public class SoExtTexture2 extends SoTexture
The node is similar to SoTexture2
, but differs in the following significant ways:
The texture is read from the file specified by the filename
field. There is no image field created. Data is sent directly to OpenGL.
The maximum system memory allowed for all SoExtTexture2
nodes (in total) can be set using setMemorySpace()
.
If the memory allowed for texture images (setMemorySpace()
) would be exceeded by loading a new image, one or more existing images will be deleted from system memory. In most cases OpenGL texture objects will already have been created for the deleted images (i.e. OpenGL has a copy of the images), so this does not affect rendering.
If it is necessary to recreate an OpenGL texture object and the required texture image has been deleted from system memory, the node will automatically re-read the image file. For this reason, applications should be careful not to remove image files that might be needed during program execution.
To reduce the use of texture memory (by approximately a factor of 4), use the useTexturePalette()
method to request the image be converted to a 256-color paletted image. This feature is available only if the driver supports the GL_EXT_paletted_texture or GL_EXT_texture_color_table extension.
If the texture image's width or height is not a power of 2, and the Non Power Of Two (NPOT) extension is available on your graphics board, by default Open Inventor will send the image to OpenGL without modification. However, if the texture image's width or height is not a power of 2 (and the Non Power Of Two (NPOT) extension is not available on your graphics board), or the image's width or height is greater than the maximum supported by OpenGL, then the image will be automatically scaled up or down to the nearest power of 2 or the maximum texture size. For maximum speed, point-sampling is used to do the scaling. If you want higher quality scaling, pre-filter your images to a power of 2 smaller than the maximum texture size. Use the OpenGL glGetIntegerv(GL_MAX_TEXTURE_SIZE...) call to determine the maximum texture dimension for a specific OpenGL implementation. Setting the environment variable OIV_USE_NPOT to 0 will force the image to be rescaled (when necessary) even if the NPOT extension is available.
The quality of the texturing is affected by the textureQuality field of the SoComplexity
node. The textureQuality field affects what kind of filtering is done to the texture when it must be minified or magnified. The mapping of a particular texture quality value to a particular OpenGL filtering technique is platform dependent, and varies based on the texturing performance. If mipmap filtering is required, mipmaps are automatically created using a simple box filter.
Performance Note: Automatic scaling of texture images to a power of 2 is a very convenient feature for prototyping, but it does take additional time the first time the texture node is traversed for rendering. For large images, or a large number of images, this can make the application seem slow while starting up or loading a new data file. Avoid this effect by either pre-scaling the image or by storing it as a sub-image in a "power of 2" image (then provide explicit texture coordinates such that only the sub-image is used).
File format/default:
ExtTexture2 {
filename | "" |
enableCompressedTexture | false |
wrapS | REPEAT |
wrapT | REPEAT |
model | MODULATE |
blendColor | 0 0 0 |
loadingStatus | false |
syncMode | SYNCHRONOUS |
loadingMode | AUTO |
loadingThreadPriorty | 1 |
enableBorder | false |
borderColor | 0 0 0 0 |
maxAnisotropy | 1.0 |
minFilter | AUTO |
magFilter | AUTO |
useAutoMipmap | false |
internalFormat | AUTO_INTERNAL_FORMAT |
Action behavior:
SoGLRenderAction
, SoCallbackAction
Sets current texture in state. Sets: SoTextureImageElement
See also:
SoTexture2
, SoComplexity
, SoMaterial
, SoTexture2Transform
, SoTextureCoordinate2
, SoTextureCoordinateBinding
, SoTextureCoordinateFunction
Modifier and Type | Class and Description |
---|---|
static class |
SoExtTexture2.ImageSize |
static class |
SoExtTexture2.Loadings
Loading mode.
|
static class |
SoExtTexture2.Syncs
Synchrone/asynchrone loading mode.
|
SoTexture.FileTypes, SoTexture.Filters, SoTexture.HW_Features, SoTexture.InternalFormats, SoTexture.Models, SoTexture.WrapType
SoNode.RenderModes
Inventor.ConstructorCommand
Modifier and Type | Field and Description |
---|---|
SoSFFilePathString |
filename
Names file from which to read texture image.
|
SoSFEnum<SoExtTexture2.Loadings> |
loadingMode
Specifies the loading mode.
|
SoSFBool |
loadingStatus
Tells if the texture is loaded or not (not necessarily displayed)
|
SoSFInt32 |
loadingThreadPriority
Specifies the priority of the texture loading thread when activated (syncMode = ASYNCHRONOUS).
|
SoSFEnum<SoExtTexture2.Syncs> |
syncMode
Specifies the synchronous/asynchronous mode.
|
SoSFEnum<SoTexture.WrapType> |
wrapT
Indicates what to do when texture coordinates in the T (vertical) direction lie outside the range 0-1.
|
blendColor, borderColor, enableBorder, enableCompressedTexture, internalFormat, magFilter, maxAnisotropy, minFilter, model, wrapS
VERBOSE_LEVEL, ZeroHandle
Constructor and Description |
---|
SoExtTexture2()
Creates a texture node with default settings.
|
Modifier and Type | Method and Description |
---|---|
void |
allowPrequalifyFile(boolean name_11583)
If true, allows the PrequalifyFile callback to be called.
|
static double |
getGlobalMemoryUsed()
Return the current system memory used by all texture images.
|
SoExtTexture2.ImageSize |
getImageSize()
Returns the size and the number of components in the image.
|
static double |
getMemorySpace()
Gets the system memory space allowed for the texture images.
|
void |
loadTexture()
Loads the texture if the loading mode is set to MANUAL.
|
static void |
setMemorySpace(double megaBytes)
Sets the system memory space allowed for the texture images.
|
static void |
useTexturePalette(boolean value)
If true, uses a 256-color-indexed palette.
|
getBitmapFileType, isSupported, readTexture, readTexture, setBitmapFileType
affectsState, callback, copy, copy, distribute, doAction, getAlternateRep, getBoundingBox, getByName, getMatrix, getPrimitiveCount, getRenderEngineMode, getRenderUnitID, GLRender, GLRenderBelowPath, GLRenderInPath, GLRenderOffPath, grabEventsCleanup, grabEventsSetup, handleEvent, isBoundingBoxIgnoring, isOverride, pick, rayPick, search, setOverride, touch, write
copyFieldValues, copyFieldValues, enableNotify, fieldsAreEqual, get, getAllFields, getEventIn, getEventOut, getField, getFieldName, hasDefaultValues, isNotifyEnabled, set, setToDefaults
dispose, getName, isDisposable, isSynchronizable, setName, setSynchronizable
getNativeResourceHandle
public final SoSFFilePathString filename
SoRasterImageRW
for the list. If the filename is not an absolute path name, the list of directories maintained by SoInput
is searched. If the texture is not found in any of those directories, then the file is searched for relative to the directory from which the SoTexture2
node was read. For example, if an SoTexture2
node with a filename of "../tofu.rgb" is read from /usr/people/bob/models/food.iv, then /usr/people/bob/tofu.rgb will be read (assuming tofu.rgb isn't found in the directories maintained by SoInput
).public final SoSFEnum<SoTexture.WrapType> wrapT
public final SoSFBool loadingStatus
public final SoSFEnum<SoExtTexture2.Syncs> syncMode
public final SoSFEnum<SoExtTexture2.Loadings> loadingMode
public final SoSFInt32 loadingThreadPriority
public SoExtTexture2()
public SoExtTexture2.ImageSize getImageSize()
public static void setMemorySpace(double megaBytes)
public static double getMemorySpace()
public void allowPrequalifyFile(boolean name_11583)
public void loadTexture()
public static double getGlobalMemoryUsed()
public static void useTexturePalette(boolean value)
enableCompressedTexture
is set true, its value takes precedence over this request to use a paletted texture. Compressed textures will be used.Generated on July 31, 2019, Copyright © Thermo Fisher Scientific. All rights reserved. http://www.openinventor.com