27
$\begingroup$

I'm trying to achieve the effect where a beam of light sent through a prism or other refractive object, separates out into the light spectrum. (See image below)

enter image description here

This effect is especially useful to have when modeling gemstones, since the 'sparkle' of colors produced by this effect adds a lot of realism to the model.

It does not seem possible to get Cycles to produce this effect, since Cycles handles each ray of light as only a single, one-colored ray. Is there any way to coax Cycles (or any other render engine) into treating light as a full spectrum? Is this kind of treatment of light even possible in Blender?

$\endgroup$
  • $\begingroup$ I was about to ask this question myself, after looking all over for good techniques to get this effect.. :D $\endgroup$ – gandalf3 Jul 2 '13 at 19:45
  • $\begingroup$ There's a new Add-on "Prism" which should help you achieve exactly this effect. $\endgroup$ – Samoth Mar 21 '16 at 19:58
16
$\begingroup$

It is fake-able to some extent in cycles, see some of these results:

http://www.blendernation.com/2012/04/05/cycles-diamond-dispersion/

http://www.blendernation.com/2012/09/04/cycles-dispersion-glass-shader/

One technique I know of is to use multiple Glass shaders with different IOR values

A quick setup:

enter image description here

Low sample result:
enter image description here
(Not that great, but the closest method I know of..)

Luxrender is an open source unbiased bi-directional rendering engine with blender integration and is capable of this. (there is also a related project called Luxrays trying to get Luxrender fully integrated with the GPU)

Some examples:

http://mitsuma.deviantart.com/art/LuxRender-Prism-198927185

https://www.youtube.com/watch?feature=player_detailpage&v=kIX5WL07Uss#t=15s

SmallLuxGPU example (Luxrays)
https://www.youtube.com/watch?feature=player_detailpage&v=jk-N4f9ze4k#t=82s

Yafaray is another open source render engine with blender integration that supports both biased and unbiased techniques, and also seems to handle this well.
http://www.youtube.com/watch?v=RVHYMq8NEEs

$\endgroup$
  • 1
    $\begingroup$ Just a note, since Cycles' caustics are still not very good, if you use that Cycles material setup in a low-light setting you end up needing about 10,000 samples to see anything reasonable. I ended up going with Luxrender for that reason, and I've gotten great results, thank you! $\endgroup$ – Gwen Jul 9 '13 at 1:46
2
$\begingroup$

Cycles only shoots rays from the camera:

diagram of the ray path
(source: blender.org)

For dispersion, support for bidirectional path tracing needs to be added. This is currently considered a low priority. There has been a community effort to get an additional developer to implement it.

$\endgroup$
  • 3
    $\begingroup$ Having myself written a unidirectional forward pathtracer supporting dispersion, I can say that requiring BDPT is incorrect. $\endgroup$ – imallett Nov 16 '14 at 23:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.