Appendix F.2
Scene Debugging Tips

To see a quick version of your picture, render it very small. With fewer pixels to calculate the ray-tracer can finish more quickly. -W 160 -H 100 is a good size. Use the +Q quality switch when appropriate. If there is a particular area of your picture that you need to see in high resolution, perhaps with anti-aliasing on (perhaps a fine-grained wood texture), use the +SC , +EC , +SR and +ER switches to isolate a window . If your image contains a lot of inter-reflections, set max_trace_level to a low value such as 1 or 2. Don't forget to put it back up when you're finished! Turn off any unnecessary lights. Comment out extended light keywords when not needed for debugging. Again, don't forget to put them back in before you retire for the night with a final render running! If you've run into an error that is eluding you by visual examination it's time to start bracketing your file. Use the block comment characters /* ... */ to disable most of your scene and try to render again. If you no longer get an error the problem naturally lies somewhere within the disabled area. Slow and methodical testing like this will eventually get you to a point where you will either be able to spot the bug, or go quietly insane. Maybe both. If you seem to have lost yourself or an object (a common experience for beginners) there are a few tricks that can sometimes help:

1) Move your camera way back to provide a long range view. This may not help with very small objects which tend to be less visible at a distance, but it's a nice trick to keep up your sleeve.
2) Try setting the ambient value to 1.0 if you suspect that the object may simply be hidden from the lights. This will make it self-illuminated and you'll be able to see it even with no lights in the scene.
3) Replace the object with a larger, more obvious "stand-in" object like a large sphere or box. Be sure that all the same transformations are applied to this new shape so that it ends up in the same spot.

Appendix F.3
Animation Tips

When animating objects with solid textures, the textures must move with the object, i. e. apply the same rotate or translate functions to the texture as to the object itself. This is now done automatically if the transformations are placed after the texture block like the following example

shape { ... pigment { ... } scale < ... > }

will scale the shape and pigment texture by the same amount.

shape { ... scale < ... > pigment { ... } }

will scale the shape but not the pigment. Constants can be declared for most of the data types in the program including floats and vectors. By writing these to include files you can easily separate the parameters for an animation into a separate file. Some examples of declared constants would be:

#declare Y_Rotation = 5.0 * clock #declare ObjectRotation = <0, Y_Rotation, 0> #declare MySphere = sphere { <0, 0, 0>, 1.1234 } Other examples can be found scattered throughout the sample scene files. A tip for MS-Dos users: Get ahold of dta.exe (Dave's Targa Animator) for creating .FLI/.FLC animations. aaplay.exe and play.exe are common viewers for this type of file. When moving the camera in an animation (or placing one in a still image, for that matter) avoid placing the camera directly over the origin. This will cause very strange errors. Instead, move off center slightly and avoid hovering directly over the scene.

Appendix F.4
Texture Tips

Wood is designed like a log with growth rings aligned along the z-axis. Generally these will look best when scaled down by about a tenth (to a unit-sized object). Start out with rather small value for the turbulence too (around 0.05 is good for starters). The marble texture is designed around a pigment primitive that is much like an x-gradient. When turbulated, the effect is different when viewed from the side or from the end . Try rotating it by 90 degrees on the y-axis to see the difference. You cannot get specular highlights on a totally black object. Try using a very dark gray, say Gray10 or Gray15 (from colors.in ), instead.

Appendix F.5
Height Field Tips

Try using POV-Ray itself to create images for height fields: camera { location <0, 0, -2> } plane { z, 0 finish { ambient 1 } // needs no light sources pigment { bozo } // or whatever. Experiment. } That's all you'll need to create a .tga file that can then be used as a height field in another image!

Appendix F.6
Converting "Handedness"

If you are importing images from other systems you may find that the shapes are backwards (left-to-right inverted) and no rotation can make them correct.

Often, all you have to do is negate the terms in the right vector of the camera to flip the camera left-to-right (use the right-hand coordinate system). Some programs seem to interpret the coordinate systems differently, however, so you may need to experiment with other camera transformations if you want the y- and z-vectors to work as POV-Ray does.


Appendix G
Frequently Asked Questions

This is a collection of frequently asked questions and their answers taken directly from messages posted in the Graphic Developer's Forum on Compuserve and the comp.graphics.raytracing newsgroup. This version of the FAQ is heavily biased towards the CompuServe user of the IBM PC version of POV-Ray. Hopefully later revisions will remove some of this bias, but at present time, that is the largest audience.

Appendix G.1
General Questions

Q: When will POV-Ray 3.0 be released? A: It is already available. Q: When will the source code be released? A: The soruce code available too.

Appendix G.2
POV-Ray Option Questions

Q: How can I set mosaic preview to go from 8*straight to final render without going to 4*and then t*first? \\ A: Use the +SP n or Preview_Start_Size option to set the starting resolution and the +EP n or Preview_End_Size option to set the ending resolution. With +SP 8 and +EP 8 it will go from 8*8 down to 8*8 (just one pass) then immediately drop into the final pass at 1*1. Q: Should the +MB switch be used in very small scenes, i. e. with a low number of objects. \\ A: That depends on the number of objects and their type. Normally it doesn't hurt to always use the bounding box hierarchy ( +MB 0). If you have just one or two objects it may be better to not use automatic bounding. Q: Does the +MB switch affect the quality of the image? A: No. It only affects the speed of the intersection tests.

Appendix G.3
Atmosphere Questions

Q: Why is the atmosphere I added not visible? \ A: The most common error made when adding an atmosphere to a scene is the missing hollow keyword in all objects the camera currently is in. If you are inside a box that is used to model a room you'll have to add the hollow keyword to the box statement. If a plane is used to model the ground you'll have to make it hollow (only if you are inside the plane, but to be sure you can always do it). If this doesn't help there may be other problems you'll have to verify. The distance and scattering values of the atmosphere have to be larger than zero. Light sources that shall interact with the atmosphere mustn't contain an atmosphere off statement.

Q: Why can't I see any atmosphere through my translucent object? \\ A: If you have a translucent object you (almost) always have to make it hollow by adding the hollow keyword. Whenever an intersection is found and the ray is inside a solid object no atmospheric effects will be calculated.

If you have a partially transparent plane for example the atmosphere on the other side of the plane will only be visible through the plane if this plane is hollow.

Q: Why do the lit parts of the atmosphere amplify the background? \\

A: First, they don't.

Second, whenever parts of the background are visible through the atmosphere and those areas of the atmosphere are lit by any light source, the scattered light is added to the light coming from the background. This is the reason why the background seems to be amplified by the atmosphere. Just imagine the followoing example: you have a blue background that is attenuated be the atmosphere in a way that the color reaching the viewer is <0,0,0.2>. Now some light coming from a light source is attenuated and scattered by the atmosphere and finally reaches the viewer with a color of <0.5,0.5,0.5>. Since we already have light coming from the background, both colors are added to give <0.5,0.5,0.7>. Thus the light gets a blue hue. As a result you think that the background light is amplified but it isn't as the following scene clearly shows.

#version 3.0 camera { location <0, 6, -20> look_at <0, 6, 0> angle 48 } atmosphere { type 1 samples 10 distance 20 scattering 0.3 aa_level 3 aa_threshold 0.1 jitter 0.2 } light_source { <0, 15, 0> color red .7 green .7 blue .7 shadowless } light_source { <-5, 15, 0> color rgb <1, 0, 0> spotlight point_at <-5, 0, 0> radius 10 falloff 15 tightness 1 atmospheric_attenuation on } light_source { <0, 15, 0> color rgb <0, 1, 0> spotlight point_at <0, 0, 0> radius 10 falloff 15 tightness 1 atmospheric_attenuation on } light_source { <5, 15, 0> color rgb <0, 0, 1> spotlight point_at <5, 0, 0> radius 10 falloff 15 tightness 1 atmospheric_attenuation on } plane { z, 10 pigment { checker color rgb<1, 0, 0> color rgb<0, 1, 0> } hollow }


The atmosphere seems to amplify what is seen in the background.

In the background you see a red/green checkered plane. The background color visible through the atmosphere is added to the light scattered from the spotlights. You'll notice that even though the red squares behind the red spotlight's cone are brighter than those outside the cone the green ones are not. For the green spotlight the situation is turned around: the green squares seem to be amplified while the red are not. The blue spotlight doesn't show this effect at all.


Next Section
Table Of Contents