Thread: [TEC] Modding SH3
View Single Post
Old 12-18-2016, 09:57 AM   #56
Tycho
Sonar Guy
 
Join Date: Oct 2009
Location: Sofia, Bg
Posts: 382
Downloads: 264
Uploads: 1


Default How the terrain texturing work.

How the terrain texturing work?

First, my TerrainTypes.raw now looks like this:
 

And I have this IdxConversion:
 
Quote:
[IdxConversion]
IDX 1=0; / Generic / 1 season
IDX 2=1; / Ice / 1 season
IDX 3=2; / Tundra / 2 seasons (winter, summer)
IDX 4=3; / Taiga / 2 seasons (winter, summer)
IDX 5=4; / Temperate North / 4 seasons (winter, spring, summer, autumn)
IDX 6=5; / Temperate South / 4 seasons (summer, autumn, winter, spring)
IDX 7=6; / Chaparral / 2 seasons (winter, summer)
IDX 8=7; / Desert / 1 season
IDX 9=8; / Jungle / 1 season
IDX 10=9; / Savanna / 2 seasons (dry, wet)
IDX 11=10; / Grassland North / 2 seasons (dry, wet)
IDX 12=11; / Grassland South / 2 seasons (dry, wet)

Now, let's look over the textures for the terrains.

In Terrain.cfg for every TerrainTypeDef, have a set of four textures:
Quote:
Tex01=data/Terrain/Textures/Generic/1.tga
Tex02=data/Terrain/Textures/Generic/2.tga
Tex03=data/Terrain/Textures/Generic/3.tga
Tex04=data/Terrain/Textures/Generic/4.tga
Like you see, you are able to point to specific texture, you are able to separate the textures in different folders for different terrain types or seasons, for example.

You have some control over the first three textures, through some parameters in the Terrain.cfg.
Like "TexTilesPerKM=" - obviously means, how many textures the game will use for 1 km of the terrain.
TexTilesPerKM=3 is equal to 3x3 or 9 textures for 1 square km.
Looks:
 

If you work with HD textures, maybe is good idea, to expand the area of covering, so you lower the TexTilesPerKM.
TexTilesPerKM=1, looks:
 

Tex01= is for seabed plus some height above water, according to this parameter - MaxHeightForTex01=
Tex02= is for ground, plain area texture
Tex03= is slope texture

Tex04= is special, you control it through "DetailTextureTileFactor=".
With the default factor = 2, the texture cover 2.5 square km and lies above the first three textures.
With two previous examples, TexTilesPerKM= 3 and 1, looks:
 



I work with resolution 256x256 for textures and original parameters of:
TexTilesPerKM=3
DetailTextureTileFactor=2
Are good for me, but if you work with high resolution, maybe is reasonable to experiment with these.

TexTilesPerKM=1 / 1 square km for Tex01,02 and 03.
DetailTextureTileFactor=1 / 5 square km for Tex04.
Looks:
 


This texture act like shadow map over Tex01,02 and 03.
And because one Tex04= covers many of the lower textures (contiguous textures receive a different shade),
this help a lot, to hide the tiling effect and give character to the terrain.

Let's experiment.
I choose for textures 01, 02 and 03, these ones:
 
--

First, let's be without Tex04= (well, it is not without, but is completely white, which is the same):
 



The tiling effect is visible over slope texture, repetition of the one and the same texture. Also is visible from certain angle over the grass.
And all terrain is... just simple.

Second, will be with the default "Tex04". The original game, used one Tex04 texture (Detaile.tga) for every terrain type.
 

Now the terrain looks:
 



I don't know the terminology for these things, but I don't like it. Didn't have character, and the tiling over slope is still visible.
If you watch carefully, you will see it over grass too.

Finally, let's see, what I made.
I take the copy of the Tex03 texture and transform it to this, and use it for Tex04.
 
----->

Not for every terrain type I use the third texture, but in this concrete example, it is good for the purpose.
Now the same terrain looks:
 



Oh yes, I like it. This is terrain with character.

After the textures, is the forest file. The forest cover 5 square km, and the game places it only around the coast.
Deep inside the terrain will be waste of the resources.
 



But for the forests, I'll tell you another time.
__________________
If you ride like lightning, you're gonna crash like thunder.

Last edited by Tycho; 12-27-2016 at 01:53 PM.
Tycho is offline   Reply With Quote