POV-Ray : Newsgroups : povray.general : gamma handling discussion Server Time
28 Mar 2024 06:14:14 EDT (-0400)
  gamma handling discussion (Message 1 to 9 of 9)  
From: omniverse
Subject: gamma handling discussion
Date: 2 Nov 2016 20:25:07
Message: <web.581a8342222bc6629c5d6c810@news.povray.org>
Warp <war### [at] tagpovrayorg> wrote:
> I would like to know your opinion on these as well:
>
> 1) Which one of these images do you think looks more realistic?
>
> http://koti.kapsi.fi/warp/media/pov37_test1.png
> http://koti.kapsi.fi/warp/media/pov37_test2.png
>
>
> 2) Currently, when using assumed_gamma 1 in povray 3.7 mode, default
> color values in things like the ambient finish do not get adjusted in
> terms of srgb, but remain in their rgb values (for example, the default
> ambient finish is "rgb 0.1"), which means that a change in assumed_gamma
> will affect their brightness.
>
> The second image above was rendered by explicitly specifying the default
> ambient finish (using the #default directive in the scene file) using
> "srgb". Without this explicit setting, ie. using the default value, the
> image looks like this:
>
> http://koti.kapsi.fi/warp/media/pov37_test4.png
>
> (It's essentially impossible to get any shades are darker than that due to
> the default ambient finish.)
>
> So my question is: Should POV-Ray define default colors (eg. in the ambient
> finish, and anywhere else where there are default colors) in terms of srgb
> (which would result in the second image by default, without having to
> explicitly set those defaults), or is the current functionality ok (which
> by default results in the third image).
>
> --
>                                                           - Warp

I'm going to take the initiative to move this into a separate message thread due
to Clipka asking not to reply to posts in the "survey" thread.

I must ask, was the scene absolutely identical other than srgb replacing rgb?

That reflection on the red and white ball changes drastically from first image.
Guessing radiosity was not used...?

Something that comes to mind about the ambient change is what about emission
srgb instead of rgb? Wouldn't that be needed as well?

Thanks for showing these differences because I think it shows the trouble I had
with understanding how assumed_gamma 1 and srgb versus rgb was affecting the
renderings. Usually cranked up the assumed_gamma above 1.0 to improve
appearance, probably a bad way to go about it. And then I was using
assumed_gamma srgb and still not certain what was the best way before adjusting
scene texture elements once again.

Bob


Post a reply to this message

From: clipka
Subject: Re: gamma handling discussion
Date: 3 Nov 2016 06:50:08
Message: <581b1660@news.povray.org>
Am 03.11.2016 um 01:22 schrieb omniverse:
> Warp <war### [at] tagpovrayorg> wrote:
>> I would like to know your opinion on these as well:
>>
>> 1) Which one of these images do you think looks more realistic?
>>
>> http://koti.kapsi.fi/warp/media/pov37_test1.png
>> http://koti.kapsi.fi/warp/media/pov37_test2.png
>>
>>
>> 2) Currently, when using assumed_gamma 1 in povray 3.7 mode, default
>> color values in things like the ambient finish do not get adjusted in
>> terms of srgb, but remain in their rgb values (for example, the default
>> ambient finish is "rgb 0.1"), which means that a change in assumed_gamma
>> will affect their brightness.

I would like to add that this has always been the case when using
assumed_gamma 1, so it is not specific to the 3.7 mode, but rather to
the assumed_gamma 1, which had been around in 3.6 already.

>> The second image above was rendered by explicitly specifying the default
>> ambient finish (using the #default directive in the scene file) using
>> "srgb". Without this explicit setting, ie. using the default value, the
>> image looks like this:
>>
>> http://koti.kapsi.fi/warp/media/pov37_test4.png
>>
>> (It's essentially impossible to get any shades are darker than that due to
>> the default ambient finish.)

That is not entirely true: Darkening can also be effected by...

- Setting the "ambient_light" to a lower value, or

- Reducing the pigment colour, and cranking up the illumination of the
portions intended to be brighter.

Also, using radiosity obviously eliminates the problem, and gives more
realistic results anyway.

I don't mean to dispute the fact that the assumed_gamma 1 mode
effectively uses different defaults for ambient than the 3.6 default
mode (in a nutshell, assumed_gamma 1 uses a factor of 0.1, whereas the
3.6 default effectively used a factor of 0.0064 in otherwise pitch black
regions), but I mean to get all the facts on the table.


BTW, some other facts I consider worth mentioning:

- The actual effective ambient factor in 3.6 default mode depended on
various other conditions (thanks to the mathematically incorrect
internal colour computations): In total shadows, and with a white
pigment, the effective factor would indeed be around 0.0064. However,
with a non-white pigment the factor could drop even further (e.g. 0.0027
for an rgb 0.5 pigment), while in brightly lit portions of the image it
could climb to as high as 0.19 instead.

- In 3.6 default mode, the ambient brightness even varied across
operating systems: The effective factor of 0.0064 under standard
conditions given above is true for Windows and, IIRC, Unix machines; on
pre-OS X Mac machines however, the factor would be 0.016 instead.


>> So my question is: Should POV-Ray define default colors (eg. in the ambient
>> finish, and anywhere else where there are default colors) in terms of srgb
>> (which would result in the second image by default, without having to
>> explicitly set those defaults), or is the current functionality ok (which
>> by default results in the third image).

I don't think this style of question is of any help in providing the dev
team with any guidance whatsoever, for various reasons:

- It is not clear to the user whether they are expected to give feedback
on their personal preferences (i.e. ease of use), or whether they are
expected to put them in the dev team's shoes to make a decision.

- Consequently, we don't know what type of feedback the user actually
intends to give.

- Besides, even if we knew a user intends to give feedback on how they
would decide, we have no way of knowing how well-informed that decision
is: We know neither what portion of the entire picture they actually do
have, nor what portion of the picture they're aware they don't have, let
alone what portion of the picture they're entirely unaware of.

You did present the positive effects a change in the defaults would have
on the ease of use, but we must expect the average user to be pretty
much in the dark regarding all other areas to consider, such as how easy
it would be to implement, what pitfalls are to be expect in the process,
what alternative routes could be taken, or even what negative side
effects a change in the defaults might have.


> I must ask, was the scene absolutely identical other than srgb replacing rgb?

As far as http://koti.kapsi.fi/warp/media/pov37_test2.png and
http://koti.kapsi.fi/warp/media/pov37_test4.png are concerned, the info
given by Warp sounds plausible enough for me.

> That reflection on the red and white ball changes drastically from first image.
> Guessing radiosity was not used...?

Even that doesn't seem entirely unreasonable to me.

Just like what is happening with ambient, a similar effect should also
be seen for reflection (and diffuse and highlights) when the parameters
happen to not be set to either 0 or 1.

As mentioned above, in the old 3.6 default mode the effective ambient
factor is boosted unnaturally wherever the scene is illuminated by other
means; in the same manner, reflection should also be boosted unnaturally
wherever the scene is already bright for other reasons.

Therefore, in http://koti.kapsi.fi/warp/media/pov37_test1.png we should
see reflections less drowned out by diffuse than would be realistic.

I'm a bit surprised about the strength of the effect, but it still seems
plausible to me.


> Something that comes to mind about the ambient change is what about emission
> srgb instead of rgb? Wouldn't that be needed as well?

Not really; emission defaults to 0.0, which is one of the two parameter
values entirely unaffected by gamma (the other being 1.0).

But we should theoretically also overhaul the default value for diffuse,
even though it doesn't take a colour; and if we take the issue serious,
all the default include files' finish settings should also be changed
with regard to ambient (or emission), diffuse, specular, phong, and
reflection. Obviously that's non-trivial, since we would want to
continue using the old values in scenes using 3.6 default mode or
assumed_gamma 2.2.


One possible way to bypass the entire issue of default values might be
to add a simple short default include file, say, "linear.inc",
containing something like this:

    #ifndef(LINEAR_INC_TEMP)
    #define LINEAR_INC_TEMP = version;
    #version 3.6;

    #define LINEAR_MODE = on;
    global_settings { assumed_gamma 1.0 }
    default {
      ambient pow(0.1, 2.2)
      diffuse pow(0.7, 2.2)
    }

    #version LINEAR_INC_TEMP;
    #end

Instead of specifying "global_settings { assumed_gamma 1.0 }", users
would then just specify:

    #include "linear.inc"

Default include files could then test for LINEAR_MODE, in which case
they could provide alternative finish definitions to better match
assumed_gamma 1 mode.

This way we could address the problem without even touching the POV-Ray
source code, while at the same time solving problems we couldn't
reasonably address by source code changes alone.

In the include file we could also define a macro or function to
encapsulate pow(x,2.2) for ease of use.


I guess in an ideal world POV-Ray would have always used different
default values in assumed_gamma 1 mode (and yes, Warp, maybe even
various other gamma-related semantic differences), but given that our
timeline branched off that ideal world as early as the release of
POV-Ray 3.6.0, I think the best we can do is go for a reasonable compromise.


Post a reply to this message

From: Cousin Ricky
Subject: Re: gamma handling discussion
Date: 3 Nov 2016 16:02:19
Message: <581b97cb$1@news.povray.org>
On 2016-11-02 08:22 PM (-4), omniverse wrote:
 > I'm going to take the initiative to move this into a separate message 
thread due
 > to Clipka asking not to reply to posts in the "survey" thread.

Thanks for that.  As such, this reply is to Warp, not to you.

> Warp <war### [at] tagpovrayorg> wrote:
>> I would like to know your opinion on these as well:
>>
>> 1) Which one of these images do you think looks more realistic?
>>
>> http://koti.kapsi.fi/warp/media/pov37_test1.png
>> http://koti.kapsi.fi/warp/media/pov37_test2.png

I cannot say, as that would depend on the environmental lighting 
conditions and material properties.

>> 2) Currently, when using assumed_gamma 1 in povray 3.7 mode, default
>> color values in things like the ambient finish do not get adjusted in
>> terms of srgb, but remain in their rgb values (for example, the default
>> ambient finish is "rgb 0.1"), which means that a change in assumed_gamma
>> will affect their brightness.
>>
>> The second image above was rendered by explicitly specifying the default
>> ambient finish (using the #default directive in the scene file) using
>> "srgb". Without this explicit setting, ie. using the default value, the
>> image looks like this:
>>
>> http://koti.kapsi.fi/warp/media/pov37_test4.png
>>
>> (It's essentially impossible to get any shades are darker than that due to
>> the default ambient finish.)
>>
>> So my question is: Should POV-Ray define default colors (eg. in the ambient
>> finish, and anywhere else where there are default colors) in terms of srgb
>> (which would result in the second image by default, without having to
>> explicitly set those defaults), or is the current functionality ok (which
>> by default results in the third image).

As far as I'm concerned, the default ambient is just a place holder. 
That said, on those occasions when I forgo radiosity, my ambient value 
is usually greater than rgb 0.1, even though I use assumed_gamma 1.  The 
scenes in which I use less than rgb 0.1 all have a very dark 
environment.  This is to say that rgb 0.1 is a perfectly fine default, 
and I would certainly not lower it.

(I never use srgb in ambient statements because it is physically 
meaningless to me--akin to why I do not use assumed_gamma 2.2.  When I 
need a darker ambient, I just use a smaller rgb value.  N.B. srgb in a 
pigment color is a completely different matter.)

The problem with pov37_test4.png, as I see it, is not that the ambient 
is too high, but that there is no ambient occlusion--the feature that, 
to me, most makes radiosity scenes so much more convincing than 
non-radiosity scenes.  One way to simulate ambient occlusion would be to 
use fill lights, and of course, in that case, lowering the ambient would 
be appropriate.


Post a reply to this message

From: Warp
Subject: Re: gamma handling discussion
Date: 4 Nov 2016 04:19:43
Message: <581c449f@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:
> I don't mean to dispute the fact that the assumed_gamma 1 mode
> effectively uses different defaults for ambient than the 3.6 default
> mode (in a nutshell, assumed_gamma 1 uses a factor of 0.1, whereas the
> 3.6 default effectively used a factor of 0.0064 in otherwise pitch black
> regions), but I mean to get all the facts on the table.

The ambient finish is the simplest, "cheapest" way of kind of emulating
radiosity in a simplistic renderer. POV-Ray has used it from the very
beginning so that shadowed parts (ie. surface that do not see any light
source) will not be pitch-black by default, but will be a bit visible,
simulating in a simplistic manner real life, where nothing is really
pitch-black because light bounces from surfaces to illumate things in
shadows.

It is, essentially, a kludge. Its default value is just completely
arbitrary. Something that's not too bright, not too dark. Something
that gives an acceptable default brightness in non-illuminated areas
in simple scenes. Something that when you quickly write a scene and
render it, gives you an ok result.

However, it becomes way too bright when assumed_gamma 1.0 is used.
It destroys its purpose to exist. Now it becomes a detrimental effect
rather than a useful one. Now you have to find out what the cause is,
and write additional settings to tone it back down to an acceptable
level.

I see no reason for this. It serves absolutely no useful purpose like this.
I think that by default it should remain the same brightness regardless
of what assumed_gamma is. That way it retains its original purpose (ie.
that of serving as a simplistic "radiosity" simulator for simple scenes;
not too bright, not too dark.) I see no reason why it shouldn't be like
that.

The problem with it as it is now is that when a new user, or even an
existing user, specifies assumed_gamma 1.0 as recommended, all of his
scenes will become needlessly bright, diminishing the visual quality
of the result. Usually he will not know that there's something wrong
with the ambient finish setting and that he needs to manually adjust
it. I see absolutely no reason why it should be manually adjusted in
order to retain the good-looking level of brightness. That should be
the default. You only need to adjust it if you really want some other
level of brightness.

-- 
                                                          - Warp


Post a reply to this message

From: Warp
Subject: Re: gamma handling discussion
Date: 4 Nov 2016 04:25:21
Message: <581c45f0@news.povray.org>
Cousin Ricky <ric### [at] yahoocom> wrote:
> >> http://koti.kapsi.fi/warp/media/pov37_test2.png
> >> http://koti.kapsi.fi/warp/media/pov37_test4.png

> As far as I'm concerned, the default ambient is just a place holder. 
> That said, on those occasions when I forgo radiosity, my ambient value 
> is usually greater than rgb 0.1, even though I use assumed_gamma 1.  The 
> scenes in which I use less than rgb 0.1 all have a very dark 
> environment.  This is to say that rgb 0.1 is a perfectly fine default, 
> and I would certainly not lower it.

You honestly think that pov37_test4.png looks better than pov37_test2.png
above?

My question pertains to how POV-Ray should behave by default. If you are
not aware of any #default statements and ambient finishes, and you use
assumed_gamma 1.0 and specify all colors in terms of srgb, which one of
those two images should be the default result?

(Note that the first one corresponds to the ambient finish brightness you
got in POV-Ray 3.6 using all default values.)

-- 
                                                          - Warp


Post a reply to this message

From: Cousin Ricky
Subject: Re: gamma handling discussion
Date: 4 Nov 2016 06:50:00
Message: <web.581c67c7d8b64c9e6546fe630@news.povray.org>
Warp <war### [at] tagpovrayorg> wrote:
> Cousin Ricky <ric### [at] yahoocom> wrote:
> > >> http://koti.kapsi.fi/warp/media/pov37_test2.png
> > >> http://koti.kapsi.fi/warp/media/pov37_test4.png
>
> > As far as I'm concerned, the default ambient is just a place holder.
> > That said, on those occasions when I forgo radiosity, my ambient value
> > is usually greater than rgb 0.1, even though I use assumed_gamma 1.  The
> > scenes in which I use less than rgb 0.1 all have a very dark
> > environment.  This is to say that rgb 0.1 is a perfectly fine default,
> > and I would certainly not lower it.
>
> You honestly think that pov37_test4.png looks better than pov37_test2.png
> above?

I did not say that.  I said that the problem with pov37_test4.png is in the lack
of ambient inclusion, not the ambient light level.


Post a reply to this message

From: clipka
Subject: Re: gamma handling discussion
Date: 4 Nov 2016 07:58:02
Message: <581c77ca$1@news.povray.org>
Am 04.11.2016 um 09:19 schrieb Warp:

> [ambient]
> The problem with it as it is now is that when a new user, or even an
> existing user, specifies assumed_gamma 1.0 as recommended, all of his
> scenes will become needlessly bright, diminishing the visual quality
> of the result. Usually he will not know that there's something wrong
> with the ambient finish setting and that he needs to manually adjust
> it. I see absolutely no reason why it should be manually adjusted in
> order to retain the good-looking level of brightness. That should be
> the default. You only need to adjust it if you really want some other
> level of brightness.

Well, I absolutely do see a reason: Maintaining backward compatibility.

It can be argued whether that reason is strong enough, but anyone
claiming that they see absolutely no reason is either blind,
deliberately closing their eyes, or deliberately misleading the audience.


Post a reply to this message

From: Cousin Ricky
Subject: Re: gamma handling discussion
Date: 4 Nov 2016 08:55:01
Message: <web.581c84fbd8b64c9e6546fe630@news.povray.org>
"Cousin Ricky" <rickysttATyahooDOTcom> wrote:
> I did not say that.  I said that the problem with pov37_test4.png is in the lack
> of ambient inclusion, not the ambient light level.

*occlusion


Post a reply to this message

From: Warp
Subject: Re: gamma handling discussion
Date: 6 Nov 2016 01:12:08
Message: <581ebba8@news.povray.org>
Cousin Ricky <rickysttATyahooDOTcom> wrote:
> Warp <war### [at] tagpovrayorg> wrote:
> > Cousin Ricky <ric### [at] yahoocom> wrote:
> > > >> http://koti.kapsi.fi/warp/media/pov37_test2.png
> > > >> http://koti.kapsi.fi/warp/media/pov37_test4.png
> >
> > > As far as I'm concerned, the default ambient is just a place holder.
> > > That said, on those occasions when I forgo radiosity, my ambient value
> > > is usually greater than rgb 0.1, even though I use assumed_gamma 1.  The
> > > scenes in which I use less than rgb 0.1 all have a very dark
> > > environment.  This is to say that rgb 0.1 is a perfectly fine default,
> > > and I would certainly not lower it.
> >
> > You honestly think that pov37_test4.png looks better than pov37_test2.png
> > above?

> I did not say that.  I said that the problem with pov37_test4.png is in the lack
> of ambient inclusion, not the ambient light level.

The question is how POV-Ray should act by default, when there is no #default
directive specifying the ambient finish. Should it produce the first or the
second image? Why should it procude the second image?

-- 
                                                          - Warp


Post a reply to this message

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