new CubeMap
A cube map with faces +x, -x, +y, -y, +z, and -z. Cube maps are used for environment techniques like approximate reflection and refraction as used in the Reflection and Refraction Materials.
See:
Source:
Members
-
flipY :Boolean
-
True if the source pixels are flipped vertically when cube-map faces are created or updated, i.e.,
UNPACK_FLIP_Y_WEBGL
is used. -
height :Number
-
The height, in texels, of faces in this cube map. All faces in the same cube map have the same width and height, and the width equals the height.
-
negativeX :CubeMapFace
-
The negative x face of this cube map for modification, rendering to, etc.
-
negativeY :CubeMapFace
-
The negative y face of this cube map for modification, rendering to, etc.
-
negativeZ :CubeMapFace
-
The negative z face of this cube map for modification, rendering to, etc.
-
pixelDatatype :PixelDatatype
-
The pixel datatype of this cube map. All faces in the same cube map have the same pixel datatype.
-
pixelFormat :PixelFormat
-
The pixel format of this cube map. All faces in the same cube map have the same pixel format.
-
positiveX :CubeMapFace
-
The positive x face of this cube map for modification, rendering to, etc.
-
positiveY :CubeMapFace
-
The positive y face of this cube map for modification, rendering to, etc.
-
positiveZ :CubeMapFace
-
The positive z face of this cube map for modification, rendering to, etc.
-
preMultiplyAlpha :Boolean
-
True if the cubemap was created with premultiplied alpha (UNPACK_PREMULTIPLY_ALPHA_WEBGL).
-
sampler :Object
-
DOC_TBA
Methods
-
destroy
-
Destroys the WebGL resources held by this object. Destroying an object allows for deterministic release of WebGL resources, instead of relying on the garbage collector to destroy this object.
Once an object is destroyed, it should not be used; calling any function other thanisDestroyed
will result in a DeveloperError exception. Therefore, assign the return value (undefined
) to the object as done in the example.Throws:
DeveloperError : This cube map was destroyed, i.e., destroy() was called.Returns:
Example
cubeMap = cubeMap && cubeMap.destroy();
-
generateMipmap
-
Generates a complete mipmap chain for each cubemap face.
Parameters:
Name Type Argument Default Description hint
MipmapHint <optional>
MipmapHint.DONT_CARE A performance vs. quality hint. Throws:
-
DeveloperError : hint is invalid.
-
DeveloperError : This CubeMap's width must be a power of two to call generateMipmap().
-
DeveloperError : This CubeMap's height must be a power of two to call generateMipmap().
-
DeveloperError : This CubeMap was destroyed, i.e., destroy() was called.
Example
// Generate mipmaps, and then set the sampler so mipmaps are used for // minification when the cube map is sampled. cubeMap.generateMipmap(); cubeMap.sampler = context.createSampler({ minificationFilter : Cesium.TextureMinificationFilter.NEAREST_MIPMAP_LINEAR });
-
-
isDestroyed
-
Returns true if this object was destroyed; otherwise, false.
If this object was destroyed, it should not be used; calling any function other thanisDestroyed
will result in a DeveloperError exception.Returns:
Boolean True if this object was destroyed; otherwise, false.See: