tb
2002-12-17, 11:38:20
Hallo!
Also so wird der Befehlsfolge unter dx8 beschrieben. Irgendwie komm ich nicht so recht weiter:
//u' = TextureCoordinates(stage m)UVW * t(n)RGB
//v' = TextureCoordinates(stage m+1)UVW * t(n)RGB
//w' = TextureCoordinates(stage m+2)UVW * t(n)RGB
//(u'', v'', w'') = 2*[(N*E)/(N*N)]*N - E
// where the normal N is given by
// N = (u', v', w')
// and the eye-ray vector E is given by
// E = (TextureCoordinates(stage m)Q,
// TextureCoordinates(stage m+1)Q,
// TextureCoordinates(stage m+2)Q)
//Lastly, the texm3x3vspec instruction samples t(m+2) with (u'',v'',w'')and stores the result in t(m+2).
//t(m+2)RGBA = TextureSample(stage m+2)RGBA
Dies ist der ps1.1 shader:
ps.1.1
tex t0 ; Define t0 as a standard 3-vector.
texm3x3pad t1, t0_bx2 ; Perform first row of matrix multiply.
texm3x3pad t2, t0_bx2 ; Perform second row of matrix multiply.
texm3x3vspec t3, t0_bx2 ; Perform third row of matrix multiply,
; do reflection calculation
; using eye ray, and sample texture 3
; specular map.
Hier mein bisheriger ps1.4 Teil
ps.1.4
texld r0, t0 ; Look up normal map.
texcrd r4.rgb, t1 ; 1st row of environment matrix
texcrd r2.rgb, t2 ; 2st row of environment matrix
texcrd r3.rgb, t3 ; 3rd row of environment matrix
dp3 r4.r, r4, r0_bx2 ; 1st row of matrix multiply
dp3 r4.g, r2, r0_bx2 ; 2nd row of matrix multiply
dp3 r4.b, r3, r0_bx2 ; 3rd row of matrix multiply
?
Thomas
Also so wird der Befehlsfolge unter dx8 beschrieben. Irgendwie komm ich nicht so recht weiter:
//u' = TextureCoordinates(stage m)UVW * t(n)RGB
//v' = TextureCoordinates(stage m+1)UVW * t(n)RGB
//w' = TextureCoordinates(stage m+2)UVW * t(n)RGB
//(u'', v'', w'') = 2*[(N*E)/(N*N)]*N - E
// where the normal N is given by
// N = (u', v', w')
// and the eye-ray vector E is given by
// E = (TextureCoordinates(stage m)Q,
// TextureCoordinates(stage m+1)Q,
// TextureCoordinates(stage m+2)Q)
//Lastly, the texm3x3vspec instruction samples t(m+2) with (u'',v'',w'')and stores the result in t(m+2).
//t(m+2)RGBA = TextureSample(stage m+2)RGBA
Dies ist der ps1.1 shader:
ps.1.1
tex t0 ; Define t0 as a standard 3-vector.
texm3x3pad t1, t0_bx2 ; Perform first row of matrix multiply.
texm3x3pad t2, t0_bx2 ; Perform second row of matrix multiply.
texm3x3vspec t3, t0_bx2 ; Perform third row of matrix multiply,
; do reflection calculation
; using eye ray, and sample texture 3
; specular map.
Hier mein bisheriger ps1.4 Teil
ps.1.4
texld r0, t0 ; Look up normal map.
texcrd r4.rgb, t1 ; 1st row of environment matrix
texcrd r2.rgb, t2 ; 2st row of environment matrix
texcrd r3.rgb, t3 ; 3rd row of environment matrix
dp3 r4.r, r4, r0_bx2 ; 1st row of matrix multiply
dp3 r4.g, r2, r0_bx2 ; 2nd row of matrix multiply
dp3 r4.b, r3, r0_bx2 ; 3rd row of matrix multiply
?
Thomas