rcmaniac25 / GamePlay

Open-source, cross-platform 3D native C++ game framework making it easy to learn and write mobile and desktop games.
www.gameplay3d.org
1 stars 1 forks source link

HDR Support #30

Open rcmaniac25 opened 10 years ago

rcmaniac25 commented 10 years ago

There are two parts to this: HDR Textures and HDR Rendering.

HDR Rendering requires at least OpenGL 3.0, OpenGL ES 3.0, or GL_EXT_color_buffer_float/GL_EXT_color_buffer_half_float + Framebuffer support (which GamePlay supports by default).

For HDR rendering, 16bit floats work better then 32bit in terms of performance (at least, that was the case in 2008). Regardless of format, the rendered scene can then be tone-mapped, bloom, etc. based on actual lighting.

It's hand-wavey to describe, but the effects of HDR are fantastic for many games and are often used now for areas where a player may go from a dark or light area to an area of differing contrast, lighting changes, etc. For more info, play Half Life 2: Lost Coast, or any game from ~2007 on...

It can mainly be done with shaders to perform the tone mapping.

HDR Textures is less of a problem then rendering. It mainly requires that Radiance and/or OpenEXR file formats are supported and that floating point textures are supported (OpenGL 3.0, OpenGL ES 3.0, GL_OES_texture_float).

It would also be interesting if HDR screenshots could be taken. There already is a screenshot function built into FrameBuffers. The challenge is doing it with floats so that an HDR one can be captured.

Sources: