Home < Solutions < 'looks_like'
The POV-Ray Cyclopedia
www.spiritone.com/~english/cyclopedia/

Steven Duell <rubik@ksjs.org> had some questions about the looks_like statement. We'll look at how to make a light source visible and some variations on the theme.

Part One
Examining looks_like

The looks_like statement is supposed to create a visual instance of the light. Here is the basic code:

#declare light_object = 
  sphere { 0,1  pigment { rgb <1,1,0> } }

light_source { 0*x color rgb 1.0 looks_like { light_object } }

Which gives us the image to the right. Notice how the ground is definitely lighter right under the sphere? Too bad the sphere looks dull, flat, and most of all unlit. It is in permanent shadow because the inside of the sphere is the only one getting any light.

So in the second image we added "filter 0.5" and got a different result. The sphere still looks flat, but it looks lighter because we can see through it. Notice how the looks_like object doesn't effect the color of the light? This is useful because you might want to keep a simple yellow sun and keep the white light. POV-Ray is nothing if not flexible.

#declare light_object = 
  sphere { 0,1  pigment { rgb <1,1,0> filter 0.5} }

light_source { 0*x color rgb 1.0 looks_like { light_object } }

One simple method to recover from this is to give the object some ambience like we have in image three (and I removed the filter). At least it looks closer to being a glowing object capable of shedding light.

#declare light_object = 
  sphere { 0,1 
           pigment { rgb <1,1,0> filter 0.5} 
           finish { ambient 1 } }

light_source { 0*x color rgb 1.0 looks_like { light_object } }
Plain boring light

1. Your basic, but dull, looks_like object

Plain boring light

2. A transparent looks_like object

Plain boring light

3. An ambient looks_like object

Part Two
Some Variations

One way to make the looks_like object a bit more stylized is to give it a perfectly clear pigment and a specular or phong highlight:

#declare light_object = 
  sphere { 0,1 
           pigment { rgbf 1 } 
           finish { specular 1 } }

light_source { 0*x color rgb 1.0 looks_like { light_object } }

Image 4 looks a bit nicer. The sphere appears smaller, and the glare will show up directly between the light and the camera. I cut down the filter value to get image 5, so the entire image shows up.

Now we can have some fun. Lets color the ball and add the metallic keyword to the finish statement and get image 6. (It also has a filter value of 1.)

All of these images have kept a white light. In fact, there is nothing we can do to the surface of the object to affect the color of the light when it is used as a "looks_like" object. If we were to use a union of the light and the looks_like object we could get:

image 7.

#declare light_object = 
  sphere { 0,1 
           pigment {  rgbf <0.3,0.5,0.7,1> } 
           finish { specular 1 metallic} }

union {
  light_source { 0*x color rgb 1.0 }
  object { light_object } }
Using a highlight

4. Using a highlight

Adjusting the hightlight

5. Adjusting the hightlight

Alt Tag

6. Coloring the highlight

Using a union statement to color the light

7. Using a union statement to color the light

Part Three
Letting the Light do the work

Now we'll let the light do most of the work. Here is some adjusted code.

 #declare light_object = 
   sphere { 0,1 
            pigment {  rgbf <1,1,1,1> } 
            finish { specular 5 metallic} }

 light_source { 0*x color rgb <1,0.75,0> looks_like { light_object } }

By boosting the specular size we make the glare look larger and more intense. And for

real fun we can add a normal statement and get something like images 9 and 10.

Letting the light do the work

8. Letting the light do the work

Using a granite normal

9. granite 0.1

Using a granite normal

10. granite 1


Send feedback, or head back to the Cyclopedia.

This page was last updated on 31 Aug 2001 20:04 .

Valid HTML 4.01! Valid CSS! Powered by Python