Coluna
12-04-2003, 06:48 AM
Hi;
The VP to my terrain renderer works in my geforce2mx(and in 4mx too), but not in my FX5200...the terrain is rendered in black(if i disable blend)...here is the code
!!ARBvp1.0
OPTION ARB_position_invariant;
#61 - cam pos
#62 - .y - scale of tex0 .w - fog
#63 - .y - scale of tex1
PARAM camera = program.local[61];
PARAM fator0 = program.local[62];
PARAM fator1 = program.local[63];
PARAM half = {0.5 , 0.5 , 0.5 , 1.0 };
PARAM one = {1.0 , 1.0 , 1.0 , 1.0 };
PARAM zero = {0.0 , 0.0 , 0.0 , 0.0 };
ATTRIB vpos = vertex.position;
OUTPUT oColor = result.color;
OUTPUT oTex0 = result.texcoord[0];
OUTPUT oTex1 = result.texcoord[1];
TEMP dist, inverso;
MAD oTex0.xy, vpos.xzyw, fator0.y, half;
MUL oTex1.xy, vpos.xzyw, fator1.y;
#i use the squared dist from vert to camera to calculate an alpha value
SUB dist, vpos, camera;
DP3 dist.w, dist, dist;
MUL inverso.w, dist.w, fator1.w;
MUL inverso.w,inverso.w,inverso.w;
MIN inverso.w, one.w, inverso.w;
MOV oColor , one;
MOV oColor.w, inverso.w;
END
First i draw the z pass, then enable blend and draw the terrain using this VP...please help me
The VP to my terrain renderer works in my geforce2mx(and in 4mx too), but not in my FX5200...the terrain is rendered in black(if i disable blend)...here is the code
!!ARBvp1.0
OPTION ARB_position_invariant;
#61 - cam pos
#62 - .y - scale of tex0 .w - fog
#63 - .y - scale of tex1
PARAM camera = program.local[61];
PARAM fator0 = program.local[62];
PARAM fator1 = program.local[63];
PARAM half = {0.5 , 0.5 , 0.5 , 1.0 };
PARAM one = {1.0 , 1.0 , 1.0 , 1.0 };
PARAM zero = {0.0 , 0.0 , 0.0 , 0.0 };
ATTRIB vpos = vertex.position;
OUTPUT oColor = result.color;
OUTPUT oTex0 = result.texcoord[0];
OUTPUT oTex1 = result.texcoord[1];
TEMP dist, inverso;
MAD oTex0.xy, vpos.xzyw, fator0.y, half;
MUL oTex1.xy, vpos.xzyw, fator1.y;
#i use the squared dist from vert to camera to calculate an alpha value
SUB dist, vpos, camera;
DP3 dist.w, dist, dist;
MUL inverso.w, dist.w, fator1.w;
MUL inverso.w,inverso.w,inverso.w;
MIN inverso.w, one.w, inverso.w;
MOV oColor , one;
MOV oColor.w, inverso.w;
END
First i draw the z pass, then enable blend and draw the terrain using this VP...please help me