A complex approach - Iridescence in cycles

I didn’t detail read any of the blends/materials, but I got the impression that none of this is based on light position? I read hard coded and so on a couple of places. Is this useful in your ventures?



The red node is the key to the trick, where you just select the light. Obviously you would have to add the effect to work on all lights you want it to consider (may get ridiculous in complex lit scenes), rather than on a material basis as it should be (but impossible due lacking closure, if I got all that correctly :)).

I’m not good with maths, but I think the diffuse shading is about right, with some crazy ramp going on. If you mute the blue node, you cancel the absolute of the dot, and allows shading effects also on the backside (could be valid for soap bubbles and so on). You could even link to an empty in the general direction of a HDRI sunlight, but do not do the inverse square then :slight_smile: With light position obtained from scene data, one could also easily, for those with better math skills than me, do half angle based stuff like phong (reflections).

Don’t mind what’s going on in the right top section, that’s just me having fun :smiley: But I think you see the idea.

I don’t know if this is useful at all. Thought I should just mention it.