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:
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.setSampler(context.createSampler({ minificationFilter : TextureMinificationFilter.NEAREST_MIPMAP_LINEAR }));
-
-
getFlipY
-
Returns true if the source pixels are flipped vertically when cube-map faces are created or updated, i.e.,
UNPACK_FLIP_Y_WEBGL
is used.Throws:
DeveloperError : This cube map was destroyed, i.e., destroy() was called.Returns:
Boolean True if the source pixels are flipped vertically; otherwise, false. -
getHeight
-
Returns 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.
Throws:
DeveloperError : This CubeMap was destroyed, i.e., destroy() was called.Returns:
Number The height, in texels, of faces in this cube map. -
getNegativeX
-
Returns the -x face of this cube map for modification, rendering to, etc.
Throws:
DeveloperError : This CubeMap was destroyed, i.e., destroy() was called.Returns:
CubeMapFace The -x face of this cube map. -
getNegativeY
-
Returns the -y face of this cube map for modification, rendering to, etc.
Throws:
DeveloperError : This CubeMap was destroyed, i.e., destroy() was called.Returns:
CubeMapFace The -y face of this cube map. -
getNegativeZ
-
Returns the -z face of this cube map for modification, rendering to, etc.
Throws:
DeveloperError : This CubeMap was destroyed, i.e., destroy() was called.Returns:
CubeMapFace The -z face of this cube map. -
getPixelDatatype
-
Returns the pixel datatype of this cube map. All faces in the same cube map have the same pixel datatype.
Throws:
DeveloperError : This CubeMap was destroyed, i.e., destroy() was called.Returns:
PixelDatatype The pixel datatype of this cubemap. -
getPixelFormat
-
Returns the pixel format of this cube map. All faces in the same cube map have the same pixel format.
Throws:
DeveloperError : This CubeMap was destroyed, i.e., destroy() was called.Returns:
PixelFormat The pixel format of this cubemap. -
getPositiveX
-
Returns the +x face of this cube map for modification, rendering to, etc.
Throws:
DeveloperError : This CubeMap was destroyed, i.e., destroy() was called.Returns:
CubeMapFace The +x face of this cube map. -
getPositiveY
-
Returns the +y face of this cube map for modification, rendering to, etc.
Throws:
DeveloperError : This CubeMap was destroyed, i.e., destroy() was called.Returns:
CubeMapFace The +y face of this cube map. -
getPositiveZ
-
Returns the +z face of this cube map for modification, rendering to, etc.
Throws:
DeveloperError : This CubeMap was destroyed, i.e., destroy() was called.Returns:
CubeMapFace The +z face of this cube map. -
getPreMultiplyAlpha
-
Returns true if the cubemap was created with premultiplied alpha (UNPACK_PREMULTIPLY_ALPHA_WEBGL).
Throws:
DeveloperError : This cube map was destroyed, i.e., destroy() was called.Returns:
Boolean true if the cubemap was created with premultiplied alpha; otherwise, false. -
getSampler
-
DOC_TBA
Throws:
DeveloperError : This CubeMap was destroyed, i.e., destroy() was called. -
getWidth
-
Returns the width, 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.
Throws:
DeveloperError : This CubeMap was destroyed, i.e., destroy() was called.Returns:
Number The width, in texels, of faces in this cube map. -
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:
-
setSampler
-
DOC_TBA
Parameters:
Name Type Argument Description sampler
<optional>
DOC_TBA Throws:
DeveloperError : This CubeMap was destroyed, i.e., destroy() was called.