diff options
| author | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
|---|---|---|
| committer | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
| commit | 3bf9df6b2785fa6d951086978a3e66f49427166a (patch) | |
| tree | 2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /materialsystem/stdshaders/WaterRefractFresnel_ps11.psh | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'materialsystem/stdshaders/WaterRefractFresnel_ps11.psh')
| -rw-r--r-- | materialsystem/stdshaders/WaterRefractFresnel_ps11.psh | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/materialsystem/stdshaders/WaterRefractFresnel_ps11.psh b/materialsystem/stdshaders/WaterRefractFresnel_ps11.psh new file mode 100644 index 0000000..efade0f --- /dev/null +++ b/materialsystem/stdshaders/WaterRefractFresnel_ps11.psh @@ -0,0 +1,24 @@ +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 +dp3_sat r1.rgba, t2_bx2, t3_bx2 + +mul r0.a, 1-r1.a, 1-r1.a ; squared +mul r0.a, r0.a, r0.a ; quartic + +mul r0.rgb, t1, c0 ++mul_sat r0.a, r0.a, 1-r1.a ; quintic + +add_sat r0.a, r0.a, v0.a ; cheap water distance |