Horde3D

Next-Generation Graphics Engine
It is currently 27.11.2024, 10:42

All times are UTC + 1 hour




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Terrain shader
PostPosted: 04.01.2009, 10:58 
Offline

Joined: 06.12.2008, 08:32
Posts: 10
I've just been playing around with a terrain shader a bit and thought I'd show off the results...

Image

It's height/slope based and uses triplanar texturing to avoid stretching on steep areas. The triplanar texturing is a pretty big performance hit (~45fps with compared to ~100fps without) but I think the result is pretty cool.
In case you're wondering, the small text in the image is min height/max height/min slope/max slope/strength for each texture.

I've been toying with the idea of making an arcade style air combat game but I'm not sure about using the terrain extension for that. Even the 1024x1024 heightmap that comes with the demo takes ~10 seconds to load on my box so a larger map (which would be needed for such a game) would be painfully slow I think. We'll see...


Top
 Profile  
Reply with quote  
 Post subject: Re: Terrain shader
PostPosted: 04.01.2009, 11:36 
Offline

Joined: 11.06.2008, 10:34
Posts: 119
Looking very good.

Ive had similar experience using the terrain extension in regards to FPS, hence for the mars project I was using the Geo format, and to be honest I was getting good results considering their was no level of detail. Creating the landscape in Modo it allowed me to shunt in details where I wanted it, and optimise else where - you can also have overhangs, tunnels and what not.

All we need now is a progressive level of detail system to apply to Geo based terrains :)

_________________

Let's bring 'em out! Any old iron! Any old iron!
A door opens and a homewife brings out a rather sophisticated-looking ground-to-air missile system, and dumps it on the cart.
Thank you.


Top
 Profile  
Reply with quote  
 Post subject: Re: Terrain shader
PostPosted: 04.01.2009, 12:10 
Offline
Tool Developer

Joined: 13.11.2007, 11:07
Posts: 1150
Location: Germany
Looking great. Would be awesome if you could write a short article together with the shader code in the wiki. Or just post the shader.

@pug
Something like a progressive mesh node may be handy. Perhaps one could implement this as an extension (or also directly to the engine).

The terrain extension does already have a LOD algorithm. The only thing I'm missing there is a streaming algorithm to have unlimited heightmap sizes :-)


Top
 Profile  
Reply with quote  
 Post subject: Re: Terrain shader
PostPosted: 04.01.2009, 15:46 
Offline
Engine Developer

Joined: 10.09.2006, 15:52
Posts: 1217
Very nice, especially that you are using triplanar texturing.

About the loading time: we are doing some preprocessing to increase runtime efficiency (building a quadtree of the heightmap with min/max height info and geometric error for each recursion), but 10 secs sounds like a bit too much. In release mode it is rather two seconds (or less) on my machine. For larger maps, if really necessary, this information could be cached on disk quite easily.


Top
 Profile  
Reply with quote  
 Post subject: Re: Terrain shader
PostPosted: 05.01.2009, 11:01 
Offline

Joined: 06.12.2008, 08:32
Posts: 10
Volker wrote:
Would be awesome if you could write a short article together with the shader code in the wiki.

http://www.horde3d.org/wiki/index.php5?title=Shading_Technique_-_Terrain_Shading

Ask and you shall recieve (within reason ;)) Hopefully it's understandable. I sometimes have a tendency to no explain myself very well.

Volker wrote:
The only thing I'm missing there is a streaming algorithm to have unlimited heightmap sizes

That, my good sir, would be made of win :)

@marciano - I was wrong actually. It's about 6 seconds. A little less painful sounding but would still get iffy for really big terrains. Although I suppose my computer being a little on the outdated side doesn't help (Athlon XP 2400+, 1.5GB RAM :oops:)

P.S. Thank you all for the kind words :)


Top
 Profile  
Reply with quote  
 Post subject: Re: Terrain shader
PostPosted: 05.01.2009, 14:42 
Offline
Tool Developer

Joined: 13.11.2007, 11:07
Posts: 1150
Location: Germany
Thanks again, I added your sample picture to the article.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group