139 const float lon_inc = 2 *
M_PI / lon_res;
140 const float lat_inc =
M_PI / lat_res;
144 const uint vbo_len = (lat_res - 1) * lon_res * 6;
152 for (
int i = 0; i < lon_res; i++, lon += lon_inc) {
154 for (
int j = 0; j < lat_res; j++, lat += lat_inc) {
155 if (j != lat_res - 1) {
177 const float lon_inc = 2 *
M_PI / lon_res;
178 const float lat_inc =
M_PI / lat_res;
182 const uint vbo_len = (lat_res * lon_res * 2) + ((lat_res - 1) * lon_res * 2);
190 for (
int i = 0; i < lon_res; i++, lon += lon_inc) {
192 for (
int j = 0; j < lat_res; j++, lat += lat_inc) {
196 if (j != lat_res - 1) {
221 const float color[4])
243 const float col_high[4],
244 const float col_dark[4],
248 const uint vbo_len = 4 * 2 * (6 * 2);
255 const int px =
int(pixelsize);
262 const int x_ofs = y_ofs;
265 for (i_x = 0; i_x < 4; i_x++) {
266 for (i_y = 0; i_y < 2; i_y++) {
267 const int x_co = (x_ofs) + (i_x * (box_size + box_margin));
268 const int y_co = (y_ofs) + (i_y * (box_size + box_margin));
274 (y_co + box_size) - px_zoom,
278 &pos_step, x_co - box_size, y_co, x_co, y_co + box_size, &col_step, col_high);
285 const float col_high[4],
286 const float col_dark[4],
289 const bool parameters_changed = (
g_presets_2d.panel_drag_widget_pixelsize != pixelsize) ||
295 if (
g_presets_2d.batch.panel_drag_widget && parameters_changed) {
303 pixelsize, col_high, col_dark, width);
319 float pos_data[4][2] = {{0.0f, 0.0f}, {0.0f, 1.0f}, {1.0f, 0.0f}, {1.0f, 1.0f}};
369 if (preset_batch == link->data) {
383 blender::gpu::Batch *preset =
static_cast<blender::gpu::Batch *
>(link->data);
#define LISTBASE_FOREACH_BACKWARD(type, var, list)
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_remlink(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
struct LinkData * BLI_genericNodeN(void *data)
void * BLI_pophead(ListBase *listbase) ATTR_NONNULL(1)
MINLINE int round_fl_to_int(float a)
MINLINE int max_ii(int a, int b)
MINLINE void copy_v4_v4(float r[4], const float a[4])
MINLINE void copy_v2_v2(float r[2], const float a[2])
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE bool equals_v4v4(const float v1[4], const float v2[4]) ATTR_WARN_UNUSED_RESULT
void BLI_mutex_end(ThreadMutex *mutex)
void BLI_mutex_init(ThreadMutex *mutex)
int BLI_thread_is_main(void)
void BLI_mutex_lock(ThreadMutex *mutex)
void BLI_mutex_unlock(ThreadMutex *mutex)
pthread_mutex_t ThreadMutex
blender::gpu::Batch * GPU_batch_create_ex(GPUPrimType primitive_type, blender::gpu::VertBuf *vertex_buf, blender::gpu::IndexBuf *index_buf, eGPUBatchFlag owns_flag)
void GPU_batch_discard(blender::gpu::Batch *batch)
void GPU_vertbuf_attr_get_raw_data(blender::gpu::VertBuf *, uint a_idx, GPUVertBufRaw *access)
GPU_INLINE void * GPU_vertbuf_raw_step(GPUVertBufRaw *a)
#define GPU_vertbuf_create_with_format(format)
void GPU_vertbuf_attr_fill(blender::gpu::VertBuf *, uint a_idx, const void *data)
GPU_INLINE uint GPU_vertbuf_raw_used(const GPUVertBufRaw *a)
void GPU_vertbuf_data_alloc(blender::gpu::VertBuf &verts, uint v_len)
Read Guarded memory(de)allocation.
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 Brightness Control the brightness and contrast of the input color Vector Map input vector components with curves 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 Invert a color
draw_view push_constant(Type::INT, "radiance_src") .push_constant(Type capture_info_buf storage_buf(1, Qualifier::READ, "ObjectBounds", "bounds_buf[]") .push_constant(Type draw_view int
static blender::gpu::Batch * batch_sphere_wire(int lat_res, int lon_res)
blender::gpu::Batch * panel_drag_widget
blender::gpu::Batch * sphere_high
static ListBase presets_list
blender::gpu::Batch * GPU_batch_preset_quad()
float panel_drag_widget_width
static GPUVertFormat & preset_3d_format()
static GPUVertFormat & preset_2d_format()
bool gpu_batch_presets_unregister(blender::gpu::Batch *preset_batch)
void gpu_batch_presets_register(blender::gpu::Batch *preset_batch)
void gpu_batch_presets_init()
static void batch_sphere_lat_lon_vert(GPUVertBufRaw *pos_step, GPUVertBufRaw *nor_step, float lat, float lon)
blender::gpu::Batch * sphere_wire_low
static struct @157336070235062372277311340362362342103123126032 g_presets_3d
static struct @173166146123024354131051042022317337175111041006 g_presets_2d
static blender::gpu::Batch * gpu_batch_sphere(int lat_res, int lon_res)
blender::gpu::Batch * quad
float panel_drag_widget_col_high[4]
blender::gpu::Batch * sphere_low
blender::gpu::Batch * GPU_batch_preset_panel_drag_widget(const float pixelsize, const float col_high[4], const float col_dark[4], const float width)
float panel_drag_widget_pixelsize
static void gpu_batch_preset_rectf_tris_color_ex(GPUVertBufRaw *pos_step, float x1, float y1, float x2, float y2, GPUVertBufRaw *col_step, const float color[4])
blender::gpu::Batch * sphere_wire_med
static blender::gpu::Batch * gpu_batch_preset_panel_drag_widget(float pixelsize, const float col_high[4], const float col_dark[4], const float width)
blender::gpu::Batch * GPU_batch_preset_sphere_wire(int lod)
blender::gpu::Batch * GPU_batch_preset_sphere(int lod)
void gpu_batch_presets_exit()
blender::gpu::Batch * sphere_med
struct @157336070235062372277311340362362342103123126032::@132215023242101136103363133227133264017254024241 attr_id
struct @157336070235062372277311340362362342103123126032::@262166344314164341202215145112231240022370055142 batch
float panel_drag_widget_col_dark[4]
void MEM_freeN(void *vmemh)
VecBase< float, 2 > float2
Frequency::GEOMETRY nor[]