Mesh load terrain

Blitz3D Forums/Blitz3D Programming/Mesh load terrain

Guy Fawkes(Posted 2009) [#1]
I know u guys proally dont have time to fix it, but i need some help fixing uv coordinate glitch. its some bad geometry.




Guy Fawkes(Posted 2009) [#2]
Ok, guys. I have tried & tried to fix ur code, but i still end up where i started. here's my code so far. download the zip provided above to try the code.

i added stuff as well. ull need a cloud texture. i will provide it to u. and a sea texture. which i cant provide to you. i say this because my sea texture isnt perfect.




Guy Fawkes(Posted 2009) [#3]
Cloud texture: http://www.mediafire.com/download.php?zgmjlieydgl


Abrexxes(Posted 2009) [#4]
Please, next time upload in 32bit TIFF to make DSL6000 users happy! (or optimize it to make us all happy) ;)




Guy Fawkes(Posted 2009) [#5]
Sorry abrexxes ><


Adam Novagen(Posted 2009) [#6]
Meh, don't worry about it too much, DSW; just check on the image filesize. If it's over 500KB, try to shrink it down. JPEGs are usually smaller; if you have Photoshop or the GIMP, you can tune their settings to get the perfect balance of quality vs. size.

With regards to your actual problem, though, I wish I could help, but UV mapping is a very new concept to me, so I'm not much good. T_T


Guy Fawkes(Posted 2009) [#7]
I understand. :)


Ross C(Posted 2009) [#8]
I updated my load terrain mesh function in the archives. I believe that code uses my old version, with the old UV bugs. My new version should work perfectly.

http://www.blitzbasic.com/codearcs/codearcs.php?code=1609


Guy Fawkes(Posted 2009) [#9]
Ross, this leads back to the same function I've been using. LoadMeshTerrain. and I tried the other 2, but I cant seem to move camera w/ top function OR use a map w/ a dot to show position of player.

the 2nd function doesnt even show the terrain. loadterrain3().

here's my code so far:



~DS~


Ross C(Posted 2009) [#10]
Don't even use that code. Just use my code i posted in the archives. He has modified some of my code, so replacing it with the new version won't work.

And the function is called the exact same thing, yes. I have however, updated it and eliminated the bugs.


Guy Fawkes(Posted 2009) [#11]
right, so how do i make the map appear on the screen as sprite like he did? w/ dot that cant go off the sprite?


Ross C(Posted 2009) [#12]
I don't know. You'd need to write a map function :o) My function only taks a heightmap image and creates and textures a Blitz mesh. It would involve making a relationship between the players co-ords, and the ultimate size of the terrain i believe, and scaling it appropriately so it would show a map.


cyberyoyo(Posted 2009) [#13]
Hey Darkshadowing I have made some fixes to your program and removed a lot fof the seams.
look there:
http://www.blitzbasic.com/codearcs/codearcs.php?code=1609


Guy Fawkes(Posted 2009) [#14]
This is great cyber! :D Btw, could u tell me ur email? If not, its cool :)


cyberyoyo(Posted 2009) [#15]
Wait a minute I think I can improve it again. I'll post a newer version in this thread later today.
Sorry I'm a bit paranoid with my email :p


cyberyoyo(Posted 2009) [#16]
Ok here's my last effort. I couldn't improve on the seams but I cleaned up the code a bit.
It looks good enough for me ;)




Guy Fawkes(Posted 2009) [#17]
This is awesome! Thank you so much cyber!

The glitch is sorta annoying.

If anyone else would like to try to fix it 100%, please do.

If not, then thats fine.

~DS~


Krischan(Posted 2009) [#18]
DarkShadowWing, take a look in the code archives, i posted an update there.


Guy Fawkes(Posted 2009) [#19]
Holy CRAP! Kris, thats AWESOME!

HOW did u make this?!

http://www.blitzbasic.com/gallery/view_pic.php?id=1910

Can u do the same for LoadTerrain?!

Along with it reading terragen OR heightmap?


Krischan(Posted 2009) [#20]
Can u do the same for LoadTerrain?!

Sure, I'm working on it right now. In the screenshot I used an older code with a quadtree Terrain not capable of Vertex Shadows but with a very high resolution texture and a nice but unfinished realtime sky environment. The huge 8192x8192 texture is cutted down to 8x8=64 "smaller" textures with 1024x1024 pixels each. But this leads to the next problem (which is the same problem you encountered in the first post of this topic). You will notice the cutting seams of the texture, but only if you're close enough (in my latest demo there is a large texture stretched across all tiles so there a no seams). The solution here is to align a single row of texels along the right and bottom texture side with the neighbour texels of the neighbour textures per tile, hard to explain. Short: the opposite pixels must be "duplicated" to align seamless. If I have time I will post a demo later.

I wouldn't suggest using a heightmap, just think about the detail difference. A heightmap gives you 0...255 = 256 nuances. A terragen file gives you 0...65535 = 65536 nuances! This is 256 times more detailed! You must code it yourself - I don't need a heightmap anymore - the terragen loader works fine :-p There are nice tools like Wilbur, L3DT and of course Terragen out there that you don't need a paint program to create your landscape. Look at my island - the height information has been done in Wilbur only, and the colormap has been rendered out of it in L3DT.

Wilbur: http://www.ridgecrest.ca.us/~jslayton/wilbur.html
L3DT: http://www.bundysoft.com/L3DT/


Guy Fawkes(Posted 2009) [#21]
How's it going? Do you need help?

With what little I can offer?


Guy Fawkes(Posted 2009) [#22]
Can you make it so the ter files have the same quality & height as the heightmaps when using the older code?


Guy Fawkes(Posted 2009) [#23]
Did you finish?


Krischan(Posted 2009) [#24]
Not yet. But I managed to find out the original files from my "monkey island 1" demo and it looks much better than the original with my new system. But I think the old island sucks now, my revised island looks much better and is optimized for this system. I think I can release a running demo soon. I still have to rewrite large parts of the source, clean it up and comment it, after that I'll post the source here. But there is much room for improvements, no optimizations yet (LOD or PVS).

Both terrains are ultra-high resolution (513x513 vertices), but still looks nice 4 times reduced (to 129x129) - in these screenshots I used the ultra resolution, running still fine here on my notebook (GF9600M GT, C2D 2.53GHz). Both use a 4096x4096 colormap texture, vertex colors (with vertex lights) and a detail map, nothing else. I only switched the two input files (terragen source and colormap texture).

The old Island:


The new Island:



Guy Fawkes(Posted 2009) [#25]
Awesome! Keep it up!

Is that sun real or is it a texture or somethin?


Krischan(Posted 2009) [#26]
The Sun is made out of 6 Quads with 4 different textures drawed over the sky with Entityorder. Three Sun Quads blended together (Flag 0,03, Alpha 1.0,0.5,0.25), blended again with two sun glow quads with different textures plus a brightness quad for the effect when you look direct into the sun it gets brighter (calculated smoothly by the distance screen center<>screen corners), Blend Modes 3,5,3. And the sun looks different depending on the day time (like the whole scene). Looks cool but not real. A single texture couldn't achieve such an effect.


Guy Fawkes(Posted 2009) [#27]
Thats awesome!

So when do u think this will be done mate?


Krischan(Posted 2009) [#28]
I arranged a first pre-alpha demo so don't expect a stable or optimized demo but you will get a good impression of my current work. Oh and it is still based on Ross C's meshterrain code :-) But read the readme.txt first!

3.5MB 7zip SFX Archive: http://www.christianhart.de/bb/terratilesdemo.exe


Guy Fawkes(Posted 2009) [#29]
Since ross' code is open source can u please release the source when ur done? :)


Krischan(Posted 2009) [#30]
Take a look at this Showcase entry and answer your question yourself :-)

http://www.blitzbasic.com/Community/posts.php?topic=84108


Guy Fawkes(Posted 2009) [#31]
thanks :)

i found a few things u might add. make jump a little slower if at all possible, allow for when u switch to free camera mode (the 1 where it looks like ur running down a mountain, make it so that the player runs faster depending on the gravity, and if theres a little bit too much of gravity, the player will literally fall down the hill. and make it so the player can swim & float :)

these are only ideas, do what u want to


Guy Fawkes(Posted 2009) [#32]
hows it going? :)


Guy Fawkes(Posted 2009) [#33]
Any headway yet? :)


Krischan(Posted 2009) [#34]
Sure. I had to rewrite the EVERYTHING but it is much more sophisticated now. The terrain is based on a quadtree now (still tiled) - that doubled the FPS rates! I spent a lot of time commenting, designing new maps and tuning the settings. I am nearly finished - I'm just thinking about improvements and trying some different settings now.

I renamed the project from "TerraTiles" to "BlitzTiles" (there is a company named like that dealing with real tiles so BlitzTiles is a very unique term) - so this will be a new project - the old non-quadtree code is antiquated now.

And here three candy map previews for my new Loading screen (I hate the black commandline-style loader), stay tuned for the program I plan to release it this week (the shots are 1:1 as they look in the program, I only added some text):


This map has been created completely with L3DT. In L3DT there is a template called "desert mesas", the map is named after it. I only added some steep mesa mountains. The map demonstrates a desert landscape with water holes and a very steep sun angle and a bright full moon night in a 1025 resolution. This map has a square footage of 105kmē


This map has been created completely with Wilbur. It is a very detailled island environment named after the similar looking island from the game "The Secret of Monkey Island". It is the only map using the huge 2049 resolution. This map has a square footage of 105kmē, too (ocean area not mentioned)


This map has been created out of real height data of the zillertal alps in Tirol / Austria using 3DEM, Wilbur and L3DT. Additional I added some description of mountain tops and local places. Although the map has only a 1025 resolution it covers the whole nature park. The visibility range is about 50km. This map has a huge square footage of 2123kmē! I really love to walk on this map because I spent my vacations quite often there, hiking the mountains.


Hambone(Posted 2009) [#35]
Absolutely beautiful. The last shot is easily one one of the prettiest landscape shots I have ever sen in B3D.

Very well done!


John Blackledge(Posted 2009) [#36]
Waiting for this eagerly.


Guy Fawkes(Posted 2009) [#37]
I agree w/ @hambone & @john blackledge. absolutely FASCINATING! :D Could you release the new source? I honestly think this should make the Blitz image archive :)

Thanks yet again for all the help you have given not only to me, but to other Blitz developers as well :)

I'm sure this will prove useful in the future! :)

Thank you! :)

~DS~


Adam Novagen(Posted 2009) [#38]
That looks very nice Krischan, very nice indeed. Looking closely at your terrains, I think I figured something out: the texturing (grass, rock, etc) seems to be based on the slope angle of each area. Am I close?


Krischan(Posted 2009) [#39]
BlitzTiles is up. Have fun!

http://www.blitzbasic.com/Community/posts.php?topic=84809


Guy Fawkes(Posted 2009) [#40]
Simply AMAZING! Thats all I can say... This thing is AMAZING! :O

Congrats, Krischan!

~DS~


Guy Fawkes(Posted 2009) [#41]
Could someone plz help me modify this, so depending on what angle the player is at on a hill, it will adjust the player speed using the added force of running up or down a hill, until the hill reaches a certain "dropoff" point, where the player will activate a trip & fall animation making the player fall down the hill, and slip down the hill until the hill angle becomes walkable again, at which point the "get back up" animation activates, and the dwarf gets back up?

I have a sorta working version that is sorta what should be happening here:




Krischan(Posted 2009) [#42]
You should use the global Var "BT_NY#"! It will return the Y normal below the player. 1.0 is 100% flat and 0.0 is very steep, for example if the NY is below 0.75 you could start sliding. Put this before Flip 0 and walk around:

Text 0,0,BT_NY

But I think it is more complex. I did some tests with it but the player movement was not my main objective here. In one test I added four cubes around the player and checked the collision normals to find out if the player moves toward a cliff and what is "around" the player. Never really worked.


Guy Fawkes(Posted 2009) [#43]
No worries, my friend is learning Blitz, and will soon be able to teach me! :) He's WAY better than I am at figuring this stuff out! :) IF I get a fix, I will post it if he says its ok! :) Which am sure he will! :)
Thanks again, Krischan! :)

~SI~


Guy Fawkes(Posted 2009) [#44]
thought id bring this thread up again

hows the bug fixes going?


Krischan(Posted 2009) [#45]
Bug fixes? BlitzTiles is released and it's up to you now. I'm working on my other projects (but nothing to mention at this stage).