Jump to content

Iridescence Shader


Macha

Recommended Posts

I'm trying to make a iridescence shader.

The basic color pattern works but there are still problems with it. For example, the shader behaves differently with different lights. Not sure yet if that is a bug or correct behavior. There are also antialias issues.

Here is a viewport animation:

and here a rendered one:

The 2 pictures below show a dark line that appears when adding 2 lights. This line is also apparent in a standard shader, but much weaker. A bug or not, I don't know yet, but it would be nice to be able to control it.

The third image shows the behavior with an environment light (and slightly different settings). I suppose the shader requires a light with strong directionality, otherwise the light samples average the effect.

The forth image shows how I went about to design the shader. Green are camera direction vectors, yellow for light, and red represents the final effect.

Fifth is a render.

post-4013-12686406142_thumb.jpg

post-4013-126864063211_thumb.jpg

post-4013-126864098718_thumb.jpg

post-4013-126864122598_thumb.jpg

post-4013-126864131691_thumb.jpg

Edited by Macha
Link to comment
Share on other sites

Just for a record, if you by chance haven't seen this: http://forums.odforc...l__Iridescence. I use that code a lot in deadly need of rainbow...

Thanks, aah, but this is more of a learning-project, to see what's under the hood.

What I am looking for though is iridescent refraction. That's what I am ultimately hoping to achieve. I know I can fake it by combining a few refractions with differing refractive index for different colors. But such a discrete approach doesn't give a very good result and involves adding expensive nodes. Instead, a continuous approach would be needed but I haven't found any good references for such things yet.

Link to comment
Share on other sites

What I am looking for though is iridescent refraction. That's what I am ultimately hoping to achieve. I know I can fake it by combining a few refractions with differing refractive index for different colors. But such a discrete approach doesn't give a very good result and involves adding expensive nodes. Instead, a continuous approach would be needed but I haven't found any good references for such things yet.

Enter Mario and his glass shader odyssey.

Also his Implementing Spectral Colors in Mantra masterclass should be relevant.

eetu.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...