1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * Copyright 2019, Blender Foundation.
17  */
18 
19 /** \file
20  * \ingroup DNA
21  */
22 
23 #pragma once
24 
25 #include "DRW_render.h"
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
31 #ifdef __APPLE__
32 #  define USE_GEOM_SHADER_WORKAROUND 1
33 #else
34 #  define USE_GEOM_SHADER_WORKAROUND 0
35 #endif
36 
37 /* Needed for eSpaceImage_UVDT_Stretch */
38 #include "DNA_space_types.h"
39 
40 /* Forward declarations */
41 struct ImBuf;
42 
43 typedef struct OVERLAY_FramebufferList {
44   struct GPUFrameBuffer *overlay_default_fb;
45   struct GPUFrameBuffer *overlay_line_fb;
46   struct GPUFrameBuffer *overlay_color_only_fb;
47   struct GPUFrameBuffer *overlay_in_front_fb;
48   struct GPUFrameBuffer *overlay_line_in_front_fb;
49   struct GPUFrameBuffer *outlines_prepass_fb;
50   struct GPUFrameBuffer *outlines_resolve_fb;
51 } OVERLAY_FramebufferList;
52 
53 typedef struct OVERLAY_TextureList {
54   struct GPUTexture *temp_depth_tx;
55   struct GPUTexture *dummy_depth_tx;
56   struct GPUTexture *outlines_id_tx;
57   struct GPUTexture *overlay_color_tx;
58   struct GPUTexture *overlay_line_tx;
59 } OVERLAY_TextureList;
60 
61 #define NOT_IN_FRONT 0
62 #define IN_FRONT 1
63 
64 typedef enum OVERLAY_UVLineStyle {
65   OVERLAY_UV_LINE_STYLE_OUTLINE = 0,
66   OVERLAY_UV_LINE_STYLE_DASH = 1,
67   OVERLAY_UV_LINE_STYLE_BLACK = 2,
68   OVERLAY_UV_LINE_STYLE_WHITE = 3,
69   OVERLAY_UV_LINE_STYLE_SHADOW = 4,
70 } OVERLAY_UVLineStyle;
71 
72 typedef struct OVERLAY_PassList {
73   DRWPass *antialiasing_ps;
74   DRWPass *armature_ps[2];
75   DRWPass *armature_bone_select_ps;
76   DRWPass *armature_transp_ps[2];
77   DRWPass *background_ps;
78   DRWPass *clipping_frustum_ps;
79   DRWPass *edit_curve_wire_ps[2];
80   DRWPass *edit_curve_handle_ps;
81   DRWPass *edit_gpencil_ps;
82   DRWPass *edit_gpencil_gizmos_ps;
83   DRWPass *edit_lattice_ps;
84   DRWPass *edit_mesh_depth_ps[2];
85   DRWPass *edit_mesh_verts_ps[2];
86   DRWPass *edit_mesh_edges_ps[2];
87   DRWPass *edit_mesh_faces_ps[2];
88   DRWPass *edit_mesh_faces_cage_ps[2];
89   DRWPass *edit_mesh_analysis_ps;
90   DRWPass *edit_mesh_normals_ps;
91   DRWPass *edit_particle_ps;
92   DRWPass *edit_text_overlay_ps;
93   DRWPass *edit_text_darken_ps;
94   DRWPass *edit_text_wire_ps[2];
95   DRWPass *edit_uv_edges_ps;
96   DRWPass *edit_uv_verts_ps;
97   DRWPass *edit_uv_faces_ps;
98   DRWPass *edit_uv_stretching_ps;
99   DRWPass *edit_uv_tiled_image_borders_ps;
100   DRWPass *edit_uv_stencil_ps;
101   DRWPass *extra_ps[2];
102   DRWPass *extra_blend_ps;
103   DRWPass *extra_centers_ps;
104   DRWPass *extra_grid_ps;
105   DRWPass *gpencil_canvas_ps;
106   DRWPass *facing_ps[2];
107   DRWPass *fade_ps[2];
108   DRWPass *grid_ps;
109   DRWPass *image_background_ps;
110   DRWPass *image_background_scene_ps;
111   DRWPass *image_empties_ps;
112   DRWPass *image_empties_back_ps;
113   DRWPass *image_empties_blend_ps;
114   DRWPass *image_empties_front_ps;
115   DRWPass *image_foreground_ps;
116   DRWPass *image_foreground_scene_ps;
117   DRWPass *metaball_ps[2];
118   DRWPass *motion_paths_ps;
119   DRWPass *outlines_prepass_ps;
120   DRWPass *outlines_detect_ps;
121   DRWPass *outlines_resolve_ps;
122   DRWPass *paint_color_ps;
123   DRWPass *paint_depth_ps;
124   DRWPass *paint_overlay_ps;
125   DRWPass *particle_ps;
126   DRWPass *pointcloud_ps;
127   DRWPass *sculpt_mask_ps;
128   DRWPass *volume_ps;
129   DRWPass *wireframe_ps;
130   DRWPass *wireframe_xray_ps;
131   DRWPass *xray_fade_ps;
132 } OVERLAY_PassList;
133 
134 /* Data used by GLSL shader. To be used as UBO. */
135 typedef struct OVERLAY_ShadingData {
136   /** Grid */
137   float grid_axes[3], grid_distance;
138   float zplane_axes[3], grid_size[3];
139   float grid_steps[8];
140   float inv_viewport_size[2];
141   float grid_line_size;
142   int grid_flag;
143   int zpos_flag;
144   int zneg_flag;
145   /** Wireframe */
146   float wire_step_param;
147   /** Edit Curve */
148   float edit_curve_normal_length;
149   /** Edit Mesh */
150   int data_mask[4];
151 } OVERLAY_ShadingData;
152 
153 typedef struct OVERLAY_ExtraCallBuffers {
154   DRWCallBuffer *camera_frame;
155   DRWCallBuffer *camera_tria[2];
156   DRWCallBuffer *camera_distances;
157   DRWCallBuffer *camera_volume;
158   DRWCallBuffer *camera_volume_frame;
159 
160   DRWCallBuffer *center_active;
161   DRWCallBuffer *center_selected;
162   DRWCallBuffer *center_deselected;
163   DRWCallBuffer *center_selected_lib;
164   DRWCallBuffer *center_deselected_lib;
165 
166   DRWCallBuffer *empty_axes;
167   DRWCallBuffer *empty_capsule_body;
168   DRWCallBuffer *empty_capsule_cap;
169   DRWCallBuffer *empty_circle;
170   DRWCallBuffer *empty_cone;
171   DRWCallBuffer *empty_cube;
172   DRWCallBuffer *empty_cylinder;
173   DRWCallBuffer *empty_image_frame;
174   DRWCallBuffer *empty_plain_axes;
175   DRWCallBuffer *empty_single_arrow;
176   DRWCallBuffer *empty_sphere;
177   DRWCallBuffer *empty_sphere_solid;
178 
179   DRWCallBuffer *extra_dashed_lines;
180   DRWCallBuffer *extra_lines;
181   DRWCallBuffer *extra_points;
182 
183   DRWCallBuffer *field_curve;
184   DRWCallBuffer *field_force;
185   DRWCallBuffer *field_vortex;
186   DRWCallBuffer *field_wind;
187   DRWCallBuffer *field_cone_limit;
188   DRWCallBuffer *field_sphere_limit;
189   DRWCallBuffer *field_tube_limit;
190 
191   DRWCallBuffer *groundline;
192 
193   DRWCallBuffer *light_point;
194   DRWCallBuffer *light_sun;
195   DRWCallBuffer *light_spot;
196   DRWCallBuffer *light_spot_cone_back;
197   DRWCallBuffer *light_spot_cone_front;
198   DRWCallBuffer *light_area[2];
199 
200   DRWCallBuffer *origin_xform;
201 
202   DRWCallBuffer *probe_planar;
203   DRWCallBuffer *probe_cube;
204   DRWCallBuffer *probe_grid;
205 
206   DRWCallBuffer *solid_quad;
207 
208   DRWCallBuffer *speaker;
209 
210   DRWShadingGroup *extra_wire;
211   DRWShadingGroup *extra_loose_points;
212 } OVERLAY_ExtraCallBuffers;
213 
214 typedef struct OVERLAY_ArmatureCallBuffers {
215   DRWCallBuffer *box_outline;
216   DRWCallBuffer *box_solid;
217   DRWCallBuffer *box_transp;
218 
219   DRWCallBuffer *dof_lines;
220   DRWCallBuffer *dof_sphere;
221 
222   DRWCallBuffer *envelope_distance;
223   DRWCallBuffer *envelope_outline;
224   DRWCallBuffer *envelope_solid;
225   DRWCallBuffer *envelope_transp;
226 
227   DRWCallBuffer *octa_outline;
228   DRWCallBuffer *octa_solid;
229   DRWCallBuffer *octa_transp;
230 
231   DRWCallBuffer *point_outline;
232   DRWCallBuffer *point_solid;
233   DRWCallBuffer *point_transp;
234 
235   DRWCallBuffer *stick;
236 
237   DRWCallBuffer *wire;
238 
239   DRWShadingGroup *custom_outline;
240   DRWShadingGroup *custom_solid;
241   DRWShadingGroup *custom_transp;
242   DRWShadingGroup *custom_wire;
243   GHash *custom_shapes_transp_ghash;
244   GHash *custom_shapes_ghash;
245 } OVERLAY_ArmatureCallBuffers;
246 
247 typedef struct OVERLAY_PrivateData {
248   DRWShadingGroup *armature_bone_select_act_grp;
249   DRWShadingGroup *armature_bone_select_grp;
250   DRWShadingGroup *edit_curve_normal_grp[2];
251   DRWShadingGroup *edit_curve_wire_grp[2];
252   DRWShadingGroup *edit_curve_handle_grp;
253   DRWShadingGroup *edit_curve_points_grp;
254   DRWShadingGroup *edit_lattice_points_grp;
255   DRWShadingGroup *edit_lattice_wires_grp;
256   DRWShadingGroup *edit_gpencil_points_grp;
257   DRWShadingGroup *edit_gpencil_wires_grp;
258   DRWShadingGroup *edit_mesh_depth_grp[2];
259   DRWShadingGroup *edit_mesh_faces_grp[2];
260   DRWShadingGroup *edit_mesh_faces_cage_grp[2];
261   DRWShadingGroup *edit_mesh_verts_grp[2];
262   DRWShadingGroup *edit_mesh_edges_grp[2];
263   DRWShadingGroup *edit_mesh_facedots_grp[2];
264   DRWShadingGroup *edit_mesh_skin_roots_grp[2];
265   DRWShadingGroup *edit_mesh_normals_grp;
266   DRWShadingGroup *edit_mesh_analysis_grp;
267   DRWShadingGroup *edit_particle_strand_grp;
268   DRWShadingGroup *edit_particle_point_grp;
269   DRWShadingGroup *edit_text_overlay_grp;
270   DRWShadingGroup *edit_text_wire_grp[2];
271   DRWShadingGroup *edit_uv_verts_grp;
272   DRWShadingGroup *edit_uv_edges_grp;
273   DRWShadingGroup *edit_uv_shadow_edges_grp;
274   DRWShadingGroup *edit_uv_faces_grp;
275   DRWShadingGroup *edit_uv_face_dots_grp;
276   DRWShadingGroup *edit_uv_stretching_grp;
277   DRWShadingGroup *extra_grid_grp;
278   DRWShadingGroup *facing_grp[2];
279   DRWShadingGroup *fade_grp[2];
280   DRWShadingGroup *motion_path_lines_grp;
281   DRWShadingGroup *motion_path_points_grp;
282   DRWShadingGroup *outlines_grp;
283   DRWShadingGroup *outlines_ptcloud_grp;
284   DRWShadingGroup *outlines_gpencil_grp;
285   DRWShadingGroup *paint_depth_grp;
286   DRWShadingGroup *paint_surf_grp;
287   DRWShadingGroup *paint_wire_grp;
288   DRWShadingGroup *paint_wire_selected_grp;
289   DRWShadingGroup *paint_point_grp;
290   DRWShadingGroup *paint_face_grp;
291   DRWShadingGroup *particle_dots_grp;
292   DRWShadingGroup *particle_shapes_grp;
293   DRWShadingGroup *pointcloud_dots_grp;
294   DRWShadingGroup *sculpt_mask_grp;
295   DRWShadingGroup *volume_selection_surface_grp;
296   DRWShadingGroup *wires_grp[2][2];      /* With and without coloring. */
297   DRWShadingGroup *wires_all_grp[2][2];  /* With and without coloring. */
298   DRWShadingGroup *wires_hair_grp[2][2]; /* With and without coloring. */
299   DRWShadingGroup *wires_sculpt_grp[2];
300 
301   DRWView *view_default;
302   DRWView *view_wires;
303   DRWView *view_edit_faces;
304   DRWView *view_edit_faces_cage;
305   DRWView *view_edit_edges;
306   DRWView *view_edit_verts;
307   DRWView *view_edit_text;
308   DRWView *view_reference_images;
309 
310   /** TODO get rid of this. */
311   ListBase smoke_domains;
312   ListBase bg_movie_clips;
313 
314   /** Two instances for in_front option and without. */
315   OVERLAY_ExtraCallBuffers extra_call_buffers[2];
316 
317   OVERLAY_ArmatureCallBuffers armature_call_buffers[2];
318 
319   View3DOverlay overlay;
320   enum eContextObjectMode ctx_mode;
321   bool is_image_editor;
322   bool clear_in_front;
323   bool use_in_front;
324   bool wireframe_mode;
325   bool hide_overlays;
326   bool xray_enabled;
327   bool xray_enabled_and_not_wire;
328   float xray_opacity;
329   short v3d_flag;     /* TODO move to View3DOverlay */
330   short v3d_gridflag; /* TODO move to View3DOverlay */
331   int cfra;
332   DRWState clipping_state;
333   OVERLAY_ShadingData shdata;
334 
335   struct {
336     bool enabled;
337     bool do_depth_copy;
338     bool do_depth_infront_copy;
339   } antialiasing;
340   struct {
341     bool show_handles;
342     int handle_display;
343   } edit_curve;
344   struct {
345     float overlay_color[4];
346   } edit_text;
347   struct {
348     bool do_zbufclip;
349     bool do_faces;
350     bool do_edges;
351     bool select_vert;
352     bool select_face;
353     bool select_edge;
354     int flag; /** Copy of v3d->overlay.edit_flag.  */
355   } edit_mesh;
356   struct {
357     bool use_weight;
358     int select_mode;
359   } edit_particle;
360   struct {
361     bool do_uv_overlay;
362     bool do_uv_shadow_overlay;
363     bool do_uv_stretching_overlay;
364     bool do_tiled_image_overlay;
365     bool do_tiled_image_border_overlay;
366     bool do_stencil_overlay;
367 
368     bool do_faces;
369     bool do_face_dots;
370 
371     float uv_opacity;
372     /* edge drawing */
373     OVERLAY_UVLineStyle line_style;
374     float dash_length;
375     int do_smooth_wire;
376 
377     /* stretching overlay */
378     float aspect[2];
379     eSpaceImage_UVDT_Stretch draw_type;
380     ListBase totals;
381     float total_area_ratio;
382     float total_area_ratio_inv;
383 
384     /* stencil overlay */
385     struct Image *stencil_image;
386     struct ImBuf *stencil_ibuf;
387     void * stencil_lock;
388   } edit_uv;
389   struct {
390     bool transparent;
391     bool show_relations;
392     bool do_pose_xray;
393     bool do_pose_fade_geom;
394   } armature;
395   struct {
396     bool in_front;
397     bool alpha_blending;
398   } painting;
399   struct {
400     DRWCallBuffer *handle[2];
401   } mball;
402 } OVERLAY_PrivateData; /* Transient data */
403 
404 typedef struct OVERLAY_StorageList {
405   struct OVERLAY_PrivateData *pd;
406 } OVERLAY_StorageList;
407 
408 typedef struct OVERLAY_Data {
409   void *engine_type;
410   OVERLAY_FramebufferList *fbl;
411   OVERLAY_TextureList *txl;
412   OVERLAY_PassList *psl;
413   OVERLAY_StorageList *stl;
414 } OVERLAY_Data;
415 
416 typedef struct OVERLAY_DupliData {
417   DRWShadingGroup *wire_shgrp;
418   DRWShadingGroup *outline_shgrp;
419   DRWShadingGroup *extra_shgrp;
420   struct GPUBatch *wire_geom;
421   struct GPUBatch *outline_geom;
422   struct GPUBatch *extra_geom;
423   short base_flag;
424 } OVERLAY_DupliData;
425 
426 typedef struct BoneInstanceData {
427   /* Keep sync with bone instance vertex format (OVERLAY_InstanceFormats) */
428   union {
429     float mat[4][4];
430     struct {
431       float _pad0[3], color_hint_a;
432       float _pad1[3], color_hint_b;
433       float _pad2[3], color_a;
434       float _pad3[3], color_b;
435     };
436     struct {
437       float _pad00[3], amin_a;
438       float _pad01[3], amin_b;
439       float _pad02[3], amax_a;
440       float _pad03[3], amax_b;
441     };
442   };
443 } BoneInstanceData;
444 
445 typedef struct OVERLAY_InstanceFormats {
446   struct GPUVertFormat *instance_pos;
447   struct GPUVertFormat *instance_extra;
448   struct GPUVertFormat *instance_bone;
449   struct GPUVertFormat *instance_bone_outline;
450   struct GPUVertFormat *instance_bone_envelope;
451   struct GPUVertFormat *instance_bone_envelope_distance;
452   struct GPUVertFormat *instance_bone_envelope_outline;
453   struct GPUVertFormat *instance_bone_stick;
454   struct GPUVertFormat *pos;
455   struct GPUVertFormat *pos_color;
456   struct GPUVertFormat *wire_extra;
457   struct GPUVertFormat *point_extra;
458 } OVERLAY_InstanceFormats;
459 
460 /* Pack data into the last row of the 4x4 matrix. It will be decoded by the vertex shader. */
pack_data_in_mat4(float rmat[4][4],const float mat[4][4],float a,float b,float c,float d)461 BLI_INLINE void pack_data_in_mat4(
462     float rmat[4][4], const float mat[4][4], float a, float b, float c, float d)
463 {
464   copy_m4_m4(rmat, mat);
465   rmat[0][3] = a;
466   rmat[1][3] = b;
467   rmat[2][3] = c;
468   rmat[3][3] = d;
469 }
470 
pack_v4_in_mat4(float rmat[4][4],const float mat[4][4],const float v[4])471 BLI_INLINE void pack_v4_in_mat4(float rmat[4][4], const float mat[4][4], const float v[4])
472 {
473   pack_data_in_mat4(rmat, mat, v[0], v[1], v[2], v[3]);
474 }
475 
pack_fl_in_mat4(float rmat[4][4],const float mat[4][4],float a)476 BLI_INLINE void pack_fl_in_mat4(float rmat[4][4], const float mat[4][4], float a)
477 {
478   copy_m4_m4(rmat, mat);
479   rmat[3][3] = a;
480 }
481 
482 void OVERLAY_antialiasing_init(OVERLAY_Data *vedata);
483 void OVERLAY_antialiasing_cache_init(OVERLAY_Data *vedata);
484 void OVERLAY_antialiasing_cache_finish(OVERLAY_Data *vedata);
485 void OVERLAY_antialiasing_start(OVERLAY_Data *vedata);
486 void OVERLAY_antialiasing_end(OVERLAY_Data *vedata);
487 void OVERLAY_xray_fade_draw(OVERLAY_Data *vedata);
488 void OVERLAY_xray_depth_copy(OVERLAY_Data *vedata);
489 void OVERLAY_xray_depth_infront_copy(OVERLAY_Data *vedata);
490 
491 bool OVERLAY_armature_is_pose_mode(Object *ob, const struct DRWContextState *draw_ctx);
492 void OVERLAY_armature_cache_init(OVERLAY_Data *vedata);
493 void OVERLAY_armature_cache_populate(OVERLAY_Data *vedata, Object *ob);
494 void OVERLAY_edit_armature_cache_populate(OVERLAY_Data *vedata, Object *ob);
495 void OVERLAY_pose_armature_cache_populate(OVERLAY_Data *vedata, Object *ob);
496 void OVERLAY_armature_cache_finish(OVERLAY_Data *vedata);
497 void OVERLAY_armature_draw(OVERLAY_Data *vedata);
498 void OVERLAY_armature_in_front_draw(OVERLAY_Data *vedata);
499 void OVERLAY_pose_cache_populate(OVERLAY_Data *vedata, Object *ob);
500 void OVERLAY_pose_draw(OVERLAY_Data *vedata);
501 
502 void OVERLAY_background_cache_init(OVERLAY_Data *vedata);
503 void OVERLAY_background_draw(OVERLAY_Data *vedata);
504 
505 void OVERLAY_bone_instance_data_set_color_hint(BoneInstanceData *data, const float hint_color[4]);
506 void OVERLAY_bone_instance_data_set_color(BoneInstanceData *data, const float bone_color[4]);
507 
508 void OVERLAY_edit_curve_cache_init(OVERLAY_Data *vedata);
509 void OVERLAY_edit_curve_cache_populate(OVERLAY_Data *vedata, Object *ob);
510 void OVERLAY_edit_surf_cache_populate(OVERLAY_Data *vedata, Object *ob);
511 void OVERLAY_edit_curve_draw(OVERLAY_Data *vedata);
512 
513 void OVERLAY_edit_gpencil_cache_init(OVERLAY_Data *vedata);
514 void OVERLAY_gpencil_cache_init(OVERLAY_Data *vedata);
515 void OVERLAY_gpencil_cache_populate(OVERLAY_Data *vedata, Object *ob);
516 void OVERLAY_gpencil_draw(OVERLAY_Data *vedata);
517 void OVERLAY_edit_gpencil_draw(OVERLAY_Data *vedata);
518 
519 void OVERLAY_edit_lattice_cache_init(OVERLAY_Data *vedata);
520 void OVERLAY_edit_lattice_cache_populate(OVERLAY_Data *vedata, Object *ob);
521 void OVERLAY_lattice_cache_populate(OVERLAY_Data *vedata, Object *ob);
522 void OVERLAY_edit_lattice_draw(OVERLAY_Data *vedata);
523 
524 void OVERLAY_edit_text_cache_init(OVERLAY_Data *vedata);
525 void OVERLAY_edit_text_cache_populate(OVERLAY_Data *vedata, Object *ob);
526 void OVERLAY_edit_text_draw(OVERLAY_Data *vedata);
527 
528 void OVERLAY_volume_cache_init(OVERLAY_Data *vedata);
529 void OVERLAY_volume_cache_populate(OVERLAY_Data *vedata, Object *ob);
530 void OVERLAY_volume_draw(OVERLAY_Data *vedata);
531 
532 void OVERLAY_edit_mesh_init(OVERLAY_Data *vedata);
533 void OVERLAY_edit_mesh_cache_init(OVERLAY_Data *vedata);
534 void OVERLAY_edit_mesh_cache_populate(OVERLAY_Data *vedata, Object *ob);
535 void OVERLAY_edit_mesh_draw(OVERLAY_Data *vedata);
536 
537 void OVERLAY_edit_particle_cache_init(OVERLAY_Data *vedata);
538 void OVERLAY_edit_particle_cache_populate(OVERLAY_Data *vedata, Object *ob);
539 void OVERLAY_edit_particle_draw(OVERLAY_Data *vedata);
540 
541 void OVERLAY_edit_uv_init(OVERLAY_Data *vedata);
542 void OVERLAY_edit_uv_cache_init(OVERLAY_Data *vedata);
543 void OVERLAY_edit_uv_cache_populate(OVERLAY_Data *vedata, Object *ob);
544 void OVERLAY_edit_uv_draw(OVERLAY_Data *vedata);
545 
546 void OVERLAY_extra_cache_init(OVERLAY_Data *vedata);
547 void OVERLAY_extra_cache_populate(OVERLAY_Data *vedata, Object *ob);
548 void OVERLAY_extra_blend_draw(OVERLAY_Data *vedata);
549 void OVERLAY_extra_draw(OVERLAY_Data *vedata);
550 void OVERLAY_extra_in_front_draw(OVERLAY_Data *vedata);
551 void OVERLAY_extra_centers_draw(OVERLAY_Data *vedata);
552 
553 void OVERLAY_camera_cache_populate(OVERLAY_Data *vedata, Object *ob);
554 void OVERLAY_empty_cache_populate(OVERLAY_Data *vedata, Object *ob);
555 void OVERLAY_light_cache_populate(OVERLAY_Data *vedata, Object *ob);
556 void OVERLAY_lightprobe_cache_populate(OVERLAY_Data *vedata, Object *ob);
557 void OVERLAY_speaker_cache_populate(OVERLAY_Data *vedata, Object *ob);
558 
559 OVERLAY_ExtraCallBuffers *OVERLAY_extra_call_buffer_get(OVERLAY_Data *vedata, Object *ob);
560 void OVERLAY_extra_point(OVERLAY_ExtraCallBuffers *cb, const float point[3], const float color[4]);
561 void OVERLAY_extra_line_dashed(OVERLAY_ExtraCallBuffers *cb,
562                                const float start[3],
563                                const float end[3],
564                                const float color[4]);
565 void OVERLAY_extra_line(OVERLAY_ExtraCallBuffers *cb,
566                         const float start[3],
567                         const float end[3],
568                         const int color_id);
569 void OVERLAY_empty_shape(OVERLAY_ExtraCallBuffers *cb,
570                          const float mat[4][4],
571                          const float draw_size,
572                          const char draw_type,
573                          const float color[4]);
574 void OVERLAY_extra_loose_points(OVERLAY_ExtraCallBuffers *cb,
575                                 struct GPUBatch *geom,
576                                 const float mat[4][4],
577                                 const float color[4]);
578 void OVERLAY_extra_wire(OVERLAY_ExtraCallBuffers *cb,
579                         struct GPUBatch *geom,
580                         const float mat[4][4],
581                         const float color[4]);
582 
583 void OVERLAY_facing_init(OVERLAY_Data *vedata);
584 void OVERLAY_facing_cache_init(OVERLAY_Data *vedata);
585 void OVERLAY_facing_cache_populate(OVERLAY_Data *vedata, Object *ob);
586 void OVERLAY_facing_draw(OVERLAY_Data *vedata);
587 void OVERLAY_facing_infront_draw(OVERLAY_Data *vedata);
588 
589 void OVERLAY_fade_init(OVERLAY_Data *vedata);
590 void OVERLAY_fade_cache_init(OVERLAY_Data *vedata);
591 void OVERLAY_fade_cache_populate(OVERLAY_Data *vedata, Object *ob);
592 void OVERLAY_fade_draw(OVERLAY_Data *vedata);
593 void OVERLAY_fade_infront_draw(OVERLAY_Data *vedata);
594 
595 void OVERLAY_grid_init(OVERLAY_Data *vedata);
596 void OVERLAY_grid_cache_init(OVERLAY_Data *vedata);
597 void OVERLAY_grid_draw(OVERLAY_Data *vedata);
598 
599 void OVERLAY_image_init(OVERLAY_Data *vedata);
600 void OVERLAY_image_cache_init(OVERLAY_Data *vedata);
601 void OVERLAY_image_camera_cache_populate(OVERLAY_Data *vedata, Object *ob);
602 void OVERLAY_image_empty_cache_populate(OVERLAY_Data *vedata, Object *ob);
603 void OVERLAY_image_cache_finish(OVERLAY_Data *vedata);
604 void OVERLAY_image_draw(OVERLAY_Data *vedata);
605 void OVERLAY_image_background_draw(OVERLAY_Data *vedata);
606 void OVERLAY_image_scene_background_draw(OVERLAY_Data *vedata);
607 void OVERLAY_image_in_front_draw(OVERLAY_Data *vedata);
608 
609 void OVERLAY_metaball_cache_init(OVERLAY_Data *vedata);
610 void OVERLAY_edit_metaball_cache_populate(OVERLAY_Data *vedata, Object *ob);
611 void OVERLAY_metaball_cache_populate(OVERLAY_Data *vedata, Object *ob);
612 void OVERLAY_metaball_draw(OVERLAY_Data *vedata);
613 void OVERLAY_metaball_in_front_draw(OVERLAY_Data *vedata);
614 
615 void OVERLAY_motion_path_cache_init(OVERLAY_Data *vedata);
616 void OVERLAY_motion_path_cache_populate(OVERLAY_Data *vedata, Object *ob);
617 void OVERLAY_motion_path_draw(OVERLAY_Data *vedata);
618 
619 void OVERLAY_outline_init(OVERLAY_Data *vedata);
620 void OVERLAY_outline_cache_init(OVERLAY_Data *vedata);
621 void OVERLAY_outline_cache_populate(OVERLAY_Data *vedata,
622                                     Object *ob,
623                                     OVERLAY_DupliData *dupli,
624                                     bool init_dupli);
625 void OVERLAY_outline_draw(OVERLAY_Data *vedata);
626 
627 void OVERLAY_paint_init(OVERLAY_Data *vedata);
628 void OVERLAY_paint_cache_init(OVERLAY_Data *vedata);
629 void OVERLAY_paint_texture_cache_populate(OVERLAY_Data *vedata, Object *ob);
630 void OVERLAY_paint_vertex_cache_populate(OVERLAY_Data *vedata, Object *ob);
631 void OVERLAY_paint_weight_cache_populate(OVERLAY_Data *vedata, Object *ob);
632 void OVERLAY_paint_draw(OVERLAY_Data *vedata);
633 
634 void OVERLAY_particle_cache_init(OVERLAY_Data *vedata);
635 void OVERLAY_particle_cache_populate(OVERLAY_Data *vedata, Object *ob);
636 void OVERLAY_particle_draw(OVERLAY_Data *vedata);
637 
638 void OVERLAY_sculpt_cache_init(OVERLAY_Data *vedata);
639 void OVERLAY_sculpt_cache_populate(OVERLAY_Data *vedata, Object *ob);
640 void OVERLAY_sculpt_draw(OVERLAY_Data *vedata);
641 
642 void OVERLAY_wireframe_init(OVERLAY_Data *vedata);
643 void OVERLAY_wireframe_cache_init(OVERLAY_Data *vedata);
644 void OVERLAY_wireframe_cache_populate(OVERLAY_Data *vedata,
645                                       Object *ob,
646                                       OVERLAY_DupliData *dupli,
647                                       bool init_dupli);
648 void OVERLAY_wireframe_draw(OVERLAY_Data *vedata);
649 void OVERLAY_wireframe_in_front_draw(OVERLAY_Data *vedata);
650 
651 void OVERLAY_shader_library_ensure(void);
652 GPUShader *OVERLAY_shader_antialiasing(void);
653 GPUShader *OVERLAY_shader_armature_degrees_of_freedom_wire(void);
654 GPUShader *OVERLAY_shader_armature_degrees_of_freedom_solid(void);
655 GPUShader *OVERLAY_shader_armature_envelope(bool use_outline);
656 GPUShader *OVERLAY_shader_armature_shape(bool use_outline);
657 GPUShader *OVERLAY_shader_armature_shape_wire(void);
658 GPUShader *OVERLAY_shader_armature_sphere(bool use_outline);
659 GPUShader *OVERLAY_shader_armature_stick(void);
660 GPUShader *OVERLAY_shader_armature_wire(void);
661 GPUShader *OVERLAY_shader_background(void);
662 GPUShader *OVERLAY_shader_clipbound(void);
663 GPUShader *OVERLAY_shader_depth_only(void);
664 GPUShader *OVERLAY_shader_edit_curve_handle(void);
665 GPUShader *OVERLAY_shader_edit_curve_point(void);
666 GPUShader *OVERLAY_shader_edit_curve_wire(void);
667 GPUShader *OVERLAY_shader_edit_gpencil_guide_point(void);
668 GPUShader *OVERLAY_shader_edit_gpencil_point(void);
669 GPUShader *OVERLAY_shader_edit_gpencil_wire(void);
670 GPUShader *OVERLAY_shader_edit_lattice_point(void);
671 GPUShader *OVERLAY_shader_edit_lattice_wire(void);
672 GPUShader *OVERLAY_shader_edit_mesh_analysis(void);
673 GPUShader *OVERLAY_shader_edit_mesh_edge(bool use_flat_interp);
674 GPUShader *OVERLAY_shader_edit_mesh_face(void);
675 GPUShader *OVERLAY_shader_edit_mesh_facedot(void);
676 GPUShader *OVERLAY_shader_edit_mesh_normal(void);
677 GPUShader *OVERLAY_shader_edit_mesh_skin_root(void);
678 GPUShader *OVERLAY_shader_edit_mesh_vert(void);
679 GPUShader *OVERLAY_shader_edit_particle_strand(void);
680 GPUShader *OVERLAY_shader_edit_particle_point(void);
681 GPUShader *OVERLAY_shader_edit_uv_edges_get(void);
682 GPUShader *OVERLAY_shader_edit_uv_face_get(void);
683 GPUShader *OVERLAY_shader_edit_uv_face_dots_get(void);
684 GPUShader *OVERLAY_shader_edit_uv_verts_get(void);
685 GPUShader *OVERLAY_shader_edit_uv_stretching_area_get(void);
686 GPUShader *OVERLAY_shader_edit_uv_stretching_angle_get(void);
687 GPUShader *OVERLAY_shader_edit_uv_tiled_image_borders_get(void);
688 GPUShader *OVERLAY_shader_edit_uv_stencil_image(void);
689 GPUShader *OVERLAY_shader_extra(bool is_select);
690 GPUShader *OVERLAY_shader_extra_groundline(void);
691 GPUShader *OVERLAY_shader_extra_wire(bool use_object, bool is_select);
692 GPUShader *OVERLAY_shader_extra_loose_point(void);
693 GPUShader *OVERLAY_shader_extra_point(void);
694 GPUShader *OVERLAY_shader_facing(void);
695 GPUShader *OVERLAY_shader_gpencil_canvas(void);
696 GPUShader *OVERLAY_shader_grid(void);
697 GPUShader *OVERLAY_shader_grid_image(void);
698 GPUShader *OVERLAY_shader_image(void);
699 GPUShader *OVERLAY_shader_motion_path_line(void);
700 GPUShader *OVERLAY_shader_motion_path_vert(void);
701 GPUShader *OVERLAY_shader_uniform_color(void);
702 GPUShader *OVERLAY_shader_outline_prepass(bool use_wire);
703 GPUShader *OVERLAY_shader_outline_prepass_gpencil(void);
704 GPUShader *OVERLAY_shader_outline_prepass_pointcloud(void);
705 GPUShader *OVERLAY_shader_extra_grid(void);
706 GPUShader *OVERLAY_shader_outline_detect(void);
707 GPUShader *OVERLAY_shader_paint_face(void);
708 GPUShader *OVERLAY_shader_paint_point(void);
709 GPUShader *OVERLAY_shader_paint_texture(void);
710 GPUShader *OVERLAY_shader_paint_vertcol(void);
711 GPUShader *OVERLAY_shader_paint_weight(void);
712 GPUShader *OVERLAY_shader_paint_wire(void);
713 GPUShader *OVERLAY_shader_particle_dot(void);
714 GPUShader *OVERLAY_shader_particle_shape(void);
715 GPUShader *OVERLAY_shader_sculpt_mask(void);
716 GPUShader *OVERLAY_shader_volume_velocity(bool use_needle, bool use_mac);
717 GPUShader *OVERLAY_shader_volume_gridlines(bool color_with_flags, bool color_range);
718 GPUShader *OVERLAY_shader_wireframe(bool custom_bias);
719 GPUShader *OVERLAY_shader_wireframe_select(void);
720 GPUShader *OVERLAY_shader_xray_fade(void);
721 
722 OVERLAY_InstanceFormats *OVERLAY_shader_instance_formats_get(void);
723 
724 void OVERLAY_shader_free(void);
725 
726 #ifdef __cplusplus
727 }
728 #endif
729