Python Forum

Full Version: how to destroy or remove object rendered with opengl from the screen?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
There are many ways to render object on the screen,such as using  VAO/VBO and glbegin/glend,but how do I destroy them or remove them from the scene?
One way I can think of is by making the object transparent by changing the alpha value in the shader,
But there are some problem,
1)the object isn't really removed or destroyed,but just invisible instead.
2)I need to rerender the whole scene from back to front again.
My main question is,how does games like minecraft destroy its block when player destroys it?
Nevermind,already found a way.
My idea is giving it a if statement before rendering the object and continue to render the object only if the boolean variable is true.
If not,don't render,which means destroy or remove.