If you ever tried
to implement high dynamic range (HDR) rendering, you
probably noticed a few things:
- HDR requires a
rendertarget format with more than 8 bit precision
- If you
want to draw anything interesting, this format needs to support alpha
blending
- There is no consistently available format that
meets these requirements :-(
XNA Game Studio 4.0
introduces a new SurfaceFormat.HdrBlendable with the following
characteristics:
- Guaranteed to be supported for textures
and rendertargets (but not the backbuffer) by all HiDef devices
- Supports alpha blending
- Floating point format with
platform specific precision
- RGB
- At least 7 bits mantissa
- At least 3 bits
exponent
- Range at least 0 to 31.875
- Smallest nonzero value <= (1 / 512)
- May or
may not support NaN, Inf + denorms
- Alpha
- At least 2 bits
- Range at least 0 to 1
- When used with GetData or SetData, pixel values are encoded as
HalfVector4
- Only supports point sampling (no filtering)
On Xbox, this is implemented using an Xbox specific 7e3 (32
bits per pixel) EDRAM format. On Windows, it is implemented using
HalfVector4.