Chaos Corona Forum

Chaos Corona for 3ds Max => [Max] Tutorials & Guides => Topic started by: borisquezadaa on 2014-03-18, 04:43:16

Title: Realistically fake refractive dispersion caustics
Post by: borisquezadaa on 2014-03-18, 04:43:16
I just want to share an aproach to Realistically "FAKE" dispersion in a refractive material.

Since Corona A5 does not have a dispersion setting and i needed to have a diamond, came up with this idea.

The post render tab in corona allows to save green, red or blue channel of a render, so in order to fake diamond refraction one just need to find the refrection index of diamond for determined color.

This page shows the index of refraction as a curve and can show you the IOR for determined wavelength. http://refractiveindex.info/?shelf=3d&book=crystals&page=diamond (http://refractiveindex.info/?shelf=3d&book=crystals&page=diamond)
I use diamond specs but it could be applied to any refractive material.

So we need to find the aprox equivalence between wavelength and RGB color... (remember this is a fake, but a very informed one... XD). This place has something one could use http://academo.org/demos/wavelength-to-colour-relationship/ (http://academo.org/demos/wavelength-to-colour-relationship/)

For red (255,0,0) = 658nm that gives us a IOR of: 2.40975
For green (0,255,0) = 510nm that gives us a IOR of: 2.43024
For blue (0,0,255) = 440nm that gives us a IOR of: 2.44856

So we create 3 materials each with diferent IOR as stated, then render just saving the channel for that IOR color.For  example, apply the first material with IOR 2.40975 and save the image but just the red channel (set appropiate numbers in post tab of corona red:1 green:0 blue:0).

Do that for each Material saving the correspondent color channel for that ior.


The next step is open the 3 images in photoshop as layers and set the layer as Linear dodge (ADD) to get the composite of the 3 wavelengths.

And there you have it. A really convincent fake dispersion for a diamond render or any refractive material.

Here can have the test scene used in max 2014 and corona A5 and the composite in photoshop, and the final image as shown.

By the way the scene is illuminated just with CoronaSun and sky only. But i Guess works with hdrs or custom illumination as well.

Title: Re: Realistically fake refractive dispersion caustics
Post by: Alessandro on 2014-03-18, 09:50:26
Curious approach to solve this problem, but the result seems to be realistic, thx for sharing!
Title: Re: Realistically fake refractive dispersion caustics
Post by: Ondra on 2014-03-18, 10:17:49
actually you just invented spectral rendering in Corona :D
Title: Re: Realistically fake refractive dispersion caustics
Post by: Utroll on 2014-03-18, 17:19:35
Can you say fake when you're just bypassing a limitation...
It's like rendering 4 slices 8000px wide and pretend you did a FAKE 32k wide rendering after stitching.
Your 'fake' is fake :D

Thanks for the tricks (maths)
Title: Re: Realistically fake refractive dispersion caustics
Post by: laurenth on 2016-07-27, 09:38:04
Now that the layered materials are quicker you can actually compose all the differents IOR in a blend material with R G and B refraction colors and each blended material to 33,3333 blend amount and it renders pretty quickly. I'm not sure how big of an issue it is that 33,3333 is not exactly 100/3 for the blend, but it gives devent results.
Title: Re: Realistically fake refractive dispersion caustics
Post by: maru on 2016-07-27, 16:48:32
Now that the layered materials are quicker you can actually compose all the differents IOR in a blend material with R G and B refraction colors and each blended material to 33,3333 blend amount and it renders pretty quickly. I'm not sure how big of an issue it is that 33,3333 is not exactly 100/3 for the blend, but it gives devent results.
Most probably you will end up with wrong IOR/other problems when mixing refractive materials. The problem is acknowledged and listed here:
https://coronarenderer.freshdesk.com/support/solutions/articles/5000516180-known-bugs-and-limitations
Title: Re: Realistically fake refractive dispersion caustics
Post by: borisquezadaa on 2017-09-28, 16:37:20
Now there is dispersion in corona so forget about this old thread. XD.
Great work as usual guys!
Title: Re: Realistically fake refractive dispersion caustics
Post by: maru on 2017-09-28, 17:19:06
And soon[tm] we will have proper caustics! https://trello.com/b/EfPE4kPx/corona-road-map-3ds-max
Title: Re: Realistically fake refractive dispersion caustics
Post by: snakebox on 2017-10-04, 08:27:09
And soon[tm] we will have proper caustics! https://trello.com/b/EfPE4kPx/corona-road-map-3ds-max

Not so soon anymore, looks like it has been moved to maybe 1.9 ? :/