Posted: 20th Feb 2006 19:10
Thanks I have a gigabyte 6600 256mb Turbo edition
So pixel and vertex shader 3
The shader code once again.
texture mtlSkin1; //should be light grey
matrix matWorldViewProj;
matrix matWorld;
matrix matWorldView;
vector vecSkill1;
vector vecSkill41;
vector vecFog;
vector vecSunDir;
technique shadowblur
{
pass p0
{
texture[0]=<mtlSkin1>;
zWriteEnable=false;
alphaBlendEnable=true;
srcblend=destcolor;
destblend=zero;
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