HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RE_Material Class Reference

#include <RE_Material.h>

+ Inheritance diagram for RE_Material:

Public Types

enum  RE_MaterialType {
  FILM_SURFACE, GAMES_SURFACE, HAIR, TERRAIN_SURFACE,
  MATX_SURFACE
}
 
enum  RE_TexMapType {
  DIFFUSE, SPECULAR, BUMP, NORMAL,
  OPACITY, ENVIRONMENT, DISPLACEMENT, EMISSION,
  ROUGHNESS, OCCLUSION, METALLIC, COAT_INTENSITY,
  COAT_ROUGHNESS, REFLECTION_AMOUNT, HAIR_DIFFUSE, HAIR_DIFFUSE_BLEND,
  HAIR_SPECULAR, HAIR_SPECULAR_BLEND, HAIR_ALPHA, GAME_BLEND,
  NUM_TEXMAP_TYPES
}
 
enum  AlphaMode { ALPHA_BLEND = 0, CUTOUT_ALPHA, IGNORE_ALPHA }
 
enum  { PHONG =0, BLINN =1, GGX =2, SPEC_ANGLE =3 }
 
enum  re_NormalMapType { NMLMAP_TANGENT =0, NMLMAP_WORLD =1, NMLMAP_OBJECT =2 }
 
enum  re_Displace { DISPLACE_NORMAL, DISPLACE_VECTOR_TANGENT, DISPLACE_VECTOR_WORLD, DISPLACE_VECTOR_OBJECT }
 

Public Member Functions

 RE_Material (const char *materialName)
 
const UT_StringHoldergetMaterialName () const
 
int getUniqueId () const
 
int64 getVersion () const
 
void setVersion (int64 v)
 
void dirty (bool dirty=true)
 
bool isDirty (fpreal time) const
 
void setTimeDependent (bool timedep, fpreal t=0.0)
 
bool isTimeDependent () const
 
fpreal getCurrentTime () const
 
void incref ()
 
void decref ()
 
void setNodePath (UT_StringHolder path, int node_id)
 
const UT_StringHoldergetNodePath () const
 
int getNodeId () const
 
void setMatNetName (const UT_StringRef &mat_path)
 
const UT_StringRefgetMatNetName () const
 
void setMatXNodeVersion (int64 version)
 
int64 getMatXNodeVersion () const
 
void dirtyMatNet (bool dirty=true)
 
bool isMatNetDirty () const
 
void setOverrides (const UT_Options *overrides)
 
const UT_OptionsgetOverrides () const
 
bool hasOverrides () const
 
void setVertexOverrides (const UT_StringMap< UT_StringHolder > &ovr)
 
const UT_StringMap
< UT_StringHolder > & 
vertexOverrides () const
 
void setMaterialType (RE_MaterialType type)
 
RE_MaterialType getMaterialType () const
 
void markDefaultShader (bool def)
 
bool isDefaultShader () const
 
void assignShaderRef (int shader_program_id, RE_ShaderTarget ptype=RE_SHADER_TARGET_TRIANGLE)
 
void assignShader (RE_Shader *sh, RE_ShaderTarget ptype=RE_SHADER_TARGET_TRIANGLE, bool owned=true)
 
void assignShader (UT_UniquePtr< RE_Shader > &&sh, RE_ShaderTarget ptype=RE_SHADER_TARGET_TRIANGLE)
 
int getShaderRefID (RE_ShaderTarget ptype=RE_SHADER_TARGET_TRIANGLE) const
 
void clearTexture (RE_Render *r)
 
void clearDiffuseMap ()
 
void reserveDiffuseLayers (int nlayers)
 
RE_TextureHolder getDiffuseMap (RE_Render *r, int layer, bool preload=false, bool mat_changed=true)
 
RE_TextureHolder getSpecularMap (RE_Render *r, bool preload=false, bool mat_change=true)
 
RE_TextureHolder getBumpMap (RE_Render *r, bool preload=false, bool mat_change=true)
 
RE_TextureHolder getNormalMap (RE_Render *r, bool preload=false, bool mat_change=true)
 
RE_TextureHolder getOpacityMap (RE_Render *r, bool preload=false, bool mat_change=true)
 
RE_TextureHolder getDisplaceMap (RE_Render *r, bool preload=false, bool mat_change=true)
 
RE_TextureHolder getEmissionMap (RE_Render *r, bool preload=false, bool mat_change=true)
 
RE_TextureHolder getRoughnessMap (RE_Render *r, bool preload=false, bool mat_change=true)
 
RE_TextureHolder getOcclusionMap (RE_Render *r, bool preload=false, bool mat_change=true)
 
RE_TextureHolder getMetallicMap (RE_Render *r, bool preload=false, bool mat_change=true)
 
RE_TextureHolder getCoatIntensityMap (RE_Render *r, bool preload=false, bool mat_change=true)
 
RE_TextureHolder getCoatRoughnessMap (RE_Render *r, bool preload=false, bool mat_change=true)
 
RE_TextureHolder getReflectionAmountMap (RE_Render *r, bool preload=false, bool mat_change=true)
 
RE_TextureHolder getHairDiffuseMap (RE_Render *r, bool preload=false)
 
RE_TextureHolder getHairSpecularMap (RE_Render *r, bool preload=false)
 
RE_TextureHolder getHairDiffuseRamp (RE_Render *r, bool preload=false)
 
RE_TextureHolder getHairSpecularRamp (RE_Render *r, bool preload=false)
 
RE_TextureHolder getHairAlphaRamp (RE_Render *r, bool preload=false)
 
RE_TextureHolder getEnvMap (RE_Render *r, bool preload=false)
 
bool areTexturesPending ()
 
void clearTextureLayer (int layer)
 
bool hasSpecularMap () const
 
bool hasBumpMap () const
 
bool hasNormalMap () const
 
bool hasOpacityMap () const
 
bool hasDisplaceMap () const
 
bool hasEnvMap () const
 
bool hasEmissionMap () const
 
bool hasRoughnessMap () const
 
bool hasOcclusionMap () const
 
bool hasMetallicMap () const
 
bool hasCoatRoughnessMap () const
 
bool hasCoatIntensityMap () const
 
bool hasReflectionAmountMap () const
 
bool hasHairDiffuseMap () const
 
bool hasHairSpecularMap () const
 
bool hasHairDiffuseRamp () const
 
bool hasHairSpecularRamp () const
 
bool hasHairAlphaRamp () const
 
bool isTransparent (bool check_diffuse_alpha) const
 
void setTransparent (bool alpha)
 
bool isTextured () const
 
void setTextured (bool has_tex)
 
bool needsUVs () const
 
void setNeedsUVs (bool uvs)
 
void needTextureUpdate ()
 
bool needsTextureUpdate () const
 
void setNumMatXTextures (int num)
 
void setMatXTexture (RE_TextureMap *map, int index)
 
RE_TextureMapgetMatXTexture (int index) const
 
void finishTextureSetup (RE_Render *r, bool preload)
 
bool checkForCacheUpdate (int cache_serial, fpreal t)
 
bool isMatCapTextured () const
 
const UT_Map< UT_StringHolder,
int > & 
getUVSets ()
 
void clearUVSets ()
 
void addUVSet (const UT_StringRef &uv)
 
const UT_StringHoldergetLayerUVSet (int layer) const
 
void setTextureFormat (RE_TextureCompress format)
 
RE_TextureCompress getTextureFormat () const
 
void limitTextureSize (bool limit, int w, int h)
 
bool limitTextureSize () const
 
void getMaxTextureSize (int &w, int &h)
 
void setTextureScale (float sc)
 
float getTextureScale () const
 
void setTextureMemLimitMB (int mem)
 
int getTextureMemLimitMB () const
 
void mipMapTextures (bool yes)
 
bool mipMapTextures () const
 
void setAnisotropySamples (int samp)
 
int getAnisotropySamples () const
 
void allowShaders (bool yes)
 
bool allowShaders () const
 
void doLighting (bool yes)
 
bool isLit () const
 
RE_ShadercreateShader (RE_Render *r, const char *name=nullptr, RE_ShaderTarget ptype=RE_SHADER_TARGET_TRIANGLE)
 
RE_ShadergetShader (RE_ShaderTarget sht=RE_SHADER_TARGET_TRIANGLE) const
 
bool isShaderOwned (RE_ShaderTarget sht=RE_SHADER_TARGET_TRIANGLE) const
 
void setShaderSource (const char *vert_src, const char *geom_src, const char *frag_src, RE_ShaderTarget ptype=RE_SHADER_TARGET_TRIANGLE)
 caches the source for the shader in the material. More...
 
bool hasShaderSource (const char *vert_src, const char *geom_src, const char *frag_src, RE_ShaderTarget ptype=RE_SHADER_TARGET_TRIANGLE)
 
void setShaderProgram (const char *program_file)
 
bool hasShaderProgram (const char *program_file) const
 
bool hasCustomShader (RE_ShaderTarget ptype=RE_SHADER_TARGET_TRIANGLE) const
 
bool customShaderDirty () const
 
void removeShader ()
 
float amb (unsigned idx) const
 
UT_Vector3F amb () const
 
float diff (unsigned idx) const
 
UT_Vector3F diff () const
 
float spec (unsigned idx) const
 
UT_Vector3F spec () const
 
float emit (unsigned idx) const
 
UT_Vector3F emit () const
 
UT_Vector3F metallicEdgeTint () const
 
float metallic () const
 
float alpha () const
 
float roughness () const
 
float reflection () const
 
float coatRoughness () const
 
float coatIntensity () const
 
float diffuseRoughness () const
 
void setAlpha (float alpha_perp, float alpha_para=-1.0)
 
void setAlphaMode (AlphaMode mode)
 
AlphaMode getAlphaMode () const
 
void setAlphaCutoff (fpreal alpha_val)
 
fpreal getAlphaCutoff () const
 
void setShaderAlpha (bool enabled)
 
bool hasShaderAlpha () const
 
void setRoughness (float r)
 
void setShininess (float sh)
 
void setDiffuseRoughness (fpreal r)
 
void setAmb (float r, float g, float b)
 
void setDiff (float r, float g, float b)
 
void setSpec (float r, float g, float b)
 
void setEmit (float r, float g, float b)
 
void setMetallic (float metal)
 
void setMetallicEdge (const UT_Vector3F &metal)
 
void setAmbient (UT_Color col)
 
void setDiffuse (UT_Color col)
 
void setSpecular (UT_Color col)
 
void setEmission (UT_Color col)
 
void setAmbient (const UT_Vector3F &col)
 
void setDiffuse (const UT_Vector3F &col)
 
void setSpecular (const UT_Vector3F &col)
 
void setEmission (const UT_Vector3F &col)
 
void setSpecularTint (fpreal t)
 
fpreal getSpecularTint () const
 
void setSpecularModel (int spec_model)
 
int getSpecularModel () const
 
void setCoatSpecularModel (int spec_model)
 
int getCoatSpecuarModel () const
 
void setCoatIntensity (fpreal i)
 
fpreal getCoatIntensity () const
 
void setCoatRoughness (fpreal r)
 
fpreal getCoatRoughness () const
 
void setIOR (float ior)
 
fpreal getIOR () const
 
void setReflection (float r, bool explicit_r)
 
fpreal getReflection () const
 
void usePackedColor (bool enable)
 
void useGeometryColor (bool enable)
 
bool usePackedColor () const
 
bool useGeometryColor () const
 
bool hasExplicitReflection () const
 
void setNeedsTangentSpace (bool b)
 
bool needsTangentSpace () const
 
void setOpacityMapParms (bool invert, int component)
 
void setNormalParms (re_NormalMapType type, bool bias, UT_Vector2F scale, bool flip_x, bool flip_y, bool flip_z)
 
void setEnvParms (float scale, const UT_Vector3 &rot, const UT_XformOrder &rord)
 
void setDisplaceParms (float scale, float offset, float quality, re_Displace vector_space, bool y_up)
 
void setDisplaceLOD (float lod)
 
float getDisplaceLOD () const
 
void setRoughParms (bool invert_map, int component)
 
void setOcclusionParms (int component)
 
void setMetallicParms (int component)
 
void setCoatRoughnessParms (int component)
 
void setCoatIntensityParms (int component)
 
void setReflectionAmountParms (int component, bool affect_ior)
 
void setEmissionParms (bool use_matcap)
 
bool hasDisplacement () const
 
void setUVTransform (RE_TexMapType maptype, const UT_Matrix3F &xform, int layer=0)
 
void clearUVTransform (RE_TexMapType maptype, int layer=0)
 
void enableHairParameters (bool e)
 
void setHairDiffuse (float intensity, UT_Vector3F root_col, UT_Vector3F tip_col, bool use_map, bool use_ramp)
 
void setHairSpecular (float intensity, float angle, float shift, UT_Vector3F root_col, UT_Vector3F tip_col, bool use_map, bool use_ramp)
 
void setHairAlpha (float alpha, bool use_alpha_ramp)
 
void setHairRandomize (bool random_hue, UT_Vector2F hue_range, bool random_sat, UT_Vector2F sat_range, bool random_int, UT_Vector2F int_range, bool random_spec_int, UT_Vector2F spec_int_range)
 
void setUVTransform (int layer, UT_Vector2F t, fpreal r, UT_Vector2F s)
 
void getUVTransform (int layer, UT_Vector2F &t, fpreal &r, UT_Vector2F &s) const
 
void setUVLayerTint (int layer, bool use_tint, UT_Vector4F tint, fpreal rough)
 
void setUVTriplanar (int layer, fpreal scale=1.0, fpreal sharp=1.0, UT_Vector3F blend=UT_Vector3F(1.0f), UT_Vector3F offset=UT_Vector3F(0.0f))
 
bool isUVTriplanar (int layer) const
 
fpreal getUVTriplanarSharp (int layer) const
 
fpreal getUVTriplanarScale (int layer) const
 
UT_Vector3F getUVTriplanarBlend (int layer) const
 
UT_Vector3F getUVTriplanarOffset (int layer) const
 
bool getUVLayerUseTint (int layer) const
 
UT_Vector4F getUVLayerTint (int layer) const
 
fpreal getUVLayerRough (int layer) const
 
void setReflectionMap (RE_Texture *map)
 
void clearReflectionMap ()
 
RE_MaterialPtr cloneWithoutTexture () const
 
bool loadTextureMaps (RE_Render *r, bool preload_only=false)
 
void preloadMapsOnly (bool preload)
 
void assignTextureMap (RE_Texture *tex, RE_TexMapType maptype, int index=0)
 
void removeTextureMap (RE_TexMapType maptype, int index=0)
 
void setTextureMap (RE_TextureMap *map, bool give_ownership, RE_TexMapType maptype, const UT_StringRef &uv_set, int index=0)
 
void clearTextureMap (RE_TexMapType maptype, int index=0)
 
RE_TextureMapgetTextureMap (RE_TexMapType maptype, int index=0)
 
int getNumDiffuseLayers () const
 
bool updateShaderForMaterial (RE_Render *r, int layer, bool textured, RE_ShaderTarget sht=RE_SHADER_TARGET_TRIANGLE, RE_Shader *shader=nullptr, bool allow_partial=false)
 
void restoreShader (RE_Render *r, RE_ShaderTarget sht=RE_SHADER_TARGET_TRIANGLE)
 
int64 getMemoryUsage (bool inclusive) const
 
void writeMaterialParmsToBlockGL4 (RE_Render *r, RE_UniformBlock *block, int material_idx, int layer, bool lit, bool textured)
 
void makeTexturesResident (RE_Render *r)
 
void removeTexturesFromResident (RE_Render *r)
 
DEP_MicroNodedependencies ()
 
void updateMaterialBlock (int layer)
 
const RE_UniformBlockHandlematerialBlock () const
 
const RE_UniformBlockHandlehairBlock () const
 
const RE_UniformBlockHandlegameMatBlock () const
 

Static Public Member Functions

static RE_MaterialTextureBinding getMaterialTextureBinding (const UT_StringRef &texname)
 
static bool fetchRegOrUDIM (const UT_StringRef &tex_name, const UT_StringRef &node_path, RE_TextureMap *&map, bool allow_preload=false, const char *uvtile_marker=nullptr)
 
static void setEnvMapOverride (RE_TextureHolder env_map, const UT_Matrix3F &rot, const UT_Vector3F &col)
 
static void clearEnvMapOverride ()
 
static RE_TextureHolder getEnvMapOverride ()
 

Additional Inherited Members

- Protected Member Functions inherited from UT_NonCopyableNS::UT_NonCopyable
 UT_NonCopyable ()=default
 
 ~UT_NonCopyable ()=default
 
 UT_NonCopyable (const UT_NonCopyable &)=delete
 
UT_NonCopyableoperator= (const UT_NonCopyable &)=delete
 

Detailed Description

Definition at line 41 of file RE_Material.h.

Member Enumeration Documentation

anonymous enum
Enumerator
PHONG 
BLINN 
GGX 
SPEC_ANGLE 

Definition at line 432 of file RE_Material.h.

Enumerator
ALPHA_BLEND 
CUTOUT_ALPHA 
IGNORE_ALPHA 

Definition at line 379 of file RE_Material.h.

Enumerator
DISPLACE_NORMAL 
DISPLACE_VECTOR_TANGENT 
DISPLACE_VECTOR_WORLD 
DISPLACE_VECTOR_OBJECT 

Definition at line 474 of file RE_Material.h.

Enumerator
FILM_SURFACE 
GAMES_SURFACE 
HAIR 
TERRAIN_SURFACE 
MATX_SURFACE 

Definition at line 105 of file RE_Material.h.

Enumerator
NMLMAP_TANGENT 
NMLMAP_WORLD 
NMLMAP_OBJECT 

Definition at line 465 of file RE_Material.h.

Enumerator
DIFFUSE 
SPECULAR 
BUMP 
NORMAL 
OPACITY 
ENVIRONMENT 
DISPLACEMENT 
EMISSION 
ROUGHNESS 
OCCLUSION 
METALLIC 
COAT_INTENSITY 
COAT_ROUGHNESS 
REFLECTION_AMOUNT 
HAIR_DIFFUSE 
HAIR_DIFFUSE_BLEND 
HAIR_SPECULAR 
HAIR_SPECULAR_BLEND 
HAIR_ALPHA 
GAME_BLEND 
NUM_TEXMAP_TYPES 

Definition at line 136 of file RE_Material.h.

Constructor & Destructor Documentation

RE_Material::RE_Material ( const char *  materialName)
explicit

Member Function Documentation

void RE_Material::addUVSet ( const UT_StringRef uv)
void RE_Material::allowShaders ( bool  yes)
inline

Definition at line 314 of file RE_Material.h.

bool RE_Material::allowShaders ( ) const
inline

Definition at line 315 of file RE_Material.h.

float RE_Material::alpha ( ) const
inline

Definition at line 367 of file RE_Material.h.

float RE_Material::amb ( unsigned  idx) const
inline

Definition at line 357 of file RE_Material.h.

UT_Vector3F RE_Material::amb ( ) const
inline

Definition at line 358 of file RE_Material.h.

bool RE_Material::areTexturesPending ( )
inline

Definition at line 218 of file RE_Material.h.

void RE_Material::assignShader ( RE_Shader sh,
RE_ShaderTarget  ptype = RE_SHADER_TARGET_TRIANGLE,
bool  owned = true 
)
void RE_Material::assignShader ( UT_UniquePtr< RE_Shader > &&  sh,
RE_ShaderTarget  ptype = RE_SHADER_TARGET_TRIANGLE 
)
void RE_Material::assignShaderRef ( int  shader_program_id,
RE_ShaderTarget  ptype = RE_SHADER_TARGET_TRIANGLE 
)
void RE_Material::assignTextureMap ( RE_Texture tex,
RE_TexMapType  maptype,
int  index = 0 
)
bool RE_Material::checkForCacheUpdate ( int  cache_serial,
fpreal  t 
)
inline

Definition at line 995 of file RE_Material.h.

void RE_Material::clearDiffuseMap ( )
static void RE_Material::clearEnvMapOverride ( )
static
void RE_Material::clearReflectionMap ( )
inline

Definition at line 564 of file RE_Material.h.

void RE_Material::clearTexture ( RE_Render r)
void RE_Material::clearTextureLayer ( int  layer)
void RE_Material::clearTextureMap ( RE_TexMapType  maptype,
int  index = 0 
)
void RE_Material::clearUVSets ( )
void RE_Material::clearUVTransform ( RE_TexMapType  maptype,
int  layer = 0 
)
RE_MaterialPtr RE_Material::cloneWithoutTexture ( ) const
float RE_Material::coatIntensity ( ) const
inline

Definition at line 371 of file RE_Material.h.

float RE_Material::coatRoughness ( ) const
inline

Definition at line 370 of file RE_Material.h.

RE_Shader* RE_Material::createShader ( RE_Render r,
const char *  name = nullptr,
RE_ShaderTarget  ptype = RE_SHADER_TARGET_TRIANGLE 
)
bool RE_Material::customShaderDirty ( ) const
inline

Definition at line 352 of file RE_Material.h.

void RE_Material::decref ( )
inline

Definition at line 72 of file RE_Material.h.

DEP_MicroNode& RE_Material::dependencies ( )
inline

Definition at line 628 of file RE_Material.h.

float RE_Material::diff ( unsigned  idx) const
inline

Definition at line 359 of file RE_Material.h.

UT_Vector3F RE_Material::diff ( ) const
inline

Definition at line 360 of file RE_Material.h.

float RE_Material::diffuseRoughness ( ) const
inline

Definition at line 372 of file RE_Material.h.

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

Definition at line 53 of file RE_Material.h.

void RE_Material::dirtyMatNet ( bool  dirty = true)
inline

Definition at line 90 of file RE_Material.h.

void RE_Material::doLighting ( bool  yes)
float RE_Material::emit ( unsigned  idx) const
inline

Definition at line 363 of file RE_Material.h.

UT_Vector3F RE_Material::emit ( ) const
inline

Definition at line 364 of file RE_Material.h.

void RE_Material::enableHairParameters ( bool  e)
inline

Definition at line 500 of file RE_Material.h.

static bool RE_Material::fetchRegOrUDIM ( const UT_StringRef tex_name,
const UT_StringRef node_path,
RE_TextureMap *&  map,
bool  allow_preload = false,
const char *  uvtile_marker = nullptr 
)
static
void RE_Material::finishTextureSetup ( RE_Render r,
bool  preload 
)
const RE_UniformBlockHandle& RE_Material::gameMatBlock ( ) const
inline

Definition at line 636 of file RE_Material.h.

fpreal RE_Material::getAlphaCutoff ( ) const
inline

Definition at line 390 of file RE_Material.h.

AlphaMode RE_Material::getAlphaMode ( ) const
inline

Definition at line 386 of file RE_Material.h.

int RE_Material::getAnisotropySamples ( ) const
inline

Definition at line 312 of file RE_Material.h.

RE_TextureHolder RE_Material::getBumpMap ( RE_Render r,
bool  preload = false,
bool  mat_change = true 
)
fpreal RE_Material::getCoatIntensity ( ) const
inline

Definition at line 438 of file RE_Material.h.

RE_TextureHolder RE_Material::getCoatIntensityMap ( RE_Render r,
bool  preload = false,
bool  mat_change = true 
)
fpreal RE_Material::getCoatRoughness ( ) const
inline

Definition at line 440 of file RE_Material.h.

RE_TextureHolder RE_Material::getCoatRoughnessMap ( RE_Render r,
bool  preload = false,
bool  mat_change = true 
)
int RE_Material::getCoatSpecuarModel ( ) const
inline

Definition at line 436 of file RE_Material.h.

fpreal RE_Material::getCurrentTime ( ) const
inline

Definition at line 69 of file RE_Material.h.

RE_TextureHolder RE_Material::getDiffuseMap ( RE_Render r,
int  layer,
bool  preload = false,
bool  mat_changed = true 
)
float RE_Material::getDisplaceLOD ( ) const
inline

Definition at line 482 of file RE_Material.h.

RE_TextureHolder RE_Material::getDisplaceMap ( RE_Render r,
bool  preload = false,
bool  mat_change = true 
)
RE_TextureHolder RE_Material::getEmissionMap ( RE_Render r,
bool  preload = false,
bool  mat_change = true 
)
RE_TextureHolder RE_Material::getEnvMap ( RE_Render r,
bool  preload = false 
)
static RE_TextureHolder RE_Material::getEnvMapOverride ( )
static
RE_TextureHolder RE_Material::getHairAlphaRamp ( RE_Render r,
bool  preload = false 
)
RE_TextureHolder RE_Material::getHairDiffuseMap ( RE_Render r,
bool  preload = false 
)
RE_TextureHolder RE_Material::getHairDiffuseRamp ( RE_Render r,
bool  preload = false 
)
RE_TextureHolder RE_Material::getHairSpecularMap ( RE_Render r,
bool  preload = false 
)
RE_TextureHolder RE_Material::getHairSpecularRamp ( RE_Render r,
bool  preload = false 
)
fpreal RE_Material::getIOR ( ) const
inline

Definition at line 443 of file RE_Material.h.

const UT_StringHolder& RE_Material::getLayerUVSet ( int  layer) const
const UT_StringHolder& RE_Material::getMaterialName ( ) const
inline

Definition at line 47 of file RE_Material.h.

static RE_MaterialTextureBinding RE_Material::getMaterialTextureBinding ( const UT_StringRef texname)
static
RE_MaterialType RE_Material::getMaterialType ( ) const
inline

Definition at line 114 of file RE_Material.h.

const UT_StringRef& RE_Material::getMatNetName ( ) const
inline

Definition at line 86 of file RE_Material.h.

int64 RE_Material::getMatXNodeVersion ( ) const
inline

Definition at line 89 of file RE_Material.h.

RE_TextureMap* RE_Material::getMatXTexture ( int  index) const
void RE_Material::getMaxTextureSize ( int w,
int h 
)
inline

Definition at line 298 of file RE_Material.h.

int64 RE_Material::getMemoryUsage ( bool  inclusive) const

Returns the amount of main memory (NOT graphics memory!) owned by this RE_Material.

RE_TextureHolder RE_Material::getMetallicMap ( RE_Render r,
bool  preload = false,
bool  mat_change = true 
)
int RE_Material::getNodeId ( ) const
inline

Definition at line 81 of file RE_Material.h.

const UT_StringHolder& RE_Material::getNodePath ( ) const
inline

Definition at line 80 of file RE_Material.h.

RE_TextureHolder RE_Material::getNormalMap ( RE_Render r,
bool  preload = false,
bool  mat_change = true 
)
int RE_Material::getNumDiffuseLayers ( ) const
inline

Definition at line 600 of file RE_Material.h.

RE_TextureHolder RE_Material::getOcclusionMap ( RE_Render r,
bool  preload = false,
bool  mat_change = true 
)
RE_TextureHolder RE_Material::getOpacityMap ( RE_Render r,
bool  preload = false,
bool  mat_change = true 
)
const UT_Options& RE_Material::getOverrides ( ) const
inline

Definition at line 96 of file RE_Material.h.

fpreal RE_Material::getReflection ( ) const
RE_TextureHolder RE_Material::getReflectionAmountMap ( RE_Render r,
bool  preload = false,
bool  mat_change = true 
)
RE_TextureHolder RE_Material::getRoughnessMap ( RE_Render r,
bool  preload = false,
bool  mat_change = true 
)
RE_Shader * RE_Material::getShader ( RE_ShaderTarget  sht = RE_SHADER_TARGET_TRIANGLE) const
inline

Definition at line 1022 of file RE_Material.h.

int RE_Material::getShaderRefID ( RE_ShaderTarget  ptype = RE_SHADER_TARGET_TRIANGLE) const
inline

Definition at line 1033 of file RE_Material.h.

RE_TextureHolder RE_Material::getSpecularMap ( RE_Render r,
bool  preload = false,
bool  mat_change = true 
)
int RE_Material::getSpecularModel ( ) const
inline

Definition at line 434 of file RE_Material.h.

fpreal RE_Material::getSpecularTint ( ) const
inline

Definition at line 430 of file RE_Material.h.

RE_TextureCompress RE_Material::getTextureFormat ( ) const
inline

Definition at line 294 of file RE_Material.h.

RE_TextureMap* RE_Material::getTextureMap ( RE_TexMapType  maptype,
int  index = 0 
)
int RE_Material::getTextureMemLimitMB ( ) const
inline

Definition at line 306 of file RE_Material.h.

float RE_Material::getTextureScale ( ) const
inline

Definition at line 303 of file RE_Material.h.

int RE_Material::getUniqueId ( ) const
inline

Definition at line 48 of file RE_Material.h.

fpreal RE_Material::getUVLayerRough ( int  layer) const
UT_Vector4F RE_Material::getUVLayerTint ( int  layer) const
bool RE_Material::getUVLayerUseTint ( int  layer) const
const UT_Map<UT_StringHolder, int>& RE_Material::getUVSets ( )
void RE_Material::getUVTransform ( int  layer,
UT_Vector2F t,
fpreal r,
UT_Vector2F s 
) const
UT_Vector3F RE_Material::getUVTriplanarBlend ( int  layer) const
UT_Vector3F RE_Material::getUVTriplanarOffset ( int  layer) const
fpreal RE_Material::getUVTriplanarScale ( int  layer) const
fpreal RE_Material::getUVTriplanarSharp ( int  layer) const
int64 RE_Material::getVersion ( ) const
inline

Definition at line 50 of file RE_Material.h.

const RE_UniformBlockHandle& RE_Material::hairBlock ( ) const
inline

Definition at line 634 of file RE_Material.h.

bool RE_Material::hasBumpMap ( ) const
inline

Definition at line 225 of file RE_Material.h.

bool RE_Material::hasCoatIntensityMap ( ) const
inline

Definition at line 240 of file RE_Material.h.

bool RE_Material::hasCoatRoughnessMap ( ) const
inline

Definition at line 238 of file RE_Material.h.

bool RE_Material::hasCustomShader ( RE_ShaderTarget  ptype = RE_SHADER_TARGET_TRIANGLE) const
inline

Definition at line 346 of file RE_Material.h.

bool RE_Material::hasDisplaceMap ( ) const
inline

Definition at line 228 of file RE_Material.h.

bool RE_Material::hasDisplacement ( ) const
inline

Definition at line 1012 of file RE_Material.h.

bool RE_Material::hasEmissionMap ( ) const
inline

Definition at line 230 of file RE_Material.h.

bool RE_Material::hasEnvMap ( ) const
inline

Definition at line 229 of file RE_Material.h.

bool RE_Material::hasExplicitReflection ( ) const
inline

Definition at line 454 of file RE_Material.h.

bool RE_Material::hasHairAlphaRamp ( ) const
inline

Definition at line 253 of file RE_Material.h.

bool RE_Material::hasHairDiffuseMap ( ) const
inline

Definition at line 245 of file RE_Material.h.

bool RE_Material::hasHairDiffuseRamp ( ) const
inline

Definition at line 249 of file RE_Material.h.

bool RE_Material::hasHairSpecularMap ( ) const
inline

Definition at line 247 of file RE_Material.h.

bool RE_Material::hasHairSpecularRamp ( ) const
inline

Definition at line 251 of file RE_Material.h.

bool RE_Material::hasMetallicMap ( ) const
inline

Definition at line 236 of file RE_Material.h.

bool RE_Material::hasNormalMap ( ) const
inline

Definition at line 226 of file RE_Material.h.

bool RE_Material::hasOcclusionMap ( ) const
inline

Definition at line 234 of file RE_Material.h.

bool RE_Material::hasOpacityMap ( ) const
inline

Definition at line 227 of file RE_Material.h.

bool RE_Material::hasOverrides ( ) const
inline

Definition at line 97 of file RE_Material.h.

bool RE_Material::hasReflectionAmountMap ( ) const
inline

Definition at line 242 of file RE_Material.h.

bool RE_Material::hasRoughnessMap ( ) const
inline

Definition at line 232 of file RE_Material.h.

bool RE_Material::hasShaderAlpha ( ) const
inline

Definition at line 402 of file RE_Material.h.

bool RE_Material::hasShaderProgram ( const char *  program_file) const
bool RE_Material::hasShaderSource ( const char *  vert_src,
const char *  geom_src,
const char *  frag_src,
RE_ShaderTarget  ptype = RE_SHADER_TARGET_TRIANGLE 
)

checks this materials' shader against the source, and returns true if it matches.

bool RE_Material::hasSpecularMap ( ) const
inline

Definition at line 224 of file RE_Material.h.

void RE_Material::incref ( )
inline

Definition at line 71 of file RE_Material.h.

bool RE_Material::isDefaultShader ( ) const
inline

Definition at line 117 of file RE_Material.h.

bool RE_Material::isDirty ( fpreal  time) const
inline

Definition at line 54 of file RE_Material.h.

bool RE_Material::isLit ( ) const
inline

Definition at line 319 of file RE_Material.h.

bool RE_Material::isMatCapTextured ( ) const
inline

Definition at line 281 of file RE_Material.h.

bool RE_Material::isMatNetDirty ( ) const
inline

Definition at line 91 of file RE_Material.h.

bool RE_Material::isShaderOwned ( RE_ShaderTarget  sht = RE_SHADER_TARGET_TRIANGLE) const
inline

Definition at line 325 of file RE_Material.h.

bool RE_Material::isTextured ( ) const
inline

Definition at line 263 of file RE_Material.h.

bool RE_Material::isTimeDependent ( ) const
inline

Definition at line 68 of file RE_Material.h.

bool RE_Material::isTransparent ( bool  check_diffuse_alpha) const
bool RE_Material::isUVTriplanar ( int  layer) const
void RE_Material::limitTextureSize ( bool  limit,
int  w,
int  h 
)
bool RE_Material::limitTextureSize ( ) const
inline

Definition at line 297 of file RE_Material.h.

bool RE_Material::loadTextureMaps ( RE_Render r,
bool  preload_only = false 
)
void RE_Material::makeTexturesResident ( RE_Render r)
void RE_Material::markDefaultShader ( bool  def)
inline

Definition at line 116 of file RE_Material.h.

const RE_UniformBlockHandle& RE_Material::materialBlock ( ) const
inline

Definition at line 632 of file RE_Material.h.

float RE_Material::metallic ( ) const
inline

Definition at line 366 of file RE_Material.h.

UT_Vector3F RE_Material::metallicEdgeTint ( ) const
inline

Definition at line 365 of file RE_Material.h.

void RE_Material::mipMapTextures ( bool  yes)
bool RE_Material::mipMapTextures ( ) const
inline

Definition at line 309 of file RE_Material.h.

bool RE_Material::needsTangentSpace ( ) const
inline

Definition at line 457 of file RE_Material.h.

bool RE_Material::needsTextureUpdate ( ) const
inline

Definition at line 271 of file RE_Material.h.

bool RE_Material::needsUVs ( ) const
inline

Definition at line 267 of file RE_Material.h.

void RE_Material::needTextureUpdate ( )
inline

Definition at line 270 of file RE_Material.h.

void RE_Material::preloadMapsOnly ( bool  preload)
inline

Definition at line 577 of file RE_Material.h.

float RE_Material::reflection ( ) const
inline

Definition at line 369 of file RE_Material.h.

void RE_Material::removeShader ( )
void RE_Material::removeTextureMap ( RE_TexMapType  maptype,
int  index = 0 
)
void RE_Material::removeTexturesFromResident ( RE_Render r)
void RE_Material::reserveDiffuseLayers ( int  nlayers)
void RE_Material::restoreShader ( RE_Render r,
RE_ShaderTarget  sht = RE_SHADER_TARGET_TRIANGLE 
)
float RE_Material::roughness ( ) const
inline

Definition at line 368 of file RE_Material.h.

void RE_Material::setAlpha ( float  alpha_perp,
float  alpha_para = -1.0 
)

Sets the perpendicular and parallel alpha factors. If the parallel alpha is less than zero, they are assumed to be the same.

void RE_Material::setAlphaCutoff ( fpreal  alpha_val)
void RE_Material::setAlphaMode ( AlphaMode  mode)
void RE_Material::setAmb ( float  r,
float  g,
float  b 
)
void RE_Material::setAmbient ( UT_Color  col)
void RE_Material::setAmbient ( const UT_Vector3F col)
inline

Definition at line 974 of file RE_Material.h.

void RE_Material::setAnisotropySamples ( int  samp)
void RE_Material::setCoatIntensity ( fpreal  i)
void RE_Material::setCoatIntensityParms ( int  component)
void RE_Material::setCoatRoughness ( fpreal  r)
void RE_Material::setCoatRoughnessParms ( int  component)
void RE_Material::setCoatSpecularModel ( int  spec_model)
void RE_Material::setDiff ( float  r,
float  g,
float  b 
)
void RE_Material::setDiffuse ( UT_Color  col)
void RE_Material::setDiffuse ( const UT_Vector3F col)
inline

Definition at line 979 of file RE_Material.h.

void RE_Material::setDiffuseRoughness ( fpreal  r)
void RE_Material::setDisplaceLOD ( float  lod)
inline

Definition at line 481 of file RE_Material.h.

void RE_Material::setDisplaceParms ( float  scale,
float  offset,
float  quality,
re_Displace  vector_space,
bool  y_up 
)
void RE_Material::setEmission ( UT_Color  col)
void RE_Material::setEmission ( const UT_Vector3F col)
inline

Definition at line 989 of file RE_Material.h.

void RE_Material::setEmissionParms ( bool  use_matcap)
void RE_Material::setEmit ( float  r,
float  g,
float  b 
)
static void RE_Material::setEnvMapOverride ( RE_TextureHolder  env_map,
const UT_Matrix3F rot,
const UT_Vector3F col 
)
static
void RE_Material::setEnvParms ( float  scale,
const UT_Vector3 rot,
const UT_XformOrder rord 
)
void RE_Material::setHairAlpha ( float  alpha,
bool  use_alpha_ramp 
)
void RE_Material::setHairDiffuse ( float  intensity,
UT_Vector3F  root_col,
UT_Vector3F  tip_col,
bool  use_map,
bool  use_ramp 
)
void RE_Material::setHairRandomize ( bool  random_hue,
UT_Vector2F  hue_range,
bool  random_sat,
UT_Vector2F  sat_range,
bool  random_int,
UT_Vector2F  int_range,
bool  random_spec_int,
UT_Vector2F  spec_int_range 
)
void RE_Material::setHairSpecular ( float  intensity,
float  angle,
float  shift,
UT_Vector3F  root_col,
UT_Vector3F  tip_col,
bool  use_map,
bool  use_ramp 
)
void RE_Material::setIOR ( float  ior)
void RE_Material::setMaterialType ( RE_MaterialType  type)
void RE_Material::setMatNetName ( const UT_StringRef mat_path)
inline

Definition at line 84 of file RE_Material.h.

void RE_Material::setMatXNodeVersion ( int64  version)
inline

Definition at line 88 of file RE_Material.h.

void RE_Material::setMatXTexture ( RE_TextureMap map,
int  index 
)
void RE_Material::setMetallic ( float  metal)
void RE_Material::setMetallicEdge ( const UT_Vector3F metal)
void RE_Material::setMetallicParms ( int  component)
void RE_Material::setNeedsTangentSpace ( bool  b)
inline

Definition at line 456 of file RE_Material.h.

void RE_Material::setNeedsUVs ( bool  uvs)
inline

Definition at line 268 of file RE_Material.h.

void RE_Material::setNodePath ( UT_StringHolder  path,
int  node_id 
)
void RE_Material::setNormalParms ( re_NormalMapType  type,
bool  bias,
UT_Vector2F  scale,
bool  flip_x,
bool  flip_y,
bool  flip_z 
)
void RE_Material::setNumMatXTextures ( int  num)
void RE_Material::setOcclusionParms ( int  component)
void RE_Material::setOpacityMapParms ( bool  invert,
int  component 
)
void RE_Material::setOverrides ( const UT_Options overrides)
void RE_Material::setReflection ( float  r,
bool  explicit_r 
)
void RE_Material::setReflectionAmountParms ( int  component,
bool  affect_ior 
)
void RE_Material::setReflectionMap ( RE_Texture map)
inline

Definition at line 563 of file RE_Material.h.

void RE_Material::setRoughness ( float  r)
void RE_Material::setRoughParms ( bool  invert_map,
int  component 
)
void RE_Material::setShaderAlpha ( bool  enabled)
inline

If true, the shader generates its own alpha independent of the material parameters. This indicates that the material requires a transparency pass, since the renderer can otherwise not determine this from the shader code.

Definition at line 400 of file RE_Material.h.

void RE_Material::setShaderProgram ( const char *  program_file)
void RE_Material::setShaderSource ( const char *  vert_src,
const char *  geom_src,
const char *  frag_src,
RE_ShaderTarget  ptype = RE_SHADER_TARGET_TRIANGLE 
)

caches the source for the shader in the material.

void RE_Material::setShininess ( float  sh)
void RE_Material::setSpec ( float  r,
float  g,
float  b 
)
void RE_Material::setSpecular ( UT_Color  col)
void RE_Material::setSpecular ( const UT_Vector3F col)
inline

Definition at line 984 of file RE_Material.h.

void RE_Material::setSpecularModel ( int  spec_model)
void RE_Material::setSpecularTint ( fpreal  t)
void RE_Material::setTextured ( bool  has_tex)
inline

Definition at line 264 of file RE_Material.h.

void RE_Material::setTextureFormat ( RE_TextureCompress  format)
void RE_Material::setTextureMap ( RE_TextureMap map,
bool  give_ownership,
RE_TexMapType  maptype,
const UT_StringRef uv_set,
int  index = 0 
)
void RE_Material::setTextureMemLimitMB ( int  mem)
void RE_Material::setTextureScale ( float  sc)
void RE_Material::setTimeDependent ( bool  timedep,
fpreal  t = 0.0 
)
inline

Definition at line 63 of file RE_Material.h.

void RE_Material::setTransparent ( bool  alpha)
inline

Definition at line 260 of file RE_Material.h.

void RE_Material::setUVLayerTint ( int  layer,
bool  use_tint,
UT_Vector4F  tint,
fpreal  rough 
)
void RE_Material::setUVTransform ( RE_TexMapType  maptype,
const UT_Matrix3F xform,
int  layer = 0 
)
void RE_Material::setUVTransform ( int  layer,
UT_Vector2F  t,
fpreal  r,
UT_Vector2F  s 
)
void RE_Material::setUVTriplanar ( int  layer,
fpreal  scale = 1.0,
fpreal  sharp = 1.0,
UT_Vector3F  blend = UT_Vector3F(1.0f),
UT_Vector3F  offset = UT_Vector3F(0.0f) 
)
void RE_Material::setVersion ( int64  v)
inline

Definition at line 51 of file RE_Material.h.

void RE_Material::setVertexOverrides ( const UT_StringMap< UT_StringHolder > &  ovr)
inline

Definition at line 100 of file RE_Material.h.

float RE_Material::spec ( unsigned  idx) const
inline

Definition at line 361 of file RE_Material.h.

UT_Vector3F RE_Material::spec ( void  ) const
inline

Definition at line 362 of file RE_Material.h.

void RE_Material::updateMaterialBlock ( int  layer)
bool RE_Material::updateShaderForMaterial ( RE_Render r,
int  layer,
bool  textured,
RE_ShaderTarget  sht = RE_SHADER_TARGET_TRIANGLE,
RE_Shader shader = nullptr,
bool  allow_partial = false 
)
void RE_Material::useGeometryColor ( bool  enable)
bool RE_Material::useGeometryColor ( ) const
inline

Definition at line 451 of file RE_Material.h.

void RE_Material::usePackedColor ( bool  enable)
bool RE_Material::usePackedColor ( ) const
inline

Definition at line 450 of file RE_Material.h.

const UT_StringMap<UT_StringHolder>& RE_Material::vertexOverrides ( ) const
inline

Definition at line 102 of file RE_Material.h.

void RE_Material::writeMaterialParmsToBlockGL4 ( RE_Render r,
RE_UniformBlock block,
int  material_idx,
int  layer,
bool  lit,
bool  textured 
)

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