Archived

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

i_pee_freely

Nehe tut - Heightmapping question

Recommended Posts

I have a question about NEHE''s tutorial number 34 on heightmapping. This "world" is pretty small. How would i make his code create a larger size environment???? One that i could move around on without flying around in never-never-land????

Share this post


Link to post
Share on other sites
You increase MAP_SIZE, and if you get very low fps, you can increase STEP_SIZE(which makes the polys larger)

another way to make the heightmap bigger is to increase the size with glScale (i think that''s the command, i don''t really remember, hehe)

Good luck

// Jonas Ericsson

Share this post


Link to post
Share on other sites
I think if you change those values, eventually his program will run at less than 1fps. At that point he''ll have to implement some kind of algorithm to reduce the number of triangle strips that are being displayed.

Share this post


Link to post
Share on other sites
I think if you change those values, eventually his program will run at less than 1fps. At that point he''ll have to implement some kind of algorithm to reduce the number of triangle strips that are being displayed.

---------------------------

??

Isn''t that the point? I haven''t seen many 3d games which don''t use culling.

Share this post


Link to post
Share on other sites
If you increase the scale amount, you won''t loose significant amounts of FPS.
However your polygons become larger, and they require more fill rate to do it.

~Main

==
Colt "MainRoach" McAnlis
Programmer
www.badheat.com/sinewave

Share this post


Link to post
Share on other sites
3d landscape rendering is a huge topic. There are many, many ways and techniques for representing large amounts of terrain without bringing your computer to a crawl. CLOD, ROAM, frustrum culling to name just a few. You can read many, many papers on the suject.

some of this stuff can be found here at gamedev.net. Other places to look are flipcode.com, gamasutra.com, and a really good resource is vterrain.org

Share this post


Link to post
Share on other sites
I have started with my first heightmap program too this week, and I''ve got it so far that I have split it up in leaves (small terrain pieces, this is called a quad-tree) and can render it with a call to drawArrays. It was quite a biatch to get it this far.
The biggest problem with NeHe''s tutorial is that he draws EVERYTHING at ANY TIME. So, when you are standing in the middle of the map, looking to the north, he will also draw what''s behind you, in the south. With the leaves and some easy frustrum culling you can determine what leaves you do, and what leaves you don''t need to draw, this will save you some performance.
I don''t know if nehe''s tutorial uses multitexturing, but you can also gain performance by determining if a leaf needs multitexturing or not. If it''s far away, you don''t need multitexture, if you''re right on it, you DO need multitexturing. This is called a LOD (Level Of Detail) technique, as mentioned before in this thread.

Another thing you could do to size up the map is enlarge the view angle. If you use Nehe''s code, you can find it in the resizeGLscene function, in the main.cpp file. I turned it up to 90 degrees in the gluPerspective call in that function (it was 45 original)

I recommend surfing over to www.gametutorials.com, and look up the openGL tutorials about heightmapping. There are about 4 or 5 of them, and they cover the most common ways of rendering the terrain.

______________________________
"A computer is meant to be a big calculator, not a storage device"
Struct.m33p.net

Share this post


Link to post
Share on other sites
quote:

you can also gain performance by determining if a leaf needs multitexturing or not. If it''s far away, you don''t need multitexture, if you''re right on it, you DO need multitexturing. This is called a LOD (Level Of Detail) technique, as mentioned before in this thread.



Approximating the mesh (i.e., using less triangles to render an area) that is further away from the viewer is also considered LOD. Some people call this geomipmapping. This, along with frustrum culling will definitely give you a HUGE boost in framerate.


Share this post


Link to post
Share on other sites