Closed
Description
I think Godot should offer support for stencil buffers to avoid rendering overhead or do fancy effects. However, there are many ways to use them, and it might be difficult to add this feature so it's both easy to use and flexible enough.
The following should become a collection of ideas what the stencil buffer can/will be used for, and what things must be respected in its implementation. Please feel free to add ideas and to discuss :).
I'll start here:
- Support for portal-like games: One camera A for the player and another camera B inside a viewport with "the environment on the other side of the portal". That "other" camera B should only render the scene where A can actually see a portal.
- This only requires one bit depth in the stencil, the ability to render objects into the stencil only (setting or clearing bits there), and the ability to do a simple on/off stencil test in the camera.
Possible problem with any implementation: The Godot engine itself may want to use the stencil buffer for its own effects in the future (?). Maybe we can only expose a part of the buffer?