Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/gpencil/gpencil_utils.c
| Show First 20 Lines • Show All 1,677 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| void ED_gpencil_brush_draw_eraser(Brush *brush, int x, int y) | void ED_gpencil_brush_draw_eraser(Brush *brush, int x, int y) | ||||
| { | { | ||||
| short radius = (short)brush->size; | short radius = (short)brush->size; | ||||
| GPUVertFormat *format = immVertexFormat(); | GPUVertFormat *format = immVertexFormat(); | ||||
| const uint shdr_pos = GPU_vertformat_attr_add(format, "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); | const uint shdr_pos = GPU_vertformat_attr_add(format, "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); | ||||
| immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); | immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR); | ||||
| GPU_line_smooth(true); | GPU_line_smooth(true); | ||||
| GPU_blend(GPU_BLEND_ALPHA); | GPU_blend(GPU_BLEND_ALPHA); | ||||
| immUniformColor4ub(255, 100, 100, 20); | immUniformColor4ub(255, 100, 100, 20); | ||||
| imm_draw_circle_fill_2d(shdr_pos, x, y, radius, 40); | imm_draw_circle_fill_2d(shdr_pos, x, y, radius, 40); | ||||
| immUnbindProgram(); | immUnbindProgram(); | ||||
| ▲ Show 20 Lines • Show All 165 Lines • ▼ Show 20 Lines | if (GPENCIL_VERTEX_MODE(gpd)) { | ||||
| radius = brush->size; | radius = brush->size; | ||||
| copy_v3_v3(color, brush->rgb); | copy_v3_v3(color, brush->rgb); | ||||
| } | } | ||||
| /* draw icon */ | /* draw icon */ | ||||
| GPUVertFormat *format = immVertexFormat(); | GPUVertFormat *format = immVertexFormat(); | ||||
| uint pos = GPU_vertformat_attr_add(format, "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); | uint pos = GPU_vertformat_attr_add(format, "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); | ||||
| immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); | immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR); | ||||
| GPU_line_smooth(true); | GPU_line_smooth(true); | ||||
| GPU_blend(GPU_BLEND_ALPHA); | GPU_blend(GPU_BLEND_ALPHA); | ||||
| /* Inner Ring: Color from UI panel */ | /* Inner Ring: Color from UI panel */ | ||||
| immUniformColor4f(color[0], color[1], color[2], 0.8f); | immUniformColor4f(color[0], color[1], color[2], 0.8f); | ||||
| if ((gp_style) && (GPENCIL_PAINT_MODE(gpd)) && | if ((gp_style) && (GPENCIL_PAINT_MODE(gpd)) && | ||||
| ((brush->gpencil_settings->flag & GP_BRUSH_STABILIZE_MOUSE) == 0) && | ((brush->gpencil_settings->flag & GP_BRUSH_STABILIZE_MOUSE) == 0) && | ||||
| ▲ Show 20 Lines • Show All 1,419 Lines • Show Last 20 Lines | |||||