Difference between revisions of "TextureFormat"

m (Clarified descriptions for constants)
(Cleaned up formatting and added some notes)
Line 2: Line 2:
 
Controls the canvas texture format.
 
Controls the canvas texture format.
 
== Constants ==
 
== Constants ==
{{constant|normal|The default texture format: 8 bits per channel (32 bpp) RGBA.}}
+
;normal: The default texture format: 8 bits per channel (32 bpp) RGBA. Color channel values range from 0-255 (0-1 in shaders.)
{{constant|hdr|The HDR texture format: floating point 16 bits per channel (64 bpp) RGBA.}}
+
;hdr: The high dynamic range texture format: floating point 16 bits per channel (64 bpp) RGBA. Color channel values inside the Canvas range from -infinity to +infinity.
 +
== Notes ==
 +
The HDR format is most useful when combined with pixel shaders. Effects such as tonemapped HDR with bloom can be accomplished, or the canvas can be used to store arbitrary non-color data such as positions which are then interpreted and used in a shader, as long as you draw the right things to the canvas.
 +
 
 +
Not all systems which support Canvases will support the HDR format, use [[love.graphics.isSupported]] to check before creating the Canvas.
 
== See Also ==
 
== See Also ==
 
* [[parent::love.graphics]]
 
* [[parent::love.graphics]]
 
* [[love.graphics.newCanvas]]
 
* [[love.graphics.newCanvas]]
 +
* [[love.graphics.isSupported]]
 
[[Category:Enums]]
 
[[Category:Enums]]
 
{{#set:Description=Controls the canvas texture format.}}
 
{{#set:Description=Controls the canvas texture format.}}
 
== Other Languages ==
 
== Other Languages ==
 
{{i18n|TextureMode}}
 
{{i18n|TextureMode}}

Revision as of 03:46, 31 August 2013

Available since LÖVE 0.9.0
This enum is not supported in earlier versions.

Controls the canvas texture format.

Constants

normal
The default texture format: 8 bits per channel (32 bpp) RGBA. Color channel values range from 0-255 (0-1 in shaders.)
hdr
The high dynamic range texture format: floating point 16 bits per channel (64 bpp) RGBA. Color channel values inside the Canvas range from -infinity to +infinity.

Notes

The HDR format is most useful when combined with pixel shaders. Effects such as tonemapped HDR with bloom can be accomplished, or the canvas can be used to store arbitrary non-color data such as positions which are then interpreted and used in a shader, as long as you draw the right things to the canvas.

Not all systems which support Canvases will support the HDR format, use love.graphics.isSupported to check before creating the Canvas.

See Also

Other Languages