Archived

This topic is now archived and is closed to further replies.

Terrain Engine

This topic is 4955 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I've made several terrain engines in DirectX. Now I want to make a Terrain Engine in OpenGL that allows for fast manipulation of the individual vertices. What would you guys suggest. Should I compile a list and always recompile when theres a change. Or just feed in the data per frame: glBegin....glEnd Or any other ideas. Obviously I want maximum performance. What would you guys suggest. -CProgrammer [edited by - CProgrammer on May 19, 2004 5:23:02 AM]

Share this post


Link to post
Share on other sites
It depends on how you intend on altering the vertex data. However, I would definitely not recommend compiling a display list for data that isn''t going to be static. Use vertex arrays instead for a _quick_ solution.

Share this post


Link to post
Share on other sites
And it depends how your terrain is organised - a polygon mesh, a simple heightmap etc. I guess storing the data somewhere in system memory and cpying accross the bits you want would work. It depends I think how often the vertices need to change. If it''s rarely then optimise it for a astatic terrain ie data in graphics memory. If changed all the time ie many vertices changed each frame then I think putting it in system memory is best.

Share this post


Link to post
Share on other sites
It will change all the time. So storing in System Memory and then just sending the data via glBegin... is the best choice here. Or wait the Vertex Array idea. Since I havent used OpenGL to much does one of you have a good look explaining the implementation of VertexArrays with OGL.
-CProgrammer

Share this post


Link to post
Share on other sites
quote:
Original post by CProgrammer
It will change all the time. So storing in System Memory and then just sending the data via glBegin...


stay away from glbegin for anything thats more than a handful primitives. youre handfeeding the gpu in the slowest possible way.

either plain old vertex array or vbo. if you change data all the time use the right type (DYNAMIC_DRAW unless you are really changing it every few frames, then id use STREAM_DRAW).

Share this post


Link to post
Share on other sites
Visit OpenGL.org you''ll find enough tutorials that explain VAs or VBOs. OpenGL has nearly everything that exists in D3D and it''s easier to write code once you''re accustommed.

Share this post


Link to post
Share on other sites
Take a look at glDrawElements(). Its OpenGL''s vertex array renderer, and is very easy to use. MS OpenGL reference is a good resource for OpenGL. So is the OpenGL Programming Guide by Woo, Neider, Davis.

--------------------------------------------------------------------------------
Good Links: C++ Reference, Java API
SDL Home Page, Lua Scripting Language, Python Scripting Language
Chris Taylor''s Design Document (Downloadabe MS-Word Only), Blitz Basic Homepage

Share this post


Link to post
Share on other sites