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);
143 {
return myDetailTransforms.entries(); }
145 { myDetailFullTransform =
xform; }
147 {
return myDetailFullTransform; }
152 { myInstancerTransform =
xform;
153 myInstancerIdentityFlag = xform.
isIdentity(); }
155 { myInstancerTransform.identity();
156 myInstancerIdentityFlag =
true; }
158 {
return myInstancerTransform; }
169 int use_vertex)
const;
181 void setIsInstancedGeo(
bool instanced);
184 void clearInstanceTransforms();
186 int64 getInstanceVersion()
const;
189 void gpuMemoryUsage(
exint &used_bytes,
191 exint &pinned_bytes);
211 const char *view_name,
222 const char *view_name,
225 virtual bool hasParallelUpdate()
const;
239 {
return myHasOnionSkinPrims; }
246 void getOnionSkinPrimRenderInfos(
253 bool hasOutlineOnionSkins()
const;
256 {
return myMaterialTexturePending; }
258 void addMaterialReference(
OP_Node *mat_node);
259 void removeMaterialReference(
OP_Node *mat_node);
260 void clearMaterialReferences();
271 bool isLit()
const {
return myLitFlag; }
296 { myNeedsDeferredPass = need;}
310 {
return myMaterialHasReflection; }
313 { myInfo.myObjectGhosted = ghost; }
315 { myInfo.myObjectSelection = obj_selection; }
317 { myInfo.myCanRenderUV = uv_render; }
320 return myInfo.myCanRenderUV;
323 bool getComponentSelection(
350 fpreal ghost_amount = 0.5);
378 {
return myPrimDecorMask; }
384 virtual void decorationRender(
389 bool override_dispopt,
410 bool canBeSelectedWhenNotUsingOps(
414 bool pick_ghost)
const;
426 unsigned int primmask,
433 const char *
name()
const {
return myCacheName; }
438 void cleanupLighting();
440 static void resetStats();
441 static void getStats(
int &num_objs,
447 void useObjectMaterials(
bool use_obj_mat);
462 return isBBoxShadingMode(getDisplayOptionSet(opt));
480 {
return myVisUpdateTime; }
483 {
return myVisRefineTime; }
490 { myVisRefineTime = myVisUpdateTime =
494 {
return myUpdateVisualizers.find(vis_id) >= 0; }
497 {
return myRefineVisualizers.find(vis_id) >= 0; }
503 {
return myUpdateVisualizers; }
506 {
return myRefineVisualizers; }
509 { myUpdateVisualizers = getActiveVisualizers(); }
512 { myUpdateVisualizers.clear(); }
515 { myRefineVisualizers = getActiveVisualizers(); }
518 { myRefineVisualizers.clear(); }
520 void runCreatorVisualizers(
int &listcount,
538 bool use_hidden_grp);
546 static void handleMaterialChange(
OP_Node *
src,
void *dest,
553 {
return myMaterialUseOverrides; }
556 { myMaterialLimitExceeded = e; }
558 { myHasTimeDepMaterials = d; }
560 {
return myHasTimeDepMaterials; }
563 void invalidateGeo();
568 { myDataIds.clear(); }
580 {
return (myMatOpChanges.size()!=0); }
591 myLocalBBox.makeInvalid();
592 myWorldBBox.makeInvalid();
593 myLook->invalidateBBox();
600 virtual bool shouldRender(
const GU_Detail *geo)
const;
603 {
return myPrimitives.entries(); }
640 bool outline=
true) {};
651 bool &has_edges)
const;
653 bool &has_edges)
const;
671 bool &needs_alpha_pass);
694 bool *old_poly_offset);
707 const char *view_name,
718 const char *view_name,
736 bool apply_filter_vis,
748 void clearUnusedAlembicArchives();
762 bool is_onion_skin_pass =
false);
773 bool processing_geo_prims,
774 bool apply_filter_vis,
786 bool processing_geo_prims,
790 void resetPrimClassify();
798 const char *view_name);
800 bool buildInstanceSelection(
bool has_sel_overrides);
810 bool include_selection);
813 { mySelectionId =
id; mySelectionRevision =
version; }
825 gui_RenderHookEntry *&prev,
827 bool processing_geo_prims,
833 void restartCollectionPrimitives();
834 void removeUnusedCollectionPrimitives();
836 void find3DBoundaries(
const GU_Detail *geo,
839 void findUVBoundaries(
const GU_Detail *geo,
862 bool view_3d,
bool vert_uv);
881 void resizePrimArray(
exint nprims,
bool clear =
false);
885 void updateWorldTransform();
935 bool shouldUVRender(
const GU_Detail *geo,
937 bool is_vertex)
const;
956 bool checkAutoVertexNormal(
const GU_Detail *dtl,
959 bool inPackedPrim()
const
960 {
return myPackedPrimLevel > 0; }
961 bool inInstancePrim()
const
962 {
return myInstancePrim.entries() > 0; }
963 void updateInstanceEntry(gr_PrimEntry *entry,
977 bool use_fraction_parm);
985 bool set_shader =
false,
986 bool is_matte =
false,
992 void clearMaterialInterests();
1001 bool myObjectMaterialDirty;
1007 bool myUseObjectMaterial;
1015 bool myHasGLStateCheckPrims;
1017 bool myShadeOpenCurvesFlag;
1018 bool myShadeOpenCurvesFlagSet;
1019 bool myHasGuideParts;
1020 bool myHasPackedPrims;
1021 bool myHasPackedFragments;
1022 bool myHasPackedInstances;
1023 bool myWireframeFlag;
1024 bool myForceShadedFlag;
1025 bool myTransparencySortFlag;
1027 bool myRecordingTime;
1029 bool myIsSubD =
false;
1031 bool myHasAgentPrims;
1032 bool myAgentLastLODEnable;
1033 int myAgentLastMinPoints;
1034 int myAgentLastMaxLOD;
1035 int myAgentLastMaxBlendShapeLOD;
1038 bool myLookIsOnionSkinning =
false;
1039 bool myHasOnionSkinPrims =
false;
1043 bool myHasPolygons =
false;
1044 bool myHasCurves =
false;
1045 bool myHasPoints =
false;
1049 int myDrawTimeWaiting;
1055 int64 myTopologyVersion;
1056 int myCachedShowSelect;
1057 int64 myPrimitiveVersion;
1059 exint mySelectionId;
1060 exint mySelectionRevision;
1062 bool myNeedsDeferredPass;
1063 bool myNeedsParallelPass;
1075 bool operator==(
const DataIdsCache &rhs)
const
1077 return myDataIdsCount==rhs.myDataIdsCount &&
1078 myDataIdsSum==rhs.myDataIdsSum;
1090 myDataIdsSum += (
exint)
id;
1093 void getDataIdsExcept_p_transform(
const GA_Detail *gdp);
1096 exint myDataIdsCount;
1099 DataIdsCache myDataIds;
1100 DataIdsCache myDataIdsCache;
1105 bool myPolygonConvexQuality;
1106 bool myVertexNormalEnable;
1107 fpreal myVertexNormalCuspAngle;
1109 bool myShowAllPoints;
1115 bool myObjectDisplayAsSubdiv;
1121 bool myDetailTransformIdentity;
1124 bool myInstancerIdentityFlag;
1128 int64 myCachedInstanceVersion;
1129 int myRefineVersion;
1130 bool myObjectTransformDirty;
1131 bool myNeedsAlphaPassFlag;
1132 bool myPrimAlphaPassFlag;
1134 bool myRefineOnLODChange;
1135 int mySelectionInstance;
1136 fpreal myLimitedInstanceFraction;
1137 bool myShowMaterials;
1138 int myFactoryMaterialOverrideId = -1;
1142 bool myHasInstanceSelection;
1149 gui_Instance() { myBBox.makeInvalid(); }
1163 gui_DiskFile() : myPrimIndex(0) {}
1169 int myPackedPrimLevel;
1171 mutable bool myCachedUseSampleMask;
1172 mutable int myCachedSampleMask;
1173 mutable bool myCachedMultisample;
1174 mutable bool myCachedSampleCoverage;
1176 fpreal myCubeInstanceFraction;
1181 exint myVisUpdateTime;
1182 exint myVisRefineTime;
1188 bool myRefineOnUpdate;
1189 unsigned myMaterialTextureFlag :1,
1190 myMaterialTexturePending :1,
1191 myMaterialHasDisplaceMap :1,
1192 myMaterialHasReflection :1,
1193 myMaterialUseOverrides :1,
1194 myMaterialTexCacheUpdate : 1,
1195 myHasTimeDepMaterials :1,
1196 myHasOpDepMaterials :1,
1203 int myMaterialLimit;
1204 bool myMaterialLimitExceeded;
1205 int myObjMaterialID;
1212 int64 myBaseMaterialPrevID;
1213 int64 myBaseMaterialRemapPrevID;
1214 bool myForceMaterialUpdate;
1215 bool myMaterialAllowUpdates;
1220 class gui_DetailAttribLists
1223 bool checkForAttribListChanges(
const GU_Detail &dtl);
1233 gui_DetailAttribLists myDetailAttribLists;
1240 } myHedgeInterface[2];
1243 int myPrimClassifierDetailId;
1244 int64 myPrimClassifierCacheVersion;
1245 int64 myPrimClassifierTopVersion;
1246 int64 myPrimClassifierSelectId;
1247 int64 myPrimClassifierSelectRevision;
1252 int myCachedGroupDetailId;
1253 int64 myCachedGroupCacheVersion;
1254 int64 myCachedGroupTopVersion;
1256 int64 myCachedHidden3DVersion;
1258 fpreal myDisplacementValue = -1.0;
1259 bool myDisplacementChanged =
false;
1260 bool myAllowTransparency =
true;
1261 fpreal myAlphaCutoff = -1.0;
1279 friend class gr_PrimEntry;
1297 return myDetailTransforms(index);
1303 return myDetailInvTransforms(index);
A collection of Vulkan UBO, SSBO, and Image shader bindings (descriptor set)
UT_SharedPtr< RV_Geometry > my2DGeo
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)
UT_UniquePtr< RV_ShaderBlock > myEdgeBlock
GA_API const UT_StringHolder rot
int getObjectMaterialID() const
fpreal getSetupTime() const
GT_API const UT_StringHolder cache_name
bool hasOnionSkinPrims() const
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
UT_UniquePtr< RV_ShaderBlock > myCubeTransforms
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_UniquePtr< RV_ShaderVariableSet > myEdgeSet
std::pair< GA_PrimitiveTypeId, GT_PrimitiveType > GUI_PrimTypeKey
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
GUI_ObjectMaterialCache * myObjectMaterialCache
bool isDisplayAsSubdiv() const
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
GA_API const UT_StringHolder transform
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.
UT_UniquePtr< RV_ShaderVariableSet > myCubeSet
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)
UT_SharedPtr< RV_Geometry > myGeoV
void refreshRefineVisualizers()
GUI_DisplaySetType getDisplaySetType() const
bool isMSSPerPrimEnabled() const
int getMaterialLimit() const
GA_API const UT_StringHolder parms
GR_DisplayOption * getDisplayOptionSet(GUI_DisplayOption &disp_opt)
UT_UniquePtr< RV_Geometry > myCubeGeo
void refreshVisUpdateTime()
int getPostPassID() const
UT_SharedPtr< RV_Geometry > my2DGeoV
UT_UniquePtr< GA_Group > GA_GroupUPtr
int64 myLimitInstanceVersion
bool hasMaterialReflection() const
GA_GroupType
An ordinal enum for the different types of groups in GA.
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
UT_UniquePtr< GA_EdgeGroup > mySelectedEdges
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
cgltf_primitive * getPrimitive(const cgltf_data &data, const GLTF_Index mesh_id, const GLTF_Index prim_id)
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)
UT_SharedPtr< RV_Geometry > myGeo
static GUI_VisInterface * getHandler()
bool areOverridesEnabled() const
UT_UniquePtr< GEO_DetachedHedgeInterface > interface
bool hasPendingMaterialTextures() const
const GR_DisplayOption * getDisplayOptionSet(const GUI_DisplayOption &disp_opt) const