Terrain Textures

Improving the artwork in Warzone2100 - not for mod discussions
User avatar
effigy
Regular
Regular
Posts: 1217
Joined: 22 Jan 2010, 03:21

Re: Terrain Textures

Post by effigy »

Can we not just detect a cliff and add a rule to disable terrain blending when a cliff and normal ground share a least 2 verticies (or something like that)?
This is why some features aren't implemented: http://forums.wz2100.net/viewtopic.php?f=30&t=7490&view=unread#p87241
Jorzi
Regular
Regular
Posts: 2063
Joined: 11 Apr 2010, 00:14

Re: Terrain Textures

Post by Jorzi »

I don't really think you would want sharp edges. Really it looks about as bad as non-tiling textures. What we want is simply a steeper gradient for cliffs. Part of the problem is of course that textures are assigned to the upper left vertex of the face instead of the face itself. Otherwise it probably wouldn't be too hard to add something like this:
You do not have the required permissions to view the files attached to this post.
ImageImage
-insert deep philosophical statement here-
i-NoD
Code contributor
Code contributor
Posts: 318
Joined: 30 Nov 2008, 00:42
Location: In the middle of nowhere

Re: Terrain Textures

Post by i-NoD »

Flail13 wrote:how difficult would it be to use per-tile alpha masks on the texture blending?
That would require separating blended tiles into distinct terrain renderer path. Like drawing all single layered tiles as is with current renderer, and then draw with blend all mixed tiles with additional mask texture. One would need an algorithm to map all blending combinations to maps and masks, thus giving tile mid-tile shape a correct texture coordinates to mask texture.

If my math didn't rot completely, given 4 blend controlling vertices in a mid-tile shape we'd get 16 possible combinations, dropping 2 dead cases like all filled or none all that left are 4* types of: straight cases(two adjacent corners filled in fact), single filled corner cases, triple corner filled cases (invert of previous one) and two opposite filled corners, so with tex coords rotations algorithm you'll need 4 mask per layer (and there are 7 layers on Arizona tilset and 10 on other two). All masks for a single layer (at least) should reside on a single texture for speed consideration. Depending on maximum texture size allowed on gpu, this might end in not so smooth transitions as in current interpolation system...

PS
Obviously there will be no variations on mask for a single layer, and they must be tileable.
User avatar
effigy
Regular
Regular
Posts: 1217
Joined: 22 Jan 2010, 03:21

Re: Terrain Textures

Post by effigy »

Jorzi wrote:I don't really think you would want sharp edges. Really it looks about as bad as non-tiling textures. What we want is simply a steeper gradient for cliffs. Part of the problem is of course that textures are assigned to the upper left vertex of the face instead of the face itself. Otherwise it probably wouldn't be too hard to add something like this:
I was discussing this with Berg earlier in IRC, and arrived to the same conclusion (blending needs to be reduced at cliffs, not removed) :(

We chatted a bit further about a solution, but it seems we were making assumptions. The appearance is that cliff tiles get blended over normal terrain. Could that be changed to do the opposite?
This is why some features aren't implemented: http://forums.wz2100.net/viewtopic.php?f=30&t=7490&view=unread#p87241
Jorzi
Regular
Regular
Posts: 2063
Joined: 11 Apr 2010, 00:14

Re: Terrain Textures

Post by Jorzi »

By saying "blended over" I assume you mean it fills the whole tile and produces gradients on neighbouring tiles. This is not the case, however. In fact, the current mapping is quite wrong and not good for cliffs at all:
Image
See http://developer.wz2100.net/wiki/MappingTips for more information.
As you can see, the texture isn't really assigned to the tile but to its upper left vertex. This can be easily accounted for when painting ground textures but isn't suitable at all for one-tile-wide cliffs.
ImageImage
-insert deep philosophical statement here-
User avatar
effigy
Regular
Regular
Posts: 1217
Joined: 22 Jan 2010, 03:21

Re: Terrain Textures

Post by effigy »

I thought that the problem with cliffs was that it was impossible to have 1 tile wide passages that don't look like cliffs (eg, any passageway is narrower than it should be).
This is why some features aren't implemented: http://forums.wz2100.net/viewtopic.php?f=30&t=7490&view=unread#p87241
Jorzi
Regular
Regular
Posts: 2063
Joined: 11 Apr 2010, 00:14

Re: Terrain Textures

Post by Jorzi »

Ok, in that case, it probably is as you say (i.e. cliffs have been programmed to cover one extra tile of width to compensate for mentioned problem). However, if you would make it the other way, 1-tile wide cliffs wouldn't be visible instead...
ImageImage
-insert deep philosophical statement here-
i-NoD
Code contributor
Code contributor
Posts: 318
Joined: 30 Nov 2008, 00:42
Location: In the middle of nowhere

Re: Terrain Textures

Post by i-NoD »

That passage about exact bound cliffs is a mystery to me... :hmm:
Usually one can consult directly with code. I can see water vs terrain, but terrain case doesn't directly distinguish cliff vs anything other, its just a blended layer as anything else.

If you compare 2.3 vs 3.1/master you can see that cliffs are blended with flat ground in 3.1/master and mountains with one terrain tile between two cliffs are totally blended to cliffs. But it doesnt have to represent actual impassibility state due to such blending.
terrain_renderer_diff.png
Even if there is a buried deep enough logic for cliffs it will not hinder to use masks on this abstraction level.
You do not have the required permissions to view the files attached to this post.
User avatar
effigy
Regular
Regular
Posts: 1217
Joined: 22 Jan 2010, 03:21

Re: Terrain Textures

Post by effigy »

I don't see anything wrong with sample 1, but in sample 2 you've captured a place where plateaus are ambiguous.
This is why some features aren't implemented: http://forums.wz2100.net/viewtopic.php?f=30&t=7490&view=unread#p87241
User avatar
Berg
Regular
Regular
Posts: 2204
Joined: 02 Sep 2007, 23:25
Location: Australia

Re: Terrain Textures

Post by Berg »

User avatar
aubergine
Professional
Professional
Posts: 3462
Joined: 10 Oct 2010, 00:58

Re: Terrain Textures

Post by aubergine »

zOMG! The screenies in that topic look amazing!! (ok, some of the cliff textures are a bit weird, but overall it looks better than current 3.1 releases IMHO)
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
User avatar
Berg
Regular
Regular
Posts: 2204
Joined: 02 Sep 2007, 23:25
Location: Australia

Re: Terrain Textures

Post by Berg »

That was the beginning of the terrain blending so read on and see what was done.
The tiles get lots better I think the best was done in trunk 3.0 but thats just my opinion.
User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: Terrain Textures

Post by NoQ »

aubergine wrote:
zOMG! The screenies in that topic look amazing!! (ok, some of the cliff textures are a bit weird, but overall it looks better than current 3.1 releases IMHO)
They were changed to what we have now because 1. they seem to go too far from the original game's atmosphere and 2. arizona was too undeveloped in that texture set (just a uniform red sand instead of red/yellow/brown sand etc). There was a vote, and current textures had something around 60:30 win. P.S. Not sure if you noticed, but you see these textures all the time in this website's header (:
User avatar
JDW
Regular
Regular
Posts: 1669
Joined: 18 May 2010, 20:44

Re: Terrain Textures

Post by JDW »

I had voted for Gerards textures. Too bad we could not have them both somehow.
"Speak when you are angry and you will make the best speech you will ever regret."
-- Ambrose Bierce
User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: Terrain Textures

Post by NoQ »

I think it's not hard to substitute them locally.
It won't even affect multiplayer compatibility.