diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2018-11-30 15:26:30 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2018-11-30 17:40:57 +0300 |
commit | e68c0bf76a4ccb16f51b7caf488c2f345552eea9 (patch) | |
tree | fc5ec8d69b1f33445f2b8aff0639384bcb4ae758 /source/blender/draw/engines/workbench/shaders | |
parent | dabd6615cc0ecbb82f52415e81c734ad041f7598 (diff) |
Workbench: Add Shadow Focus and change Shadow Orientation
Shadow focus let the user choose how hard are is the shadows transition.
Harder shadow transition can be used for stylistic effects or more uniform
shading.
Make shadow orientation respect the same orientation as the studio light
(view from +Y direction aka. front view). Make the default shadow direction
more similar to the default light position (the default light object, not
the default studio lighting).
Diffstat (limited to 'source/blender/draw/engines/workbench/shaders')
-rw-r--r-- | source/blender/draw/engines/workbench/shaders/workbench_deferred_composite_frag.glsl | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/draw/engines/workbench/shaders/workbench_deferred_composite_frag.glsl b/source/blender/draw/engines/workbench/shaders/workbench_deferred_composite_frag.glsl index 310169bdf5d..e383d1b1939 100644 --- a/source/blender/draw/engines/workbench/shaders/workbench_deferred_composite_frag.glsl +++ b/source/blender/draw/engines/workbench/shaders/workbench_deferred_composite_frag.glsl @@ -16,6 +16,7 @@ uniform vec4 viewvecs[3]; uniform float shadowMultiplier; uniform float lightMultiplier; uniform float shadowShift = 0.1; +uniform float shadowFocus = 1.0; layout(std140) uniform world_block { WorldData world_data; @@ -99,7 +100,7 @@ void main() float light_factor = -dot(normal_viewport, world_data.shadow_direction_vs.xyz); /* The step function might be ok for meshes but it's * clearly not the case for hairs. Do smoothstep in this case. */ - float shadow_mix = smoothstep(1.0, shadowShift, light_factor); + float shadow_mix = smoothstep(shadowFocus, shadowShift, light_factor); shaded_color *= mix(lightMultiplier, shadowMultiplier, shadow_mix); #endif |