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; }
537 void invalidateGeo();
542 { myDataIds.clear(); }
552 {
return (myMatOpChanges.size()!=0); }
565 myLocalBBox.makeInvalid();
566 myWorldBBox.makeInvalid();
567 myLook->invalidateBBox();
574 virtual bool shouldRender(
const GU_Detail *geo)
const;
577 {
return myPrimitives.entries(); }
614 bool outline=
true) {};
625 bool &has_edges)
const;
627 bool &has_edges)
const;
645 bool &needs_alpha_pass);
674 const char *view_name,
685 const char *view_name,
703 bool apply_filter_vis,
715 void clearUnusedAlembicArchives();
739 bool processing_geo_prims,
740 bool apply_filter_vis,
752 bool processing_geo_prims,
756 void resetPrimClassify();
764 const char *view_name);
766 bool buildInstanceSelection(
bool has_sel_overrides);
776 bool include_selection);
779 { mySelectionId =
id; mySelectionRevision =
version; }
791 gui_RenderHookEntry *&prev,
793 bool processing_geo_prims,
799 void restartCollectionPrimitives();
800 void removeUnusedCollectionPrimitives();
802 void find3DBoundaries(
const GU_Detail *geo,
805 void findUVBoundaries(
const GU_Detail *geo,
828 bool view_3d,
bool vert_uv);
847 void resizePrimArray(
exint nprims,
bool clear =
false);
851 void updateWorldTransform();
897 bool shouldUVRender(
const GU_Detail *geo,
899 bool is_vertex)
const;
918 bool checkAutoVertexNormal(
const GU_Detail *dtl,
921 bool inPackedPrim()
const
922 {
return myPackedPrimLevel > 0; }
923 bool inInstancePrim()
const
924 {
return myInstancePrim.entries() > 0; }
925 void updateInstanceEntry(gr_PrimEntry *entry,
939 bool use_fraction_parm);
947 bool set_shader =
false,
948 bool is_matte =
false,
956 void clearMaterialInterests();
965 bool myObjectMaterialDirty;
971 bool myUseObjectMaterial;
979 bool myHasGLStateCheckPrims;
981 bool myShadeOpenCurvesFlag;
982 bool myShadeOpenCurvesFlagSet;
983 bool myHasGuideParts;
984 bool myHasPackedPrims;
985 bool myHasPackedFragments;
986 bool myHasPackedInstances;
987 bool myWireframeFlag;
988 bool myForceShadedFlag;
990 bool myRecordingTime;
992 bool myIsSubD =
false;
994 bool myHasAgentPrims;
995 bool myAgentLastLODEnable;
996 int myAgentLastMinPoints;
997 int myAgentLastMaxLOD;
1008 int myDrawTimeWaiting;
1014 int64 myTopologyVersion;
1015 int myCachedShowSelect;
1016 int64 myPrimitiveVersion;
1018 exint mySelectionId;
1019 exint mySelectionRevision;
1021 bool myNeedsDeferredPass;
1022 bool myNeedsParallelPass;
1034 bool operator==(
const DataIdsCache &rhs)
const
1036 return myDataIdsCount==rhs.myDataIdsCount &&
1037 myDataIdsSum==rhs.myDataIdsSum;
1049 myDataIdsSum += (
exint)
id;
1052 void getDataIdsExcept_p_transform(
const GA_Detail *gdp);
1055 exint myDataIdsCount;
1058 DataIdsCache myDataIds;
1059 DataIdsCache myDataIdsCache;
1065 int myDispOptSerial;
1067 bool myPolygonConvexQuality;
1068 bool myVertexNormalEnable;
1069 fpreal myVertexNormalCuspAngle;
1071 bool myShowAllPoints;
1077 bool myObjectDisplayAsSubdiv;
1083 bool myDetailTransformIdentity;
1086 bool myInstancerIdentityFlag;
1090 int64 myCachedInstanceVersion;
1091 int myRefineVersion;
1092 bool myObjectTransformDirty;
1093 bool myNeedsAlphaPassFlag;
1094 bool myPrimAlphaPassFlag;
1096 bool myRefineOnLODChange;
1097 int mySelectionInstance;
1098 fpreal myLimitedInstanceFraction;
1099 bool myShowMaterials;
1100 int myFactoryMaterialOverrideId = -1;
1104 bool myHasInstanceSelection;
1111 gui_Instance() { myBBox.makeInvalid(); }
1125 gui_DiskFile() : myPrimIndex(0) {}
1131 int myPackedPrimLevel;
1133 mutable bool myCachedUseSampleMask;
1134 mutable int myCachedSampleMask;
1135 mutable bool myCachedMultisample;
1136 mutable bool myCachedSampleCoverage;
1141 fpreal myCubeInstanceFraction;
1146 exint myVisUpdateTime;
1147 exint myVisRefineTime;
1153 bool myRefineOnUpdate;
1154 unsigned myMaterialTextureFlag :1,
1155 myMaterialTexturePending :1,
1156 myMaterialHasDisplaceMap :1,
1157 myMaterialHasReflection :1,
1158 myMaterialUseOverrides :1,
1159 myMaterialTexCacheUpdate : 1,
1160 myHasTimeDepMaterials :1,
1161 myHasOpDepMaterials :1,
1168 int myMaterialLimit;
1169 bool myMaterialLimitExceeded;
1170 int myObjMaterialID;
1176 int64 myBaseMaterialPrevID;
1177 int64 myBaseMaterialRemapPrevID;
1178 bool myForceMaterialUpdate;
1179 bool myMaterialAllowUpdates;
1184 class gui_DetailAttribLists
1187 bool checkForAttribListChanges(
const GU_Detail &dtl);
1197 gui_DetailAttribLists myDetailAttribLists;
1204 } myHedgeInterface[2];
1207 int myPrimClassifierDetailId;
1208 int64 myPrimClassifierCacheVersion;
1209 int64 myPrimClassifierTopVersion;
1210 int64 myPrimClassifierSelectId;
1211 int64 myPrimClassifierSelectRevision;
1216 int myCachedGroupDetailId;
1217 int64 myCachedGroupCacheVersion;
1218 int64 myCachedGroupTopVersion;
1220 int64 myCachedHidden3DVersion;
1222 fpreal myDisplacementValue = -1.0;
1223 bool myDisplacementChanged =
false;
1243 friend class gr_PrimEntry;
1261 return myDetailTransforms(index);
1267 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()
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
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