hi all,

i have a model that has suglasses and needs fur in certain areas (multipass).

i got two shaders, a fur shader and a cubemap shader, both work well alone. now i was trying to combine em.

thecubemap shader works with the alpha channel of entSkin1. the fur is created from the alpha channel of entSkin2.

my problem is the first pass. the fur works, but the shader overrides the alpha value of entSkin1, so i get no cubemap reflection.
Code:

texture entSkin1;
texture entSkin2;
texture mtlSkin1;
matrix matMtl;
matrix matWorldViewProj;
matrix matWorld;
matrix matWorldView;
vector vecSkill1;
vector vecSkill41;
vector vecFog;
vector vecSunDir;

technique cubefur
{
pass p0
{

texture[0]=<entSkin1>;
texture[1]=<mtlSkin1>;
texture[2]=<entSkin2>;

zWriteEnable=true;
alphaBlendEnable=false;

colorArg1[0]=Texture;
colorOp[0]=Modulate2x;
colorArg2[0]=Diffuse;

colorArg1[1]=Texture;
colorOp[1]=blendCurrentAlpha;
addressU[1]=Clamp;
addressV[1]=Clamp;
texCoordIndex[1]=cameraSpaceReflectionVector;
textureTransformFlags[1]=Count3;
textureTransform[1]=<matMtl>; // transform camera space back to world space

vertexShaderConstant[0]=<matWorldViewProj>;
vertexShaderConstant[4]=<matWorld>;
vertexShaderConstant[8]=<matWorldView>;
vertexShaderConstant[16]=<vecSkill41>; // shell_distance, 0, fur_u_scale, fur_v_scale
vertexShaderConstant[17]={0.0,0.0,0.0,0.0}; // shell_number
vertexShaderConstant[19]=<vecSunDir>;
vertexShaderConstant[20]=<vecFog>;
vertexShaderConstant[94]=<vecSkill1>; // first_shell_brightness, brightness_increment, 0, 0
vertexShaderConstant[95]={0.5,1.0,2.0,0.0};

vertexShader =

asm
{
vs.1.1

dcl_position v0
dcl_normal v3
dcl_texcoord1 v7 //color uv

mov r0,v0
mov r1,c16
mul r1,r1.x,c17.x // shell distance * shell number
mul r1,r1,v3 // scale normal
add r0.xyz,r0.xyz,r1.xyz // shell offset (vertex position + scaled normal}

m4x4 oPos,r0,c0 // transform position to clip space
mov oT0,v7 // output uvs

mov r1.w,c20.w // r1.w=1
dp4 r0,v0,c10 // distance to camera position
add r0,r0,-c20.x // distance-fog_start
mad r0.x,-r0.x,c20.z,r1.w // 1-(distance-fog_start}*(1/(fog_end-fog_start}}
max oFog,r0.x,c95.w // clamp with custom max value
};
pixelShader=
asm
{
ps.1.1
tex t0 // sample colormap

mov r0,t0

};


}

//-----------------------------------------------------------------------------

pass p1
{ [rhabarber] [blabla]
...pass 21 ...




deleting the lines
Code:

vertexShaderConstant[0]=<matWorldViewProj>;
vertexShaderConstant[4]=<matWorld>;
vertexShaderConstant[8]=<matWorldView>;
vertexShaderConstant[16]=<vecSkill41>; // shell_distance, 0, fur_u_scale, fur_v_scale
vertexShaderConstant[17]={0.0,0.0,0.0,0.0}; // shell_number
vertexShaderConstant[19]=<vecSunDir>;
vertexShaderConstant[20]=<vecFog>;
vertexShaderConstant[94]=<vecSkill1>; // first_shell_brightness, brightness_increment, 0, 0
vertexShaderConstant[95]={0.5,1.0,2.0,0.0};

vertexShader =

asm
{
vs.1.1

dcl_position v0
dcl_normal v3
dcl_texcoord1 v7 //color uv

mov r0,v0
mov r1,c16
mul r1,r1.x,c17.x // shell distance * shell number
mul r1,r1,v3 // scale normal
add r0.xyz,r0.xyz,r1.xyz // shell offset (vertex position + scaled normal}

m4x4 oPos,r0,c0 // transform position to clip space
mov oT0,v7 // output uvs

mov r1.w,c20.w // r1.w=1
dp4 r0,v0,c10 // distance to camera position
add r0,r0,-c20.x // distance-fog_start
mad r0.x,-r0.x,c20.z,r1.w // 1-(distance-fog_start}*(1/(fog_end-fog_start}}
max oFog,r0.x,c95.w // clamp with custom max value
};
pixelShader=
asm
{
ps.1.1
tex t0 // sample colormap

mov r0,t0

};


gives me a good fur, a good reflection, but somehow the base texture has wrong colours.

any help is appreciated.
thx in advance