11 #ifndef GUI_GeoRender_h
12 #define GUI_GeoRender_h
73 class gui_CollectionPrim;
76 class GT_PrimCharacterScene;
79 class gui_HookedPrims;
82 class gui_RenderHookEntry;
83 class gui_UpdateResults;
84 class GUI_ObjectMaterialCache;
98 virtual const char *
className()
const {
return "GUI_GeoRender"; }
102 void setGeometry(
OP_Node *node);
106 void setGeoName(
const char *name);
108 void setInstanceName(
const char *name);
142 {
return myDetailTransforms.entries(); }
144 { myDetailFullTransform =
xform; }
146 {
return myDetailFullTransform; }
151 { myInstancerTransform =
xform;
152 myInstancerIdentityFlag = xform.
isIdentity(); }
154 { myInstancerTransform.identity();
155 myInstancerIdentityFlag =
true; }
157 {
return myInstancerTransform; }
168 int use_vertex)
const;
180 void setIsInstancedGeo(
bool instanced);
183 void clearInstanceTransforms();
185 int64 getInstanceVersion()
const;
188 void gpuMemoryUsage(
exint &used_bytes,
190 exint &pinned_bytes);
210 const char *view_name,
221 const char *view_name,
224 virtual bool hasParallelUpdate()
const;
238 {
return myHasOnionSkinPrims; }
245 void getOnionSkinPrimRenderInfos(
252 bool hasOutlineOnionSkins()
const;
255 {
return myMaterialTexturePending; }
257 void addMaterialReference(
OP_Node *mat_node);
258 void removeMaterialReference(
OP_Node *mat_node);
259 void clearMaterialReferences();
269 bool isLit()
const {
return myLitFlag; }
294 { myNeedsDeferredPass = need;}
308 {
return myMaterialHasReflection; }
311 { myInfo.myObjectGhosted = ghost; }
313 { myInfo.myObjectSelection = obj_selection; }
315 { myInfo.myCanRenderUV = uv_render; }
318 return myInfo.myCanRenderUV;
321 bool getComponentSelection(
348 fpreal ghost_amount = 0.5);
376 {
return myPrimDecorMask; }
382 virtual void decorationRender(
387 bool override_dispopt,
408 bool canBeSelectedWhenNotUsingOps(
412 bool pick_ghost)
const;
424 unsigned int primmask,
431 const char *
name()
const {
return myCacheName; }
436 void cleanupLighting();
438 static void resetStats();
439 static void getStats(
int &num_objs,
445 void useObjectMaterials(
bool use_obj_mat);
460 return isBBoxShadingMode(getDisplayOptionSet(opt));
478 {
return myVisUpdateTime; }
481 {
return myVisRefineTime; }
488 { myVisRefineTime = myVisUpdateTime =
492 {
return myUpdateVisualizers.find(vis_id) >= 0; }
495 {
return myRefineVisualizers.find(vis_id) >= 0; }
501 {
return myUpdateVisualizers; }
504 {
return myRefineVisualizers; }
507 { myUpdateVisualizers = getActiveVisualizers(); }
510 { myUpdateVisualizers.clear(); }
513 { myRefineVisualizers = getActiveVisualizers(); }
516 { myRefineVisualizers.clear(); }
518 void runCreatorVisualizers(
int &listcount,
536 bool use_hidden_grp);
544 static void handleMaterialChange(
OP_Node *
src,
void *dest,
551 {
return myMaterialUseOverrides; }
554 { myMaterialLimitExceeded = e; }
556 { myHasTimeDepMaterials = d; }
558 {
return myHasTimeDepMaterials; }
561 void invalidateGeo();
566 { myDataIds.clear(); }
578 {
return (myMatOpChanges.size()!=0); }
589 myLocalBBox.makeInvalid();
590 myWorldBBox.makeInvalid();
591 myLook->invalidateBBox();
598 virtual bool shouldRender(
const GU_Detail *geo)
const;
601 {
return myPrimitives.entries(); }
638 bool outline=
true) {};
649 bool &has_edges)
const;
651 bool &has_edges)
const;
669 bool &needs_alpha_pass);
692 bool *old_poly_offset);
705 const char *view_name,
716 const char *view_name,
734 bool apply_filter_vis,
746 void clearUnusedAlembicArchives();
760 bool is_onion_skin_pass =
false);
771 bool processing_geo_prims,
772 bool apply_filter_vis,
784 bool processing_geo_prims,
788 void resetPrimClassify();
796 const char *view_name);
798 bool buildInstanceSelection(
bool has_sel_overrides);
808 bool include_selection);
811 { mySelectionId =
id; mySelectionRevision =
version; }
823 gui_RenderHookEntry *&prev,
825 bool processing_geo_prims,
831 void restartCollectionPrimitives();
832 void removeUnusedCollectionPrimitives();
834 void find3DBoundaries(
const GU_Detail *geo,
837 void findUVBoundaries(
const GU_Detail *geo,
860 bool view_3d,
bool vert_uv);
879 void resizePrimArray(
exint nprims,
bool clear =
false);
883 void updateWorldTransform();
930 bool shouldUVRender(
const GU_Detail *geo,
932 bool is_vertex)
const;
951 bool checkAutoVertexNormal(
const GU_Detail *dtl,
954 bool inPackedPrim()
const
955 {
return myPackedPrimLevel > 0; }
956 bool inInstancePrim()
const
957 {
return myInstancePrim.entries() > 0; }
958 void updateInstanceEntry(gr_PrimEntry *entry,
972 bool use_fraction_parm);
980 bool set_shader =
false,
981 bool is_matte =
false,
987 void clearMaterialInterests();
996 bool myObjectMaterialDirty;
1002 bool myUseObjectMaterial;
1010 bool myHasGLStateCheckPrims;
1012 bool myShadeOpenCurvesFlag;
1013 bool myShadeOpenCurvesFlagSet;
1014 bool myHasGuideParts;
1015 bool myHasPackedPrims;
1016 bool myHasPackedFragments;
1017 bool myHasPackedInstances;
1018 bool myWireframeFlag;
1019 bool myForceShadedFlag;
1020 bool myTransparencySortFlag;
1022 bool myRecordingTime;
1024 bool myIsSubD =
false;
1026 bool myHasAgentPrims;
1027 bool myAgentLastLODEnable;
1028 int myAgentLastMinPoints;
1029 int myAgentLastMaxLOD;
1030 int myAgentLastMaxBlendShapeLOD;
1033 bool myLookIsOnionSkinning =
false;
1034 bool myHasOnionSkinPrims =
false;
1038 bool myHasPolygons =
false;
1039 bool myHasCurves =
false;
1040 bool myHasPoints =
false;
1044 int myDrawTimeWaiting;
1050 int64 myTopologyVersion;
1051 int myCachedShowSelect;
1052 int64 myPrimitiveVersion;
1054 exint mySelectionId;
1055 exint mySelectionRevision;
1057 bool myNeedsDeferredPass;
1058 bool myNeedsParallelPass;
1070 bool operator==(
const DataIdsCache &rhs)
const
1072 return myDataIdsCount==rhs.myDataIdsCount &&
1073 myDataIdsSum==rhs.myDataIdsSum;
1085 myDataIdsSum += (
exint)
id;
1088 void getDataIdsExcept_p_transform(
const GA_Detail *gdp);
1091 exint myDataIdsCount;
1094 DataIdsCache myDataIds;
1095 DataIdsCache myDataIdsCache;
1100 bool myPolygonConvexQuality;
1101 bool myVertexNormalEnable;
1102 fpreal myVertexNormalCuspAngle;
1104 bool myShowAllPoints;
1110 bool myObjectDisplayAsSubdiv;
1116 bool myDetailTransformIdentity;
1119 bool myInstancerIdentityFlag;
1123 int64 myCachedInstanceVersion;
1124 int myRefineVersion;
1125 bool myObjectTransformDirty;
1126 bool myNeedsAlphaPassFlag;
1127 bool myPrimAlphaPassFlag;
1129 bool myRefineOnLODChange;
1130 int mySelectionInstance;
1131 fpreal myLimitedInstanceFraction;
1132 bool myShowMaterials;
1133 int myFactoryMaterialOverrideId = -1;
1137 bool myHasInstanceSelection;
1144 gui_Instance() { myBBox.makeInvalid(); }
1158 gui_DiskFile() : myPrimIndex(0) {}
1164 int myPackedPrimLevel;
1166 mutable bool myCachedUseSampleMask;
1167 mutable int myCachedSampleMask;
1168 mutable bool myCachedMultisample;
1169 mutable bool myCachedSampleCoverage;
1171 fpreal myCubeInstanceFraction;
1176 exint myVisUpdateTime;
1177 exint myVisRefineTime;
1183 bool myRefineOnUpdate;
1184 unsigned myMaterialTextureFlag :1,
1185 myMaterialTexturePending :1,
1186 myMaterialHasDisplaceMap :1,
1187 myMaterialHasReflection :1,
1188 myMaterialUseOverrides :1,
1189 myMaterialTexCacheUpdate : 1,
1190 myHasTimeDepMaterials :1,
1191 myHasOpDepMaterials :1,
1198 int myMaterialLimit;
1199 bool myMaterialLimitExceeded;
1200 int myObjMaterialID;
1206 int64 myBaseMaterialPrevID;
1207 int64 myBaseMaterialRemapPrevID;
1208 bool myForceMaterialUpdate;
1209 bool myMaterialAllowUpdates;
1214 class gui_DetailAttribLists
1217 bool checkForAttribListChanges(
const GU_Detail &dtl);
1227 gui_DetailAttribLists myDetailAttribLists;
1234 } myHedgeInterface[2];
1237 int myPrimClassifierDetailId;
1238 int64 myPrimClassifierCacheVersion;
1239 int64 myPrimClassifierTopVersion;
1240 int64 myPrimClassifierSelectId;
1241 int64 myPrimClassifierSelectRevision;
1246 int myCachedGroupDetailId;
1247 int64 myCachedGroupCacheVersion;
1248 int64 myCachedGroupTopVersion;
1250 int64 myCachedHidden3DVersion;
1252 fpreal myDisplacementValue = -1.0;
1253 bool myDisplacementChanged =
false;
1254 bool myAllowTransparency =
true;
1255 fpreal myAlphaCutoff = -1.0;
1278 friend class gr_PrimEntry;
1296 return myDetailTransforms(index);
1302 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
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_SharedPtr< RE_Geometry > my2DGeo
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
UT_SharedPtr< RE_Geometry > my2DGeoV
GUI_ObjectMaterialCache * myObjectMaterialCache
UT_SharedPtr< RE_Geometry > myGeoV
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)
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_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
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)
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