Add shader and multiple transparency?

Edit: I think my biggest issue was due to some clamp settings I’d forgotten about. Adding r+g+b isn’t exactly the same as using white, but it approaches it as samples increase.

I’ve been experimenting with some chromatic aberration materials and have gotten stymied by some strange behavior. I’m hoping that somebody can explain it, so I can figure out a work around.

So the basis of my CA effects has been separating R, G and B channels, running those through a BSDF of some sort, and then using add shader nodes to add them back together.

But I’ve had some weird behavior when it comes to refraction and transparency. Adding three primary colored shaders looks nothing like using one white shader.

Here’s transparency:

So I’m adding three primary colored transparency shaders over a diffuse plane and an HDRI world. I’m applying the material to a cube in the foreground and a plane in the background. As you can, where there are layers of multiple transparency, adding three primary transparents leads to less transparency than a single white transparent.

Oddly, the color of the layered transparent section, even though not black, doesn’t seem to respond to additional layers of add shaders-- even though it’s not black, layering this shader on top of each other doesn’t brighten the areas of multiple transparency:

Note that the first pic was in default color management, but I’m using raw color here to avoid any issues with tone mapping. Notice how the add shader multiplies the brightness of the single-surface shader, but doesn’t seem to have any effect on the multiple transparent layers.

I’m running into these issues with working on CA in a refraction shader, and I think it’s connected. Because my ultimate goal is refraction, I can’t just mix with white transparency on the basis of transparent depth; I need to divide my refaction into components to treat each differently, even on backfaces.

Any ideas what’s going on? Any suggested workarounds?

I am not sure what you want to archive.have you tryed to increased transparency bounces at the render settings?

If the problem is the trichromatic transparency,then try split the RGB with seperate/combine RGB converter nodes instead of add nodes.

for refraction you can use a glass bsdf shader node,for diffraction simplest solution is to combine 3 glass shader with red,green,blue each and slightly different IORs.

usally black transparent objects apearring, if the transparent bounces set to low in the render settings.

Yeah, I’m using plenty. Doesn’t matter. Same for enabling/disabling caustics, doesn’t matter, bad no matter which way.

My goal is trichromatic refraction, at different IORs or normals (different normals looks better on my glossy versions than different IORs fed into Fresnel.)

I’d like to handle my refraction separately from my glossy, but the glass shader has the same issue anyways. Adding from three different channels gives bad output. Here’s a 1.0 IOR glass shader, fed either by separate RGB shaders or by a single white channel:

You still see the problem as you increase the IOR, but it’s most noticeable at IOR 1.0, where refraction should equal transparency (and is, as a single white shader, but isn’t, as the addition of three primary color shaders.)

your IOR settings seems to low.

here a quick example

That’s an artifact of Cycles… An IOR of 1.0 should act like the transparency shader, but at some strange situations ([geometric normals vs smooth normals vs textured normals] at high glanced hits ) are simply discarded. Probably an artifact of the bsdf function itself, but it should be checked (perhaps report it as a bug).

i have tested ,and yes i see these edges,you can try with lightpath to mask it out,like this.

Thanks for help all. The biggest problem, it turned out, was that I was using some clamp settings that I’d forgotten about. Not sure if there are any remaining issues-- as samples increase, adding r+g+b seems to approach using white. So I think I’m okay with it.

here a new setup,with greather than, you can control at how many ray depth you want transparency.I am sure there is a better way.