Replies: 2 comments
-
|
The reason you have to change the blend mode is that by default the alpha channel of a destination buffer is unmodified. To get this effect we need our drawing to affect the alpha channel, and not just blend with the color channels. So we have to change the blend mode. The pixels in the circle have an alpha of 0, the pixels in the texture have an alpha of 1. So the mode compares the two, 0 is the smallest value of 0 and 1, so it writes 0 to the alpha channel for those pixels. This mode ensures that the most transparent pixels are kept regardless of what is drawn. |
Beta Was this translation helpful? Give feedback.
-
|
Hey! That's a nice example! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Here is a simple example of how to build a render texture with a transparent hole in it.
It involves using RLGL and OpenGL blend modes (Note the #defines at the top of the code).
Beta Was this translation helpful? Give feedback.
All reactions