POV-Ray : Newsgroups : povray.advanced-users : Gamma and light sources : Re: Gamma and light sources Server Time
26 Apr 2024 01:50:55 EDT (-0400)
  Re: Gamma and light sources  
From: clipka
Date: 17 Nov 2016 22:54:43
Message: <582e7b83@news.povray.org>
Am 18.11.2016 um 04:02 schrieb Mike Horvath:
> On 9/2/2015 9:43 AM, clipka wrote:
>> Presuming that you're trying to migrate a legacy POV-Ray 3.6 scene
>> without assumed_gamma setting, or trying to migrate a scene with
>> "assumed_gamma 2.2" to "assumed_gamma 1.0", I recommend that you use the
>> "srgb" family of keywords in the /definition/ of light_color. If you do
>> that, there should be no need to perform any color conversions in the
>> light source definition itself.
>>
> 
> I'm still sort of confused. For a brand new scene designed from scratch
> in 3.7 and not needing to migrate from 3.6, should I aim to use "srgb"
> or "rgb" in the light color definition?

You should be using "assumed_gamma 1.0" if you want physical realism.

Whether you're using `rgb` or `srgb` is irrelevant. You can either specify

    rgb <R,G,B>

or

    srgb <Rp,Gp,Bp>

where Rp=f(R), Gp=f(G) and Bp=f(B), with f(x) being a special function
defined in the sRGB colour space specification. The rendering results
are the same either way.

In the former case you're specifying the light source colour and
brightness in terms of linear light intensity values. In the latter case
you're specifying the light source colour and brightness in terms of
something closer to how the human eye perceives the values.

For example, you can either specify

    rgb <0.0, 0.214, 1.0>

or

    srgb <0.0, 0.5, 1.0>

without any difference in the render result. Whatever floats your boat.


There's a caveat though when performing mathematical operations in
conjunction with `srgb`; for instance,

    rgb <0.0, 0.214, 1.0> * 100

is equivalent to

    rgb <0, 21.4, 100>

which is equivalent to

    srgb <0, 3.726, 7.133>

which is equivalent to

    srgb <0.0, 0.522, 1.0> * 7.133

and thus results in a different hue than

    srgb <0.0, 0.5, 1.0> * 7.133

so if you're using `srgb` notation you'll need to take care when trying
to adjust the bightness of light sources without changing the hue; the
following should work:

    (srgb <0.0, 0.5, 1.0>) * 100


So my personal recommendation would be to prefer `rgb` over `srgb`.


Post a reply to this message

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