Workbench: Add Curvature overlay for better visibility of surface detail for e.g...
authorLukas Stockner <lukas.stockner@freenet.de>
Mon, 26 Nov 2018 15:49:56 +0000 (16:49 +0100)
committerLukas Stockner <lukas.stockner@freenet.de>
Mon, 26 Nov 2018 16:31:18 +0000 (17:31 +0100)
commitc0816cd03b42399e75a285d5e5dd1319e5054f17
tree563c3c6a3025cc5a81f6a99cfc3306ff99898922
parent9238b7308a3f0b2716237b36dbe9fe16ce4e041c
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
14 files changed:
release/scripts/startup/bl_ui/space_view3d.py
source/blender/blenkernel/intern/screen.c
source/blender/blenloader/intern/versioning_280.c
source/blender/draw/CMakeLists.txt
source/blender/draw/engines/workbench/shaders/workbench_curvature_lib.glsl [new file with mode: 0644]
source/blender/draw/engines/workbench/shaders/workbench_data_lib.glsl
source/blender/draw/engines/workbench/shaders/workbench_deferred_composite_frag.glsl
source/blender/draw/engines/workbench/workbench_data.c
source/blender/draw/engines/workbench/workbench_deferred.c
source/blender/draw/engines/workbench/workbench_forward.c
source/blender/draw/engines/workbench/workbench_materials.c
source/blender/draw/engines/workbench/workbench_private.h
source/blender/makesdna/DNA_view3d_types.h
source/blender/makesrna/intern/rna_space.c