Blender  V3.3
draw_common.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2016 Blender Foundation. */
3 
8 #include "DRW_render.h"
9 
10 #include "GPU_matrix.h"
11 #include "GPU_shader.h"
12 #include "GPU_texture.h"
13 
14 #include "UI_resources.h"
15 
16 #include "BKE_colorband.h"
17 #include "BKE_global.h"
18 #include "BKE_object.h"
19 
20 #include "draw_common.h"
21 
22 #if 0
23 # define UI_COLOR_RGB_FROM_U8(r, g, b, v4) \
24  ARRAY_SET_ITEMS(v4, (float)r / 255.0f, (float)g / 255.0f, (float)b / 255.0f, 1.0)
25 #endif
26 #define UI_COLOR_RGBA_FROM_U8(r, g, b, a, v4) \
27  ARRAY_SET_ITEMS(v4, (float)r / 255.0f, (float)g / 255.0f, (float)b / 255.0f, (float)a / 255.0f)
28 
32 struct DRW_Global G_draw = {{{0}}};
33 
34 static bool weight_ramp_custom = false;
36 
38 
40 {
42 
47  UI_COLOR_RGBA_FROM_U8(0x88, 0xFF, 0xFF, 155, gb->color_library_select);
48  UI_COLOR_RGBA_FROM_U8(0x55, 0xCC, 0xCC, 155, gb->color_library);
58  UI_COLOR_RGBA_FROM_U8(0xB0, 0x00, 0xB0, 0xFF, gb->color_vertex_missing_data);
63 
84 
85  /* Custom median color to slightly affect the edit mesh colors. */
89  (float[3]){0.3333f, 0.3333f, 0.3333f})); /* Desaturate */
90 
91 #ifdef WITH_FREESTYLE
94 #else
97 #endif
98 
101 
102  /* Bone colors */
110  UI_COLOR_RGBA_FROM_U8(255, 150, 0, 80, gb->color_bone_pose_target);
111  UI_COLOR_RGBA_FROM_U8(255, 255, 0, 80, gb->color_bone_pose_ik);
112  UI_COLOR_RGBA_FROM_U8(200, 255, 0, 80, gb->color_bone_pose_spline_ik);
116  copy_v4_fl4(gb->color_bone_ik_line, 0.8f, 0.5f, 0.0f, 1.0f);
117  copy_v4_fl4(gb->color_bone_ik_line_no_target, 0.8f, 0.8f, 0.2f, 1.0f);
118  copy_v4_fl4(gb->color_bone_ik_line_spline, 0.8f, 0.8f, 0.2f, 1.0f);
119 
120  /* Curve */
136 
138 
139  /* Meta-ball. */
140  UI_COLOR_RGBA_FROM_U8(0xA0, 0x30, 0x30, 0xFF, gb->color_mball_radius);
141  UI_COLOR_RGBA_FROM_U8(0xF0, 0xA0, 0xA0, 0xFF, gb->color_mball_radius_select);
142  UI_COLOR_RGBA_FROM_U8(0x30, 0xA0, 0x30, 0xFF, gb->color_mball_stiffness);
143  UI_COLOR_RGBA_FROM_U8(0xA0, 0xF0, 0xA0, 0xFF, gb->color_mball_stiffness_select);
144 
145  /* Grid */
147  /* Emphasize division lines lighter instead of darker, if background is darker than grid. */
149  TH_GRID,
150  (gb->color_grid[0] + gb->color_grid[1] + gb->color_grid[2] + 0.12f >
151  gb->color_background[0] + gb->color_background[1] + gb->color_background[2]) ?
152  20 :
153  -10,
154  gb->color_grid_emphasis);
155  /* Grid Axis */
159 
163 
164  /* UV colors */
166 
167  gb->size_pixel = U.pixelsize;
168  gb->size_object_center = (UI_GetThemeValuef(TH_OBCENTER_DIA) + 1.0f) * U.pixelsize;
169  gb->size_light_center = (UI_GetThemeValuef(TH_OBCENTER_DIA) + 1.5f) * U.pixelsize;
170  gb->size_light_circle = U.pixelsize * 9.0f;
171  gb->size_light_circle_shadow = gb->size_light_circle + U.pixelsize * 3.0f;
172 
173  /* M_SQRT2 to be at least the same size of the old square */
174  gb->size_vertex = U.pixelsize *
175  (max_ff(1.0f, UI_GetThemeValuef(TH_VERTEX_SIZE) * (float)M_SQRT2 / 2.0f));
178  gb->size_edge = U.pixelsize * (1.0f / 2.0f); /* TODO: Theme. */
179  gb->size_edge_fix = U.pixelsize * (0.5f + 2.0f * (2.0f * (gb->size_edge * (float)M_SQRT1_2)));
180 
181  const float(*screen_vecs)[3] = (float(*)[3])DRW_viewport_screenvecs_get();
182  for (int i = 0; i < 2; i++) {
183  copy_v3_v3(gb->screen_vecs[i], screen_vecs[i]);
184  }
185 
187 
188  /* Deprecated, use drw_view.viewport_size instead */
190  copy_v2_v2(&gb->size_viewport[2], &gb->size_viewport[0]);
191  invert_v2(&gb->size_viewport[2]);
192 
193  /* Color management. */
194  {
195  float *color = gb->UBO_FIRST_COLOR;
196  do {
197  /* TODO: more accurate transform. */
199  color += 4;
200  } while (color <= gb->UBO_LAST_COLOR);
201  }
202 
203  if (G_draw.block_ubo == NULL) {
205  sizeof(GlobalsUboStorage), gb, "GlobalsUboStorage");
206  }
207 
209 
210  if (!G_draw.ramp) {
211  ColorBand ramp = {0};
212  float *colors;
213  int col_size;
214 
215  ramp.tot = 3;
216  ramp.data[0].a = 1.0f;
217  ramp.data[0].b = 1.0f;
218  ramp.data[0].pos = 0.0f;
219  ramp.data[1].a = 1.0f;
220  ramp.data[1].g = 1.0f;
221  ramp.data[1].pos = 0.5f;
222  ramp.data[2].a = 1.0f;
223  ramp.data[2].r = 1.0f;
224  ramp.data[2].pos = 1.0f;
225 
226  BKE_colorband_evaluate_table_rgba(&ramp, &colors, &col_size);
227 
228  G_draw.ramp = GPU_texture_create_1d("ramp", col_size, 1, GPU_RGBA8, colors);
229 
230  MEM_freeN(colors);
231  }
232 
233  /* Weight Painting color ramp texture */
234  bool user_weight_ramp = (U.flag & USER_CUSTOM_RANGE) != 0;
235 
236  if (weight_ramp_custom != user_weight_ramp ||
237  (user_weight_ramp && memcmp(&weight_ramp_copy, &U.coba_weight, sizeof(ColorBand)) != 0)) {
239  }
240 
241  if (G_draw.weight_ramp == NULL) {
242  weight_ramp_custom = user_weight_ramp;
243  memcpy(&weight_ramp_copy, &U.coba_weight, sizeof(ColorBand));
244 
246  }
247 }
248 
249 /* ********************************* SHGROUP ************************************* */
250 
252 {
253 }
254 
256  const RegionView3D *rv3d,
257  float offset)
258 {
259  /* Create view with depth offset */
260  float viewmat[4][4], winmat[4][4];
261  DRW_view_viewmat_get(parent_view, viewmat, false);
262  DRW_view_winmat_get(parent_view, winmat, false);
263 
264  float viewdist = rv3d->dist;
265 
266  /* special exception for ortho camera (`viewdist` isn't used for perspective cameras). */
267  if (rv3d->persp == RV3D_CAMOB && rv3d->is_persp == false) {
268  viewdist = 1.0f / max_ff(fabsf(winmat[0][0]), fabsf(winmat[1][1]));
269  }
270 
271  winmat[3][2] -= GPU_polygon_offset_calc(winmat, viewdist, offset);
272 
273  return DRW_view_create_sub(parent_view, viewmat, winmat);
274 }
275 
276 /* ******************************************** COLOR UTILS ************************************ */
277 
278 /* TODO: FINISH. */
279 int DRW_object_wire_theme_get(Object *ob, ViewLayer *view_layer, float **r_color)
280 {
281  const DRWContextState *draw_ctx = DRW_context_state_get();
282  const bool is_edit = (draw_ctx->object_mode & OB_MODE_EDIT) && (ob->mode & OB_MODE_EDIT);
283  const bool active = view_layer->basact &&
284  ((ob->base_flag & BASE_FROM_DUPLI) ?
285  (DRW_object_get_dupli_parent(ob) == view_layer->basact->object) :
286  (view_layer->basact->object == ob));
287 
288  /* confusing logic here, there are 2 methods of setting the color
289  * 'colortab[colindex]' and 'theme_id', colindex overrides theme_id.
290  *
291  * NOTE: no theme yet for 'colindex'. */
292  int theme_id = is_edit ? TH_WIRE_EDIT : TH_WIRE;
293 
294  if (is_edit) {
295  /* fallback to TH_WIRE */
296  }
297  else if (((G.moving & G_TRANSFORM_OBJ) != 0) && ((ob->base_flag & BASE_SELECTED) != 0)) {
298  theme_id = TH_TRANSFORM;
299  }
300  else {
301  /* Sets the 'theme_id' or fallback to wire */
302  if ((ob->base_flag & BASE_SELECTED) != 0) {
303  theme_id = (active) ? TH_ACTIVE : TH_SELECT;
304  }
305  else {
306  switch (ob->type) {
307  case OB_LAMP:
308  theme_id = TH_LIGHT;
309  break;
310  case OB_SPEAKER:
311  theme_id = TH_SPEAKER;
312  break;
313  case OB_CAMERA:
314  theme_id = TH_CAMERA;
315  break;
316  case OB_EMPTY:
317  theme_id = TH_EMPTY;
318  break;
319  case OB_LIGHTPROBE:
320  /* TODO: add light-probe color. */
321  theme_id = TH_EMPTY;
322  break;
323  default:
324  /* fallback to TH_WIRE */
325  break;
326  }
327  }
328  }
329 
330  if (r_color != NULL) {
331  if (UNLIKELY(ob->base_flag & BASE_FROM_SET)) {
332  *r_color = G_draw.block.color_wire;
333  }
334  else {
335  switch (theme_id) {
336  case TH_WIRE_EDIT:
337  *r_color = G_draw.block.color_wire_edit;
338  break;
339  case TH_ACTIVE:
340  *r_color = G_draw.block.color_active;
341  break;
342  case TH_SELECT:
343  *r_color = G_draw.block.color_select;
344  break;
345  case TH_TRANSFORM:
346  *r_color = G_draw.block.color_transform;
347  break;
348  case TH_SPEAKER:
349  *r_color = G_draw.block.color_speaker;
350  break;
351  case TH_CAMERA:
352  *r_color = G_draw.block.color_camera;
353  break;
354  case TH_EMPTY:
355  *r_color = G_draw.block.color_empty;
356  break;
357  case TH_LIGHT:
358  *r_color = G_draw.block.color_light;
359  break;
360  default:
361  *r_color = G_draw.block.color_wire;
362  break;
363  }
364  }
365  }
366 
367  return theme_id;
368 }
369 
370 /* XXX This is very stupid, better find something more general. */
371 float *DRW_color_background_blend_get(int theme_id)
372 {
373  static float colors[11][4];
374  float *ret;
375 
376  switch (theme_id) {
377  case TH_WIRE_EDIT:
378  ret = colors[0];
379  break;
380  case TH_ACTIVE:
381  ret = colors[1];
382  break;
383  case TH_SELECT:
384  ret = colors[2];
385  break;
386  case TH_TRANSFORM:
387  ret = colors[5];
388  break;
389  case TH_SPEAKER:
390  ret = colors[6];
391  break;
392  case TH_CAMERA:
393  ret = colors[7];
394  break;
395  case TH_EMPTY:
396  ret = colors[8];
397  break;
398  case TH_LIGHT:
399  ret = colors[9];
400  break;
401  default:
402  ret = colors[10];
403  break;
404  }
405 
406  UI_GetThemeColorBlendShade4fv(theme_id, TH_BACK, 0.5, 0, ret);
407 
408  return ret;
409 }
410 
411 bool DRW_object_is_flat(Object *ob, int *r_axis)
412 {
413  float dim[3];
414 
415  if (!ELEM(ob->type,
416  OB_MESH,
418  OB_SURF,
419  OB_FONT,
420  OB_MBALL,
421  OB_CURVES,
423  OB_VOLUME)) {
424  /* Non-meshes object cannot be considered as flat. */
425  return false;
426  }
427 
428  BKE_object_dimensions_get(ob, dim);
429  if (dim[0] == 0.0f) {
430  *r_axis = 0;
431  return true;
432  }
433  if (dim[1] == 0.0f) {
434  *r_axis = 1;
435  return true;
436  }
437  if (dim[2] == 0.0f) {
438  *r_axis = 2;
439  return true;
440  }
441  return false;
442 }
443 
445 {
446  float ob_rot[3][3], invviewmat[4][4];
447  DRW_view_viewmat_get(NULL, invviewmat, true);
448  BKE_object_rot_to_mat3(ob, ob_rot, true);
449  float dot = dot_v3v3(ob_rot[axis], invviewmat[2]);
450  if (fabsf(dot) < 1e-3) {
451  return true;
452  }
453 
454  return false;
455 }
456 
457 static void DRW_evaluate_weight_to_color(const float weight, float result[4])
458 {
459  if (U.flag & USER_CUSTOM_RANGE) {
460  BKE_colorband_evaluate(&U.coba_weight, weight, result);
461  }
462  else {
463  /* Use gamma correction to even out the color bands:
464  * increasing widens yellow/cyan vs red/green/blue.
465  * Gamma 1.0 produces the original 2.79 color ramp. */
466  const float gamma = 1.5f;
467  const float hsv[3] = {(2.0f / 3.0f) * (1.0f - weight), 1.0f, pow(0.5f + 0.5f * weight, gamma)};
468 
469  hsv_to_rgb_v(hsv, result);
470 
471  for (int i = 0; i < 3; i++) {
472  result[i] = pow(result[i], 1.0f / gamma);
473  }
474  }
475 }
476 
478 {
479  float pixels[256][4];
480  for (int i = 0; i < 256; i++) {
481  DRW_evaluate_weight_to_color(i / 255.0f, pixels[i]);
482  pixels[i][3] = 1.0f;
483  }
484 
485  return GPU_texture_create_1d("weight_color_ramp", 256, 1, GPU_SRGB8_A8, pixels[0]);
486 }
typedef float(TangentPoint)[2]
bool BKE_colorband_evaluate(const struct ColorBand *coba, float in, float out[4])
void BKE_colorband_evaluate_table_rgba(const struct ColorBand *coba, float **array, int *size)
@ G_TRANSFORM_OBJ
Definition: BKE_global.h:247
General operations, lookup, etc. for blender objects.
void BKE_object_dimensions_get(struct Object *ob, float r_vec[3])
Definition: object.cc:3786
void BKE_object_rot_to_mat3(const struct Object *ob, float r_mat[3][3], bool use_drot)
MINLINE float max_ff(float a, float b)
#define M_SQRT2
Definition: BLI_math_base.h:29
#define M_SQRT1_2
Definition: BLI_math_base.h:32
void hsv_to_rgb_v(const float hsv[3], float r_rgb[3])
Definition: math_color.c:49
MINLINE void srgb_to_linearrgb_v4(float linear[4], const float srgb[4])
MINLINE void copy_v4_fl4(float v[4], float x, float y, float z, float w)
MINLINE void copy_v2_v2(float r[2], const float a[2])
MINLINE void copy_v3_v3(float r[3], const float a[3])
void interp_v4_v4v4(float r[4], const float a[4], const float b[4], float t)
Definition: math_vector.c:38
MINLINE float dot_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void zero_v4(float r[4])
MINLINE void copy_v3_fl(float r[3], float f)
MINLINE void invert_v2(float r[2])
#define UNLIKELY(x)
#define ELEM(...)
@ BASE_FROM_DUPLI
@ BASE_FROM_SET
@ BASE_SELECTED
@ OB_MODE_EDIT
@ OB_SPEAKER
@ OB_MBALL
@ OB_EMPTY
@ OB_SURF
@ OB_CAMERA
@ OB_FONT
@ OB_LAMP
@ OB_MESH
@ OB_POINTCLOUD
@ OB_VOLUME
@ OB_CURVES_LEGACY
@ OB_CURVES
@ OB_LIGHTPROBE
@ USER_CUSTOM_RANGE
#define RV3D_CAMOB
#define DRW_TEXTURE_FREE_SAFE(tex)
Definition: DRW_render.h:183
float GPU_polygon_offset_calc(const float(*winmat)[4], float viewdist, float dist)
Definition: gpu_matrix.cc:690
GPUTexture * GPU_texture_create_1d(const char *name, int w, int mip_len, eGPUTextureFormat format, const float *data)
Definition: gpu_texture.cc:278
struct GPUTexture GPUTexture
Definition: GPU_texture.h:17
@ GPU_SRGB8_A8
Definition: GPU_texture.h:121
@ GPU_RGBA8
Definition: GPU_texture.h:87
GPUUniformBuf * GPU_uniformbuf_create_ex(size_t size, const void *data, const char *name)
void GPU_uniformbuf_update(GPUUniformBuf *ubo, const void *data)
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_EDGE_SHARP
Definition: UI_resources.h:201
@ TH_BONE_SOLID
Definition: UI_resources.h:133
@ TH_HANDLE_ALIGN
Definition: UI_resources.h:112
@ TH_NORMAL
Definition: UI_resources.h:92
@ TH_LIGHT
Definition: UI_resources.h:155
@ TH_FACE_BACK
Definition: UI_resources.h:90
@ TH_BACK_GRAD
Definition: UI_resources.h:41
@ TH_LNORMAL
Definition: UI_resources.h:94
@ TH_EDGE_FACESEL
Definition: UI_resources.h:87
@ TH_NURB_SEL_VLINE
Definition: UI_resources.h:106
@ TH_TRANSPARENT_CHECKER_PRIMARY
Definition: UI_resources.h:296
@ TH_BONE_POSE_ACTIVE
Definition: UI_resources.h:135
@ TH_FREESTYLE_FACE_MARK
Definition: UI_resources.h:254
@ TH_FREESTYLE_EDGE_MARK
Definition: UI_resources.h:253
@ TH_GRID
Definition: UI_resources.h:68
@ TH_BACK
Definition: UI_resources.h:39
@ TH_WIRE
Definition: UI_resources.h:69
@ TH_BONE_LOCKED_WEIGHT
Definition: UI_resources.h:136
@ TH_FACEDOT_SIZE
Definition: UI_resources.h:96
@ TH_BONE_POSE
Definition: UI_resources.h:134
@ TH_HANDLE_SEL_AUTO
Definition: UI_resources.h:115
@ TH_SKIN_ROOT
Definition: UI_resources.h:264
@ TH_EDGE_SELECT
Definition: UI_resources.h:85
@ TH_TRANSPARENT_CHECKER_SECONDARY
Definition: UI_resources.h:297
@ TH_HANDLE_SEL_AUTOCLAMP
Definition: UI_resources.h:118
@ TH_ACTIVE_SPLINE
Definition: UI_resources.h:120
@ TH_CAMERA
Definition: UI_resources.h:157
@ TH_TRANSFORM
Definition: UI_resources.h:76
@ TH_EDGE_BEVEL
Definition: UI_resources.h:334
@ TH_HANDLE_AUTO
Definition: UI_resources.h:110
@ TH_NURB_VLINE
Definition: UI_resources.h:104
@ TH_SPEAKER
Definition: UI_resources.h:156
@ TH_VERTEX
Definition: UI_resources.h:77
@ TH_VERTEX_SIZE
Definition: UI_resources.h:81
@ TH_HANDLE_SEL_ALIGN
Definition: UI_resources.h:117
@ TH_GP_VERTEX_SELECT
Definition: UI_resources.h:209
@ TH_OBCENTER_DIA
Definition: UI_resources.h:83
@ TH_UV_SHADOW
Definition: UI_resources.h:251
@ TH_HANDLE_SEL_FREE
Definition: UI_resources.h:114
@ TH_FACE_SELECT
Definition: UI_resources.h:89
@ TH_CFRAME
Definition: UI_resources.h:97
@ TH_NURB_ULINE
Definition: UI_resources.h:103
@ TH_EDGE_SEAM
Definition: UI_resources.h:86
@ TH_AXIS_Y
Definition: UI_resources.h:301
@ TH_AXIS_X
Definition: UI_resources.h:300
@ TH_HANDLE_SEL_VECT
Definition: UI_resources.h:116
@ TH_VERTEX_SELECT
Definition: UI_resources.h:78
@ TH_EMPTY
Definition: UI_resources.h:158
@ TH_FACE_FRONT
Definition: UI_resources.h:91
@ TH_VERTEX_UNREFERENCED
Definition: UI_resources.h:80
@ TH_TRANSPARENT_CHECKER_SIZE
Definition: UI_resources.h:298
@ TH_V3D_CLIPPING_BORDER
Definition: UI_resources.h:329
@ TH_AXIS_Z
Definition: UI_resources.h:302
@ TH_EDITMESH_ACTIVE
Definition: UI_resources.h:202
@ TH_GP_VERTEX_SIZE
Definition: UI_resources.h:210
@ TH_GP_VERTEX
Definition: UI_resources.h:208
@ TH_FACE_DOT
Definition: UI_resources.h:95
@ TH_CAMERA_PATH
Definition: UI_resources.h:238
@ TH_SELECT
Definition: UI_resources.h:72
@ TH_HANDLE_FREE
Definition: UI_resources.h:109
@ TH_HANDLE_AUTOCLAMP
Definition: UI_resources.h:113
@ TH_EDGE_CREASE
Definition: UI_resources.h:218
@ TH_HANDLE_VECT
Definition: UI_resources.h:111
@ TH_TEXT
Definition: UI_resources.h:42
@ TH_WIRE_EDIT
Definition: UI_resources.h:71
@ TH_NURB_SEL_ULINE
Definition: UI_resources.h:105
@ TH_ACTIVE
Definition: UI_resources.h:73
@ TH_FACE
Definition: UI_resources.h:88
@ TH_VNORMAL
Definition: UI_resources.h:93
@ TH_TEXT_HI
Definition: UI_resources.h:43
void UI_GetThemeColorBlendShade4fv(int colorid1, int colorid2, float fac, int offset, float col[4])
Definition: resources.c:1299
void UI_GetThemeColorBlendShade3fv(int colorid1, int colorid2, float fac, int offset, float col[3])
Definition: resources.c:1279
void UI_GetThemeColorShadeAlpha4fv(int colorid, int coloffset, int alphaoffset, float col[4])
Definition: resources.c:1259
void UI_GetThemeColor4fv(int colorid, float col[4])
Definition: resources.c:1173
void UI_GetThemeColorShade4fv(int colorid, int offset, float col[4])
Definition: resources.c:1331
float UI_GetThemeValuef(int colorid)
Definition: resources.c:1141
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
unsigned int U
Definition: btGjkEpa3.h:78
void DRW_globals_update(void)
Definition: draw_common.c:39
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
#define UI_COLOR_RGBA_FROM_U8(r, g, b, a, v4)
Definition: draw_common.c:26
static void DRW_evaluate_weight_to_color(const float weight, float result[4])
Definition: draw_common.c:457
struct DRW_Global G_draw
Definition: draw_common.c:32
static ColorBand weight_ramp_copy
Definition: draw_common.c:35
bool DRW_object_is_flat(Object *ob, int *r_axis)
Definition: draw_common.c:411
DRWView * DRW_view_create_with_zoffset(const DRWView *parent_view, const RegionView3D *rv3d, float offset)
Definition: draw_common.c:255
static bool weight_ramp_custom
Definition: draw_common.c:34
void DRW_globals_free(void)
Definition: draw_common.c:251
bool DRW_object_axis_orthogonal_to_view(Object *ob, int axis)
Definition: draw_common.c:444
static struct GPUTexture * DRW_create_weight_colorramp_texture(void)
Definition: draw_common.c:477
#define UBO_LAST_COLOR
const float * DRW_viewport_pixelsize_get(void)
Definition: draw_manager.c:303
struct Object * DRW_object_get_dupli_parent(const Object *UNUSED(ob))
Definition: draw_manager.c:264
const DRWContextState * DRW_context_state_get(void)
const float * DRW_viewport_size_get(void)
Definition: draw_manager.c:288
const float * DRW_viewport_screenvecs_get(void)
Definition: draw_manager.c:298
void DRW_view_winmat_get(const DRWView *view, float mat[4][4], bool inverse)
DRWView * DRW_view_create_sub(const DRWView *parent_view, const float viewmat[4][4], const float winmat[4][4])
void DRW_view_viewmat_get(const DRWView *view, float mat[4][4], bool inverse)
ccl_gpu_kernel_postfix ccl_global float int int int int float bool int offset
void(* MEM_freeN)(void *vmemh)
Definition: mallocn.c:27
ccl_device_inline float3 pow(float3 v, float e)
Definition: math_float3.h:533
#define G(x, y, z)
#define fabsf(x)
Definition: metal/compat.h:219
bool active
all scheduled work for the GPU.
return ret
struct Object * object
CBData data[32]
eObjectMode object_mode
Definition: DRW_render.h:991
GlobalsUboStorage block
Definition: draw_common.h:127
struct GPUUniformBuf * block_ubo
Definition: draw_common.h:129
struct GPUTexture * weight_ramp
Definition: draw_common.h:132
struct GPUTexture * ramp
Definition: draw_common.h:131
short base_flag
struct Base * basact