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 }
 
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 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 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)
 
void clearTexture (RE_Render *r)
 
void clearDiffuseMap ()
 
void reserveDiffuseLayers (int nlayers)
 
RE_TextureHolder getTexture (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
 
bool isTextured () const
 
const UT_Map< UT_StringHolder,
int > & 
getUVSets ()
 
const UT_StringHoldergetLayerUVSet (int layer) const
 
void setCallback (RE_TextureCallback *cb)
 
RE_TextureCallbackgetCallback ()
 
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=0, 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 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 setOpacityMapParms (bool invert)
 
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, 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 setUVTransform (RE_TextureCallback::RE_TexMapType maptype, const UT_Matrix3F &xform, int layer=0)
 
void clearUVTransform (RE_TextureCallback::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)
 
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
 
void setReflectionMap (RE_Texture *map)
 
void clearReflectionMap ()
 
RE_MaterialPtr cloneWithoutTexture () const
 
void loadTextureMaps (RE_Render *r, bool preload_only=false)
 
void preloadMapsOnly (bool preload)
 
void assignTextureMap (RE_Texture *tex, RE_TextureCallback::RE_TexMapType maptype, int index=0)
 
void removeTextureMap (RE_TextureCallback::RE_TexMapType maptype, int index=0)
 
int getNumDiffuseLayers () const
 
bool updateShaderForMaterial (RE_Render *r, int layer, bool lit, bool textured, RE_ShaderTarget sht=RE_SHADER_TARGET_TRIANGLE, RE_Shader *shader=NULL, 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 ()
 
const RE_UniformBlockHandlematerialBlock () const
 
const RE_UniformBlockHandlehairBlock () const
 
const RE_UniformBlockHandlegameMatBlock () const
 

Static Public Member Functions

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 97 of file RE_Material.h.

Member Enumeration Documentation

anonymous enum
Enumerator
PHONG 
BLINN 
GGX 
SPEC_ANGLE 

Definition at line 392 of file RE_Material.h.

Enumerator
DISPLACE_NORMAL 
DISPLACE_VECTOR_TANGENT 
DISPLACE_VECTOR_WORLD 
DISPLACE_VECTOR_OBJECT 

Definition at line 426 of file RE_Material.h.

Enumerator
FILM_SURFACE 
GAMES_SURFACE 
HAIR 
TERRAIN_SURFACE 

Definition at line 150 of file RE_Material.h.

Enumerator
NMLMAP_TANGENT 
NMLMAP_WORLD 
NMLMAP_OBJECT 

Definition at line 417 of file RE_Material.h.

Constructor & Destructor Documentation

RE_Material::RE_Material ( const char *  materialName)
explicit

Member Function Documentation

void RE_Material::allowShaders ( bool  yes)
inline

Definition at line 291 of file RE_Material.h.

bool RE_Material::allowShaders ( ) const
inline

Definition at line 292 of file RE_Material.h.

float RE_Material::alpha ( ) const
inline

Definition at line 345 of file RE_Material.h.

float RE_Material::amb ( unsigned  idx) const
inline

Definition at line 335 of file RE_Material.h.

UT_Vector3F RE_Material::amb ( ) const
inline

Definition at line 336 of file RE_Material.h.

bool RE_Material::areTexturesPending ( )
inline

Definition at line 216 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::assignTextureMap ( RE_Texture tex,
RE_TextureCallback::RE_TexMapType  maptype,
int  index = 0 
)
void RE_Material::clearDiffuseMap ( )
static void RE_Material::clearEnvMapOverride ( )
static
void RE_Material::clearReflectionMap ( )
inline

Definition at line 511 of file RE_Material.h.

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

Definition at line 349 of file RE_Material.h.

float RE_Material::coatRoughness ( ) const
inline

Definition at line 348 of file RE_Material.h.

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

Definition at line 330 of file RE_Material.h.

void RE_Material::decref ( )
inline

Definition at line 128 of file RE_Material.h.

DEP_MicroNode& RE_Material::dependencies ( )
inline

Definition at line 565 of file RE_Material.h.

float RE_Material::diff ( unsigned  idx) const
inline

Definition at line 337 of file RE_Material.h.

UT_Vector3F RE_Material::diff ( ) const
inline

Definition at line 338 of file RE_Material.h.

float RE_Material::diffuseRoughness ( ) const
inline

Definition at line 350 of file RE_Material.h.

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

Definition at line 109 of file RE_Material.h.

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

Definition at line 341 of file RE_Material.h.

UT_Vector3F RE_Material::emit ( ) const
inline

Definition at line 342 of file RE_Material.h.

void RE_Material::enableHairParameters ( bool  e)
inline

Definition at line 449 of file RE_Material.h.

const RE_UniformBlockHandle& RE_Material::gameMatBlock ( ) const
inline

Definition at line 571 of file RE_Material.h.

int RE_Material::getAnisotropySamples ( ) const
inline

Definition at line 289 of file RE_Material.h.

RE_TextureHolder RE_Material::getBumpMap ( RE_Render r,
bool  preload = false,
bool  mat_change = true 
)
RE_TextureCallback* RE_Material::getCallback ( )
inline

Definition at line 268 of file RE_Material.h.

fpreal RE_Material::getCoatIntensity ( ) const
inline

Definition at line 398 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 400 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 396 of file RE_Material.h.

fpreal RE_Material::getCurrentTime ( ) const
inline

Definition at line 125 of file RE_Material.h.

float RE_Material::getDisplaceLOD ( ) const
inline

Definition at line 434 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 403 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 103 of file RE_Material.h.

RE_MaterialType RE_Material::getMaterialType ( ) const
inline

Definition at line 158 of file RE_Material.h.

void RE_Material::getMaxTextureSize ( int w,
int h 
)
inline

Definition at line 275 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 137 of file RE_Material.h.

const UT_StringHolder& RE_Material::getNodePath ( ) const
inline

Definition at line 136 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 536 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 141 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 301 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 394 of file RE_Material.h.

fpreal RE_Material::getSpecularTint ( ) const
inline

Definition at line 390 of file RE_Material.h.

RE_TextureHolder RE_Material::getTexture ( RE_Render r,
int  layer,
bool  preload = false,
bool  mat_changed = true 
)
RE_TextureCompress RE_Material::getTextureFormat ( ) const
inline

Definition at line 271 of file RE_Material.h.

int RE_Material::getTextureMemLimitMB ( ) const
inline

Definition at line 283 of file RE_Material.h.

float RE_Material::getTextureScale ( ) const
inline

Definition at line 280 of file RE_Material.h.

int RE_Material::getUniqueId ( ) const
inline

Definition at line 104 of file RE_Material.h.

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 106 of file RE_Material.h.

const RE_UniformBlockHandle& RE_Material::hairBlock ( ) const
inline

Definition at line 569 of file RE_Material.h.

bool RE_Material::hasBumpMap ( ) const
inline

Definition at line 223 of file RE_Material.h.

bool RE_Material::hasCoatIntensityMap ( ) const
inline

Definition at line 238 of file RE_Material.h.

bool RE_Material::hasCoatRoughnessMap ( ) const
inline

Definition at line 236 of file RE_Material.h.

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

Definition at line 324 of file RE_Material.h.

bool RE_Material::hasDisplaceMap ( ) const
inline

Definition at line 226 of file RE_Material.h.

bool RE_Material::hasEmissionMap ( ) const
inline

Definition at line 228 of file RE_Material.h.

bool RE_Material::hasEnvMap ( ) const
inline

Definition at line 227 of file RE_Material.h.

bool RE_Material::hasExplicitReflection ( ) const
inline

Definition at line 414 of file RE_Material.h.

bool RE_Material::hasHairAlphaRamp ( ) const
inline

Definition at line 247 of file RE_Material.h.

bool RE_Material::hasHairDiffuseMap ( ) const
inline

Definition at line 243 of file RE_Material.h.

bool RE_Material::hasHairDiffuseRamp ( ) const
inline

Definition at line 245 of file RE_Material.h.

bool RE_Material::hasHairSpecularMap ( ) const
inline

Definition at line 244 of file RE_Material.h.

bool RE_Material::hasHairSpecularRamp ( ) const
inline

Definition at line 246 of file RE_Material.h.

bool RE_Material::hasMetallicMap ( ) const
inline

Definition at line 234 of file RE_Material.h.

bool RE_Material::hasNormalMap ( ) const
inline

Definition at line 224 of file RE_Material.h.

bool RE_Material::hasOcclusionMap ( ) const
inline

Definition at line 232 of file RE_Material.h.

bool RE_Material::hasOpacityMap ( ) const
inline

Definition at line 225 of file RE_Material.h.

bool RE_Material::hasOverrides ( ) const
inline

Definition at line 142 of file RE_Material.h.

bool RE_Material::hasReflectionAmountMap ( ) const
inline

Definition at line 240 of file RE_Material.h.

bool RE_Material::hasRoughnessMap ( ) const
inline

Definition at line 230 of file RE_Material.h.

bool RE_Material::hasShaderAlpha ( ) const
inline

Definition at line 362 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 222 of file RE_Material.h.

void RE_Material::incref ( )
inline

Definition at line 127 of file RE_Material.h.

bool RE_Material::isDefaultShader ( ) const
inline

Definition at line 161 of file RE_Material.h.

bool RE_Material::isDirty ( fpreal  time) const
inline

Definition at line 110 of file RE_Material.h.

bool RE_Material::isLit ( ) const
inline

Definition at line 296 of file RE_Material.h.

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

Definition at line 303 of file RE_Material.h.

bool RE_Material::isTextured ( ) const
inline

Definition at line 254 of file RE_Material.h.

bool RE_Material::isTimeDependent ( ) const
inline

Definition at line 124 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 274 of file RE_Material.h.

void 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 160 of file RE_Material.h.

const RE_UniformBlockHandle& RE_Material::materialBlock ( ) const
inline

Definition at line 567 of file RE_Material.h.

float RE_Material::metallic ( ) const
inline

Definition at line 344 of file RE_Material.h.

UT_Vector3F RE_Material::metallicEdgeTint ( ) const
inline

Definition at line 343 of file RE_Material.h.

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

Definition at line 286 of file RE_Material.h.

void RE_Material::preloadMapsOnly ( bool  preload)
inline

Definition at line 524 of file RE_Material.h.

float RE_Material::reflection ( ) const
inline

Definition at line 347 of file RE_Material.h.

void RE_Material::removeShader ( )
void RE_Material::removeTextureMap ( RE_TextureCallback::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 346 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::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 893 of file RE_Material.h.

void RE_Material::setAnisotropySamples ( int  samp)
void RE_Material::setCallback ( RE_TextureCallback cb)
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 898 of file RE_Material.h.

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

Definition at line 433 of file RE_Material.h.

void RE_Material::setDisplaceParms ( float  scale,
float  offset,
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 908 of file RE_Material.h.

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::setMetallic ( float  metal)
void RE_Material::setMetallicEdge ( const UT_Vector3F metal)
void RE_Material::setMetallicParms ( int  component)
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::setOcclusionParms ( int  component)
void RE_Material::setOpacityMapParms ( bool  invert)
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 510 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 360 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 903 of file RE_Material.h.

void RE_Material::setSpecularModel ( int  spec_model)
void RE_Material::setSpecularTint ( fpreal  t)
void RE_Material::setTextureFormat ( RE_TextureCompress  format)
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 119 of file RE_Material.h.

void RE_Material::setUVLayerTint ( int  layer,
bool  use_tint,
UT_Vector4F  tint 
)
void RE_Material::setUVTransform ( RE_TextureCallback::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 107 of file RE_Material.h.

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

Definition at line 145 of file RE_Material.h.

float RE_Material::spec ( unsigned  idx) const
inline

Definition at line 339 of file RE_Material.h.

UT_Vector3F RE_Material::spec ( void  ) const
inline

Definition at line 340 of file RE_Material.h.

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

Definition at line 411 of file RE_Material.h.

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

Definition at line 410 of file RE_Material.h.

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

Definition at line 147 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: