HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GR_GeoRenderGL Class Reference

#include <GR_GeoRenderGL.h>

+ Inheritance diagram for GR_GeoRenderGL:

Public Member Functions

 GR_GeoRenderGL (GR_Primitive *parent_prim)
 
 ~GR_GeoRenderGL () override
 
virtual void updateInstanceGroupArray (const RE_VertexArray *array, int instance_group=-1, const char *attrib_name=NULL, RE_GenericAttribID id=RE_GENATTRIB_NONE)
 
RE_GeometrycreateGeometry (int npoints=0)
 
RE_GeometrygetGeometry () override
 
void retireGeometry () override
 
void getPickConnectGroup (unsigned int pick_mode, GR_PickGeometry pick_geo, int &out_connect_start, int &out_connect_num) override
 
void setupGeoOverride (RE_Render *r, const GR_DisplayOption *opt, RE_Geometry *geo, UT_UniquePtr< RE_OverrideList > &override_list)
 
void cleanupGeoOverride (RE_Render *r, const GR_DisplayOption *opt, RE_Geometry *geo)
 
- Public Member Functions inherited from GR_GeoRender
 GR_GeoRender (GR_Primitive *parent_prim, RenderType type)
 
virtual ~GR_GeoRender ()
 
virtual const char * className () const =0
 
bool isGL () const
 
bool isVulkan () const
 
virtual void update (RE_RenderContext r, const GT_PrimitiveHandle &primh, const GR_UpdateParms &p, const char *cache_name)=0
 
virtual void viewUpdate (RE_RenderContext r, const GR_DisplayOption &opts, const char *cache_name, RE_CacheVersion geo_version, RE_CacheVersion select_version)
 
virtual void draw (RE_RenderContext r, GR_RenderMode mode, GR_RenderFlags flags, GR_DrawParms draw_parms)=0
 Normal drawing method. Only issue rendering commands. More...
 
virtual bool supportsInstances () const
 By default, no instanced drawing support. More...
 
virtual bool isConvexed () const
 
virtual void geometryUpdated (RE_RenderContext)
 
virtual bool hasTransparency () const
 returns true if this drawable renders some transparent elements More...
 
virtual exint getNumGLPrimitives () const =0
 
virtual RV_GeometrygetVkGeometry ()
 
void getPickConnectGroup (unsigned int pick_mode, GR_PickGeometry pick_geo, int &out_connect_start, int &out_connect_num, int &out_connect_end)
 
virtual RV_GeometrygetVkPickGeometry (unsigned int pick_mode)
 
bool showSelections () const
 
GR_RenderVersion getRenderVersion () const
 
void allowGeoOverride (bool allow_overrides)
 
virtual bool canFrustumCull ()
 
bool inViewFrustum (const UT_Matrix4D &objviewproj, const UT_BoundingBoxD *bbox)
 
bool isRasterizedInView (const UT_Matrix4F &objviewproj, const UT_Vector2F &min_proj_size, const UT_BoundingBoxF *bbox=nullptr)
 
GR_BasePrimType getParentType () const
 
RenderType getRenderType () const
 
void buildInformation (bool prim_id, bool point_id)
 
bool shouldBuildPrimID () const
 
bool shouldBuildPointID () const
 
void setSelectionMask (GR_AttribMask selection_mask)
 
GR_AttribMask getSelectionMask () const
 
void setSelectionDisplayMode (GR_SelectMode m)
 
GR_SelectMode getSelectionDisplayMode () const
 
void setSelectionInstance (int i)
 
int getSelectionInstance () const
 
void setMaterialOverride (int mat_index)
 
void clearMaterialOverride ()
 
bool getDetailPrimID (int &id) const
 
void addUpdateMessage (GR_ErrorManager::Source err_source, GR_ErrorCode gr_code, UT_StringHolder extra_text=UT_StringHolder(), UT_StringHolder src_name=UT_StringHolder())
 
void addUpdateWarning (GR_ErrorManager::Source err_source, GR_ErrorCode gr_code, UT_StringHolder extra_text=UT_StringHolder(), UT_StringHolder src_name=UT_StringHolder())
 
void addUpdateError (GR_ErrorManager::Source err_source, GR_ErrorCode gr_code, UT_StringHolder extra_text=UT_StringHolder(), UT_StringHolder src_name=UT_StringHolder())
 
void addUpdateFatal (GR_ErrorManager::Source err_source, GR_ErrorCode gr_code, UT_StringHolder extra_text=UT_StringHolder(), UT_StringHolder src_name=UT_StringHolder())
 
void addRedrawMessage (GR_ErrorManager::Source err_source, GR_ErrorCode gr_code, UT_StringHolder extra_text=UT_StringHolder(), UT_StringHolder src_name=UT_StringHolder())
 
void addRedrawWarning (GR_ErrorManager::Source err_source, GR_ErrorCode gr_code, UT_StringHolder extra_text=UT_StringHolder(), UT_StringHolder src_name=UT_StringHolder())
 
void addRedrawError (GR_ErrorManager::Source err_source, GR_ErrorCode gr_code, UT_StringHolder extra_text=UT_StringHolder(), UT_StringHolder src_name=UT_StringHolder())
 
void addRedrawFatal (GR_ErrorManager::Source err_source, GR_ErrorCode gr_code, UT_StringHolder extra_text=UT_StringHolder(), UT_StringHolder src_name=UT_StringHolder())
 
GT_DataArrayHandle buildPointIDData (const GT_Primitive &prim, const GU_ConstDetailHandle &geo, int npoints)
 
GT_DataArrayHandle buildPrimitiveIDData (const GT_Primitive &prim, const GU_ConstDetailHandle &geo)
 
void setGeoBounds (const UT_BoundingBox &b)
 
const UT_BoundingBoxDgetGeoBounds () const
 

Static Public Member Functions

static RE_VertexArraygetDirtyAttribArray (RE_Render *r, RE_Geometry *geo, const char *attrib_name, const GT_DataArrayHandle &h, const GR_DisplayOption &opts, RE_ArrayType atype, RE_CacheVersion attr_version)
 
static void fillGeoAttribs (RE_Render *r, const GT_Primitive *prim, const GR_UpdateParms &p, RE_Geometry *geo, bool needs_nml, bool needs_uv, bool needs_tangent, bool need_prim_vert_info, const GT_DataArrayHandle &point_norm, GR_BasePrimType packed_type, bool build_point_id, bool build_prim_id, GR_GeoRenderGL *geo_ren=nullptr, bool *has_detail_prim_id=nullptr, int *detail_prim_id=nullptr, int *num_bone_deform=nullptr)
 
- Static Public Member Functions inherited from GR_GeoRender
static bool createTanAttrib (UT_Vector4F *tan_data, const GT_DataArray *nml, const GT_DataArray *tanu, const GT_DataArray *tanv, const GT_DataArray *vlist)
 

Protected Member Functions

void initLights (RE_Render *r, RE_Shader *sh, GR_RenderMode mode, GR_RenderFlags flags, const GR_DisplayOption *opt)
 
void buildPointID (RE_Render *r, const GT_Primitive &prim, const GU_ConstDetailHandle &geo, RE_CacheVersion geo_version)
 
void buildPrimitiveID (RE_Render *r, const GT_Primitive &primh, const GU_ConstDetailHandle &geo, RE_CacheVersion geo_version)
 
GR_SelectMode buildSelection (RE_Render *r, const GR_UpdateParms &parms, RE_Geometry &obj, const GT_PrimitiveHandle &primh, const GT_DataArrayHandle &vertexlist)
 
GR_SelectMode addToPointSelection (RE_Render *r, RE_VertexArray *select_array, int length, const GU_Detail &geo, const GT_DataArrayHandle &vh, const GT_DataArrayHandle &vl, const GA_PointGroup *pntsel, bool use_vertex_for_point_select, bool &init)
 
GR_SelectMode addToVertexSelection (RE_Render *r, RE_VertexArray *select_array, int length, const GU_Detail &geo, const GT_DataArrayHandle &vh, const GA_VertexGroup *vertsel, bool &init)
 
GR_SelectMode addToEdgeSelection (RE_Render *r, RE_VertexArray *select_array, int length, const GU_Detail &geo, const GT_DataArrayHandle &vt, const GT_DataArrayHandle &vert_list, const GA_EdgeGroup *edgesel, bool &init)
 
GR_SelectMode addToPrimSelection (RE_Render *r, RE_VertexArray *sel_array, const GT_DataArrayHandle &vh, const GA_PrimitiveGroup *primsel, bool &init)
 
virtual GR_SelectMode addToBreakpointSelection (RE_Render *r, RE_VertexArray *select, int bpnt_len, const GA_BreakpointGroup *bps, bool &init)
 
GR_SelectMode buildInstanceSelection (RE_Render *r, const GR_UpdateParms &p, RE_Geometry &obj)
 
void fillAttributesGL3 (RE_Render *r, const GT_Primitive *prim, const GR_UpdateParms &p, RE_Geometry *geo, bool needs_nml, bool needs_uv, bool needs_tangent, bool need_prim_vert_info, const GT_DataArrayHandle &point_norm)
 
virtual int setupSelection (RE_Render *r, const GR_DisplayOption *opt, GR_RenderFlags flags, bool supports_outline=false) const
 
virtual void cleanupSelection (RE_Render *r, int key) const
 Clean up selection uniforms; much be paired with a setupSelection(). More...
 
void updateWireColor (RE_Render *r, RE_Geometry *geo, const GR_DisplayOption *opt, int start_draw_idx, int num_draw_idx=1) const
 
- Protected Member Functions inherited from GR_GeoRender
GR_AttribMask hasAttribute (const GT_Primitive *prim, const char *name, GT_DataArrayHandle &h) const
 
GT_PrimitiveHandle getCachedGTPrimitive ()
 
void cacheGTPrimitive (GT_PrimitiveHandle &primh)
 
int getCurrentLayer () const
 
template<typename T >
GR_SelectMode addToPointSelection (const UT_Span< T > &out_select, const GU_Detail &geo, const GT_DataArrayHandle &vh, const GT_DataArrayHandle &vl, const GA_PointGroup *pntsel, bool use_vertex_for_point_select, bool &init)
 
GR_SelectMode addToVertexSelection (const UT_Span< uint8 > &out_select, const GU_Detail &geo, const GT_DataArrayHandle &vh, const GA_VertexGroup *vertsel, bool &init)
 
template<typename T >
GR_SelectMode addToEdgeSelection (const UT_Span< T > &out_select, const GU_Detail &geo, const GT_DataArrayHandle &vt, const GT_DataArrayHandle &vert_list, const GA_EdgeGroup *edgesel, bool &init)
 
GR_SelectMode addToPrimSelection (const UT_Span< uint8 > &out_select, const GT_DataArrayHandle &vh, const GA_PrimitiveGroup *primsel, bool &init)
 

Protected Attributes

RE_GeometrymyGeometry
 
- Protected Attributes inherited from GR_GeoRender
RenderType myRenderer
 
const GR_RenderInfomyInfo
 
GR_MaterialGroups myMatGroups
 
UT_BoundingBoxD myBounds
 
unsigned myBuildPointInfo: 1
 
unsigned myBuildPrimInfo: 1
 
unsigned myHasDetailPrimID: 1
 
unsigned myHasInstancedTransform: 1
 
unsigned myHasIdentityTransform: 1
 
unsigned myUseBoneDeform: 1
 
unsigned myNumBoneDeform: 2
 
unsigned myAllowGeoOverride: 1
 
UT_Matrix4D myPrimitiveTransform
 
GR_AttribMask mySelectionMask
 
GR_SelectMode myCurrentSelection
 
int myCurrentPointSelectInstance
 
int myMaterialOverride
 
int myConvexFlag
 
int myDetailPrimID
 
GR_PrimitivemyParentPrim
 
int myCurrentLayer
 

Additional Inherited Members

- Public Types inherited from GR_GeoRender
enum  RenderType { OPENGL, VULKAN }
 

Detailed Description

Definition at line 26 of file GR_GeoRenderGL.h.

Constructor & Destructor Documentation

GR_GeoRenderGL::GR_GeoRenderGL ( GR_Primitive parent_prim)
GR_GeoRenderGL::~GR_GeoRenderGL ( )
override

Member Function Documentation

virtual GR_SelectMode GR_GeoRenderGL::addToBreakpointSelection ( RE_Render r,
RE_VertexArray select,
int  bpnt_len,
const GA_BreakpointGroup bps,
bool &  init 
)
protectedvirtual
GR_SelectMode GR_GeoRenderGL::addToEdgeSelection ( RE_Render r,
RE_VertexArray select_array,
int  length,
const GU_Detail geo,
const GT_DataArrayHandle vt,
const GT_DataArrayHandle vert_list,
const GA_EdgeGroup edgesel,
bool &  init 
)
protected
GR_SelectMode GR_GeoRenderGL::addToPointSelection ( RE_Render r,
RE_VertexArray select_array,
int  length,
const GU_Detail geo,
const GT_DataArrayHandle vh,
const GT_DataArrayHandle vl,
const GA_PointGroup pntsel,
bool  use_vertex_for_point_select,
bool &  init 
)
protected
GR_SelectMode GR_GeoRenderGL::addToPrimSelection ( RE_Render r,
RE_VertexArray sel_array,
const GT_DataArrayHandle vh,
const GA_PrimitiveGroup primsel,
bool &  init 
)
protected
GR_SelectMode GR_GeoRenderGL::addToVertexSelection ( RE_Render r,
RE_VertexArray select_array,
int  length,
const GU_Detail geo,
const GT_DataArrayHandle vh,
const GA_VertexGroup vertsel,
bool &  init 
)
protected
GR_SelectMode GR_GeoRenderGL::buildInstanceSelection ( RE_Render r,
const GR_UpdateParms p,
RE_Geometry obj 
)
protected
void GR_GeoRenderGL::buildPointID ( RE_Render r,
const GT_Primitive prim,
const GU_ConstDetailHandle geo,
RE_CacheVersion  geo_version 
)
protected
void GR_GeoRenderGL::buildPrimitiveID ( RE_Render r,
const GT_Primitive primh,
const GU_ConstDetailHandle geo,
RE_CacheVersion  geo_version 
)
protected
GR_SelectMode GR_GeoRenderGL::buildSelection ( RE_Render r,
const GR_UpdateParms parms,
RE_Geometry obj,
const GT_PrimitiveHandle primh,
const GT_DataArrayHandle vertexlist 
)
protected
void GR_GeoRenderGL::cleanupGeoOverride ( RE_Render r,
const GR_DisplayOption opt,
RE_Geometry geo 
)
virtual void GR_GeoRenderGL::cleanupSelection ( RE_Render r,
int  key 
) const
protectedvirtual

Clean up selection uniforms; much be paired with a setupSelection().

RE_Geometry* GR_GeoRenderGL::createGeometry ( int  npoints = 0)
void GR_GeoRenderGL::fillAttributesGL3 ( RE_Render r,
const GT_Primitive prim,
const GR_UpdateParms p,
RE_Geometry geo,
bool  needs_nml,
bool  needs_uv,
bool  needs_tangent,
bool  need_prim_vert_info,
const GT_DataArrayHandle point_norm 
)
protected
static void GR_GeoRenderGL::fillGeoAttribs ( RE_Render r,
const GT_Primitive prim,
const GR_UpdateParms p,
RE_Geometry geo,
bool  needs_nml,
bool  needs_uv,
bool  needs_tangent,
bool  need_prim_vert_info,
const GT_DataArrayHandle point_norm,
GR_BasePrimType  packed_type,
bool  build_point_id,
bool  build_prim_id,
GR_GeoRenderGL geo_ren = nullptr,
bool *  has_detail_prim_id = nullptr,
int detail_prim_id = nullptr,
int num_bone_deform = nullptr 
)
static
static RE_VertexArray* GR_GeoRenderGL::getDirtyAttribArray ( RE_Render r,
RE_Geometry geo,
const char *  attrib_name,
const GT_DataArrayHandle h,
const GR_DisplayOption opts,
RE_ArrayType  atype,
RE_CacheVersion  attr_version 
)
static
RE_Geometry* GR_GeoRenderGL::getGeometry ( )
inlineoverridevirtual

Reimplemented from GR_GeoRender.

Definition at line 43 of file GR_GeoRenderGL.h.

void GR_GeoRenderGL::getPickConnectGroup ( unsigned int  pick_mode,
GR_PickGeometry  pick_geo,
int out_connect_start,
int out_connect_num 
)
overridevirtual

Reimplemented from GR_GeoRender.

void GR_GeoRenderGL::initLights ( RE_Render r,
RE_Shader sh,
GR_RenderMode  mode,
GR_RenderFlags  flags,
const GR_DisplayOption opt 
)
protected
void GR_GeoRenderGL::retireGeometry ( )
overridevirtual

Reimplemented from GR_GeoRender.

Reimplemented in GR_PolySurface.

void GR_GeoRenderGL::setupGeoOverride ( RE_Render r,
const GR_DisplayOption opt,
RE_Geometry geo,
UT_UniquePtr< RE_OverrideList > &  override_list 
)
virtual int GR_GeoRenderGL::setupSelection ( RE_Render r,
const GR_DisplayOption opt,
GR_RenderFlags  flags,
bool  supports_outline = false 
) const
protectedvirtual

Set selection uniforms SELECT_MODE and SELECT_INSTANCE. Returns an int which should be passed to cleanup selection.

virtual void GR_GeoRenderGL::updateInstanceGroupArray ( const RE_VertexArray array,
int  instance_group = -1,
const char *  attrib_name = NULL,
RE_GenericAttribID  id = RE_GENATTRIB_NONE 
)
virtual

add an array to, or update an array in, an instance group. If 'instance_group' is -1, RE_VertexArray must specify an instance group via setInstanceGroup().

void GR_GeoRenderGL::updateWireColor ( RE_Render r,
RE_Geometry geo,
const GR_DisplayOption opt,
int  start_draw_idx,
int  num_draw_idx = 1 
) const
protected

Member Data Documentation

RE_Geometry* GR_GeoRenderGL::myGeometry
protected

Definition at line 186 of file GR_GeoRenderGL.h.


The documentation for this class was generated from the following file: