POV-Ray : Newsgroups : povray.general : Toggling on and off "everything at ambient rgb 1" : Re: Toggling on and off "everything at ambient rgb 1" Server Time
2 Aug 2024 22:19:45 EDT (-0400)
  Re: Toggling on and off "everything at ambient rgb 1"  
From: Brian Elliott
Date: 18 Jul 2004 11:00:49
Message: <40fa90a1$1@news.povray.org>
"Greg M. Johnson" <gregj;-)565### [at] aolcom> wrote in message
news:40f9ce26$1@news.povray.org...
> I thought I new how to do this, but everything I've tried, even after
RTFM,
> doesn't do the job.
>
> I have a standard scene and I assume that with one statement of povray
SDL,
> I can simply turn on a situation where everything is as if it had
> finish{ambient rgb 1}.   I cannot tell if either the docs are deficient,
> povray just cannot do this, or I've got a big bug in my code that's
messing
> with the normal behavior of pov.

There's a somewhat related method I use for managing ambient throughout a
scene with a global radiosity variable.

In every scene, I declare a Radiosity variable; it is always there, either
"off" or "on".  Then I declare a "Boolean inverse", which is used as a flag
in finish {} blocks.  Also the variables control the placement of
ambient_light in the global_settings{} block.

It basically goes like this:

#declare Radiosity = off;  // or "on"
#declare _Rad = (Radiosity ? 0 : 1);  // notRad is the opposite of Radiosity

global_settings
{
#if (Radiosity)
  ambient_light 0
  radiosity { <radiosity settings>}
#end
}

I keep that in my Insert Menu, so I don't have to type it in every scene.
Then every object which needs an EXPLICITLY defined ambient value, has a
finish statement similar to either of these two - Both methods work
differently.

finish { ambient 0.2 * _Rad}          // ambient = {0.2 or 0.0}
finish { #if (_Rad) ambient 0.2 #end} // ambient = {0.2 or texture default}

I think I have almost always used the first method.  The second allows
glowing ambient textures if you don't touch the global ambient_light, unlike
I have done.

But unfortunately you'll still have to painfully edit all those object
textures in your particular scene!

Cheers,
  Brian


Post a reply to this message

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