Introduction to the Scene Description Langage of the POV-Ray Raytracer         - page 11 -
by Friedrich A. Lohmüller
Italiano Italiano
Français français
Deutsch Deutsch

Home
- POV-Ray Tutorials
 
  
POV-Ray Introduction
  Content  -  INDEX
 
  1. Working with POV-Ray:
      "Insert Menu Add-on".
  2. Basics on
      How To Make a Scene.
      3D Coordinates,
      Floats and Vectors
  3. Scene Structure
      Basic example.
  4. Scene File Header,
      #include files,
      camera, light_source.
  5. Basic Geometric Objects
      sphere, box, cylinder,
      cone, torus, plane.
      and other shapes
  6. Transformations
      Streching, Turning,
      Moving and others.
      CSG: union,
      difference, intersection.
  7. Colors on Surfaces
      texture, pigment, normal, finish
  8. #declare, #local, #macro,
      placeholders + flexible objects.
  9. #while Loops
      Basic examples.
 10. #include, include files,
      re-usable objects.
>11. Efficiency,
      speed, flexibility,
      modulare working
      adapting from 3.1 to 3.5;3.6
      adapting from 3.5;3.6 to 3.7
      POV-Ray + Windows Vista.
 
  - Insert Menu Add-on
    & Download
                                       
Tips and Tricks for Efficient Working with POV-Ray

Speed hints:
Ray tracing and photo realistic computer graphics will be a fight with insufficient computer power for ever! Therefore it is very unrealistic and useless to wait until the computers finally will be "fast enough" - they never will be fast enough for our ideas!!!! So it is better starting today to learn and train the little tricks of how to reduce times for developing and rendering on our too small and too slow computers of today. Those who know these tricks also on the supercomputers of tomorrow will arrive much faster at good results then those peoples without this know-how.
 
Some Basic rules, worth to accept:
1. Keep order to keep track! Work modular!

  • Keep attention on clear arranged and well structured text files!
  • Insert with "//" lines of comments with concise and significant words.
  • No texts of tapeworm for hardcopies on loo paper, but also not too much different things in one line! - It's surely a question of experience, what's right for you!
  • Divide bigger projects in clearly marked off smaller parts of the projects.
  • With "/*" and "*/" it is easy to comment out for testing reasons all other parts of a scene. With this, it is possible to save a lot of rendering time in test renderings during developing a scene.
2. Stay flexible!
  • Predefine multiple used elements like objects, values, textures and so on by "#declare ...". This allows more flexibility and easy changing of this elements. It's very basic to have such flexibility if you want to design a scene or an object and if you need to adjust proportions and colouring of some elements in the scene.
3. quick_color-Rendering:
  • If you're designing constructions with a huge number of elements in complex and slow rendering textures it is recommended to add to the pigment declarations "quick_color"s. If you select these "quick_color"s clearly distinguishable for different kind of objects in your construction it will be much easier to place all elements on her right place by rendering the scene in quick modus.
4. Partial Rendering:
  • If you want to see parts of your scene in a large scale (for adapting textures or shape precisely), it is often uncomfortable to render all the scene in a large scale or moving the camera for detailed look to that what you want to see.
    In this cases it is possible to use the partial rendering. This can be invoked by editing the "command line options" (see button "Ini"). " +sr100 +er200 +sc300 +ec350" e.g. sets the render region to
    start row: 100 , end row 200 and start column: 300, end column: 350.
  • Since POV-Ray version 3.1 the render region can be selected on a rendered image with the "rubber band mode to select render region" in a luxurious way.
5. Increasing max_trace_level:
  • By using glass textures and/or mirroring surfaces, it is possible that you will see often black spots in complex structures of objects in the glass or in the reflecting materials. This is caused by the fact that the raytracer has there to trace too many levels of refractions/reflections. By default POV-Ray stops tracing a ray if it does not find an object after 5 refractions or reflections - in this case the point remains black. Use the statement global_settings {max_trace_level 20} to increase it and reduce the size of black spots in surfaces of glass or mirrors.
  • On the other hand it is obvious, that it speeds up test renderings of such scenes, if you put max_trace_level back to 5 during tests or if you are using quick rendering in quick_colors. Then there no refraction or reflection will be calculated - all surface with these effects will remain black or will appear in the explicit defined quick_color of this object.
6. Attention users of version 3.0: "Halos" does not have future!
  • Those who are using POV-Ray version 3.0 (e.g. on win3.x) should not use the halo feature and the atmosphere feature anymore. These effects are totally new designed in version 3.1. So using sceneries with these features and newer versions of POV-Ray will no longer work without dramatic changing of this text files!
7. Adapting POV-Ray 3.1 scene files to POV-Ray version 3.5/3.6:
      In POV-Ray version 3.5/3.6 some critical features have changed, here are some of them:
  • Camera Angle Has Changed to Realistic Values! - In 3.2 the values for camera angle were unrealistic high - now they are adapted to reality:
    Use something about a half of the angle that you used in 3.1 scene files!
     
  • Interesting New Feature:
    Instead of changing the aspect ratio in the camera by "right x*4/3 up y" or quadratic: "right x up y ", in POV-Ray 3.6/3.6 we can install a automatic calculation of aspect ratio by
    " right x*image_width/image_height"
     
  • Semicolon expected! - After a declaring of a float or vector value semicolon is necessary:
    Samples:
    #declare R = 0.25;
    #local Diameter = 2*Radius;

     
  • Changed New Noise Generators - In version 3.5 three different noise generators are in use. Default for POV-Ray 3.6/3.6 is now the noise_generator 2. Old POV-Ray 3.1 used noise_generator 1. This causes some turbulent textures made with POV-Ray 3.1 to look different in POV-Ray 3.6/3.6. In this case we can reinstall the old noise generator by the statement
    global_settings { noise_generator 1 }
     
  • Gradient pattern has changed:
    It used to reverse / mirror for negative values along the specified orientation vector. Solution: Use function{abs(x)} as a pattern instead of gradient x and similar for gradient y and gradient z.
     
  • The float function log used to be the natural logarithm, as per version 3.5/3.6 it is 10-based.
    Solution: replace log by ln.
     
8. Adapting POV-Ray 3.5/3.6 scene files to POV-Ray version 3.7:
      New in POV-Ray version 3.7:
  • Gamma correction should not be adjusted from a scene file
    A strict logical separation of "frontend" (user-interface, Parsing of command-line options and ini files etc.) and "backend" (Parsing and rendering of scene files) requires that "assumed_gamma" should not be used in scene files.
    This is a preparation for the future transition of POV-Ray to a fully network-capable renderer.
    The text segment of a formar scene file:
    #version 3.5
        global_settings{ assumed_gamma 1 } // with display_gamma = 2.2
    therefore in POV-Ray 3.7 these lines must be canceled or commented out by "//".
     
9. 'Error-Terror' -- despite of this: Don't worry, be happy :-),
  • Keep cool and stay happy, also if any of this magic error reports are bothering you! And how they can bother you! ;-((((
    Stay cool! If it doesn't kill you, it will make you stronger! To learn a systematic and successful research on error handling is also a positive thing you can do with this program (also very easy :-).
  • Often the reason for this error is to find some lines before the line where parsing stopped. By tracing the text for errors, we must keep in mind, that the program tried to understand the statements in the text translating it starting from the head. So a forgotten final brace at a statement like "#declare .. = union{ ... }" (sometimes many many lines later) will result in an "undeclared_identifier"-error.
  • And please: If you cannot avoid to make errors (and if you are a human, you can't!), so don't make a second error and think: this program did this error - because it was the only other one here, who also was involved in this action!
    This program was and is developed by the best cracks in computer graphics from all over the world and during so many years of testing, that it's unrealistic, that a beginner may be able to discover during his first steps an error in this program. Well - sorry, I can give you no help! - if an error occurs, you have to seek it by yourself, it is highly probable (~ 99.999% !), that it is "your error" :-)
  • A complete listing of all types of errors and their possible reasons, also with all the errors a ray tracing newbie usually can make, I will write it N E V E R   A T   A L L!! Because this masterpiece would become much longer than the best description of all the positive possibilities of this wonderful POV-Ray!
10. Using POV-Ray 3.6 and POV-Ray 3.7 with Windows Vista ,
  • We need POV-Ray 3.6.2 (10-June-2009) for working under Windows Vista without problems by rendering animations! This is an update of 3.6.1 adapted to work under Vista and Vista64 operating systems. Download here: www.povray.org/download/.
    New Structure in 3.6.2:
    The programm files (bin) are now located in "C:\User\AppData\Roaming\POV-Ray\v3.6\bin\"
    while the Insert Menu, the include files and the sample scene files are now located in "C:\User\Documents\POV-Ray\v3.6\"
    While POV-Ray 3.6 for Windows is designed for Windows98/ME/XP there are some problems with Vista.
    Specially during animations POV-Ray need to write in its own directory. While trying this the program will freeze up and exit because this action is allowed to Vista compatible programs.
    Here how it worked on my computers:
    Installing POV-Ray 3.6.1 or 3.5 under Vista:
    1. Don't install POV-Ray in "Program Files"!
      Install POV-Ray somewhere else like i.e. "C:\POV-Ray3.6 ".
      (Don't move it manually! Change the installation directory during the installations process!)
    2. After installation search for the POV-Ray binary file in
      "C:\POV-Ray for windows v.36\bin\pvengine.exe".
      Right click on the icon, select "Properties" .
      Click the "Compatibility" tab and click botton "Run this program in compatibility mode for:",
      select here: "Windows 98/Windows Me"
      and select lower on this tab "Disable visual themes"
    3. Click on the "Security" tab and make sure that "all users" have "full controll" selecting the "permissions" box accordingly.
  • Using POV-Ray 3.7 (08-Nov-2013):
    POV-Ray 3.7 is a "must" for users with multicore/multiprocessor systems. Using multicores speeds up POV-Ray tremendously: POV-Ray 3.7 uses multicore processors and the speed is nearly proportional to the number of the processor cores x number of threads !!!!
  • Note: For installing the POV-Ray 3.7 you don't need to have a correct installed version of POV-Ray 3.6.
  • New structure in POV-Ray 3.7:
    The program files are now in "C:\Programs\POV-Ray\v3.7\bin\".
    The "Insert Menu" files are now in "C:\Users\Documents\POV-Ray\v3.7\Insert Menu\".
    Also the resolutions ini file "quickres.ini" and "povray.ini" with all the Library_Path settings are in "\v3.7\ini\".
    And also the sample scenes now are in "\v3.7\scenes\".
  • Compatibility: Normally all files created under version 3.6 should also work under 3.7. Only with the radiosity feature little adaptions (i.e. 'emission' repaces 'ambient') are necessary.
    Vice versa: New objects in POV-Ray version 3.7 are i.e. the include files 'shapes3.inc', 'meshmaker.inc' and 'makegrass.inc' should also work under POV-Ray version 3.6, if you have the according include files somewhere in the include file pathes of the 3.6 version.

part 0 | part 1 | part 2 | part 3 | part 4 | part 5 | part 6 | part 7 | part 8 | part 9 | part 10 | part 11

top

© Friedrich A. Lohmüller, 2014
homepage:www.f-lohmueller.de