openexr-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Openexr-user] opaque colors


From: Chris Cox
Subject: Re: [Openexr-user] opaque colors
Date: Tue, 25 May 2004 12:01:19 -0700

Are you applying the toning per-channel?
Don't do that.
You apply the toning to the luminance (which usually turns into a multiplier on the channels).

Chris



At 12:08 PM +0200 5/25/04, Enrico Borrione wrote:
hi all,
i am working on a little application using exr cube maps.
The 3D part works via opensg, a graphic library built on top of opengl.
This is my problem: I correctly load the exr image in half format.
Since opensg has no support for 16bit floats, i store the pixels as 16
ints.
After that loading, in the rendering part, i use a fragment program to
process the pixel, adding exposure and other stuff (actually the same
tonemapping used in the exrdisplay program.)
now my sphere is textured and the exposure works, thou the colors have
lost all the brightness, looking all grayish and giving the impression
the the ball is covered in dust. If i turn on also the gamma correction
computation the problem hardens and the sphere is almost in grayscale.
I'd send a jpg of the sphere but i dunno if it is allowed, so better ask
first...

my fp looks like:

# Fragment Params
PARAM exposure = program.local[0];
PARAM one_over_gamma = {0.4545,0,0,0};
#middle gray with no gamma corr
PARAM middle_gray = {0.0883,0.0883,0.0883,1.0};

# Fragment inputs
ATTRIB inTexCoord = fragment.texcoord;      # First set of texture
coordinates
ATTRIB inColor    = fragment.color.primary; # Diffuse interpolated color


# Fragment outputs
OUTPUT outColor   = result.color;

TEMP texelcolor;
TEX texelcolor, inTexCoord, texture[0], CUBE;

TEMP texelColor,luminance, m_exp, t_exp, temp_inColor, temp_outColor,
temp_inColor2, outColor2;
TEX texelColor, inTexCoord, texture[0], CUBE;

ADD t_exp.x, exposure.x, 2.47393;
EX2 m_exp, t_exp.x;
MUL temp_inColor2.xyz, texelColor, m_exp.x;

POW temp_outColor.x, temp_inColor2.x, one_over_gamma.x;
POW temp_outColor.y, temp_inColor2.y, one_over_gamma.x;
POW temp_outColor.z, temp_inColor2.z, one_over_gamma.x;

#don't use the gamma, otherwise all the colors become gray...
#MUL outColor, temp_outColor, middle_gray;
MUL outColor, temp_inColor2, middle_gray;

END

now where can possibly hide the problem? maybe in the half/int parsing?
i dunno much of tonemapping tecniques, so finding the error it's a bit
tricky for me...
thx enrico



_______________________________________________
Openexr-user mailing list
address@hidden
http://mail.nongnu.org/mailman/listinfo/openexr-user





reply via email to

[Prev in Thread] Current Thread [Next in Thread]