diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2019-01-29 05:46:57 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2019-01-29 17:07:53 +0300 |
commit | 8134f3f0a6bb0ca7bb6c002a7ce0b4c91342a6d1 (patch) | |
tree | 102aea79c5df30823086ab8375f364a574f1fe14 /source/blender/draw/engines/workbench/workbench_data.c | |
parent | bc99f4903c5f55d35b5fec32d6e18400f25089fb (diff) |
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.
Diffstat (limited to 'source/blender/draw/engines/workbench/workbench_data.c')
-rw-r--r-- | source/blender/draw/engines/workbench/workbench_data.c | 6 |
1 files changed, 6 insertions, 0 deletions
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; |