Blender  V3.3
draw_cache.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2016 Blender Foundation. */
3 
8 #pragma once
9 
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
13 
14 struct GPUBatch;
15 struct GPUMaterial;
16 struct ModifierData;
17 struct Object;
18 struct PTCacheEdit;
19 struct ParticleSystem;
20 struct Volume;
21 struct VolumeGrid;
22 struct bGPDstroke;
23 struct bGPdata;
24 
28 typedef enum eDRWLevelOfDetail {
32 
33  DRW_LOD_MAX, /* Max number of level of detail */
35 
36 void DRW_shape_cache_free(void);
37 
38 /* 3D cursor */
39 struct GPUBatch *DRW_cache_cursor_get(bool crosshair_lines);
40 
41 /* Common Shapes */
43 /* Grid */
44 struct GPUBatch *DRW_cache_grid_get(void);
49 /* Just a regular quad with 4 vertices. */
50 struct GPUBatch *DRW_cache_quad_get(void);
51 /* Just a regular quad with 4 vertices - wires. */
53 struct GPUBatch *DRW_cache_cube_get(void);
55 
56 struct GPUBatch *DRW_cache_sphere_get(eDRWLevelOfDetail level_of_detail);
57 
58 /* Dummy VBOs */
59 
61 
62 /* Common Object */
63 
65 struct GPUBatch *DRW_cache_object_edge_detection_get(struct Object *ob, bool *r_is_manifold);
66 struct GPUBatch *DRW_cache_object_surface_get(struct Object *ob);
69  struct GPUMaterial **gpumat_array,
70  uint gpumat_array_len);
73 
78 
79 /* Empties */
83 struct GPUBatch *DRW_cache_circle_get(void);
89 
90 /* Force Field */
91 
95 
96 /* Screen-aligned circle. */
97 
101 
102 /* Screen-aligned dashed circle */
103 
105 
106 /* Lights */
107 
114 
115 /* Camera */
116 
121 struct GPUBatch *DRW_cache_camera_tria_get(void);
123 
124 /* Speaker */
125 
126 struct GPUBatch *DRW_cache_speaker_get(void);
127 
128 /* Probe */
129 
133 
134 /* Bones */
135 
138 struct GPUBatch *DRW_cache_bone_box_get(void);
142 struct GPUBatch *DRW_cache_bone_point_get(void);
144 struct GPUBatch *DRW_cache_bone_stick_get(void);
145 struct GPUBatch *DRW_cache_bone_arrows_get(void);
148 
149 /* Meshes */
150 
151 struct GPUBatch *DRW_cache_mesh_all_verts_get(struct Object *ob);
152 struct GPUBatch *DRW_cache_mesh_all_edges_get(struct Object *ob);
154 struct GPUBatch *DRW_cache_mesh_edge_detection_get(struct Object *ob, bool *r_is_manifold);
155 struct GPUBatch *DRW_cache_mesh_surface_get(struct Object *ob);
161  struct GPUMaterial **gpumat_array,
162  uint gpumat_array_len);
173 
174 /* Curve */
175 
176 struct GPUBatch *DRW_cache_curve_edge_wire_get(struct Object *ob);
177 
178 /* edit-mode */
179 
183 
184 /* Font */
185 
186 struct GPUBatch *DRW_cache_text_edge_wire_get(struct Object *ob);
187 
188 /* Surface */
189 
190 struct GPUBatch *DRW_cache_surf_edge_wire_get(struct Object *ob);
191 
192 /* Lattice */
193 
194 struct GPUBatch *DRW_cache_lattice_verts_get(struct Object *ob);
195 struct GPUBatch *DRW_cache_lattice_wire_get(struct Object *ob, bool use_weight);
197 
198 /* Particles */
199 
200 struct GPUBatch *DRW_cache_particles_get_hair(struct Object *object,
201  struct ParticleSystem *psys,
202  struct ModifierData *md);
203 struct GPUBatch *DRW_cache_particles_get_dots(struct Object *object, struct ParticleSystem *psys);
205  struct ParticleSystem *psys,
206  struct PTCacheEdit *edit,
207  bool use_weight);
209  struct ParticleSystem *psys,
210  struct PTCacheEdit *edit);
212  struct ParticleSystem *psys,
213  struct PTCacheEdit *edit);
215 
216 /* Metaball */
217 
218 struct GPUBatch *DRW_cache_mball_surface_get(struct Object *ob);
220  struct GPUMaterial **gpumat_array,
221  uint gpumat_array_len);
223 struct GPUBatch *DRW_cache_mball_edge_detection_get(struct Object *ob, bool *r_is_manifold);
224 
225 /* Curves */
226 
229  struct GPUMaterial **gpumat_array,
230  uint gpumat_array_len);
232 struct GPUBatch *DRW_cache_curves_edge_detection_get(struct Object *ob, bool *r_is_manifold);
233 
234 /* PointCloud */
235 
236 struct GPUBatch *DRW_cache_pointcloud_get_dots(struct Object *obj);
238 
239 /* Volume */
240 
241 typedef struct DRWVolumeGrid {
243 
244  /* Grid name. */
245  char *name;
246 
247  /* 3D texture. */
249 
250  /* Transform between 0..1 texture space and object space. */
251  float texture_to_object[4][4];
252  float object_to_texture[4][4];
253 
254  /* Transform from bounds to texture space. */
255  float object_to_bounds[4][4];
256  float bounds_to_texture[4][4];
258 
260  const struct VolumeGrid *grid);
263 
264 /* GPencil */
265 
266 struct GPUBatch *DRW_cache_gpencil_strokes_get(struct Object *ob, int cfra);
267 struct GPUBatch *DRW_cache_gpencil_fills_get(struct Object *ob, int cfra);
268 struct GPUBatch *DRW_cache_gpencil_edit_lines_get(struct Object *ob, int cfra);
269 struct GPUBatch *DRW_cache_gpencil_edit_points_get(struct Object *ob, int cfra);
270 struct GPUBatch *DRW_cache_gpencil_edit_curve_handles_get(struct Object *ob, int cfra);
271 struct GPUBatch *DRW_cache_gpencil_edit_curve_points_get(struct Object *ob, int cfra);
274 int DRW_gpencil_material_count_get(struct bGPdata *gpd);
275 
277 
282 void DRW_cache_gpencil_sbuffer_clear(struct Object *ob);
283 
284 #ifdef __cplusplus
285 }
286 #endif
unsigned int uint
Definition: BLI_sys_types.h:67
GPUBatch
Definition: GPU_batch.h:78
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
struct GPUTexture GPUTexture
Definition: GPU_texture.h:17
struct GPUVertBuf GPUVertBuf
struct GPUBatch ** DRW_cache_curves_surface_shaded_get(struct Object *ob, struct GPUMaterial **gpumat_array, uint gpumat_array_len)
struct GPUBatch * DRW_cache_object_loose_edges_get(struct Object *ob)
Definition: draw_cache.c:863
struct GPUBatch * DRW_cache_field_vortex_get(void)
Definition: draw_cache.c:1307
struct GPUBatch * DRW_cache_curves_edge_detection_get(struct Object *ob, bool *r_is_manifold)
struct GPUBatch * DRW_cache_bone_arrows_get(void)
Definition: draw_cache.c:2518
struct GPUBatch * DRW_cache_gpencil_strokes_get(struct Object *ob, int cfra)
struct GPUBatch * DRW_cache_mesh_surface_mesh_analysis_get(struct Object *ob)
Definition: draw_cache.c:2914
struct GPUBatch * DRW_cache_mesh_surface_edges_get(struct Object *ob)
Definition: draw_cache.c:2864
struct GPUBatch * DRW_cache_mesh_surface_get(struct Object *ob)
Definition: draw_cache.c:2858
struct GPUBatch * DRW_cache_mesh_surface_weights_get(struct Object *ob)
Definition: draw_cache.c:2902
struct GPUBatch * DRW_cache_object_edge_detection_get(struct Object *ob, bool *r_is_manifold)
Definition: draw_cache.c:812
struct GPUBatch * DRW_cache_empty_cylinder_get(void)
Definition: draw_cache.c:1131
struct GPUBatch * DRW_cache_camera_volume_wire_get(void)
Definition: draw_cache.c:2734
struct GPUBatch * DRW_cache_light_point_lines_get(void)
Definition: draw_cache.c:1496
struct GPUBatch ** DRW_cache_mball_surface_shaded_get(struct Object *ob, struct GPUMaterial **gpumat_array, uint gpumat_array_len)
Definition: draw_cache.c:2980
struct GPUBatch * DRW_cache_bone_box_wire_get(void)
Definition: draw_cache.c:2123
struct GPUBatch * DRW_cache_light_area_square_lines_get(void)
Definition: draw_cache.c:1659
struct GPUBatch * DRW_gpencil_dummy_buffer_get(void)
Definition: draw_cache.c:776
struct GPUBatch * DRW_cache_mball_face_wireframe_get(struct Object *ob)
Definition: draw_cache.c:2974
struct GPUBatch * DRW_cache_empty_capsule_body_get(void)
Definition: draw_cache.c:1172
struct GPUBatch * DRW_cache_curve_edge_normal_get(struct Object *ob)
Definition: draw_cache.c:2933
struct GPUBatch * DRW_cache_field_cone_limit_get(void)
Definition: draw_cache.c:1390
struct GPUBatch * DRW_cache_object_surface_get(struct Object *ob)
Definition: draw_cache.c:887
struct GPUBatch * DRW_cache_object_face_wireframe_get(struct Object *ob)
Definition: draw_cache.c:836
struct GPUBatch * DRW_cache_field_curve_get(void)
Definition: draw_cache.c:1336
struct GPUBatch * DRW_cache_camera_tria_wire_get(void)
Definition: draw_cache.c:2758
struct GPUBatch * DRW_cache_mesh_edge_detection_get(struct Object *ob, bool *r_is_manifold)
Definition: draw_cache.c:2852
struct GPUBatch * DRW_cache_volume_face_wireframe_get(struct Object *ob)
Definition: draw_cache.c:3075
struct GPUBatch * DRW_cache_curve_edge_overlay_get(struct Object *ob)
Definition: draw_cache.c:2940
struct GPUBatch * DRW_cache_mball_surface_get(struct Object *ob)
Definition: draw_cache.c:2962
struct GPUBatch * DRW_cache_camera_distances_get(void)
Definition: draw_cache.c:2802
struct bGPDstroke * DRW_cache_gpencil_sbuffer_stroke_data_get(struct Object *ob)
struct GPUBatch * DRW_cache_speaker_get(void)
Definition: draw_cache.c:1708
struct GPUBatch * DRW_cache_mball_edge_detection_get(struct Object *ob, bool *r_is_manifold)
Definition: draw_cache.c:2968
struct GPUBatch * DRW_cache_bone_dof_lines_get(void)
Definition: draw_cache.c:2637
struct GPUBatch * DRW_cache_bone_stick_get(void)
Definition: draw_cache.c:2375
struct GPUBatch * DRW_cache_bone_octahedral_wire_get(void)
Definition: draw_cache.c:2065
struct GPUBatch * DRW_cache_gpencil_face_wireframe_get(struct Object *ob)
struct GPUBatch * DRW_cache_bone_point_get(void)
Definition: draw_cache.c:2252
struct GPUBatch * DRW_cache_surf_edge_wire_get(struct Object *ob)
Definition: draw_cache.c:3008
struct GPUBatch * DRW_cache_bone_dof_sphere_get(void)
Definition: draw_cache.c:2584
struct GPUBatch * DRW_cache_bone_point_wire_outline_get(void)
Definition: draw_cache.c:2327
struct GPUBatch * DRW_cache_cursor_get(bool crosshair_lines)
Definition: draw_cache.c:3198
struct GPUBatch * DRW_cache_mesh_all_verts_get(struct Object *ob)
Definition: draw_cache.c:2834
struct GPUBatch ** DRW_cache_object_surface_material_get(struct Object *ob, struct GPUMaterial **gpumat_array, uint gpumat_array_len)
Definition: draw_cache.c:971
eDRWLevelOfDetail
Definition: draw_cache.h:28
@ DRW_LOD_MEDIUM
Definition: draw_cache.h:30
@ DRW_LOD_LOW
Definition: draw_cache.h:29
@ DRW_LOD_HIGH
Definition: draw_cache.h:31
@ DRW_LOD_MAX
Definition: draw_cache.h:33
struct GPUBatch * DRW_cache_field_sphere_limit_get(void)
Definition: draw_cache.c:1424
struct GPUBatch * DRW_cache_lightprobe_cube_get(void)
Definition: draw_cache.c:1773
struct GPUBatch * DRW_cache_lattice_vert_overlay_get(struct Object *ob)
Definition: draw_cache.c:3043
struct GPUBatch ** DRW_cache_mesh_surface_texpaint_get(struct Object *ob)
Definition: draw_cache.c:2878
struct GPUBatch * DRW_cache_grid_get(void)
Definition: draw_cache.c:429
struct GPUBatch * DRW_cache_volume_selection_surface_get(struct Object *ob)
Definition: draw_cache.c:3081
struct GPUBatch * DRW_cache_object_all_edges_get(struct Object *ob)
Definition: draw_cache.c:800
struct GPUBatch * DRW_cache_empty_cone_get(void)
Definition: draw_cache.c:1092
struct GPUBatch * DRW_cache_groundline_get(void)
Definition: draw_cache.c:1475
struct GPUBatch * DRW_cache_lattice_verts_get(struct Object *ob)
Definition: draw_cache.c:3021
struct GPUBatch * DRW_cache_mesh_face_wireframe_get(struct Object *ob)
Definition: draw_cache.c:2908
struct GPUVertBuf * DRW_cache_object_pos_vertbuf_get(struct Object *ob)
Definition: draw_cache.c:911
struct GPUBatch * DRW_cache_curves_surface_get(struct Object *ob)
struct GPUBatch * DRW_cache_particles_get_hair(struct Object *object, struct ParticleSystem *psys, struct ModifierData *md)
Definition: draw_cache.c:3093
struct GPUBatch * DRW_cache_gpencil_sbuffer_fill_get(struct Object *ob)
struct GPUBatch * DRW_cache_particles_get_edit_strands(struct Object *object, struct ParticleSystem *psys, struct PTCacheEdit *edit, bool use_weight)
Definition: draw_cache.c:3103
struct GPUBatch * DRW_cache_sphere_get(eDRWLevelOfDetail level_of_detail)
Definition: draw_cache.c:482
struct GPUBatch * DRW_cache_circle_get(void)
Definition: draw_cache.c:728
struct GPUBatch * DRW_cache_mesh_loose_edges_get(struct Object *ob)
Definition: draw_cache.c:2846
struct GPUBatch * DRW_cache_bone_octahedral_get(void)
Definition: draw_cache.c:2029
struct GPUBatch * DRW_cache_normal_arrow_get(void)
Definition: draw_cache.c:751
struct GPUBatch * DRW_cache_gpencil_edit_lines_get(struct Object *ob, int cfra)
struct GPUBatch * DRW_cache_quad_get(void)
Definition: draw_cache.c:389
struct GPUBatch * DRW_cache_particles_get_prim(int type)
Definition: draw_cache.c:3125
struct GPUBatch * DRW_cache_empty_capsule_cap_get(void)
Definition: draw_cache.c:1205
struct GPUBatch * DRW_cache_lattice_wire_get(struct Object *ob, bool use_weight)
Definition: draw_cache.c:3029
struct GPUBatch * DRW_cache_curves_face_wireframe_get(struct Object *ob)
struct GPUBatch * DRW_cache_fullscreen_quad_get(void)
Definition: draw_cache.c:356
struct GPUBatch * DRW_cache_single_arrow_get(void)
Definition: draw_cache.c:1045
void DRW_shape_cache_free(void)
Definition: draw_cache.c:153
struct DRWVolumeGrid DRWVolumeGrid
struct GPUBatch * DRW_cache_lightprobe_grid_get(void)
Definition: draw_cache.c:1827
struct GPUBatch * DRW_cache_gpencil_edit_curve_points_get(struct Object *ob, int cfra)
struct GPUBatch * DRW_cache_mesh_surface_vertpaint_get(struct Object *ob)
Definition: draw_cache.c:2890
struct GPUBatch * DRW_cache_quad_wires_get(void)
Definition: draw_cache.c:409
struct GPUBatch ** DRW_cache_mesh_surface_shaded_get(struct Object *ob, struct GPUMaterial **gpumat_array, uint gpumat_array_len)
Definition: draw_cache.c:2870
struct GPUBatch * DRW_cache_gpencil_edit_curve_handles_get(struct Object *ob, int cfra)
struct GPUBatch * DRW_cache_curve_edge_wire_get(struct Object *ob)
Definition: draw_cache.c:2926
struct GPUBatch * DRW_cache_empty_sphere_get(void)
Definition: draw_cache.c:1083
struct GPUBatch * DRW_cache_particles_get_edit_inner_points(struct Object *object, struct ParticleSystem *psys, struct PTCacheEdit *edit)
Definition: draw_cache.c:3111
DRWVolumeGrid * DRW_volume_batch_cache_get_grid(struct Volume *volume, const struct VolumeGrid *grid)
struct GPUBatch * DRW_cache_camera_tria_get(void)
Definition: draw_cache.c:2782
struct GPUBatch * DRW_cache_light_area_disk_lines_get(void)
Definition: draw_cache.c:1627
struct GPUBatch * DRW_cache_bone_envelope_outline_get(void)
Definition: draw_cache.c:2207
struct GPUBatch * DRW_cache_empty_cube_get(void)
Definition: draw_cache.c:1025
int DRW_gpencil_material_count_get(struct bGPdata *gpd)
struct GPUBatch * DRW_cache_gpencil_fills_get(struct Object *ob, int cfra)
struct GPUBatch * DRW_cache_light_spot_volume_get(void)
Definition: draw_cache.c:1600
struct GPUBatch * DRW_cache_light_sun_lines_get(void)
Definition: draw_cache.c:1520
struct GPUBatch * DRW_cache_bone_envelope_solid_get(void)
Definition: draw_cache.c:2157
struct GPUBatch * DRW_cache_mesh_surface_texpaint_single_get(struct Object *ob)
Definition: draw_cache.c:2884
struct GPUBatch * DRW_cache_camera_volume_get(void)
Definition: draw_cache.c:2709
struct GPUBatch * DRW_cache_pointcloud_surface_get(struct Object *obj)
Definition: draw_cache.c:3063
struct GPUBatch * DRW_cache_particles_get_dots(struct Object *object, struct ParticleSystem *psys)
Definition: draw_cache.c:3098
struct GPUBatch * DRW_cache_lightprobe_planar_get(void)
Definition: draw_cache.c:1889
struct GPUBatch * DRW_cache_pointcloud_get_dots(struct Object *obj)
Definition: draw_cache.c:3057
struct GPUBatch * DRW_cache_cube_get(void)
Definition: draw_cache.c:695
int DRW_cache_object_material_count_get(struct Object *ob)
Definition: draw_cache.c:936
struct GPUBatch * DRW_cache_gpencil_edit_points_get(struct Object *ob, int cfra)
struct GPUBatch * DRW_cache_particles_get_edit_tip_points(struct Object *object, struct ParticleSystem *psys, struct PTCacheEdit *edit)
Definition: draw_cache.c:3118
struct GPUBatch * DRW_cache_mesh_surface_sculptcolors_get(struct Object *ob)
Definition: draw_cache.c:2896
void DRW_cache_gpencil_sbuffer_clear(struct Object *ob)
struct GPUBatch * DRW_cache_text_edge_wire_get(struct Object *ob)
Definition: draw_cache.c:2995
struct GPUBatch * DRW_cache_curve_vert_overlay_get(struct Object *ob)
Definition: draw_cache.c:2948
struct GPUBatch * DRW_cache_field_wind_get(void)
Definition: draw_cache.c:1261
struct GPUBatch * DRW_cache_mesh_all_edges_get(struct Object *ob)
Definition: draw_cache.c:2840
struct GPUBatch * DRW_cache_plain_axes_get(void)
Definition: draw_cache.c:1003
struct GPUBatch * DRW_cache_bone_box_get(void)
Definition: draw_cache.c:2090
struct GPUBatch * DRW_cache_camera_frame_get(void)
Definition: draw_cache.c:2677
struct GPUBatch * DRW_cache_field_tube_limit_get(void)
Definition: draw_cache.c:1356
struct GPUBatch * DRW_cache_gpencil_sbuffer_stroke_get(struct Object *ob)
struct GPUBatch * DRW_cache_field_force_get(void)
Definition: draw_cache.c:1284
struct GPUBatch * DRW_cache_light_spot_lines_get(void)
Definition: draw_cache.c:1554
float texture_to_object[4][4]
Definition: draw_cache.h:251
float bounds_to_texture[4][4]
Definition: draw_cache.h:256
struct DRWVolumeGrid * prev
Definition: draw_cache.h:242
float object_to_bounds[4][4]
Definition: draw_cache.h:255
struct DRWVolumeGrid * next
Definition: draw_cache.h:242
struct GPUTexture * texture
Definition: draw_cache.h:248
float object_to_texture[4][4]
Definition: draw_cache.h:252