POV-Ray : Newsgroups : povray.beta-test : Strange alpha channel bug Server Time
2 Nov 2024 11:24:46 EDT (-0400)
  Strange alpha channel bug (Message 1 to 4 of 4)  
From: Anders K 
Subject: Strange alpha channel bug
Date: 7 Dec 2001 20:11:33
Message: <3c1168c5$1@news.povray.org>
I have a white plane that is half transparent (rgbt <1, 1, 1, 1/2>), and a
sphere on top of the plane that casts a shadow on it. I was then looking at
the alpha channel with GIMP's color picker tool. On the part of the plane
that's in the light, the alpha value is 186 (= the gamma-corrected version
of 1/2), as it should be. However, on the part of the plane that's in
shadow, the alpha value is 127, the *non*-gamma corrected version of 1/2!

Here's a simplified version of my scene that demonstrates the problem.

  // +ft +ua
  global_settings { assumed_gamma 1.0 }
  camera { orthographic location 10*z look_at 0 up y right 4/3*x }
  light_source { <-10, 10, 20> color rgb 1 }
  plane {
    z, 0 pigment { rgbt <1, 1, 1, 1/2> }
    finish { diffuse 1 ambient 0 brilliance 0 }
  }
  sphere { <0, 0, 5/16>, 5/16 pigment { rgb <1, 0, 0> } }

The "finish" line on the plane makes the plane pure white in the light, and
pure black in shadow. If you comment out this line, the alpha value in the
light becomes 147, while the alpha value in the shadow remains 127. It
should be 186 in both cases.

If the assumed_gamma 1.0 line is commented out, the alpha value in both the
light and the shadow is 127, as it should be (since there is no gamma
correction). So this definately has something to do with gamma correction,
but I don't see why it would. Shouldn't the color values only be
gamma-corrected at the very end, as part of writing the image file output?
Anyway, this bug should hopefully be easy to track down.

POV-Ray 3.5 beta 8, Windows 98, Athlon 700, 256 MB

Anders


Post a reply to this message

From: Anders K 
Subject: Re: Strange alpha channel bug
Date: 12 Dec 2001 10:55:29
Message: <3c177df1@news.povray.org>
Can someone confirm this please?

"Anders K." <and### [at] f2scom> wrote in message
news:3c1168c5$1@news.povray.org...
> I have a white plane that is half transparent (rgbt <1, 1, 1, 1/2>), and a
> sphere on top of the plane that casts a shadow on it. I was then looking
at
> the alpha channel with GIMP's color picker tool. On the part of the plane
> that's in the light, the alpha value is 186 (= the gamma-corrected version
> of 1/2), as it should be. However, on the part of the plane that's in
> shadow, the alpha value is 127, the *non*-gamma corrected version of 1/2!
>
> Here's a simplified version of my scene that demonstrates the problem.
>
>   // +ft +ua
>   global_settings { assumed_gamma 1.0 }
>   camera { orthographic location 10*z look_at 0 up y right 4/3*x }
>   light_source { <-10, 10, 20> color rgb 1 }
>   plane {
>     z, 0 pigment { rgbt <1, 1, 1, 1/2> }
>     finish { diffuse 1 ambient 0 brilliance 0 }
>   }
>   sphere { <0, 0, 5/16>, 5/16 pigment { rgb <1, 0, 0> } }
>
> The "finish" line on the plane makes the plane pure white in the light,
and
> pure black in shadow. If you comment out this line, the alpha value in the
> light becomes 147, while the alpha value in the shadow remains 127. It
> should be 186 in both cases.
>
> If the assumed_gamma 1.0 line is commented out, the alpha value in both
the
> light and the shadow is 127, as it should be (since there is no gamma
> correction). So this definately has something to do with gamma correction,
> but I don't see why it would. Shouldn't the color values only be
> gamma-corrected at the very end, as part of writing the image file output?
> Anyway, this bug should hopefully be easy to track down.
>
> POV-Ray 3.5 beta 8, Windows 98, Athlon 700, 256 MB
>
> Anders


Post a reply to this message

From: Anders K 
Subject: Re: Strange alpha channel bug
Date: 21 Dec 2001 18:12:58
Message: <3c23c1fa$1@news.povray.org>
This is still present in beta 9. Can someone confirm this please?

Anders

"Anders K." <and### [at] f2scom> wrote in message
news:3c1168c5$1@news.povray.org...
> I have a white plane that is half transparent (rgbt <1, 1, 1, 1/2>), and a
> sphere on top of the plane that casts a shadow on it. I was then looking
at
> the alpha channel with GIMP's color picker tool. On the part of the plane
> that's in the light, the alpha value is 186 (= the gamma-corrected version
> of 1/2), as it should be. However, on the part of the plane that's in
> shadow, the alpha value is 127, the *non*-gamma corrected version of 1/2!
>
> Here's a simplified version of my scene that demonstrates the problem.
>
>   // +ft +ua
>   global_settings { assumed_gamma 1.0 }
>   camera { orthographic location 10*z look_at 0 up y right 4/3*x }
>   light_source { <-10, 10, 20> color rgb 1 }
>   plane {
>     z, 0 pigment { rgbt <1, 1, 1, 1/2> }
>     finish { diffuse 1 ambient 0 brilliance 0 }
>   }
>   sphere { <0, 0, 5/16>, 5/16 pigment { rgb <1, 0, 0> } }
>
> The "finish" line on the plane makes the plane pure white in the light,
and
> pure black in shadow. If you comment out this line, the alpha value in the
> light becomes 147, while the alpha value in the shadow remains 127. It
> should be 186 in both cases.
>
> If the assumed_gamma 1.0 line is commented out, the alpha value in both
the
> light and the shadow is 127, as it should be (since there is no gamma
> correction). So this definately has something to do with gamma correction,
> but I don't see why it would. Shouldn't the color values only be
> gamma-corrected at the very end, as part of writing the image file output?
> Anyway, this bug should hopefully be easy to track down.
>
> POV-Ray 3.5 beta 8, Windows 98, Athlon 700, 256 MB
>
> Anders
>
>
>


Post a reply to this message

From: Rune
Subject: Re: Strange alpha channel bug
Date: 22 Dec 2001 05:38:45
Message: <3c2462b5@news.povray.org>
"Anders K." wrote:
> This is still present in beta 9. Can someone confirm this please?

I confirm.

When assumed_gamma is set to 1.0 the illuminated part of the plane is 73%
opaque, while the shadowed area is still 50% opaque. They should be equally
opaque, just like they are when there's no gamma correction.

Rune
--
3D images and anims, include files, tutorials and more:
Rune's World:    http://rsj.mobilixnet.dk (updated Nov 5)
POV-Ray Users:   http://rsj.mobilixnet.dk/povrayusers/
POV-Ray Webring: http://webring.povray.co.uk


Post a reply to this message

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