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_materials.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_materials.c')
-rw-r--r-- | source/blender/draw/engines/workbench/workbench_materials.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/draw/engines/workbench/workbench_materials.c b/source/blender/draw/engines/workbench/workbench_materials.c index 3c02810f176..a2e57cd6c7d 100644 --- a/source/blender/draw/engines/workbench/workbench_materials.c +++ b/source/blender/draw/engines/workbench/workbench_materials.c @@ -179,6 +179,7 @@ int workbench_material_get_composite_shader_index(WORKBENCH_PrivateData *wpd) SET_FLAG_FROM_TEST(index, wpd->shading.flag & V3D_SHADING_CAVITY, 1 << 3); SET_FLAG_FROM_TEST(index, wpd->shading.flag & V3D_SHADING_OBJECT_OUTLINE, 1 << 4); SET_FLAG_FROM_TEST(index, MATDATA_PASS_ENABLED(wpd), 1 << 5); + BLI_assert(index < MAX_COMPOSITE_SHADERS); return index; } @@ -194,6 +195,7 @@ int workbench_material_get_prepass_shader_index( SET_FLAG_FROM_TEST(index, MATCAP_ENABLED(wpd), 1 << 4); SET_FLAG_FROM_TEST(index, use_textures, 1 << 5); SET_FLAG_FROM_TEST(index, wpd->world_clip_planes != NULL, 1 << 6); + BLI_assert(index < MAX_PREPASS_SHADERS); return index; } @@ -205,6 +207,9 @@ int workbench_material_get_accum_shader_index(WORKBENCH_PrivateData *wpd, bool u index = SPECULAR_HIGHLIGHT_ENABLED(wpd) ? 3 : wpd->shading.light; SET_FLAG_FROM_TEST(index, use_textures, 1 << 2); SET_FLAG_FROM_TEST(index, is_hair, 1 << 3); + /* 1 bits SHADOWS (only facing factor) */ + SET_FLAG_FROM_TEST(index, SHADOW_ENABLED(wpd), 1 << 4); + BLI_assert(index < MAX_ACCUM_SHADERS); return index; } |