POV-Ray Glassy Spheres and Transparency

By Xah Lee. Date:

This page show you how to use POV-Ray to make object transparent. If you don't understand it, please see Intro to POV-Ray

Transparency with Textures

POV-Ray allows various ways to simulate a object's surface. This feature is called textures. We will show some examples of textures here that are of mathematical interest, such as rendering translucent objects or reflective surfaces.

Here's a excerpt from POV-Ray documentation that makes it clear what texture in POV-Ray means:

The texture statement is an object modifier which describes what the surface of an object looks like, i.e. its material. Textures are combinations of pigments, normals, and finishes. Pigment is the color or pattern of colors inherent in the material. Normal is a method of simulating various patterns of bumps, dents, ripples or waves by modifying the surface normal vector. Finish describes the reflective properties of a material.

How shiny a object looks is emulated by the keyword “phong”. Its value can be set from 0 to 1. The higher the value, the more hard and smooth the surface appears. Its syntax is like this:

texture{ pigment{ color Blue} finish {phong 0}}

To make a object transparent, use the “filter” or “transmit” keyword, like this:

texture{ pigment{color Red filter 0.7 }}
texture{ pigment{color Red transmit 0.7 }}
texture transparency
The green balls have progressive “phong” values, from 0 on the left to 1 on the right. The yellow balls have progressive “filter” values. The red balls have progressive “transmit” values. Note that if the transmit value is 1, then the object becomes invisible, but you can still see the highlight spot made by phong. Source: [texture_transparency.pov].

Both “filter” and “transmite” lets light pass thru. Their difference is that filter will tint the light with the object's surface texture, while transmit will not. (look at their shadows)

2.5 Textures

Glass Balls

To create glass-like effect, one must use the interior{} keyword, like this:

interior{ior 1.5}

The ior means “index of refraction”.

The default ior value of 1.0 will give no refraction. The index of refraction for air is 1.0, water is 1.33, glass is 1.5 and diamond is 2.4.

glass balls
The glassy balls have progressive ior values of 1, 1.5, 2, 2.5, from left to right. The yellow balls has filter set to 1, and the red balls have transmit set to 0.9. Source: [interior.pov].

2.6 Interior and Media and Photons

See also: Photon mapping, Refraction