|
|
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
|
|
|
|
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
|
|
|
|
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
|
|