Author Topic: complex terrain modeling  (Read 4389 times)

0 Members and 1 Guest are viewing this topic.

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
complex terrain modeling
lately ive been attempting to create extremely high poly terrain models using extensive detail boxing. i want to be able to go to a resolution as high as 2 polygons per square meter, yet want to cover the entire xz plane of the mission space of 1500000^2 meters (with some no-mans land to complete the illusion and provide a buffer so a skybox can be used to generate the feel of expanse). were talking 4500000000000 polies! purely impossible entirely. so how close to that can i get?

ive been using topographic maps as well as visible spectrum maps of various planets and moons generated by various space missions by nasa and other space agencies. seems the best maps are for the moon or mars. they are fairly easy to to convert to models in max, using the topographic map and the displace modifier on a subdivided plane generates some fairly accurate terrain. the trick is making the resolution of the terrain model more dynamic. you do this by tiling the model. and then having a progressive loding system drop or raise the lod of each tile depending on how close you are to it.

my closest attempt was a 1280.58^2km terrain model of a rather boring part of mars, at a resolution of roughly 2 polygons per 18^2 km. and it looks pretty good from high altitude. it worked and my fps stayed at 60, unfortunately my detail box based loding kinda sucked. in fact it didnt work at all, so only the low poly version of the model was ever visable. i setup 36 tiles, each having2 lods, one between 4k and 5k polies each, and another at about 500 each. this was actually the 2nd and 6th lods of the tiles i created, each had 7 lods. unfortunately the detail box system is rather cumbersome when dealing with that many subobjects. this of course was a prototype to see if the idea would work. and it sorta did.  it took about 20 minutes for pcs2 to generate bsp trees for it, and another 10 minutes for freespace to create an ibx for it. and the model was 44 megs.

my plans for a final version require 256 tiles each 100 km^2. lods would start at 1 square by 1 square by 2 tris, and continue up exponentially from there to about 128*128*2, for 8 lods (32768 polies at the top level). the lod of the current tile beneath you would depend on your height. possibly dropping an lod per 10km of altitude above it. the detail boxes would extend slightly over eachother to provide a transition zone, so if youre over an edge 2 tiles will be rendered at the lod for your height, over a corner and 4 tiles would get rendered at that lod. to prevent too many polies from being displayed at once, the detail box overlap would need to lessen as lods get higher. one would have to put together an lod progression that keeps too many polies from rendering at once.

then comes the matter of how to lod it. theres a couple ideas i have, one is to make each tile a subobject with its own stack of lods. though im not sure if freespace does per subobject lod distances (it really should because theres no point rendering a 2000 poly turret at the other end of a 10km long ship that fills up a dozen pixels on the screen). that would certainly make things a lot easier in the long run. the detail box system is rather cumbersome. since each lod of each tile, 2048 of them!, needs special subobject properties. also detail boxes dont exactly give you much control, it either renders when youre in the box or out of it, and i dont know if its possible to set inner and outer boundaries for each detail object. you might have to group a blank poly with each lod, so if youre in the box render the detail model, if not render the dummy with detail boxes as children. put frankly detail boxes suck or this. unless of course you create them procedurally. what would be really awesome is a utility to generate terrain models with a few parameters and a topographic map, and spew out a pmf model with all the tiles pre detail boxed for you. that would be kinda cool.
« Last Edit: June 20, 2009, 06:20:33 am by Nuke »
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline peterv

  • 28
Re: complex terrain modeling
I admire you Nuke! I wouldn't even think to do somethink like this without a team of 20 modelers an 3600 converters.  :D

 

Offline Col. Fishguts

  • voodoo doll
  • 211
Re: complex terrain modeling
Pictures or it didn't happen :p

Seriously, I admire your spirit for adventures in the FSO engine.
"I don't think that people accept the fact that life doesn't make sense. I think it makes people terribly uncomfortable. It seems like religion and myth were invented against that, trying to make sense out of it." - D. Lynch

Visit The Babylon Project, now also with HTL flavour  ¦ GTB Rhea

  

Offline Retsof

  • 210
  • Sanity is over-rated.
Re: complex terrain modeling
Okay, now this sounds awesome.
:::PROUD VASUDAN RIGHTS SUPPORTER:::

"Get off my forum" -General Battuta
I can't help but hear a shotgun cocking with this.

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: complex terrain modeling
Pictures or it didn't happen :p

Seriously, I admire your spirit for adventures in the FSO engine.

its still a wip, my proof of concept worked but it was kind of ugly, so im working on fixing it
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 
Re: complex terrain modeling
May the road rise, Nuke!  Looking forward to seeing what develops.

Cheers

 

Offline Aardwolf

  • 211
  • Posts: 16,384
Re: complex terrain modeling
Screenshots, kthx.

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: complex terrain modeling
i just wanted to share the technique and see if anyones done this before (aside from a certain death star). i estimate it would take a lot of effort to do this properly (something im not exactly known for). in fact its probably easier to to write a topomap->pmf converter. give it a really big topographic map and a really big texture, set some parameters, and it spits out a pmf, tables, textures, and possibly shell into a normal map compiling program to generate those from the top lods, with all the detail boxes pre-generated for you. then all you got to do is load it into pcs2, compile bsp and collision data (this takes awhile), then load into the game and create an ibx (also takes awhile)
« Last Edit: June 26, 2009, 03:12:02 pm by Nuke »
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline Dragon

  • Citation needed
  • 212
  • The sky is the limit.
Re: complex terrain modeling
It would be completely awesome ,with this even I would be able to make terrain models.
I wish you good luck with this, Nuke.

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: complex terrain modeling
i started writing a lua based tga parser. i found a module that you can use to strings to typed binary and vice versa. this lets me better work with binary files like tga, as well as pmf and pof. the tga specs are so simple i managed to get a parser working fairly well. it wont be hard to generate triangular patch grids of different resolutions. then it would be a simple matter of mapping the image over it and then set the y value of every vert according to the pixel value in the same place on the map. there will probibly be some kind of filtering done to smooth out the results, as well as amplify the effect.

im either gonna use a sdl based software renderer or no renderer at all (command line only). id go with an opengl renderer but then id have to compile a custom lua interpreter with open gl bindings. but the hard part will be understanding kazan's pmf specs.
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline Spoon

  • 212
  • ヾ(´︶`♡)ノ
Re: complex terrain modeling
What nuke wrote:
i started writing a lua based tga parser. i found a module that you can use to strings to typed binary and vice versa. this lets me better work with binary files like tga, as well as pmf and pof. the tga specs are so simple i managed to get a parser working fairly well. it wont be hard to generate triangular patch grids of different resolutions. then it would be a simple matter of mapping the image over it and then set the y value of every vert according to the pixel value in the same place on the map. there will probibly be some kind of filtering done to smooth out the results, as well as amplify the effect.

im either gonna use a sdl based software renderer or no renderer at all (command line only). id go with an opengl renderer but then id have to compile a custom lua interpreter with open gl bindings. but the hard part will be understanding kazan's pmf specs.

What I read:
I'm casting a Magic spell to help me make the impossible possible
:lol:
Urutorahappī!!

[02:42] <@Axem> spoon somethings wrong
[02:42] <@Axem> critically wrong
[02:42] <@Axem> im happy with these missions now
[02:44] <@Axem> well
[02:44] <@Axem> with 2 of them

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: complex terrain modeling
thats pretty much it. :D
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline Roanoke

  • 210
Re: complex terrain modeling
does it need to cover the entire potential play area ? I know it would be best if it did, but I'd be inclined to do something more like a quarter and put up some invisible walls to stop smart arses' fromt straying. No where near as "cool" but it's worked for pro games for years.

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: complex terrain modeling
no, but i want it to be an option. in fact i want to make terrain size and number of tiles input variables. so you can make as big of a model as you want, or a smaller more detailed one if its better suited to your modding needs.  mainly im writing this util for my atmospheric flight model, but if you want to restrict the players movement, then it wouldnt be that hard, just import an inverted cube with the invisible texture with pcs2. this would allow you to use more detailed terrain, if you plan to use standard freespace physics.

so far its still not generating polygons, the tga parser works flawlessly, i got my pixel class working and my 2d vector class working. today il work on the 3d vector class and see if i can generate at least some verts with tga imported height values. im kind of concerned about memory usage. since loading a 300x300 pixel image somehow consumed 600 megs of ram. though it may have just been my ascii renderer :D
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline Spicious

  • Master Chief John-158
  • 210
Re: complex terrain modeling
Why lua?

 

Offline chief1983

  • Still lacks a custom title
  • 212
  • ⬇️⬆️⬅️⬅️🅰➡️⬇️
    • Skype
    • Steam
    • Twitter
    • Fate of the Galaxy
Re: complex terrain modeling
Because Nuke is a scripting junkie?
Fate of the Galaxy - Now Hiring!  Apply within | Diaspora | SCP Home | Collada Importer for PCS2
Karajorma's 'How to report bugs' | Mantis
#freespace | #scp-swc | #diaspora | #SCP | #hard-light on EsperNet

"You may not sell or otherwise commercially exploit the source or things you created based on the source." -- Excerpt from FSO license, for reference

Nuclear1:  Jesus Christ zack you're a little too hamyurger for HLP right now...
iamzack:  i dont have hamynerge i just want ptatoc hips D:
redsniper:  Platonic hips?!
iamzack:  lays

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: complex terrain modeling
i really like lua. since ive discovered the language ive been very impressed with it. you dont have to **** with datatypes, pointers, references, and dynamic memory. you just go straight to doing what you need to do. its also a good way to prototype stuff i might eventually do in c/++. for example my (still not quite done) particle spew code was prototyped in lua.
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline Aardwolf

  • 211
  • Posts: 16,384
Re: complex terrain modeling
So, still nothing in-game?

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: complex terrain modeling
no. im starting to question if this is even possible. lua's memory usage is through the roof. just loading an 8 bit 2048^2 topographic map (much smaller that what i had planned to use) eats over 500 megs of memory. it should only be around 32 megs, but lua tables are rather inefficient when it comes to memory use. apparently named keys take up 40 bytes each, indexed keys use up 16 bytes each. unless i come up with a means to streamline the whole process my efforts may be in vain. i could start over and write it directly in c/++. which would allow an opengl rendered of sorts. but im gonna try to change some of my tables around to see if i can squeeze more memory from the whole system.
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: complex terrain modeling
heres a teaser, this is a low lod of the proposed full level terrain map.
http://www.youtube.com/watch?v=MMmhsxv69uI
it also shows my atmospherics and gravity
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN