Now add the light source:
Rendering this we see that a fairly believable light bulb now illuminates the scene. However, if we do not specify a high ambient value, the light bulb is not lit by the light source. On the plus side, all of the shadows fall away from the light bulb, just as they would in a real situation. The shadows are sharp, so let's make our bulb an area light:
Note that we have placed this area light in the x-y-plane instead of the x-z-plane. Note also that the actual appearance of the light bulb is not affected in any way by the light source. The bulb must be illuminated by some other light source or by, as in this case, a high ambient value. More interesting results might therefore be obtained in this case by using halos (see section "Halos" ).
Remember the three colored area spotlights? Go back now and uncomment them and comment out any other lights you have made. Now add the following:
%%%
This is a fairly dim ( Gray75 ) light 20 units over the center of the scene. It will give a dim illumination to all objects including the plane in the background. Render it and see.
First, make the fill light a little brighter by changing Gray75 to Gray50 . Now change that fill light as follows:
This means that the full value of the fill light will be achieved at a distance of 5 units away from the light source. The fade_power of 1 means that the falloff will be linear (the light falls of at a constant rate). Render this to see the result.
That definitely worked! Now let's try a fade_power of 2 and a fade_distance of 10. Again, this works well. The falloff is much sharper with a fade_power of 2 so we had ot raise the fade_distance to 10.
Let's experiment with these keywords. First we must add an atmosphere to our scene:
Then, so the trace will not take as long and the effect will be easier to see, comment out the three lines that turn each of the three spotlights into area lights:
Tracing the scene at 200x150 -A we see that indeed the spotlights are visible. We can see where the blue and red spots cross each other and where the white overhead light shines down through the center of the scene. We also notice that the spotlights appear to diminish in their intensity as the light descends from the light source to the objects. The red light is all but gone in the lower left part of the scene and the blue light all but gone in the lower right. This is due to the atmospheric attenuation and lends a further realism to the scene. The atmosphere-lightsource interaction gives our scene a smoky, mysterious appearance, but the trace took a long time. Make those spotlights area lights and it will take even longer. This is an inevitable trade-off - tracing speed for image quality.
Now render this the same way you did before. The phong keyword adds a highlight the same color of the light shining on the object. It adds a lot of credibility to the picture and makes the object look smooth and shiny. Lower values of phong will make the highlight less bright (values should be between 0 and 1).
Suppose you wanted a very bumpy surface on the object. It would be very difficult to mathematically model lots of bumps. We can however simulate the way bumps look by altering the way light reflects off of the surface. Reflection calculations depend on a vector called a surface normal vector. This is a vector which points away from the surface and is perpendicular to it. By artificially modifying (or perturbing) this normal vector you can simulate bumps. Change the scene to read as follows and render it:
This tells POV-Ray to use a bump pattern to modify the surface normal. The value 0.4 controls the apparent depth of the bumps. Usually the bumps are about 1 unit wide which doesn't work very well with a sphere of radius 2. The scale makes the bumps 1/5th as wide but does not affect their depth.