diff options
| author | Michael Sartain <[email protected]> | 2014-10-02 08:25:55 -0700 |
|---|---|---|
| committer | Michael Sartain <[email protected]> | 2014-10-02 08:25:55 -0700 |
| commit | 55ed12f8d1eb6887d348be03aee5573d44177ffb (patch) | |
| tree | 3686f7ca78c780cd9a3d367b79a9d9250c1be7c0 /mp/src/materialsystem/stdshaders/LightmappedGeneric_BumpmappedLightmap.psh | |
| parent | * Added support for Visual C++ 2013 Express to VPC (diff) | |
| download | source-sdk-2013-55ed12f8d1eb6887d348be03aee5573d44177ffb.tar.xz source-sdk-2013-55ed12f8d1eb6887d348be03aee5573d44177ffb.zip | |
Updated the SDK with the latest code from the TF and HL2 branches.
Diffstat (limited to 'mp/src/materialsystem/stdshaders/LightmappedGeneric_BumpmappedLightmap.psh')
| -rw-r--r-- | mp/src/materialsystem/stdshaders/LightmappedGeneric_BumpmappedLightmap.psh | 158 |
1 files changed, 79 insertions, 79 deletions
diff --git a/mp/src/materialsystem/stdshaders/LightmappedGeneric_BumpmappedLightmap.psh b/mp/src/materialsystem/stdshaders/LightmappedGeneric_BumpmappedLightmap.psh index 9e55248e..82b83a49 100644 --- a/mp/src/materialsystem/stdshaders/LightmappedGeneric_BumpmappedLightmap.psh +++ b/mp/src/materialsystem/stdshaders/LightmappedGeneric_BumpmappedLightmap.psh @@ -1,79 +1,79 @@ -ps.1.1
-
-;------------------------------------------------------------------------------
-; Computes the diffuse component of lighting using lightmap + bumpmap
-; t0 - Normalmap
-; t1 - Lightmap1
-; t2 - Lightmap2
-; t3 - Lightmap3
-;
-; The texture coordinates need to be defined as follows:
-; tc0 - Normalmap and lightmap texture coordinates
-; c0, c1, c2 - Axes of the lightmap coordinate system in tangent space
-;------------------------------------------------------------------------------
-
-; Get the 3-vector from the normal map
-tex t0
-
-; Sample the lightmaps
-tex t1
-tex t2
-tex t3
-
-; output = lightmapColor[0] * ( ( N dot basis[0] )^2 ) +
-; lightmapColor[1] * ( ( N dot basis[1] )^2 ) +
-; lightmapColor[2] * ( ( N dot basis[2] )^2 ) +
-
-; r0 = ( N dot basis[0] )
-; don't "_sat" here so that everything adds up to one even if the normal is outside of the basis!!!!!
-dp3 r0, t0_bx2, c0
-
-; r1 = ( N dot basis[1] )
-dp3 r1, t0_bx2, c1
-
-;----
-; r0 = ( N dot basis[0] )
-; r1 = ( N dot basis[1] )
-;----
-
-; r0.rgb = ( N dot basis[0] )^2
-mul r0.rgb, r0, r0
-
-; r1.a = ( N dot basis[1] )^2
-+mul r1.a, r1, r1
-
-;----
-; r0.rgb = ( N dot basis[0] )^2
-; r1.a = ( N dot basis[1] )^2
-;----
-
-mul t1, r0, t1
-
-;----
-; r1.a = ( N dot basis[1] )^2
-; t1 = lightmapColor[0] * ( N dot basis[0] )^2
-;----
-
-dp3 r0, t0_bx2, c2
-
-;----
-; r1.a = ( N dot basis[1] )^2
-; t1 = lightmapColor[0] * ( N dot basis[0] )^2
-; r0 = ( N dot basis[2] )
-;----
-
-mad t1.rgb, r1.a, t2, t1
-+mul r0.a, r0, r0
-
-;----
-; t1.rgb = lightmapColor[0] * ( N dot basis[0] )^2 + lightmapColor[1] * ( N dot basis[1] )^2
-; r0.a = ( N dot basis[2] )^2
-;----
-
-mad r0.rgba, r0.a, t3, t1
-
-;----
-; r0.rgb = lightmapColor[0] * ( N dot basis[0] )^2 +
-; lightmapColor[1] * ( N dot basis[1] )^2 +
-; lightmapColor[2] * ( N dot basis[2] )^2
-;----
+ps.1.1 + +;------------------------------------------------------------------------------ +; Computes the diffuse component of lighting using lightmap + bumpmap +; t0 - Normalmap +; t1 - Lightmap1 +; t2 - Lightmap2 +; t3 - Lightmap3 +; +; The texture coordinates need to be defined as follows: +; tc0 - Normalmap and lightmap texture coordinates +; c0, c1, c2 - Axes of the lightmap coordinate system in tangent space +;------------------------------------------------------------------------------ + +; Get the 3-vector from the normal map +tex t0 + +; Sample the lightmaps +tex t1 +tex t2 +tex t3 + +; output = lightmapColor[0] * ( ( N dot basis[0] )^2 ) + +; lightmapColor[1] * ( ( N dot basis[1] )^2 ) + +; lightmapColor[2] * ( ( N dot basis[2] )^2 ) + + +; r0 = ( N dot basis[0] ) +; don't "_sat" here so that everything adds up to one even if the normal is outside of the basis!!!!! +dp3 r0, t0_bx2, c0 + +; r1 = ( N dot basis[1] ) +dp3 r1, t0_bx2, c1 + +;---- +; r0 = ( N dot basis[0] ) +; r1 = ( N dot basis[1] ) +;---- + +; r0.rgb = ( N dot basis[0] )^2 +mul r0.rgb, r0, r0 + +; r1.a = ( N dot basis[1] )^2 ++mul r1.a, r1, r1 + +;---- +; r0.rgb = ( N dot basis[0] )^2 +; r1.a = ( N dot basis[1] )^2 +;---- + +mul t1, r0, t1 + +;---- +; r1.a = ( N dot basis[1] )^2 +; t1 = lightmapColor[0] * ( N dot basis[0] )^2 +;---- + +dp3 r0, t0_bx2, c2 + +;---- +; r1.a = ( N dot basis[1] )^2 +; t1 = lightmapColor[0] * ( N dot basis[0] )^2 +; r0 = ( N dot basis[2] ) +;---- + +mad t1.rgb, r1.a, t2, t1 ++mul r0.a, r0, r0 + +;---- +; t1.rgb = lightmapColor[0] * ( N dot basis[0] )^2 + lightmapColor[1] * ( N dot basis[1] )^2 +; r0.a = ( N dot basis[2] )^2 +;---- + +mad r0.rgba, r0.a, t3, t1 + +;---- +; r0.rgb = lightmapColor[0] * ( N dot basis[0] )^2 + +; lightmapColor[1] * ( N dot basis[1] )^2 + +; lightmapColor[2] * ( N dot basis[2] )^2 +;---- |