Page 1 of 1

More robust options for terrain detail textures

Posted: 05 Jun 2008, 18:09
by hunterw
We could do some very cool things if we had more control over terrain detail textures.

First and foremost, there should be a .smd setting called DetailTextureScale. The current version of Spring scales the detail texture no matter what resolution to one size...we should be able to set that scale.

Now for the harder suggestions...imagine if we could render the detail texture as a normal map? Using the map's sundirection parameters as a base for setting the normal map's light, terrains would look unbelievably better. Since texture map resolution is rather limited, this would be the perfect way to make them look high-resolution when viewed up close.

The fun doesn't stop there - what about an option to use the detail texture as a specular map? Ice and snow maps could actually have a reflective sheen off of the snow and glaciers. This would also be great for metal maps.

Another simpler idea that occured to me was to be able to use just a normal detail texture but set a parameter for motion. We could use a cloud shadow texture, then set the texture to pan across the ground slowly. The cloud shadows would not show up on units, but they would sure look cool anyway.

Re: More robust options for terrain detail textures

Posted: 05 Jun 2008, 19:03
by AF
All possible using lua. You could draw the entire map using lua.

Re: More robust options for terrain detail textures

Posted: 05 Jun 2008, 20:11
by jcnossen
Why not just start rebuilding spring in lua. It's all possible.

Does spring have MMORPG support? Yes, with lua ;)

AFAIK trepans last lua map options addition does not allow modifying the map rendering algorithm itself, just the parameters

Re: More robust options for terrain detail textures

Posted: 05 Jun 2008, 21:22
by AF
IIRC Jk said you can tell the engine not to render the ground, and since there're OpenGL calls available theres nothing stopping you from drawing the ground in its place. Or from drawing the map directly ontop of the existing map but several pixels higher up. which would work even though itd mean rendering the map twice which isnt exactly ideal.

Re: More robust options for terrain detail textures

Posted: 06 Jun 2008, 03:36
by Warlord Zsinj
... It also doesn't help that there's all of about 5 people that can actually code LUA with any ability and regularity.

Re: More robust options for terrain detail textures

Posted: 06 Jun 2008, 09:15
by jK
bad idea to draw (on) the ground with lua.

ground rendering takes MUCH time, that's why it is highly optimized in modern engines. Things you can't do with lua ...
See that startbox widget: at the start it renders on <50% of the map and it is _damn_ slow (30-50% fpsdrop), you only don't need those fps at the start, but it isn't usable ingame.
The only way to do it with lua is using the new float32 heightexture (only in svn), so you could use the vertex shader and a display list (with hardbounded LOD). But I wouldn't advise it to combine it with the engine algorithm, you will always get ugly glitches. That's what happens with ground decals atm they are rendered after the ground and have always full vertex detail -> ignore ground LOD (that's why they are soo slow), so they differ from the groundvertices, you try to solve it with a PolygonOffset and a small y-offset, but it still doesn't help, you always see those dead triangles ...

The only solutions are: redoing the whole ground rendering code (use a vertex shader + float32 heightmap) or modifying it the current code, so it supports multi-layers (it sounds easier than it is).

PS: cloud shadows are something different (you can use a different technique for those). I already have a demo widget :p

Edit:
Image

Re: More robust options for terrain detail textures

Posted: 06 Jun 2008, 17:23
by smoth
COOL!

Re: More robust options for terrain detail textures

Posted: 08 Jun 2008, 01:20
by hunterw
jK wrote:bad idea to draw (on) the ground with lua.

ground rendering takes MUCH time, that's why it is highly optimized in modern engines. Things you can't do with lua ...
See that startbox widget: at the start it renders on <50% of the map and it is _damn_ slow (30-50% fpsdrop), you only don't need those fps at the start, but it isn't usable ingame.
The only way to do it with lua is using the new float32 heightexture (only in svn), so you could use the vertex shader and a display list (with hardbounded LOD). But I wouldn't advise it to combine it with the engine algorithm, you will always get ugly glitches. That's what happens with ground decals atm they are rendered after the ground and have always full vertex detail -> ignore ground LOD (that's why they are soo slow), so they differ from the groundvertices, you try to solve it with a PolygonOffset and a small y-offset, but it still doesn't help, you always see those dead triangles ...

The only solutions are: redoing the whole ground rendering code (use a vertex shader + float32 heightmap) or modifying it the current code, so it supports multi-layers (it sounds easier than it is).

PS: cloud shadows are something different (you can use a different technique for those). I already have a demo widget :p

Edit:
Image
this post is win, i love learning things 8)

Re: More robust options for terrain detail textures

Posted: 06 Aug 2010, 15:05
by manolo_
dig dig dig, where is this widget, talked with vbs about it and he found this :)

Re: More robust options for terrain detail textures

Posted: 06 Aug 2010, 15:07
by Beherith
Dunno about the widget, but all of the points brought up by hunterw are addressed in SSMF :D

Re: More robust options for terrain detail textures

Posted: 06 Aug 2010, 15:34
by manolo_
ssmf?

Re: More robust options for terrain detail textures

Posted: 06 Aug 2010, 15:42
by BrainDamage

Re: More robust options for terrain detail textures

Posted: 07 Aug 2010, 19:46
by Hobo Joe
Where can I get cloud shadows? :O

Re: More robust options for terrain detail textures

Posted: 09 Aug 2010, 10:56
by manolo_
so it will be stored in the mapfile (instead of a seperat widget?)

Re: More robust options for terrain detail textures

Posted: 09 Aug 2010, 12:40
by very_bad_soldier
I see manolo recompiling every spring map known to mankind.
(you could fix the pinstripes on older maps when you are at it)

Re: More robust options for terrain detail textures

Posted: 09 Aug 2010, 15:20
by manolo_
^^

i know nothing about mapping nor the configs. about them nor ssmf (i skip long textes with bla bla bla) - so i just looked at the pic and thought WWWWWOOOOOOOWAAAAWW. :P

Re: More robust options for terrain detail textures

Posted: 09 Aug 2010, 16:23
by SirArtturi
very_bad_soldier wrote:I see manolo recompiling every spring map known to mankind.
(you could fix the pinstripes on older maps when you are at it)
Yea you should do that!
especially when SSMF actually does not need any recompiling. Just couple more files and repacking...

Re: More robust options for terrain detail textures

Posted: 09 Aug 2010, 16:25
by Beherith
Fixing scanlines needs recompiling.