lavaflowglow
New member
- Joined
- Dec 13, 2020
- Messages
- 24
- Reaction score
- 6
- Points
- 0
Hello everybody, it's not often I make a post asking for help but decided it would be beneficial for me and potentially anybody in the future if I asked. I am currently a bit confused on how the stencil buffer works, I'm planning to use it for a clickgui but am trying to understand it before I start. As of right now my goal is to draw a small white box and then a large red box covering the screen, but I want the red box to not draw over the white one. I understand I can just draw the red box first and the other second but this is really only so I can understand how to use a stencil. I looked a bit online and on the forum and read a lot of documentation but for some reason my code isn't working, it's like the stencil doesn't exist at all. I'm assuming the problem has to do with minecraft itself and not opengl so I'm asking here, I put my code below, any help is appreciated
(Note for my code: The class containing the code extends off of mc guiscreen and is in the drawScreen method. Due to this, method calls like "drawRect" are just to minecraft's default drawRect method. Also the screenshots are of the middle of the screen, they're large enough to show both boxes but not the size of the full window)
Code: https://pastebin.com/ViLA7YUW
Result if I only draw the small box: https://aetherclient.com/uploads/lavaflowglow/f1610fe9b0.png
Result if I draw both boxes: https://aetherclient.com/uploads/lavaflowglow/b9c8224da9.png
Result if I draw both boxes but set the stencil test to never pass before drawing the red box: https://yiffing.zone/c4ab76ffd0
Again any help is appreciated, thanks in advance
(Note for my code: The class containing the code extends off of mc guiscreen and is in the drawScreen method. Due to this, method calls like "drawRect" are just to minecraft's default drawRect method. Also the screenshots are of the middle of the screen, they're large enough to show both boxes but not the size of the full window)
Code: https://pastebin.com/ViLA7YUW
Result if I only draw the small box: https://aetherclient.com/uploads/lavaflowglow/f1610fe9b0.png
Result if I draw both boxes: https://aetherclient.com/uploads/lavaflowglow/b9c8224da9.png
Result if I draw both boxes but set the stencil test to never pass before drawing the red box: https://yiffing.zone/c4ab76ffd0
Again any help is appreciated, thanks in advance