Blender  V3.3
Classes | Functions
draw_subdivision.h File Reference
#include "BLI_sys_types.h"

Go to the source code of this file.

Classes

struct  DRWPatchMap
 
struct  DRWSubdivLooseEdge
 
struct  DRWSubdivLooseVertex
 
struct  DRWSubdivLooseGeom
 
struct  DRWSubdivCache
 

Typedefs

DRWPatchMap

This is a GPU version of the OpenSubDiv PatchMap. The quad tree and the patch handles are copied to GPU buffers in order to lookup the right patch for a given set of patch coordinates.

typedef struct DRWPatchMap DRWPatchMap
 
DRWSubdivLooseEdge

This stores information about a subdivided loose edge.

typedef struct DRWSubdivLooseEdge DRWSubdivLooseEdge
 
DRWSubdivLooseVertex

This stores information about a subdivided loose vertex, that may or may not come from a loose edge.

typedef struct DRWSubdivLooseVertex DRWSubdivLooseVertex
 
DRWSubdivLooseGeom

This stores the subdivided vertices and edges of loose geometry from MeshExtractLooseGeom.

typedef struct DRWSubdivLooseGeom DRWSubdivLooseGeom
 

Functions

void DRW_create_subdivision (struct Object *ob, struct Mesh *mesh, struct MeshBatchCache *batch_cache, struct MeshBufferCache *mbc, const bool is_editmode, const bool is_paint_mode, const bool is_mode_active, const float obmat[4][4], const bool do_final, const bool do_uvedit, const bool do_cage, const ToolSettings *ts, const bool use_hide)
 
void DRW_subdivide_loose_geom (DRWSubdivCache *subdiv_cache, struct MeshBufferCache *cache)
 
void DRW_subdiv_cache_free (struct Subdiv *subdiv)
 
void draw_subdiv_init_mesh_render_data (DRWSubdivCache *cache, struct MeshRenderData *mr, const struct ToolSettings *toolsettings)
 
void draw_subdiv_init_origindex_buffer (struct GPUVertBuf *buffer, int32_t *vert_origindex, uint num_loops, uint loose_len)
 
struct GPUVertBufdraw_subdiv_build_origindex_buffer (int *vert_origindex, uint num_loops)
 
void draw_subdiv_build_sculpt_data_buffer (const DRWSubdivCache *cache, struct GPUVertBuf *mask_vbo, struct GPUVertBuf *face_set_vbo, struct GPUVertBuf *sculpt_data)
 
void draw_subdiv_accumulate_normals (const DRWSubdivCache *cache, struct GPUVertBuf *pos_nor, struct GPUVertBuf *face_adjacency_offsets, struct GPUVertBuf *face_adjacency_lists, struct GPUVertBuf *vertex_loop_map, struct GPUVertBuf *vertex_normals)
 
void draw_subdiv_finalize_normals (const DRWSubdivCache *cache, struct GPUVertBuf *vertex_normals, struct GPUVertBuf *subdiv_loop_subdiv_vert_index, struct GPUVertBuf *pos_nor)
 
void draw_subdiv_finalize_custom_normals (const DRWSubdivCache *cache, GPUVertBuf *src_custom_normals, GPUVertBuf *pos_nor)
 
void draw_subdiv_extract_pos_nor (const DRWSubdivCache *cache, struct GPUVertBuf *pos_nor, struct GPUVertBuf *orco)
 
void draw_subdiv_interp_custom_data (const DRWSubdivCache *cache, struct GPUVertBuf *src_data, struct GPUVertBuf *dst_data, int dimensions, int dst_offset, bool compress_to_u16)
 
void draw_subdiv_extract_uvs (const DRWSubdivCache *cache, struct GPUVertBuf *uvs, int face_varying_channel, int dst_offset)
 
void draw_subdiv_build_edge_fac_buffer (const DRWSubdivCache *cache, struct GPUVertBuf *pos_nor, struct GPUVertBuf *edge_idx, struct GPUVertBuf *edge_fac)
 
void draw_subdiv_build_tris_buffer (const DRWSubdivCache *cache, struct GPUIndexBuf *subdiv_tris, int material_count)
 
void draw_subdiv_build_lines_buffer (const DRWSubdivCache *cache, struct GPUIndexBuf *lines_indices)
 
void draw_subdiv_build_lines_loose_buffer (const DRWSubdivCache *cache, struct GPUIndexBuf *lines_indices, GPUVertBuf *lines_flags, uint num_loose_edges)
 
void draw_subdiv_build_fdots_buffers (const DRWSubdivCache *cache, struct GPUVertBuf *fdots_pos, struct GPUVertBuf *fdots_nor, struct GPUIndexBuf *fdots_indices)
 
void draw_subdiv_build_lnor_buffer (const DRWSubdivCache *cache, struct GPUVertBuf *pos_nor, struct GPUVertBuf *lnor)
 
void draw_subdiv_build_edituv_stretch_area_buffer (const DRWSubdivCache *cache, struct GPUVertBuf *coarse_data, struct GPUVertBuf *subdiv_data)
 
void draw_subdiv_build_edituv_stretch_angle_buffer (const DRWSubdivCache *cache, struct GPUVertBuf *pos_nor, struct GPUVertBuf *uvs, int uvs_offset, struct GPUVertBuf *stretch_angles)
 
struct GPUVertFormatdraw_subdiv_get_pos_nor_format (void)
 

DRWSubdivCache

This holds the various buffers used to evaluate and render subdivision through OpenGL.

typedef struct DRWSubdivCache DRWSubdivCache
 
void draw_subdiv_cache_free (DRWSubdivCache *cache)
 

Typedef Documentation

◆ DRWPatchMap

typedef struct DRWPatchMap DRWPatchMap

◆ DRWSubdivCache

◆ DRWSubdivLooseEdge

◆ DRWSubdivLooseGeom

◆ DRWSubdivLooseVertex

Function Documentation

◆ draw_subdiv_accumulate_normals()

void draw_subdiv_accumulate_normals ( const DRWSubdivCache cache,
struct GPUVertBuf pos_nor,
struct GPUVertBuf face_adjacency_offsets,
struct GPUVertBuf face_adjacency_lists,
struct GPUVertBuf vertex_loop_map,
struct GPUVertBuf vertex_normals 
)

◆ draw_subdiv_build_edge_fac_buffer()

void draw_subdiv_build_edge_fac_buffer ( const DRWSubdivCache cache,
struct GPUVertBuf pos_nor,
struct GPUVertBuf edge_idx,
struct GPUVertBuf edge_fac 
)

◆ draw_subdiv_build_edituv_stretch_angle_buffer()

void draw_subdiv_build_edituv_stretch_angle_buffer ( const DRWSubdivCache cache,
struct GPUVertBuf pos_nor,
struct GPUVertBuf uvs,
int  uvs_offset,
struct GPUVertBuf stretch_angles 
)

◆ draw_subdiv_build_edituv_stretch_area_buffer()

void draw_subdiv_build_edituv_stretch_area_buffer ( const DRWSubdivCache cache,
struct GPUVertBuf coarse_data,
struct GPUVertBuf subdiv_data 
)

◆ draw_subdiv_build_fdots_buffers()

void draw_subdiv_build_fdots_buffers ( const DRWSubdivCache cache,
struct GPUVertBuf fdots_pos,
struct GPUVertBuf fdots_nor,
struct GPUIndexBuf fdots_indices 
)

◆ draw_subdiv_build_lines_buffer()

void draw_subdiv_build_lines_buffer ( const DRWSubdivCache cache,
struct GPUIndexBuf lines_indices 
)

◆ draw_subdiv_build_lines_loose_buffer()

void draw_subdiv_build_lines_loose_buffer ( const DRWSubdivCache cache,
struct GPUIndexBuf lines_indices,
GPUVertBuf lines_flags,
uint  num_loose_edges 
)

◆ draw_subdiv_build_lnor_buffer()

void draw_subdiv_build_lnor_buffer ( const DRWSubdivCache cache,
struct GPUVertBuf pos_nor,
struct GPUVertBuf lnor 
)

◆ draw_subdiv_build_origindex_buffer()

struct GPUVertBuf* draw_subdiv_build_origindex_buffer ( int *  vert_origindex,
uint  num_loops 
)

◆ draw_subdiv_build_sculpt_data_buffer()

void draw_subdiv_build_sculpt_data_buffer ( const DRWSubdivCache cache,
struct GPUVertBuf mask_vbo,
struct GPUVertBuf face_set_vbo,
struct GPUVertBuf sculpt_data 
)

◆ draw_subdiv_build_tris_buffer()

void draw_subdiv_build_tris_buffer ( const DRWSubdivCache cache,
struct GPUIndexBuf subdiv_tris,
int  material_count 
)

◆ draw_subdiv_cache_free()

void draw_subdiv_cache_free ( DRWSubdivCache cache)

◆ draw_subdiv_extract_pos_nor()

void draw_subdiv_extract_pos_nor ( const DRWSubdivCache cache,
struct GPUVertBuf pos_nor,
struct GPUVertBuf orco 
)

◆ draw_subdiv_extract_uvs()

void draw_subdiv_extract_uvs ( const DRWSubdivCache cache,
struct GPUVertBuf uvs,
int  face_varying_channel,
int  dst_offset 
)

◆ draw_subdiv_finalize_custom_normals()

void draw_subdiv_finalize_custom_normals ( const DRWSubdivCache cache,
GPUVertBuf src_custom_normals,
GPUVertBuf pos_nor 
)

◆ draw_subdiv_finalize_normals()

void draw_subdiv_finalize_normals ( const DRWSubdivCache cache,
struct GPUVertBuf vertex_normals,
struct GPUVertBuf subdiv_loop_subdiv_vert_index,
struct GPUVertBuf pos_nor 
)

◆ draw_subdiv_get_pos_nor_format()

struct GPUVertFormat* draw_subdiv_get_pos_nor_format ( void  )

◆ draw_subdiv_init_mesh_render_data()

void draw_subdiv_init_mesh_render_data ( DRWSubdivCache cache,
struct MeshRenderData mr,
const struct ToolSettings toolsettings 
)

◆ draw_subdiv_init_origindex_buffer()

void draw_subdiv_init_origindex_buffer ( struct GPUVertBuf buffer,
int32_t vert_origindex,
uint  num_loops,
uint  loose_len 
)

◆ draw_subdiv_interp_custom_data()

void draw_subdiv_interp_custom_data ( const DRWSubdivCache cache,
struct GPUVertBuf src_data,
struct GPUVertBuf dst_data,
int  dimensions,
int  dst_offset,
bool  compress_to_u16 
)

◆ DRW_create_subdivision()

void DRW_create_subdivision ( struct Object ob,
struct Mesh mesh,
struct MeshBatchCache batch_cache,
struct MeshBufferCache mbc,
const bool  is_editmode,
const bool  is_paint_mode,
const bool  is_mode_active,
const float  obmat[4][4],
const bool  do_final,
const bool  do_uvedit,
const bool  do_cage,
const ToolSettings ts,
const bool  use_hide 
)

◆ DRW_subdiv_cache_free()

void DRW_subdiv_cache_free ( struct Subdiv subdiv)

◆ DRW_subdivide_loose_geom()

void DRW_subdivide_loose_geom ( DRWSubdivCache subdiv_cache,
struct MeshBufferCache cache 
)