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.

Dark GDK / 3d Terrain question / pop quiz

Author
Message
Smoke sheath
18
Years of Service
User Offline
Joined: 19th May 2006
Location:
Posted: 28th Jun 2006 18:10
Hi folks, been trying to get my head round something and would be interested in advice.

Looking to create a landscape made from multiple terrain blocks, each block of which is made from an array of (say) 16 x 16 tiles (tri pairs). Terrain blocks are to be held in a quadtree to enable easy dbHide / dbShow if in view.

Now as far as I see there are two ways of doing this:

(1) use dbTerrainObject - this is what i did first time under dbPro and it worked like a dream although I have since read on the darkSDK forums that the terrain object is slow to draw, unnecessarity double sided and there are other, potentially better ways of doing things.

------- During land generation
(2) Construct the terrain in the following way:
A. generate the terrain using fractal generation algorithm (not a prob)
B. process each block data with LOD algorithm to remove unnecessary vertex / face data (hopefully not a prob)
C. write block data into text .x file
------- When ingame ....
D. load .x file with dbLoadObject
E. dbMakeMeshFromObject to pull vertex / face info back out
F. construct data tree for players current 16x16 block in order to pull height / face location out for walking / sliding behaviour


Here is the question:
Are these my only two options or is there something glaringly obvious i have overlooked ? Answers on a postcard please and I will treat the winner to a beer flavoured ice-cream once i have finished banging my head on the wall 8D
Zeal
22
Years of Service
User Offline
Joined: 10th Oct 2002
Location: Colorado Springs, CO
Posted: 28th Jun 2006 19:04 Edited at: 28th Jun 2006 19:05
Use a chunked system. Imagine 16x16 chunks (individual objects), each of whatever resolution you want. Dark sdk will auto hide chunks that arent in view.

With a chunked system you can do a lot of neat things too, like different lod tiers based on distance. Streaming terrain that shifts/updates as you move, ect...

Its how im doing my terrain, and its hands down the way to go.

*as far as the structure of the individual chunks, im just using a simple quad (again whatever resolution you need). When I need to shape the chunks, use the vertex manipulation commands to set the height of the verts.

All you need is zeal
Smoke sheath
18
Years of Service
User Offline
Joined: 19th May 2006
Location:
Posted: 29th Jun 2006 14:46
Thanks Zeal, interesting suggestion

Is your player purely on the ground ? I can see that as the player moves across the 16x16 chunks you can preload the next two sides (top & left, top & right etc ... but prolly only about 1k of data mebbe 2) as required. How about with the player taking to the air - you would need to load more than two strips at once ... loading less detailed lod sections for more chunks per unit time .... do you get much framerate stutter from this ?

No Gir ! Thats Bad !
Zeal
22
Years of Service
User Offline
Joined: 10th Oct 2002
Location: Colorado Springs, CO
Posted: 1st Jul 2006 03:08 Edited at: 1st Jul 2006 03:13
Yes thats right the player is mainly on the ground and the terrain only shifts left and right (and for the love of god, DONT try and process both a x axis & z axis shift at the same time!). As far as "loading", all you really need to load are the new heightmaps (the chunks themselves are never deleted, but rather repositioned). So if you move too far to the x+, all the objects on x- (left) side get picked up, and repositioned on the right side. Then just write a little queue so only one chunk is updated (re shaped, re textured, re 'normaled') every xMs. If you do it right (like me :p) you will get ZERO stutter.

As for taking to the air, and Lod, you have lots of options. My terrain had been through a billion revisions (been working on it for over a year). Right now im actually managing two terrains, one is 16x16 chunks low res, the other is 4x4 chunks high res. The two terrains just sit ontop of each other, each shift as you move. There are more complex ways to manage lod, but I found this way to be most elegant. Its a good place to start imo, you could always add more layers if you need more lod.

All you need is zeal
Smoke sheath
18
Years of Service
User Offline
Joined: 19th May 2006
Location:
Posted: 3rd Jul 2006 00:13
Thanks again Zeal, I didnt immediately see how the chunk system would work (as you described with single 2 tri tiles) when having to deal with a variable height above ground but after the innitial suggestion and some nosing around on the web for chunk systems i think i have a model which should cover all instances (and should be less of a pain in the motherboard).

Many thanks again - just less me know where to send the beer ice-cream 8)

Again i came to the conclusion that a multitiered system would best - possibly 3 tiers as i was max draw distance, and if the framerate allows as you pull up from the ground ghost the higher res tier to allow partial visibility of the lower behind it to avoid the terrain obviously snapping to an adjusted shape. Yes I know transparency is expensive but this is just a suck-it-and-see idea during implimentation.

At the risk of repeating myself - Many thanks

No Gir ! Thats Bad !

Login to post a reply

Server time is: 2024-11-19 06:32:50
Your offset time is: 2024-11-19 06:32:50