POV-Ray : Newsgroups : povray.beta-test : Gamma tutorial for the 3.7 documentation? : Re: Gamma tutorial for the 3.7 documentation? Server Time
5 Oct 2024 00:57:29 EDT (-0400)
  Re: Gamma tutorial for the 3.7 documentation?  
From: Sven Geier
Date: 4 Nov 2009 15:45:00
Message: <web.4af1e75ee70cefa25b4449250@news.povray.org>
Warp <war### [at] tagpovrayorg> wrote:

> [a number of interesting things]

I have to say: If the value of a message is measured by the amount of thinking
it inspires, then this was one of the most valuable messages I've seen on the
Internet in a while. After quite a bit of pondering, this is the most coherent
answer I can come up with.

Let me start here:

>Gamma correction is about how your *input* values are mapped to the
>output values. In other words, when in the *input* you say "I want 50%
>gray", gamma correction tells the program what it should write to the
>output image in order to get 50% gray.
>
> Gamma correction is also about telling in the image data that "this
>should be interpreted as 50% gray" so that if you view the image in a
>different system with a different display hardware with different gamma,
>that color will look like 50% gray there as well, and not eg. 40% or 60%
>gray.

I think these two paragraphs sum up a bit of a conflict: is gamma about the
input or the output? If you say that it specifies how I want a pixel to appear
on the screen, then it sure looks like it is a post-processing step after the
color of the pixel has already been computed in the linear rgb space. An
afterthought, if you will, to take care of the different output devices this
pixel might be displayed on. Which is in conflict with the claim that it is
about input conversion.

At this point, it might actually be nice to have a clear "mission statement"
that actually tells us what purpose all the futzing with gamma in POV is
actually supposed to have. Input? Output? Both? Some high-level declaration
against which we can measure any one change that is occuring: "does *this*
change really serve *that* purpose?"

But the real beef, the part that really made me think, was this innocent little
question:

>  If you specify "50% gray" in your scene file, and the end result is not
>50% gray on your screen, is that how you wanted it to work? Because that's
>how POV-Ray 3.6 works.

I had never really thought much about it, but I actually think *about POV-Ray*
in two different (sometimes incompatible) ways.

On the one side, I think of it in terms of physics. Photons interacting with
surfaces, watts per square meter per steradian emitted in certain given spectral
bands and then absorbed somewhere else. Diffraction, illumination, scattering.
All the wonderful bits of math involved. Conservation of energy. That kind of
thing.

From this perspective, your question up there doesn't make much sense: a
specification of "rgb 0.5" in my scene file is about the reality of a given
object, namely that it emits half as many watts per area into some solid angle
(given by things like specularity) as it received. This specification is
completely unrelated to any kind of output device - an object specified as "50%
grey" can appear on any one monitor as any one color, depending on the
illumination of that surface by light sources and other surfaces and by the
angle to and distance from the camera.

Heck, even if there is no camera at all. The object is still specified as "50%
grey" and that is still a property of the object and this "50% grey"-ness
influences how it reflects light onto other things even if the camera points in
the opposite direction. Whether this object is ever taken into account in the
creation of any one image depends on its geometric relationship with its
environment and the direction in which any one camera might be pointed. And if
it is in view in any one image, then it can appear on my screen as anything from
pitch black to pure white and anything in between, depending on the actual
illumination conditions.

The other perspective I have on POV-Ray is about art. A tool to make pretty
images. Here I care about composition, lighting, shapes, structure, texture etc.
The physical background goes away entirely.

I might look at a scene and say: "That thing there looks too dark compared to
what I am trying to achieve. I'd like to make it a little lighter". In this
context, I could not care less what *number* there is attached to any one
specification - like the "rgb ..." value in some pigment. If I want it lighter,
I might increase it. Until it looks right. Or do something completely different
like increase "ambient" or such.

What I am concerned about there is the actual pixels on my screen, the image
that is being created - and all the vectors and color specs and whatnot become
mere utilities to that end. I want a grey that "looks a little lighter than that
and a shade colder" and from an artistic perspective I know I can make it a
little colder by making it a little bluer which I can achieve by raising the
blue component in my "ambient" statement and voila: I have changed the
appearance of an object even though its pigment is still specified as "rgb 0.5".
Or maybe "rgb 0.1" or "rgb 5.7". Or whatever I may have tinkered with to make
something *look* right.

From this perspective your question doesn't make much sense either - if I want
50% grey then there's a million buttons to turn and very rarely will there
happen to be a number "0.5" in there somewhere. Maybe the object is specified as
"0.7" and with a negative ambient illumination or something weird like that -
because it served some artistic purpose elsewhere.

All this said, here's my take on your question:

>  If you specify "50% gray" in your scene file, and the end result is not
>50% gray on your screen, is that how you wanted it to work?

If I specify "50% gray" in a scene file and there happens to be a pixel on my
screen that happens to come out 50% gray, then this would be mere coincidence.
It's not that I "want" it to come out differently, but it sure isn't like I
"wanted" it to come out this way either. From a physics perspective the "50%
grey" in the input is the reality and the resulting image (if any) is just
incidental to that reality and carries the properties of my camera and my light
sources in it - and from an arts perspective the image is all there is to it and
whether any of the numbers that entered into making the image happens to be
"0.5" or "128" or or "#808080" or "374629.4432" makes no difference to the end
result.

All that said - my preferred way of looking at POV-Ray is from an arts
perspective. I'm a physicist and if I have a situation where I really care about
the reality of the light propagation I'll run Zemax or Code-V; POV-Ray doesn't
cut it there. It's a toy, in the end.

And from an arts perspective, the recent betas of 3.7 have produced results that
looked like foot. But looked a lot better if I take them individually into a
paint program after the fact - and reduce gamma by about ~50%.

Am I the only one who looks at things this way? Who is the target audience here,
really? And what do they want and think? I am honestly curious.


Post a reply to this message

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