diff options
| author | Joe Ludwig <[email protected]> | 2013-12-23 14:58:45 -0800 |
|---|---|---|
| committer | Joe Ludwig <[email protected]> | 2013-12-23 15:00:03 -0800 |
| commit | 7309a5f13f63fdcc7b1e090f6c176113a9d95061 (patch) | |
| tree | ad65c7fbe46a3c70bdc0a1426e88247ce1b0d7f5 /sp/src/materialsystem/stdshaders/VertexLitGeneric_EnvmappedBumpmapV2_MultByAlpha_ps14.psh | |
| parent | Merge pull request #182 from ardneran/master (diff) | |
| download | source-sdk-2013-7309a5f13f63fdcc7b1e090f6c176113a9d95061.tar.xz source-sdk-2013-7309a5f13f63fdcc7b1e090f6c176113a9d95061.zip | |
Added many shader source files
This should include the latest version of every shader that was in the
2007 SDK. It also includes a smattering of debug shaders, both VR
distortion shaders, and other assorted shaders that will hopefully be
useful.
None of these new files are included in the game shader DLL project. If
you need to modify one of these shaders for use in your mod you will
need to rename it so that you don't collide with the version of that
shader that lives in stdshader_dx9.dll.
Diffstat (limited to 'sp/src/materialsystem/stdshaders/VertexLitGeneric_EnvmappedBumpmapV2_MultByAlpha_ps14.psh')
| -rw-r--r-- | sp/src/materialsystem/stdshaders/VertexLitGeneric_EnvmappedBumpmapV2_MultByAlpha_ps14.psh | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/sp/src/materialsystem/stdshaders/VertexLitGeneric_EnvmappedBumpmapV2_MultByAlpha_ps14.psh b/sp/src/materialsystem/stdshaders/VertexLitGeneric_EnvmappedBumpmapV2_MultByAlpha_ps14.psh new file mode 100644 index 00000000..eac900c9 --- /dev/null +++ b/sp/src/materialsystem/stdshaders/VertexLitGeneric_EnvmappedBumpmapV2_MultByAlpha_ps14.psh @@ -0,0 +1,42 @@ +ps.1.4
+;------------------------------------------------------------------------------
+; Phase 1
+;------------------------------------------------------------------------------
+; Get the 3-vector from the normal map
+texld r0, t0
+; Get environment matrix
+texcrd r1.rgb, t1
+texcrd r2.rgb, t2
+texcrd r3.rgb, t3
+; Normalize eye-ray vector through normalizer cube map
+texld r4, t4 ; <---- CUBE MAP here!!!
+;mov r0.rgba, r4
+
+; Transform normal
+dp3 r5.r, r1, r0_bx2
+dp3 r5.g, r2, r0_bx2
+dp3 r5.b, r3, r0_bx2
+; Reflection calculatiom
+dp3_x2 r3.rgb, r5, r4_bx2 ; 2(N.Eye)
+mul r3.rgb, r5, r3 ; 2N(N.Eye)
+dp3 r2.rgb, r5, r5 ; N.N
+mad r2.rgb, -r4_bx2, r2, r3 ; 2N(N.Eye) - Eye(N.N)
+; Alpha gets lost after phase marker, so store it here
+mov r5, r0.a
+;------------------------------------------------------------------------------
+; Phase 2
+;------------------------------------------------------------------------------
+phase
+; Sample environment map
+texld r3, r2
+; Result goes in output color (multiply by constant color c0)
+mul r0.rgb, r3, c0
++mov r0.a, c0.a
+
+mul r1.rgb, r0, r0
+lrp r0.rgb, c1, r1, r0 ; blend between color and color * color
+dp3 r1.rgb, r0, c3
+lrp r0.rgb, c2, r0, r1 ; blend between color and greyscale
+
+; mult by alpha
+mul r0.rgb, r0, r5
|