POV-Ray : Newsgroups : povray.binaries.images : Minus Values in Assumed_Gamma = Strange :) : Re: Minus Values in Assumed_Gamma = Strange :) Server Time
19 Aug 2024 16:11:59 EDT (-0400)
  Re: Minus Values in Assumed_Gamma = Strange :)  
From: Chris Huff
Date: 12 Nov 2000 17:48:27
Message: <chrishuff-0B5574.17483712112000@news.povray.org>
In article <3a0efbd8@news.povray.org>, "Jan Walzer" <jan### [at] lzernet> 
wrote:

> So this is what I originaly ment ... If you use the
> gamma-correction(with negativ values) on an antialiased image ,
> you don't have any longer the effect of antialiasing. The GC
> could produce again (unexpected) stairsteps.

You would still have the effect of antialiasing, though there will be 
additional "jaggies" from the gamma function itself.


> Of course, we often have other functions in POV, working with
> unrealistic values (negative pigments or lights ...[New question:
> what is with negative IOR ???]), but they are or could be quite
> predictable, but what do you expect from a negative gamma value
> ??? How would define the result ???

Define it as whatever you get when you feed negative input to the gamma 
function. :-)

Negative ior may not be unrealistic. The ior of a bubble of air in water 
is lower than the ior of water, it just makes the light bend the other 
way. An ior of 1 usually means no effect, because POV sets the ior of 
"space" to 1. It is the change in ior that causes light to bend...


> BTW: has someone here have the code for the gamma function ???

I said it was probably simple. :-)
The variable opts.GammaFactor is set to assumed_gamma/DisplayGamma in 
parse.c.

render.c:
static void gamma_correct(COLOUR Colour)
{
  if (opts.Options & GAMMA_CORRECT)
  {
    Colour[RED]   = pow(Colour[RED],  opts.GammaFactor);
    Colour[GREEN] = pow(Colour[GREEN],opts.GammaFactor);
    Colour[BLUE]  = pow(Colour[BLUE], opts.GammaFactor);
  }
}

And as far as I can tell, Clip_Colour() is always called on the color 
before this, then the gamma function is called, then the result is added 
to the pixel before averaging of values. I'm not sure if the last part 
is correct, I noticed that focal blur was changed so individual samples 
weren't corrected.

-- 
Christopher James Huff
Personal: chr### [at] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/

<><


Post a reply to this message

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