Iris2.de

Iris2-Forum
It is currently Thu Mar 28, 2024 11:42 am

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Tue Jun 15, 2010 9:10 am 
Offline
Power User
User avatar

Joined: Fri Apr 17, 2009 2:32 pm
Posts: 122
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 :)

_________________
Programer's Mantra wrote:
If it ain't broke, it doesn't have enough features yet!


Top
 Profile  
 
PostPosted: Tue Jun 15, 2010 12:17 pm 
Offline
iris2-developer
User avatar

Joined: Tue Apr 18, 2006 10:28 pm
Posts: 823
Location: Munich, Bavaria, Germany
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.


Top
 Profile  
 
PostPosted: Tue Jun 15, 2010 3:04 pm 
Offline
Power User
User avatar

Joined: Fri Apr 17, 2009 2:32 pm
Posts: 122
Got that ghouly =) ty so much.

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

_________________
Programer's Mantra wrote:
If it ain't broke, it doesn't have enough features yet!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group