SoTextureCombine - Online Linux Manual PageSection : 3
Updated : Mon Jan 25 2021
Source : Version 2.5.0
Note : Coin
NAMESoTextureCombine − The SoTextureCombine class is a node for setting texture combine functions.
SYNOPSIS
#include <Inventor/nodes/SoTextureCombine.h> Inherits SoNode.
Public Typesenum Source { PRIMARY_COLOR = SoTextureCombineElement::PRIMARY_COLOR, TEXTURE = SoTextureCombineElement::TEXTURE, CONSTANT = SoTextureCombineElement::CONSTANT, PREVIOUS = SoTextureCombineElement::PREVIOUS }
enum Operand { SRC_COLOR = SoTextureCombineElement::SRC_COLOR, ONE_MINUS_SRC_COLOR = SoTextureCombineElement::ONE_MINUS_SRC_COLOR, SRC_ALPHA = SoTextureCombineElement::SRC_ALPHA, ONE_MINUS_SRC_ALPHA = SoTextureCombineElement::ONE_MINUS_SRC_ALPHA }
enum Operation { REPLACE = SoTextureCombineElement::REPLACE, MODULATE = SoTextureCombineElement::MODULATE, ADD = SoTextureCombineElement::ADD, ADD_SIGNED = SoTextureCombineElement::ADD_SIGNED, SUBTRACT = SoTextureCombineElement::SUBTRACT, INTERPOLATE = SoTextureCombineElement::INTERPOLATE, DOT3_RGB = SoTextureCombineElement::DOT3_RGB, DOT3_RGBA = SoTextureCombineElement::DOT3_RGBA }
Public Member Functionsvirtual SoType getTypeId (void) const
SoTextureCombine (void)
virtual void doAction (SoAction *action)
virtual void callback (SoCallbackAction *action)
virtual void GLRender (SoGLRenderAction *action)
virtual void pick (SoPickAction *action)
Static Public Member Functionsstatic SoType getClassTypeId (void)
static void initClass (void)
Public AttributesSoMFEnum rgbSource
SoMFEnum alphaSource
SoMFEnum rgbOperand
SoMFEnum alphaOperand
SoSFEnum rgbOperation
SoSFEnum alphaOperation
SoSFFloat rgbScale
SoSFFloat alphaScale
SoSFVec4f constantColor
Protected Member Functionsvirtual const SoFieldData * getFieldData (void) const
virtual ~SoTextureCombine ()
Static Protected Member Functionsstatic const SoFieldData ** getFieldDataPtr (void)
Additional Inherited Members
Detailed DescriptionThe SoTextureCombine class is a node for setting texture combine functions. This node is more or less an exact mapping of the OpenGL ARB_texture_env_combine extension (included in OpenGL in OpenGL v1.3). See http://oss.sgi.com/projects/ogl-sample/registry/ARB/texture_env_combine.txt for more information about this extension. Basically this node lets you specify up to three sources, and a function to combine those sources. In addition to the function, it's possible to apply simple operands on the sources. In the documentation below, the sources will be called Arg0, Arg1, and Arg2, just like in the ARB_texture_env_mode specification. It's possible to specify both a color and an alpha operation. This node has many fields, but usually it is sufficient to set only one or very few fields. The selected operation decides which values you need to set. One common example is to add a light map to textured geometry. A lightmap can look like this: The example below just shows how to apply the lightmap to a cube, with one light source on each side of the cube. Usually the texture coordinates are calculated so that a spot light or a point light is simulated. Texture2 { filename "wood.jpg" }
Switch {
whichChild -3 # use to toggle lightmap on/off
TextureUnit {
unit 1
}
TextureCombine {
rgbOperation ADD_SIGNED
rgbSource [PREVIOUS, TEXTURE]
rgbOperand [SRC_COLOR, SRC_COLOR ]
alphaOperation REPLACE
alphaSource [TEXTURE]
alphaOperand [SRC_ALPHA]
}
Texture2 { filename "lightmap.jpg" }
TextureUnit { unit 0 }
}
Cube { }.fiThe scene above in a viewer: In addition to the functions you can set in rgbOperation (or alphaOperation), it's possible to create more complex texture functions by combining two textures that have already been combined. You can use the SoSceneTexture2 node to create those textures. Below is an example that shows how to implement Arg0*Arg1
• Arg2*Arg0, where Arg0 = texture1 RGB, Arg1 = texture2 RGB, Arg2 = texture 2 alpha:ShapeHints { vertexOrdering COUNTERCLOCKWISE shapeType SOLID }
Separator {
SceneTexture2 {
size 256 256
transparencyFunction NONE
scene Separator {
OrthographicCamera {
height 2
aspectRatio 1
position 0 0 1
viewportMapping LEAVE_ALONE
}
LightModel { model BASE_COLOR }
Coordinate3 {
point [ -1 -1 0, 1 -1 0, 1 1 0, -1 1 0 ]
}
DEF texture1 Texture2 { filename "texture1.png" }
TextureUnit { unit 1 }
TextureCombine {
rgbOperation MODULATE
rgbSource [ PREVIOUS, TEXTURE ]
rgbOperand [ SRC_COLOR, SRC_COLOR ]
alphaOperation REPLACE
alphaSource [TEXTURE]
alphaOperand [ SRC_ALPHA ]
}
DEF texture2 Texture2 { filename "texture2_with_alpha.png" }
TextureCoordinate2 {
point [0 0, 1 0, 1 1, 0 1]
}
FaceSet { numVertices 4 }
}
}
TextureUnit { unit 1 }
TextureCombine {
rgbOperation ADD
rgbSource [ PREVIOUS, TEXTURE ]
rgbOperand [ SRC_COLOR, SRC_COLOR ]
alphaOperation REPLACE
alphaSource [TEXTURE]
alphaOperand [ SRC_ALPHA ]
}
SceneTexture2 {
size 256 256
transparencyFunction NONE
scene Separator {
OrthographicCamera {
height 2
aspectRatio 1
position 0 0 1
viewportMapping LEAVE_ALONE
}
LightModel { model BASE_COLOR }
Coordinate3 {
point [ -1 -1 0, 1 -1 0, 1 1 0, -1 1 0 ]
}
USE texture1
TextureUnit { unit 1 }
TextureCombine {
rgbOperation MODULATE
rgbSource [ PREVIOUS, TEXTURE ]
rgbOperand [ SRC_COLOR, SRC_ALPHA ]
alphaOperation REPLACE
alphaSource [TEXTURE]
alphaOperand [ SRC_ALPHA ]
}
USE texture2
TextureCoordinate2 {
point [0 0, 1 0, 1 1, 0 1]
}
FaceSet { numVertices 4 }
}
}
# map resulting texture onto a Cube
Cube { }
}It should be possible to create almost any kind of texture function using this scheme, at the cost of extra texture memory usage (the intermediate textures), of course. FILE FORMAT/DEFAULTS: TextureCombine {
rgbSource [ ]
alphaSource [ ]
rgbOperand [ ]
alphaOperand [ ]
rgbOperation MODULATE
alphaOperation MODULATE
rgbScale 1
alphaScale 1
constantColor 1 1 1 1
}
Since Coin 2.3
Member Enumeration Documentation
enum SoTextureCombine::SourceFor enumerating combiner sources. Enumerator PRIMARY_COLOR Choose primary color as source. TEXTURE Choose texture as source. CONSTANT Choose the constantColor field as source. PREVIOUS Choose the previous unit's texture as source.
enum SoTextureCombine::OperandFor enumerating source operands. Enumerator SRC_COLOR Use the source color as operand. ONE_MINUS_SRC_COLOR Use one minus source color as operand. SRC_ALPHA Use the source alpha as operand. ONE_MINUS_SRC_ALPHA Use one minus source alpha as operand.
enum SoTextureCombine::OperationFor enumerating combiner operations/functions. Enumerator REPLACE dst = Arg0 MODULATE dst = Arg0 * Arg1 ADD dst = Arg0 + Arg1 ADD_SIGNED dst = Arg0 + Arg1 - 0.5 SUBTRACT dst = Arg0 - Arg1 INTERPOLATE dst = Arg0 * (Arg2) + Arg1 * (1-Arg2) DOT3_RGB Dot product of Arg0 and Arg1 DOT3_RGBA Dot product (including alpha) of Arg0 and Arg1
Constructor & Destructor Documentation
SoTextureCombine::SoTextureCombine (void)Constructor. References ADD, ADD_SIGNED, CONSTANT, DOT3_RGB, DOT3_RGBA, INTERPOLATE, MODULATE, ONE_MINUS_SRC_ALPHA, ONE_MINUS_SRC_COLOR, PREVIOUS, PRIMARY_COLOR, REPLACE, SoField::setDefault(), SoMField::setNum(), SRC_ALPHA, SRC_COLOR, SUBTRACT, and TEXTURE.
SoTextureCombine::~SoTextureCombine () [protected], [virtual]Destructor.
Member Function Documentation
SoType SoTextureCombine::getClassTypeId (void) [static]SoTextureCombine::rgbSource The color sources. This field is empty by default, but you can insert up to three values [Arg0, Arg1, Arg2]. When the field contains less than three values, the default [TEXTURE, PREVIOUS, CONSTANT], will be used for missing values. For texture unit 0, PREVIOUS maps to PRIMARY_COLOR, SoTextureCombine::alphaSource The alpha sources. This field is empty by default, but you can insert up to three values [Arg0, Arg1, Arg2]. When the field contains less than three values, the default [TEXTURE, PREVIOUS, CONSTANT], will be used for missing values. For texture unit 0, PREVIOUS maps to PRIMARY_COLOR, SoTextureCombine::rgbOperand The color operands. This field is empty by default, but you can insert up to three values. When the field contains less than three values, the default [SRC_COLOR, SRC_COLOR, SRC_COLOR] will be used for missing values. SoTextureCombine::alphaOperand The alpha operands. This field is empty by default, but you can insert up to three values. When the field contains less than three values, the default [SRC_ALPHA, SRC_ALPHA, SRC_ALPHA] will be used for missing values. Please not that only SRC_ALPHA and ONE_MINUS_SRC_ALPHA are valid operands for alpha operations. SoTextureCombine::rgbOperation The color operation. Default value is MODULATE. SoTextureCombine::alphaOperation The alpha operation. Default value is MODULATE. SoTextureCombine::rgbScale Scale color result by this value. Supported values are 1, 2, and 4. SoTextureCombine::alphaScale Scale alpha result by this value. Supported values are 1, 2, and 4. SoTextureCombine::constantColor The constant color (when CONSTANT is used as source). Default value is (1,1,1,1).
SoType SoTextureCombine::getTypeId (void) const [virtual]Returns the type identification of an object derived from a class inheriting SoBase. This is used for run-time type checking and 'downward' casting. Usage example: void foo(SoNode * node)
{
if (node->getTypeId() == SoFile::getClassTypeId()) {
SoFile * filenode = (SoFile *)node; // safe downward cast, knows the type
}
else if (node->getTypeId().isOfType(SoGroup::getClassTypeId())) {
SoGroup * group = (SoGroup *)node; // safe downward cast, knows the type
}
}For application programmers wanting to extend the library with new nodes, engines, nodekits, draggers or others: this method needs to be overridden in all subclasses. This is typically done as part of setting up the full type system for extension classes, which is usually accomplished by using the pre-defined macros available through for instance Inventor/nodes/SoSubNode.h (SO_NODE_INIT_CLASS and SO_NODE_CONSTRUCTOR for node classes), Inventor/engines/SoSubEngine.h (for engine classes) and so on. For more information on writing Coin extensions, see the class documentation of the toplevel superclasses for the various class groups. Implements SoBase.
const SoFieldData * SoTextureCombine::getFieldData (void) const [protected], [virtual]Returns a pointer to the class-wide field data storage object for this instance. If no fields are present, returns NULL. Reimplemented from SoFieldContainer.
void SoTextureCombine::doAction (SoAction * action) [virtual]This function performs the typical operation of a node for any action. Reimplemented from SoNode. References SoMField::getNum(), SoAction::getState(), SbColor4f::getValue(), and SoMFEnum::getValues(). Referenced by GLRender().
void SoTextureCombine::callback (SoCallbackAction * action) [virtual]Action method for SoCallbackAction. Simply updates the state according to how the node behaves for the render action, so the application programmer can use the SoCallbackAction for extracting information about the scene graph. Reimplemented from SoNode. References SoNode::callback().
void SoTextureCombine::GLRender (SoGLRenderAction * action) [virtual]Action method for the SoGLRenderAction. This is called during rendering traversals. Nodes influencing the rendering state in any way or who wants to throw geometry primitives at OpenGL overrides this method. Reimplemented from SoNode. References doAction(), DOT3_RGB, DOT3_RGBA, SoGLRenderAction::getCacheContext(), and SoDebugError::postWarning().
void SoTextureCombine::pick (SoPickAction * action) [virtual]Action method for SoPickAction. Does common processing for SoPickAction action instances. Reimplemented from SoNode. References SoNode::pick().
AuthorGenerated automatically by Doxygen for Coin from the source code. 0
Johanes Gumabo
Data Size : 52,060 byte
man-SoTextureCombine.3coin2Build : 2024-12-05, 20:55 :
Visitor Screen : x
Visitor Counter ( page / site ) : 3 / 201,630
Visitor ID : :
Visitor IP : 3.136.19.136 :
Visitor Provider : AMAZON-02 :
Provider Position ( lat x lon ) : 39.962500 x -83.006100 : x
Provider Accuracy Radius ( km ) : 5 :
Provider City : Columbus :
Provider Province : Ohio , : ,
Provider Country : United States :
Provider Continent : North America :
Visitor Recorder : Version :
Visitor Recorder : Library :
Online Linux Manual Page : Version : Online Linux Manual Page - Fedora.40 - march=x86-64 - mtune=generic - 24.12.05
Online Linux Manual Page : Library : lib_c - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Online Linux Manual Page : Library : lib_m - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Data Base : Version : Online Linux Manual Page Database - 24.04.13 - march=x86-64 - mtune=generic - fedora-38
Data Base : Library : lib_c - 23.02.07 - march=x86-64 - mtune=generic - fedora.36
Very long time ago, I have the best tutor, Wenzel Svojanovsky . If someone knows the email address of Wenzel Svojanovsky , please send an email to johanes_gumabo@yahoo.co.id .
If error, please print screen and send to johanes_gumabo@yahoo.co.id
Under development. Support me via PayPal.