faking dispersion using the new blend material

while it renders in a blitz, wrong (for what we need here), without shellac mode, right? (line before the last one in the code set to “off” )

Lele

Indeed Gijs… I tried it and it is not right.. making me question the blend material a bit. The math that you did is correct, but I wanted to do it without the shellac (additive) mode. So I figured out that each color that gets added down the line gets added at 50% of it and 50% of all the other layers combined. Makes the math more tricky but still possible. Using Vray color (float is easier on the math), I did a base of red at x4, second was green at 4x and third was blue at 2x… Seems to match… but makes actually using the blend more complicated than I hoped, and questions what I have done so far.

That’s realy clever! It took me a moment to figure out what you did, but it should indeed be mathematically correct (and working). Now I wanted to make a material that starts with violet and ends with red. in rgb values something like this:

1 0 1 violet
0 0 1 blue
0 1 1 cyan
0 1 0 green
1 1 0 yellow
1 0 0 red

After some tests it looks like this is going beyond the capabilities of the Vray blend material.

Not really, but you need to know a bit better what’s going on.

My preferred way of making a “dispersive” material is by making three ordinary glass materials (full white reflection/refraction with Fresnel and slightly different IORs), but assigning different Blend colors to them (e.g. Red and Green, or Blue and Green etc). This avoids having to do divisions and stuff.

Suppose we have Green for the first coat material, and Red for the second one.

Now, materials are calculated from bottom to top (bottom and top as in the UI). First we consider the second material with the red blend color. This means that the red component of the final result will come from that material, while the other components (green and blue) will pass through. Next, we get to the first coat material with the green blend amount. This means that the green component of the final result will come from that material, while the other components (by now only blue) will pass through. Finally we get to the base material, and we are only left with the blue component, which comes from that material.

I hope this makes sense… This scheme can also be adapted to include intermediate colors of the spectrum, if you think a bit more. E.g. if you want 4 colors in the spectrum, you can do something like this: have the bottom-most material with 50% red color; the one above it should be 100% red and 50% green, the one above it should be 100% green and 50% blue, the one above it should be the base material. It’s possible to maybe write a script for this…

Best regards,
Vlado

:shock: :roll: :?:

I guess i’ll have to finish me coffee first :stuck_out_tongue:

Lele

That must be one big coffee :smile:

hehehe, I already hoped that that sentence would trigger you :stuck_out_tongue:

Indeed using colors for the blend amount opens new possibilities. Goin to dive into this later. Thanks.

go on lele! you can do it!!!

That is, the blend colour is actually a FILTER colour?

if you want 4 colors in the spectrum, you can do something like this: have the bottom-most material with 50% red color; the one above it should be 100% red and 50% green, the one above it should be 100% green and 50% blue, the one above it should be the base material. It’s possible to maybe write a script for this…
Suppose we have 7 colours.
Is it like saying we use each colour of the spectrum to blend but , say, the red?
All at 100% value?
I managed to make it work with three, of course, and yay. looks good and that’s very scriptable.
I am missing something here…

Lele

Lele

I got some interesting results using negative colors in the vray color map as a blend. Seemed like it was additive then, rendered long too :smile:

@Gijs,

Can you repost the images from your first post in this thread? They are dead links now…

Cheers

Thanks, Cheers.

Can anyone get the dispersion to work in RC4? I’ve tried both techniques here and get really bad results.

By my figuring using the same glass material in each slot and masking by the full red or green as Vlado suggest should give you the same as you original material (giving you room then to adjust the IOR till you get nice results)

However even with the same IOR I get a very wide spread of strange flat colours. Even the material editor slot looks coloured which I would not expect.

Am I just doing it wrong or has something changed in RC4?

DaveMcD

I wouldn’t know. Apparently I am not special enough to have RC4…

I’ve never gotten it to work in RC2 though

So, as far as I see - there’s no way to make smooth transition between blend colors ?

This is what I get, of course this is not straight from max. This is a mix of five channel in post, to add glow.

Here’s my attempt :slight_smile:

Wanted to ask - is there a way to speed up vrayblend caustics ? As it totaly unusable.

You can try to use very slight refraction glossiness in the glass materials (like 0.99 or something).

Best regards,
Vlado

Already using it - 0.95

P.S. BTW - can I extract per material channel separately in one pass ? Like in mentalray. Smth like a map placed in any 3dsmax slot, that can be checked in render elements. Or for a Vray blend material - I want to save all the coat materials below base one. Not their initial state (three glass materials for my diamond mat), but the mixed one. Simple - red, green and blue (they have different IOR) materials refraction to be in separate layers in one pass. Dunno, if Material ID will work.