1
0
mirror of https://github.com/alliedmodders/hl2sdk.git synced 2025-09-19 20:16:10 +08:00
Files
hl2sdk/materialsystem/stdshaders/SDK_WaterRefractFresnel_ps11.psh

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

40 lines
778 B
Plaintext
Raw Permalink Normal View History

ps.1.1
; t0:
; texture: dudv map
; texcoords: dudvmap texcoords
; t1:
; texture: refraction render target
; texcoords:
tex t0 ; sample dudv map
texbem t1, t0 ; refraction
tex t2 ; The normal map
tex t3 ; Normalize the tangent-space vector to the eye
; dot eye-vector with per-pixel normal from t2
#ifndef _XBOX
dp3_sat r1.rgba, t2_bx2, t3_bx2
#else
dp3 r1.rgba, t2_bx2, t3_bx2
mov r1, r1_sat
#endif
mul r0.a, 1-r1.a, 1-r1.a ; squared
mul r0.a, r0.a, r0.a ; quartic
mul r0.rgb, t1, c0
#ifndef _XBOX
+mul_sat r0.a, r0.a, 1-r1.a ; quintic
#else
+mul r0.a, r0.a, 1-r1.a
mov r0.a, r0_sat.a
#endif
#ifndef _XBOX
add_sat r0.a, r0.a, v0.a ; cheap water distance
#else
add r0.a, r0.a, v0.a
mov r0.a, r0_sat.a
#endif