POV-Ray : Newsgroups : povray.newusers : objects turn white with raised ambience Server Time
1 Nov 2024 09:22:59 EDT (-0400)
  objects turn white with raised ambience (Message 1 to 8 of 8)  
From: Ian Crofoot
Subject: objects turn white with raised ambience
Date: 22 Dec 2005 18:15:00
Message: <web.43ab330f9ef0c7f3dff1290@news.povray.org>
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

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.


Post a reply to this message

From: PM 2Ring
Subject: Re: objects turn white with raised ambience
Date: 22 Dec 2005 21:25:01
Message: <web.43ab5f12405ec266a6f2f67b0@news.povray.org>
"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.


Post a reply to this message

From: Mike Williams
Subject: Re: objects turn white with raised ambience
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

From: PM 2Ring
Subject: Re: objects turn white with raised ambience
Date: 23 Dec 2005 03:20:01
Message: <web.43abb098405ec266a6f2f67b0@news.povray.org>
Mike Williams <nos### [at] econymdemoncouk> wrote:
> 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.

> >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.

Of course. Oops! (I'm glad I put that disclaimer in :)

FWIW, until I started reading these newsgroups, I didn't even know you could
use colour values outside the zero to one range. I was puzzled when I first
saw SDL with fading light sources using rgb 100, but I'm so used to it now
that I'd forgotten all about colour clipping.

> 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.

That makes sense, Mike.

> 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

What about using a layered texture, with the bottom layer having a high
white ambient and the top layer with the desired colour as filtered
transparency? Or even using two objects, a coloured bulb object,
containing a white glowing object?

Other possible techniques:
* Develop the scene using low light values & brighten up the scene with
post-processing.

* Use two-pass radiosity.


Post a reply to this message

From: Mike Williams
Subject: Re: objects turn white with raised ambience
Date: 23 Dec 2005 04:48:23
Message: <abdVJCAib8qDFwEV@econym.demon.co.uk>
Wasn't it PM 2Ring who wrote:
>
>What about using a layered texture, with the bottom layer having a high
>white ambient and the top layer with the desired colour as filtered
>transparency? Or even using two objects, a coloured bulb object,
>containing a white glowing object?

I tried those, and I also tried having a high ambient no_image object
around a conventional object In all cases the radiosity comes from the
unclipped value and the visible image comes from the clipped value of
the same thing. So if the combination object is bright enough to cast a
decent amount of radiosity, then what you see is bright enough to suffer
from clipping.

>Other possible techniques:
>* Develop the scene using low light values & brighten up the scene with
>post-processing.

That works. You have to set the ambient of the non-bulb objects to zero,
or close to zero, and you have to also increase the saturation in post-
processing because brightening the image by large amounts will tend to
cause the saturation to be washed out.

I'd imagine that the increased length of the development/test cycle
would make it tedious to get it to look just right.

>* Use two-pass radiosity.

That works. It looks like the best solution. Run the first pass with the
"ambient rgb 100" and a radiosity save file. Run the second pass with
"ambient rgb 1" and a radiosity load file.

It's also easy to develop because the radiosity look exactly like it
does with "ambient rgb 100" and the bulb looks exactly like it does with
"ambient rgb 1".

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: Alain
Subject: Re: objects turn white with raised ambience
Date: 23 Dec 2005 12:39:52
Message: <43ac3668$1@news.povray.org>
Ian Crofoot nous apporta ses lumieres en ce 2005-12-22 18:13:
> 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
> 
> 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.
> 
> 
Why don't use a macro for your lights? That macro take a colour as parameter and
create one small 
coloured christmass light with a light_source of the apropriate colour. It can also
include a small 
media in it's container. (using emissive madia if prety fase)
In the macro, create the light at the origin, you then rotate it and translate to it's
final place. 
Rotation and position can also be passed to the macro as parameters.

-- 
Alain
-------------------------------------------------
No man or woman is worth your tears, and the one
who is, won't make you cry.


Post a reply to this message

From: Ian Crofoot
Subject: Re: objects turn white with raised ambience
Date: 23 Dec 2005 15:45:00
Message: <web.43ac61a9405ec266f3dff1290@news.povray.org>
Thanks guys.  I'll think I'll try two-pass radiosity for this (something I
should learn by now).  I appreciate the time you guys spent on helping me!

And Alain, do you have a link to this macro you speak of?


Post a reply to this message

From: Ian Crofoot
Subject: Re: objects turn white with raised ambience
Date: 23 Dec 2005 15:55:00
Message: <web.43ac6319405ec266f3dff1290@news.povray.org>
Alain <ele### [at] netscapenet> wrote:
> Why don't use a macro for your lights? That macro take a colour as parameter and
create one small
> coloured christmass light with a light_source of the apropriate colour. It can also
include a small
> media in it's container. (using emissive madia if prety fase)
> In the macro, create the light at the origin, you then rotate it and translate to
it's final place.
> Rotation and position can also be passed to the macro as parameters.
>
> --
> Alain
> -------------------------------------------------
> No man or woman is worth your tears, and the one
> who is, won't make you cry.

Oh, you're saying to make my own macro.  Gotcha.  Nevermind the link
question, then.


Post a reply to this message

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