Raytracing in Poser5, Part Two
Introduction
This tutorial will explain how the refraction node works in Poser5.
The reflect node is explained in "Raytracing in Poser5, Part One", as well as some information about ray trace shadows. It is highly recommended you'read the first tutorial, as some features are exactly the same for both nodes and won't be detailed here.
Step 1 - Some information on refracting
This picture is totally wrong! You only need to look through your window to see this: what you see through the window is not transformed! This is because how Poser handles refraction.
In reality, refraction effects are linked to specific volumes, and Poser has problems dealing with this. The refract node tells Poser at which index of refraction the space behind the object is. For example, with the cube above, the refract node sets the index of refraction inside the cube AND behind the cube! This, of course, makes no sense in real world physics.
To produce a realistic refraction effect with this cube in Poser, you must set different values for the faces of the cube. The faces closest to the camera must be set to the index of refraction you wish to give to the object whereas the hidden faces must be set to a value corresponding to that of the environment which surrounds the camera (1.0000 if it's in the air).
Step 2 - Setting the refract node
In order to use the refract node, you must go to the material room. Take care to plug the refract node to the Refraction_Color, and not the Refraction_Value.
Also, decrease the Diffuse_Value in order to get a better refraction.
Finally, for everything to work, remember to check the “Raytracing on” option in the render settings.
When using the refract node on a surface it's important not to add transparency effects to that same surface, otherwise the object is seen both in transparency and simultaneously refracted, causing strange effects. The refract node handles transparencies on its own.
Poser's FireFly renderer isn't designed to handle refractions from surfaces too close to the object they are refracting (such as, say, glasses placed on a figure's nose), and this produces horrible black spots on the render. Ronstuff discovered a simple solution to this problem: rescale all object to 1000% of their original size and modify the camera placement in consequence.
Step 3 - Refraction Color, Refraction Value, Background, Quality and Softness
The values in yellow react exactly the same way as for the reflect node. Instead of restating their function here, I recommend you check part one of this tutorial.
The value in blue, Index_of_Refraction, will be covered in step 5.
The settings in red, Quality and Softness, don't react the sane way as with the reflect node.
The Quality setting works more like a blur setting. But it's hard to see on objects that are simply textured. There must be a bump or displace map in order to make the effect really visible.
On the two next pictures, I put a square between the camera and the cat.
- The right side of the square is set with a Quality and Softness of zero.
- The left side of the square shows the effect (or the lack of effect) of the quality or softness settings.
The Softness setting seems to have no effect…
Step 4 - Visibility in raytrace
Step 5 - Index of Refraction
This is the really important element of the refract node. It defines how important the refraction will be. In theory, the index of refraction cannot be under 1.000 (this would mean that the light is going faster than the speed of light).
Some values:
Air 1.000
Water 1.333
Glass 1.500
Diamond 2.417
In this picture, the angle between the camera view axis and the square is 50'. When the white zone appears, it is because there is no object to refract (the background color of the refract node is used so if you set this color to red, you will have a red zone instead of this white zone). Notice that the background color of the main scene does not affect this white zone. To remove it, the refraction must find an object to refract.
Also, it is important to know that the angle at which you're looking at the object doing the refraction modifies how the appearance of the refraction effect.
Step 6 - A strange effect explained or the 'real' underwater scene
Under certain angles (and certain values of the index of refraction), you may see strange black shapes. This is due to a physical proprety of the refraction: The color of the black part is influenced by the Diffuse_Color and the Ambiant_Color of the water surface. A situation that demonstrates this strange effect occurs when you set up an underwater scene, with the camera looking upwards at a slight angle (see the picture below). To set up a similar diving scene with the camera under the water looking up at the surface, while avoiding the black shapes, there are two possibilities:
You can do it the hard way, respecting the way physics work: you can add a ball primitive over the camera. On this ball, you set an index of refraction of 1.333 with a blue refraction color and you set the index of refraction to 1.000 for the water's surface.
(A simple way to add this ball is to load the ball, parent it to the camera, set all three transX, transY et transZ to zero. You won't see the ball, because the camera is in it.).
The problem is that, on the water's surface, the displacement information is nearly completely out.
You should also take extra care as using this method may produce some strange effects, such as reflections suddenly appearing in the middle of the Water's surface (and this even without any reflection nodes). In my experience, using the “Wave Deformer” to create the waves also results in strange artifacts.
You can cheat and give the water's surface an index of refraction that is less than one. You should use 0.75 to fake the water and add some blue light(s) to make the scene a little bit more realistic.
The settings I gave here are just guidelines. You will have to adjust some other settings (Ambient color and value, Specular color, etc.) as producing an attractive scene depends on many many things. It's quite complex to achieve a really good effect and you will just have to try various values in order to find what suits your scene.
Step 7 - Reflection and refraction
In theory, every time there is refraction, there is also reflection. Basically, the sum of the Refraction_Value and the Reflection_Value should be one. A scene featuring water should include refraction and reflection, but no transparencies for the water!
The next render uses a displacement map for the water's surface, using the turbulence node.
And here is the render, with a little bit retouching - only for the colors (adding some blue)
Thanks again and again to Mark for correcting my English
You are here: start » Public » Tutorials » poser » Raytracing in Poser5, Part Two


















