Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Advanced Terrain - Memory error

Author
Message
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 29th Jul 2004 20:34 Edited at: 29th Jul 2004 20:36
I have used the example terrain source, which works, to create my own terrain, but I get a "memory failure". No more, no less, just that one message in a message box.

My images are 512 x 512



Any ideas?

BatVink
http://biglaugh.co.uk/catalog AMD 3000+ Barton, 512Mb Ram, 120 Gig Drive space, GeForce 5200 FX 128 Mb, Asus A7N8X Mobo.
Terms & Conditions apply
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 29th Jul 2004 20:43
OK...reduced images to 128 x 128 and it works.

If anyone knows the exact requirements of these images, it would be good to know.

BatVink
http://biglaugh.co.uk/catalog AMD 3000+ Barton, 512Mb Ram, 120 Gig Drive space, GeForce 5200 FX 128 Mb, Asus A7N8X Mobo.
Terms & Conditions apply
Mike Johnson
TGC Developer
21
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 29th Jul 2004 21:03
This will fail because of the split value. When using a large heightmap and a low split value it causes the terrain segments to end up with more than 64k indices and this cannot happen. Change your split value so it's higher. A value of 8 will work with 512 x 512 height maps.

Mike
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 29th Jul 2004 22:22
Cheers Mike.

So to get this right in my own mind, it's the number of "squares" in each "limb" that is too excessive? And if you generate more "limbs", you get around the problem? Sorry for the terminology, but it makes it simple for me to understand!

BatVink
http://biglaugh.co.uk/catalog AMD 3000+ Barton, 512Mb Ram, 120 Gig Drive space, GeForce 5200 FX 128 Mb, Asus A7N8X Mobo.
Terms & Conditions apply
Mike Johnson
TGC Developer
21
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 29th Jul 2004 22:49
BatVink - that's right. I'll try and explain it a little better -

Instead of using one large mesh the terrain is divided into multiple meshes. It's cut up like a grid and this is where the split value comes in.

The split value determines how the terrain is cut up. Imagine taking the height map and creating a 2D grid of 8 x 8. This is then transferred to the 3D so we end up with 8 x 8 = 64 meshes. These meshes ( limbs ) can the be used internally for visibility and also accessed by yourself through the limb commands in DB Pro.

In this example we have 64 meshes. Each of these meshes contains a certain amount of polygons that is based off the split value. If the split value is too low we end up with meshes that have more data than the graphics card can handle and this is when the memory error will be displayed.

As a test try removing the call to "update terrain" and add in a line "hide limb 1, 0". See how a part of the terrain is now missing. Try chaning that line to "hide limb 1, 1". Notice now how the part next to it is missing. Now experiment with the split value and see how the meshes end up larger or smaller based on this value.

Mike
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 29th Jul 2004 22:57 Edited at: 29th Jul 2004 22:58
Cheers Mike, now I have more questions!

UPDATE TERRAIN - does this do the "What shall I hide and what shall I show" work? I'd missed that bit, so I am guessing that I wasn't running as efficiently as I could/should.

Quote: "These meshes ( limbs ) can the be used internally for visibility and also accessed by yourself through the limb commands in DB Pro"

Does this mean that given enough meshes, you could potentially do some basic terrain deformation? Such as scaling the Y dimension to flatten bumps? Would this be efficient, or will it put a strain on the game?

BatVink
http://biglaugh.co.uk/catalog AMD 3000+ Barton, 512Mb Ram, 120 Gig Drive space, GeForce 5200 FX 128 Mb, Asus A7N8X Mobo.
Terms & Conditions apply
Mike Johnson
TGC Developer
21
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 29th Jul 2004 23:10
That's right - the update terrain command handles the visibility of the meshes.

It might be worth trying to deform the terrain and see how fast it runs. I haven't tried anything like this but as long as you're not modifying massive amounts of data it may not have much of a speed hit.

Mike

Login to post a reply

Server time is: 2024-05-09 00:15:26
Your offset time is: 2024-05-09 00:15:26