Three channels glass

On the left side of the image,i have made a glass shader, adding three glass shaders with red,green and blue colors.
On the right side there is the default glass shader.
With 3 separeted channels ,in theory,adding the 3 shaders should be physically correct, but the result is
two different images.
Can anyone explain to me why?


add shader does add and output can get greater then 1
so it won’t be physically correct !

happy cl

But the 3 channels are distinct R (1,0,0,) G (0,1,0) B (0,0,1) so there should be no interference,i think !
Is there another way to obtain the same result of the default shader with 3 separated channels?

that looks so wrong, what are even trying to do? cant all that adding take place in the color and texture stage? glass shaders are heavily optimized. what your trying to do may only work with emission shaders, maybe diffuse.

add shaders not only add the colors, but the calculated lighting too. say you added two transparent white shaders, the result would be anything behind it being double bright.

Ok thanks for the answer

I believe you’re trying to do something like the “Fake Dispersion Glass” but you’re missing a few key elements.
First, you have to split an input color into RGB rather than using straight R G and B colored glass.
Second, each color has to have a slightly different IOR to create the dispersion effect.

It should work as expected, seems like some samples are killed or clamped due to some render setting. Explicitly splitting color components and adding them together again must give expected result without generating additional light or losing it. If it does not, something is wrong.

I agree with kesonmis, in theory they should produce the identical result. I believe the glass shader is optimized though, so it may perform some tricks. Does something else happen if IOR is just so slightly changed, or if you reproduce glass from refraction and glossy (via fresnel)? Maybe this slightly weird setup requires more bounces to produce equal result? Hard to tell. But yeah, should produce equal result unless I’m missing something.

Technically, this should work, too, but it clearly doesn’t.




I have tried a new combination with add shaders again.
The fresnel value R is the fraction of light that is reflected and T = 1 - R is the fraction that is refracted (if there is no absorption).
So R is the glossy color ,T is the refraction color and R + T =1 .This should imply that in this case that add shader could work.
In this image the first glass is the default cycles glass,the second glass is the result of the nodes.
They seem almost identical.
Maybe this could be the base to modify the R G B channels with different indices of refraction.


Ehm, what you have there is just glass recontructed, and fresnel driving mix node (rather than color) should produce the same result. Doesn’t seem to have anything to do with original post.

@Roken: Why would you expect that to work? For each mix shader the color component is reduced producing 1/3 of the desired brightness.

For some reason - Blender doesnt like it if the roughness is zero when you add glass shaders.

These renders have the same node setup as the OP (split RGB nodes on the left - pure glass on the right). The first render has roughness = 0.000, Second roughness is 0.001



You’re right @CarlG :yes: I went off topic.
Yes @moony,i didn’t know. I’ve found that with my original configuration of nodes and with different ior for R G B, the result is dark even if roughness is 0.001.This works if ior is the same for R G B.Thank you anyway,this could be a bug in blender cycles :confused:,boh!
I have made a node group for glass with inputs 3 indeces of refraction (R G B) and ray depth to set a maximum number
of bounces for light path node.
I did it to attenuate the effect of total internal reflection (dark areas),with transparent color white.
High ray depth means dark areas,low ray depth means whitish areas.
The color of the glass is white by default for now.
I have separated refraction and glossy shaders for red green and blue because this could be useful to insert a
nodegroup for absorption giving different colors.
These are the main nodegroup and what there is inside.At the end of the post i enclose blend file.



Examples:


This is the blend file:

Attachments

rgbglass0.blend (3.09 MB)

I was modifying blend file to include absorption and i’ve found one error.
So when i’ll resolve the problem, i’ll post my solution. Thanx

Maybe this could be a possible solution for the three channels glass (r g b)
The first glass is the default glass,the second is the new glass with distinct red/green/blue channels.I think they are very similar and maybe acceptable .And then a colored suzanne.
I enclose the blend file.Inside i’ve tried to add absorption,tanslucency,dispersion and caustic.
The nodegroups must be completed and reorganized.
I must do many tests and renders.


Attachments

glasstest.zip (882 KB)