Iris2.de
http://iris2.de/forum/

Terrain Texturing ( well, multi texturing :P )
http://iris2.de/forum/viewtopic.php?f=16&t=1646
Page 1 of 1

Author:  Sehlor [ Tue Jun 15, 2010 9:10 am ]
Post subject:  Terrain Texturing ( well, multi texturing :P )

Hi All Dev Team :)

After we had a little chat with hagish, i generally understand the way yo do, but i want a little more explanation for terrain texturing.

hagish told me you're using 64x64 blend maps for blending texture to another, thank give me a link for blend maps,

terrain_multitex_mask_64_blur_man_antibleed.png

now, i want to ask, how the process walks.

i think,
for each tile readed from .mul files
get the tile, then get tiles around current tile
then decision which blend map will apply (256x256 blendmap, which 64x64 pixels will be used)
then final texture = blend map + texture

tell me if i'm not right, thanks anyway :)

Author:  ghoulsblade [ Tue Jun 15, 2010 12:17 pm ]
Post subject:  Re: Terrain Texturing ( well, multi texturing :P )

yep,
mapX.mul has uo-terrain ids,
those are converted to the iris terrain ids (which are fewer, but uo terrain ids have stuff like transitions in them that we calc automatically).

then for each terrain tile a primary terraintype and a secondary terraintype are determined.
primary = the terrain of the tile itself
secondary = the type different from primary that most neighbors have.

example: current tile = mud surrounding it are 5 other mud tiles 3 grass tiles and 1 sand tile
primary = mud (even if there'd be no other mud-tile around, this is always the type of the tile itself)
secondary = grass

then based on which of the neighbors are same as the tile itself, one of the blendmasks and it's rotation is determined.

then using multitexturing with 3 textures the terrain is rendered
3 sets of texcoords are used,
A=terrain multitile spanning & selection of primary terraintype in atlas
B=terrain multitile spanning & selection of secondary terraintype in atlas
C=blendmask selection and rotation

multitex1 = atlas texture + texcoordA (appears as primary terraintype)
multitex2 = atlas texture + texcoordB (appears as secondary terraintype)
multitex3 = mask texture + texcoordC (appears as black/white/gray blendmask)

if i remember correctly the multitexturing is combined in two passes

pass1 combines multitex2(secondary terraintype) with multitex3(blendmask), where multitex3 is used as alpha channel,
the result of pass1 is a texture that looks like secondary terrain type, but has an alphachnanel according to the mask

pass2 combines the result of pass1 with multitex1(primary terraintype) to produce the finally visible texture,
which looks like a transition due to the alpha blendmask.

Author:  Sehlor [ Tue Jun 15, 2010 3:04 pm ]
Post subject:  Re: Terrain Texturing ( well, multi texturing :P )

Got that ghouly =) ty so much.

I need a little bit shader code experince, than i think i can code :P

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