How would I check if an object drawn in openGL-ES is visible?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You don’t check IN OpenGL if an object is visible.
You must have your own visibility/culling algorithms to do that. That means BSP Trees, Portals, Octree and others. Depending on the complexity of the world you can get away with an space partitioning based on an grid or something. It really depends on what you are doing.
Remember, OpenGL knowns only to Draw and to Cull.
You can do a loop on all objects in your world and tell GL to draw them all one by one. Each one will be process and discarded if not in view. Of course this is brute force and slow.
Hence the need for more encompassing algorithms for culling.
Why do you think Graphic Engines have all those million lines? 😀