38 class re_Connectivity;
39 class re_InstanceGroup;
41 #define RE_GEO_POINTS_IDX 0
42 #define RE_GEO_WIRE_IDX 2
43 #define RE_GEO_SHADED_IDX 4
45 #define RE_GEO_ALL_SHADED 0x40000000
56 bool use_buffer_object =
true);
63 int64 getMemoryUsage(
bool inclusive)
const;
70 void useBufferObjects(
bool use_buf =
true);
75 void useVertexState(
bool use_state =
true);
84 bool setNumPoints(
int num);
90 bool setNumVertices(
int num);
96 bool setNumPrimitives(
int num);
112 bool shrink_if_smaller,
134 void stashAttributes();
138 int clearStashedAttributes(
bool purge_from_cache);
144 RE_VertexArray *recallStashedVaryingAttribute(
const char *attrib_name);
147 RE_VertexArray *recallStashedConstAttribute(
const char *attrib_name);
154 bool hasStashedAttribute(
const char *
name);
162 const char *attrib_name,
169 const char *cache_prefix =
nullptr,
178 const char *attrib_name,
184 const char *cache_prefix
191 const char *attrib_name,
201 const char *attrib_name,
204 const void *default_value);
214 bool clearAttribute(
const char *
name,
215 bool purge_cache=
false);
220 bool clearAttributeByIndex(
int i,
221 bool purge_cache=
false);
228 int getAttributeIndex(
const char *
name)
const;
234 int getNumAttributes()
const;
257 const char *attrib_name,
264 const char *cache_prefix
268 const char *attrib_name,
272 RE_VertexArray *getAddressableAttribute(
const char *attrib_name)
const;
275 int getAddressableAttributeIndex(
const char *attrib_name)
279 void clearAddressableAttribute(
const char *attrib_name);
283 {
return myTextureAttributes.entries(); }
287 {
return myBufferTextures(index); }
290 {
return myTextureAttributes(index); }
307 bool cacheBuffers(
const char *
name);
313 bool isCaching()
const {
return myCacheName.isstring(); }
317 { myPurgeOnDelete = purge; }
334 const char *attrib_name,
338 bool create_if_missing =
false,
339 int random_array_size = -1,
342 const char *cache_prefix =
nullptr,
350 const char *attrib_name,
355 bool create_if_missing=
false,
358 const char *cache_prefix =
nullptr,
374 void createInstanceGroup(
int instance_group);
379 void removeInstanceGroup(
int instance_group);
382 bool hasInstanceGroup(
int instance_group)
const;
385 {
return myInstanceGroups.entries(); }
392 void setInstanceGroupNesting(
int instance_group,
394 void clearInstanceGroupNesting(
int instance_group);
403 int max_capacity = -1);
408 int instance_to_draw);
411 void setInstanceGroupDrawEverything(
RE_Render *
r,
414 void setInstanceGroupDrawNothing(
RE_Render *
r,
427 void setConstInstanceGroupTransform(
int instance_group,
429 bool remove_instanced_xform);
430 void setConstInstanceGroupTransform(
int instance_group,
432 bool remove_instanced_xform);
435 void copyConstInstanceGroupTransform(
int instance_group,
436 int src_instance_group);
458 const char *view_name
468 bool clearInstanceGroupAttrib(
int instance_group,
481 int getInstanceGroupCount(
int instance_group)
const;
485 const char *base_name,
514 int vertices_per_patch = 0);
525 int vertices_per_patch = 0);
535 const unsigned int *prims,
538 int vertices_per_patch = 0);
547 int vertices_per_patch = 0);
558 int getConnectNumElementArrays(
int connect_group);
564 bool hasConnectGroup(
int connect_group)
const;
566 bool hasNonEmptyConnectGroup(
int connect_group)
const;
570 int getMaxConnectGroup()
const;
574 bool removeConnectedPrims(
int connect_group);
577 void resetConnectedPrims();
583 bool assignMaterialToConnectivty(
RE_Render *
r,
601 void useAttribute(
int connect_group,
602 const char *
name,
bool enable);
606 void useAttribute(
int connect_group,
612 void useMaterialTextures(
bool enable =
true);
615 void setNumMaterialLayers(
int num);
637 drawPrivate(r, getConnect(connect_idx,
false),0,
638 prim_type, attrib_overrides, 0);
656 int connect_group_start,
int num_connect_groups,
659 const int *material_offset =
nullptr);
679 int connect_start,
int num_connect,
683 const int *material_offset =
nullptr);
699 const int *material_offset =
nullptr);
712 void enableArrays(
RE_Render *
r,
int connect_group,
714 void disableArrays(
RE_Render *
r,
int connect_group);
735 void print(std::ostream *out =
nullptr)
const;
738 void setDebugDraw(
bool dump_uniforms,
747 re_Connectivity *getConnect(
int group_idx,
748 bool create_if_none);
752 void clearBuffers(
bool connectivity_too =
true);
758 const char *attrib_name);
763 const char *attrib_name);
768 const char *attrib_name,
774 const char *cache_prefix);
781 bool privAttachAttribute(
RE_VertexArray *attrib,
bool show_errors);
786 const char *attrib_name,
794 const char *cache_prefix =
nullptr,
795 bool create_const_attrib =
false,
796 int array_capacity = -1);
799 const char *attrib_name,
804 bool create_if_missing,
808 const char *cache_prefix =
nullptr,
811 re_Connectivity *connect,
822 void privEnableArrays(
824 re_Connectivity *connect,
827 int instance_group = 0);
828 void privDisableArrays(
830 re_Connectivity *connect,
833 re_Connectivity *connect,
834 const char *attrib_name,
846 mutable int myAttribPIndex;
847 bool myUseVertexState;
848 bool myPurgeOnDelete;
849 int myVertexStateSerial;
852 int myNumMaterialLayers;
867 int myDebugDrawFlags;
869 friend class re_InstanceGroup;
875 myUseTextures = enable;
881 myNumMaterialLayers =
SYSclamp(num, 1, 32);
886 const char *attrib_name,
890 bool create_if_missing,
894 const char *cache_prefix,
897 return fetchCachedAttrib(r, attrib_name, data_format, vectorsize,
898 array_type, 0, create_if_missing,
899 array_size, cache_version, usage,
900 cache_prefix, capacity);
905 const char *attrib_name,
910 bool create_if_missing,
913 const char *cache_prefix,
916 return fetchCachedAttrib(r, attrib_name, data_format, vectorsize,
918 create_if_missing, array_size,
919 cache_version, usage, cache_prefix, capacity);
int getNumInstanceGroups() const
Create a new instance group. instance_group must be a positive int.
void useMaterialTextures(bool enable=true)
Enables or disables textures on materials when drawn.
GLsizei GLenum const void * indices
void purgeOnDelete(bool purge=true)
Remove all buffers from the cache when this geometry object is deleted.
void setNumMaterialLayers(int num)
Clamp the number of layers to draw with a multi-layer material.
A collection of vertex arrays defining a geometry object. This class acts as a wrapper around multipl...
void draw(RE_Render *r, int connect_idx, RE_PrimType prim_type=RE_PRIM_AS_IS, RE_OverrideList *attrib_overrides=nullptr)
GLboolean GLboolean GLboolean GLboolean a
const RE_VertexMap * getVertexMap() const
Return a vertex map representing the layout locations of the attributes.
GLuint GLsizei GLsizei * length
bool isCaching() const
Check if this geometry object is caching.
GLint GLint GLsizei GLint GLenum GLenum type
RE_Texture * getAddressableAttributeTexture(int index) const
Return the texture buffer object representing addressable attribute 'i'.
std::string OIIO_UTIL_API replace(string_view str, string_view pattern, string_view replacement, bool global=false)
UT_Vector3T< T > SYSclamp(const UT_Vector3T< T > &v, const UT_Vector3T< T > &min, const UT_Vector3T< T > &max)
RE_VertexArray * getAddressableAttributeByIndex(int index) const
Return the vertex arrayrepresenting addressable attribute 'i'.
GLint GLenum GLboolean GLsizei stride
#define UT_NON_COPYABLE(CLASS)
Define deleted copy constructor and assignment operator inside a class.
RE_VertexArray * findCachedInstancedAttrib(RE_Render *r, const char *attrib_name, RE_GPUType data_format, int vectorsize, int instance_step, int array_size, bool create_if_missing=false, const RE_CacheVersion *v=nullptr, RE_BufferUsageHint h=RE_BUFFER_WRITE_FREQUENT, const char *cache_prefix=nullptr, int capacity=-1)
Find an instanced attribute in the GL cache, possibly creating it. The instance_step parameter define...
GLuint const GLchar * name
OPENVDB_API void initialize()
Global registration of native Grid, Transform, Metadata and Point attribute types. Also initializes blosc (if enabled).
GLfloat GLfloat GLfloat GLfloat h
GLsizeiptr const void GLenum usage
int getNumVertices() const
Sets the number of elements in arrays declared as RE_ARRAY_VERTEX.
int getNumPoints() const
Number of points in the geometry. Number of points for the arrays declared as RE_ARRAY_POINT. This will clear the data in all point arrays and reset the connectivty.
int getNumAddressableAttributes() const
Return the number of addressable attributes.
const char * getCacheName() const
Return the base cache name.
Simple class for a mutli-integer cache tag.
RE_VertexArray * getAttribute(const char *name) const
Fetch an attribute by name.
FMT_INLINE void print(format_string< T...> fmt, T &&...args)
int getNumPrimitives() const
Sets the number of elements in arrays declared as RE_ARRAY_PRIMITIVE.
RE_VertexArray * findCachedAttrib(RE_Render *r, const char *attrib_name, RE_GPUType data_format, int vectorsize, RE_ArrayType array_type, bool create_if_missing=false, int random_array_size=-1, const RE_CacheVersion *cv=nullptr, RE_BufferUsageHint h=RE_BUFFER_WRITE_FREQUENT, const char *cache_prefix=nullptr, int capacity=-1)
Find an attribute or array in the GL cache, possibly creating it Returns the cached array...