postprocessing icon indicating copy to clipboard operation
postprocessing copied to clipboard

Implement EdgeEffect

Open vanruesc opened this issue 1 year ago • 0 comments

Description

Related: #393

Implement an EdgeEffect.

This effect should focus only on rendering object feature edges for the whole scene. Selective object highlighting will be implemented in a different way.

References:

  • https://roystan.net/articles/outline-shader/
  • https://gamedev.stackexchange.com/questions/68401/how-can-i-draw-outlines-around-3d-models
  • https://docs.blender.org/manual/en/2.79/render/blender_render/post_processing/edges.html
  • https://github.com/gkjohnson/threejs-sandbox/tree/master/sobel-outline
  • https://www.vertexfragment.com/ramblings/unity-postprocessing-sobel-outline/

Tasks

  • [ ] Create SobelMaterial and SobelPass.
  • [ ] Create EdgeEffect that uses SobelPass to generate an edge texture.
  • [ ] Create edge demo under special-effects.
  • [ ] Add unit test.

Implementation Details

  • Use G-Buffer components (depth, normals).
  • Edge threshold, color and thickness should be configurable.

vanruesc avatar Feb 16 '24 00:02 vanruesc