SoIndexedTexture2rescaleTexCoord Property |
This field controls the way an image with non-power-of-two dimension is handled:
Namespace: OIV.Inventor.Nodes
If the graphics card supports GL_ARB_texture_non_power_of_two , this field is ignored and the image is sent directly to OpenGL.
If OIV.Inventor.Nodes.SoIndexedTexture2.rescaleTexCoord is false (the default), the image is rescaled to the next lower power-of-two dimensions. The scaling is done with a box filter.
If OIV.Inventor.Nodes.SoIndexedTexture2.rescaleTexCoord is true, the image is not rescaled but is only copied into a texture with the next higher power-of-two dimension, and its texture coordinates are scaled by applying a texture transform in order to only display the actual image.
Default is false.
When this field is enabled, if other texture transforms are applied to the texture coordinates (especially if the texture is repeated), the unused part of the larger texture could be displayed. Furthermore, in this mode, if non-power-of-two textures occur one after another in the scene graph, an incorrect image may result because texture transforms are cumulative. For example, the following code would give incorrect results:
root.AddChild( colorMap ); root.AddChild( nonPowerOfTwoIndexedTexture1 ); root.AddChild( nonPowerOfTwoIndexedTexture2 ); root.AddChild( nonPowerOfTwoIndexedTexture3 );
root.AddChild( colorMap ); root.AddChild( separator1 ); separator1.AddChild( nonPowerOfTwoIndexedTexture1 ); root.AddChild( separator2 ); separator2.AddChild( nonPowerOfTwoIndexedTexture2 ); root.AddChild( separator3 ); separator3.AddChild( nonPowerOfTwoIndexedTexture3 );