LWJGL 3 - Clipping mask

493msi

For drawing, I am using VAOs with glDrawElements and GLSL 3.30.

Imagine you have two objects (image below), the cyan one is the mask, and the red circle is the object to be clipped. All other objects aren't affected by the mask.

Only the part inside the cyan is showing on the screen.

What would be the most effective way to make this in real-time (no alpha maps), so it could be animated?

elect

You could use the stencil test. Essentially you render the mask first writing a specific stencil values, then you render the red circle only where you do not have those values.

Some good resources:

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related