| ||
To make realistic refractive objects, you have to understand how Lightwave handles refraction. As a light ray bounces around in your scene, Lightwave keeps track of the refractive index of the medium that the ray is currently in. The ray starts out in air, with a refractive index of 1. Every time it hits a transparent polygon, it is bent according to the ratio of the current index to the new index by Snell's Law. The current index is set to the new index and the ray keeps going. Now let's think about what happens in "real life". A light ray starts out in air (index = 1) and hits the glass jug (index = 1.52). This bends the ray. Then it travels through the glass to the other side, back out into air (index = 1). This bends the ray again. So, to simulate this, the ray needs to hit polygons going in (glass) and polygons going out (air). SUMMARY: We need glass polygons facing out, and air polygons facing in. | ||
An easy way to make the air polys is to copy the glass polys and flip them. However, under certain conditions this can cause problems in ray-traced shadows and reflections of the glass object. See Bad Glass and Coplanar Polygons. It's come to my attention that NewTek has acknowledged this problem and will fix it soon. Then you won't have to worry about smooth shifting, and refrciton will be more realistic. |
|
I'll give the same advice for refractive objects that I do for reflective
objects: If you want refractive objects to look real, you have to give them
something to refract! Build a set. Have lots of lights, with light fixtures,
walls, a floor and a cieling and stuff. For some excellent tips on great lighting by Andrew Weiler, visit here. When you've got that all built and
lit properly and you're ready to render that sucker, remember to have TRACE
SHADOWS, TRACE REFLECTIONS and TRACE REFRACTIONS all turned ON. |
|
![]() Now I'll introduce my happy plug-in called GThick, which lets you add realistic opacity to your refractive objects. You can download it here. Here's how to work it: Build and set up your glass object exactly as described in this tutorial. Write down the color and diffuse of your "glass" surface, and make the "air" surface the same color and diffuse. Change the transparency of your "glass" surface to 100%. My plug-in will take care of the transparency. Change the transparency of your "air" surface to something less than 100%, like 70% or 90%. This tells my plug-in how transparent to make the glass. Apply the GThick plug-in to the "air" surface. Not the "glass" surface, but the "air" surface. This is so my plug-in can tell how far the light ray travelled through the glass. Now, play with the "transparency unit" option to match the scale of your object. The default of 500 units / meter is good for small (bottle-sized) objects. Generally, bigger objects need smaller numbers, and smaller objects need bigger numbers. The larger the number, the more the thickness affects the opacity. By the way, the color of the glass is now controlled completely from the "air" surface. The "glass" surface is only useful for outer stuff, like specularity, reflectivity, and bump-maps. Remember to apply the same bump-maps to the "air" as to the "glass"! You may also want to add a little luminosity to your "air" surface to simulate light diffusing around inside the glass. Finally, if you have any troubles, just e-mail me! |