Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/modes/overlay_mode.c
| Show First 20 Lines • Show All 207 Lines • ▼ Show 20 Lines | static void overlay_cache_init(void *vedata) | ||||
| } | } | ||||
| { | { | ||||
| /* Face Orientation Pass */ | /* Face Orientation Pass */ | ||||
| DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_DEPTH_EQUAL | DRW_STATE_BLEND_ALPHA; | DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_DEPTH_EQUAL | DRW_STATE_BLEND_ALPHA; | ||||
| psl->face_orientation_pass = DRW_pass_create("Face Orientation", state); | psl->face_orientation_pass = DRW_pass_create("Face Orientation", state); | ||||
| g_data->face_orientation_shgrp = DRW_shgroup_create(sh_data->face_orientation, | g_data->face_orientation_shgrp = DRW_shgroup_create(sh_data->face_orientation, | ||||
| psl->face_orientation_pass); | psl->face_orientation_pass); | ||||
| if (rv3d->rflag & RV3D_CLIPPING) { | if (DRW_state_is_clipping_enabled()) { | ||||
| DRW_shgroup_state_enable(g_data->face_orientation_shgrp, DRW_STATE_CLIP_PLANES); | DRW_shgroup_state_enable(g_data->face_orientation_shgrp, DRW_STATE_CLIP_PLANES); | ||||
| } | } | ||||
| } | } | ||||
| { | { | ||||
| /* Wireframe */ | /* Wireframe */ | ||||
| const bool use_select = (DRW_state_is_select() || DRW_state_is_depth()); | const bool use_select = (DRW_state_is_select() || DRW_state_is_depth()); | ||||
| GPUShader *face_wires_sh = use_select ? sh_data->select_wireframe : sh_data->face_wireframe; | GPUShader *face_wires_sh = use_select ? sh_data->select_wireframe : sh_data->face_wireframe; | ||||
| ▲ Show 20 Lines • Show All 179 Lines • ▼ Show 20 Lines | if ((!pd->show_overlays) || | ||||
| if (geom || use_sculpt_pbvh) { | if (geom || use_sculpt_pbvh) { | ||||
| if (is_wire && is_xray) { | if (is_wire && is_xray) { | ||||
| shgrp = DRW_shgroup_create_sub(pd->face_wires_xray_shgrp); | shgrp = DRW_shgroup_create_sub(pd->face_wires_xray_shgrp); | ||||
| } | } | ||||
| else { | else { | ||||
| shgrp = DRW_shgroup_create_sub(pd->face_wires_shgrp); | shgrp = DRW_shgroup_create_sub(pd->face_wires_shgrp); | ||||
| } | } | ||||
| if (draw_ctx->rv3d->rflag & RV3D_CLIPPING) { | if (DRW_state_is_clipping_enabled()) { | ||||
| DRW_shgroup_state_enable(shgrp, DRW_STATE_CLIP_PLANES); | DRW_shgroup_state_enable(shgrp, DRW_STATE_CLIP_PLANES); | ||||
| } | } | ||||
| float wire_step_param = 10.0f; | float wire_step_param = 10.0f; | ||||
| if (!use_sculpt_pbvh) { | if (!use_sculpt_pbvh) { | ||||
| wire_step_param = (all_wires) ? 1.0f : pd->wire_step_param; | wire_step_param = (all_wires) ? 1.0f : pd->wire_step_param; | ||||
| } | } | ||||
| DRW_shgroup_uniform_float_copy(shgrp, "wireStepParam", wire_step_param); | DRW_shgroup_uniform_float_copy(shgrp, "wireStepParam", wire_step_param); | ||||
| ▲ Show 20 Lines • Show All 113 Lines • Show Last 20 Lines | |||||