Available since LÖVE 0.9.0
This enum is not supported in earlier versions.
Canvas formats.
rgba8
format, or the srgb
format if gamma-correct rendering is enabled in LÖVE 0.10.0 and newer.rgba16f
format, normally.rgba8
, but the Canvas is interpreted as being in the sRGB color space. Everything drawn to the Canvas will be converted from linear RGB to sRGB. When the Canvas is drawn (or used in a shader), it will be decoded from sRGB to linear RGB. This reduces color banding when doing gamma-correct rendering, since sRGB encoding has more precision than linear RGB for darker colors.
The 16 bpp RGB and RGBA formats use half as much VRAM as the 32 bpp RGBA formats, but they have significantly lower quality.
The HDR / floating point formats are 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 can then be used in a custom shader.
The sRGB format should only be used when doing gamma-correct rendering, which is an advanced topic and it's easy to get color-spaces mixed up. If you're not sure whether you need this, you might want to avoid it. Read more about gamma-correct rendering here, here, and here.
Not all systems support every format. Use love.graphics.getCanvasFormats to check before creating the Canvas.
In general, rgba8
, rgba4
, and rgb5a1
are supported everywhere. rgb10a2
is also supported everywhere on desktop platforms.
The regular single- and two-channel formats (r8
and rg8
), as well as the srgb
format, are supported on desktop graphics cards capable of OpenGL 3+ / DirectX 10+ (nvidia GeForce 8000 series and up, ATI/AMD HD 2000 series and up, and the Intel HD 2000 and up), and mobile GPUs capable of OpenGL ES 3.
The floating-point formats (rgba16f
, rgba32f
, rg11b10f
, r16f
, rg16f
, r32f
, and rg32f
) are supported on OpenGL 3-capable desktop graphics cards, and some OpenGL ES 3 mobile GPUs. The 32-bit-per-channel floating point formats are rarely supported on mobile devices.
rgb565
is often only supported on OpenGL ES / mobile devices, or with very new desktop OpenGL drivers.
© 2006–2016 LÖVE Development Team
Licensed under the GNU Free Documentation License, Version 1.3.
https://love2d.org/wiki/CanvasFormat