11 #ifndef GUI_GeoRender_h
12 #define GUI_GeoRender_h
74 class gui_CollectionPrim;
77 class GT_PrimCharacterScene;
80 class gui_HookedPrims;
83 class gui_RenderHookEntry;
84 class gui_UpdateResults;
85 class GUI_ObjectMaterialCache;
99 virtual const char *
className()
const {
return "GUI_GeoRender"; }
103 void setGeometry(
OP_Node *node);
107 void setGeoName(
const char *name);
109 void setInstanceName(
const char *name);
141 {
return myDetailTransforms.entries(); }
143 { myDetailFullTransform = xform; }
145 {
return myDetailFullTransform; }
150 { myInstancerTransform = xform;
151 myInstancerIdentityFlag = xform.
isIdentity(); }
153 { myInstancerTransform.identity();
154 myInstancerIdentityFlag =
true; }
156 {
return myInstancerTransform; }
167 int use_vertex)
const;
176 static void setWorldToScreen(
const UT_Matrix4R &xform);
179 void setIsInstancedGeo(
bool instanced);
180 bool addInstanceTransform(
const UT_DMatrix4 &xform,
182 void clearInstanceTransforms();
184 int64 getInstanceVersion()
const;
187 void gpuMemoryUsage(
exint &used_bytes,
189 exint &pinned_bytes);
209 const char *view_name,
220 const char *view_name,
223 virtual bool hasParallelUpdate()
const;
234 {
return myMaterialTexturePending; }
236 void addMaterialReference(
OP_Node *mat_node);
237 void removeMaterialReference(
OP_Node *mat_node);
238 void clearMaterialReferences();
248 bool isLit()
const {
return myLitFlag; }
273 { myNeedsDeferredPass = need;}
287 {
return myMaterialHasReflection; }
290 { myInfo.myObjectGhosted = ghost; }
292 { myInfo.myObjectSelection = obj_selection; }
294 { myInfo.myCanRenderUV = uv_render; }
297 return myInfo.myCanRenderUV;
300 bool getComponentSelection(
327 fpreal ghost_amount = 0.5);
355 {
return myPrimDecorMask; }
361 virtual void decorationRender(
366 bool override_dispopt,
387 bool canBeSelectedWhenNotUsingOps(
391 bool pick_ghost)
const;
403 unsigned int primmask,
410 const char *
name()
const {
return myCacheName; }
415 void cleanupLighting();
417 static void resetStats();
418 static void getStats(
int &num_objs,
424 void useObjectMaterials(
bool use_obj_mat);
440 return isBBoxShadingMode(getDisplayOptionSet(opt));
458 {
return myVisUpdateTime; }
461 {
return myVisRefineTime; }
468 { myVisRefineTime = myVisUpdateTime =
472 {
return myUpdateVisualizers.find(vis_id) >= 0; }
475 {
return myRefineVisualizers.find(vis_id) >= 0; }
481 {
return myUpdateVisualizers; }
484 {
return myRefineVisualizers; }
487 { myUpdateVisualizers = getActiveVisualizers(); }
490 { myUpdateVisualizers.clear(); }
493 { myRefineVisualizers = getActiveVisualizers(); }
496 { myRefineVisualizers.clear(); }
498 void runCreatorVisualizers(
int &listcount,
516 bool use_hidden_grp);
524 static void handleMaterialChange(
OP_Node *
src,
void *dest,
531 {
return myMaterialUseOverrides; }
534 { myMaterialLimitExceeded = e; }
536 { myHasTimeDepMaterials = d; }
538 {
return myHasTimeDepMaterials; }
541 void invalidateGeo();
546 { myDataIds.clear(); }
556 {
return (myMatOpChanges.size()!=0); }
569 myLocalBBox.makeInvalid();
570 myWorldBBox.makeInvalid();
571 myLook->invalidateBBox();
578 virtual bool shouldRender(
const GU_Detail *geo)
const;
581 {
return myPrimitives.entries(); }
618 bool outline=
true) {};
629 bool &has_edges)
const;
631 bool &has_edges)
const;
649 bool &needs_alpha_pass);
678 const char *view_name,
689 const char *view_name,
707 bool apply_filter_vis,
719 void clearUnusedAlembicArchives();
743 bool processing_geo_prims,
744 bool apply_filter_vis,
756 bool processing_geo_prims,
760 void resetPrimClassify();
768 const char *view_name);
770 bool buildInstanceSelection(
bool has_sel_overrides);
780 bool include_selection);
783 { mySelectionId =
id; mySelectionRevision =
version; }
795 gui_RenderHookEntry *&prev,
797 bool processing_geo_prims,
803 void restartCollectionPrimitives();
804 void removeUnusedCollectionPrimitives();
806 void find3DBoundaries(
const GU_Detail *geo,
809 void findUVBoundaries(
const GU_Detail *geo,
832 bool view_3d,
bool vert_uv);
851 void resizePrimArray(
exint nprims,
bool clear =
false);
855 void updateWorldTransform();
901 bool shouldUVRender(
const GU_Detail *geo,
903 bool is_vertex)
const;
922 bool checkAutoVertexNormal(
const GU_Detail *dtl,
925 bool inPackedPrim()
const
926 {
return myPackedPrimLevel > 0; }
927 bool inInstancePrim()
const
928 {
return myInstancePrim.entries() > 0; }
929 void updateInstanceEntry(gr_PrimEntry *entry,
943 bool use_fraction_parm);
951 bool set_shader =
false,
952 bool is_matte =
false,
960 void clearMaterialInterests();
969 bool myObjectMaterialDirty;
975 bool myUseObjectMaterial;
983 bool myHasGLStateCheckPrims;
985 bool myShadeOpenCurvesFlag;
986 bool myShadeOpenCurvesFlagSet;
987 bool myHasGuideParts;
988 bool myHasPackedPrims;
989 bool myHasPackedFragments;
990 bool myHasPackedInstances;
991 bool myWireframeFlag;
992 bool myForceShadedFlag;
994 bool myRecordingTime;
996 bool myIsSubD =
false;
998 bool myHasAgentPrims;
999 bool myAgentLastLODEnable;
1000 int myAgentLastMinPoints;
1001 int myAgentLastMaxLOD;
1012 int myDrawTimeWaiting;
1018 int64 myTopologyVersion;
1019 int myCachedShowSelect;
1020 int64 myPrimitiveVersion;
1022 exint mySelectionId;
1023 exint mySelectionRevision;
1025 bool myNeedsDeferredPass;
1026 bool myNeedsParallelPass;
1038 bool operator==(
const DataIdsCache &rhs)
const
1040 return myDataIdsCount==rhs.myDataIdsCount &&
1041 myDataIdsSum==rhs.myDataIdsSum;
1053 myDataIdsSum += (
exint)
id;
1056 void getDataIdsExcept_p_transform(
const GA_Detail *gdp);
1059 exint myDataIdsCount;
1062 DataIdsCache myDataIds;
1063 DataIdsCache myDataIdsCache;
1069 int myDispOptSerial;
1071 bool myPolygonConvexQuality;
1072 bool myVertexNormalEnable;
1073 fpreal myVertexNormalCuspAngle;
1075 bool myShowAllPoints;
1081 bool myObjectDisplayAsSubdiv;
1087 bool myDetailTransformIdentity;
1090 bool myInstancerIdentityFlag;
1094 int64 myCachedInstanceVersion;
1095 int myRefineVersion;
1096 bool myObjectTransformDirty;
1097 bool myNeedsAlphaPassFlag;
1098 bool myPrimAlphaPassFlag;
1100 bool myRefineOnLODChange;
1101 int mySelectionInstance;
1102 fpreal myLimitedInstanceFraction;
1103 bool myShowMaterials;
1104 int myFactoryMaterialOverrideId = -1;
1108 bool myHasInstanceSelection;
1115 gui_Instance() { myBBox.makeInvalid(); }
1129 gui_DiskFile() : myPrimIndex(0) {}
1135 int myPackedPrimLevel;
1137 mutable bool myCachedUseSampleMask;
1138 mutable int myCachedSampleMask;
1139 mutable bool myCachedMultisample;
1140 mutable bool myCachedSampleCoverage;
1145 fpreal myCubeInstanceFraction;
1150 exint myVisUpdateTime;
1151 exint myVisRefineTime;
1157 bool myRefineOnUpdate;
1158 unsigned myMaterialTextureFlag :1,
1159 myMaterialTexturePending :1,
1160 myMaterialHasDisplaceMap :1,
1161 myMaterialHasReflection :1,
1162 myMaterialUseOverrides :1,
1163 myMaterialTexCacheUpdate : 1,
1164 myHasTimeDepMaterials :1,
1165 myHasOpDepMaterials :1,
1172 int myMaterialLimit;
1173 bool myMaterialLimitExceeded;
1174 int myObjMaterialID;
1180 int64 myBaseMaterialPrevID;
1181 int64 myBaseMaterialRemapPrevID;
1182 bool myForceMaterialUpdate;
1183 bool myMaterialAllowUpdates;
1188 class gui_DetailAttribLists
1191 bool checkForAttribListChanges(
const GU_Detail &dtl);
1201 gui_DetailAttribLists myDetailAttribLists;
1208 } myHedgeInterface[2];
1211 int myPrimClassifierDetailId;
1212 int64 myPrimClassifierCacheVersion;
1213 int64 myPrimClassifierTopVersion;
1214 int64 myPrimClassifierSelectId;
1215 int64 myPrimClassifierSelectRevision;
1220 int myCachedGroupDetailId;
1221 int64 myCachedGroupCacheVersion;
1222 int64 myCachedGroupTopVersion;
1224 int64 myCachedHidden3DVersion;
1226 fpreal myDisplacementValue = -1.0;
1227 bool myDisplacementChanged =
false;
1247 friend class gr_PrimEntry;
1265 return myDetailTransforms(index);
1271 return myDetailInvTransforms(index);
A collection of Vulkan UBO, SSBO, and Image shader bindings (descriptor set)
void setPostPassID(int id)
GR_MaterialAtlas myVulkanMaterials
UT_Map< UT_StringRef, int > myPrevAttributes
void setDetailFullTransform(const UT_DMatrix4 &xform)
int getNumPrimitives() const
gui_BoundaryData my3DBoundary
void clearUpdateVisualizers()
GR_MaterialAtlas * materials()
UT_StringMap< gui_BoundaryData > myUVBoundary
virtual void simpleBBoxRender(RE_RenderContext r, GUI_DisplayOption &opt, RE_Shader *shader=0, bool fill=true, bool outline=true)
void refreshVisRefineTime()
gui_BoundaryData myEdgeSelection
GA_API const UT_StringHolder uv
GT_API const UT_StringHolder time
void shadingMode(GR_ShadingMode shading_mode)
void setNameIndex(int idx)
GA_API const UT_StringHolder rot
int getObjectMaterialID() const
A collection of vertex arrays defining a geometry object. This class acts as a wrapper around multipl...
fpreal getSetupTime() const
GT_API const UT_StringHolder cache_name
void setGhosted(bool ghost)
Object that represents drawable geometry. This object holds vertex, instancing and index buffers for ...
const UT_DMatrix4 & getDetailTransform(int index) const
bool forceWireframe() const
bool hasUpdateVisualizer(int vis_id) const
static UT_Lock theShaderLock
bool isBBoxShadingMode(GUI_DisplayOption &opt) const
bool isDeferredPass() const
GUI_DisplaySetType
Context specific display options for geometry states.
Temporary container for either a RV_Render and an RE_Render.
int getNumDetailTransforms() const
std::optional< T > UT_Optional
const GU_Detail * myLockedDetail
const UT_IntArray & getUpdateVisualizers() const
std::unique_ptr< T, Deleter > UT_UniquePtr
A smart pointer for unique ownership of dynamically allocated objects.
const UT_IntArray & getRefineVisualizers() const
bool needsDeferredPass() const
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
void setNeedsDeferredPass(bool need)
void refreshUpdateVisualizers()
void setSelection(int64 id, int64 version)
virtual exint bumpClock()=0
UT_SharedPtr< GA_EdgeGroup > myEdges
void setDisplayed(bool is_disp)
GLint GLint GLsizei GLint GLenum GLenum type
UT_SharedPtr< RE_Geometry > my2DGeo
std::pair< GA_PrimitiveTypeId, GT_PrimitiveType > GUI_PrimTypeKey
RE_MaterialAtlas myMaterialAtlas
void bumpObjectMaterial()
virtual int64 getPrimDecorationMask() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
This class provides a way to manage a reference to an attribute permitting Read-Only access...
UT_UniquePtr< gui_UpdateResults > myUpdateResults
UT_SharedPtr< RE_Geometry > my2DGeoV
GUI_ObjectMaterialCache * myObjectMaterialCache
UT_SharedPtr< RE_Geometry > myGeoV
UT_SharedPtr< GA_PrimitiveGroup > myEdgePrims
GR_LightList * myLightList
RV_API void cleanupShaders()
bool isBBoxShadingMode(const GR_DisplayOption *opt) const
GLuint const GLchar * name
void clearRefineVisualizers()
void setInstancerTransform(const UT_DMatrix4 &xform)
const UT_DMatrix4 & getDetailInvTransform(int index) const
virtual void simpleRender(RE_RenderContext r, GUI_DisplayOption &opt, const GU_Detail *geo, GR_RenderMode mode, GR_RenderFlags flags)
The base class for all GT primitive types.
bool needsAlphaPass() const
Handle to the main interface of Vulkan.
void setInstancerTransformIdentity()
UT_SharedPtr< GU_Selection > GU_SelectionHandle
GUI_DetailLook & look() const
FS_API bool cleanup(UT_StringArray &removed, UT_StringArray &error_files, exint &memory_freed, bool dry_run, const char *override_path=nullptr)
void setShowMaterials(bool show)
void setDeferredPass(bool dpass)
const UT_DMatrix4 & getDetailFullTransform() const
bool isMSSEnabled() const
GT_API const UT_StringHolder version
virtual const char * className() const
void setInstanceVersion(int64 version)
bool hasGuideParts() const
bool showMaterials() const
RV_API bool initShaders(RV_Instance *inst)
void refreshRefineVisualizers()
GUI_DisplaySetType getDisplaySetType() const
bool isMSSPerPrimEnabled() const
int getMaterialLimit() const
GR_DisplayOption * getDisplayOptionSet(GUI_DisplayOption &disp_opt)
void refreshVisUpdateTime()
int getPostPassID() const
UT_UniquePtr< GA_Group > GA_GroupUPtr
int64 myLimitInstanceVersion
bool hasMaterialReflection() const
GA_GroupType
An ordinal enum for the different types of groups in GA.
UT_SharedPtr< RE_Geometry > myGeo
void setMaterialLimitExceeded(bool e)
A specialization of GA_AIFStringTuple to access "shared strings".
void setObjectSelection(int obj_selection)
exint getVisUpdateTime() const
int64 getInstanceVersion() const
const char * name() const
GR_API void setupGhosting(RE_RenderContext r, int opaque_data[3], fpreal transparency=0.25f)
bool hasRefineVisualizer(int vis_id) const
virtual GU_ConstDetailHandle & getDetailHandle()
GR_RenderInfo & getRenderInfo()
void setHasTimeDependentMaterials(bool d)
exint getVisRefineTime() const
UT_Map< UT_StringRef, int > myAttributes
const UT_DMatrix4 & getInstancerTransform() const
GR_API void cleanupGhosting(RE_RenderContext r, int opaque_data[3])
virtual void solidRender(RE_RenderContext r, GUI_DisplayOption &disp_opt, const GU_Detail *geo, GR_RenderMode mode, GR_RenderFlags flags, GR_AlphaPass pass)
bool myCheckUpdateViewFlag
Container class for all geometry.
bool isMSSPackedEnabled() const
bool needsParallelPass() const
void setCanRenderUV(int uv_render)
fpreal getDrawTime() const
Simple class for a mutli-integer cache tag.
virtual bool isObjectRender() const
bool hasMaterialOpChanges() const
virtual void cleanupMaterials()
const UT_IntArray & getActiveVisualizers() const
UT_StringMap< bool > myUVAttribIsVertex
static int theNumVertices
const UT_IntArray & getActiveVisualizers() const
const char * getCacheName() const
bool hasTimeDependentMaterials() const
virtual bool isLopRender() const
void needsAlphaPass(bool need)
void setGeoIndex(int idx)
static GUI_VisInterface * getHandler()
Simple interface to building a shader from a .prog file.
bool areOverridesEnabled() const
UT_UniquePtr< GEO_DetachedHedgeInterface > interface
bool hasPendingMaterialTextures() const
const GR_DisplayOption * getDisplayOptionSet(const GUI_DisplayOption &disp_opt) const