diff options
author | Lukas Stockner <lukas.stockner@freenet.de> | 2018-11-26 18:49:56 +0300 |
---|---|---|
committer | Lukas Stockner <lukas.stockner@freenet.de> | 2018-11-26 19:31:18 +0300 |
commit | c0816cd03b42399e75a285d5e5dd1319e5054f17 (patch) | |
tree | 563c3c6a3025cc5a81f6a99cfc3306ff99898922 /source/blender/draw/engines/workbench/shaders/workbench_data_lib.glsl | |
parent | 9238b7308a3f0b2716237b36dbe9fe16ce4e041c (diff) |
Workbench: Add Curvature overlay for better visibility of surface detail for e.g. sculpting
The approach is fairly simple, just apply an edge detection filter to the view normal and scale the brightness based on that.
The overlay is disabled at object boundaries to avoid dark lines around objects.
Generally, this implementation follows the proposal of @monio at https://blender.community/c/rightclickselect/J9bbbc.
The changes are:
- Dynamic filter radius (on high-DPI displays, a radius of two is used)
- Options to reduce the strength of both ridges and valleys
- Tweaked function for the strength reduction (the original method actually had a local maximum, resulting in a brighter line inside valleys)
- Multiplication for blending instead of overlay, which doesn't work reliably with scene-referred intensities
- Renamed to point out the distinction between it and the SSAO-based cavity overlay
Reviewers: jbakker
Reviewed By: jbakker
Subscribers: billreynish, manitwo, linko, monio
Differential Revision: https://developer.blender.org/D3617
Diffstat (limited to 'source/blender/draw/engines/workbench/shaders/workbench_data_lib.glsl')
-rw-r--r-- | source/blender/draw/engines/workbench/shaders/workbench_data_lib.glsl | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/draw/engines/workbench/shaders/workbench_data_lib.glsl b/source/blender/draw/engines/workbench/shaders/workbench_data_lib.glsl index 7ba6b3a5193..3a538f4f2ac 100644 --- a/source/blender/draw/engines/workbench/shaders/workbench_data_lib.glsl +++ b/source/blender/draw/engines/workbench/shaders/workbench_data_lib.glsl @@ -13,5 +13,7 @@ struct WorldData { int num_lights; int matcap_orientation; float background_alpha; - int pad[1]; + float curvature_ridge; + float curvature_valley; + int pad[3]; }; |