|
![](/i/fill.gif) |
> I am trying to create a simple scene that has a semi-transparent triangular
> prism with a white light entering on one side and a rainbow exiting on the
> other, similar to
> http://en.wikipedia.org/wiki/File:Dispersive_Prism_Illustration_by_Spigget.jpg
>
> I was thinking about just using a gradient and a color map to build the rainbow
> but every time I tried the gradient would be small and repeat, so it was like 5
> or 6 repeating rainbows. I then tried the actual rainbow structure but couldn't
> get it straight and triangular like the dispersion from a prism. Any idea on how
> to go about this?
>
>
You need to enable photons maping.
global_settings{photons{spacing 0.01 autostop 0}}
or
global_settings{photons{count 1000000 autostop 0}}
This turns on photons emission for all lights except for shadowless ones.
Then, you need to add the followings to your prism:
"interior{ior 1.5 dispersion 1.03}"
"ior"1.5 make the prism actualy refract light, here, with a median value
for glass.
dispersion 1.03 turn on the chromatic dispersion. The given value is
relatively strong.
In the interior block, you can add dispersion_samples 12 (or more) to
get smoother results.
"photons{target refraction on reflection on}"
This enable shooting photons at the object.
"reflection on" is optional in this particular case.
"refraction on" is needed to enable the prism to bend light.
To get exactly the same result, you also need to add some reflection to
your prism:
"finish{reflection{0.01 1 fresnel}conserve_energy}"
With "reflection on" in the photons block of the prism.
If you look the documentations about photons, there is mention of a
photons block for light_source. This block is optional and have the
following default values:
photons{refraction on reflection on area_light off}
Alain
Post a reply to this message
|
![](/i/fill.gif) |