Simplygon C++ API  8.3.35800.0
SimplygonSDK::IMaterial Class Referenceabstract

#include <SimplygonSDK.h>

Inheritance diagram for SimplygonSDK::IMaterial:
SimplygonSDK::IObject

Public Member Functions

virtual void AddUserChannel (const char *channel_name)=0
 
virtual void ChangeTexturePrefixPath (const char *current_path_prefix, const char *new_path_prefix)=0
 
virtual void ConvertHandedness ()=0
 
virtual unsigned int GetChannelCount ()=0
 
virtual rstring GetChannelFromIndex (rid index)=0
 
virtual const char * GetClass ()
 
virtual rstring GetMaterialGUID ()=0
 
virtual unsigned int GetMaterialType ()=0
 
virtual CountedPointer< IShadingNodeGetShadingNetwork (const char *channel_name)=0
 
virtual bool GetUseTangentSpaceNormals ()=0
 
virtual bool HasUserChannel (const char *channel_name)=0
 
virtual bool IsA (const char *type) const
 
virtual bool IsIdenticalTo (IMaterial *mat)=0
 
virtual bool IsTransparent ()=0
 
virtual void LoadShadingNetworkFromXML (const char *channel_name, const char *in_xml)=0
 
virtual void RemoveUserChannel (const char *channel_name)=0
 
virtual rstring SaveShadingNetworkToXML (const char *channel_name)=0
 
virtual void SetMaterialGUID (const char *value)=0
 
virtual void SetMaterialType (unsigned int value)=0
 
virtual void SetOpacityFromDiffuseAlpha ()=0
 
virtual void SetShadingNetwork (const char *channel_name, IShadingNode *node)=0
 
virtual void SetUseTangentSpaceNormals (bool value)=0
 
- Public Member Functions inherited from SimplygonSDK::IObject
virtual rid AddObserver (robserver *Observer, rid EventId)=0
 
virtual void AddRef ()=0
 
virtual rstring GetName ()=0
 
virtual void * GetUserComponentArea (rid userid)=0
 
virtual void PrintInfo ()=0
 
virtual void Release ()=0
 
virtual void RemoveObserver (rid ObserverId)=0
 
virtual void SetName (const char *Name)=0
 

Static Public Member Functions

static bool IsClassA (const char *type)
 
static IMaterialSafeCast (IObject *ptr)
 
- Static Public Member Functions inherited from SimplygonSDK::IObject
static bool IsClassA (const char *type)
 
static IObjectSafeCast (IObject *ptr)
 

Detailed Description

IMaterial keeps information on materials used while rendering.

Definition at line 6972 of file SimplygonSDK.h.

Member Function Documentation

◆ AddUserChannel()

virtual void SimplygonSDK::IMaterial::AddUserChannel ( const char *  channel_name)
pure virtual

Add a user material channel

Parameters
channel_namethe name of the material channel

◆ ChangeTexturePrefixPath()

virtual void SimplygonSDK::IMaterial::ChangeTexturePrefixPath ( const char *  current_path_prefix,
const char *  new_path_prefix 
)
pure virtual

Changes the prefix path (drive, directory) of all matching texture paths in the material, with the new one. This method is useful when external textures are placed in a specific folder, which needs to be moved

Parameters
current_path_prefixthe current prefix path, either relative or absolute
new_path_prefixthe new prefix path

◆ ConvertHandedness()

virtual void SimplygonSDK::IMaterial::ConvertHandedness ( )
pure virtual

Converts parameters such as UVTiling and UVOffset in shading networks.

◆ GetChannelCount()

virtual unsigned int SimplygonSDK::IMaterial::GetChannelCount ( )
pure virtual

Returns the number of material channels in the material

Returns
the current channel count

◆ GetChannelFromIndex()

virtual rstring SimplygonSDK::IMaterial::GetChannelFromIndex ( rid  index)
pure virtual

Returns the name of a channel from the index. Note that by adding/removing channels the indices are changed, and this method should only be used for enumeration

Parameters
indexis the index to the channel to be fetched
Returns
the channel name corresponding to the index

◆ GetClass()

virtual const char* SimplygonSDK::IMaterial::GetClass ( )
virtual

GetClass returns the name of the class of the object.

Returns
the name of the actual class of the object, as a const char string

Reimplemented from SimplygonSDK::IObject.

◆ GetMaterialGUID()

virtual rstring SimplygonSDK::IMaterial::GetMaterialGUID ( )
pure virtual

Gets the unique id for this node.

Returns
the GUID for this node

◆ GetMaterialType()

virtual unsigned int SimplygonSDK::IMaterial::GetMaterialType ( )
pure virtual

Get the MaterialType.

◆ GetShadingNetwork()

virtual CountedPointer<IShadingNode> SimplygonSDK::IMaterial::GetShadingNetwork ( const char *  channel_name)
pure virtual

Get which shading network to use for the material's channel

Parameters
channel_nameis the name of the channel
Returns
the current shading network's exit node

◆ GetUseTangentSpaceNormals()

virtual bool SimplygonSDK::IMaterial::GetUseTangentSpaceNormals ( )
pure virtual

Set/Get the UseTangentSpaceNormals flag. If set, the normal map has tangent space normals

◆ HasUserChannel()

virtual bool SimplygonSDK::IMaterial::HasUserChannel ( const char *  channel_name)
pure virtual

Check if the user channel exists within the material.

Parameters
channel_namethe name of the material channel
Returns
true if the channel exists, false if not

◆ IsA()

virtual bool SimplygonSDK::IMaterial::IsA ( const char *  type) const
virtual

The IsA function returns true if the object is a or is a descendant of the class named as the type parameter

Parameters
typeis the name of the class to check if the object is, or is a descendant of
Returns
true if the object is of the specified class, false if not

Reimplemented from SimplygonSDK::IObject.

◆ IsClassA()

static bool SimplygonSDK::IMaterial::IsClassA ( const char *  type)
inlinestatic

The IsClassA function returns true if IMaterial is a or is a descendant of the class named as the type parameter

Parameters
typeis the name of the class to check if the class is, or is a descendant of
Returns
true if the class is of the specified class, false if not

Definition at line 6993 of file SimplygonSDK.h.

◆ IsIdenticalTo()

virtual bool SimplygonSDK::IMaterial::IsIdenticalTo ( IMaterial mat)
pure virtual

Returns true if the material is setup identical to this material

Parameters
matthe material to compare to

◆ IsTransparent()

virtual bool SimplygonSDK::IMaterial::IsTransparent ( )
pure virtual

Returns true if the material could be transparent

◆ LoadShadingNetworkFromXML()

virtual void SimplygonSDK::IMaterial::LoadShadingNetworkFromXML ( const char *  channel_name,
const char *  in_xml 
)
pure virtual

Save shading network to XML

Parameters
channel_nameis the name of the channel
in_xmlthe xml descriping the shading node graph
Returns
the current shading network's exit node

◆ RemoveUserChannel()

virtual void SimplygonSDK::IMaterial::RemoveUserChannel ( const char *  channel_name)
pure virtual

Remove a user material channel

Parameters
channel_namethe name of the material channel

◆ SafeCast()

static IMaterial* SimplygonSDK::IMaterial::SafeCast ( IObject ptr)
inlinestatic

SafeCast makes sure the pointer is of a class that can be cast into a IMaterial pointer, and if this is possible, returns the cast pointer.

Parameters
ptris the pointer to be cast into a IMaterial pointer
Returns
a pointer to the IMaterial object, if the cast can be made, and a NULL pointer otherwise

Definition at line 7006 of file SimplygonSDK.h.

◆ SaveShadingNetworkToXML()

virtual rstring SimplygonSDK::IMaterial::SaveShadingNetworkToXML ( const char *  channel_name)
pure virtual

Save shading network to XML

Parameters
channel_nameis the name of the channel
Returns
the current shading network's exit node

◆ SetMaterialGUID()

virtual void SimplygonSDK::IMaterial::SetMaterialGUID ( const char *  value)
pure virtual

Sets the unique id for this node.

Parameters
valueis the node id of type string

◆ SetMaterialType()

virtual void SimplygonSDK::IMaterial::SetMaterialType ( unsigned int  value)
pure virtual

Set the MaterialType.

Parameters
valuethe Material type. One of the following
  • SG_MATERIALTYPE_STANDARD -> Use the standard shader
  • SG_MATERIALTYPE_FLIPBOOK -> Use the flipbook shader.
  • SG_MATERIALTYPE_BILLBOARDCLOUD -> Use the billboard cloud shader.

◆ SetOpacityFromDiffuseAlpha()

virtual void SimplygonSDK::IMaterial::SetOpacityFromDiffuseAlpha ( )
pure virtual

Maps the alpha component of the diffuse channel to all the RGBA components in the opacity channel (by using a swizzle node).

◆ SetShadingNetwork()

virtual void SimplygonSDK::IMaterial::SetShadingNetwork ( const char *  channel_name,
IShadingNode node 
)
pure virtual

Set which shading network to use for the material's channel

Parameters
channel_nameis the name of the new channel
nodethe shading network's exit node

◆ SetUseTangentSpaceNormals()

virtual void SimplygonSDK::IMaterial::SetUseTangentSpaceNormals ( bool  value)
pure virtual

Set/Get the UseTangentSpaceNormals flag. If set, the normal map has tangent space normals

Parameters
valuethe desired flag value.

The documentation for this class was generated from the following file: