12
$\begingroup$

For instance, is it possible to simulate effects such as heat haze or other kinds of mirages which are caused by air with differing/changing refractive indexes?

Plugging a procedural texture into the IOR input gets pretty close, but the IOR is only being changed at the object's surface (this is to be expected, since the refraction node is plugged into the surface output).

For example, with this scene:

enter image description here

Connecting only the volume scatter node proves that the gradient sphere is in the center of the cube:

enter image description here

If you connect the refraction node, you might expect to see some distortion in the center where the gradient texture is. However, since the gradient is completely inside the cube, there is no evidence of the gradient on the surface, and the IOR is not changed.

enter image description here

Plugging the refraction node into the volume output does not seem to be supported yet; the output is completely transparent.

Is it possible to change the IOR of the inside of an object in cycles like this?
If not, is there any way to simulate these kinds of atmospheric effects in cycles?


I would share the .blend, but pasteall is acting up atm..

Related: Is it possible to render other materials besides volumes using a procidural texture to define "density"?

$\endgroup$
2
$\begingroup$

I'm working on a project faking the atmospheric disturbances that bother anyone using a telescope. This is the sort of distortion that adaptive optics systems compensate for. It is not much different from heat haze.

I accomplished this with a plane placed between the camera and a "far away" starry image on another plane. I gave the plane a Refraction shader (using Cycles), a small IOR maybe 1.02 or something like that, and a Noise or Wave texture and a Bump node to supply a normal vector to the shader. I animated this by adding a linear increasing value to the x coordinate of the vector given to the texture. The normal vectors have to be kept close to the usual perpendicular direction - just small wobbles. At least for my setup.

There are actually four of these wobbled-normal planes. Two have normals up, and the other two have normals down. Not sure that's necessary, but I figured it would help make things messier. The texture animations and texture scales are all different, with all roughly a tenth of a wavelength to one wavelength spanning the view. enter image description here The bottom layer is an astronomical image - but for a hot desert scene, it could be distant mountains roads and buildings. (There's another layer just above it for another special effect unrelated to this question.)

I have not tried modulating the IOR value of the Refraction node. If the IOR were to vary spatially or with time, the effect would be similar to varying the amount of wobble of the normal vectors. Either way, I expect rendering to go much faster than any attempt to do volume interactions of any kind.

In my case, the wobbling-normal planes are sized to be larger than the camera's field of view. In case only part of the scene needs the effect, a mask image could be used to switch between the wobbling-normal Refraction shader, and a plain Transparent one.

$\endgroup$

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.