POV-Ray : Newsgroups : povray.programming : exposure control woes Server Time
23 Dec 2024 14:46:05 EST (-0500)
  exposure control woes (Message 1 to 4 of 4)  
From: Kevin Loney
Subject: exposure control woes
Date: 22 Sep 2002 19:45:20
Message: <3d8e5610$1@news.povray.org>
I'm trying to implement logarithimic exposure control in 3.5, all was going
well until I tried large values for the exposure time, for some reason it is
clipping the colors really wierd and I'm getting strange black bands
everywhere. any thoughts as to why? If this isn't very clear I can post an
example pic on p.b.i

//The function
void Expose_Color (COLOUR Color, DBL Time)
{
 register DBL gray, expgray;
 gray = GREY_SCALE(Color);
 if(gray)
 {
  expgray = 1-exp(-Time*gray);
  Color[pRED] = (expgray/gray) * Color[pRED];
  Color[pGREEN] = (expgray/gray) * Color[pGREEN];
  Color[pBLUE] = (expgray/gray) * Color[pBLUE];
 }
}

//The call (render.cpp)
if(Frame.Exposure_Time)
{
  Expose_Color(Colour,Frame.Exposure_Time);
}

note: this is in 3.5

--
Kevin
http://www.geocities.com/qsquared_1999/
#macro _(r)#if(r<12)#local i=asc(substr("oqshilacefg",r,1))-97;
disc{<mod(i,7)-3,div(i,7)-1,6>,z,.4pigment{rgb 10}}_(r+1)
#end#end _(1)//KL


Post a reply to this message

From: Kari Kivisalo
Subject: Re: exposure control woes
Date: 23 Sep 2002 07:14:52
Message: <3D8EF7B8.A5596C82@luxlab.com>
Kevin Loney wrote:
>
> I'm getting strange black bands
> everywhere. any thoughts as to why?
>
> void Expose_Color (COLOUR Color, DBL Time)
> {
>  register DBL gray, expgray;
>  gray = GREY_SCALE(Color);
>  if(gray)
>  {
>   expgray = 1-exp(-Time*gray);
>   Color[pRED] = (expgray/gray) * Color[pRED];
>   Color[pGREEN] = (expgray/gray) * Color[pGREEN];
>   Color[pBLUE] = (expgray/gray) * Color[pBLUE];
>  }
> }

The color channels are separate so try this:

Color[pRED] =   1-exp(-Time*Color[pRED]);
Color[pGREEN] = 1-exp(-Time*Color[pGREEN]);
Color[pBLUE] =  1-exp(-Time*Color[pBLUE]);



_____________
Kari Kivisalo


Post a reply to this message

From: Kari Kivisalo
Subject: Re: exposure control woes
Date: 24 Sep 2002 14:07:29
Message: <3D90A9E7.8E9E3FCE@luxlab.com>
The clipping and black bands are caused by the grayscale conversion.
Some components will get values higher than one. 


color = rgb<0.1,0,1>

gray = 0.3 * red + 0.59 * green + 0.11 * blue  (NTSC formula)
 
gray = 0.14

expgray = 1 - exp(-10*gray) = 0.75

expgray/gray * color.blue = 5.4



_____________
Kari Kivisalo


Post a reply to this message

From: Kari Kivisalo
Subject: Re: exposure control woes
Date: 9 Nov 2002 05:27:35
Message: <3DCCE315.323FD54@luxlab.com>
Kevin Loney wrote:
> 
> I'm trying to implement logarithimic exposure control in 3.5

Since you are not going to use the equations I suggested I will
make my own logarithimic exposure control patch from them.


_____________
Kari Kivisalo


Post a reply to this message

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