Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/modes/object_mode.c
| Show First 20 Lines • Show All 1,496 Lines • ▼ Show 20 Lines | for (int i = 0; i < 2; ++i) { | ||||
| /* Object Center pass grouped by State */ | /* Object Center pass grouped by State */ | ||||
| DRWShadingGroup *grp; | DRWShadingGroup *grp; | ||||
| static float outlineWidth, size; | static float outlineWidth, size; | ||||
| DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_BLEND | DRW_STATE_POINT; | DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_BLEND | DRW_STATE_POINT; | ||||
| psl->ob_center = DRW_pass_create("Obj Center Pass", state); | psl->ob_center = DRW_pass_create("Obj Center Pass", state); | ||||
| outlineWidth = 1.0f * U.pixelsize; | outlineWidth = 1.0f * U.pixelsize; | ||||
| size = U.obcenter_dia * U.pixelsize + outlineWidth; | size = UI_GetThemeValuef(TH_OBCENTER_DIA) * U.pixelsize + outlineWidth; | ||||
| GPUShader *sh = GPU_shader_get_builtin_shader_with_config( | GPUShader *sh = GPU_shader_get_builtin_shader_with_config( | ||||
| GPU_SHADER_3D_POINT_UNIFORM_SIZE_UNIFORM_COLOR_OUTLINE_AA, draw_ctx->sh_cfg); | GPU_SHADER_3D_POINT_UNIFORM_SIZE_UNIFORM_COLOR_OUTLINE_AA, draw_ctx->sh_cfg); | ||||
| /* Active */ | /* Active */ | ||||
| grp = DRW_shgroup_point_batch_create(sh, psl->ob_center); | grp = DRW_shgroup_point_batch_create(sh, psl->ob_center); | ||||
| DRW_shgroup_uniform_float(grp, "size", &size, 1); | DRW_shgroup_uniform_float(grp, "size", &size, 1); | ||||
| DRW_shgroup_uniform_float(grp, "outlineWidth", &outlineWidth, 1); | DRW_shgroup_uniform_float(grp, "outlineWidth", &outlineWidth, 1); | ||||
| ▲ Show 20 Lines • Show All 2,062 Lines • Show Last 20 Lines | |||||