openexr-devel
[Top][All Lists]
Advanced

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

[Openexr-devel] Re: LUT for HDR-histograms, too?


From: Drew Hess
Subject: [Openexr-devel] Re: LUT for HDR-histograms, too?
Date: Mon, 26 Jan 2004 15:50:33 -0800 (PST)

On Tue, 27 Jan 2004, Matthias Biedermann wrote:

> 1) The pipeline-comment mentions that applying the exposure has to be
> limited to rgb only. However, the line "half4 c = h4texRECT (image,
> texCoord) * expMult;" does the multiplication to all four components of
> the half4, doesn't it? Or have I just missed the details of
> "h4texRECT"...?


err.. yeah, that's a bug.  I should probably make expMult a float4 and set
the 'a' component to 1.0.  (It can be set by the calling program, need not
be done in the shader.)  It doesn't show up in my app because I don't
display the alpha, but that would be a problem if you comp'ed the output
of this shader with something else.


> 2) Do you think the same approach (using a 2D-texture as lut indexed by
> floats) would work with creating a histogram of the HDR-image? As I need
> some information about the "light sources" of the HDR-Envmap, some sort
> of image processing (binary/n-ary thresholding) based on the image's
> histogram has to be performed beforehand...


Well in the shader I posted, you really want a 1x65k 1D texture for the
lookup, but because you can't make a texture that large, we use this trick
of folding it into a 256x256 2D texture and then splitting the half color
component from the HDR texture into two 8-bit indicies.

I guess you could render to texture, where the histogram is a 256x256 2D
texture and the color value in the HDR texture is your index into the
histogram texture.  Then you need to do a read-modify-write on the
histogram texture (read, add one, write)... that's the tricky part.


-dwh-







reply via email to

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