76 void setTimeDependent(
bool timedep,
fpreal t = 0.0);
77 void setOPTimeDependent(
bool timedep,
fpreal t = 0.0);
86 exint cache_version = 0;
90 if(myTexCacheVersion != cache_version)
93 if(myDirtyFlag || myDepNode.isDirty())
104 myDepNode.update(myTime);
140 return bindSets(r, shader, for_curve);
146 bool created =
false;
147 return (initMaterialSetForRender(r, shader, created) &&
148 initBlocks(r, opts) &&
149 bindSets(r, shader, for_curve));
154 virtual bool initMaterialSetForRender(
RV_Render *
r,
170 void setOverrides(
const UT_Options *overrides);
173 void setFallbacks(
const UT_Options *attrib_fallbacks);
185 { myExtraInputs = extra_inputs; }
188 static exint getUniqueMaterialID();
196 void clearOpIDs() { myOpNodes.clear(); myOpDepsDirty =
true; }
197 void addOpID(
int id);
199 bool timeChangeCheck()
const;
221 exint myTexCacheVersion = 0;
222 unsigned myTimeDep : 1,
227 myHasDisplacement : 1,
230 myTexturesLoaded : 1,
247 {
return myDefault; }
251 {
return myFactory; }
259 if(myAltAtlas && material_id < 0)
260 return myAltAtlas->get(-material_id);
262 return myDefault ? myDefault : myFactory;
265 return entry->second;
273 if(myAltAtlas && material_id < 0)
274 return myAltAtlas->get(-material_id);
276 if(material_id == 0 && dp.vk_default_mat_id != 0)
277 material_id = dp.vk_default_mat_id;
280 return myDefault ? myDefault : myFactory;
284 return entry->second;
290 { (*this)[ material->id() ] = material; }
295 { myDefault = material;
if(add_list && material)
add(material); }
300 { myFactory = material;
if(add_list && material)
add(material); }
305 { myAltAtlas = atlas; }
312 return (entry !=
end());
336 bool hasParm(
exint ptype)
const;
338 int getParmI(
exint ptype,
int defval = 0)
const;
358 static void initCache();
359 static void destroyCache();
371 static void cacheShader(
exint entry,
383 exint myCurrentID = 1;
void setFactoryMaterial(const GR_MaterialPtr &material, bool add_list=true)
void dirty(bool dirty=true)
virtual RV_ShaderProgram * getSurfaceShader() const
virtual void dirtyTextures()
const GR_MaterialPtr & getFactoryMaterial() const
Base class for various things that can appear in a scene outside of geometry.
bool isTimeDependent() const
bool opDependenciesDirty() const
GT_API const UT_StringHolder time
const UT_Options * getOverrides() const
bool isOPTimeDependent() const
UT_NON_COPYABLE(GR_SceneItem)
std::unique_ptr< T, Deleter > UT_UniquePtr
A smart pointer for unique ownership of dynamically allocated objects.
bool texturesLoaded() const
const GR_MaterialAtlas * alternateMaterials() const
fpreal getCurrentTime() const
void setTransparent(bool has_tex)
bool isTransparent() const
bool needsTangents() const
const UT_StringMap< InputType > & extraInputs() const
const UT_Options * getFallbacks() const
static const UT_Matrix4T< float > & getIdentityMatrix()
MaterialType type() const
void setHasDisplacement(bool has_disp)
#define UT_NON_COPYABLE(CLASS)
Define deleted copy constructor and assignment operator inside a class.
const UT_Set< int > opDependencies() const
void add(const GR_MaterialPtr &material)
void setNeedsTangents(bool tan)
static exint cacheRefresh()
bool isDirty(fpreal time)
GLuint const GLchar * name
void clearOpDependenciesDirty()
bool bindWithoutUpdate(RV_Render *r, RV_ShaderProgram *shader, const GR_DisplayOption *opts, bool for_curve=false)
SYS_API double tan(double x)
A map of string to various well defined value types.
DEP_MicroNode & dependencies()
void setTextured(bool has_tex)
bool bind(RV_Render *r, RV_ShaderProgram *shader, const GR_DisplayOption *opts, bool for_curve=false)
void setNeedsUVs(bool uvs)
void setHasUDIM(bool has_udim)
void setTexturesLoaded(bool loaded)
virtual RV_ShaderProgram * getCurveShader() const
void setDefaultMaterial(const GR_MaterialPtr &material, bool add_list=true)
bool hasMaterial(int material_id) const
bool hasDisplacement() const
GR_MaterialAtlas * alternateMaterials()
ImageBuf OIIO_API add(Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)
This is a fast, non-string access and cut-down version of UT_Options.
void setAlternateMaterials(GR_MaterialAtlas *atlas)
bool SYSisEqual(const UT_Vector2T< T > &a, const UT_Vector2T< T > &b, S tol=SYS_FTOLERANCE)
Componentwise equality.
const GR_MaterialPtr & getDefaultMaterial() const
Reader/Writer mutex class.
Base::const_iterator const_iterator
FMT_CONSTEXPR auto find(Ptr first, Ptr last, T value, Ptr &out) -> bool
void setExtraInputs(const UT_StringMap< InputType > &extra_inputs)