I haven’t experimented with HDR yet, hoping to find time soon, but I’ve assumed thus far that the conversion can happen in the pixel shader, so you store the hdr texture as r,g,b,exponent and then in the pixel shader do the calculation to convert this into a single floating point triplet and do your bloom/glare/exposure calculations based on that. I’m not entirely sure why you’d ever need floating point texture formats either, surely this level of precision would never be noticed?
Check out this page: http://www.graphics.cornell.edu/%7Ebjw/rgbe.html
There is source included for reading RGBE format. Check out the function rgbe2float() to do the conversion yourself in a fragment program.
I believe there’s a format called “.hdr”, which I assume stores the pixels as 3 single precision floats, in which case I imagine it would be fairly straightforward to write a convertor from “.hdr” to “.rgbe” or is this being naive?
Originally posted by knackered: I believe there’s a format called “.hdr”, which I assume stores the pixels as 3 single precision floats, in which case I imagine it would be fairly straightforward to write a convertor from “.hdr” to “.rgbe” or is this being naive?
.hdr are RLE encoded RGBE images
yeah, i found more info last night, you simply upload your texture as RGBE (exponenet in the alpha channel),
and use a shader to decode the data into floats.
Originally posted by NitroGL: [quote]Originally posted by knackered: I believe there’s a format called “.hdr”, which I assume stores the pixels as 3 single precision floats, in which case I imagine it would be fairly straightforward to write a convertor from “.hdr” to “.rgbe” or is this being naive?
.hdr are RLE encoded RGBE images[/QUOTE]Really? Great to see another proliferation of file formats…why agree on one when 10 can keep people in work for years.
Originally posted by knackered:Really? Great to see another proliferation of file formats…why agree on one when 10 can keep people in work for years.
Yeah, though the RLE encoding is kind of odd. It only encodes per scanline, not the max run length. Or something like that anyway.
Personally I use RGBE encoded TGA images, with the TGA RLE encoding. Works pretty well, at least I think so.