Let’s say I have a background, a polygon (A) on top of that and a smaller polygon (B) on top of polygon A. I want B to look like it’s cut out of A so it looks like a hole. I’ve managed to do this by using
. However while there is now a hole in A, my “background” has also disappeared leaving me with a black hole. Even when I reset glBlendFunc to its original settings afterwards. Around polygon A, the background is fine, but underneath polygon B I have a black hole now. Can anybody help?
Make hole in polygon A that looks like B and dont draw polygon B.
Using stencil bufer. Draw B in stencil buffer (disable color & depth writes) and then draw A but use stencil function to discard fragments that belongs to B.
I managed to get it to work but on my test pc using a S3 Twister card, the CPU load jumps to 100%. Does that mean the video driver can’t handle stencil buffers?