More robust options for terrain detail textures

More robust options for terrain detail textures

Requests for features in the spring code.

Moderator: Moderators

Post Reply
User avatar
hunterw
Posts: 1838
Joined: 14 May 2006, 12:22

More robust options for terrain detail textures

Post 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.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: More robust options for terrain detail textures

Post by AF »

All possible using lua. You could draw the entire map using lua.
User avatar
jcnossen
Former Engine Dev
Posts: 2440
Joined: 05 Jun 2005, 19:13

Re: More robust options for terrain detail textures

Post 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
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: More robust options for terrain detail textures

Post 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.
Warlord Zsinj
Imperial Winter Developer
Posts: 3742
Joined: 24 Aug 2004, 08:59

Re: More robust options for terrain detail textures

Post 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.
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Re: More robust options for terrain detail textures

Post 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
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: More robust options for terrain detail textures

Post by smoth »

COOL!
User avatar
hunterw
Posts: 1838
Joined: 14 May 2006, 12:22

Re: More robust options for terrain detail textures

Post 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)
User avatar
manolo_
Posts: 1370
Joined: 01 Jul 2008, 00:08

Re: More robust options for terrain detail textures

Post by manolo_ »

dig dig dig, where is this widget, talked with vbs about it and he found this :)
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: More robust options for terrain detail textures

Post by Beherith »

Dunno about the widget, but all of the points brought up by hunterw are addressed in SSMF :D
User avatar
manolo_
Posts: 1370
Joined: 01 Jul 2008, 00:08

Re: More robust options for terrain detail textures

Post by manolo_ »

ssmf?
User avatar
BrainDamage
Lobby Developer
Posts: 1164
Joined: 25 Sep 2006, 13:56

Re: More robust options for terrain detail textures

Post by BrainDamage »

User avatar
Hobo Joe
Posts: 1001
Joined: 02 Jan 2008, 21:55

Re: More robust options for terrain detail textures

Post by Hobo Joe »

Where can I get cloud shadows? :O
User avatar
manolo_
Posts: 1370
Joined: 01 Jul 2008, 00:08

Re: More robust options for terrain detail textures

Post by manolo_ »

so it will be stored in the mapfile (instead of a seperat widget?)
User avatar
very_bad_soldier
Posts: 1397
Joined: 20 Feb 2007, 01:10

Re: More robust options for terrain detail textures

Post 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)
User avatar
manolo_
Posts: 1370
Joined: 01 Jul 2008, 00:08

Re: More robust options for terrain detail textures

Post 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
User avatar
SirArtturi
Posts: 1164
Joined: 23 Jan 2008, 18:29

Re: More robust options for terrain detail textures

Post 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...
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: More robust options for terrain detail textures

Post by Beherith »

Fixing scanlines needs recompiling.
Post Reply

Return to “Feature Requests”