osg.Texture¶
-
class
osg.Texture¶ Represents: c++ class Wraps: osg::Texture Bases: osg.StateAttributeTexture pure virtual base class that encapsulates OpenGL texture functionality common to the various types of OSG textures.
Methods:
-
:
setWrap(osg.Texture.WrapParameter which, osg.Texture.WrapMode wrap)¶ Sets the texture wrap mode.
Parameters: - which (
osg.Texture.WrapParameter) – - wrap (
osg.Texture.WrapMode) –
- which (
-
:
getWrap(osg.Texture.WrapParameter which)¶ Gets the texture wrap mode.
Parameters: which ( osg.Texture.WrapParameter) –Return type: osg.Texture.WrapMode
-
:
setBorderColor(osg.Vec4 color)¶ Sets the border color. Only used when wrap mode is
osg.Texture.CLAMP_TO_BORDER. The border color will be casted to the appropriate type to match the internal pixel format of the texture.Parameters: color ( osg.Vec4) –
-
:
setBorderWidth(int width)¶ Sets the border width.
Parameters: width ( int) –
-
:
getBorderWidth()¶ -
Return type: int
-
:
setFilter(osg.Texture.FilterParameter which, osg.Texture.FilterMode mode)¶ Sets the texture filter mode.
Parameters: - which (
osg.Texture.FilterParameter) – - mode (
osg.Texture.FilterMode) –
- which (
-
:
getFilter(osg.Texture.FilterParameter which)¶ Gets the texture filter mode.
Parameters: which ( osg.Texture.FilterParameter) –Return type: osg.Texture.FilterMode
-
:
setMaxAnisotropy(double anis)¶ Sets the maximum anisotropy value, default value is 1.0 for no anisotropic filtering. If hardware does not support anisotropic filtering, use normal filtering (equivalent to a max anisotropy value of 1.0. Valid range is 1.0f upwards. The maximum value depends on the graphics system.
Parameters: anis ( double) –
-
:
getMaxAnisotropy()¶ Gets the maximum anisotropy value.
Return type: double
-
:
setMinLOD(double anis)¶ -
Parameters: anis ( double) –
-
:
getMinLOD()¶ -
Return type: double
-
:
setLODBias(double anis)¶ -
Parameters: anis ( double) –
-
:
getLODBias()¶ -
Return type: double
-
:
setUseHardwareMipMapGeneration(bool b)¶ Sets the hardware mipmap generation hint. If enabled, it will only be used if supported in the graphics system.
Parameters: b ( bool) –
-
:
getUseHardwareMipMapGeneration()¶ Gets the hardware mipmap generation hint.
Return type: bool
-
:
setUnRefImageDataAfterApply(bool b)¶ Sets whether or not the apply() function will unreference the image data. If enabled, and the image data is only referenced by this
osg.Texture, apply() will delete the image data.Parameters: b ( bool) –
-
:
getUnRefImageDataAfterApply()¶ Gets whether or not apply() unreferences image data.
Return type: bool
-
:
setClientStorageHint(bool b)¶ Sets whether to use client storage for the texture, if supported by the graphics system. Note: If enabled, and the graphics system supports it, the
osg.Image(s) associated with this texture cannot be deleted, so the UnRefImageDataAfterApply flag would be ignored.Parameters: b ( bool) –
-
:
getClientStorageHint()¶ Gets whether to use client storage for the texture.
Return type: bool
-
:
setResizeNonPowerOfTwoHint(bool b)¶ Sets whether to force the texture to resize images that have dimensions that are not a power of two. If enabled, NPOT images will be resized, whether or not NPOT textures are supported by the hardware. If disabled, NPOT images will not be resized if supported by hardware.
Parameters: b ( bool) –
-
:
getResizeNonPowerOfTwoHint()¶ Gets whether texture will force non power to two images to be resized.
Return type: bool
-
:
setShadowComparison(bool flag)¶ Sets GL_TEXTURE_COMPARE_MODE_ARB to GL_COMPARE_R_TO_TEXTURE_ARB See http://oss.sgi.com/projects/ogl-sample/registry/ARB/shadow.txt.
Parameters: flag ( bool) –
-
:
getShadowComparison()¶ -
Return type: bool
-
:
setShadowCompareFunc(osg.Texture.ShadowCompareFunc func)¶ Sets shadow texture comparison function.
Parameters: func ( osg.Texture.ShadowCompareFunc) –
-
:
getShadowCompareFunc()¶ -
Return type: osg.Texture.ShadowCompareFunc
-
:
setShadowTextureMode(osg.Texture.ShadowTextureMode mode)¶ Sets shadow texture mode after comparison.
Parameters: mode ( osg.Texture.ShadowTextureMode) –
-
:
getShadowTextureMode()¶ -
Return type: osg.Texture.ShadowTextureMode
-
:
setImage(int face, osg.Image image)¶ Sets the texture image for the specified face.
Parameters: - face (
int) – - image (
osg.Image) –
- face (
-
:
getImage(int face)¶ Gets the texture image for the specified face.
Parameters: face ( int) –Return type: osg.Image
-
:
getNumImages()¶ Gets the number of images that can be assigned to this
osg.Texture.Return type: unsigned
-
:
getTextureTarget()¶ -
Return type: int
-
:
getTextureWidth()¶ -
Return type: int
-
:
getTextureHeight()¶ -
Return type: int
-
:
getTextureDepth()¶ -
Return type: int
-
:
setSourceFormat(GLenum.Value format)¶ Sets the external source image format, used as a fallback when no
osg.Imageis attached to provide the source image format.Parameters: format ( GLenum.Value) –
-
:
getSourceFormat()¶ Gets the external source image format.
Return type: GLenum.Value
-
:
setInternalFormatMode(osg.Texture.InternalFormatMode fromatmode)¶ Sets the internal texture format mode. Note: If the texture format is
osg.Texture.USE_IMAGE_DATA_FORMAT,osg.Texture.USE_ARB_COMPRESSION, orosg.Texture.USE_S3TC_COMPRESSION, the internal format mode is set automatically and will overwrite the previous _internalFormat.Parameters: fromatmode ( osg.Texture.InternalFormatMode) –
-
:
getInternalFormatMode()¶ Gets the internal texture format mode.
Return type: osg.Texture.InternalFormatMode
-
:
setInternalFormat(unsigned format)¶ Sets the internal texture format. Implicitly sets the internalFormatMode to
osg.Texture.USE_USER_DEFINED_FORMAT. The corresponding internal format type will be computed.Parameters: format ( unsigned) –
-
:
getInternalFormat()¶ Gets the internal texture format.
Return type: unsigned
-
:
isCompressedInternalFormat()¶ Return
trueif the internal format is one of the compressed formats.Return type: bool
-
:
setSourceType(GLenum.Value datatype)¶ Sets the external source data type, used as a fallback when no
osg.Imageis attached to provide the source image format.Parameters: datatype ( GLenum.Value) –
-
:
getSourceType()¶ Gets the external source data type.
Return type: GLenum.Value
-
:
isDirty(unsigned contextID)¶ Return
trueif the texture image data has been modified and the associated GL texture object needs to be updated.Parameters: contextID ( unsigned) –Return type: bool
-
:
getTextureObject(unsigned contextID)¶ Returns a pointer to the
osg.Texture.TextureObjectfor the current context.Parameters: contextID ( unsigned) –Return type: osg.Texture.TextureObject
-
:
setTextureObject(unsigned contextID, osg.Texture.TextureObject to)¶ -
Parameters: - contextID (
unsigned) – - to (
osg.Texture.TextureObject) –
- contextID (
-
:
dirtyTextureObject()¶ Forces a recompile on next
apply()of associated OpenGL texture objects.
-
:
areAllTextureObjectsLoaded()¶ Returns
trueif the texture objects for all the required graphics contexts are loaded.Return type: bool
-
: