Nehe tut - Heightmapping question

Started by
8 comments, last by i_pee_freely 21 years, 2 months ago
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????
Advertisement
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
// Jonas Ericsson
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.
---------------------http://www.stodge.net
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.
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
==Colt "MainRoach" McAnlisGraphics Engineer - http://mainroach.blogspot.com
You might want to look at HME (see link in my sig) if you want a custom, larger height map

Height Map Editor | Eternal lands
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
E-x-p-e-n-d-a-b-l-e
OK, thanx
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
STOP THE PLANET!! I WANT TO GET OFF!!
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.


E-x-p-e-n-d-a-b-l-e

This topic is closed to new replies.

Advertisement