VrayDirt and local rotations

Hi, is it possible to rotate the bias of a VRayDirt map with the object as I want to use directional streaks on a vehicle? Or is there a material node trick to making it lock with an arbitrary object, like ‘reference to another node’ does with vraytriplanars? Rich dirt has a rotation option but I’m liking the results I’m getting with VrayDirt better. Thank you

I’m not exactly sure if you can do this. I tried a script where the rotation of an object is taken and used as a bias, but to no avail since the Bias is using Normal coordinates. I’ll ask somebody more competent in MaxScript, maybe there is a way.

Thanks for the update Aleksandar, thanks for looking into it.

It seems writing a script for it would be far too complex. The easiest solution is to unwrap the object and bake the VRayDirt map in a VRayExtraTexMap.

Hi Aleksandar, unfortunately that’s not really the best solution since it defeats the advantages of procedural texturing, having to bake all of the textures on all of the objects. Simplest solution for me is to switch back to RichDirt which does work with rotations, but it’s a shame because VRayDirt gives me a better result. Maybe one day the developers can implement something similar to the "Space - local object’ like VRayTriplanars do? Thanks for investigating.

I haven’t tried it at all, but I wonder if there is some xref scene way of doing this. With the object rotated in the xref’d scene. So it’s on the cardinal axis in the xref’d scene and then rotated to the desired angle in the rendered scene. I don’t think that would work, though. Maybe VRayProxy/vrmesh?

Just the dirts, so a) they stick to the node’s transform and b) don’t cost compute time for each frame.
Unfortunately doing this via scripting would be quite messy (callbacks, referencing various maps in different places, and so on.), so it’d have to come from the devs, which are however quite busy atm.

Hey Joelaff, that almost works! Making it an xref does work BUT only if I turn blur off on the streaks. If I leave blur on then it goes back to world space but if i turn it off it stays in local. Sadly you don’t get those lovely concentrations nearer the contact points but if I use a triplanar in local mode with a streaks texture it look pretty good. So thanks for suggesting it!

Pretty cool. Did you try vrmesh ? I wonder if that would work. I bet it is the same, though.

Of course if you have just one object that needs this you could rotate your entire scene…

@dean_yurke Just so you know, I’ve logged an improvement request (internal bug-tracker id: VMAX-12000) to implement a “Rotate with Object space” option to VRayDirt.

Currently I’m binding the xref scene (containing all the objects) to a dummy helper and animating that in a master scene. I’ll try a xref objects next and see if that’ll work too, But the master xref with binding works in the meantime (besides not being able to blur). Thanks again for pointing me in the xref direction!

Fantastic Aleksandar!!! Thanks for adding it to the list.

Hi Lele, I’m now doing this with Bake to Texture as you suggested. I’m attaching all of the static objects in my vehicle as sub objects so it’s all one poly, and then using multiple vray dirts with composite maps until I get my desired look. Then I bake the VrayDiffuseFilter map of the entire model and use that bitmap for the diffuse on a simple vraymtl then swap the materials. When I want to adjust the vraydirt, I just switch back to the complex version and repeat when I’m ready to render.

Like you said it’s much faster to render and it means I can use the streaks blur too, but the biggest reason I’m doing it this is because when I use VrayDirt (and Rich dirt does this too) on an object which is an xref which I then bind and animate the rotations, after a few frames the object’s animation goes haywire. It only happens if object motionblur is enabled too, weird city.

At least this way (bake to texture) I probably have a way more efficient overall pipeline so I guess all’s well that ends well. Thanks!

Dean, nice to hear you’re finding at least some respite from your woes.
I realised late my suggestion was indeed too simplistic to cover all bases (you could have parameters in the dirt animated based on something else entirely in your scenes, or zoom in so much that a texture would be pixelated), but i thought i’d leave it in the hat regardless.
We have asked the devs for the change, and they’ll be sure to implement it (it’s also quite elegant an approach), but it will surely take some time.

There is also a way to do this that i didn’t think of initially, which you may be able to request to your TDs: writing a simple scripted plugin of the vrayDirt map.
Essentially, the UI would stay the same, the only thing to add would be an extra rollout with the node picker.
Once the node is picked, it’s trivial to refresh it (instead of checking the map against its references, wherever they may be in a complex scene), and it shouldn’t impact scene speed at all.
I say this should be done by your TDs because it’d then be a plugin (albeit written in maxscript) to be deployed wherever one needed it (individual workstation, slaves), and it’d have a name which wouldn’t be “vrayDirt” (as that’s already taken), so there are things you may want to discuss while implementing it.