SOTEXTURE2(3iv)
β¨ NAME β¨
SoTexture2 β the texture mapping node π
(this is page 3IV, bestie, we're in the Inventor section of the manual and it's giving iconic)
π¦ INHERITS FROM π¦
SoBase > SoFieldContainer > SoNode > SoTexture2
the family tree is lowkey a whole lineage, and SoTexture2 is the main character at the bottom of it π
πΈ SYNOPSIS πΈ
#include <Inventor/nodes/SoTexture2.h>
okay so first up, the enums, and they matter, don't skip them:
enum Model {
SoTexture2::MODULATE The texture color is multiplied by the surface
color
SoTexture2::DECAL The texture color replaces the surface color
SoTexture2::BLEND Blends between the surface color and a
specified blend color
}
enum Wrap {
SoTexture2::REPEAT Repeats texture outside 0-1 texture coordinate
range
SoTexture2::CLAMP Clamps texture coordinates to lie within 0-1
range
}
Fields from class SoTexture2:
SoSFString filename
SoSFImage image
SoSFEnum wrapS
SoSFEnum wrapT
SoSFEnum model
SoSFColor blendColor
Methods from class SoTexture2:
SoTexture2()
static SoType getClassTypeId()
Methods from class SoNode:
void setOverride(SbBool state)
SbBool isOverride() const
SoNode * copy(SbBool copyConnections = FALSE) const
virtual SbBool affectsState() const
static SoNode * getByName(const SbName &name)
static int getByName(const SbName &name, SoNodeList &list)
Methods from class SoFieldContainer:
void setToDefaults()
SbBool hasDefaultValues() const
SbBool fieldsAreEqual(const SoFieldContainer *fc) const
void copyFieldValues(const SoFieldContainer *fc, SbBool
copyConnections = FALSE)
SbBool set(const char *fieldDataString)
void get(SbString &fieldDataString)
virtual int getFields(SoFieldList &resultList) const
virtual SoField * getField(const SbName &fieldName) const
SbBool getFieldName(const SoField *field, SbName &fieldName)
const
SbBool isNotifyEnabled() const
SbBool enableNotify(SbBool flag)
Methods from class SoBase:
void ref()
void unref() const
void unrefNoDelete() const
void touch()
virtual SoType getTypeId() const
SbBool isOfType(SoType type) const
virtual void setName(const SbName &name)
virtual SbName getName() const
π DESCRIPTION π
So this is a property node, and what it does is define a texture map plus the parameters for that map. That map then gets used to slap texture onto every subsequent shape as they get rendered. It's a whole vibe-setting node fr fr.
The texture can be read from the file you point at with the filename field. Once the texture has been read, the image field holds the texture data. BUT β heads up β this field is marked so the image is not written out when the texture node itself gets written to a file. Sneaky. And when you want to turn texturing off, you set the filename field to an empty string (""). That's the off switch, periodt.
Textures can also be specified in memory, by setting the image field to contain the texture data directly. Doing that resets the filename to the empty string. (Yes, they fight over the same spot. That's the rule.)
Now the sizing tea β: if the texture image's width or height is not a power of 2, 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 next power of 2, or to the maximum texture size. For maximum speed, point-sampling is used to do the scale. If you want more accurate resampling, pre-filter your images to a power of 2 that's smaller than the maximum texture size β and use the OpenGL glGetIntegerv(GL_MAX_TEXTURE_SIZE...) call to figure out the max texture for a specific OpenGL implementation.
The quality of the texturing is affected by the textureQuality field of the SoComplexity node. That textureQuality field affects what kind of filtering gets 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 implementation dependent, and it varies based on the texturing performance. And if mipmap filtering is required, the mipmaps are automatically created using the simple box filter. No cap. π«Ά
π FIELDS π
SoSFStringfilenameβ names the file from which to read the texture image. Currently only SGI.rgbfiles are supported, ngl. If the filename is not an absolute path name, the list of directories maintained bySoInputgets searched. If the texture is not found in any of those directories, then the file is searched for relative to the directory from which theSoTexture2node was read. For example, if anSoTexture2node with a filename of"../tofu.rgb"is read from/usr/people/bob/models/food.iv, then/usr/people/bob/tofu.rgbwill be read (assumingtofu.rgbisn't found in the directories maintained bySoInput). πSoSFImageimageβ contains an in-memory representation of the texture map. It's either the contents of the file read fromfilename, an image read directly from an Inventor file, or an image set programmatically using the methods provided bySoSFImage.SoSFEnumwrapSSoSFEnumwrapTβ indicates what to do when texture coordinates in the S (horizontal) or T (vertical) direction lie outside the range0-1.SoSFEnummodelβ specifies how to map the texture onto the surface.SoSFColorblendColorβ the color used for theBLENDmodel. π
π METHODS π
SoTexture2()β creates a texture node with default settings. Fresh out the box, defaults on defaults. β¨static SoType getClassTypeId()β returns the type identifier for this class. iykyk.
π₯ ACTION BEHAVIOR π₯
SoGLRenderAction, SoCallbackAction β sets the current texture in state. That's it, that's the behavior, she ate. π
π FILE FORMAT/DEFAULTS π
Texture2 {
filename ""
image 0 0 0
wrapS REPEAT
wrapT REPEAT
model MODULATE
blendColor 0 0 0
}
β SEE ALSO β
SoComplexity, SoMaterial, SoTexture2Transform, SoTextureCoordinate2, SoTextureCoordinateBinding, SoTextureCoordinateFunction
and that's the whole page, bestie π§ this was SoTexture2(3IV)(), signed off the exact same way it came in β SoTexture2(3IV)() β no date on it, just the source/version tag chilling at the bottom like a little footnote π go texture something iconic π
β¨
π¦ where this page comes from
- debian bookworm: inventor-doc 2.1.5-10+dfsg-2 Β· LGPL-2.0-or-later
- debian trixie: inventor-doc 2.1.6+ds-2 Β· LGPL-2.0-or-later
- ubuntu jammy: inventor-doc 2.1.5-10-24
- ubuntu noble: inventor-doc 2.1.5-10+dfsg-2.1build2 Β· LGPL-2.0-or-later
- ubuntu questing: inventor-doc 2.1.6+ds-2
- ubuntu resolute: inventor-doc 2.1.6.1+ds-1 Β· LGPL-2.0-or-later
- ubuntu stonking: inventor-doc 2.1.6.1+ds-1 Β· LGPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms