Related Scripting Object: OGLMaterial
This object represents the OpenGL properties of a material object. More...
#include <xsi_oglmaterial.h>
Inheritance diagram for OGLMaterial:

Public Member Functions |
|
| OGLMaterial () | |
| ~OGLMaterial () | |
| OGLMaterial (const CRef &in_ref) | |
| OGLMaterial (const OGLMaterial &in_obj) | |
| bool | IsA (siClassID in_ClassID) const |
| siClassID | GetClassID () const |
| OGLMaterial & | operator= (const OGLMaterial &in_obj) |
| OGLMaterial & | operator= (const CRef &in_ref) |
| CColor | GetDiffuse () const |
| CColor | GetSpecular () const |
| CColor | GetAmbient () const |
| double | GetDecay () const |
| siShadingModel | GetShadingModel () const |
OGLMaterial objects are read-only. OGLMaterial can be created with Material.OGLMaterial.
using namespace XSI; Application app; Model root = app.GetActiveSceneRoot(); X3DObject myGrid; root.AddGeometry( L"Grid", L"MeshSurface", L"", myGrid ); Material myMaterial(myGrid.GetMaterial()); OGLMaterial myOGLMaterial(myMaterial.GetOGLMaterial());
| OGLMaterial | ( | ) |
Default constructor.
| ~OGLMaterial | ( | ) |
Default destructor.
| OGLMaterial | ( | const CRef & | in_ref | ) |
Constructor.
| in_ref | constant reference object. |
| OGLMaterial | ( | const OGLMaterial & | in_obj | ) |
Copy constructor.
| in_obj | constant class object. |
| bool IsA | ( | siClassID | in_ClassID | ) | const [virtual] |
Returns true if a given class type is compatible with this API class.
| in_ClassID | class type. |
Reimplemented from CBase.
| siClassID GetClassID | ( | ) | const [virtual] |
Returns the type of the API class.
Implements CBase.
| OGLMaterial& operator= | ( | const OGLMaterial & | in_obj | ) |
Creates an object from another object. The newly created object is set to empty if the input object is not compatible.
| in_obj | constant class object. |
| OGLMaterial& operator= | ( | const CRef & | in_ref | ) |
Creates an object from a reference object. The newly created object is set to empty if the input reference object is not compatible.
| in_ref | constant class object. |
| CColor GetDiffuse | ( | ) | const |
Returns the diffuse color of this material.
| CColor GetSpecular | ( | ) | const |
Returns the specular color of this material.
| CColor GetAmbient | ( | ) | const |
Returns the ambient color of this material.
| double GetDecay | ( | ) | const |
The decay value of this material.
| siShadingModel GetShadingModel | ( | ) | const |
Returns the shading model of this material. It is usually not possible to exactly represent the mental ray shaders attached to a material in OpenGL; however, Softimage tries to guess the best OpenGL shading model to approximate these shaders.
Softimage chooses a shading model based on specific markings on shader parameters provided by the shader developer (using the ui "mapping" = "guid" syntax in the SPDL). These markings tell Softimage if a parameter can be interpreted as a diffuse color, a specular color, etc. and based on the presence or absence of these markings, Softimage guesses a shading model. For example, if there is a diffuse, specular, and ambient-like parameter, Softimage chooses the Phong shading model (which in OpenGL, is actually Gouraud). If only diffuse and ambient-like parameters are present, Lambert would be used instead (since the Lambert shading model does not have a specular color). If only ambient is present, Constant is used.