Is there anyway to scale a terrain created from a heightmap without having huge performace hits. im using a 800x600 grey scale height map but it hurts perforamce quite alot. was wondering if a smaller heightmap sacled up will be better?
Date: 17 Feb 2010 22:13
Number of posts: 2
RSS: New posts
The more vertices you have the harder it will be. I'm not sure about JigLibX, but with other physics engines you can submit heightfields in chunks. For example, rather than a 1024x1024 heightfield, you could submit 4 512x512 heightfields. Doing this allows the physics engine to more easily eliminate unnecessary collision checks. However, a proper engine would probably have some kind of spacial partitioning even within its own mesh to eliminate most of the triangles or vertices that need a collision check, and if that is the case, I'm not sure submitting multiple chunks of smaller terrain would help.
Anyway, all of that being said, I'm using a 1024x1024 terrain, scaled to 4096x4096 in dimension/size, and seeing pretty good performance (around 150 fps even with a stack of boxes and 20-30 spheres bouncing around the map). Are you sure physics is your problem? Or could it be the rendering of the terrain itself, or something else? What kinds of shapes are you using? Are they simple shapes, or something complex like a trianglemesh?