osg.Texture

class osg.Texture
Represents

c++ class

Wraps

osg::Texture

Bases

osg.StateAttribute

Texture 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.

Параметры
:getWrap(osg.Texture.WrapParameter which)

Gets the texture wrap mode.

Параметры

which (osg.Texture.WrapParameter) –

Тип результата

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.

Параметры

color (osg.Vec4) –

:getBorderColor()

Gets the border color.

Тип результата

osg.Vec4

:setBorderWidth(int width)

Sets the border width.

Параметры

width (int) –

:getBorderWidth()

Тип результата

int

:setFilter(osg.Texture.FilterParameter which, osg.Texture.FilterMode mode)

Sets the texture filter mode.

Параметры
:getFilter(osg.Texture.FilterParameter which)

Gets the texture filter mode.

Параметры

which (osg.Texture.FilterParameter) –

Тип результата

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.

Параметры

anis (double) –

:getMaxAnisotropy()

Gets the maximum anisotropy value.

Тип результата

double

:setUseHardwareMipMapGeneration(bool b)

Sets the hardware mipmap generation hint. If enabled, it will only be used if supported in the graphics system.

Параметры

b (bool) –

:getUseHardwareMipMapGeneration()

Gets the hardware mipmap generation hint.

Тип результата

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.

Параметры

b (bool) –

:getUnRefImageDataAfterApply()

Gets whether or not apply() unreferences image data.

Тип результата

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.

Параметры

b (bool) –

:getClientStorageHint()

Gets whether to use client storage for the texture.

Тип результата

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.

Параметры

b (bool) –

:getResizeNonPowerOfTwoHint()

Gets whether texture will force non power to two images to be resized.

Тип результата

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.

Параметры

flag (bool) –

:getShadowComparison()

Тип результата

bool

:setShadowCompareFunc(osg.Texture.ShadowCompareFunc func)

Sets shadow texture comparison function.

Параметры

func (osg.Texture.ShadowCompareFunc) –

:getShadowCompareFunc()

Тип результата

osg.Texture.ShadowCompareFunc

:setShadowTextureMode(osg.Texture.ShadowTextureMode mode)

Sets shadow texture mode after comparison.

Параметры

mode (osg.Texture.ShadowTextureMode) –

:getShadowTextureMode()

Тип результата

osg.Texture.ShadowTextureMode

:setImage(int face, osg.Image image)

Sets the texture image for the specified face.

Параметры
:getImage(int face)

Gets the texture image for the specified face.

Параметры

face (int) –

Тип результата

osg.Image

:getNumImages()

Gets the number of images that can be assigned to this osg.Texture.

Тип результата

unsigned

:getTextureTarget()

Тип результата

int

:getTextureWidth()

Тип результата

int

:getTextureHeight()

Тип результата

int

:getTextureDepth()

Тип результата

int

:setSourceFormat(GLenum.Value format)

Sets the external source image format, used as a fallback when no osg.Image is attached to provide the source image format.

Параметры

format (GLenum.Value) –

:getSourceFormat()

Gets the external source image format.

Тип результата

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, or osg.Texture.USE_S3TC_COMPRESSION, the internal format mode is set automatically and will overwrite the previous _internalFormat.

Параметры

fromatmode (osg.Texture.InternalFormatMode) –

:getInternalFormatMode()

Gets the internal texture format mode.

Тип результата

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.

Параметры

format (unsigned) –

:getInternalFormat()

Gets the internal texture format.

Тип результата

unsigned

:isCompressedInternalFormat()

Return true if the internal format is one of the compressed formats.

Тип результата

bool

:setSourceType(GLenum.Value datatype)

Sets the external source data type, used as a fallback when no osg.Image is attached to provide the source image format.

Параметры

datatype (GLenum.Value) –

:getSourceType()

Gets the external source data type.

Тип результата

GLenum.Value

:isDirty(unsigned contextID)

Return true if the texture image data has been modified and the associated GL texture object needs to be updated.

Параметры

contextID (unsigned) –

Тип результата

bool

:getTextureObject(unsigned contextID)

Returns a pointer to the osg.Texture.TextureObject for the current context.

Параметры

contextID (unsigned) –

Тип результата

osg.Texture.TextureObject

:setTextureObject(unsigned contextID, osg.Texture.TextureObject to)

Параметры
:dirtyTextureObject()

Forces a recompile on next apply() of associated OpenGL texture objects.

:areAllTextureObjectsLoaded()

Returns true if the texture objects for all the required graphics contexts are loaded.

Тип результата

bool