home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Igromania 2005 May
/
Igromania_2005-05.iso
/
DemosThemes2
/
Demo1944BattleOfTheBulge
/
demo1944english.exe
/
Inf
/
grass2-shadow.ps.ati
< prev
next >
Wrap
Text File
|
2004-06-14
|
1KB
|
65 lines
ps_2_0
; c0 = mastercolor
; c1 = ambient color
def c12, 0, 0, 0, 1
def c13, 0.00048828125f, 0, 0, 0
def c14, 0, 0.00048828125f, 0, 0
def c15, 0.00048828125f, 0.00048828125f, 0, 0
def c16, 2048, 2048, 2048, 2048
dcl v0 ; vertex color
dcl_2d s0 ; shadow map
dcl_2d s1 ; diffuse
dcl t0.xyzw ; shadow map coord
dcl t1.xy ; diffuse coord
#if 1
// regi shadow-map kod
rcp r0, t0.w
mul r0, t0, r0
texld r1, r0, s0
sub r1, r0.z, r1.r
cmp r0, r1, c1, v0
#else
; uj shadow map kod itt kezdodik
rcp r0, t0.w ; r0.w=1/t0.w
mul r0, t0, r0 ; r0=t0/t0.w
; more taps
; r0=alap tap
add r1, r0, c13
add r2, r0, c14
add r3, r0, c15
mul r4, r0, c16 ; r4, texel space
frc r4, r4 ; r4.xy=interpolant
texld r5, r0, s0 ; tap0 sample
texld r6, r1, s0 ; tap1 sample
texld r7, r2, s0 ; tap2 sample
texld r8, r3, s0 ; tap3 sample
sub r1.r, r0.z, r5.r ; kivonas 00
sub r1.g, r0.z, r6.r ; kivonas 10
sub r1.b, r0.z, r7.r ; kivonas 01
sub r1.a, r0.z, r8.r ; kivonas 11
cmp r2, r1, c12.x, c12.w ; 0 vagy 1
lrp r5, r4.x, r2.g, r2.r
lrp r6, r4.x, r2.a, r2.b
lrp r7, r4.y, r6, r5
lrp r0, r7, v0, c1
#endif
; itt van vege. eredmeny r0-ban
texld r1, t1, s1
mul r1.rgb, r1, r0
mul r0.rgb, r1, v0.a
mov r0.a, r1.a
mov oC0, r0