public class Texture2D extends Texture
The texture width and height are no longer required to be an exact power of two. However, not all graphics devices supports non-power-of-two textures. If non-power-of-two texture mapping is unsupported on a particular Canvas3D, textures with a width or height that are not an exact power of two are ignored for that canvas.
Canvas3D.queryProperties()
ALLOW_ANISOTROPIC_FILTER_READ, ALLOW_BOUNDARY_COLOR_READ, ALLOW_BOUNDARY_MODE_READ, ALLOW_ENABLE_READ, ALLOW_ENABLE_WRITE, ALLOW_FILTER_READ, ALLOW_FORMAT_READ, ALLOW_IMAGE_READ, ALLOW_IMAGE_WRITE, ALLOW_LOD_RANGE_READ, ALLOW_LOD_RANGE_WRITE, ALLOW_MIPMAP_MODE_READ, ALLOW_SIZE_READ, ALPHA, ANISOTROPIC_NONE, ANISOTROPIC_SINGLE_VALUE, BASE_LEVEL, BASE_LEVEL_LINEAR, BASE_LEVEL_POINT, CLAMP, CLAMP_TO_BOUNDARY, CLAMP_TO_EDGE, FASTEST, INTENSITY, LUMINANCE, LUMINANCE_ALPHA, MULTI_LEVEL_LINEAR, MULTI_LEVEL_MIPMAP, MULTI_LEVEL_POINT, NICEST, RGB, RGBA, WRAP
Constructor and Description |
---|
Texture2D()
Constructs a texture object using default values.
|
Texture2D(int mipMapMode,
int format,
int width,
int height)
Constructs an empty Texture2D object with specified mipmapMode
format, width and height.
|
Texture2D(int mipMapMode,
int format,
int width,
int height,
int boundaryWidth)
Constructs an empty Texture2D object with specified mipMapMode,
format, width, height, and boundaryWidth.
|
Modifier and Type | Method and Description |
---|---|
NodeComponent |
cloneNodeComponent()
Deprecated.
replaced with cloneNodeComponent(boolean forceDuplicate)
|
void |
duplicateNodeComponent(NodeComponent originalNodeComponent)
Deprecated.
replaced with duplicateNodeComponent(
NodeComponent originalNodeComponent, boolean forceDuplicate)
|
getAnisotropicFilterDegree, getAnisotropicFilterMode, getBaseLevel, getBoundaryColor, getBoundaryModeS, getBoundaryModeT, getBoundaryWidth, getEnable, getFormat, getHeight, getImage, getImages, getLodOffset, getMagFilter, getMaximumLevel, getMaximumLOD, getMinFilter, getMinimumLOD, getMipMapMode, getWidth, numMipMapLevels, setAnisotropicFilterDegree, setAnisotropicFilterMode, setBaseLevel, setBoundaryColor, setBoundaryColor, setBoundaryModeS, setBoundaryModeT, setEnable, setImage, setImages, setLodOffset, setLodOffset, setMagFilter, setMaximumLevel, setMaximumLOD, setMinFilter, setMinimumLOD, setMipMapMode
cloneNodeComponent, duplicateNodeComponent, getDuplicateOnCloneTree, setDuplicateOnCloneTree
clearCapability, clearCapabilityIsFrequent, duplicateSceneGraphObject, getCapability, getCapabilityIsFrequent, getName, getUserData, isCompiled, isLive, setCapability, setCapabilityIsFrequent, setName, setUserData, toString, updateNodeReferences
public Texture2D()
Note that the default constructor creates a texture object with a width and height of 0 and is, therefore, not useful.
public Texture2D(int mipMapMode, int format, int width, int height)
mipMapMode
- type of mipmap for this Texture: One of
BASE_LEVEL, MULTI_LEVEL_MIPMAP.format
- data format of Textures saved in this object.
One of INTENSITY, LUMINANCE, ALPHA, LUMINANCE_ALPHA, RGB, RGBA.width
- width of image at level 0.height
- height of image at level 0.java.lang.IllegalArgumentException
- if width or height are NOT
greater than 0 OR invalid format/mipmapMode is specified.public Texture2D(int mipMapMode, int format, int width, int height, int boundaryWidth)
mipMapMode
is set to
BASE_LEVEL
, then the image at level 0 must be set
by the application (using either the setImage
or
setImages
method). If mipMapMode
is
set to MULTI_LEVEL_MIPMAP
, then images for levels
Base Level through Maximum Level must be set.
Note that a texture with a non-power-of-two width or height will
only be rendered on a graphics device that supports non-power-of-two
textures.mipMapMode
- type of mipmap for this Texture: one of
BASE_LEVEL, MULTI_LEVEL_MIPMAPformat
- data format of Textures saved in this object.
One of INTENSITY, LUMINANCE, ALPHA, LUMINANCE_ALPHA, RGB, RGBAwidth
- width of image at level 0. This
does not include the width of the boundary.height
- height of image at level 0. This
does not include the width of the boundary.boundaryWidth
- width of the boundary, which must be 0 or 1.java.lang.IllegalArgumentException
- if width or height are not greater
than 0, if an invalid format or mipMapMode is specified, or
if the boundaryWidth is < 0 or > 1public NodeComponent cloneNodeComponent()
cloneNodeComponent
in class NodeComponent
public void duplicateNodeComponent(NodeComponent originalNodeComponent)
duplicateNodeComponent
in class NodeComponent