| 1 |
NAME SoTexture2 SoTex2 SO_TEX2_ { texture mapping node } |
| 2 |
|
| 3 |
INCLUDE nodes/SoTexture2.h |
| 4 |
|
| 5 |
DESC { |
| 6 |
This property node defines a texture map and parameters for that map. This |
| 7 |
map is used to apply texture to subsequent shapes as they are rendered. |
| 8 |
\p |
| 9 |
The texture can be read from the file specified by the \vfilename\. |
| 10 |
field. Once the texture has been read, the \vimage\. field contains |
| 11 |
the texture data. However, this field is marked so the image is not |
| 12 |
written out when the texture node is written to a file. To turn off |
| 13 |
texturing, set the \vfilename\. field to an empty string (""). |
| 14 |
\p |
| 15 |
Textures can also be specified in memory by setting the \vimage\. |
| 16 |
field to contain the texture data. Doing so resets the \vfilename\. to |
| 17 |
the empty string. |
| 18 |
\p |
| 19 |
If the texture image's width or height is not a power of 2, or the |
| 20 |
image's width or height is greater than the maximum supported by |
| 21 |
OpenGL, then the image will be automatically scaled up or down to the |
| 22 |
next power of 2 or the maximum texture size. For maximum speed, |
| 23 |
point-sampling is used to do the scale; if you want more accurate |
| 24 |
resampling, pre-filter images to a power of 2 smaller than the maximum |
| 25 |
texture size (use the OpenGL glGetIntegerv(GL_MAX_TEXTURE_SIZE...) |
| 26 |
call to determine maximum texture for a specific OpenGL |
| 27 |
implementation). |
| 28 |
\p |
| 29 |
The quality of the texturing is affected by the \vtextureQuality\. |
| 30 |
field of the \cSoComplexity\. node. The \vtextureQuality\. field |
| 31 |
affects what kind of filtering is done to the texture when it must be |
| 32 |
minified or magnified. The mapping of a particular texture quality |
| 33 |
value to a particular OpenGL filtering technique is implementation |
| 34 |
dependent, and varies based on the texturing performance. |
| 35 |
If mipmap filtering is required, mipmaps are automatically created |
| 36 |
using the simple box filter. |
| 37 |
|
| 38 |
} |
| 39 |
|
| 40 |
ENUM Model { |
| 41 |
MODULATE "The texture color is multiplied by the surface color", |
| 42 |
DECAL "The texture color replaces the surface color", |
| 43 |
BLEND "Blends between the surface color and a specified blend color" |
| 44 |
} |
| 45 |
|
| 46 |
ENUM Wrap { |
| 47 |
REPEAT "Repeats texture outside 0-1 texture coordinate range", |
| 48 |
CLAMP "Clamps texture coordinates to lie within 0-1 range" |
| 49 |
} |
| 50 |
|
| 51 |
FIELD filename { |
| 52 |
Names file from which to read texture image. Currently only SGI .rgb |
| 53 |
files are supported. If the filename is not an absolute path name, the |
| 54 |
list of directories maintained by \cSoInput\. is searched. If the |
| 55 |
texture is not found in any of those directories, then the file is |
| 56 |
searched for relative to the directory from which the \cSoTexture2\. |
| 57 |
node was read. For example, if an \cSoTexture2\. node with a filename |
| 58 |
of \k"../tofu.rgb"\. is read from \k/usr/people/bob/models/food.iv\., |
| 59 |
then \k/usr/people/bob/tofu.rgb\. will be read (assuming \ktofu.rgb\. |
| 60 |
isn't found in the directories maintained by \cSoInput\.). |
| 61 |
} |
| 62 |
|
| 63 |
FIELD image { |
| 64 |
Contains an in-memory representation of the texture map. It is either |
| 65 |
the contents of the file read from \vfilename\., an image read |
| 66 |
directly from an Inventor file, or an image set programmatically using |
| 67 |
the methods provided by \cSoSFImage\.. |
| 68 |
} |
| 69 |
|
| 70 |
FIELD wrapS {} |
| 71 |
FIELD wrapT { |
| 72 |
Indicates what to do when texture coordinates in the S (horizontal) or |
| 73 |
T (vertical) direction lie outside the range 0-1. |
| 74 |
} |
| 75 |
|
| 76 |
FIELD model { Specifies how to map texture onto surface. } |
| 77 |
|
| 78 |
FIELD blendColor { Color used for \kBLEND\. model. } |
| 79 |
|
| 80 |
METHOD "" SoTexture2() { |
| 81 |
Creates a texture node with default settings. |
| 82 |
} |
| 83 |
|
| 84 |
METHOD "" static SoType getClassTypeId() { |
| 85 |
Returns type identifier for this class. |
| 86 |
} |
| 87 |
|
| 88 |
ACTION SoGLRenderAction, SoCallbackAction { |
| 89 |
Sets current texture in state. |
| 90 |
} |
| 91 |
|
| 92 |
ALSO { |
| 93 |
SoComplexity, |
| 94 |
SoMaterial, |
| 95 |
SoTexture2Transform, |
| 96 |
SoTextureCoordinate2, |
| 97 |
SoTextureCoordinateBinding, |
| 98 |
SoTextureCoordinateFunction |
| 99 |
} |