Horde3D
http://horde3d.org/forums/

Terrain shader
http://horde3d.org/forums/viewtopic.php?f=4&t=597
Page 1 of 1

Author:  ecksp [ 04.01.2009, 10:58 ]
Post subject:  Terrain shader

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...

Author:  PuG [ 04.01.2009, 11:36 ]
Post subject:  Re: Terrain shader

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 :)

Author:  Volker [ 04.01.2009, 12:10 ]
Post subject:  Re: Terrain shader

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 :-)

Author:  marciano [ 04.01.2009, 15:46 ]
Post subject:  Re: Terrain shader

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.

Author:  ecksp [ 05.01.2009, 11:01 ]
Post subject:  Re: Terrain shader

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 :)

Author:  Volker [ 05.01.2009, 14:42 ]
Post subject:  Re: Terrain shader

Thanks again, I added your sample picture to the article.

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/