SoTextureCubeMap Class |
Cube texture mapping node.
Namespace: OIV.Inventor.Nodes
The SoTextureCubeMap type exposes the following members.
Name | Description | |
---|---|---|
SoTextureCubeMap | Creates a texture node with default settings. |
Name | Description | |
---|---|---|
AffectsState | Returns true if a node has an effect on the state during traversal. | |
AllowPrequalifyFile | ||
Callback | (Inherited from SoTexture.) | |
Copy | Calls Copy(false). (Inherited from SoNode.) | |
Copy(Boolean) | Creates and returns an exact copy of the node. | |
CopyFieldValues(SoFieldContainer) | Calls CopyFieldValues(fc, false). (Inherited from SoFieldContainer.) | |
CopyFieldValues(SoFieldContainer, Boolean) | Copies the contents of fc's fields into this object's fields. | |
Dispose |
Releases all resources used by SoDisposable.
(Inherited from SoDisposable.) | |
Distribute | (Inherited from SoNode.) | |
DoAction | (Overrides SoTextureDoAction(SoAction).) | |
EnableNotify | Notification at this Field Container is enabled (if flag == true) or disabled (if flag == false). | |
Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) | |
FieldsAreEqual | Returns true if this object's fields are exactly equal to fc's fields. | |
Get | Returns the values of the fields of this object in the Open Inventor ASCII file format in the given string. | |
GetAllFields | Returns a list of fields, including the eventIn's and eventOut's. | |
GetAlternateRep | This method is called by actions to allow the node to provide an "alternate representation" when appropriate (typically depending on the action type). | |
GetBitmapFileType | Gets the texture file format. | |
GetBoundingBox | (Inherited from SoNode.) | |
GetEventIn | Returns a the eventIn with the given name. | |
GetEventOut | Returns the eventOut with the given name. | |
GetField | Returns a the field of this object whose name is fieldName. | |
GetFieldName | Returns the name of the given field in the fieldName argument. | |
GetFields | Appends references to all of this object's fields to resultList, and returns the number of fields appended. | |
GetHashCode |
Overrides GetHashCode().
(Inherited from SoNetBase.) | |
GetMatrix | (Inherited from SoNode.) | |
GetName | Returns the name of an instance. | |
GetPrimitiveCount | (Inherited from SoNode.) | |
GetRenderEngineMode | Returns the supported Render engine mode. | |
GetRenderUnitID | (Inherited from SoNode.) | |
GetStringName | (Inherited from SoBase.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
GLRender | (Overrides SoTextureGLRender(SoGLRenderAction).) | |
GLRenderBelowPath | (Inherited from SoNode.) | |
GLRenderInPath | (Inherited from SoNode.) | |
GLRenderOffPath | (Inherited from SoNode.) | |
GrabEventsCleanup | (Inherited from SoNode.) | |
GrabEventsSetup | (Inherited from SoNode.) | |
HandleEvent | (Inherited from SoNode.) | |
HasDefaultValues | Returns true if all of the object's fields have their default values. | |
IsAllowPrequalifyFile | ||
IsBoundingBoxIgnoring | This method is used by getBoundingBox action traversal to know if the current node must be traversed or not, ie the bounding should be ignored. | |
IsNotifyEnabled | Notification is the process of telling interested objects that this object has changed. | |
IsOverride | Returns the state of the override field. | |
IsSynchronizable | Gets the ScaleViz synchronizable state of this object. | |
Pick | (Inherited from SoNode.) | |
RayPick | (Inherited from SoNode.) | |
Search | (Inherited from SoNode.) | |
Set | Sets one or more fields in this object to the values specified in the given string, which should be a string in the Open Inventor file format. | |
SetBitmapFileType | Sets the texture file format. | |
SetName | (Inherited from SoBase.) | |
SetOverride | Set the state of the override field. | |
SetSynchronizable | Sets this to be a ScaleViz synchronizable object. | |
SetToDefaults | Sets all fields in this object to their default values. | |
ToString |
Converts this SoBase structure to a human readable string.
(Inherited from SoBase.) | |
Touch | Marks an instance as modified, simulating a change to it. | |
Write | (Inherited from SoNode.) |
Name | Description | |
---|---|---|
blendColor | Color used for BLEND model. | |
borderColor | Defines border color used for border texture filtering. | |
enableBorder | Enables borders for textures. | |
enableCompressedTexture | Enables storage of textures on the graphics board in compressed form. | |
filenames | Names file(s) from which to read texture image(s). | |
HDRIExposure | Specifies an exposure factor when using an HDRI file. | |
imageNegX | ||
imageNegY | ||
imageNegZ | ||
imagePosX | Contains an in-memory representation of the texture map. | |
imagePosY | ||
imagePosZ | ||
internalFormat | Internal format for texture storage. | |
IsDisposable | ISafeDisposable interface implementation.
(Inherited from SoDisposable.) | |
magFilter | Specifies the OpenGL magFilter. | |
maxAnisotropy | Specifies on a per-texture object basis, the maximum degree of anisotropy to account for in texture filtering. | |
minFilter | Specifies the OpenGL minFilter. | |
model | Specifies how to map texture onto surface. | |
renderToTextureProperty | Specifies an OIV.Inventor.Nodes.SoRenderToTextureProperty node containing a scene graph that will be rendered to create the texture image. | |
UserData |
Gets or sets the user data to be contained by the field container.
(Inherited from SoFieldContainer.) | |
wrapR | Indicates what to do when texture coordinates in the R (depth) direction lie outside the range 0-1. | |
wrapS | Indicates what to do when texture coordinates in the S (horizontal) direction lie outside the range 0-1. | |
wrapT | Indicates what to do when texture coordinates in the T (vertical) direction lie outside the range 0-1. |
Cube map textures provide a new texture generation scheme for looking up textures from a set of six two-dimensional images representing the faces of a cube. The (s,t,r) texture coordinates are treated as a direction vector emanating from the center of a cube. At texture generation time, the interpolated per-fragment (s,t,r) selects one cube face two-dimensional image based on the largest magnitude coordinate (the major axis). A new (s,t) is calculated by dividing the two other coordinates (the minor axes values) by the major axis value, and the new (s,t) is used to lookup into the selected two-dimensional texture image face of the cube map.
Cube map textures are often used within shader programs to implement effects such as reflection or refraction.
There are three ways to send the texture to Open Inventor:
The textures can be read from six image files specified in the OIV.Inventor.Nodes.SoTextureCubeMap.filenames field.
Textures can be specified in memory by setting the image fields (OIV.Inventor.Nodes.SoTextureCubeMap.imagePosX, ...) to contain the texture data. Doing so resets the OIV.Inventor.Nodes.SoTextureCubeMap.filenames field to the empty string.
Textures can be rendered from a scene graph using the renderToTextureProperty field.
But in all cases, the images must be specified in the following order:
imagePosX (left)
imagePosY (bottom)
imagePosZ (back)
imageNegX (right)
imageNegY (top)
imageNegZ (front)
The OIV.Inventor.Nodes.SoTextureCoordinateReflectionMap node can be used to automatically generate appropriate texture coordinates for cube mapping.
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. See OIV.Inventor.Nodes.SoTexture2 for a complete discussion of this feature.
Transparency Texture images can contain transparency (alpha values less than 1) and modify the transparency of geometry in the scene. Also note that some image file formats, for example JPEG, do not support transparency information (alpha channel).
Limitations:
Since Open Inventor 10.0.0 Alpha 2 it is no longer possible to fill a OIV.Inventor.Nodes.SoTextureCubeMap with textures in different formats or sizes. All six textures must have the same format and size. If these conditions are not met, an error message is displayed (in debug) and nothing is changed on the state.
SoInput.AddDirectoryFirst("/ImageDirectory"); string[] faceFile = { "left.jpg", "bottom.jpg", "back.jpg", "right.jpg", "top.jpg", "front.jpg", }; SoTextureCubeMap texture = new SoTextureCubeMap(); for (int i = 0; i < 6; ++i) { texture.filenames[i] = faceFile[i]; } root.AddChild( new SoTextureCoordinateReflectionMap() ); root.AddChild( texture ); root.AddChild( geometry );
TextureCubeMap {
filenames | "" |
imagePosX | 0 0 0 |
imageNegX | 0 0 0 |
imagePosY | 0 0 0 |
imageNegY | 0 0 0 |
imagePosZ | 0 0 0 |
imageNegZ | 0 0 0 |
wrapS | REPEAT |
wrapT | REPEAT |
wrapR | REPEAT |
enableCompressedTexture | false |
model | MODULATE |
blendColor | 0 0 0 |
enableBorder | false |
borderColor | 0 0 0 0 |
maxAnisotropy | 1.0 |
minFilter | AUTO |
magFilter | AUTO |
useAutoMipmap | false |
internalFormat | AUTO_INTERNAL_FORMAT |
OIV.Inventor.Actions.SoGLRenderAction, OIV.Inventor.Actions.SoCallbackAction Sets current texture in state.