Unexpected "color" transition in half transparent cylinder with Cycles I try to represent red and blue spheres moving in a tube, and render it with Cycles. I made a part of the tube opaque and another part semi-transparent following the "color based on height" trick. I get the following result, but I am anoyed by the color transition that takes place at the third sphere (from the bottom right). It does not seem to depend on the orientation of the sun.
 

I built a minimal working example, with a half-transparent cylinder and got the same effect. The corresponding Blender file can be found here. The effect is not present if the cylinder is opaque.


Do you have any idea where this effect come from and how can I avoid it?
It seems that the reason of this shading 'glitch' is topology of your Cylinder. I don't know exactly why this is happening, maybe because of stretched faces (or for sure). When you scale it down on the X axis (to make it shorter) problem disappears.



You have two options:


Add Subdivision Surface modifier.





Add Loop Cut in the middle of the Cylinder (or couple of them to be sure that it doesn't happen again.




Personally I would go with second one as this is 'lighter' solution.