colour by light direction/intensity

hello,

i am wondering if it is possible to have a colour ramp driven by light direction / intensity on a vray material? A bit like the old maya ramp shader where you can choose light angle to drive a ramp.

Thanks in advance

Matt

We actually support maya’s ramp shader. Won’t it work for your case?

Hi,

I’m trying to create a pearlescent car paint material using Vray Stochastic flakes. I have a photo of the paint as reference. I just cant get it to match very well, The actual paint seems to change colour dependent on light direction and intensity. I dont think maya ramp shader is going to help

thanks

Matt

I think the flakes themselves should do the trick, isn’t that what happens with real carpaint? The color change is actually because of the flakes being hit by light at a different angle (at least I think so, hope I’m not wrong). In this case, try going with a high number of colored flakes - there’s options to randomize the flake color. Just a thought.

Thanks ill try that and report back.

No luck, i dont think it is possible with vray, reading up on pearlescent paint. Maybe a dev can chime in and confirm?

What are you looking to get out of V-Ray? Any references?

I’m fairly certain that the color of pearlescent paint depends on the viewing angle, not the angle of the light to the material. You can use a VRayFalloff node or the facing ratio output from a samplerInfo node as the input to your color ramp.

It will be hard to make it work with light angles, yes, but with viewing angles it’s easier. There’s the sampler info, there’s the vrayFalloff that has some built-in modes that can be used separately from the samplerInfo, and there might be more available solutions. But as I said, it would all depend on what the end goal is :slight_smile: So a reference is good to have in this case.

yes here you go,

note the shift in hue on the paint work relative to light direction

Ah, that sheds some more light onto the subject (pun intended) :slight_smile:

See if this setup will be useful to you: see the attached file.

I’ve done a pretty quick and for the most part inaccurate setup, but it all boils down to using vrayFalloff texture in “distance blend” mode, where the direction is set to “explicit direction”, where I’ve connected a light’s worldPosition. Basically moving the light should blend the two colors respectively. The concept of the setup can be expanded a lot. Hope it helps.
Of course, you can use any dummy object as the “explicit direction origin” and not rely on the light’s position itself (I would personally set it up like that).
falloff_explicitDir_from_lightPos.zip (10.6 KB)

yes im aware of v sampler info and facing ratios etc but this is not the look i am after. i would like to get as close to clients reference shots of the car as possible out of the render after all this is what they will be comparing me with.

FYI My light setup is just a hdri, originally i was using a couple of stochastic flake materials and a lacquer in a blend material, but doing it this way there was no way to control the shift in hue relative to light direction and intensity. I have managed to get closer to their material by using a maya ramp shader as the base material and driving the diffuse with the light angle, this works pretty well . but my blend material is a dirty hack with lots of ‘un physically correct’ layers on top of each other as Additive.

i love a pun!

oh and thanks for the attachment, ill try it now and report back

Hi Yolov,

when i render your scene from the perspective view i just get an orange ball, what values did you set your near and far to on distance blend mode?

Also what was your reasons for using distance blend?

If i switch to towards away i get something that looks quite usefull

thanks

Matt

I’m using a newer build than yours and we did some changes to the falloff tex, that might explain any differences.

Basically here’s what the result should be:

I’m using the “distance blend”, because it gives me control over where exactly the blend should be, but you can use any other mode and just set the “falloff direction” to “explicit dir” so you can connect another node (such as the light). The explict dir is the key to the setup actually, not the falloff type.

I’ll see if I can match the setup for 3.6 and upload another example.

Here’s a version that should work with 3.60.02:
falloff_explicitDir_from_lightPos_vray36002.zip (13.5 KB)

just for the record, I’m 90% sure this is just the orange color being brightened up by the metallic highlight along the side of the car, combined with some photo retouching. Try rendering a generic metallic orange sphere with a super bright keylight, you’ll find the same hue shift happening around the highlight.

Of course that is completely irrelevant since you’re just trying to match reference for a client.

Thanks for the input, if i use a really bright light source enough to burn the highlight to get a hue shift then it throws all my other materials out, so im not sure this is a correct interpretation of the reference shown.