共3个Pass。每个Pass2个Texture Stage。
设置如下:
Pass 0:
Stage 0:
ColorOP: Select Arg1
ColorArg1: Texture // Texture 0
Render States:
AlphaBlendEnable: false
Pass 1:
Stage 0:
ColorOP: Blend Current Alpha
ColorArg1: Texture // Texture 1
Stage 1:
ColorOP: Select Arg2
ColorArg2: Current // Render result of Stage 0 in Pass 1
AlphaOP: Select Arg1
AlphaArg1: Texture // Alpha map 0; used for alpha-blend between Pass 0 and Pass 1
Render States:
AlphaBlendEnable: true
BlendOP: Add
SrcBlendFactor: SrcAlpha
DestBlendFactor: InvSrcAlpha
Pass 2:
Stage 0:
ColorOP: Blend Current Alpha
ColorArg1: Texture // Texture 2
Stage 1:
ColorOP: Modulate
ColorArg1: Texture // Lightmap
ColorArg2: Current // Render result of Stage 0 in Pass 2
AlphaOP: Select Arg1
AlphaArg1: Texture // Yes, Alpha infos are stored in lightmap's alpha channel
Render States:
AlphaBlendEnable: true
BlendOP: Add
SrcBlendFactor: SrcAlpha
DestBlendFactor: InvSrcAlpha
截图:
从图中可看出,alpha图不够精细,导致不同贴图之间的边界很明显。当前Alphamap(也是Lightmap)的尺寸是256*256 ARGB。如何使画面不同贴图的过渡更自然呢?发愁中...