From 8134f3f0a6bb0ca7bb6c002a7ce0b4c91342a6d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Tue, 29 Jan 2019 03:46:57 +0100 Subject: Workbench: Add "Shadow" factor to Xray This just maintain more parity accross the 2 visuals. Note that this is not "real shadowing" just the facing factor shadowing. --- source/blender/draw/engines/workbench/workbench_data.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source/blender/draw/engines/workbench/workbench_data.c') diff --git a/source/blender/draw/engines/workbench/workbench_data.c b/source/blender/draw/engines/workbench/workbench_data.c index b009a8acb08..97b585c1215 100644 --- a/source/blender/draw/engines/workbench/workbench_data.c +++ b/source/blender/draw/engines/workbench/workbench_data.c @@ -76,6 +76,12 @@ void workbench_private_data_init(WORKBENCH_PrivateData *wpd) wpd->shading.studio_light, STUDIOLIGHT_TYPE_STUDIO); } + + float shadow_focus = scene->display.shadow_focus; + /* Clamp to avoid overshadowing and shading errors. */ + CLAMP(shadow_focus, 0.0001f, 0.99999f); + wpd->shadow_shift = scene->display.shadow_shift; + wpd->shadow_focus = 1.0f - shadow_focus * (1.0f - wpd->shadow_shift); wpd->shadow_multiplier = 1.0 - wpd->shading.shadow_intensity; WORKBENCH_UBO_World *wd = &wpd->world_data; -- cgit v1.2.3