Senior Developer
Joined: Sep 2004
Posts: 1,214
Austin, Texas
|
Quote:
which part of the code actually puts the bumpmapping-effect on the cube
EDIT: I enbled AlhpaBlendEnable and i got the bumpmapping effect. but there is no colors.
@ whine that's not the shader I am trying to convert... that's the one Reaver posted... the bumpmapping with show up even with alphaBlendEnable = false. I don't understand why Reaver posted that... it's off topic...
Here's my code:
MATERIAL bumpmap { flags=tangent; effect =" texture entSkin1; texture entSkin2; matrix matWorldViewProj; matrix matWorld; vector vecLight; technique dot3map { pass p0 { Texture[0] = <entSkin2>;//2te Skin im Model ist die Normal Map Texture[1] = <entSkin1>;//1te Skin im Model ist die Textur ColorOp[0] = DotProduct3; ColorArg1[0] = Texture; ColorArg2[0] = Diffuse; ColorOp[1] = Modulate2x; ColorArg1[1] = Texture; ColorArg2[1] = Current; VertexShaderConstant[0]=<matWorldViewProj>; VertexShaderConstant[4]=<matWorld>; VertexShaderConstant[18]={1.0f,1.0f,1.0f,1.0f}; VertexShaderConstant[19]={0.5f,0.5f,0.5f,0.5f}; VertexShaderConstant[20]= <vecLight>; VertexShaderConstant[30]={0.0f,1.0f,0.0f,0.0f}; VertexShaderConstant[31]={1.0f,0.0f,0.0f,0.0f}; VertexShaderConstant[32]={0.0f,0.0f,1.0f,0.0f}; VertexShaderConstant[90]={1.0f,0.0f,0.0f,0.0f}; //damit oFog gefüllt ist
VertexShader = asm { vs_1_1 dcl_position v0 dcl_normal v3 dcl_texcoord0 v7
m4x4 oPos, v0, c0 m4x4 r10,v0,c4 m4x4 r8,v3,c4 mov oT0, v7 mov oT1, v7 mov oT2, v7 mov oT3, v7 //calculate texture space matrix from normal and up mul r0,c31,v3.zxyw //-1,0,0 mul r1,c32,v3.yzxw //0,0,-1 sub r0,r1,r0 dp3 r0.w,r0,r0 rsq r0.w,r0.w mul r0,r0,r0.w //normalized right vector mov r1, c30 //0,-1,0 mov r2.xyzw, r8 sub r9,c20,r10 dp3 r9.w,r9,r9 rsq r9.w,r9.w mul r9,r9,r9.w //normalized light vector m3x3 r3,r9,r0 mov r3.w,c30.w //transform light to texture space add r3,r3,c18 //bias mul r3,r3,c19//scale mov oD0,r3.w mov oFog,c90.x }; } } technique fallback { pass P0 { //set texture stage states Texture[1] = <entSkin1>; ColorArg1[1] = Texture; // stage 0 = skin texture ColorOp[1] = Modulate; ColorArg2[1] = Diffuse; // modulate by lighting
} } "; }
|