View Full Version : Does OpenGL remove the processing of the objects that aren't in the view volume?
10-23-2005, 04:42 AM
My question is about the terrains. terrains consist of many vertices. assume that we have created a terrain with 5000 vertices and the view volume can only show 1000 vertices. So i believe that only 1000 vertices are processed in my program. Am i correct?
Note that i have called the function DrawTerrain() in my Render function:
DrawTerrain(); // Draw a terrain with 5000 vertices.
Does OpenGL remove the processing of the objects that aren't in the view volume? As an example, if i call the function DrawModel() in my render function and if it's not in the view volume, can i insure that it isn't processed by my graphics card?
10-23-2005, 05:10 AM
OpenGL renders all objects between the near and far clipping plane. Those objects that fall outside are not rendered. I'm not sure what happens with models or terrain. I think that OpenGL renders only the visible triangles (that are between near and far clipping plane).
That's just what I think. I'm not sure...
Try to have a look at the OpenGL pipeline, that will really help you.
All the vertices you stippled pass the first stages of the pipeline. Only when those vertices are transform in eye coordinate space, they will be clipped, but not only with near and far clip planes, but with 6 planes (a truncated pyramid). It's only there that vertices out of the view will be dicarded (if full out) or clipped (if partially in the view).
So, I don't know what to really answer to your question. Anyway, hope that helps.
10-23-2005, 11:10 AM
Do a google on CULLing, typically you want to cull the geometry that falls outside your frustum before you send data to OpenGL
The answer is, of course, that OpenGL has to do SOME processing for EVERY vertex you give it. Vertices that are clipped because they fall outside the view frustum have less processing than those inside, but the processing and test to determine this is not zero.
10-23-2005, 11:46 PM
Now i understand... Regarding the book *OpenGL A Primer*, the OpenGL pipeline consist of the following steps:
So all the vertices should pass the first 2 steps.But those vertices that are inside the view volume, move through the OpenGL pipeline. :)
Powered by vBulletin® Version 4.2.3 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.