For my current game I need an outline shader with these requirements:
- The outline should stay the same thickness reguardless of camera distance and viewing angle.
- The outline width should be configurable to more than just 1 pixel
- The outline should Only be outside the mesh. There should Not be outlines inside the mesh.
Hint: The example image does not accurately represent 3D rendering in Godot (or in general) since I made it in Inkscape. It was the best way I knew of to quickly give an idea about the effect I want.
---
One possible solution to this challenge could be to:
- Render the 3D object into a framebuffer.
- Apply the 2D outline shader from the 2D shaders demo (View here, desired shader is on the 2nd Godette in the 1st row)
- Render the result onto the screen.
I'm not suggesting that this is the only or even the best solution to the problem. It's just the only one that came to mind because of my relative inexperience with shaders.