HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GR_Material Class Referenceabstract

#include <GR_Material.h>

+ Inheritance diagram for GR_Material:

Public Types

enum  AlphaMode { ALPHA_BLEND = 0, ALPHA_CUTOUT, ALPHA_IGNORE }
 
enum  MaterialType {
  SIMPLE_SURFACE, UNLIT_SURFACE, FILM_SURFACE, HAIR_CURVE,
  HEIGHTFIELD_SURFACE, MATX_SURFACE, MATCAP_SURFACE
}
 
enum  InputType {
  IN_INT, IN_FLOAT, IN_VEC2, IN_VEC3,
  IN_VEC4
}
 

Public Member Functions

MaterialType type () const
 
int getNodeID () const
 
void setNodeID (int id)
 
UT_StringHolder getNodePath () const
 
void setTimeDependent (bool timedep, fpreal t=0.0)
 
void setOPTimeDependent (bool timedep, fpreal t=0.0)
 
bool isTimeDependent () const
 
bool isOPTimeDependent () const
 
fpreal getCurrentTime () const
 
bool isDirty (fpreal time)
 
void dirty (bool dirty=true)
 
virtual void dirtyTextures ()
 
bool isTextured () const
 
void setTextured (bool has_tex)
 
bool hasUDIM () const
 
void setHasUDIM (bool has_udim)
 
bool hasDisplacement () const
 
void setHasDisplacement (bool has_disp)
 
bool needsUVs () const
 
void setNeedsUVs (bool uvs)
 
bool needsTangents () const
 
void setNeedsTangents (bool tan)
 
bool isTransparent () const
 
void setTransparent (bool has_tex)
 
bool texturesLoaded () const
 
void setTexturesLoaded (bool loaded)
 
bool bindWithoutUpdate (RV_Render *r, RV_ShaderProgram *shader, const GR_DisplayOption *opts, bool for_curve=false)
 
bool bind (RV_Render *r, RV_ShaderProgram *shader, const GR_DisplayOption *opts, bool for_curve=false)
 
virtual void update (const GR_MaterialParms &options)=0
 
virtual bool initMaterialSetForRender (RV_Render *r, RV_ShaderProgram *shader, bool &created)=0
 
virtual bool initBlocks (RV_Render *r, const GR_DisplayOption *opts)=0
 
bool bindSets (RV_Render *r, RV_ShaderProgram *shader, bool for_curve)
 
DEP_MicroNodedependencies ()
 
virtual RV_ShaderProgramgetSurfaceShader () const
 
virtual RV_ShaderProgramgetCurveShader () const
 
bool opDependenciesDirty () const
 
void clearOpDependenciesDirty ()
 
const UT_Set< intopDependencies () const
 
void setOverrides (const UT_Options *overrides)
 
const UT_OptionsgetOverrides () const
 
void setFallbacks (const UT_Options *attrib_fallbacks)
 
const UT_OptionsgetFallbacks () const
 
void setExtraInputs (const UT_StringMap< InputType > &extra_inputs)
 
const UT_StringMap< InputType > & extraInputs () const
 
- Public Member Functions inherited from GR_SceneItem
const UT_StringHoldername () const
 
exint id () const
 
int64 getVersion () const
 
void setVersion (int64 v)
 
void incref ()
 
void decref ()
 
void setName (const UT_StringHolder &name)
 
void setID (int id)
 

Static Public Member Functions

static GR_MaterialPtr create (MaterialType type, const UT_StringHolder &name)
 
static exint getUniqueMaterialID ()
 

Protected Member Functions

 GR_Material (const UT_StringHolder &name, MaterialType type)
 
 ~GR_Material () override
 
 UT_NON_COPYABLE (GR_Material)
 
void clearOpIDs ()
 
void addOpID (int id)
 
bool timeChangeCheck () const
 
- Protected Member Functions inherited from GR_SceneItem
 GR_SceneItem (const UT_StringHolder &name, int id)
 
virtual ~GR_SceneItem ()
 
 UT_NON_COPYABLE (GR_SceneItem)
 

Protected Attributes

bool myDirtyFlag
 
bool myBlockDirtyFlag
 

Detailed Description

Definition at line 45 of file GR_Material.h.

Member Enumeration Documentation

Enumerator
ALPHA_BLEND 
ALPHA_CUTOUT 
ALPHA_IGNORE 

Definition at line 50 of file GR_Material.h.

Enumerator
IN_INT 
IN_FLOAT 
IN_VEC2 
IN_VEC3 
IN_VEC4 

Definition at line 176 of file GR_Material.h.

Enumerator
SIMPLE_SURFACE 
UNLIT_SURFACE 
FILM_SURFACE 
HAIR_CURVE 
HEIGHTFIELD_SURFACE 
MATX_SURFACE 
MATCAP_SURFACE 

Definition at line 56 of file GR_Material.h.

Constructor & Destructor Documentation

GR_Material::GR_Material ( const UT_StringHolder name,
MaterialType  type 
)
protected
GR_Material::~GR_Material ( )
overrideprotected

Member Function Documentation

void GR_Material::addOpID ( int  id)
protected
bool GR_Material::bind ( RV_Render r,
RV_ShaderProgram shader,
const GR_DisplayOption opts,
bool  for_curve = false 
)
inline

Definition at line 143 of file GR_Material.h.

bool GR_Material::bindSets ( RV_Render r,
RV_ShaderProgram shader,
bool  for_curve 
)
bool GR_Material::bindWithoutUpdate ( RV_Render r,
RV_ShaderProgram shader,
const GR_DisplayOption opts,
bool  for_curve = false 
)
inline

Definition at line 137 of file GR_Material.h.

void GR_Material::clearOpDependenciesDirty ( )
inline

Definition at line 166 of file GR_Material.h.

void GR_Material::clearOpIDs ( )
inlineprotected

Definition at line 196 of file GR_Material.h.

static GR_MaterialPtr GR_Material::create ( MaterialType  type,
const UT_StringHolder name 
)
static
DEP_MicroNode& GR_Material::dependencies ( )
inline

Definition at line 160 of file GR_Material.h.

void GR_Material::dirty ( bool  dirty = true)
inline

Definition at line 99 of file GR_Material.h.

virtual void GR_Material::dirtyTextures ( )
inlinevirtual

Reimplemented in GR_MatXMaterial, GR_HairMaterial, GR_FilmMaterial, and GR_MatCapMaterial.

Definition at line 111 of file GR_Material.h.

const UT_StringMap<InputType>& GR_Material::extraInputs ( ) const
inline

Definition at line 186 of file GR_Material.h.

fpreal GR_Material::getCurrentTime ( ) const
inline

Definition at line 80 of file GR_Material.h.

virtual RV_ShaderProgram* GR_Material::getCurveShader ( ) const
inlinevirtual

Definition at line 163 of file GR_Material.h.

const UT_Options* GR_Material::getFallbacks ( ) const
inline

Definition at line 174 of file GR_Material.h.

int GR_Material::getNodeID ( ) const
inline

Definition at line 72 of file GR_Material.h.

UT_StringHolder GR_Material::getNodePath ( ) const
const UT_Options* GR_Material::getOverrides ( ) const
inline

Definition at line 171 of file GR_Material.h.

virtual RV_ShaderProgram* GR_Material::getSurfaceShader ( ) const
inlinevirtual

Definition at line 162 of file GR_Material.h.

static exint GR_Material::getUniqueMaterialID ( )
static
bool GR_Material::hasDisplacement ( ) const
inline

Definition at line 120 of file GR_Material.h.

bool GR_Material::hasUDIM ( ) const
inline

Definition at line 117 of file GR_Material.h.

virtual bool GR_Material::initBlocks ( RV_Render r,
const GR_DisplayOption opts 
)
pure virtual
virtual bool GR_Material::initMaterialSetForRender ( RV_Render r,
RV_ShaderProgram shader,
bool &  created 
)
pure virtual
bool GR_Material::isDirty ( fpreal  time)
inline

Definition at line 82 of file GR_Material.h.

bool GR_Material::isOPTimeDependent ( ) const
inline

Definition at line 79 of file GR_Material.h.

bool GR_Material::isTextured ( ) const
inline

Definition at line 114 of file GR_Material.h.

bool GR_Material::isTimeDependent ( ) const
inline

Definition at line 78 of file GR_Material.h.

bool GR_Material::isTransparent ( ) const
inline

Definition at line 131 of file GR_Material.h.

bool GR_Material::needsTangents ( ) const
inline

Definition at line 128 of file GR_Material.h.

bool GR_Material::needsUVs ( ) const
inline

Definition at line 124 of file GR_Material.h.

const UT_Set<int> GR_Material::opDependencies ( ) const
inline

Definition at line 167 of file GR_Material.h.

bool GR_Material::opDependenciesDirty ( ) const
inline

Definition at line 165 of file GR_Material.h.

void GR_Material::setExtraInputs ( const UT_StringMap< InputType > &  extra_inputs)
inline

Definition at line 184 of file GR_Material.h.

void GR_Material::setFallbacks ( const UT_Options attrib_fallbacks)
void GR_Material::setHasDisplacement ( bool  has_disp)
inline

Definition at line 121 of file GR_Material.h.

void GR_Material::setHasUDIM ( bool  has_udim)
inline

Definition at line 118 of file GR_Material.h.

void GR_Material::setNeedsTangents ( bool  tan)
inline

Definition at line 129 of file GR_Material.h.

void GR_Material::setNeedsUVs ( bool  uvs)
inline

Definition at line 125 of file GR_Material.h.

void GR_Material::setNodeID ( int  id)
inline

Definition at line 73 of file GR_Material.h.

void GR_Material::setOPTimeDependent ( bool  timedep,
fpreal  t = 0.0 
)
void GR_Material::setOverrides ( const UT_Options overrides)
void GR_Material::setTextured ( bool  has_tex)
inline

Definition at line 115 of file GR_Material.h.

void GR_Material::setTexturesLoaded ( bool  loaded)
inline

Definition at line 135 of file GR_Material.h.

void GR_Material::setTimeDependent ( bool  timedep,
fpreal  t = 0.0 
)
void GR_Material::setTransparent ( bool  has_tex)
inline

Definition at line 132 of file GR_Material.h.

bool GR_Material::texturesLoaded ( ) const
inline

Definition at line 134 of file GR_Material.h.

bool GR_Material::timeChangeCheck ( ) const
protected
MaterialType GR_Material::type ( ) const
inline

Definition at line 69 of file GR_Material.h.

virtual void GR_Material::update ( const GR_MaterialParms options)
pure virtual
GR_Material::UT_NON_COPYABLE ( GR_Material  )
protected

Member Data Documentation

bool GR_Material::myBlockDirtyFlag
protected

Definition at line 213 of file GR_Material.h.

bool GR_Material::myDirtyFlag
protected

Definition at line 212 of file GR_Material.h.


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