Saturday, October 13, 2012

VRayDistanceTex

First of all I really can't claim credit for this technique.  I got the idea from Bertrand Benoit's post on Two-Tone Trees (link).  More specifically I got the idea of using VRayDistanceTex to drive two-tone from a comment on BB's page by Mark Whelan.  Pure genius, thank you Mark and BB!

So basically what VRayDistanceTex does is say your have a 'Far Texture' and a 'Near Texture.'  Then you choose what object(s) you want to drive this distance and set a distance parameter (4' for example.)  So what I did is use a giant invisible (non-rendering but visible in viewport) sphere as my 'object.'  Then I assigned the VRay2Sided mat to my tree.  The diffuse was what is driven by VRayDistanceTex.  I've attached a material screenshot below along with some quick, sample renders.  Not the best tree but you get the idea.  It's based off a GrowFX sample with my own custom leaf material.

One nice thing about this technique is that its a super smooth gradient, so you actually get like 3 tones or more, depending on how different your two defined tones are.  I'm just struggling to define the falloff from the object, though.  There aren't that many parameters with VRayDistanceTex (just 'Distance' which is a number, not a map or anything) and I would have expected to see some kind of a graph or gradient to control the strength of the object as you get further away.  If you have ideas on this please comment!

Anyway, definitely check out BB's blog post on this, though, because he shows a totally different, more precise way of controlling color tone using the Vertexpaint modifier.

I could see using this in lots of ways...leafless branches, dead pine needles, things like that.  Fun!

Nice red's and yellows

Different lighting and tones...getting some green






Also this isn't using VRayDistanceTex, but its a closeup of the material that I thought I'd share: