POV-Ray : Newsgroups : povray.newusers : objects turn white with raised ambience : Re: objects turn white with raised ambience Server Time
29 Jul 2024 12:14:17 EDT (-0400)
  Re: objects turn white with raised ambience  
From: Mike Williams
Date: 22 Dec 2005 23:18:03
Message: <iQSr7RAen3qDFwzp@econym.demon.co.uk>
Wasn't it PM 2Ring who wrote:
>"Ian Crofoot" <nomail@nomail> wrote:
>> I'm testing a scene with Christmas lights, and to get the effect of the
>> lights I thought turning up the ambient values sufficiently high would work
>> (with radiosity).  The only problem I run into is that four of the six
>> colors of lights I use turn white when the ambient value is raised.  Two of
>> them are function perfectly however.
>>
>> The scene file is rather large, so here is a link:
>>
>> http://www.geocities.com/iancrofoot/treeLit.txt
>
>You'll get more people looking at your code if you try to isolate the
>problem into a small scene we can easily read & run.
>
>>
>> Putting lightsources in all the bulbs would be HUGE pain, so this is the
>> only method I can think of.  If there is a better method, or at least a fix
>> to my problem, I would be pleased.
>
>//---------- Ian's code ----------------------
>#declare redlight_WingsMat =
>  texture{
>      pigment{ rgbf <0.866667, 0.00000e+0, 0.286667, 0.500000>}
>      finish{
>        ambient rgb 100
>        diffuse 1.00000
>        brilliance 1.00000
>        specular 0.500000 roughness 5.00000e-2
>        }
>}
>//---------- Ian's code ----------------------
>
>I've only had a quick look at your scene, but if the section above is an
>example of your problem, then I suggest not using white as your ambient
>colour.
>Instead use something like this:
>
> ambient rgb 100*<0.866667, 0, 0.286667>
>
>Sorry, I haven't tested this out.

What happens is that the colours get clipped. The colours that don't
turn white are the ones that have a zero component.

E.g. when this colour gets multiplied by 100
      pigment{ rgb <0.866667, 0.00000e+0, 0.286667>}
it gives
      pigment { rgb <86.6667, 0, 28.6667>}
which when clipped to a max of 1.0 gives
      pigment { rgb <1,0,1> }
which is pure magenta.


Similarly, the coloured ambient value is only going to help when one of
its colour components is zero or very small.

E.g. for this colour
      pigment{ rgb <0.920000, 0.700000, 0.220000>}
      finish{ ambient rgb <0.920000, 0.700000, 0.220000>*100 }
When you multiply the pigment by the ambient you get
      pigment {rgb <84.64, 49, 4.84>}
Which, when clipped to a max of 1.0 gives
      pigment {rgb <1,1,1>}
which is pure white.


You could choose to only use colours that have at least one zero
component. Even then, the high ambient is going to cause them to be
clipped to one of the pure colours red, blue, green, yellow, magenta or
cyan. The radiosity that they give off is from the unclipped colour.


Alternatively you could consider this:
  texture{
      pigment{ rgb <92, 0.7, 0.22>}
      finish {ambient 1}
   }
This causes the orange bulbs to be orange, but then cast red radiosity.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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