Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/overlay/overlay_grid.cc
| Show First 20 Lines • Show All 284 Lines • ▼ Show 20 Lines | if (pd->space_type == SPACE_IMAGE) { | ||||
| float theme_color[4]; | float theme_color[4]; | ||||
| UI_GetThemeColorShade4fv(TH_BACK, 60, theme_color); | UI_GetThemeColorShade4fv(TH_BACK, 60, theme_color); | ||||
| srgb_to_linearrgb_v4(theme_color, theme_color); | srgb_to_linearrgb_v4(theme_color, theme_color); | ||||
| float mat[4][4]; | float mat[4][4]; | ||||
| /* add wire border */ | /* add wire border */ | ||||
| GPUShader *sh = OVERLAY_shader_grid_image(); | GPUShader *sh = OVERLAY_shader_grid_image(); | ||||
| DRWShadingGroup *grp = DRW_shgroup_create(sh, psl->grid_ps); | DRWShadingGroup *grp = DRW_shgroup_create(sh, psl->grid_ps); | ||||
| DRW_shgroup_uniform_vec4_copy(grp, "color", theme_color); | DRW_shgroup_uniform_vec4_copy(grp, "ucolor", theme_color); | ||||
| unit_m4(mat); | unit_m4(mat); | ||||
| for (int x = 0; x < grid->size[0]; x++) { | for (int x = 0; x < grid->size[0]; x++) { | ||||
| mat[3][0] = x; | mat[3][0] = x; | ||||
| for (int y = 0; y < grid->size[1]; y++) { | for (int y = 0; y < grid->size[1]; y++) { | ||||
| mat[3][1] = y; | mat[3][1] = y; | ||||
| DRW_shgroup_call_obmat(grp, DRW_cache_quad_wires_get(), mat); | DRW_shgroup_call_obmat(grp, DRW_cache_quad_wires_get(), mat); | ||||
| } | } | ||||
| } | } | ||||
| Show All 11 Lines | |||||