Blender  V3.3
overlay_extra.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2019 Blender Foundation. */
3 
8 #include "DRW_render.h"
9 
10 #include "UI_resources.h"
11 
12 #include "BKE_anim_path.h"
13 #include "BKE_camera.h"
14 #include "BKE_constraint.h"
15 #include "BKE_curve.h"
16 #include "BKE_global.h"
17 #include "BKE_mball.h"
18 #include "BKE_mesh.h"
19 #include "BKE_modifier.h"
20 #include "BKE_movieclip.h"
21 #include "BKE_object.h"
22 #include "BKE_tracking.h"
23 
24 #include "BLI_listbase.h"
25 
26 #include "DNA_camera_types.h"
27 #include "DNA_constraint_types.h"
28 #include "DNA_curve_types.h"
29 #include "DNA_fluid_types.h"
31 #include "DNA_lightprobe_types.h"
32 #include "DNA_mesh_types.h"
33 #include "DNA_meta_types.h"
34 #include "DNA_modifier_types.h"
35 #include "DNA_pointcache_types.h"
36 #include "DNA_rigidbody_types.h"
37 
38 #include "DEG_depsgraph_query.h"
39 
40 #include "ED_view3d.h"
41 
42 #include "overlay_private.h"
43 
44 #include "draw_common.h"
45 #include "draw_manager_text.h"
46 
48 {
49  OVERLAY_PassList *psl = vedata->psl;
50  OVERLAY_TextureList *txl = vedata->txl;
51  OVERLAY_PrivateData *pd = vedata->stl->pd;
52  const bool is_select = DRW_state_is_select();
53 
55  DRW_PASS_CREATE(psl->extra_blend_ps, state_blend | pd->clipping_state);
56  DRW_PASS_CREATE(psl->extra_centers_ps, state_blend | pd->clipping_state);
57 
58  {
60 
63  DRWShadingGroup *grp;
65  struct GPUTexture *tex = DRW_state_is_fbo() ? dtxl->depth : txl->dummy_depth_tx;
66 
68  DRW_shgroup_uniform_texture(grp, "depthBuffer", tex);
69  DRW_shgroup_uniform_block(grp, "globalsBlock", G_draw.block_ubo);
70  DRW_shgroup_uniform_bool_copy(grp, "isTransform", (G.moving & G_TRANSFORM_OBJ) != 0);
71  }
72 
73  for (int i = 0; i < 2; i++) {
74  /* Non Meshes Pass (Camera, empties, lights ...) */
75  struct GPUShader *sh;
76  struct GPUVertFormat *format;
77  DRWShadingGroup *grp, *grp_sub;
78 
81  DRWPass **p_extra_ps = &psl->extra_ps[i];
82 
83  DRWState infront_state = (DRW_state_is_select() && (i == 1)) ? DRW_STATE_IN_FRONT_SELECT : 0;
85  DRW_PASS_CREATE(*p_extra_ps, state | pd->clipping_state | infront_state);
86 
87  DRWPass *extra_ps = *p_extra_ps;
88 
89 #define BUF_INSTANCE DRW_shgroup_call_buffer_instance
90 #define BUF_POINT(grp, format) DRW_shgroup_call_buffer(grp, format, GPU_PRIM_POINTS)
91 #define BUF_LINE(grp, format) DRW_shgroup_call_buffer(grp, format, GPU_PRIM_LINES)
92 
93  /* Sorted by shader to avoid state changes during render. */
94  {
95  format = formats->instance_extra;
96  sh = OVERLAY_shader_extra(is_select);
97 
98  grp = DRW_shgroup_create(sh, extra_ps);
99  DRW_shgroup_uniform_block(grp, "globalsBlock", G_draw.block_ubo);
100 
101  grp_sub = DRW_shgroup_create_sub(grp);
135 
136  grp_sub = DRW_shgroup_create_sub(grp);
140  }
141  {
142  format = formats->instance_extra;
143  grp = DRW_shgroup_create(sh, psl->extra_blend_ps); /* NOTE: not the same pass! */
144  DRW_shgroup_uniform_block(grp, "globalsBlock", G_draw.block_ubo);
145 
146  grp_sub = DRW_shgroup_create_sub(grp);
151 
152  grp_sub = DRW_shgroup_create_sub(grp);
155  }
156  {
157  format = formats->instance_pos;
159 
160  grp = DRW_shgroup_create(sh, extra_ps);
161  DRW_shgroup_uniform_block(grp, "globalsBlock", G_draw.block_ubo);
163 
165  }
166  {
167  sh = OVERLAY_shader_extra_wire(false, is_select);
168 
169  grp = DRW_shgroup_create(sh, extra_ps);
170  DRW_shgroup_uniform_block(grp, "globalsBlock", G_draw.block_ubo);
171 
172  cb->extra_dashed_lines = BUF_LINE(grp, formats->pos_color);
173  cb->extra_lines = BUF_LINE(grp, formats->wire_extra);
174  }
175  {
176  sh = OVERLAY_shader_extra_wire(true, is_select);
177 
178  cb->extra_wire = grp = DRW_shgroup_create(sh, extra_ps);
179  DRW_shgroup_uniform_block(grp, "globalsBlock", G_draw.block_ubo);
180  }
181  {
183 
184  cb->extra_loose_points = grp = DRW_shgroup_create(sh, extra_ps);
185  DRW_shgroup_uniform_block(grp, "globalsBlock", G_draw.block_ubo);
186 
187  /* Buffer access for drawing isolated points, matching `extra_lines`. */
188  cb->extra_points = BUF_POINT(grp, formats->point_extra);
189  }
190  {
191  format = formats->pos;
193 
194  grp = DRW_shgroup_create(sh, psl->extra_centers_ps); /* NOTE: not the same pass! */
195  DRW_shgroup_uniform_block(grp, "globalsBlock", G_draw.block_ubo);
196 
197  grp_sub = DRW_shgroup_create_sub(grp);
199  cb->center_active = BUF_POINT(grp_sub, format);
200 
201  grp_sub = DRW_shgroup_create_sub(grp);
203  cb->center_selected = BUF_POINT(grp_sub, format);
204 
205  grp_sub = DRW_shgroup_create_sub(grp);
207  cb->center_deselected = BUF_POINT(grp_sub, format);
208 
209  grp_sub = DRW_shgroup_create_sub(grp);
211  cb->center_selected_lib = BUF_POINT(grp_sub, format);
212 
213  grp_sub = DRW_shgroup_create_sub(grp);
215  cb->center_deselected_lib = BUF_POINT(grp_sub, format);
216  }
217  }
218 }
219 
220 void OVERLAY_extra_point(OVERLAY_ExtraCallBuffers *cb, const float point[3], const float color[4])
221 {
223 }
224 
226  const float start[3],
227  const float end[3],
228  const float color[4])
229 {
232 }
233 
235  const float start[3],
236  const float end[3],
237  const int color_id)
238 {
239  DRW_buffer_add_entry(cb->extra_lines, start, &color_id);
240  DRW_buffer_add_entry(cb->extra_lines, end, &color_id);
241 }
242 
244 {
245  bool do_in_front = (ob->dtx & OB_DRAW_IN_FRONT) != 0;
246  OVERLAY_PrivateData *pd = vedata->stl->pd;
247  return &pd->extra_call_buffers[do_in_front];
248 }
249 
251  struct GPUBatch *geom,
252  const float mat[4][4],
253  const float color[4])
254 {
255  float draw_mat[4][4];
256  pack_v4_in_mat4(draw_mat, mat, color);
257  DRW_shgroup_call_obmat(cb->extra_loose_points, geom, draw_mat);
258 }
259 
261  struct GPUBatch *geom,
262  const float mat[4][4],
263  const float color[4])
264 {
265  float draw_mat[4][4];
266  const float col[4] = {UNPACK3(color), 0.0f /* No stipples. */};
267  pack_v4_in_mat4(draw_mat, mat, col);
268  DRW_shgroup_call_obmat(cb->extra_wire, geom, draw_mat);
269 }
270 
271 /* -------------------------------------------------------------------- */
276  const float mat[4][4],
277  const float draw_size,
278  const char draw_type,
279  const float color[4])
280 {
281  float instdata[4][4];
282  pack_fl_in_mat4(instdata, mat, draw_size);
283 
284  switch (draw_type) {
285  case OB_PLAINAXES:
287  break;
288  case OB_SINGLE_ARROW:
290  break;
291  case OB_CUBE:
292  DRW_buffer_add_entry(cb->empty_cube, color, instdata);
293  break;
294  case OB_CIRCLE:
295  DRW_buffer_add_entry(cb->empty_circle, color, instdata);
296  break;
297  case OB_EMPTY_SPHERE:
298  DRW_buffer_add_entry(cb->empty_sphere, color, instdata);
299  break;
300  case OB_EMPTY_CONE:
301  DRW_buffer_add_entry(cb->empty_cone, color, instdata);
302  break;
303  case OB_ARROWS:
304  DRW_buffer_add_entry(cb->empty_axes, color, instdata);
305  break;
306  case OB_EMPTY_IMAGE:
307  /* This only show the frame. See OVERLAY_image_empty_cache_populate() for the image. */
309  break;
310  }
311 }
312 
314 {
315  if (((ob->base_flag & BASE_FROM_DUPLI) != 0) && ((ob->transflag & OB_DUPLICOLLECTION) != 0) &&
316  ob->instance_collection) {
317  return;
318  }
319 
321  const DRWContextState *draw_ctx = DRW_context_state_get();
322  ViewLayer *view_layer = draw_ctx->view_layer;
323  float *color;
324 
325  switch (ob->empty_drawtype) {
326  case OB_PLAINAXES:
327  case OB_SINGLE_ARROW:
328  case OB_CUBE:
329  case OB_CIRCLE:
330  case OB_EMPTY_SPHERE:
331  case OB_EMPTY_CONE:
332  case OB_ARROWS:
333  DRW_object_wire_theme_get(ob, view_layer, &color);
335  break;
336  case OB_EMPTY_IMAGE:
338  break;
339  }
340 }
341 
343  Object *ob,
344  const float *color,
345  char boundtype,
346  bool around_origin)
347 {
348  float center[3], size[3], tmp[4][4], final_mat[4][4];
349 
350  if (ob->type == OB_MBALL && !BKE_mball_is_basis(ob)) {
351  return;
352  }
353 
354  const BoundBox *bb = BKE_object_boundbox_get(ob);
355  BoundBox bb_local;
356  if (bb == NULL) {
357  const float min[3] = {-1.0f, -1.0f, -1.0f}, max[3] = {1.0f, 1.0f, 1.0f};
359  bb = &bb_local;
360  }
361 
363 
364  if (around_origin) {
365  zero_v3(center);
366  }
367  else {
369  }
370 
371  switch (boundtype) {
372  case OB_BOUND_BOX:
373  size_to_mat4(tmp, size);
374  copy_v3_v3(tmp[3], center);
375  mul_m4_m4m4(tmp, ob->obmat, tmp);
377  break;
378  case OB_BOUND_SPHERE:
379  size[0] = max_fff(size[0], size[1], size[2]);
380  size[1] = size[2] = size[0];
381  size_to_mat4(tmp, size);
382  copy_v3_v3(tmp[3], center);
383  mul_m4_m4m4(tmp, ob->obmat, tmp);
385  break;
386  case OB_BOUND_CYLINDER:
387  size[0] = max_ff(size[0], size[1]);
388  size[1] = size[0];
389  size_to_mat4(tmp, size);
390  copy_v3_v3(tmp[3], center);
391  mul_m4_m4m4(tmp, ob->obmat, tmp);
393  break;
394  case OB_BOUND_CONE:
395  size[0] = max_ff(size[0], size[1]);
396  size[1] = size[0];
397  size_to_mat4(tmp, size);
398  copy_v3_v3(tmp[3], center);
399  /* Cone batch has base at 0 and is pointing towards +Y. */
400  swap_v3_v3(tmp[1], tmp[2]);
401  tmp[3][2] -= size[2];
402  mul_m4_m4m4(tmp, ob->obmat, tmp);
404  break;
405  case OB_BOUND_CAPSULE:
406  size[0] = max_ff(size[0], size[1]);
407  size[1] = size[0];
408  scale_m4_fl(tmp, size[0]);
409  copy_v2_v2(tmp[3], center);
410  tmp[3][2] = center[2] + max_ff(0.0f, size[2] - size[0]);
411  mul_m4_m4m4(final_mat, ob->obmat, tmp);
413  negate_v3(tmp[2]);
414  tmp[3][2] = center[2] - max_ff(0.0f, size[2] - size[0]);
415  mul_m4_m4m4(final_mat, ob->obmat, tmp);
417  tmp[2][2] = max_ff(0.0f, size[2] * 2.0f - size[0] * 2.0f);
418  mul_m4_m4m4(final_mat, ob->obmat, tmp);
420  break;
421  }
422 }
423 
424 static void OVERLAY_collision(OVERLAY_ExtraCallBuffers *cb, Object *ob, const float *color)
425 {
426  switch (ob->rigidbody_object->shape) {
427  case RB_SHAPE_BOX:
428  OVERLAY_bounds(cb, ob, color, OB_BOUND_BOX, true);
429  break;
430  case RB_SHAPE_SPHERE:
431  OVERLAY_bounds(cb, ob, color, OB_BOUND_SPHERE, true);
432  break;
433  case RB_SHAPE_CONE:
434  OVERLAY_bounds(cb, ob, color, OB_BOUND_CONE, true);
435  break;
436  case RB_SHAPE_CYLINDER:
437  OVERLAY_bounds(cb, ob, color, OB_BOUND_CYLINDER, true);
438  break;
439  case RB_SHAPE_CAPSULE:
440  OVERLAY_bounds(cb, ob, color, OB_BOUND_CAPSULE, true);
441  break;
442  }
443 }
444 
445 static void OVERLAY_texture_space(OVERLAY_ExtraCallBuffers *cb, Object *ob, const float *color)
446 {
447  if (ob->data == NULL) {
448  return;
449  }
450 
451  ID *ob_data = ob->data;
452  float *texcoloc = NULL;
453  float *texcosize = NULL;
454 
455  switch (GS(ob_data->name)) {
456  case ID_ME:
457  BKE_mesh_texspace_get_reference((Mesh *)ob_data, NULL, &texcoloc, &texcosize);
458  break;
459  case ID_CU_LEGACY: {
460  Curve *cu = (Curve *)ob_data;
462  texcoloc = cu->loc;
463  texcosize = cu->size;
464  break;
465  }
466  case ID_MB: {
467  MetaBall *mb = (MetaBall *)ob_data;
468  texcoloc = mb->loc;
469  texcosize = mb->size;
470  break;
471  }
472  case ID_CV:
473  case ID_PT:
474  case ID_VO: {
475  /* No user defined texture space support. */
476  break;
477  }
478  default:
479  BLI_assert(0);
480  }
481 
482  float mat[4][4];
483 
484  if (texcoloc != NULL && texcosize != NULL) {
485  size_to_mat4(mat, texcosize);
486  copy_v3_v3(mat[3], texcoloc);
487  }
488  else {
489  unit_m4(mat);
490  }
491 
492  mul_m4_m4m4(mat, ob->obmat, mat);
493 
495 }
496 
498 {
499  int theme_id = DRW_object_wire_theme_get(ob, view_layer, NULL);
500  float *color = DRW_color_background_blend_get(theme_id);
501  PartDeflect *pd = ob->pd;
502  Curve *cu = (ob->type == OB_CURVES_LEGACY) ? ob->data : NULL;
503 
504  union {
505  float mat[4][4];
506  struct {
507  float _pad00[3], size_x;
508  float _pad01[3], size_y;
509  float _pad02[3], size_z;
510  float pos[3], _pad03[1];
511  };
512  } instdata;
513 
514  copy_m4_m4(instdata.mat, ob->obmat);
515  instdata.size_x = instdata.size_y = instdata.size_z = ob->empty_drawsize;
516 
517  switch (pd->forcefield) {
518  case PFIELD_FORCE:
519  DRW_buffer_add_entry(cb->field_force, color, &instdata);
520  break;
521  case PFIELD_WIND:
522  instdata.size_z = pd->f_strength;
523  DRW_buffer_add_entry(cb->field_wind, color, &instdata);
524  break;
525  case PFIELD_VORTEX:
526  instdata.size_y = (pd->f_strength < 0.0f) ? -instdata.size_y : instdata.size_y;
527  DRW_buffer_add_entry(cb->field_vortex, color, &instdata);
528  break;
529  case PFIELD_GUIDE:
530  if (cu && (cu->flag & CU_PATH) && ob->runtime.curve_cache->anim_path_accum_length) {
531  instdata.size_x = instdata.size_y = instdata.size_z = pd->f_strength;
532  float pos[4];
533  BKE_where_on_path(ob, 0.0f, pos, NULL, NULL, NULL, NULL);
534  copy_v3_v3(instdata.pos, ob->obmat[3]);
535  translate_m4(instdata.mat, pos[0], pos[1], pos[2]);
536  DRW_buffer_add_entry(cb->field_curve, color, &instdata);
537 
538  BKE_where_on_path(ob, 1.0f, pos, NULL, NULL, NULL, NULL);
539  copy_v3_v3(instdata.pos, ob->obmat[3]);
540  translate_m4(instdata.mat, pos[0], pos[1], pos[2]);
541  DRW_buffer_add_entry(cb->field_sphere_limit, color, &instdata);
542  /* Restore */
543  copy_v3_v3(instdata.pos, ob->obmat[3]);
544  }
545  break;
546  }
547 
548  if (pd->falloff == PFIELD_FALL_TUBE) {
549  if (pd->flag & (PFIELD_USEMAX | PFIELD_USEMAXR)) {
550  instdata.size_z = (pd->flag & PFIELD_USEMAX) ? pd->maxdist : 0.0f;
551  instdata.size_x = (pd->flag & PFIELD_USEMAXR) ? pd->maxrad : 1.0f;
552  instdata.size_y = instdata.size_x;
553  DRW_buffer_add_entry(cb->field_tube_limit, color, &instdata);
554  }
555  if (pd->flag & (PFIELD_USEMIN | PFIELD_USEMINR)) {
556  instdata.size_z = (pd->flag & PFIELD_USEMIN) ? pd->mindist : 0.0f;
557  instdata.size_x = (pd->flag & PFIELD_USEMINR) ? pd->minrad : 1.0f;
558  instdata.size_y = instdata.size_x;
559  DRW_buffer_add_entry(cb->field_tube_limit, color, &instdata);
560  }
561  }
562  else if (pd->falloff == PFIELD_FALL_CONE) {
563  if (pd->flag & (PFIELD_USEMAX | PFIELD_USEMAXR)) {
564  float radius = DEG2RADF((pd->flag & PFIELD_USEMAXR) ? pd->maxrad : 1.0f);
565  float distance = (pd->flag & PFIELD_USEMAX) ? pd->maxdist : 0.0f;
566  instdata.size_x = distance * sinf(radius);
567  instdata.size_z = distance * cosf(radius);
568  instdata.size_y = instdata.size_x;
569  DRW_buffer_add_entry(cb->field_cone_limit, color, &instdata);
570  }
571  if (pd->flag & (PFIELD_USEMIN | PFIELD_USEMINR)) {
572  float radius = DEG2RADF((pd->flag & PFIELD_USEMINR) ? pd->minrad : 1.0f);
573  float distance = (pd->flag & PFIELD_USEMIN) ? pd->mindist : 0.0f;
574  instdata.size_x = distance * sinf(radius);
575  instdata.size_z = distance * cosf(radius);
576  instdata.size_y = instdata.size_x;
577  DRW_buffer_add_entry(cb->field_cone_limit, color, &instdata);
578  }
579  }
580  else if (pd->falloff == PFIELD_FALL_SPHERE) {
581  if (pd->flag & PFIELD_USEMAX) {
582  instdata.size_x = instdata.size_y = instdata.size_z = pd->maxdist;
583  DRW_buffer_add_entry(cb->field_sphere_limit, color, &instdata);
584  }
585  if (pd->flag & PFIELD_USEMIN) {
586  instdata.size_x = instdata.size_y = instdata.size_z = pd->mindist;
587  DRW_buffer_add_entry(cb->field_sphere_limit, color, &instdata);
588  }
589  }
590 }
591 
594 /* -------------------------------------------------------------------- */
599 {
601  const DRWContextState *draw_ctx = DRW_context_state_get();
602  ViewLayer *view_layer = draw_ctx->view_layer;
603 
604  Light *la = ob->data;
605  float *color_p;
606  DRW_object_wire_theme_get(ob, view_layer, &color_p);
607  /* Remove the alpha. */
608  float color[4] = {UNPACK3(color_p), 1.0f};
609  /* Pack render data into object matrix. */
610  union {
611  float mat[4][4];
612  struct {
613  float _pad00[3];
614  union {
615  float area_size_x;
616  float spot_cosine;
617  };
618  float _pad01[3];
619  union {
620  float area_size_y;
621  float spot_blend;
622  };
623  float _pad02[3], clip_sta;
624  float pos[3], clip_end;
625  };
626  } instdata;
627 
628  copy_m4_m4(instdata.mat, ob->obmat);
629  /* FIXME / TODO: clip_end has no meaning nowadays.
630  * In EEVEE, Only clip_sta is used shadow-mapping.
631  * Clip end is computed automatically based on light power.
632  * For now, always use the custom distance as clip_end. */
633  instdata.clip_end = la->att_dist;
634  instdata.clip_sta = la->clipsta;
635 
636  DRW_buffer_add_entry(cb->groundline, instdata.pos);
637 
638  if (la->type == LA_LOCAL) {
639  instdata.area_size_x = instdata.area_size_y = la->area_size;
640  DRW_buffer_add_entry(cb->light_point, color, &instdata);
641  }
642  else if (la->type == LA_SUN) {
643  DRW_buffer_add_entry(cb->light_sun, color, &instdata);
644  }
645  else if (la->type == LA_SPOT) {
646  /* Previous implementation was using the clipend distance as cone size.
647  * We cannot do this anymore so we use a fixed size of 10. (see T72871) */
648  rescale_m4(instdata.mat, (float[3]){10.0f, 10.0f, 10.0f});
649  /* For cycles and eevee the spot attenuation is
650  * y = (1/(1 + x^2) - a)/((1 - a) b)
651  * We solve the case where spot attenuation y = 1 and y = 0
652  * root for y = 1 is (-1 - c) / c
653  * root for y = 0 is (1 - a) / a
654  * and use that to position the blend circle. */
655  float a = cosf(la->spotsize * 0.5f);
656  float b = la->spotblend;
657  float c = a * b - a - b;
658  /* Optimized version or root1 / root0 */
659  instdata.spot_blend = sqrtf((-a - c * a) / (c - c * a));
660  instdata.spot_cosine = a;
661  /* HACK: We pack the area size in alpha color. This is decoded by the shader. */
662  color[3] = -max_ff(la->area_size, FLT_MIN);
663  DRW_buffer_add_entry(cb->light_spot, color, &instdata);
664 
665  if ((la->mode & LA_SHOW_CONE) && !DRW_state_is_select()) {
666  const float color_inside[4] = {0.0f, 0.0f, 0.0f, 0.5f};
667  const float color_outside[4] = {1.0f, 1.0f, 1.0f, 0.3f};
668  DRW_buffer_add_entry(cb->light_spot_cone_front, color_inside, &instdata);
669  DRW_buffer_add_entry(cb->light_spot_cone_back, color_outside, &instdata);
670  }
671  }
672  else if (la->type == LA_AREA) {
673  bool uniform_scale = !ELEM(la->area_shape, LA_AREA_RECT, LA_AREA_ELLIPSE);
675  instdata.area_size_x = la->area_size;
676  instdata.area_size_y = uniform_scale ? la->area_size : la->area_sizey;
677  DRW_buffer_add_entry(cb->light_area[sqr], color, &instdata);
678  }
679 }
680 
683 /* -------------------------------------------------------------------- */
688 {
690  const DRWContextState *draw_ctx = DRW_context_state_get();
691  ViewLayer *view_layer = draw_ctx->view_layer;
692  float *color_p;
693  int theme_id = DRW_object_wire_theme_get(ob, view_layer, &color_p);
694  const LightProbe *prb = (LightProbe *)ob->data;
695  const bool show_clipping = (prb->flag & LIGHTPROBE_FLAG_SHOW_CLIP_DIST) != 0;
696  const bool show_parallax = (prb->flag & LIGHTPROBE_FLAG_SHOW_PARALLAX) != 0;
697  const bool show_influence = (prb->flag & LIGHTPROBE_FLAG_SHOW_INFLUENCE) != 0;
698  const bool show_data = (ob->base_flag & BASE_SELECTED) || DRW_state_is_select();
699 
700  union {
701  float mat[4][4];
702  struct {
703  float _pad00[4];
704  float _pad01[4];
705  float _pad02[3], clip_sta;
706  float pos[3], clip_end;
707  };
708  } instdata;
709 
710  copy_m4_m4(instdata.mat, ob->obmat);
711 
712  switch (prb->type) {
714  instdata.clip_sta = show_clipping ? prb->clipsta : -1.0;
715  instdata.clip_end = show_clipping ? prb->clipend : -1.0;
716  DRW_buffer_add_entry(cb->probe_cube, color_p, &instdata);
717  DRW_buffer_add_entry(cb->groundline, instdata.pos);
718 
719  if (show_influence) {
721  float f = 1.0f - prb->falloff;
722  OVERLAY_empty_shape(cb, ob->obmat, prb->distinf, shape, color_p);
723  OVERLAY_empty_shape(cb, ob->obmat, prb->distinf * f, shape, color_p);
724  }
725 
726  if (show_parallax) {
727  char shape = (prb->parallax_type == LIGHTPROBE_SHAPE_BOX) ? OB_CUBE : OB_EMPTY_SPHERE;
728  float dist = ((prb->flag & LIGHTPROBE_FLAG_CUSTOM_PARALLAX) != 0) ? prb->distpar :
729  prb->distinf;
730  OVERLAY_empty_shape(cb, ob->obmat, dist, shape, color_p);
731  }
732  break;
734  instdata.clip_sta = show_clipping ? prb->clipsta : -1.0;
735  instdata.clip_end = show_clipping ? prb->clipend : -1.0;
736  DRW_buffer_add_entry(cb->probe_grid, color_p, &instdata);
737 
738  if (show_influence) {
739  float f = 1.0f - prb->falloff;
740  OVERLAY_empty_shape(cb, ob->obmat, 1.0 + prb->distinf, OB_CUBE, color_p);
741  OVERLAY_empty_shape(cb, ob->obmat, 1.0 + prb->distinf * f, OB_CUBE, color_p);
742  }
743 
744  /* Data dots */
745  if (show_data) {
746  instdata.mat[0][3] = prb->grid_resolution_x;
747  instdata.mat[1][3] = prb->grid_resolution_y;
748  instdata.mat[2][3] = prb->grid_resolution_z;
749  /* Put theme id in matrix. */
750  if (theme_id == TH_ACTIVE) {
751  instdata.mat[3][3] = 1.0;
752  }
753  else /* TH_SELECT */ {
754  instdata.mat[3][3] = 2.0;
755  }
756 
757  uint cell_count = prb->grid_resolution_x * prb->grid_resolution_y * prb->grid_resolution_z;
759  DRW_shgroup_uniform_mat4_copy(grp, "gridModelMatrix", instdata.mat);
760  DRW_shgroup_call_procedural_points(grp, NULL, cell_count);
761  }
762  break;
764  DRW_buffer_add_entry(cb->probe_planar, color_p, &instdata);
765 
767  DRW_buffer_add_entry(cb->solid_quad, color_p, &instdata);
768  }
769 
770  if (show_influence) {
771  normalize_v3_length(instdata.mat[2], prb->distinf);
772  DRW_buffer_add_entry(cb->empty_cube, color_p, &instdata);
773  mul_v3_fl(instdata.mat[2], 1.0f - prb->falloff);
774  DRW_buffer_add_entry(cb->empty_cube, color_p, &instdata);
775  }
776  zero_v3(instdata.mat[2]);
777  DRW_buffer_add_entry(cb->empty_cube, color_p, &instdata);
778 
779  normalize_m4_m4(instdata.mat, ob->obmat);
780  OVERLAY_empty_shape(cb, instdata.mat, ob->empty_drawsize, OB_SINGLE_ARROW, color_p);
781  break;
782  }
783 }
784 
787 /* -------------------------------------------------------------------- */
792 {
794  const DRWContextState *draw_ctx = DRW_context_state_get();
795  ViewLayer *view_layer = draw_ctx->view_layer;
796  float *color_p;
797  DRW_object_wire_theme_get(ob, view_layer, &color_p);
798 
799  DRW_buffer_add_entry(cb->speaker, color_p, ob->obmat);
800 }
801 
804 /* -------------------------------------------------------------------- */
809  /* Pack render data into object matrix and object color. */
810  struct {
811  float color[4];
812  float mat[4][4];
813  };
814  struct {
815  float _pad0[2];
816  float volume_sta;
817  union {
818  float depth;
819  float focus;
820  float volume_end;
821  };
822  float _pad00[3];
823  union {
824  float corner_x;
826  };
827  float _pad01[3];
828  union {
829  float corner_y;
830  };
831  float _pad02[3];
832  union {
833  float center_x;
834  float clip_sta;
835  float mist_sta;
836  };
837  float pos[3];
838  union {
839  float center_y;
840  float clip_end;
841  float mist_end;
842  };
843  };
845 
847  OVERLAY_ExtraCallBuffers *cb, Scene *scene, View3D *v3d, Object *ob, const float color[4])
848 {
849  const DRWContextState *draw_ctx = DRW_context_state_get();
850  const bool is_select = DRW_state_is_select();
851 
852  MovieClip *clip = BKE_object_movieclip_get(scene, ob, false);
853  if (clip == NULL) {
854  return;
855  }
856 
857  const bool is_solid_bundle = (v3d->bundle_drawtype == OB_EMPTY_SPHERE) &&
858  ((v3d->shading.type != OB_SOLID) || !XRAY_FLAG_ENABLED(v3d));
859 
860  MovieTracking *tracking = &clip->tracking;
861  /* Index must start in 1, to mimic BKE_tracking_track_get_indexed. */
862  int track_index = 1;
863 
864  float bundle_color_custom[3];
865  float *bundle_color_solid = G_draw.block.color_bundle_solid;
866  float *bundle_color_unselected = G_draw.block.color_wire;
867  uchar text_color_selected[4], text_color_unselected[4];
868  /* Color Management: Exception here as texts are drawn in sRGB space directly. */
869  UI_GetThemeColor4ubv(TH_SELECT, text_color_selected);
870  UI_GetThemeColor4ubv(TH_TEXT, text_color_unselected);
871 
872  float camera_mat[4][4];
874 
875  LISTBASE_FOREACH (MovieTrackingObject *, tracking_object, &tracking->objects) {
876  float tracking_object_mat[4][4];
877 
878  if (tracking_object->flag & TRACKING_OBJECT_CAMERA) {
879  copy_m4_m4(tracking_object_mat, camera_mat);
880  }
881  else {
882  const int framenr = BKE_movieclip_remap_scene_to_clip_frame(
883  clip, DEG_get_ctime(draw_ctx->depsgraph));
884 
885  float object_mat[4][4];
887  tracking, tracking_object, framenr, object_mat);
888 
889  float object_imat[4][4];
890  invert_m4_m4(object_imat, object_mat);
891 
892  mul_m4_m4m4(tracking_object_mat, ob->obmat, object_imat);
893  }
894 
895  ListBase *tracksbase = BKE_tracking_object_get_tracks(tracking, tracking_object);
896  LISTBASE_FOREACH (MovieTrackingTrack *, track, tracksbase) {
897  if ((track->flag & TRACK_HAS_BUNDLE) == 0) {
898  continue;
899  }
900  bool is_selected = TRACK_SELECTED(track);
901 
902  float bundle_mat[4][4];
903  copy_m4_m4(bundle_mat, tracking_object_mat);
904  translate_m4(bundle_mat, track->bundle_pos[0], track->bundle_pos[1], track->bundle_pos[2]);
905 
906  const float *bundle_color;
907  if (track->flag & TRACK_CUSTOMCOLOR) {
908  /* Meh, hardcoded srgb transform here. */
909  /* TODO: change the actual DNA color to be linear. */
910  srgb_to_linearrgb_v3_v3(bundle_color_custom, track->color);
911  bundle_color = bundle_color_custom;
912  }
913  else if (is_solid_bundle) {
914  bundle_color = bundle_color_solid;
915  }
916  else if (is_selected) {
917  bundle_color = color;
918  }
919  else {
920  bundle_color = bundle_color_unselected;
921  }
922 
923  if (is_select) {
924  DRW_select_load_id(ob->runtime.select_id | (track_index << 16));
925  track_index++;
926  }
927 
928  if (is_solid_bundle) {
929  if (is_selected) {
930  OVERLAY_empty_shape(cb, bundle_mat, v3d->bundle_size, v3d->bundle_drawtype, color);
931  }
932 
933  const float bundle_color_v4[4] = {
934  bundle_color[0],
935  bundle_color[1],
936  bundle_color[2],
937  1.0f,
938  };
939 
940  bundle_mat[3][3] = v3d->bundle_size; /* See shader. */
941  DRW_buffer_add_entry(cb->empty_sphere_solid, bundle_color_v4, bundle_mat);
942  }
943  else {
944  OVERLAY_empty_shape(cb, bundle_mat, v3d->bundle_size, v3d->bundle_drawtype, bundle_color);
945  }
946 
947  if ((v3d->flag2 & V3D_SHOW_BUNDLENAME) && !is_select) {
948  struct DRWTextStore *dt = DRW_text_cache_ensure();
949 
951  bundle_mat[3],
952  track->name,
953  strlen(track->name),
954  10,
955  0,
957  is_selected ? text_color_selected : text_color_unselected);
958  }
959  }
960 
961  if ((v3d->flag2 & V3D_SHOW_CAMERAPATH) && (tracking_object->flag & TRACKING_OBJECT_CAMERA) &&
962  !is_select) {
964  reconstruction = BKE_tracking_object_get_reconstruction(tracking, tracking_object);
965 
966  if (reconstruction->camnr) {
968  float v0[3], v1[3];
969  for (int a = 0; a < reconstruction->camnr; a++, camera++) {
970  copy_v3_v3(v0, v1);
971  copy_v3_v3(v1, camera->mat[3]);
972  mul_m4_v3(camera_mat, v1);
973  if (a > 0) {
974  /* This one is suboptimal (gl_lines instead of gl_line_strip)
975  * but we keep this for simplicity */
977  }
978  }
979  }
980  }
981  }
982 }
983 
985  Object *ob,
986  const OVERLAY_CameraInstanceData *instdata,
987  bool right_eye)
988 {
989  Camera *cam = ob->data;
991  const char *viewnames[2] = {STEREO_LEFT_NAME, STEREO_RIGHT_NAME};
992  const float shiftx = BKE_camera_multiview_shift_x(&scene->r, ob, viewnames[right_eye]);
993  const float delta_shiftx = shiftx - cam->shiftx;
994  const float width = instdata->corner_x * 2.0f;
995  return delta_shiftx * width;
996  }
997 
998  return 0.0;
999 }
1005  Scene *scene,
1006  View3D *v3d,
1007  Object *ob,
1008  const OVERLAY_CameraInstanceData *instdata)
1009 {
1010  OVERLAY_CameraInstanceData stereodata = *instdata;
1011  Camera *cam = ob->data;
1012  const bool is_select = DRW_state_is_select();
1013  const char *viewnames[2] = {STEREO_LEFT_NAME, STEREO_RIGHT_NAME};
1014 
1015  const bool is_stereo3d_cameras = (v3d->stereo3d_flag & V3D_S3D_DISPCAMERAS) != 0;
1016  const bool is_stereo3d_plane = (v3d->stereo3d_flag & V3D_S3D_DISPPLANE) != 0;
1017  const bool is_stereo3d_volume = (v3d->stereo3d_flag & V3D_S3D_DISPVOLUME) != 0;
1018 
1019  if (!is_stereo3d_cameras) {
1020  /* Draw single camera. */
1022  }
1023 
1024  for (int eye = 0; eye < 2; eye++) {
1025  ob = BKE_camera_multiview_render(scene, ob, viewnames[eye]);
1026  BKE_camera_multiview_model_matrix(&scene->r, ob, viewnames[eye], stereodata.mat);
1027 
1028  stereodata.corner_x = instdata->corner_x;
1029  stereodata.corner_y = instdata->corner_y;
1030  stereodata.center_x = instdata->center_x + camera_offaxis_shiftx_get(scene, ob, instdata, eye);
1031  stereodata.center_y = instdata->center_y;
1032  stereodata.depth = instdata->depth;
1033 
1034  if (is_stereo3d_cameras) {
1035  DRW_buffer_add_entry_struct(cb->camera_frame, &stereodata);
1036 
1037  /* Connecting line between cameras. */
1038  OVERLAY_extra_line_dashed(cb, stereodata.pos, instdata->pos, G_draw.block.color_wire);
1039  }
1040 
1041  if (is_stereo3d_volume && !is_select) {
1042  float r = (eye == 1) ? 2.0f : 1.0f;
1043 
1044  stereodata.volume_sta = -cam->clip_start;
1045  stereodata.volume_end = -cam->clip_end;
1046  /* Encode eye + intensity and alpha (see shader) */
1047  copy_v2_fl2(stereodata.color, r + 0.15f, 1.0f);
1049 
1050  if (v3d->stereo3d_volume_alpha > 0.0f) {
1051  /* Encode eye + intensity and alpha (see shader) */
1052  copy_v2_fl2(stereodata.color, r + 0.999f, v3d->stereo3d_volume_alpha);
1053  DRW_buffer_add_entry_struct(cb->camera_volume, &stereodata);
1054  }
1055  /* restore */
1056  copy_v3_v3(stereodata.color, instdata->color);
1057  }
1058  }
1059 
1060  if (is_stereo3d_plane && !is_select) {
1061  if (cam->stereo.convergence_mode == CAM_S3D_TOE) {
1062  /* There is no real convergence plane but we highlight the center
1063  * point where the views are pointing at. */
1064  // zero_v3(stereodata.mat[0]); /* We reconstruct from Z and Y */
1065  // zero_v3(stereodata.mat[1]); /* Y doesn't change */
1066  zero_v3(stereodata.mat[2]);
1067  zero_v3(stereodata.mat[3]);
1068  for (int i = 0; i < 2; i++) {
1069  float mat[4][4];
1070  /* Need normalized version here. */
1071  BKE_camera_multiview_model_matrix(&scene->r, ob, viewnames[i], mat);
1072  add_v3_v3(stereodata.mat[2], mat[2]);
1073  madd_v3_v3fl(stereodata.mat[3], mat[3], 0.5f);
1074  }
1075  normalize_v3(stereodata.mat[2]);
1076  cross_v3_v3v3(stereodata.mat[0], stereodata.mat[1], stereodata.mat[2]);
1077  }
1078  else if (cam->stereo.convergence_mode == CAM_S3D_PARALLEL) {
1079  /* Show plane at the given distance between the views even if it makes no sense. */
1080  zero_v3(stereodata.pos);
1081  for (int i = 0; i < 2; i++) {
1082  float mat[4][4];
1083  BKE_camera_multiview_model_matrix_scaled(&scene->r, ob, viewnames[i], mat);
1084  madd_v3_v3fl(stereodata.pos, mat[3], 0.5f);
1085  }
1086  }
1087  else if (cam->stereo.convergence_mode == CAM_S3D_OFFAXIS) {
1088  /* Nothing to do. Everything is already setup. */
1089  }
1090  stereodata.volume_sta = -cam->stereo.convergence_distance;
1091  stereodata.volume_end = -cam->stereo.convergence_distance;
1092  /* Encode eye + intensity and alpha (see shader) */
1093  copy_v2_fl2(stereodata.color, 0.1f, 1.0f);
1095 
1096  if (v3d->stereo3d_convergence_alpha > 0.0f) {
1097  /* Encode eye + intensity and alpha (see shader) */
1098  copy_v2_fl2(stereodata.color, 0.0f, v3d->stereo3d_convergence_alpha);
1099  DRW_buffer_add_entry_struct(cb->camera_volume, &stereodata);
1100  }
1101  }
1102 }
1103 
1105 {
1107  OVERLAY_CameraInstanceData instdata;
1108 
1109  const DRWContextState *draw_ctx = DRW_context_state_get();
1110  ViewLayer *view_layer = draw_ctx->view_layer;
1111  View3D *v3d = draw_ctx->v3d;
1112  Scene *scene = draw_ctx->scene;
1113  RegionView3D *rv3d = draw_ctx->rv3d;
1114 
1115  Camera *cam = ob->data;
1116  Object *camera_object = DEG_get_evaluated_object(draw_ctx->depsgraph, v3d->camera);
1117  const bool is_select = DRW_state_is_select();
1118  const bool is_active = (ob == camera_object);
1119  const bool look_through = (is_active && (rv3d->persp == RV3D_CAMOB));
1120 
1121  const bool is_multiview = (scene->r.scemode & R_MULTIVIEW) != 0;
1122  const bool is_stereo3d_view = (scene->r.views_format == SCE_VIEWS_FORMAT_STEREO_3D);
1123  const bool is_stereo3d_display_extra = is_active && is_multiview && (!look_through) &&
1124  ((v3d->stereo3d_flag) != 0);
1125  const bool is_selection_camera_stereo = is_select && look_through && is_multiview &&
1126  is_stereo3d_view;
1127 
1128  float vec[4][3], asp[2], shift[2], scale[3], drawsize, center[2], corner[2];
1129 
1130  float *color_p;
1131  DRW_object_wire_theme_get(ob, view_layer, &color_p);
1132  copy_v4_v4(instdata.color, color_p);
1133 
1134  normalize_m4_m4(instdata.mat, ob->obmat);
1135 
1136  /* BKE_camera_multiview_model_matrix already accounts for scale, don't do it here. */
1137  if (is_selection_camera_stereo) {
1138  copy_v3_fl(scale, 1.0f);
1139  }
1140  else {
1141  copy_v3_fl3(scale, len_v3(ob->obmat[0]), len_v3(ob->obmat[1]), len_v3(ob->obmat[2]));
1142  /* Avoid division by 0. */
1143  if (ELEM(0.0f, scale[0], scale[1], scale[2])) {
1144  return;
1145  }
1146  invert_v3(scale);
1147  }
1148 
1150  scene, cam, cam->drawsize, look_through, scale, asp, shift, &drawsize, vec);
1151 
1152  /* Apply scale to simplify the rest of the drawing. */
1153  invert_v3(scale);
1154  for (int i = 0; i < 4; i++) {
1155  mul_v3_v3(vec[i], scale);
1156  /* Project to z=-1 plane. Makes positioning / scaling easier. (see shader) */
1157  mul_v2_fl(vec[i], 1.0f / fabsf(vec[i][2]));
1158  }
1159 
1160  /* Frame coords */
1161  mid_v2_v2v2(center, vec[0], vec[2]);
1162  sub_v2_v2v2(corner, vec[0], center);
1163  instdata.corner_x = corner[0];
1164  instdata.corner_y = corner[1];
1165  instdata.center_x = center[0];
1166  instdata.center_y = center[1];
1167  instdata.depth = vec[0][2];
1168 
1169  if (look_through) {
1170  if (!DRW_state_is_image_render()) {
1171  /* Only draw the frame. */
1172  if (is_multiview) {
1173  float mat[4][4];
1174  const bool is_right = v3d->multiview_eye == STEREO_RIGHT_ID;
1175  const char *view_name = is_right ? STEREO_RIGHT_NAME : STEREO_LEFT_NAME;
1176  BKE_camera_multiview_model_matrix(&scene->r, ob, view_name, mat);
1177  instdata.center_x += camera_offaxis_shiftx_get(scene, ob, &instdata, is_right);
1178  for (int i = 0; i < 4; i++) {
1179  /* Partial copy to avoid overriding packed data. */
1180  copy_v3_v3(instdata.mat[i], mat[i]);
1181  }
1182  }
1183  instdata.depth = -instdata.depth; /* Hides the back of the camera wires (see shader). */
1184  DRW_buffer_add_entry_struct(cb->camera_frame, &instdata);
1185  }
1186  }
1187  else {
1188  /* Stereo cameras, volumes, plane drawing. */
1189  if (is_stereo3d_display_extra) {
1190  camera_stereoscopy_extra(cb, scene, v3d, ob, &instdata);
1191  }
1192  else {
1193  DRW_buffer_add_entry_struct(cb->camera_frame, &instdata);
1194  }
1195  }
1196 
1197  if (!look_through) {
1198  /* Triangle. */
1199  float tria_size = 0.7f * drawsize / fabsf(instdata.depth);
1200  float tria_margin = 0.1f * drawsize / fabsf(instdata.depth);
1201  instdata.center_x = center[0];
1202  instdata.center_y = center[1] + instdata.corner_y + tria_margin + tria_size;
1203  instdata.corner_x = instdata.corner_y = -tria_size;
1204  DRW_buffer_add_entry_struct(cb->camera_tria[is_active], &instdata);
1205  }
1206 
1207  if (cam->flag & CAM_SHOWLIMITS) {
1208  /* Scale focus point. */
1209  mul_v3_fl(instdata.mat[0], cam->drawsize);
1210  mul_v3_fl(instdata.mat[1], cam->drawsize);
1211 
1212  instdata.dist_color_id = (is_active) ? 3 : 2;
1213  instdata.focus = -BKE_camera_object_dof_distance(ob);
1214  instdata.clip_sta = cam->clip_start;
1215  instdata.clip_end = cam->clip_end;
1217  }
1218 
1219  if (cam->flag & CAM_SHOWMIST) {
1220  World *world = scene->world;
1221  if (world) {
1222  instdata.dist_color_id = (is_active) ? 1 : 0;
1223  instdata.focus = 1.0f; /* Disable */
1224  instdata.mist_sta = world->miststa;
1225  instdata.mist_end = world->miststa + world->mistdist;
1227  }
1228  }
1229 
1230  /* Motion Tracking. */
1231  if ((v3d->flag2 & V3D_SHOW_RECONSTRUCTION) != 0) {
1232  camera_view3d_reconstruction(cb, scene, v3d, ob, color_p);
1233  }
1234 
1235  /* Background images. */
1236  if (look_through && (cam->flag & CAM_SHOW_BG_IMAGE) && !BLI_listbase_is_empty(&cam->bg_images)) {
1238  }
1239 }
1240 
1243 /* -------------------------------------------------------------------- */
1249  Scene *scene,
1250  Object *ob)
1251 {
1252  float *relation_color = G_draw.block.color_wire;
1253  float *constraint_color = G_draw.block.color_grid_axis_z; /* ? */
1254 
1256  float *parent_pos = ob->runtime.parent_display_origin;
1257  OVERLAY_extra_line_dashed(cb, parent_pos, ob->obmat[3], relation_color);
1258  }
1259 
1260  /* Drawing the hook lines. */
1261  for (ModifierData *md = ob->modifiers.first; md; md = md->next) {
1262  if (md->type == eModifierType_Hook) {
1263  HookModifierData *hmd = (HookModifierData *)md;
1264  float center[3];
1265  mul_v3_m4v3(center, ob->obmat, hmd->cent);
1266  if (hmd->object) {
1267  OVERLAY_extra_line_dashed(cb, hmd->object->obmat[3], center, relation_color);
1268  }
1269  OVERLAY_extra_point(cb, center, relation_color);
1270  }
1271  }
1272  for (GpencilModifierData *md = ob->greasepencil_modifiers.first; md; md = md->next) {
1273  if (md->type == eGpencilModifierType_Hook) {
1275  float center[3];
1276  mul_v3_m4v3(center, ob->obmat, hmd->cent);
1277  if (hmd->object) {
1278  OVERLAY_extra_line_dashed(cb, hmd->object->obmat[3], center, relation_color);
1279  }
1280  OVERLAY_extra_point(cb, center, relation_color);
1281  }
1282  }
1283 
1284  if (ob->rigidbody_constraint) {
1285  Object *rbc_ob1 = ob->rigidbody_constraint->ob1;
1286  Object *rbc_ob2 = ob->rigidbody_constraint->ob2;
1287  if (rbc_ob1 && (DRW_object_visibility_in_active_context(rbc_ob1) & OB_VISIBLE_SELF)) {
1288  OVERLAY_extra_line_dashed(cb, rbc_ob1->obmat[3], ob->obmat[3], relation_color);
1289  }
1290  if (rbc_ob2 && (DRW_object_visibility_in_active_context(rbc_ob2) & OB_VISIBLE_SELF)) {
1291  OVERLAY_extra_line_dashed(cb, rbc_ob2->obmat[3], ob->obmat[3], relation_color);
1292  }
1293  }
1294 
1295  /* Drawing the constraint lines */
1296  if (!BLI_listbase_is_empty(&ob->constraints)) {
1297  bConstraint *curcon;
1298  bConstraintOb *cob;
1299  ListBase *list = &ob->constraints;
1300 
1302 
1303  for (curcon = list->first; curcon; curcon = curcon->next) {
1305  /* special case for object solver and follow track constraints because they don't fill
1306  * constraint targets properly (design limitation -- scene is needed for their target
1307  * but it can't be accessed from get_targets callback) */
1308  Object *camob = NULL;
1309 
1310  if (curcon->type == CONSTRAINT_TYPE_FOLLOWTRACK) {
1312  camob = data->camera ? data->camera : scene->camera;
1313  }
1314  else if (curcon->type == CONSTRAINT_TYPE_OBJECTSOLVER) {
1316  camob = data->camera ? data->camera : scene->camera;
1317  }
1318 
1319  if (camob) {
1320  OVERLAY_extra_line_dashed(cb, camob->obmat[3], ob->obmat[3], constraint_color);
1321  }
1322  }
1323  else {
1324  const bConstraintTypeInfo *cti = BKE_constraint_typeinfo_get(curcon);
1325  ListBase targets = {NULL, NULL};
1326 
1327  if ((curcon->ui_expand_flag & (1 << 0)) && BKE_constraint_targets_get(curcon, &targets)) {
1328  bConstraintTarget *ct;
1329 
1331 
1332  for (ct = targets.first; ct; ct = ct->next) {
1333  /* calculate target's matrix */
1334  if (ct->flag & CONSTRAINT_TAR_CUSTOM_SPACE) {
1336  }
1337  else if (cti->get_target_matrix) {
1338  cti->get_target_matrix(depsgraph, curcon, cob, ct, DEG_get_ctime(depsgraph));
1339  }
1340  else {
1341  unit_m4(ct->matrix);
1342  }
1343  OVERLAY_extra_line_dashed(cb, ct->matrix[3], ob->obmat[3], constraint_color);
1344  }
1345 
1346  BKE_constraint_targets_flush(curcon, &targets, 1);
1347  }
1348  }
1349  }
1350  /* NOTE: Don't use BKE_constraints_clear_evalob here as that will reset ob->constinv. */
1351  MEM_freeN(cob);
1352  }
1353 }
1354 
1357 /* -------------------------------------------------------------------- */
1362  OVERLAY_Data *data,
1363  Object *ob,
1364  ModifierData *md,
1365  Scene *scene,
1366  const float *color)
1367 {
1368  FluidModifierData *fmd = (FluidModifierData *)md;
1369  FluidDomainSettings *fds = fmd->domain;
1370 
1371  /* Don't show smoke before simulation starts, this could be made an option in the future. */
1372  const bool draw_velocity = (fds->draw_velocity && fds->fluid &&
1373  scene->r.cfra >= fds->point_cache[0]->startframe);
1374 
1375  /* Show gridlines only for slices with no interpolation. */
1376  const bool show_gridlines = (fds->show_gridlines && fds->fluid &&
1380 
1381  const bool color_with_flags = (fds->gridlines_color_field == FLUID_GRIDLINE_COLOR_TYPE_FLAGS);
1382 
1383  const bool color_range = (fds->gridlines_color_field == FLUID_GRIDLINE_COLOR_TYPE_RANGE &&
1384  fds->use_coba && fds->coba_field != FLUID_DOMAIN_FIELD_FLAGS);
1385 
1386  /* Small cube showing voxel size. */
1387  {
1388  float min[3];
1389  madd_v3fl_v3fl_v3fl_v3i(min, fds->p0, fds->cell_size, fds->res_min);
1390  float voxel_cubemat[4][4] = {{0.0f}};
1391  /* scale small cube to voxel size */
1392  voxel_cubemat[0][0] = fds->cell_size[0] / 2.0f;
1393  voxel_cubemat[1][1] = fds->cell_size[1] / 2.0f;
1394  voxel_cubemat[2][2] = fds->cell_size[2] / 2.0f;
1395  voxel_cubemat[3][3] = 1.0f;
1396  /* translate small cube to corner */
1397  copy_v3_v3(voxel_cubemat[3], min);
1398  /* move small cube into the domain (otherwise its centered on vertex of domain object) */
1399  translate_m4(voxel_cubemat, 1.0f, 1.0f, 1.0f);
1400  mul_m4_m4m4(voxel_cubemat, ob->obmat, voxel_cubemat);
1401 
1402  DRW_buffer_add_entry(cb->empty_cube, color, voxel_cubemat);
1403  }
1404 
1405  int slice_axis = -1;
1406 
1407  if (fds->axis_slice_method == AXIS_SLICE_SINGLE) {
1408  float viewinv[4][4];
1409  DRW_view_viewmat_get(NULL, viewinv, true);
1410 
1411  const int axis = (fds->slice_axis == SLICE_AXIS_AUTO) ? axis_dominant_v3_single(viewinv[2]) :
1412  fds->slice_axis - 1;
1413  slice_axis = axis;
1414  }
1415 
1416  if (draw_velocity) {
1417  const bool use_needle = (fds->vector_draw_type == VECTOR_DRAW_NEEDLE);
1418  const bool use_mac = (fds->vector_draw_type == VECTOR_DRAW_MAC);
1419  const bool draw_mac_x = (fds->vector_draw_mac_components & VECTOR_DRAW_MAC_X);
1420  const bool draw_mac_y = (fds->vector_draw_mac_components & VECTOR_DRAW_MAC_Y);
1421  const bool draw_mac_z = (fds->vector_draw_mac_components & VECTOR_DRAW_MAC_Z);
1422  const bool cell_centered = (fds->vector_field == FLUID_DOMAIN_VECTOR_FIELD_FORCE);
1423  int line_count = 1;
1424  if (use_needle) {
1425  line_count = 6;
1426  }
1427  else if (use_mac) {
1428  line_count = 3;
1429  }
1430  line_count *= fds->res[0] * fds->res[1] * fds->res[2];
1431 
1432  if (fds->axis_slice_method == AXIS_SLICE_SINGLE) {
1433  line_count /= fds->res[slice_axis];
1434  }
1435 
1437 
1438  GPUShader *sh = OVERLAY_shader_volume_velocity(use_needle, use_mac);
1439  DRWShadingGroup *grp = DRW_shgroup_create(sh, data->psl->extra_ps[0]);
1440  DRW_shgroup_uniform_texture(grp, "velocityX", fds->tex_velocity_x);
1441  DRW_shgroup_uniform_texture(grp, "velocityY", fds->tex_velocity_y);
1442  DRW_shgroup_uniform_texture(grp, "velocityZ", fds->tex_velocity_z);
1443  DRW_shgroup_uniform_float_copy(grp, "displaySize", fds->vector_scale);
1444  DRW_shgroup_uniform_float_copy(grp, "slicePosition", fds->slice_depth);
1445  DRW_shgroup_uniform_vec3_copy(grp, "cellSize", fds->cell_size);
1446  DRW_shgroup_uniform_vec3_copy(grp, "domainOriginOffset", fds->p0);
1447  DRW_shgroup_uniform_ivec3_copy(grp, "adaptiveCellOffset", fds->res_min);
1448  DRW_shgroup_uniform_int_copy(grp, "sliceAxis", slice_axis);
1449  DRW_shgroup_uniform_bool_copy(grp, "scaleWithMagnitude", fds->vector_scale_with_magnitude);
1450  DRW_shgroup_uniform_bool_copy(grp, "isCellCentered", cell_centered);
1451 
1452  if (use_mac) {
1453  DRW_shgroup_uniform_bool_copy(grp, "drawMACX", draw_mac_x);
1454  DRW_shgroup_uniform_bool_copy(grp, "drawMACY", draw_mac_y);
1455  DRW_shgroup_uniform_bool_copy(grp, "drawMACZ", draw_mac_z);
1456  }
1457 
1458  DRW_shgroup_call_procedural_lines(grp, ob, line_count);
1459  }
1460 
1461  if (show_gridlines) {
1462  GPUShader *sh = OVERLAY_shader_volume_gridlines(color_with_flags, color_range);
1463  DRWShadingGroup *grp = DRW_shgroup_create(sh, data->psl->extra_ps[0]);
1464  DRW_shgroup_uniform_ivec3_copy(grp, "volumeSize", fds->res);
1465  DRW_shgroup_uniform_float_copy(grp, "slicePosition", fds->slice_depth);
1466  DRW_shgroup_uniform_vec3_copy(grp, "cellSize", fds->cell_size);
1467  DRW_shgroup_uniform_vec3_copy(grp, "domainOriginOffset", fds->p0);
1468  DRW_shgroup_uniform_ivec3_copy(grp, "adaptiveCellOffset", fds->res_min);
1469  DRW_shgroup_uniform_int_copy(grp, "sliceAxis", slice_axis);
1470 
1471  if (color_with_flags || color_range) {
1473  DRW_shgroup_uniform_texture(grp, "flagTexture", fds->tex_flags);
1474  }
1475 
1476  if (color_range) {
1478  DRW_shgroup_uniform_texture(grp, "fieldTexture", fds->tex_range_field);
1479  DRW_shgroup_uniform_float_copy(grp, "lowerBound", fds->gridlines_lower_bound);
1480  DRW_shgroup_uniform_float_copy(grp, "upperBound", fds->gridlines_upper_bound);
1481  DRW_shgroup_uniform_vec4_copy(grp, "rangeColor", fds->gridlines_range_color);
1482  DRW_shgroup_uniform_int_copy(grp, "cellFilter", fds->gridlines_cell_filter);
1483  }
1484 
1485  const int line_count = 4 * fds->res[0] * fds->res[1] * fds->res[2] / fds->res[slice_axis];
1486  DRW_shgroup_call_procedural_lines(grp, ob, line_count);
1487  }
1488 
1489  if (draw_velocity || show_gridlines) {
1490  }
1491 }
1492 
1495 /* -------------------------------------------------------------------- */
1496 
1498  Object *ob,
1499  OVERLAY_PrivateData *pd,
1500  ViewLayer *view_layer)
1501 {
1502  const bool is_library = ID_REAL_USERS(&ob->id) > 1 || ID_IS_LINKED(ob);
1503 
1504  if (ob == OBACT(view_layer)) {
1506  }
1507  else if (ob->base_flag & BASE_SELECTED) {
1508  DRWCallBuffer *cbuf = (is_library) ? cb->center_selected_lib : cb->center_selected;
1509  DRW_buffer_add_entry(cbuf, ob->obmat[3]);
1510  }
1511  else if (pd->v3d_flag & V3D_DRAW_CENTERS) {
1512  DRWCallBuffer *cbuf = (is_library) ? cb->center_deselected_lib : cb->center_deselected;
1513  DRW_buffer_add_entry(cbuf, ob->obmat[3]);
1514  }
1515 }
1516 
1517 static void OVERLAY_object_name(Object *ob, int theme_id)
1518 {
1519  struct DRWTextStore *dt = DRW_text_cache_ensure();
1520  uchar color[4];
1521  /* Color Management: Exception here as texts are drawn in sRGB space directly. */
1522  UI_GetThemeColor4ubv(theme_id, color);
1523 
1524  DRW_text_cache_add(dt,
1525  ob->obmat[3],
1526  ob->id.name + 2,
1527  strlen(ob->id.name + 2),
1528  10,
1529  0,
1531  color);
1532 }
1533 
1535 {
1537  OVERLAY_PrivateData *pd = vedata->stl->pd;
1538  const DRWContextState *draw_ctx = DRW_context_state_get();
1539  ViewLayer *view_layer = draw_ctx->view_layer;
1540  Scene *scene = draw_ctx->scene;
1541  ModifierData *md = NULL;
1542 
1543  const bool is_select_mode = DRW_state_is_select();
1544  const bool is_paint_mode = (draw_ctx->object_mode &
1546  const bool from_dupli = (ob->base_flag & (BASE_FROM_SET | BASE_FROM_DUPLI)) != 0;
1547  const bool has_bounds = !ELEM(ob->type, OB_LAMP, OB_CAMERA, OB_EMPTY, OB_SPEAKER, OB_LIGHTPROBE);
1548  const bool has_texspace = has_bounds &&
1550 
1551  const bool draw_relations = ((pd->v3d_flag & V3D_HIDE_HELPLINES) == 0) && !is_select_mode;
1552  const bool draw_obcenters = !is_paint_mode &&
1554  const bool draw_texspace = (ob->dtx & OB_TEXSPACE) && has_texspace;
1555  const bool draw_obname = (ob->dtx & OB_DRAWNAME) && DRW_state_show_text();
1556  const bool draw_bounds = has_bounds && ((ob->dt == OB_BOUNDBOX) ||
1557  ((ob->dtx & OB_DRAWBOUNDOX) && !from_dupli));
1558  const bool draw_xform = draw_ctx->object_mode == OB_MODE_OBJECT &&
1560  (ob->base_flag & BASE_SELECTED) && !is_select_mode;
1561  /* Don't show fluid domain overlay extras outside of cache range. */
1562  const bool draw_volume = !from_dupli &&
1565  (((FluidModifierData *)md)->domain != NULL) &&
1566  (scene->r.cfra >=
1567  (((FluidModifierData *)md)->domain->cache_frame_start)) &&
1568  (scene->r.cfra <= (((FluidModifierData *)md)->domain->cache_frame_end));
1569 
1570  float *color;
1571  int theme_id = DRW_object_wire_theme_get(ob, view_layer, &color);
1572 
1573  if (ob->pd && ob->pd->forcefield) {
1574  OVERLAY_forcefield(cb, ob, view_layer);
1575  }
1576 
1577  if (draw_bounds) {
1578  OVERLAY_bounds(cb, ob, color, ob->boundtype, false);
1579  }
1580  /* Helpers for when we're transforming origins. */
1581  if (draw_xform) {
1582  const float color_xform[4] = {0.15f, 0.15f, 0.15f, 0.7f};
1583  DRW_buffer_add_entry(cb->origin_xform, color_xform, ob->obmat);
1584  }
1585  /* don't show object extras in set's */
1586  if (!from_dupli) {
1587  if (draw_obcenters) {
1588  OVERLAY_object_center(cb, ob, pd, view_layer);
1589  }
1590  if (draw_relations) {
1591  OVERLAY_relationship_lines(cb, draw_ctx->depsgraph, draw_ctx->scene, ob);
1592  }
1593  if (draw_obname) {
1594  OVERLAY_object_name(ob, theme_id);
1595  }
1596  if (draw_texspace) {
1597  OVERLAY_texture_space(cb, ob, color);
1598  }
1599  if (ob->rigidbody_object != NULL) {
1600  OVERLAY_collision(cb, ob, color);
1601  }
1602  if (ob->dtx & OB_AXIS) {
1604  }
1605  if (draw_volume) {
1606  OVERLAY_volume_extra(cb, vedata, ob, md, scene, color);
1607  }
1608  }
1609 }
1610 
1612 {
1613  DRW_draw_pass(vedata->psl->extra_blend_ps);
1614 }
1615 
1617 {
1618  DRW_draw_pass(vedata->psl->extra_ps[0]);
1619 }
1620 
1622 {
1623  DRW_draw_pass(vedata->psl->extra_ps[1]);
1624 }
1625 
1627 {
1628  OVERLAY_PassList *psl = vedata->psl;
1629 
1632 }
bool BKE_where_on_path(const struct Object *ob, float ctime, float r_vec[4], float r_dir[3], float r_quat[4], float *r_radius, float *r_weight)
Camera data-block and utility functions.
float BKE_camera_multiview_shift_x(const struct RenderData *rd, const struct Object *camera, const char *viewname)
float BKE_camera_object_dof_distance(const struct Object *ob)
struct Object * BKE_camera_multiview_render(const struct Scene *scene, struct Object *camera, const char *viewname)
void BKE_camera_multiview_model_matrix(const struct RenderData *rd, const struct Object *camera, const char *viewname, float r_modelmat[4][4])
void BKE_camera_multiview_model_matrix_scaled(const struct RenderData *rd, const struct Object *camera, const char *viewname, float r_modelmat[4][4])
void BKE_camera_view_frame_ex(const struct Scene *scene, const struct Camera *camera, float drawsize, bool do_clip, const float scale[3], float r_asp[2], float r_shift[2], float *r_drawsize, float r_vec[4][3])
void BKE_constraint_targets_flush(struct bConstraint *con, struct ListBase *targets, bool no_copy)
Definition: constraint.c:6186
int BKE_constraint_targets_get(struct bConstraint *con, struct ListBase *r_targets)
Definition: constraint.c:6157
struct bConstraintOb * BKE_constraints_make_evalob(struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob, void *subdata, short datatype)
Definition: constraint.c:119
void BKE_constraint_custom_object_space_init(struct bConstraintOb *cob, struct bConstraint *con)
Definition: constraint.c:6331
const bConstraintTypeInfo * BKE_constraint_typeinfo_get(struct bConstraint *con)
Definition: constraint.c:5506
void BKE_curve_texspace_ensure(struct Curve *cu)
Definition: curve.cc:555
@ G_TRANSFORM_OBJ
Definition: BKE_global.h:247
bool BKE_mball_is_basis(const struct Object *ob)
void BKE_mesh_texspace_get_reference(struct Mesh *me, char **r_texflag, float **r_loc, float **r_size)
Definition: mesh.cc:1287
bool BKE_modifier_is_enabled(const struct Scene *scene, struct ModifierData *md, int required_mode)
struct ModifierData * BKE_modifiers_findby_type(const struct Object *ob, ModifierType type)
float BKE_movieclip_remap_scene_to_clip_frame(const struct MovieClip *clip, float framenr)
General operations, lookup, etc. for blender objects.
struct MovieClip * BKE_object_movieclip_get(struct Scene *scene, struct Object *ob, bool use_default)
Definition: object.cc:5042
void BKE_boundbox_calc_size_aabb(const struct BoundBox *bb, float r_size[3])
void BKE_boundbox_init_from_minmax(struct BoundBox *bb, const float min[3], const float max[3])
Definition: object.cc:3645
@ OB_VISIBLE_SELF
Definition: BKE_object.h:150
void BKE_boundbox_calc_center_aabb(const struct BoundBox *bb, float r_cent[3])
const struct BoundBox * BKE_object_boundbox_get(struct Object *ob)
Definition: object.cc:3684
struct MovieTrackingReconstruction * BKE_tracking_object_get_reconstruction(struct MovieTracking *tracking, struct MovieTrackingObject *object)
Definition: tracking.c:2131
void BKE_tracking_get_camera_object_matrix(struct Object *camera_object, float mat[4][4])
Definition: tracking.c:375
void BKE_tracking_camera_get_reconstructed_interpolate(struct MovieTracking *tracking, struct MovieTrackingObject *object, float framenr, float mat[4][4])
Definition: tracking.c:2269
#define TRACK_SELECTED(track)
Definition: BKE_tracking.h:823
struct ListBase * BKE_tracking_object_get_tracks(struct MovieTracking *tracking, struct MovieTrackingObject *object)
Definition: tracking.c:2112
#define BLI_assert(a)
Definition: BLI_assert.h:46
BLI_INLINE bool BLI_listbase_is_empty(const struct ListBase *lb)
Definition: BLI_listbase.h:269
#define LISTBASE_FOREACH(type, var, list)
Definition: BLI_listbase.h:336
MINLINE float max_fff(float a, float b, float c)
MINLINE float max_ff(float a, float b)
MINLINE void srgb_to_linearrgb_v3_v3(float linear[3], const float srgb[3])
MINLINE int axis_dominant_v3_single(const float vec[3])
void mul_m4_m4m4(float R[4][4], const float A[4][4], const float B[4][4])
Definition: math_matrix.c:259
void unit_m4(float m[4][4])
Definition: rct.c:1090
void translate_m4(float mat[4][4], float tx, float ty, float tz)
Definition: math_matrix.c:2318
bool invert_m4_m4(float R[4][4], const float A[4][4])
Definition: math_matrix.c:1287
void rescale_m4(float mat[4][4], const float scale[3])
Definition: math_matrix.c:2362
void size_to_mat4(float R[4][4], const float size[3])
Definition: math_matrix.c:2111
void mul_m4_v3(const float M[4][4], float r[3])
Definition: math_matrix.c:729
void scale_m4_fl(float R[4][4], float scale)
Definition: math_matrix.c:2297
void normalize_m4_m4(float R[4][4], const float M[4][4]) ATTR_NONNULL()
Definition: math_matrix.c:1965
void copy_m4_m4(float m1[4][4], const float m2[4][4])
Definition: math_matrix.c:77
void mul_v3_m4v3(float r[3], const float M[4][4], const float v[3])
Definition: math_matrix.c:739
#define DEG2RADF(_deg)
MINLINE void copy_v4_v4(float r[4], const float a[4])
MINLINE void madd_v3_v3fl(float r[3], const float a[3], float f)
MINLINE void copy_v2_fl2(float v[2], float x, float y)
MINLINE void madd_v3fl_v3fl_v3fl_v3i(float r[3], const float a[3], const float b[3], const int c[3])
MINLINE float normalize_v3(float r[3])
MINLINE void mul_v3_v3(float r[3], const float a[3])
MINLINE void mul_v2_fl(float r[2], float f)
MINLINE void copy_v2_v2(float r[2], const float a[2])
MINLINE void mul_v3_fl(float r[3], float f)
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE void copy_v3_fl3(float v[3], float x, float y, float z)
MINLINE void cross_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void negate_v3(float r[3])
MINLINE void invert_v3(float r[3])
void mid_v2_v2v2(float r[2], const float a[2], const float b[2])
Definition: math_vector.c:244
MINLINE float normalize_v3_length(float r[3], float unit_scale)
MINLINE void sub_v2_v2v2(float r[2], const float a[2], const float b[2])
MINLINE void swap_v3_v3(float a[3], float b[3])
MINLINE void copy_v3_fl(float r[3], float f)
MINLINE void zero_v3(float r[3])
MINLINE void add_v3_v3(float r[3], const float a[3])
MINLINE float len_v3(const float a[3]) ATTR_WARN_UNUSED_RESULT
unsigned char uchar
Definition: BLI_sys_types.h:70
unsigned int uint
Definition: BLI_sys_types.h:67
#define UNPACK3(a)
#define ELEM(...)
struct Depsgraph Depsgraph
Definition: DEG_depsgraph.h:35
float DEG_get_ctime(const Depsgraph *graph)
struct Object * DEG_get_evaluated_object(const struct Depsgraph *depsgraph, struct Object *object)
#define ID_IS_LINKED(_id)
Definition: DNA_ID.h:566
#define ID_REAL_USERS(id)
Definition: DNA_ID.h:553
@ ID_VO
Definition: DNA_ID_enums.h:83
@ ID_CV
Definition: DNA_ID_enums.h:81
@ ID_CU_LEGACY
Definition: DNA_ID_enums.h:49
@ ID_ME
Definition: DNA_ID_enums.h:48
@ ID_MB
Definition: DNA_ID_enums.h:50
@ ID_PT
Definition: DNA_ID_enums.h:82
@ CAM_S3D_PARALLEL
@ CAM_S3D_OFFAXIS
@ CAM_S3D_TOE
@ CAM_SHOWLIMITS
@ CAM_SHOW_BG_IMAGE
@ CAM_SHOWMIST
@ CONSTRAINT_TAR_CUSTOM_SPACE
@ CONSTRAINT_TYPE_FOLLOWTRACK
@ CONSTRAINT_TYPE_OBJECTSOLVER
@ CONSTRAINT_OBTYPE_OBJECT
@ CU_PATH
@ FLUID_GRIDLINE_COLOR_TYPE_FLAGS
@ FLUID_GRIDLINE_COLOR_TYPE_RANGE
@ FLUID_DISPLAY_INTERP_CLOSEST
@ FLUID_DOMAIN_FIELD_FLAGS
@ VECTOR_DRAW_NEEDLE
@ VECTOR_DRAW_MAC
@ VECTOR_DRAW_MAC_X
@ VECTOR_DRAW_MAC_Y
@ VECTOR_DRAW_MAC_Z
@ AXIS_SLICE_SINGLE
@ FLUID_DOMAIN_VECTOR_FIELD_FORCE
@ SLICE_AXIS_AUTO
@ eGpencilModifierType_Hook
@ BASE_FROM_DUPLI
@ BASE_FROM_SET
@ BASE_SELECTED
#define LA_AREA
#define LA_SPOT
#define LA_AREA_SQUARE
#define LA_AREA_ELLIPSE
#define LA_SUN
#define LA_LOCAL
#define LA_SHOW_CONE
#define LA_AREA_RECT
@ LIGHTPROBE_SHAPE_BOX
@ LIGHTPROBE_TYPE_CUBE
@ LIGHTPROBE_TYPE_PLANAR
@ LIGHTPROBE_TYPE_GRID
@ LIGHTPROBE_FLAG_SHOW_PARALLAX
@ LIGHTPROBE_FLAG_SHOW_CLIP_DIST
@ LIGHTPROBE_FLAG_SHOW_INFLUENCE
@ LIGHTPROBE_FLAG_SHOW_DATA
@ LIGHTPROBE_FLAG_CUSTOM_PARALLAX
@ eModifierMode_Realtime
@ eModifierType_Fluid
@ eModifierType_Hook
#define OB_MODE_ALL_PAINT
@ OB_BOUNDBOX
@ OB_SOLID
#define OB_MODE_ALL_PAINT_GPENCIL
@ OB_MODE_OBJECT
#define PFIELD_USEMINR
#define PFIELD_FALL_CONE
#define PFIELD_USEMIN
@ PFIELD_FORCE
@ PFIELD_GUIDE
@ PFIELD_VORTEX
#define PFIELD_FALL_TUBE
#define PFIELD_USEMAXR
#define PFIELD_FALL_SPHERE
#define PFIELD_USEMAX
@ OB_EMPTY_CONE
@ OB_SINGLE_ARROW
@ OB_PLAINAXES
@ OB_ARROWS
@ OB_CIRCLE
@ OB_CUBE
@ OB_EMPTY_IMAGE
@ OB_EMPTY_SPHERE
@ OB_SPEAKER
@ OB_LATTICE
@ OB_MBALL
@ OB_EMPTY
@ OB_CAMERA
@ OB_ARMATURE
@ OB_LAMP
@ OB_CURVES_LEGACY
@ OB_GPENCIL
@ OB_LIGHTPROBE
@ OB_DRAWNAME
@ OB_DRAWBOUNDOX
@ OB_AXIS
@ OB_DRAW_IN_FRONT
@ OB_TEXSPACE
@ OB_BOUND_CAPSULE
@ OB_BOUND_SPHERE
@ OB_BOUND_CONE
@ OB_BOUND_BOX
@ OB_BOUND_CYLINDER
@ OB_DUPLICOLLECTION
Types and defines for representing Rigid Body entities.
@ RB_SHAPE_CAPSULE
@ RB_SHAPE_BOX
@ RB_SHAPE_SPHERE
@ RB_SHAPE_CYLINDER
@ RB_SHAPE_CONE
#define STEREO_LEFT_NAME
@ SCE_XFORM_DATA_ORIGIN
#define R_MULTIVIEW
#define OBACT(_view_layer)
#define STEREO_RIGHT_NAME
@ STEREO_RIGHT_ID
@ SCE_VIEWS_FORMAT_STEREO_3D
@ TRACKING_OBJECT_CAMERA
@ TRACK_CUSTOMCOLOR
@ TRACK_HAS_BUNDLE
@ V3D_OVERLAY_HIDE_OBJECT_ORIGINS
#define V3D_S3D_DISPCAMERAS
#define RV3D_CAMOB
#define V3D_HIDE_HELPLINES
#define V3D_DRAW_CENTERS
#define V3D_SHOW_BUNDLENAME
#define V3D_SHOW_CAMERAPATH
#define V3D_SHOW_RECONSTRUCTION
#define V3D_S3D_DISPVOLUME
#define V3D_S3D_DISPPLANE
#define DRW_buffer_add_entry(buffer,...)
Definition: DRW_render.h:486
DRWState
Definition: DRW_render.h:298
@ DRW_STATE_BLEND_ALPHA
Definition: DRW_render.h:328
@ DRW_STATE_CULL_FRONT
Definition: DRW_render.h:317
@ DRW_STATE_IN_FRONT_SELECT
Definition: DRW_render.h:340
@ DRW_STATE_WRITE_DEPTH
Definition: DRW_render.h:302
@ DRW_STATE_WRITE_COLOR
Definition: DRW_render.h:303
@ DRW_STATE_DEPTH_LESS_EQUAL
Definition: DRW_render.h:311
@ DRW_STATE_CULL_BACK
Definition: DRW_render.h:316
@ DRW_STATE_DEPTH_ALWAYS
Definition: DRW_render.h:309
#define DRW_PASS_CREATE(pass, state)
Definition: DRW_render.h:690
#define DRW_shgroup_uniform_block(shgroup, name, ubo)
Definition: DRW_render.h:651
#define DRW_shgroup_call_obmat(shgroup, geom, obmat)
Definition: DRW_render.h:420
#define XRAY_FLAG_ENABLED(v3d)
Definition: ED_view3d.h:1298
NSNotificationCenter * center
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 const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble y2 _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat y2 _GL_VOID_RET _GL_VOID GLint GLint GLint y2 _GL_VOID_RET _GL_VOID GLshort GLshort GLshort y2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLuint *buffer _GL_VOID_RET _GL_VOID GLdouble t _GL_VOID_RET _GL_VOID GLfloat t _GL_VOID_RET _GL_VOID GLint t _GL_VOID_RET _GL_VOID GLshort t _GL_VOID_RET _GL_VOID GLdouble GLdouble r _GL_VOID_RET _GL_VOID GLfloat GLfloat r _GL_VOID_RET _GL_VOID GLint GLint r _GL_VOID_RET _GL_VOID GLshort GLshort r _GL_VOID_RET _GL_VOID GLdouble GLdouble r
_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 const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei width
_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 const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble v1
struct GPUShader GPUShader
Definition: GPU_shader.h:20
struct GPUTexture GPUTexture
Definition: GPU_texture.h:17
in reality light always falls off quadratically Particle Retrieve the data of the particle that spawned the object for example to give variation to multiple instances of an object Point Retrieve information about points in a point cloud Retrieve the edges of an object as it appears to Cycles topology will always appear triangulated Convert a blackbody temperature to an RGB value Normal Generate a perturbed normal from an RGB normal map image Typically used for faking highly detailed surfaces Generate an OSL shader from a file or text data block Image Sample an image file as a texture Sky Generate a procedural sky texture Noise Generate fractal Perlin noise Wave Generate procedural bands or rings with noise Voronoi Generate Worley noise based on the distance to random points Typically used to generate textures such as or biological cells Brick Generate a procedural texture producing bricks Texture Retrieve multiple types of texture coordinates nTypically used as inputs for texture nodes Vector Convert a point
in reality light always falls off quadratically Particle Retrieve the data of the particle that spawned the object for example to give variation to multiple instances of an object Point Retrieve information about points in a point cloud Retrieve the edges of an object as it appears to Cycles topology will always appear triangulated Convert a blackbody temperature to an RGB value Normal Generate a perturbed normal from an RGB normal map image Typically used for faking highly detailed surfaces Generate an OSL shader from a file or text data block Image Sample an image file as a texture Sky Generate a procedural sky texture Noise Generate fractal Perlin noise Wave Generate procedural bands or rings with noise Voronoi Generate Worley noise based on the distance to random points Typically used to generate textures such as or biological cells Brick Generate a procedural texture producing bricks Texture Retrieve multiple types of texture coordinates nTypically used as inputs for texture nodes Vector Convert a or normal between camera
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to used to fine tune the interpolation of the input Camera Retrieve information about the camera and how it relates to the current shading point s position Clamp a value between a minimum and a maximum Vector Perform vector math operation Invert a color
@ TH_CAMERA_PATH
Definition: UI_resources.h:238
@ TH_SELECT
Definition: UI_resources.h:72
@ TH_TEXT
Definition: UI_resources.h:42
@ TH_ACTIVE
Definition: UI_resources.h:73
void UI_GetThemeColor4ubv(int colorid, unsigned char col[4])
Definition: resources.c:1352
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
Definition: btDbvt.cpp:52
#define sinf(x)
Definition: cuda/compat.h:102
#define cosf(x)
Definition: cuda/compat.h:101
Scene scene
World world
const Depsgraph * depsgraph
GPUBatch * DRW_cache_camera_frame_get(void)
Definition: draw_cache.c:2677
GPUBatch * DRW_cache_empty_capsule_body_get(void)
Definition: draw_cache.c:1172
GPUBatch * DRW_cache_groundline_get(void)
Definition: draw_cache.c:1475
GPUBatch * DRW_cache_circle_get(void)
Definition: draw_cache.c:728
GPUBatch * DRW_cache_plain_axes_get(void)
Definition: draw_cache.c:1003
GPUBatch * DRW_cache_empty_sphere_get(void)
Definition: draw_cache.c:1083
GPUBatch * DRW_cache_quad_get(void)
Definition: draw_cache.c:389
GPUBatch * DRW_cache_lightprobe_grid_get(void)
Definition: draw_cache.c:1827
GPUBatch * DRW_cache_light_area_disk_lines_get(void)
Definition: draw_cache.c:1627
GPUBatch * DRW_cache_empty_cylinder_get(void)
Definition: draw_cache.c:1131
GPUBatch * DRW_cache_field_force_get(void)
Definition: draw_cache.c:1284
GPUBatch * DRW_cache_field_tube_limit_get(void)
Definition: draw_cache.c:1356
GPUBatch * DRW_cache_field_cone_limit_get(void)
Definition: draw_cache.c:1390
GPUBatch * DRW_cache_field_sphere_limit_get(void)
Definition: draw_cache.c:1424
GPUBatch * DRW_cache_field_vortex_get(void)
Definition: draw_cache.c:1307
GPUBatch * DRW_cache_light_area_square_lines_get(void)
Definition: draw_cache.c:1659
GPUBatch * DRW_cache_light_spot_lines_get(void)
Definition: draw_cache.c:1554
GPUBatch * DRW_cache_speaker_get(void)
Definition: draw_cache.c:1708
GPUBatch * DRW_cache_camera_volume_wire_get(void)
Definition: draw_cache.c:2734
GPUBatch * DRW_cache_light_spot_volume_get(void)
Definition: draw_cache.c:1600
GPUBatch * DRW_cache_field_wind_get(void)
Definition: draw_cache.c:1261
GPUBatch * DRW_cache_lightprobe_planar_get(void)
Definition: draw_cache.c:1889
GPUBatch * DRW_cache_field_curve_get(void)
Definition: draw_cache.c:1336
GPUBatch * DRW_cache_camera_tria_get(void)
Definition: draw_cache.c:2782
GPUBatch * DRW_cache_camera_volume_get(void)
Definition: draw_cache.c:2709
GPUBatch * DRW_cache_sphere_get(const eDRWLevelOfDetail level_of_detail)
Definition: draw_cache.c:482
GPUBatch * DRW_cache_light_sun_lines_get(void)
Definition: draw_cache.c:1520
GPUBatch * DRW_cache_lightprobe_cube_get(void)
Definition: draw_cache.c:1773
GPUBatch * DRW_cache_camera_tria_wire_get(void)
Definition: draw_cache.c:2758
GPUBatch * DRW_cache_quad_wires_get(void)
Definition: draw_cache.c:409
GPUBatch * DRW_cache_empty_capsule_cap_get(void)
Definition: draw_cache.c:1205
GPUBatch * DRW_cache_single_arrow_get(void)
Definition: draw_cache.c:1045
GPUBatch * DRW_cache_camera_distances_get(void)
Definition: draw_cache.c:2802
GPUBatch * DRW_cache_empty_cone_get(void)
Definition: draw_cache.c:1092
GPUBatch * DRW_cache_light_point_lines_get(void)
Definition: draw_cache.c:1496
GPUBatch * DRW_cache_bone_arrows_get(void)
Definition: draw_cache.c:2518
GPUBatch * DRW_cache_empty_cube_get(void)
Definition: draw_cache.c:1025
@ DRW_LOD_LOW
Definition: draw_cache.h:29
float * DRW_color_background_blend_get(int theme_id)
Definition: draw_common.c:371
int DRW_object_wire_theme_get(Object *ob, ViewLayer *view_layer, float **r_color)
Definition: draw_common.c:279
struct DRW_Global G_draw
Definition: draw_common.c:32
void DRW_fluid_ensure_flags(struct FluidModifierData *fmd)
Definition: draw_fluid.c:519
void DRW_smoke_ensure_velocity(struct FluidModifierData *fmd)
Definition: draw_fluid.c:486
void DRW_fluid_ensure_range_field(struct FluidModifierData *fmd)
Definition: draw_fluid.c:537
bool DRW_state_is_select(void)
bool DRW_state_show_text(void)
int DRW_object_visibility_in_active_context(const Object *ob)
Definition: draw_manager.c:209
bool DRW_state_is_fbo(void)
const DRWContextState * DRW_context_state_get(void)
bool DRW_state_is_image_render(void)
struct DRWTextStore * DRW_text_cache_ensure(void)
DefaultTextureList * DRW_viewport_texture_list_get(void)
Definition: draw_manager.c:638
void DRW_shgroup_uniform_float_copy(DRWShadingGroup *shgroup, const char *name, const float value)
void DRW_shgroup_state_disable(DRWShadingGroup *shgroup, DRWState state)
void DRW_shgroup_uniform_texture(DRWShadingGroup *shgroup, const char *name, const GPUTexture *tex)
void DRW_shgroup_uniform_ivec3_copy(DRWShadingGroup *shgroup, const char *name, const int *value)
void DRW_shgroup_call_procedural_lines(DRWShadingGroup *shgroup, Object *ob, uint line_count)
void DRW_buffer_add_entry_struct(DRWCallBuffer *callbuf, const void *data)
void DRW_shgroup_state_enable(DRWShadingGroup *shgroup, DRWState state)
void DRW_shgroup_uniform_vec3_copy(DRWShadingGroup *shgroup, const char *name, const float *value)
void DRW_shgroup_call_procedural_points(DRWShadingGroup *shgroup, Object *ob, uint point_count)
void DRW_shgroup_uniform_int_copy(DRWShadingGroup *shgroup, const char *name, const int value)
DRWShadingGroup * DRW_shgroup_create(struct GPUShader *shader, DRWPass *pass)
DRWShadingGroup * DRW_shgroup_create_sub(DRWShadingGroup *shgroup)
void DRW_shgroup_uniform_vec4_copy(DRWShadingGroup *shgroup, const char *name, const float *value)
void DRW_shgroup_uniform_bool_copy(DRWShadingGroup *shgroup, const char *name, const bool value)
void DRW_shgroup_uniform_mat4_copy(DRWShadingGroup *shgroup, const char *name, const float(*value)[4])
void DRW_view_viewmat_get(const DRWView *view, float mat[4][4], bool inverse)
void DRW_draw_pass(DRWPass *pass)
void DRW_select_load_id(uint id)
void DRW_text_cache_add(DRWTextStore *dt, const float co[3], const char *str, const int str_len, short xoffs, short yoffs, short flag, const uchar col[4])
@ DRW_TEXT_CACHE_GLOBALSPACE
@ DRW_TEXT_CACHE_STRING_PTR
uint pos
uint col
const ProjectiveReconstruction & reconstruction
Definition: intersect.cc:198
#define GS(x)
Definition: iris.c:225
const int state
ccl_gpu_kernel_postfix ccl_global float int int int int sh
format
Definition: logImageCore.h:38
void(* MEM_freeN)(void *vmemh)
Definition: mallocn.c:27
#define G(x, y, z)
#define fabsf(x)
Definition: metal/compat.h:219
#define sqrtf(x)
Definition: metal/compat.h:243
static unsigned c
Definition: RandGen.cpp:83
static unsigned a[3]
Definition: RandGen.cpp:78
T distance(const T &a, const T &b)
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
void OVERLAY_empty_shape(OVERLAY_ExtraCallBuffers *cb, const float mat[4][4], const float draw_size, const char draw_type, const float color[4])
OVERLAY_ExtraCallBuffers * OVERLAY_extra_call_buffer_get(OVERLAY_Data *vedata, Object *ob)
static void camera_view3d_reconstruction(OVERLAY_ExtraCallBuffers *cb, Scene *scene, View3D *v3d, Object *ob, const float color[4])
static void OVERLAY_forcefield(OVERLAY_ExtraCallBuffers *cb, Object *ob, ViewLayer *view_layer)
void OVERLAY_extra_centers_draw(OVERLAY_Data *vedata)
void OVERLAY_extra_in_front_draw(OVERLAY_Data *vedata)
void OVERLAY_extra_loose_points(OVERLAY_ExtraCallBuffers *cb, struct GPUBatch *geom, const float mat[4][4], const float color[4])
static void OVERLAY_collision(OVERLAY_ExtraCallBuffers *cb, Object *ob, const float *color)
#define BUF_INSTANCE
void OVERLAY_extra_cache_init(OVERLAY_Data *vedata)
Definition: overlay_extra.c:47
void OVERLAY_extra_line(OVERLAY_ExtraCallBuffers *cb, const float start[3], const float end[3], const int color_id)
void OVERLAY_extra_wire(OVERLAY_ExtraCallBuffers *cb, struct GPUBatch *geom, const float mat[4][4], const float color[4])
void OVERLAY_camera_cache_populate(OVERLAY_Data *vedata, Object *ob)
static void OVERLAY_object_name(Object *ob, int theme_id)
void OVERLAY_light_cache_populate(OVERLAY_Data *vedata, Object *ob)
void OVERLAY_extra_line_dashed(OVERLAY_ExtraCallBuffers *cb, const float start[3], const float end[3], const float color[4])
union OVERLAY_CameraInstanceData OVERLAY_CameraInstanceData
static void OVERLAY_relationship_lines(OVERLAY_ExtraCallBuffers *cb, Depsgraph *depsgraph, Scene *scene, Object *ob)
static void camera_stereoscopy_extra(OVERLAY_ExtraCallBuffers *cb, Scene *scene, View3D *v3d, Object *ob, const OVERLAY_CameraInstanceData *instdata)
#define BUF_POINT(grp, format)
#define BUF_LINE(grp, format)
void OVERLAY_extra_point(OVERLAY_ExtraCallBuffers *cb, const float point[3], const float color[4])
static void OVERLAY_bounds(OVERLAY_ExtraCallBuffers *cb, Object *ob, const float *color, char boundtype, bool around_origin)
static void OVERLAY_volume_extra(OVERLAY_ExtraCallBuffers *cb, OVERLAY_Data *data, Object *ob, ModifierData *md, Scene *scene, const float *color)
void OVERLAY_lightprobe_cache_populate(OVERLAY_Data *vedata, Object *ob)
static void OVERLAY_texture_space(OVERLAY_ExtraCallBuffers *cb, Object *ob, const float *color)
static float camera_offaxis_shiftx_get(Scene *scene, Object *ob, const OVERLAY_CameraInstanceData *instdata, bool right_eye)
void OVERLAY_extra_cache_populate(OVERLAY_Data *vedata, Object *ob)
static void OVERLAY_object_center(OVERLAY_ExtraCallBuffers *cb, Object *ob, OVERLAY_PrivateData *pd, ViewLayer *view_layer)
void OVERLAY_extra_blend_draw(OVERLAY_Data *vedata)
void OVERLAY_extra_draw(OVERLAY_Data *vedata)
void OVERLAY_empty_cache_populate(OVERLAY_Data *vedata, Object *ob)
void OVERLAY_speaker_cache_populate(OVERLAY_Data *vedata, Object *ob)
void OVERLAY_image_camera_cache_populate(OVERLAY_Data *vedata, Object *ob)
void OVERLAY_image_empty_cache_populate(OVERLAY_Data *vedata, Object *ob)
GPUShader * OVERLAY_shader_extra_groundline(void)
GPUShader * OVERLAY_shader_extra_loose_point(void)
GPUShader * OVERLAY_shader_extra_grid(void)
GPUShader * OVERLAY_shader_extra(bool is_select)
GPUShader * OVERLAY_shader_volume_velocity(bool use_needle, bool use_mac)
GPUShader * OVERLAY_shader_extra_wire(bool use_object, bool is_select)
BLI_INLINE void pack_v4_in_mat4(float rmat[4][4], const float mat[4][4], const float v[4])
GPUShader * OVERLAY_shader_extra_point(void)
OVERLAY_InstanceFormats * OVERLAY_shader_instance_formats_get(void)
GPUShader * OVERLAY_shader_volume_gridlines(bool color_with_flags, bool color_range)
BLI_INLINE void pack_fl_in_mat4(float rmat[4][4], const float mat[4][4], float a)
#define min(a, b)
Definition: sort.c:35
float clip_end
struct ListBase bg_images
float shiftx
struct CameraStereoSettings stereo
short flag
float clip_start
float drawsize
float loc[3]
float size[3]
struct Scene * scene
Definition: DRW_render.h:979
struct Depsgraph * depsgraph
Definition: DRW_render.h:987
struct ViewLayer * view_layer
Definition: DRW_render.h:980
eObjectMode object_mode
Definition: DRW_render.h:991
struct View3D * v3d
Definition: DRW_render.h:976
struct RegionView3D * rv3d
Definition: DRW_render.h:975
GlobalsUboStorage block
Definition: draw_common.h:127
struct GPUUniformBuf * block_ubo
Definition: draw_common.h:129
struct GPUTexture * depth
struct GPUTexture * tex_range_field
struct GPUTexture * tex_velocity_x
struct GPUTexture * tex_velocity_y
struct MANTA * fluid
struct GPUTexture * tex_velocity_z
struct PointCache * point_cache[2]
struct GPUTexture * tex_flags
float gridlines_range_color[4]
struct FluidDomainSettings * domain
struct Object * object
Definition: DNA_ID.h:368
char name[66]
Definition: DNA_ID.h:378
float att_dist
float area_sizey
short area_shape
float clipsta
float spotblend
float spotsize
float area_size
short type
void * first
Definition: DNA_listBase.h:31
float size[3]
float loc[3]
struct MovieTracking tracking
OVERLAY_PassList * psl
OVERLAY_StorageList * stl
OVERLAY_TextureList * txl
DRWCallBuffer * camera_volume
DRWCallBuffer * empty_image_frame
DRWCallBuffer * field_vortex
DRWCallBuffer * extra_dashed_lines
DRWCallBuffer * empty_cone
DRWCallBuffer * empty_cylinder
DRWCallBuffer * empty_circle
DRWCallBuffer * center_selected
DRWCallBuffer * light_spot
DRWCallBuffer * light_area[2]
DRWCallBuffer * probe_grid
DRWCallBuffer * empty_single_arrow
DRWCallBuffer * camera_distances
DRWCallBuffer * center_deselected
DRWCallBuffer * solid_quad
DRWCallBuffer * light_spot_cone_front
DRWCallBuffer * camera_volume_frame
DRWShadingGroup * extra_wire
DRWCallBuffer * field_force
DRWCallBuffer * origin_xform
DRWCallBuffer * empty_axes
DRWCallBuffer * light_spot_cone_back
DRWCallBuffer * field_curve
DRWCallBuffer * probe_cube
DRWCallBuffer * extra_lines
DRWCallBuffer * camera_frame
DRWCallBuffer * field_sphere_limit
DRWCallBuffer * empty_sphere_solid
DRWCallBuffer * center_active
DRWCallBuffer * empty_capsule_body
DRWCallBuffer * center_deselected_lib
DRWCallBuffer * empty_sphere
DRWCallBuffer * empty_capsule_cap
DRWCallBuffer * field_tube_limit
DRWCallBuffer * field_wind
DRWCallBuffer * extra_points
DRWShadingGroup * extra_loose_points
DRWCallBuffer * probe_planar
DRWCallBuffer * camera_tria[2]
DRWCallBuffer * field_cone_limit
DRWCallBuffer * center_selected_lib
DRWCallBuffer * empty_cube
DRWCallBuffer * light_point
DRWCallBuffer * groundline
DRWCallBuffer * empty_plain_axes
struct GPUVertFormat * point_extra
struct GPUVertFormat * pos
struct GPUVertFormat * pos_color
struct GPUVertFormat * instance_extra
struct GPUVertFormat * wire_extra
struct GPUVertFormat * instance_pos
DRWPass * extra_grid_ps
DRWPass * extra_blend_ps
DRWPass * extra_ps[2]
DRWPass * extra_centers_ps
OVERLAY_ExtraCallBuffers extra_call_buffers[2]
View3DOverlay overlay
DRWShadingGroup * extra_grid_grp
struct OVERLAY_PrivateData * pd
struct GPUTexture * dummy_depth_tx
float parent_display_origin[3]
short transflag
ListBase constraints
struct Collection * instance_collection
short base_flag
ListBase modifiers
struct RigidBodyOb * rigidbody_object
char boundtype
ListBase greasepencil_modifiers
struct PartDeflect * pd
char empty_drawtype
Object_Runtime runtime
float empty_drawsize
float obmat[4][4]
struct Object * parent
struct RigidBodyCon * rigidbody_constraint
void * data
short views_format
struct Object * ob1
struct Object * ob2
struct ToolSettings * toolsettings
struct RenderData r
struct Object * camera
struct World * world
char multiview_eye
float bundle_size
struct Object * camera
float stereo3d_volume_alpha
View3DShading shading
char bundle_drawtype
short stereo3d_flag
float stereo3d_convergence_alpha
float miststa
float mistdist
float space_obj_world_matrix[4][4]
struct bConstraintTarget * next
void(* get_target_matrix)(struct Depsgraph *depsgraph, struct bConstraint *con, struct bConstraintOb *cob, struct bConstraintTarget *ct, float ctime)
struct bConstraint * next
float max
ccl_device_inline float sqr(float a)
Definition: util/math.h:746