POV-Ray : Newsgroups : povray.newusers : Modeling of complex Scenes : Re: Modeling of complex Scenes Server Time
3 Jul 2024 04:43:14 EDT (-0400)
  Re: Modeling of complex Scenes  
From: Cousin Ricky
Date: 5 Oct 2011 21:15:01
Message: <web.4e8d006ed703f35978641e0c0@news.povray.org>
Christian Froeschlin <chr### [at] chrfrde> wrote:
> Thomas de Groot wrote:
>
> > What most people do while building their scenes, is to test-render using
> > simpler settings, like switching off area lights, switching off media,
> > switching off photons, using simple textures instead of complex ones,
> > replacing complex render-intensive objects by placeholders...
>
> Also note that, in practice, a convenient way to do this is to use
> the #if statement to distinguish between the simple and complex code
> based on some flag(s) you set at the beginning of the file.

#ifndef is your friend.  For example:
____________________________________________________________________________

#ifndef (Debug_house) #declare Debug_house = 0; #end
#ifndef (Debug_lawn) #declare Debug_lawn = 0; #end
#ifndef (Debug_tree) #declare Debug_tree = 0; #end
....

#if (Debug_house = 0)
   #declare House = union
   {  box { -1, 1 translate y }
      box { -1, 1 rotate 45*x scale <1, sqrt(0.5), sqrt(0.5)> translate 2*y }
      scale <5.5, 2.5, 3.5>
      pigment { rgb 1 }
   }
#else
   #declare t_Glass = //something slow
   #declare t_Shingles = //something slow
   #declare t_Outdoor_siding = //something slow
   #declare t_Stucco_ceiling = //something slow
   #declare t_Hardwood_floor = //something slow
   #declare Window = //something complicated
   #declare Roof = //something complicated
   #declare Door = //something complicated
   #declare House = union { /* something really complicated */ }
#end
....
____________________________________________________________________________

Then you can set the parameters from the command line or from within a .ini
file.  To work on your trees, you might set:

-a +q4 declare=Debug_tree=1


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.