Is it possible to use an OpenGL-like stencil buffer as a mask?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By kitfox

I’d like to be able to set a mask before drawing a a texture. This mask would be like the OpenGL stencil buffer and would be in addition to whatever alpha channel is present in the image I’m drawing. I’d also like to be able to draw several images with masks onto the same accumulation texture so that I can build up my image in layers. I know how I could go about this if I were writing in C++ with OpenGL, but am not sure how to do this in Godot. Is it possible with the Godot API? If not, can I use OpenGL commands directly?

If not, can I use OpenGL commands directly?

Godot isn’t designed for that. It’s specifically designed to provide an abstraction over it, so that wouldn’t work.

Calinou | 2020-08-03 12:25