Another type of Texture where you can place a square Texture on each face of a cube; once assembled you can sample the Cubemap in a shader using a normalized direction vector. Creating a Cubemap is as simple as creating a Texture at the exception that you will have to provide six separate Texture to map left, right, up, down as well as front and back. It is mostly used for environment mapping but can also be useful for a wide range of different effects.
See Also
Static Variables
Name | Description |
asset | The parent Asset associated to the active Cubemap. |
Declaration
|
usage | The current UsageType of the current Cubemap. |
Declaration - Note
- Cubemaps UsageType can only be either
kStatic or kDynamic .
|
sampler | Maintain the internal sampler parameters sent to the graphics engine when the Cubemap was created. |
Declaration
|
Variables
Name | Description |
options | Bit mask of the current TexmapOptions used to generate the Cubemap. |
Declaration - Warning
- Only available when using
kDynamic Cubemap.
|
byte | Amount of bytes the Cubemap have been generated with. |
Declaration - Warning
- Only available when using
kDynamic Cubemap.
|
Functions
Name | Description |
SetFace | Assign a Texture to a specific face of the Cubemap. |
Declaration bool SetFace( const FaceType face, Texture *texture ) Parameters
face : The face index where to apply to Texture.
texture : An existing Texture asset to apply on the face specified. To disconnect the Texture set the texture parameter to nil .
Return Value
true if the Texture have been applied or removed to the face received in parameter. false if the UsageType of the Cubemap is not kStatic or if the face is out of bounds.
|
GetFace | Return the Texture used by a specific face. |
Declaration Texture *GetFace( const FaceType face ) Parameters
Return Value
A Texture reference (if any); else nil if no Texture is currently in used for the face specified or if the face is out of bounds.
|
Update | Manually trigger an update (and an optional rebuild) of the Cubemap. |
Declaration void Update( bool rebuild ) Parameters
rebuild : Determine if the Cubemap should be internally rebuilt from scratch with a new texture id.
|
Generate | Manually generate the necessary Texture space for the active Cubemap (kStatic type only). |
Declaration bool Generate( const unsigned short size, const TexmapOptions options, const unsigned char byte ) Parameters
size : The size in texels to use for each face.
options : Bit mask of TexmapOptions to pass down when generating the Cubemap using the underlying graphics API.
byte : The amount of color component per texel.
Return Value
true if the generated successfully; else false if the Cubemap is not kDynamic .
|