Available since LÖVE 11.0 |
This function is not supported in earlier versions. |
![]() |
This function can be slow if it is called repeatedly, such as from love.update or love.draw. If you need to use a specific resource often, create it once and store it somewhere it can be reused! |
Cubemap images have 6 faces (sides) which represent a cube. They can't be rendered directly, they can only be used in Shader code (and sent to the shader via Shader:send).
To use a cubemap image in a Shader, it must be declared as a CubeImage
or samplerCube
type (instead of Image
or sampler2D
). The Texel(CubeImage image, vec3 direction)
shader function must be used to get pixel colors from the cubemap. The vec3 argument is a normalized direction from the center of the cube, rather than explicit texture coordinates.
Each face in a cubemap image must have square dimensions.
For variants of this function which accept a single image containing multiple cubemap faces, they must be laid out in one of the following forms in the image:
+y +z +x -z -y -x
or:
+y -x +z +x -z -y
or:
+x -x +y -y +z -z
or:
+x -x +y -y +z -z
Creates a cubemap Image given a single image file containing multiple cube faces.
image = love.graphics.newCubeImage( filename, settings )
string filename
table settings (nil)
boolean mipmaps (false)
boolean linear (false)
Image image
Creates a cubemap Image given a different image file for each cube face.
image = love.graphics.newCubeImage( faces, settings )
table faces
table settings (nil)
boolean mipmaps (false)
boolean linear (false)
Image image