vrmeshs (aka proxy)


Briefly: You know the principle of texture tiling? (No? Hop! Hop! Hop! (french) :Nannan: ) Well, principle is the same, but for geometry: Vrmesh are "ready to raycast" meshes. Geometry is stored in a grid (voxel).

So you only load necessary "box" to render. Your vrmesh can be huge, only the elements necessary for the calculation will be loaded/unloaded on the fly. As well as tiled maps, this increase your disk IO but gives you great flexibility.

Don't be afraid because of the size, vrmesh are done for! :D


Let's do simple, here is a scene with to 24 frame animation cycles:


You can't see it but they are walking! :onSeFendLaPoire:

At this step, principle is to assign, to each "shader group", an ordinary shader (lambert is fine). Name is the importante part because it will be stored in the vrmesh with it assigned faces:


"lambert5" should have been "arms" but I've completely missed it. :baffed:

Even though this is not required, try to keep coherence in names between all your objects. So, if you have characters crowd to export. Assign them all shaders "arm", "corp", "head", "Hair", "tenuHaut", "tenuBas", etc ... With a bit of script, you will save time later.

Select mesh group you want to export:


Then go in Create/V-Ray/Create proxy:


You will have a horrible quite sober interface:


Select Export animation. If your mesh is animated and you plan to use motion blur on your final render, select Export velocity. The two values will create the interval to calculate direction vectors to be stored in the vertices. VRay will calculate the motion blur geometry from this informations. Be careful on this interval. You can expect some (bad) surprises. If you don't go with motion blur, deselect this option. This will store less information in the geometry.

In my case I also select Use playback range but advise accordingly to your case. :reflechi:

With Face in preview, Chaos Group provide us what look like a small and trivial feature but very interesting in practice: The idea is to save n face indices that will be displayed in the viewport later.

When doing proxy, mainly to lighten a scene, we often have to manage large bouding box. Depending on the pipeline, you may even have a proxy made by another department. Here, Chaos Group guys had a very interesting reflection: "Why not make a cool proxy corresponding to the real geometry?". The bet is entirely successful, you will see that later. :)

If you want to import directly the newly created proxy, you can select Automatically create proxies.

For the rest, I strongly advise you to read the documentation.

Once that's done, click on Create Proxy!

Proceed this steps for every characters you want to export.


To import all this:






And now our 100 faces per object. Slap it right? :aupoil:

Seriously, you can import hundreds of them, your viewport does not flinch. In addition, these proxies correspond to the final model. This approximation should less bother you than a low model or worse, a bounding box.

Now let's look at this options:


If we select Bounding box:


For nostalgic. :trollface:

If you are not satisfied with the approximation, Chaos Group has got you covered: Show whole mesh:


Other options are more specific. I will not go into detail. If you're interested: :RTFM:.

Just notice animation speed is customisable (anim is possible too! :gniarkgniark: ) and that in our case (and most cases) it's Loop.

Go tabs on the right. VRay has already connected a shader and...


Oh miracle! Our slots are there! :laClasse:

You will just have to drag and drop shaders to use.

Note that trying too hard to be nice, VRay create a shader for each imported vrmesh. But if you import twice the same vrmesh, you will have two similar shaders. Don't hesitate to remove one and apply a single shader for each vrmesh "source".

Now let's get serious! :enerve:

User Attributes

Select the transform node of one vrmesh you have and add User attributes:


In these User attributes (lost at the bottom of your Attribute Editor) add the following:



There, you should begin to understand. :siffle:

On the second, create a similar value:


Now create a shader, a blinn in my example (Yes, I know it's bad). Give it a clear name (it will quickly become a mess in your connections so it's up to you :redface: ):


Add a VRayUserColor node then enter your attribute value:



Set the default color you want. It will be the color used if User Attribute is not present/valid.

You have some syntax examples just below the node (another good idea).

Connect this node to the color attribute of your shader (it's a shame the default color is not used in the hypershade, it would be a nicer than a black hole).


Connect your shader to both VRayMeshMaterial, in the "casquette" slot:



Then render:


Victory song (to listen with :smileFou: )

Do the same for all shaders (except "corp" that we keep for after :jdicajdirien: ):



Well, those are for colors. You can do the same with VRayUserScalar and floatting point value.

Now we start the body ("corp"):


Just a file node.

Supposing you have four textures:

  • checker_default.png
  • checker_four.png
  • checker_etc.png

The only variable in your texture is located at the end (and, why not, in the path).

Put this in your file path:


Then apply this variable to your different User Attributes:





Once again?

And if we have no limit: user_attr_vray_031.png


If you often do crowds, you should seriously consider this solution.


I think, as mental ray User Data, it's a bit cumbersome to deal with. But if you or your colleague is scripter, it is not too difficult to put it up on a production.

I breath the poppy it may (this is unconfirmed so take with a grain of salt) Deex (whom I thank for making me discover VRay) integrates a simple way to deal with them in Arsenal (but dont be too hasty :sourit: ).


I hope this tutorial will help you in your productions.

See you!