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 / Making terrains with REAL USGS data, part 2

Author
Message
Visigoth
19
Years of Service
User Offline
Joined: 8th Jan 2005
Location: Bakersfield, California
Posted: 4th Aug 2007 09:54
another screenie

Attachments

Login to view attachments
Visigoth
19
Years of Service
User Offline
Joined: 8th Jan 2005
Location: Bakersfield, California
Posted: 4th Aug 2007 09:55
and another

Attachments

Login to view attachments
Visigoth
19
Years of Service
User Offline
Joined: 8th Jan 2005
Location: Bakersfield, California
Posted: 4th Aug 2007 09:55
and another one

Attachments

Login to view attachments
Crazy Programmer
AGK Developer
19
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Lost in AGK
Posted: 4th Aug 2007 18:52
Very nice work. Downloading the demo for the first time!


http://www.freewebs.com/zornoxstudios/
Learning C++ thanks DGDK
jason p sage
16
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 5th Aug 2007 01:39
Looks Good to me. Did you read that article from that guy who built his terrain "engine" from scratch? Its a really good read. He discusses ways to reduce polys etc for a given "terrain" without sacrificing much in the way of appearance.

If you haven't done optimization yet - your project is starting to look pretty ripe for finetuning stuff now. Looks very good - plus I know you have the code already to handle different "resolution" (such as viewed from altitude or not).

I was playing with water plains before - and I asked this guy on here who posted a screenie of his water shader - and when I asked about - he Said - Gotta pay for it - Now - I did say I'd like to have it - but I also was saying what things I foiund tricky - such as "Tiling" a decent shader - so it looks "in scale" etc - without stretching ot needing to have it duplicated N times - I hope you have better luck getting shader help.

Something tells me I/We need to just grab the NVidia SDK to figure out how to code those ourselves. Roll up the Calculus and Trig sleeves before you do
Jason P Sage

Know way too many languages - Master of none
Visigoth
19
Years of Service
User Offline
Joined: 8th Jan 2005
Location: Bakersfield, California
Posted: 5th Aug 2007 02:49 Edited at: 5th Aug 2007 03:00
@Jason,
No, I haven't read much of anything except for the help commands and some stuff on .x file formats and some stuff about DX itself. I just like to experiment and go from there.
I've been using timers and such to test my function speeds as I go. I don't have any bottlenecks right now, it is all silky smooth. The only "problem" is what I expected, and thats the slowdowns when there are a million plus polys onscreen. As for shaders, funny you brought that up, because it is the next step in this whole process. I've been playing with RenderMonkey for the last few days; its going to take some time to fully understand it, but what I like about it so far is that I can save one of my meshes and load it as a model in RM and apply the demo shaders, and it works. And shaders are FAST. I've seen posts about shaders slowing things down, and I don't quite understand that, because from what I have read, there are some extra chips on the video cards that all they do is handle shader operations. So, I'll be moving along to that area, hopefully soon. But next up is the ability to load a terrain from a list of terrains, another demo with the new color scale, and perhaps a new post of the source. Thanks for your interest still, and stay tuned....
Visigoth
19
Years of Service
User Offline
Joined: 8th Jan 2005
Location: Bakersfield, California
Posted: 29th Aug 2007 10:29
added a new demo. From now on, it will be at the top of the thread.
Visigoth
19
Years of Service
User Offline
Joined: 8th Jan 2005
Location: Bakersfield, California
Posted: 29th Aug 2007 10:48 Edited at: 29th Aug 2007 10:49
well, I'm having trouble uploading the demo, gonna try here


edit
nope, not working.
Lucy
17
Years of Service
User Offline
Joined: 19th Apr 2007
Location: Roanoke, VA USA
Posted: 29th Aug 2007 15:43
Try using this for your fog and backdrop color... you'll love it! It looks just like daytime atmospheric haze. I've been using this in a terrain driving demo (sadly the terrain i'm using isn't as impressively detailed as this stuff you're pulling off of actual satelite data).



Nothing I say is intended to be rude. My autism means that I do not know what is rude and what isn't rude. I apologize if I seem rude. It is not my intention.
Visigoth
19
Years of Service
User Offline
Joined: 8th Jan 2005
Location: Bakersfield, California
Posted: 29th Aug 2007 17:08
good colors
looks so much better than white now, thanks.
It'll be in the next demo.
Lucy
17
Years of Service
User Offline
Joined: 19th Apr 2007
Location: Roanoke, VA USA
Posted: 29th Aug 2007 18:17
Quite welcome

Nothing I say is intended to be rude. My autism means that I do not know what is rude and what isn't rude. I apologize if I seem rude. It is not my intention.
Omen
17
Years of Service
User Offline
Joined: 7th Nov 2006
Location: Maple Grove, MN US
Posted: 30th Aug 2007 08:02
@Visigoth,

I don't know how you feel about using shaders, but you could very easily adopt one of GG's AT blenders to this:

http://forum.thegamecreators.com/?m=forum_view&t=100645&b=1
Visigoth
19
Years of Service
User Offline
Joined: 8th Jan 2005
Location: Bakersfield, California
Posted: 30th Aug 2007 08:30 Edited at: 30th Aug 2007 08:31
@Omen
I'm open to anything. I'v been playing around a bit with Render Monkey and trying to learn shaders myself, and I have some ideas. One thing I am trying to accomplish is doing all this without any images. Since I already can manipulate the vertex colors, I should also be able to modify those colors with a shader...I think? I'll still look at GG's shaders, though, he does some really good stuff, I know.
And actually, right now, I'm trying to clean the code up some so I can post the source. I hope to have the source up in the next day or two.
z_man
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: Australia
Posted: 30th Aug 2007 12:33
Been a while since I checked here. Looking great! Keep it up and impressive effort.

z_man

Intel Core 2 Duo 6600 2GB DDR2 RAM Radeon X1600 Series Realtek Sound System

Persist and you will succeed.
BillR
21
Years of Service
User Offline
Joined: 19th Mar 2003
Location: United States
Posted: 30th Aug 2007 15:37
@Visigoth - Nice, really nice.

Keep up the great work!
Niels Henriksen
19
Years of Service
User Offline
Joined: 27th Sep 2004
Location: Behind you breathing heavely
Posted: 30th Aug 2007 17:36
Is it possibel for us to get the source? I will try to put in in .NET

Niels Henriksen
Working on a (MMO)RPG right now in LightEngine
http://noggs.netopcom.dk/forum/default.asp - Forum for the game
Omen
17
Years of Service
User Offline
Joined: 7th Nov 2006
Location: Maple Grove, MN US
Posted: 30th Aug 2007 18:43 Edited at: 30th Aug 2007 18:44
@visigoth,

If you want to go completely media-less, here's a couple resources (I know, some of them are really obvious places to look, just posting them for completeness):

http://en.wikipedia.org/wiki/Procedural_textures

http://www-evasion.imag.fr/Membres/Sylvain.Lefebvre/pattern/pattern_based_procedural_textures.pdf

http://www.blackpawn.com/texts/cellular/default.html

http://freespace.virgin.net/hugo.elias/models/m_perlin.htm

Hope you find those helpful
Visigoth
19
Years of Service
User Offline
Joined: 8th Jan 2005
Location: Bakersfield, California
Posted: 31st Aug 2007 12:10 Edited at: 31st Aug 2007 12:11
@Omen

Thanks, I'll check those resources out when I get some time.

@Everyone

Worked on getting the source cleaned up a bit, and it is now available at the top of this thread, along with another demo build. This is now an open source project. If you want to contribute, let me know. I will be adding a design doc to the source soon. You may use this sourcecode freely, as long as you follow the license agreement included with the source. Thanks all.

@ Niels
See the first post of this thread.

Also, if anyone has any trouble downloading or running anything, please let me know. I tested it all here, and all is fine, but you all know how sometimes things don't always work on other folks machines.

Thanks all.
Try
19
Years of Service
User Offline
Joined: 16th Aug 2004
Location:
Posted: 1st Sep 2007 01:10
Visigoth,
Hey, fantastic work man, and congrats for the newspaper mention.

Cheers,
-Try
Visigoth
19
Years of Service
User Offline
Joined: 8th Jan 2005
Location: Bakersfield, California
Posted: 1st Sep 2007 02:45
@Try,
Thanks! I didn't even know it was in the newsletter, because I didn't get it yet. I'm not sure who to thank for the mention,(BatVink?) but thanks, it means alot!
Hoozer
17
Years of Service
User Offline
Joined: 8th Sep 2006
Location: Bremerhaven (Germany)
Posted: 1st Sep 2007 14:26 Edited at: 1st Sep 2007 14:57
@ Visigoth: I tried to download the source-zip-file, but it appears only to be of 1kb size and it won't unpack with winRAR (the demo unpacked fine)! Maybe a re-upload can fix this!

The problem you mentioned with the coloring in the "mohawkvly"-map seems to be white "dots" instead of colored vertices, right? It seems to me, that these only happen at a special hight, cause these white dots do form some kind of a "line", so the hight of the dots seems to be at a value where no color-value is specified and the default white is used instead! (This is just a guess! )
I also saw only "one" white dot at the "grandcanyon"-map.

I also must say it's an honor for you to be mentioned in the newsletter! Very cool!


Hoozer

AMD64X24800+(939);2GB;GF6800LE (@12PS, 6VS; 380 MHz, RAM: 434 MHz)
DP-Sw-Mode-Comp-Entry (updated to V. 1.4):
http://forum.thegamecreators.com/?m=forum_view&t=109846&b=5&p=0
jason p sage
16
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 1st Sep 2007 14:34
@Visigoth - Here HEre. I'm with Hoozer! Great job. You've come a long way with this - and people have noticed!

It's been weighing on my mind heavily if I should try to implement your terrain solution or not in my game. the pictures look very very good. I'll be running the demo soon and looking at the source as well in the near future.

Visigoth
19
Years of Service
User Offline
Joined: 8th Jan 2005
Location: Bakersfield, California
Posted: 1st Sep 2007 17:12
@Hoozer
Hello old friend . I tried the source download, and it seems to be working ok. As for the white vertices, I agree it must be tied to height. You know, I haven't really spent the time yet to try and fix it, been too busy on other parts. Anyway, I'm going to try attatching the zip here, see if this works.

@Jason
Go for it! I always wondered what tanks would do to the Grand Canyon. Or even BASE jumping infantrymen..heheh.

Thanks for the good comments guys. It has me inspired to work even harder at this. And the whole thing so far has been alot of fun on my end, especially all the new things I've learned so far.

Attachments

Login to view attachments
Hoozer
17
Years of Service
User Offline
Joined: 8th Sep 2006
Location: Bremerhaven (Germany)
Posted: 1st Sep 2007 18:06
@ Visigoth: My fault! The download (at your first thread-side) works! I tried Firefox and had that error, but with "good old" IE6 it works fine! Sorry, to made you worrying about it!


Keep up your fantastic work!

Hoozer

AMD64X24800+(939);2GB;GF6800LE (@12PS, 6VS; 380 MHz, RAM: 434 MHz)
DP-Sw-Mode-Comp-Entry (updated to V. 1.4):
http://forum.thegamecreators.com/?m=forum_view&t=109846&b=5&p=0
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 1st Sep 2007 18:43
This thread couldn't go by without being mentioned, it's looking very promising

Visigoth
19
Years of Service
User Offline
Joined: 8th Jan 2005
Location: Bakersfield, California
Posted: 2nd Sep 2007 08:04 Edited at: 2nd Sep 2007 08:08
@Hoozer-
goood. glad you got it working. Some of the code is still spaghetti, but, I really tried to make all the functions generic. Using Types for GLOBAL variables allows me to add or delete variables within the types as the app grows. I think you should see my style in all this.

@Batvink-
Thanks again for the mention. It means alot to me. Like I said before, I'm having alot of fun doing this. I have alot more ideas, and I just hope I can make them all work.
Yiff
18
Years of Service
User Offline
Joined: 30th Sep 2005
Location:
Posted: 4th Sep 2007 16:49
application failed to start coz:

d3dx9_31.dll was not found

What does this error message mean ?
Visigoth
19
Years of Service
User Offline
Joined: 8th Jan 2005
Location: Bakersfield, California
Posted: 6th Sep 2007 15:11
@Yiff
d3dx9_31.dll looks to be part of the DirectX system. You may need to reinstall DirectX? This is built using version 6.6 of DBPro, so you will need DX 9.0c.
Niels Henriksen
19
Years of Service
User Offline
Joined: 27th Sep 2004
Location: Behind you breathing heavely
Posted: 6th Sep 2007 18:45
@Visigoth
Where are you getting your data from? Im looking at http://edc2.usgs.gov/geodata/index.php but am a little confused

Niels Henriksen
Working on a (MMO)RPG right now in LightEngine
http://noggs.netopcom.dk/forum/default.asp - Forum for the game
Visigoth
19
Years of Service
User Offline
Joined: 8th Jan 2005
Location: Bakersfield, California
Posted: 7th Sep 2007 04:39 Edited at: 7th Sep 2007 04:40
@Niels
You get the data here:
http://seamless.usgs.gov/
It takes a bit to get used to their system. I download 1/3 arc second data in 32bit gridfloat format. Don't get too big a chunk. If you do, get the program 3DEM, just Google for it. You can use that to extract smaller grid data files. Also, you have to know how many columns and rows are in the data file. you will get a header file that has that info. Make sure you format it to the way I have the header files set up for the examples. If you keep your source data file below 30megs, you should be ok.
Niels Henriksen
19
Years of Service
User Offline
Joined: 27th Sep 2004
Location: Behind you breathing heavely
Posted: 7th Sep 2007 16:54
Very nice... I will try to play with it

Niels Henriksen
Working on a (MMO)RPG right now in LightEngine
http://noggs.netopcom.dk/forum/default.asp - Forum for the game
jason p sage
16
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 21st Oct 2007 01:46
Visigoth - I gave this a good look over. I think I'm going to check out what I can do with making height maps from the us gov stuff - and I'm also going to peruse your code as well to see what's up. I think a littel texturing, some LIT Frustrum culling (If you aren't already doing that - I think you might be the way the FPS changes dramatically depending on direction of view) All in all - I'm having really bad luck with Terrain editors - and I think its time for some satelite imagery

Visigoth
19
Years of Service
User Offline
Joined: 8th Jan 2005
Location: Bakersfield, California
Posted: 21st Oct 2007 02:06 Edited at: 21st Oct 2007 02:07
@jason
It shouldn't be too hard to make a heightmap from their data. In fact, I was thinking about modifying this a bit to use heightmaps as well as the downloadable data. Its on the back burner, at the moment. Been playing too much with shaders, hopefully to add to this. I don't know what LIT Frustrum culling is; something I need to learn about, you think? Anyway, goodluck, have fun, I'll try to answer any questions you might have about the code, if need be.
jason p sage
16
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 21st Oct 2007 02:51
Quote: "It shouldn't be too hard to make a heightmap from their data."
Cool - I just downloaded an island in hawaii as a test - 90000 ft across, but the file names and extenstions don't match your geosource ... they have hdr.adf or something, and you have files like *.hdr and *.flt ???

Quote: "I was thinking about modifying this a bit to use heightmaps as well as the downloadable data. Cool Idea! I have some bandwidth and server room for us developers "


Quote: "Been playing too much with shaders"
me too on and off. If you find a stellar "Ocean" and or "Lake" one good for views of "Huge terrain"... Do share.

Also - I observed in your demo ZERO Z-Fighting with the Wateer. How is that? If I was to mod the program so I could fly - Would I get Zfighting then? Where water flickers on edges of land? I know - I can research - but you might just know already.

Quote: "I don't know what LIT Frustrum culling is; something I need to learn about, you think?"
Yes. LIT = Lost In thought - one of our Game Programming Brethren. He took a "Tutorial" about Frustrum culling and implemented in it DarkBasic Pro. Works on limbs. Same guy who made the Inca Pro Demo where you roam around 3DWS levels... like houses and buildings etc. Has LIMB culling - and I'm told it works awesome for this sort of thing. If your lanscape is limbs I'd guess it work great - ... I've looked at his code a little and I think it handles the Whole Object as well. You do have a little set up for it to work - but basically - is a math solution for Object In Screen - because that is flawed based on size of object - Exqample - If you used object inscreen - and were flying over a land tile in your program, before you were 100% over/past it - it would disappear - too early basically.

So yeah - helps rendering speed. also, I am impressed with your different resolution/samplling of the data. Looks very cool! (Now that I had a chance to play in it for awhile)

MY questions are just: How do I read that data? Or does your code do it and you just renaed the files? (From seamless) or did you get a different file - I got the NED ones. Is that what you downloaded?

Something else that REALLY got my attention was that there is BOTH GROUND data and TREE Coverage - WHAT a COOL thing to make FOLLIAGE over land with those two layers eh? Definately perfect for a TANK/HELI/FPS game like Iron Infantry

Well - GREAT JOB... and I may dig in your code some more to see how you accomplished such nice terrain rendering without cheats like Advanced terrain - which I'm tempted to use for simplicity - but I hate the "DeTail" texture being so repetive. Otherwise it'll work in a pinch

Good Evening.

Visigoth
19
Years of Service
User Offline
Joined: 8th Jan 2005
Location: Bakersfield, California
Posted: 21st Oct 2007 06:28
@jason
I will write a better tutorial on how to get your own data, just not at this moment. I kinda covered it all in this thread, but, I think a step-by-step would be better. Something you should do is download a program called 3DEM. It will help split up real big terrain files. Just Google it, its free, it was an inspiration for me.
I'm really glad you are playing with this. And I will get to this in quick time, but, I am right in the middle of some shader stuff I am going to post in a couple minutes...plus, the Red Sox are playing...!
jason p sage
16
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 21st Oct 2007 08:03
I'm in GeoComm.com now grabbing Dem's and I grabbed 3dem. I'm probably well on my way I hope ... Oh and I hear ya on the Sox

Visigoth
19
Years of Service
User Offline
Joined: 8th Jan 2005
Location: Bakersfield, California
Posted: 21st Oct 2007 08:36
actually, you don't want DEMs Those are digital elevation models, and they are written in a proprietary format. And, they are not seamless. And they have more data than what we want. And they are smaller than what we want. It would be possible to extract the elevation data from DEMs, but, its too much of a pain in the ass. Believe me, I looked into it, not worth it. The seamless site rocks. Think like this. A terrain is nothing more than a grid of evenly spaced vertices on the x,z coordinate. To get height, all we need to do is push or pull the y coordinate. All my terrain does, is makes a grid, first. Spaced the same as the data we get from the USGS. Then, I just push or pull the y value of the vertex to match the data from them. Simple. Since we can get the data from the USGS is a float, its pretty simple, well, once you know how they format their data, to push or pull the Y coord in our grid. Makes sense to me. But DEMs aren't going to help you. All we need is a GRIDFLOAT, and you can only get this from the SEAMLESS site.
jason p sage
16
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 21st Oct 2007 09:27
Ok - thanx for the heads up - would I be a pain if I asked what "Buzz" word I want to seek out on the seamless site? They STGS, I also downloaded a "NAD".

TDDS, KML , SDDS , Digital Raster (prob not raster).

If you think I should read the whole thread thruogh I will be happy to - but my eyes are sandpaper at the moment - time to sleep.

Visigoth
19
Years of Service
User Offline
Joined: 8th Jan 2005
Location: Bakersfield, California
Posted: 21st Oct 2007 09:50
no, no problem. Like I said, I should write a step by step tutorial for this, but, what you want is 1/3 arc second data, in gridfloat format. 1/3 arc second is roughly 10 meter spacing. Can you wait till tomorrow for me to do the tutorial? I had a little too much celebration tonight with the Red Sox win.
jason p sage
16
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 21st Oct 2007 16:05 Edited at: 21st Oct 2007 17:06
Sure - I have a lot to read anyway in your current code. I bet you have some neat code making your seams line up the way they do - Not to mention the single key hi-med-low res switching - good for lod

[edit]
More looking at your code - chomping at the bit for the tutorial - read this whole thread (Where is part 1? heheh I'll go look) You mentioned that You made a conversion program - I grabbed the 1/3 arc - and I don't see a *.flt file in any of my Hawaii downloads. You mentioend you wrote some sort of tool - so I'm going to dig deeper into the code and see if you supplied it or not

Great Stuff.

Visigoth
19
Years of Service
User Offline
Joined: 8th Jan 2005
Location: Bakersfield, California
Posted: 21st Oct 2007 18:31
What I do is run the downloaded data file through 3DEM first, and extract out the section of terrain I want. 3DEM allows you to view the terrain data also, you just can't walk around in it.


the .hdr file is what tells the app how many rows and columns are in the .flt file. In this example, there are 1037 columns and 819 rows. that would actually be 1037 x 819 vertices. The app just strips off the extra 37 and 19 to make it round. It then makes each tile 100x100, so you end up with 10x8 tiles. You don't have to use 3Dem, but if you download more data than this, it will probably fail, because thats alot of polys. I think I did a test and got up to about 600 tiles before my machine locked up. The LOD uses the same data file, just reads in every nth value. that code is still kinda messy, but it works. I have to go to work now, but I'll give step by step a little later.
jason p sage
16
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 21st Oct 2007 19:39
I'm so WITH ya - don't need a step by step - your code has done that good JOB Man.... However - for "Learning sake" I'm writing a little FLT to Heightmap thingy - nothing fancy - just a util - run - and use paint to view

My only question now is - On the web site - I can only seem to download the GeoGloat stuf in 1 arc second category. the 1/3 sec catagory doesn't seem to have a Grid Float Option.

Hmm. that is the only thing - I'm thinkning i'm using less "Accurate" data when somehow I can get the 10 meter stuff.

Visigoth
19
Years of Service
User Offline
Joined: 8th Jan 2005
Location: Bakersfield, California
Posted: 21st Oct 2007 20:26
when the download page comes up after you select your area, there is a button to modify the data request. Click that, and then a new page will come up listing all the things you can download, and what you have selected. Deselect the 1 arc second, select the 1/3 arc second, and select gridfloat for the datatype. Here is a picture of that page.

Attachments

Login to view attachments
jason p sage
16
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 21st Oct 2007 22:06 Edited at: 22nd Oct 2007 19:02
DUH - Thanx! I didn't realize the "Checked" Row dynamically changed to a drop down. I thought the drop down was only for one sec arc .... smack me would ya! hahhaa

[edit]BTW - Noticed the Size limit of the geomapper as it sits now is somewhere around the 1000x1000x10meter range. You also mentioned yourself something about a tool to extract from the satelite file a "Usable" chunk. I'm trying to make a util to compliment yours that takes any size satelite iamge and makes into at least one (or many) 1000x1000x10meter tiles your geomapper thing can digest - basically just cookie cutting "BIG TILES" - dicing up psome heightmap info and texture info from satelite photo, then handing them to your geomapper so it makes the Real Tiles/meshs hi/med/low. and saves the meshs as numbered tiles to all can be puttogether dynamically in game via a LOD loader of sorts. Blending the usage of high, med, low res all together (based on distance and of course user preferences if they even want hi res etc)

I commented in a DarkGDK forum how I was very impressed with this work of yours as was everyone but my comment was how at first I was like "Whoa" Satelite..cool - musta been hard" and well I found after looking at your code that it wasn't hard - to get the satelite info - even if I was web site challenged - the daya for the Heights is easy.

I thought the real genuis was how you built the tiles in memory - adjusting faces, vertexs, welded - all in memory - that was freaking amazing how AWESOME you did there!

(So I'm using what you did to try and cover larger areas - haven't solved the lower left x/y coords and how I could make disparate satelite photes end up in a perfect "Tile System" expandable to do the whole world - like MS flight sim and Xplane did.)

I think the best way would be to basically use the longitude/latitude header information (the lowerleft point it references, and have a "close enough" Global sphere with certain "anchors" regular intervals maybe - or probably arbitrary system based on landmasses - to land tiles ok - and the fudge is underwater. Now I'm curious how they do this - but for may purposes in the short term - covering 10,20, and maybe square miles (Basically the biggest satelite downlaod I can do in one file - always square )

I AM having trouble making a heightmap with RGB values though. I can do gray scale - but that is lame - lose ALOT of resolution.

I scan the whole satelite file - lookingfor the HIGHEST point and the lowest - ignoring the "NODATA" value of -9999 - but is declared in the header and in theory could be anything. This gives me a range. The values are ground height - zero is sealevel I presume. But because there is negative values (Below sealevel) I record my lowest point - say -200 below sealevel - and save that as a offset value and I push up EACH value this amount so all my coord's start at zero. Now my HIGHEST value down to ZERO is my range. I divide that by (256*256*256) (R,G,B numerically capable of addressing) and then I do some ANDING etc to make sure I have three bytes per vertex to store the color in the heght map - but I don't know which should be the MSB, LSB etc ... example is what I think is the RED Byte what other systems use?

Well - this is a dicey side project I'm on isn't it

Visigoth
19
Years of Service
User Offline
Joined: 8th Jan 2005
Location: Bakersfield, California
Posted: 23rd Oct 2007 05:09 Edited at: 23rd Oct 2007 05:27
@Jason,
Glad you're having some fun with this. Just a few comments:
The data going in isn't an image. It is pure binary data. Each number just represents a height value. So, like you said, once you have the grid, it is easy to push the heights up and down. You just need to know the format of the data.(Columns and rows)
As for texturing the grids with actual satellite images, there is a reason I haven't messed with it, at least not yet. I was more interested in walking around the terrain, not flying over it. In fact, for flying over, I bet just satellite images on some very low res tiles would look just fine, so you could cover really large areas. Problem with walking on satellite images is those images have everything that is on the ground. Buildings, cars, trees, etc. So, once you are on the ground, everything just looks flat and pasted on. So, thats why I was color shading, and hoping to blend in some images for long distance, like trees, and for up close, have real 3d trees and grass and stuff. But, if you want, just download the images AND the terrain data at the same time. Then just line it up. You will have to slice up the images though. Oh, and one more thing, try repositioning the camera so you are looking straight down over the terrain, its looks pretty cool.
As for chopping up the data from USGS into smaller files, that is where 3DEM comes in. It will read in the data file you download, you just have to tell it how many columns and rows are in the data. This info is in the header file, which you already know.
Also, the reason behind the 100x100 grids, it was a performance thing. If I try to make an object over something like 12000 polys, it won't load. So, 100x100, actually 101 columns by 101 rows, was a nice even number. The actual grid function is very flexible. You can make grids of all different sizes and spacing.
Anyway, I'm glad you are liking this. And I welcome all your ideas and especially improvements.

edited:
ok, sorry, I see you got it right on the input data. I'm just kinda brain dead at the moment.

edited again:
sorry, I just thought of something else. One thing I discovered in all my testing, was the larger the object, the slower things got. So, if I added the tiles as limbs, and made one single object, things really got slow. Because even though the polys weren't on screen, the system() command still reported them, so I'm guessing they were in the video card memory. When I broke it up into individual objects, I could still have hi-poly counts, and, depending what I was looking at, decent frame rates.
jason p sage
16
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 23rd Oct 2007 05:45 Edited at: 23rd Oct 2007 06:01
Boy - Glad you stopped by - I was hoping/waiting for your response all day! And Yeah - I'm having fun with it!

Yeah - I hear you on the texture thing - though I'm shooting for a Walk, run, drive, or fly - so my looking at the textures revealed the same thing as your comments. However I DO think some of the satellite "Pics" are perfect for getting some textures - like runway tarmac, tones of dirt colors etc.

I - like you - want to fill it with a dynamic/Quasi-Voxel tree/shrubbery solution - with LOD for Tiles and LOD for everything else "in game" and make it "FOV" aware - so I LOD works with the zoom lens in a way one would expect

This evening I spent my time researching longitude and latitude distances and some distance math (So I can take the grid Size - from a starting long/lat - calc the "Grid Size info x/y size for given download, the "POINT" size stated in header - 10meters like you said but like 9.99999 etc in the header file and plot the data and connect the "Dots" so to speak so I can figure out how to plot "random" satellite images correctly on a globe - or in flat space for that matter - The header has the long/lat I think in the xllcorner and yllcorner variables. I think thats what they are - and the llcorner thing I assume means lower left corner.

I'm currently working with approximately 300x200square miles of terrain - just so you see the scale I'm shooting for. I'm curious if I can take a bunch of GridFloat (I know its 4byte binary floats or "Single Precision") data and plot it "Seamlessly" - say for the whole usa - not that I plan on downloading the whole usa anytime soon - but the ability to take the info - and make tiles that if "put together" worked like a global sized puzzle - well - that would be pretty cool. Unfortunately - the world isn't even a globe - but they can't prove it easily I read (Need Surveyor chain - long enough to measure surface - like a 16000 mile long chain - (I didn't make that up I swear! .. something about do it like the surveyors do) but it must be oblong a bit - (from spinning, centrifical force pulling its belly out a bit?) because they say longitude latitude just isn't perfect - but as good as we have. (Not to mention that Longitude/latitude values go to like the 20th decimal place - and it would take another programming language just to handle that part of the deal - the heights are easy compared to trying to plot this stuff on a globe

so I have decided that a preprocessor utility is required and this kind of number crunching isn't a DarkBasic strong point - so I'll write it in freepascal which is just blazing fast - and because we are talking file i/o .. I have some block read/write code I wrote that can copy files faster than windows does in the file explorer.

I really wonder how they did it in flight sim - I know it was lower res tiles very likely - but still - 1/3 arc or 1sec arc - same principles.

Again - I'm still really impressed how you build the meshes in memory. And yes I have adopted this little geomapping of yours - I'm very interested and think it is very realistically the base for a complete terrain solution for DarkBasic. I don't know how far I can/will carry the torch here - but I'm having fun trying. Thank you for your initial work - pure genuis getting to look as good as you did. Well Done!

(Still studying how you meshed this puppy)

[edit] I think I exagerated the precision needed to place the tiles. Get's pretty darn close using float ranges DBPro can handle.

Sigh
18
Years of Service
User Offline
Joined: 26th Dec 2005
Location: The Big 80s
Posted: 24th Oct 2007 09:42
Seems like a pretty cool program.

One thing that could be done to make it faster is to write a preprocessor that merges adjacent triangles that have the same, or nearly the same (constraint set by user possibly) normal. I was looking into this about a year ago but dropped it in favor of working on more important parts of my engine.

There are some good resources out there for doing this kind of thing, although they are geared more toward ROAM applications. Im sure they could be adapted to a preprocessor though.

The Great Nateholio
<img src="http://ixeelectronics.com/Nateholio/Pictures/Sigblock.PNG">
jason p sage
16
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 24th Oct 2007 14:25
Yeah - I too want to get back to the "Game" stuff - and the more I've studied - the trickier it gets.

I'm still writing a preprocessor but I think I've changed the scope a bit, partly because or the curvature of the earth thing - and partly because I need to REALLY figure out pixel by pixel how Visigoth made the meshes so I could do it myself if I had to.

The Reason is - that to do multiple Satellite images, or to simply parse a REAL BIG one - with the goal of creating exported Direct.x tiles of differeing detail, then I need to change things around a bit. Like not necessarily build 101x101 tiles at a time... at least have the ability to 1x1 ro 5000x5000 and instead - maybe work on a few at a time... new column? Make it, average seams, shift over and save old column, New Column etc. Creating and destroying objects as I go. (Maybe a tweak on that part so is doesn't dog out to bad)

Some of this admittedly gets beyond me - like converting long lat into exact spots to the satellite info lines up - but from some things I read about making flight simulation terrains - they have a preprocessor too - but it basically only comes close and requires post "Tweaking" to add missing polys, Fudge missing data to look reasonable, and sometimes just add polys because the two sets of satelitte info for same area don't quite line up.

I'll be quite happy now that I understand what's involved more to be able to turn areas of say 500 miles square into a terrain database that would allow some sort of tiled terrain on demand loading... I imagine this is what a ROAM terrain engine is.

Sigh
18
Years of Service
User Offline
Joined: 26th Dec 2005
Location: The Big 80s
Posted: 24th Oct 2007 20:21
ROAM isnt a terrain engine or method, its a process that automatically generates meshes of varying LODs (read poly counts) to speed up rendering. ROAM can take a bit of processing time, but the net result is usually a gain in FPS because you arent rendering as many polys to the screen.

ROAM (Real Time Optimally Adapting Mesh) is just code that automatically reduces poly count based on a few criteria such as distance from camera and changes in poly normals. Note though, that ROAM processors dont reduce poly count and consider it done, poly count goes down OR up based on camera distance to an area.

Here though, you'd only need a preprocessor to delete redundant polys - i.e. polys that share edges and have the same normal (or normals within a user set range). You wouldnt need to adapt the mesh for camera distance.

Here is just one of the many sites that deal with ROAM: http://www.cognigraph.com/ROAM_homepage/

The Great Nateholio
<img src="http://ixeelectronics.com/Nateholio/Pictures/Sigblock.PNG">
jason p sage
16
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 25th Oct 2007 02:30
@SIGH - Thanx for the Update on that. Its funny - back on page one of this thread Visigoth stated the mesh creation could be done in real time. I don't think he got that far - but considering what you just said about what ROAM is - I wonder how feasible this would be: Rendering as you go.

For now I'm going to go with the "Tiled" Meshes as Visigoth has done. though I've been thinking about changing the code around for my own purposes.

I've decided to scale back my "Map the World" only because I read enough about what is required to know I don't want to be writing something like the flight simulator people have written (Huge apps that do nothing but parse and build terrain - which then stell needs to be "Touched up" by hand to account for missing data, and the whole longitude/latitude/earth not perfectly round etc problems. the earth is oblong a bit - enough to screw up your typical "Longitude Latitude" distance algorythms by enough to matter - when it comes to laying down 10 meter tiles side by side hoping they are seamless everywhere! Biggest problem is "Tiling" multiple downloads when they are not contiguous.

Visigoth wrote on page one of this thread:
Quote: "But I think I want to see what Pearl Harbor looks like next "


Funny - I never saw that until I've been combing this thread rather thorughly in my quest for knowledge but before I had noticed it, I have had my scopes on Hawaii and the surrounding islands. In Fact, I've limited the scope of what I'm trying to put to tegether - to ONLY all of HAWAII and the surrounding islands - Approximately 740.125x555.9 km or 459.891x345.42 miles. For Scale - the Snippets that this geomapping code does at one time now (I THINK - if each vertice is 10 meters apart, on a 101 (100 units) square - in is in a 10x8 grid - I THINK - (Correct me if I'm wrong Visigoth) You have 10 kilometers covered currently in one clip we can walk around in.

@Visigoth - You also said you have made way for this to be a "Google Earth for Games" and I've been beating my head against a wall trying to come up with a good solution that (regardless of disk space) could be indexed (stacked directory structure for speed like with big image file databases on disk) and recalled quickly.

Did you actually make any progress along the google-earth-like lines?

I'm currently mwriting a program that will take multiple downloads and put them in one big file - defined ahead of time as the area to cover - premeasured. Based initialiiy on long/lat 4 coords distance - of the four points - but then "Flattened" into 2d grid - and long/lat with in this "SQUARE of EARTH" just calculated for a lower lefthande PLOT coordinate in the file.

THIS BIG file - is actually GridFloat Format - but is the result of multiple satelite downloads being more or less merged into one big file. This is the data I'm going to use for the modified GeoMapping util to work on to create literally a ton of meshes at varying resolutions. This I hope is the "basic" ground work I'm hoping I can use for Iron Infantry.

I've read some neat stuff how shaders might make this a lot easier in terms of texturing MILES of terrain.

Well - hope others are interested in this Satellite stuff as much as Visigoth has shown he is and I am (Otherwise - there is no reason to keep filling this thread with findings - nor do I want to hijack - this thread. Any thoughts? I can get quiet if desired! )

Login to post a reply

Server time is: 2024-05-30 22:06:05
Your offset time is: 2024-05-30 22:06:05