« Reminder: Frappr | Main | The Number Spiral »

More on glass buttons

RenderI decided to waste some more time tonight so I found an old friend of mine on the Internet, the Perspective of Vision Raytracer, and got to work on creating a glass button.

I was curious about which object and lighting properties produced the kinds of effects I was reproducing artificially in the lab.

What I found was that it was very difficult to get the effects I was looking for, even after I seemed to understand how the POV-Ray script language worked. What you see to the left is what I’ll call the best image that I produced. Every aspect of that image is deliberate and it took me hours to figure out how to create it.

Render2aEven so, it still appears slightly fake but I had to stop the madness before it consumed me further. Notice that the side view to the right shows the true shape of the object. It’s kind of a flattened sphere. Actually, that’s exactly what it is.

The Jade enclosure is an object created by Constructive Solid Geometry and it’s basically another squished sphere but half of it is eaten by a box via the difference statement.

difference {
    sphere {
        <0,0,0> 2.5
        texture { Jade} // color and clearness
        scale <0.9,1,0.4>
    }
    box {
        <-3,-3,0>,  // Near lower left corner
        <3,3,-3>   // Far upper right corner
        pigment {color White transmit 1} // color and clearness
    }
}

The actual “jewel” is simply a red sphere that transmits 60% light, has an index of refraction of 1.4 and has 30% reflectivity. There are a few other properties such as specular lighting which give it that nice highlight that you see. Some of the other properties are even more subtle. Here is he jewel markup:

sphere {
    <0,0,0> 2
    pigment {color Red transmit 0.6} // color and clearness
    finish {
        diffuse 0.9
        ambient 0.0
        specular 0.4
        reflection { 
            .3
        }
    }
    interior {
        ior 1.4 // refractive with light interaction
        fade_distance 5 fade_power 1
    }
    scale <0.9,1,0.4>
}

Now, let’s say I wanted to try and reproduce the Adobe Illustrator glass button I created in my previous post.

After a while, I realize that the effect of the Illustrator button seems to imply that there are two light sources. I couldn’t seem to get even close any other way.

In addition, the solid white border is very difficult to achieve. If the butt is indeed glass, then the white gets colored by the green light coming out of the jewel. That looks a bit strange as you can see here.

Render2c

In the end, it’s almost 2am and this is as close as I got. It looks more like a green metallic ball than it does a glass ball. I suppose I have a lot to learn about raytracing.

If you would like to render these images yourself and possibly tweak them, these are the files that you need: demo.pov and demo2.pov. Just download the raytracer from the download page and load up these files.

Cheers!

TrackBack

TrackBack URL for this entry:
http://www.primordia.com/blog/mt-tb.cgi/387