11 #ifndef GUI_GeoRender_h
12 #define GUI_GeoRender_h
68 class gui_CollectionPrim;
73 class gui_HookedPrims;
76 class gui_RenderHookEntry;
77 class GUI_ObjectMaterialCache;
91 virtual const char *
className()
const {
return "GUI_GeoRender"; }
95 void setGeometry(
OP_Node *node);
99 void setGeoName(
const char *name);
101 void setInstanceName(
const char *name);
133 {
return myDetailTransforms.entries(); }
135 { myDetailFullTransform = xform; }
137 {
return myDetailFullTransform; }
142 { myInstancerTransform = xform;
143 myInstancerIdentityFlag = xform.
isIdentity(); }
145 { myInstancerTransform.identity();
146 myInstancerIdentityFlag =
true; }
148 {
return myInstancerTransform; }
159 int use_vertex)
const;
168 static void setWorldToScreen(
const UT_Matrix4R &xform);
171 void setIsInstancedGeo(
bool instanced);
172 bool addInstanceTransform(
const UT_DMatrix4 &xform,
174 void clearInstanceTransforms();
176 int64 getInstanceVersion()
const;
196 const char *view_name,
209 {
return myMaterialTexturePending; }
211 void addMaterialReference(
OP_Node *mat_node);
212 void clearMaterialReferences();
222 bool isLit()
const {
return myLitFlag; }
247 { myNeedsDeferredPass = need;}
258 {
return myMaterialHasReflection; }
261 { myInfo.myObjectGhosted = ghost; }
263 { myInfo.myObjectSelection = obj_selection; }
265 { myInfo.myCanRenderUV = uv_render; }
268 return myInfo.myCanRenderUV;
271 bool getComponentSelection(
298 fpreal ghost_amount = 0.5);
326 {
return myPrimDecorMask; }
332 virtual void decorationRender(
337 bool override_dispopt,
349 bool canBeSelected(
OP_Node *op,
358 bool canBeSelectedWhenNotUsingOps(
362 bool pick_ghost)
const;
374 unsigned int primmask,
381 const char *
name()
const {
return myCacheName; }
386 void cleanupLighting();
388 static void resetStats();
389 static void getStats(
int &num_objs,
395 void useObjectMaterials(
bool use_obj_mat);
411 return isBBoxShadingMode(getDisplayOptionSet(opt));
429 {
return myVisUpdateTime; }
432 {
return myVisRefineTime; }
439 { myVisRefineTime = myVisUpdateTime =
443 {
return myUpdateVisualizers.find(vis_id) >= 0; }
446 {
return myRefineVisualizers.find(vis_id) >= 0; }
452 {
return myUpdateVisualizers; }
455 {
return myRefineVisualizers; }
458 { myUpdateVisualizers = getActiveVisualizers(); }
461 { myUpdateVisualizers.clear(); }
464 { myRefineVisualizers = getActiveVisualizers(); }
467 { myRefineVisualizers.clear(); }
469 void runCreatorVisualizers(
int &listcount,
487 bool use_hidden_grp);
492 static int getPolygonMeshLimit();
493 static int getPointMeshLimit();
495 static void handleMaterialChange(
OP_Node *
src,
void *dest,
502 {
return myMaterialUseOverrides; }
505 { myMaterialLimitExceeded = e; }
508 void invalidateGeo();
513 { myDataIds.clear(); }
517 static void cleanupShaders();
526 myLocalBBox.makeInvalid();
527 myWorldBBox.makeInvalid();
528 myLook->invalidateBBox();
535 virtual bool shouldRender(
const GU_Detail *geo)
const;
538 {
return myPrimitives.entries(); }
575 bool outline=
true) {};
586 bool &has_edges)
const;
588 bool &has_edges)
const;
606 bool &needs_alpha_pass);
629 const char *view_name,
647 bool apply_filter_vis,
659 void clearUnusedAlembicArchives();
683 bool processing_geo_prims,
684 bool apply_filter_vis,
696 bool processing_geo_prims,
700 void resetPrimClassify();
708 const char *view_name);
710 bool buildInstanceSelection(
bool has_sel_overrides);
720 bool include_selection);
723 { mySelectionId =
id; mySelectionRevision =
version; }
735 gui_RenderHookEntry *&prev,
737 bool processing_geo_prims,
743 void restartCollectionPrimitives();
744 void removeUnusedCollectionPrimitives();
746 void find3DBoundaries(
const GU_Detail *geo,
749 void findUVBoundaries(
const GU_Detail *geo,
772 bool view_3d,
bool vert_uv);
791 void resizePrimArray(
exint nprims,
bool clear =
false);
795 void updateWorldTransform();
830 bool shouldUVRender(
const GU_Detail *geo,
832 bool is_vertex)
const;
851 bool checkAutoVertexNormal(
const GU_Detail *dtl,
854 bool inPackedPrim()
const
855 {
return myPackedPrimLevel > 0; }
856 bool inInstancePrim()
const
857 {
return myInstancePrim.entries() > 0; }
858 void updateInstanceEntry(gr_PrimEntry *entry,
872 bool use_fraction_parm);
884 void clearMaterialInterests();
893 bool myObjectMaterialDirty;
899 bool myUseObjectMaterial;
907 bool myHasGLStateCheckPrims;
909 bool myHasGuideParts;
910 bool myHasPackedPrims;
911 bool myHasPackedFragments;
912 bool myHasPackedInstances;
913 bool myWireframeFlag;
914 bool myForceShadedFlag;
916 bool myRecordingTime;
919 bool myHasAgentPrims;
920 bool myAgentLastLODEnable;
921 int myAgentLastMinPoints;
922 int myAgentLastMaxLOD;
924 bool myCharcterLastDeform;
932 int myDrawTimeWaiting;
938 int64 myTopologyVersion;
939 int myCachedShowSelect;
940 int64 myPrimitiveVersion;
943 exint mySelectionRevision;
945 bool myNeedsDeferredPass;
957 bool operator==(
const DataIdsCache &rhs)
const
959 return myDataIdsCount==rhs.myDataIdsCount &&
960 myDataIdsSum==rhs.myDataIdsSum;
972 myDataIdsSum += (
exint)
id;
975 void getDataIdsExcept_p_transform(
const GA_Detail *gdp);
978 exint myDataIdsCount;
981 DataIdsCache myDataIds;
982 DataIdsCache myDataIdsCache;
990 bool myPolygonConvexQuality;
991 bool myVertexNormalEnable;
992 fpreal myVertexNormalCuspAngle;
994 bool myShowAllPoints;
1000 bool myObjectDisplayAsSubdiv;
1006 bool myDetailTransformIdentity;
1009 bool myInstancerIdentityFlag;
1013 int64 myCachedInstanceVersion;
1014 int myRefineVersion;
1015 bool myCheckUpdateViewFlag;
1016 bool myObjectTransformDirty;
1017 bool myNeedsAlphaPassFlag;
1018 bool myPrimAlphaPassFlag;
1020 bool myRefineOnLODChange;
1021 int mySelectionInstance;
1022 fpreal myLimitedInstanceFraction;
1023 bool myShowMaterials;
1027 bool myHasInstanceSelection;
1034 gui_Instance() { myBBox.makeInvalid(); }
1048 gui_DiskFile() : myPrimIndex(0) {}
1054 int myPackedPrimLevel;
1056 mutable bool myCachedUseSampleMask;
1057 mutable int myCachedSampleMask;
1058 mutable bool myCachedMultisample;
1059 mutable bool myCachedSampleCoverage;
1064 fpreal myCubeInstanceFraction;
1069 exint myVisUpdateTime;
1070 exint myVisRefineTime;
1076 bool myRefineOnUpdate;
1077 unsigned myMaterialTextureFlag :1,
1078 myMaterialTexturePending :1,
1079 myMaterialHasDisplaceMap :1,
1080 myMaterialHasReflection :1,
1081 myMaterialUseOverrides :1,
1088 int myMaterialLimit;
1089 bool myMaterialLimitExceeded;
1090 int myObjMaterialID;
1091 int myDefaultMatSerial;
1097 int64 myBaseMaterialPrevID;
1098 int64 myBaseMaterialRemapPrevID;
1099 bool myForceMaterialUpdate;
1100 bool myMaterialAllowUpdates;
1102 class gui_DetailAttribLists
1105 bool checkForAttribListChanges(
const GU_Detail &dtl);
1115 gui_DetailAttribLists myDetailAttribLists;
1122 } myHedgeInterface[2];
1125 int myPrimClassifierDetailId;
1126 int64 myPrimClassifierCacheVersion;
1127 int64 myPrimClassifierTopVersion;
1128 int64 myPrimClassifierSelectId;
1129 int64 myPrimClassifierSelectRevision;
1134 int myCachedGroupDetailId;
1135 int64 myCachedGroupCacheVersion;
1136 int64 myCachedGroupTopVersion;
1138 int64 myCachedHidden3DVersion;
1157 friend class gr_PrimEntry;
1175 return myDetailTransforms(index);
1181 return myDetailInvTransforms(index);
void setPostPassID(int id)
GR_MaterialAtlas myVulkanMaterials
void setDetailFullTransform(const UT_DMatrix4 &xform)
int getNumPrimitives() const
gui_BoundaryData my3DBoundary
void clearUpdateVisualizers()
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)
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
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)
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_SharedPtr< RE_Geometry > my2DGeoV
GUI_ObjectMaterialCache * myObjectMaterialCache
UT_SharedPtr< RE_Geometry > myGeoV
UT_SharedPtr< GA_PrimitiveGroup > myEdgePrims
GR_LightList * myLightList
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
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
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)
Container class for all geometry.
bool isMSSPackedEnabled() const
void setCanRenderUV(int uv_render)
fpreal getDrawTime() const
Simple class for a mutli-integer cache tag.
virtual bool isObjectRender() 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