|Available since LÖVE 0.9.2|
|This enum is not supported in earlier versions.|
- The default Canvas format - an alias for the
- 8 bits per channel (32 bpp) RGBA. Color channel values range from 0-255 (0-1 in shaders.)
- 4 bits per channel (16 bpp) RGBA.
- RGB with 5 bits each, and a 1-bit alpha channel (16 bpp.)
- RGB with 5, 6, and 5 bits each, respectively (16 bpp). There is no alpha channel in this format.
- RGB with 10 bits per channel, and a 2-bit alpha channel (32 bpp.)
- A format suitable for high dynamic range content - an alias for the
- Floating point RGBA with 16 bits per channel (64 bpp.) Color values can range from [-infinity, +infinity].
- Floating point RGBA with 32 bits per channel (128 bpp.) Color values can range from [-infinity, +infinity].
- Floating point RGB with 11 bits in the red and green channels, and 10 bits in the blue channel (32 bpp.) There is no alpha channel. Color values can range from [0, +infinity].
- The same as
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.
The 16 bpp formats use half as much VRAM as the 32 bpp formats, but they have significantly lower quality than regular
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.
rgb10a2 are supported everywhere. The floating-point formats (
srgb are supported on 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.)
rgb565 is often only supported on OpenGL ES or very new desktop OpenGL drivers.
Tiếng Việt –