Updated the SDK with the latest code from the TF and HL2 branches.

This commit is contained in:
Michael Sartain
2014-10-02 08:25:55 -07:00
parent 56accfdb9c
commit 55ed12f8d1
767 changed files with 119642 additions and 122204 deletions

View File

@@ -1,18 +1,18 @@
ps.1.1
// 1221 filter constants
def c0, 0.1667f, 0.1667f, 0.1667f, 0.3333f
tex t0
tex t1
tex t2
tex t3
mul r0.rgb, t0, c0
mad r0.rgb, t1, c0.a, r0
mad r0.rgb, t2, c0.a, r0
mad r0.rgb, t3, c0, r0
mul r0.rgb, r0, c1 +
mov r0.a, t0.a
ps.1.1
// 1221 filter constants
def c0, 0.1667f, 0.1667f, 0.1667f, 0.3333f
tex t0
tex t1
tex t2
tex t3
mul r0.rgb, t0, c0
mad r0.rgb, t1, c0.a, r0
mad r0.rgb, t2, c0.a, r0
mad r0.rgb, t3, c0, r0
mul r0.rgb, r0, c1 +
mov r0.a, t0.a

View File

@@ -1,27 +1,27 @@
ps.1.1
;------------------------------------------------------------------------------
; See the vertex shader for info
;
; This shader takes:
; t0 = normal map
; t1 = base texture
; v0 = directional light color
; t2 = directional light direction (biased into 0-1)
; c0 = percent of dirlight to add as ambient
;
; Output:
; (t0 dot t1) * v0
;------------------------------------------------------------------------------
tex t0 ; Get the 3-vector from the normal map
tex t1 ; Interpret tcoord t1 as color data.
texcoord t2
dp3 r1, t0_bx2, t2_bx2 ; r1 = normalMap dot dirLightDir
add r0, r1, c0 ; + 0.5
mul r1, v0, r0 ; scale the dot product by the dirlight's actual color
mul r0.rgb, r1, t1 + ; scale by the texture color
mul r0.a, t1.a, v0.a
ps.1.1
;------------------------------------------------------------------------------
; See the vertex shader for info
;
; This shader takes:
; t0 = normal map
; t1 = base texture
; v0 = directional light color
; t2 = directional light direction (biased into 0-1)
; c0 = percent of dirlight to add as ambient
;
; Output:
; (t0 dot t1) * v0
;------------------------------------------------------------------------------
tex t0 ; Get the 3-vector from the normal map
tex t1 ; Interpret tcoord t1 as color data.
texcoord t2
dp3 r1, t0_bx2, t2_bx2 ; r1 = normalMap dot dirLightDir
add r0, r1, c0 ; + 0.5
mul r1, v0, r0 ; scale the dot product by the dirlight's actual color
mul r0.rgb, r1, t1 + ; scale by the texture color
mul r0.a, t1.a, v0.a

View File

@@ -1,16 +1,16 @@
ps.1.1
;------------------------------------------------------------------------------
; Draw the eyes
; t0 - texture
; t1 - iris
; t2 - glint
;------------------------------------------------------------------------------
tex t0
tex t1
tex t2
lrp r0, t1.a, t1, t0 ; Blend in the iris with the background
mad r0.rgb, r0, v0, t2 + ; Modulate by the illumination, add in the glint
mov r0.a, t0.a
ps.1.1
;------------------------------------------------------------------------------
; Draw the eyes
; t0 - texture
; t1 - iris
; t2 - glint
;------------------------------------------------------------------------------
tex t0
tex t1
tex t2
lrp r0, t1.a, t1, t0 ; Blend in the iris with the background
mad r0.rgb, r0, v0, t2 + ; Modulate by the illumination, add in the glint
mov r0.a, t0.a

View File

@@ -1,18 +1,18 @@
ps.1.1
;------------------------------------------------------------------------------
; Draw the eyes
; t0 - texture
; t1 - iris
; t2 - glint
;------------------------------------------------------------------------------
tex t0
tex t1
tex t2
lrp r0, t1.a, t1, t0 ; Blend in the iris with the background
mul_x2 r0, v0, r0 ; Modulate by the illumination with overbright
add r0.rgb, r0, t2 + ; Add in the glint
mov r0.a, t0.a
ps.1.1
;------------------------------------------------------------------------------
; Draw the eyes
; t0 - texture
; t1 - iris
; t2 - glint
;------------------------------------------------------------------------------
tex t0
tex t1
tex t2
lrp r0, t1.a, t1, t0 ; Blend in the iris with the background
mul_x2 r0, v0, r0 ; Modulate by the illumination with overbright
add r0.rgb, r0, t2 + ; Add in the glint
mov r0.a, t0.a

View File

@@ -1,15 +1,15 @@
ps.1.1
;------------------------------------------------------------------------------
; Draw a texture . . woo hoo!
; t0 - texture
;
; The texture coordinates need to be defined as follows:
; tc0 - texcoords
;------------------------------------------------------------------------------
tex t0
tex t1
mul r0, t0, v0 ; base times vertex color (with alpha)
mul r0.rgb, t1, r0 ; fold in lightmap (color only)
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
ps.1.1
;------------------------------------------------------------------------------
; Draw a texture . . woo hoo!
; t0 - texture
;
; The texture coordinates need to be defined as follows:
; tc0 - texcoords
;------------------------------------------------------------------------------
tex t0
tex t1
mul r0, t0, v0 ; base times vertex color (with alpha)
mul r0.rgb, t1, r0 ; fold in lightmap (color only)
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)

View File

@@ -1,17 +1,17 @@
ps.1.1
;------------------------------------------------------------------------------
; Draw a texture . . woo hoo!
; t0 - texture
;
; The texture coordinates need to be defined as follows:
; tc0 - texcoords
; c2 - envmaptint
;------------------------------------------------------------------------------
tex t2 ; cube map
tex t3 ; envmap mask
mul r0.rgb, t2, 1-t3.a
mul r0.rgb, c2, r0 ; apply the envmaptint
+ mul r0.a, c2.a, v0.a
ps.1.1
;------------------------------------------------------------------------------
; Draw a texture . . woo hoo!
; t0 - texture
;
; The texture coordinates need to be defined as follows:
; tc0 - texcoords
; c2 - envmaptint
;------------------------------------------------------------------------------
tex t2 ; cube map
tex t3 ; envmap mask
mul r0.rgb, t2, 1-t3.a
mul r0.rgb, c2, r0 ; apply the envmaptint
+ mul r0.a, c2.a, v0.a

View File

@@ -1,17 +1,17 @@
ps.1.1
;------------------------------------------------------------------------------
; Draw a texture . . woo hoo!
; t0 - texture
;
; The texture coordinates need to be defined as follows:
; tc0 - texcoords
; c2 - envmaptint
;------------------------------------------------------------------------------
tex t2 ; cube map
tex t3 ; envmap mask
mul r0.rgb, t2, t3
mul r0.rgb, c2, r0
+ mul r0.a, c2.a, v0.a
ps.1.1
;------------------------------------------------------------------------------
; Draw a texture . . woo hoo!
; t0 - texture
;
; The texture coordinates need to be defined as follows:
; tc0 - texcoords
; c2 - envmaptint
;------------------------------------------------------------------------------
tex t2 ; cube map
tex t3 ; envmap mask
mul r0.rgb, t2, t3
mul r0.rgb, c2, r0
+ mul r0.a, c2.a, v0.a

View File

@@ -1,15 +1,15 @@
ps.1.1
;------------------------------------------------------------------------------
; Draw a texture . . woo hoo!
; t0 - texture
;
; The texture coordinates need to be defined as follows:
; tc0 - texcoords
; c2 - envmaptint
;------------------------------------------------------------------------------
tex t2 ; cube map
mul r0.rgb, t2, c2
+ mul r0.a, v0.a, c2.a
ps.1.1
;------------------------------------------------------------------------------
; Draw a texture . . woo hoo!
; t0 - texture
;
; The texture coordinates need to be defined as follows:
; tc0 - texcoords
; c2 - envmaptint
;------------------------------------------------------------------------------
tex t2 ; cube map
mul r0.rgb, t2, c2
+ mul r0.a, v0.a, c2.a

View File

@@ -1,22 +1,22 @@
ps.1.1
;------------------------------------------------------------------------------
; Draw a texture . . woo hoo!
; t0 - texture
;
; The texture coordinates need to be defined as follows:
; tc0 - texcoords
; c1 - self-illum tint
; c2 - envmap tint
;------------------------------------------------------------------------------
tex t0
tex t1
tex t2
tex t3
mul r0, t0, v0 ; base times vertex color (with alpha)
mul r0.rgb, t1, r0 ; fold in lighting (color only)
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
mul r1, t2, 1-t3.a ; envmap * envmapmask (alpha)
mad r0.rgb, r1, c2, r0 ; + envmap * envmapmask * envmaptint (color only)
ps.1.1
;------------------------------------------------------------------------------
; Draw a texture . . woo hoo!
; t0 - texture
;
; The texture coordinates need to be defined as follows:
; tc0 - texcoords
; c1 - self-illum tint
; c2 - envmap tint
;------------------------------------------------------------------------------
tex t0
tex t1
tex t2
tex t3
mul r0, t0, v0 ; base times vertex color (with alpha)
mul r0.rgb, t1, r0 ; fold in lighting (color only)
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
mul r1, t2, 1-t3.a ; envmap * envmapmask (alpha)
mad r0.rgb, r1, c2, r0 ; + envmap * envmapmask * envmaptint (color only)

View File

@@ -1,14 +1,14 @@
ps.1.1
;------------------------------------------------------------------------------
; Draw a texture . . woo hoo!
; t0 - texture
;
; The texture coordinates need to be defined as follows:
; tc0 - texcoords
;------------------------------------------------------------------------------
; Get the color from the texture
tex t0
mul r0, t0, c0
ps.1.1
;------------------------------------------------------------------------------
; Draw a texture . . woo hoo!
; t0 - texture
;
; The texture coordinates need to be defined as follows:
; tc0 - texcoords
;------------------------------------------------------------------------------
; Get the color from the texture
tex t0
mul r0, t0, c0

View File

@@ -1,66 +1,66 @@
; STATIC: "NORMALMAPALPHAENVMAPMASK" "0..1"
ps.1.1
;------------------------------------------------------------------------------
; Environment mapping on a bumped surface
; t0 - Normalmap
; t3 - Cube environment map (*must* be a cube map!)
;
; c0 - color to multiply the results by
; c1 - envmap contrast
; c2 - envmap saturation
; c3 - grey weights
; c4 - fresnel amount
; Input texture coords required here are a little wonky.
; tc0.uv <- U,V into the normal map
; tc1.uvw, tc2.uvw, tc3.uvw <- 3x3 matrix transform
; from tangent space->env map space
; tc1.q, tc2.q, tc3.q <- eye vector in env map space
;------------------------------------------------------------------------------
; Get the 3-vector from the normal map
tex t0
; Perform matrix multiply to get a local normal bump. Then
; reflect the eye vector through the normal and sample from
; a cubic environment map.
texm3x3pad t1, t0_bx2
texm3x3pad t2, t0_bx2
texm3x3vspec t3, t0_bx2
; FIXME FIXME - Need to do specialized versions of this with and without:
; - constant color
; - fresnel amount of exactly 0 or 1 or in between
; - envmap contrast of 0, 1, or in between
; - envmap saturation of 0, 1, or in between
; r0 = constant color * result of bump into envmap
mul r0.rgb, t3, c0
; dot eye-vector with per-pixel normal from t0
dp3_sat r1, v0_bx2, t0_bx2
; run Fresnel approx. on it: R0 + (1-R0) (1-cos(q))^5 in alpha channel
mul r1.rgb, r0, r0 ; color squared
+mul r0.a, 1-r1.a, 1-r1.a ; squared
lrp r0.rgb, c1, r1, r0 ; blend between color and color * color
+mul r0.a, r0.a, r0.a ; quartic
dp3 r1.rgb, r0, c3 ; color greyscaled
+mul r0.a, r0.a, 1-r1.a ; quintic
; FIXME - these should be able to pair (I think), but don't on nvidia for some reason.
; (I think) cannot pair due to use of >2 constants in single stage
lrp r0.rgb, c2, r0, r1 ; blend between color and greyscale
mad r0.a, r0.a, c6.a, c4.a ; Take Fresnel R(0) into consideration
mul r0.rgb, r0, r0.a ; multiply output color by result of fresnel calc
#if NORMALMAPALPHAENVMAPMASK
+mul r0.a, c0.a, t0.a ; Fade amount * alpha from the texture
#else
+mov r0.a, c0.a ; Just use the fade amount
#endif
; STATIC: "NORMALMAPALPHAENVMAPMASK" "0..1"
ps.1.1
;------------------------------------------------------------------------------
; Environment mapping on a bumped surface
; t0 - Normalmap
; t3 - Cube environment map (*must* be a cube map!)
;
; c0 - color to multiply the results by
; c1 - envmap contrast
; c2 - envmap saturation
; c3 - grey weights
; c4 - fresnel amount
; Input texture coords required here are a little wonky.
; tc0.uv <- U,V into the normal map
; tc1.uvw, tc2.uvw, tc3.uvw <- 3x3 matrix transform
; from tangent space->env map space
; tc1.q, tc2.q, tc3.q <- eye vector in env map space
;------------------------------------------------------------------------------
; Get the 3-vector from the normal map
tex t0
; Perform matrix multiply to get a local normal bump. Then
; reflect the eye vector through the normal and sample from
; a cubic environment map.
texm3x3pad t1, t0_bx2
texm3x3pad t2, t0_bx2
texm3x3vspec t3, t0_bx2
; FIXME FIXME - Need to do specialized versions of this with and without:
; - constant color
; - fresnel amount of exactly 0 or 1 or in between
; - envmap contrast of 0, 1, or in between
; - envmap saturation of 0, 1, or in between
; r0 = constant color * result of bump into envmap
mul r0.rgb, t3, c0
; dot eye-vector with per-pixel normal from t0
dp3_sat r1, v0_bx2, t0_bx2
; run Fresnel approx. on it: R0 + (1-R0) (1-cos(q))^5 in alpha channel
mul r1.rgb, r0, r0 ; color squared
+mul r0.a, 1-r1.a, 1-r1.a ; squared
lrp r0.rgb, c1, r1, r0 ; blend between color and color * color
+mul r0.a, r0.a, r0.a ; quartic
dp3 r1.rgb, r0, c3 ; color greyscaled
+mul r0.a, r0.a, 1-r1.a ; quintic
; FIXME - these should be able to pair (I think), but don't on nvidia for some reason.
; (I think) cannot pair due to use of >2 constants in single stage
lrp r0.rgb, c2, r0, r1 ; blend between color and greyscale
mad r0.a, r0.a, c6.a, c4.a ; Take Fresnel R(0) into consideration
mul r0.rgb, r0, r0.a ; multiply output color by result of fresnel calc
#if NORMALMAPALPHAENVMAPMASK
+mul r0.a, c0.a, t0.a ; Fade amount * alpha from the texture
#else
+mov r0.a, c0.a ; Just use the fade amount
#endif

View File

@@ -1,72 +1,72 @@
; STATIC: "NORMALMAPALPHAENVMAPMASK" "0..1"
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)
#if NORMALMAPALPHAENVMAPMASK
; Alpha gets lost after phase marker, so store it here
mov r5, r0.a
#endif
;------------------------------------------------------------------------------
; Phase 2
;------------------------------------------------------------------------------
; What's left over from the last phase:
; r0 - normal
; r1 - free
; r2 - vector to sample in envmap
; r3 - free
; r4 - normal
; r5 - normal map alpha (rgba)
phase
; Sample environment map
texld r3, r2
; dot eye-vector with per-pixel normal from r0
dp3_sat r1, v0_bx2, r0_bx2
; Result goes in output color (multiply by constant color c0)
mul r0.rgb, r3, c0
; run Fresnel approx. on it: R0 + (1-R0) (1-cos(q))^5 in alpha channel
mul r1.rgb, r0, r0
+mul r0.a, 1-r1.a, 1-r1.a ; squared
lrp r0.rgb, c1, r1, r0 ; blend between color and color * color
+mul r0.a, r0.a, r0.a ; quartic
dp3 r1.rgb, r0, c3
+mul r0.a, r0.a, 1-r1.a ; quintic
lrp r0.rgb, c2, r0, r1 ; blend between color and greyscale
mad r0.a, r0.a, c6.a, c4.a ; Take Fresnel R(0) into consideration
mul r0.rgb, r0, r0.a ; multiply output color by result of fresnel calc
#if NORMALMAPALPHAENVMAPMASK
+mul r0.a, c0.a, r5.r ; Fade amount * alpha from the texture
#else
+mov r0.a, c0.a ; Just use the fade amount
#endif
; STATIC: "NORMALMAPALPHAENVMAPMASK" "0..1"
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)
#if NORMALMAPALPHAENVMAPMASK
; Alpha gets lost after phase marker, so store it here
mov r5, r0.a
#endif
;------------------------------------------------------------------------------
; Phase 2
;------------------------------------------------------------------------------
; What's left over from the last phase:
; r0 - normal
; r1 - free
; r2 - vector to sample in envmap
; r3 - free
; r4 - normal
; r5 - normal map alpha (rgba)
phase
; Sample environment map
texld r3, r2
; dot eye-vector with per-pixel normal from r0
dp3_sat r1, v0_bx2, r0_bx2
; Result goes in output color (multiply by constant color c0)
mul r0.rgb, r3, c0
; run Fresnel approx. on it: R0 + (1-R0) (1-cos(q))^5 in alpha channel
mul r1.rgb, r0, r0
+mul r0.a, 1-r1.a, 1-r1.a ; squared
lrp r0.rgb, c1, r1, r0 ; blend between color and color * color
+mul r0.a, r0.a, r0.a ; quartic
dp3 r1.rgb, r0, c3
+mul r0.a, r0.a, 1-r1.a ; quintic
lrp r0.rgb, c2, r0, r1 ; blend between color and greyscale
mad r0.a, r0.a, c6.a, c4.a ; Take Fresnel R(0) into consideration
mul r0.rgb, r0, r0.a ; multiply output color by result of fresnel calc
#if NORMALMAPALPHAENVMAPMASK
+mul r0.a, c0.a, r5.r ; Fade amount * alpha from the texture
#else
+mov r0.a, c0.a ; Just use the fade amount
#endif

View File

@@ -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
;----

View File

@@ -1,39 +1,39 @@
;------------------------------------------------------------------------------
; Computes the diffuse component of lighting using lightmap + bumpmap
; t0 - Normalmap
; t1 - Lightmap1
; t2 - Lightmap2
; t3 - Lightmap3
; t4 - Base
;
; 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
;------------------------------------------------------------------------------
ps.1.4
; Get the 3-vector from the normal map
texld r0, t0
; Sample the lightmaps
texld r1, t1
texld r2, t2
texld r3, t3
; Sample the base texture
texld r4, t4
; output = (lightmapColor[0] * ( ( N dot basis[0] )^2 ) +
; lightmapColor[1] * ( ( N dot basis[1] )^2 ) +
; lightmapColor[2] * ( ( N dot basis[2] )^2 ) ) * base
dp3 r5.r, r0_bx2, c0
dp3 r5.g, r0_bx2, c1
dp3 r5.b, r0_bx2, c2
mul r5.rgb, r5, r5
mul r1, r1, r5.r
mad r1, r2, r5.g, r1
mad r1, r3, r5.g, r1
; assume overbright_2 !!!
mul_x2 r0, r1, r4
;------------------------------------------------------------------------------
; Computes the diffuse component of lighting using lightmap + bumpmap
; t0 - Normalmap
; t1 - Lightmap1
; t2 - Lightmap2
; t3 - Lightmap3
; t4 - Base
;
; 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
;------------------------------------------------------------------------------
ps.1.4
; Get the 3-vector from the normal map
texld r0, t0
; Sample the lightmaps
texld r1, t1
texld r2, t2
texld r3, t3
; Sample the base texture
texld r4, t4
; output = (lightmapColor[0] * ( ( N dot basis[0] )^2 ) +
; lightmapColor[1] * ( ( N dot basis[1] )^2 ) +
; lightmapColor[2] * ( ( N dot basis[2] )^2 ) ) * base
dp3 r5.r, r0_bx2, c0
dp3 r5.g, r0_bx2, c1
dp3 r5.b, r0_bx2, c2
mul r5.rgb, r5, r5
mul r1, r1, r5.r
mad r1, r2, r5.g, r1
mad r1, r3, r5.g, r1
; assume overbright_2 !!!
mul_x2 r0, r1, r4

View File

@@ -1,47 +1,47 @@
;------------------------------------------------------------------------------
; Computes the diffuse component of lighting using lightmap + bumpmap
; t0 - Normalmap
; t1 - Lightmap1
; t2 - Lightmap2
; t3 - Lightmap3
; t4 - Base1
; t5 - Base2
;
; 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
;------------------------------------------------------------------------------
ps.1.4
; output = (lightmapColor[0] * ( ( N dot basis[0] )^2 ) +
; lightmapColor[1] * ( ( N dot basis[1] )^2 ) +
; lightmapColor[2] * ( ( N dot basis[2] )^2 ) ) * lerp(base1, base2, lightmapColor[0].a)
; Get the 3-vector from the normal map
texld r0, t0
dp3 r5.r, r0_bx2, c0
dp3 r5.g, r0_bx2, c1
dp3 r5.b, r0_bx2, c2
mul r5.rgb, r5, r5
phase
; Sample the lightmaps
texld r1, t1
texld r2, t2
texld r3, t3
; Sample the base textures
texld r4, t4
texld r5, t5
mul r1, r1, r5.r
mad r1, r2, r5.g, r1
mad r1, r3, r5.g, r1
; blend base textures
lrp r4, r4, r5, r1.a
; assume overbright_2 !!!
mul_x2 r0, r1, r4
;------------------------------------------------------------------------------
; Computes the diffuse component of lighting using lightmap + bumpmap
; t0 - Normalmap
; t1 - Lightmap1
; t2 - Lightmap2
; t3 - Lightmap3
; t4 - Base1
; t5 - Base2
;
; 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
;------------------------------------------------------------------------------
ps.1.4
; output = (lightmapColor[0] * ( ( N dot basis[0] )^2 ) +
; lightmapColor[1] * ( ( N dot basis[1] )^2 ) +
; lightmapColor[2] * ( ( N dot basis[2] )^2 ) ) * lerp(base1, base2, lightmapColor[0].a)
; Get the 3-vector from the normal map
texld r0, t0
dp3 r5.r, r0_bx2, c0
dp3 r5.g, r0_bx2, c1
dp3 r5.b, r0_bx2, c2
mul r5.rgb, r5, r5
phase
; Sample the lightmaps
texld r1, t1
texld r2, t2
texld r3, t3
; Sample the base textures
texld r4, t4
texld r5, t5
mul r1, r1, r5.r
mad r1, r2, r5.g, r1
mad r1, r3, r5.g, r1
; blend base textures
lrp r4, r4, r5, r1.a
; assume overbright_2 !!!
mul_x2 r0, r1, r4

View File

@@ -1,47 +1,47 @@
ps.1.1
;------------------------------------------------------------------------------
; Computes the diffuse component of lighting using lightmap + bumpmap
; t0 - decal texture
; t1 - Lightmap1
; t2 - Lightmap2
; t3 - Lightmap3
;
; The texture coordinates need to be defined as follows:
; tc0 - Normalmap and lightmap texture coordinates
; c0, c1, c2 - ( ( N dot basis[0] )^2 ), ( ( N dot basis[1] )^2 ), ( ( N dot basis[2] )^2 )
;------------------------------------------------------------------------------
; Get the decal color
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 = lightmapColor[0] * ( ( N dot basis[0] )^2 )
mul r0, t1, c0
; r0 = lightmapColor[0] * ( ( N dot basis[0] )^2 ) + lightmapColor[1] * ( ( N dot basis[1] )^2 )
mad r0, t2, c1, r0
; r0 = lightmapColor[0] * ( ( N dot basis[0] )^2 ) +
; lightmapColor[1] * ( ( N dot basis[1] )^2 ) +
; lightmapColor[2] * ( ( N dot basis[2] )^2 )
mad r0, t3, c2, r0
; Modulate by decal texture
mul r0.rgb, r0, t0
+ mov r0.a, t0.a
; Modulate by constant color
mul r0, r0, c3
; Modulate by per-vertex factor
mul r0, r0, v0
ps.1.1
;------------------------------------------------------------------------------
; Computes the diffuse component of lighting using lightmap + bumpmap
; t0 - decal texture
; t1 - Lightmap1
; t2 - Lightmap2
; t3 - Lightmap3
;
; The texture coordinates need to be defined as follows:
; tc0 - Normalmap and lightmap texture coordinates
; c0, c1, c2 - ( ( N dot basis[0] )^2 ), ( ( N dot basis[1] )^2 ), ( ( N dot basis[2] )^2 )
;------------------------------------------------------------------------------
; Get the decal color
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 = lightmapColor[0] * ( ( N dot basis[0] )^2 )
mul r0, t1, c0
; r0 = lightmapColor[0] * ( ( N dot basis[0] )^2 ) + lightmapColor[1] * ( ( N dot basis[1] )^2 )
mad r0, t2, c1, r0
; r0 = lightmapColor[0] * ( ( N dot basis[0] )^2 ) +
; lightmapColor[1] * ( ( N dot basis[1] )^2 ) +
; lightmapColor[2] * ( ( N dot basis[2] )^2 )
mad r0, t3, c2, r0
; Modulate by decal texture
mul r0.rgb, r0, t0
+ mov r0.a, t0.a
; Modulate by constant color
mul r0, r0, c3
; Modulate by per-vertex factor
mul r0, r0, v0

View File

@@ -1,18 +1,18 @@
ps.1.1
;------------------------------------------------------------------------------
; Draw a texture . . woo hoo!
; t0 - texture
;
; The texture coordinates need to be defined as follows:
; tc0 - texcoords
;------------------------------------------------------------------------------
tex t0
tex t1
tex t2
mul r0, t0, v0 ; base times vertex color (with alpha)
mul r0.rgb, t1, r0 ; fold in lightmap (color only)
mul_x2 r1.rgb, r0, t2 ; detail texture
lrp r0.rgb, c2, r1, r0
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
ps.1.1
;------------------------------------------------------------------------------
; Draw a texture . . woo hoo!
; t0 - texture
;
; The texture coordinates need to be defined as follows:
; tc0 - texcoords
;------------------------------------------------------------------------------
tex t0
tex t1
tex t2
mul r0, t0, v0 ; base times vertex color (with alpha)
mul r0.rgb, t1, r0 ; fold in lightmap (color only)
mul_x2 r1.rgb, r0, t2 ; detail texture
lrp r0.rgb, c2, r1, r0
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)

View File

@@ -1,16 +1,16 @@
ps.1.1
;------------------------------------------------------------------------------
; Draw a texture . . woo hoo!
; t0 - texture
;
; The texture coordinates need to be defined as follows:
; tc0 - texcoords
;------------------------------------------------------------------------------
tex t1
tex t2
mul r0.rgb, t1, v0 + ; base times vertex color (with alpha)
mov r0.a, v0.a
mul_x2 r0.rgb, r0, t2 ; detail texture
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
ps.1.1
;------------------------------------------------------------------------------
; Draw a texture . . woo hoo!
; t0 - texture
;
; The texture coordinates need to be defined as follows:
; tc0 - texcoords
;------------------------------------------------------------------------------
tex t1
tex t2
mul r0.rgb, t1, v0 + ; base times vertex color (with alpha)
mov r0.a, v0.a
mul_x2 r0.rgb, r0, t2 ; detail texture
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)

View File

@@ -1,23 +1,23 @@
ps.1.1
;------------------------------------------------------------------------------
; Draw a texture . . woo hoo!
; t0 - texture
;
; The texture coordinates need to be defined as follows:
; tc0 - texcoords
;------------------------------------------------------------------------------
tex t0
tex t1
tex t2
mul r0.rgb, t0, v0 + ; base times vertex color (no alpha)
mov r0.a, v0.a ; Grab alpha from vertex color
mul r0.rgb, t1, r0 ; fold in lighting (color only)
mul_x2 r1.rgb, r0, t2 ; detail texture
lrp r0.rgb, c2, r1, r0
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
mul r1, c1, t0 ; Self illum * tint
lrp r0.rgb, t0.a, r1, r0 ; Blend between self-illum + base * lightmap
ps.1.1
;------------------------------------------------------------------------------
; Draw a texture . . woo hoo!
; t0 - texture
;
; The texture coordinates need to be defined as follows:
; tc0 - texcoords
;------------------------------------------------------------------------------
tex t0
tex t1
tex t2
mul r0.rgb, t0, v0 + ; base times vertex color (no alpha)
mov r0.a, v0.a ; Grab alpha from vertex color
mul r0.rgb, t1, r0 ; fold in lighting (color only)
mul_x2 r1.rgb, r0, t2 ; detail texture
lrp r0.rgb, c2, r1, r0
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
mul r1, c1, t0 ; Self illum * tint
lrp r0.rgb, t0.a, r1, r0 ; Blend between self-illum + base * lightmap

View File

@@ -1,21 +1,21 @@
ps.1.1
;------------------------------------------------------------------------------
; Draw a texture . . woo hoo!
; t0 - texture
;
; The texture coordinates need to be defined as follows:
; tc0 - texcoords
; c1 - self-illum tint
; c2 - envmap tint
;------------------------------------------------------------------------------
tex t1
tex t2
mov r0.rgb, v0 + ; vertex color
mul r0.a, v0.a, t2.a ; vertex alpha * envmap alpha
mad r0.rgb, t2, c2, r0 ; + envmap * envmaptint (color only)
mul r0.rgb, t1, r0 ; fold in lightmap (color only)
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
ps.1.1
;------------------------------------------------------------------------------
; Draw a texture . . woo hoo!
; t0 - texture
;
; The texture coordinates need to be defined as follows:
; tc0 - texcoords
; c1 - self-illum tint
; c2 - envmap tint
;------------------------------------------------------------------------------
tex t1
tex t2
mov r0.rgb, v0 + ; vertex color
mul r0.a, v0.a, t2.a ; vertex alpha * envmap alpha
mad r0.rgb, t2, c2, r0 ; + envmap * envmaptint (color only)
mul r0.rgb, t1, r0 ; fold in lightmap (color only)
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)

View File

@@ -1,20 +1,20 @@
ps.1.1
;------------------------------------------------------------------------------
; Draw a texture . . woo hoo!
; t0 - texture
;
; The texture coordinates need to be defined as follows:
; tc0 - texcoords
; c1 - self-illum tint
; c2 - envmap tint
;------------------------------------------------------------------------------
tex t0
tex t1
tex t2
mul r0, t0, v0 ; base times vertex color (with alpha)
mul r0.rgb, t1, r0 ; fold in lightmap (color only)
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
mad r0.rgb, t2, c2, r0 ; + envmap * envmaptint (color only)
ps.1.1
;------------------------------------------------------------------------------
; Draw a texture . . woo hoo!
; t0 - texture
;
; The texture coordinates need to be defined as follows:
; tc0 - texcoords
; c1 - self-illum tint
; c2 - envmap tint
;------------------------------------------------------------------------------
tex t0
tex t1
tex t2
mul r0, t0, v0 ; base times vertex color (with alpha)
mul r0.rgb, t1, r0 ; fold in lightmap (color only)
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
mad r0.rgb, t2, c2, r0 ; + envmap * envmaptint (color only)

View File

@@ -1,6 +1,6 @@
ps.1.1
tex t1
mov r0.rgba, t1
ps.1.1
tex t1
mov r0.rgba, t1

View File

@@ -1,24 +1,24 @@
ps.1.1
;------------------------------------------------------------------------------
; Draw a texture . . woo hoo!
; t0 - texture
;
; The texture coordinates need to be defined as follows:
; tc0 - texcoords
; c1 - self-illum tint
; c2 - envmap tint
;------------------------------------------------------------------------------
tex t1
tex t2
tex t3
mov r0.rgb, v0 ; vertex color
mul r1, t2, t3 ; envmap * envmapmask
mad r0.rgb, r1, c2, r0 + ; + envmap * envmapmask * envmaptint (color only)
mul r0.a, v0.a, r1.a ; alpha = vertex alpha * envmap alpha * envmapmask alpha
mul r0.rgb, t1, r0 ; fold in lightmap (color only)
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
ps.1.1
;------------------------------------------------------------------------------
; Draw a texture . . woo hoo!
; t0 - texture
;
; The texture coordinates need to be defined as follows:
; tc0 - texcoords
; c1 - self-illum tint
; c2 - envmap tint
;------------------------------------------------------------------------------
tex t1
tex t2
tex t3
mov r0.rgb, v0 ; vertex color
mul r1, t2, t3 ; envmap * envmapmask
mad r0.rgb, r1, c2, r0 + ; + envmap * envmapmask * envmaptint (color only)
mul r0.a, v0.a, r1.a ; alpha = vertex alpha * envmap alpha * envmapmask alpha
mul r0.rgb, t1, r0 ; fold in lightmap (color only)
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)

View File

@@ -1,22 +1,22 @@
ps.1.1
;------------------------------------------------------------------------------
; Draw a texture . . woo hoo!
; t0 - texture
;
; The texture coordinates need to be defined as follows:
; tc0 - texcoords
; c1 - self-illum tint
; c2 - envmap tint
;------------------------------------------------------------------------------
tex t0
tex t1
tex t2
tex t3
mul r0, t0, v0 ; base times vertex color (with alpha)
mul r0.rgb, t1, r0 ; fold in lighting (color only)
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
mul r1, t2, t3 ; envmap * envmapmask
mad r0.rgb, r1, c2, r0 ; + envmap * envmapmask * envmaptint (color only)
ps.1.1
;------------------------------------------------------------------------------
; Draw a texture . . woo hoo!
; t0 - texture
;
; The texture coordinates need to be defined as follows:
; tc0 - texcoords
; c1 - self-illum tint
; c2 - envmap tint
;------------------------------------------------------------------------------
tex t0
tex t1
tex t2
tex t3
mul r0, t0, v0 ; base times vertex color (with alpha)
mul r0.rgb, t1, r0 ; fold in lighting (color only)
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
mul r1, t2, t3 ; envmap * envmapmask
mad r0.rgb, r1, c2, r0 ; + envmap * envmapmask * envmaptint (color only)

View File

@@ -1,20 +1,20 @@
ps.1.1
;------------------------------------------------------------------------------
; Draw a texture . . woo hoo!
; t0 - texture
;
; The texture coordinates need to be defined as follows:
; tc0 - texcoords
;------------------------------------------------------------------------------
def c2, 1.0f, 1.0f, 1.0f, 1.0f
tex t0
tex t1
; Blend between grey and lightmap color based on total alpha
mul_x2 r1.rgb, c0, t1 ; Apply overbright to lightmap
+ mul_sat r1.a, t0, v0 ; base times vertex alpha
lrp r0, r1.a, r1, c2 ; interpolate between white + color
ps.1.1
;------------------------------------------------------------------------------
; Draw a texture . . woo hoo!
; t0 - texture
;
; The texture coordinates need to be defined as follows:
; tc0 - texcoords
;------------------------------------------------------------------------------
def c2, 1.0f, 1.0f, 1.0f, 1.0f
tex t0
tex t1
; Blend between grey and lightmap color based on total alpha
mul_x2 r1.rgb, c0, t1 ; Apply overbright to lightmap
+ mul_sat r1.a, t0, v0 ; base times vertex alpha
lrp r0, r1.a, r1, c2 ; interpolate between white + color

View File

@@ -1,20 +1,20 @@
ps.1.1
;------------------------------------------------------------------------------
; Draw a texture . . woo hoo!
; t0 - texture
;
; The texture coordinates need to be defined as follows:
; tc0 - texcoords
;------------------------------------------------------------------------------
def c2, 1.0f, 1.0f, 1.0f, 1.0f
tex t0
tex t1
; Blend between grey and lightmap color based on total alpha
mul_x2 r1.rgb, c0, t1 ; Apply overbright to lightmap
+ mov_sat r1.a, v0 ; vertex alpha
lrp r0, r1.a, r1, c2 ; interpolate between white + color
ps.1.1
;------------------------------------------------------------------------------
; Draw a texture . . woo hoo!
; t0 - texture
;
; The texture coordinates need to be defined as follows:
; tc0 - texcoords
;------------------------------------------------------------------------------
def c2, 1.0f, 1.0f, 1.0f, 1.0f
tex t0
tex t1
; Blend between grey and lightmap color based on total alpha
mul_x2 r1.rgb, c0, t1 ; Apply overbright to lightmap
+ mov_sat r1.a, v0 ; vertex alpha
lrp r0, r1.a, r1, c2 ; interpolate between white + color

View File

@@ -1,23 +1,23 @@
ps.1.1
;------------------------------------------------------------------------------
; Draw a texture . . woo hoo!
; t0 - texture
;
; The texture coordinates need to be defined as follows:
; tc0 - texcoords
;------------------------------------------------------------------------------
def c2, 1.0f, 1.0f, 1.0f, 1.0f
tex t0
tex t1
; Blend between white and lightmap color based on total alpha
mul_x2 r1.rgb, c0, t1 ; Apply overbright to lightmap
+ mov_sat r1.a, v0 ; opacity == vertex opacity (no alpha in texture)
lrp r0.rgb, t0.a, c1, r1 ; Blend between self-illum + lightmap
+ mov r0.a, c2.a
lrp r0.rgb, r1.a, r0, c2 ; interpolate between white + color
ps.1.1
;------------------------------------------------------------------------------
; Draw a texture . . woo hoo!
; t0 - texture
;
; The texture coordinates need to be defined as follows:
; tc0 - texcoords
;------------------------------------------------------------------------------
def c2, 1.0f, 1.0f, 1.0f, 1.0f
tex t0
tex t1
; Blend between white and lightmap color based on total alpha
mul_x2 r1.rgb, c0, t1 ; Apply overbright to lightmap
+ mov_sat r1.a, v0 ; opacity == vertex opacity (no alpha in texture)
lrp r0.rgb, t0.a, c1, r1 ; Blend between self-illum + lightmap
+ mov r0.a, c2.a
lrp r0.rgb, r1.a, r0, c2 ; interpolate between white + color

View File

@@ -1,14 +1,14 @@
ps.1.1
;------------------------------------------------------------------------------
; Draw a texture . . woo hoo!
; t0 - texture
;
; The texture coordinates need to be defined as follows:
; tc0 - texcoords
;------------------------------------------------------------------------------
tex t1
mul r0.rgb, t1, v0 + ; base times vertex color (with alpha)
mov r0.a, v0.a
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
ps.1.1
;------------------------------------------------------------------------------
; Draw a texture . . woo hoo!
; t0 - texture
;
; The texture coordinates need to be defined as follows:
; tc0 - texcoords
;------------------------------------------------------------------------------
tex t1
mul r0.rgb, t1, v0 + ; base times vertex color (with alpha)
mov r0.a, v0.a
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)

View File

@@ -1,34 +1,34 @@
ps.1.1
def c0, 1,0,0,0
def c1, 0,1,0,0
def c2, 0,0,1,0
;------------------------------------------------------------------------------
; 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
;------------------------------------------------------------------------------
; Get the 3-vector from the normal map
tex t0
; Sample the lightmaps
tex t1
tex t2
tex t3
; output = lightmapColor[0] * n.r + lightmapColor[1] * n.g + lightmapColor[2] * n.b
mov r0, t0
dp3 r1, t0, c0
mul r0.rgb, r1, t1
dp3 r1, t0, c1
mad r0.rgb, r1, t2, r0
dp3 r1, t0, c2
mad r0.rgb, r1, t3, r0
ps.1.1
def c0, 1,0,0,0
def c1, 0,1,0,0
def c2, 0,0,1,0
;------------------------------------------------------------------------------
; 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
;------------------------------------------------------------------------------
; Get the 3-vector from the normal map
tex t0
; Sample the lightmaps
tex t1
tex t2
tex t3
; output = lightmapColor[0] * n.r + lightmapColor[1] * n.g + lightmapColor[2] * n.b
mov r0, t0
dp3 r1, t0, c0
mul r0.rgb, r1, t1
dp3 r1, t0, c1
mad r0.rgb, r1, t2, r0
dp3 r1, t0, c2
mad r0.rgb, r1, t3, r0

View File

@@ -1,21 +1,21 @@
ps.1.1
;------------------------------------------------------------------------------
; Draw a texture . . woo hoo!
; t0 - texture
;
; The texture coordinates need to be defined as follows:
; tc0 - texcoords
;------------------------------------------------------------------------------
tex t0
tex t1
mul r0.rgb, t0, v0 + ; base times vertex color (no alpha)
mov r0.a, v0.a ; Grab alpha from vertex color
mul r0.rgb, t1, r0 ; fold in lighting (color only)
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
mul r1, c1, t0 ; Self illum * tint
lrp r0.rgb, t0.a, r1, r0 ; Blend between self-illum + base * lightmap
ps.1.1
;------------------------------------------------------------------------------
; Draw a texture . . woo hoo!
; t0 - texture
;
; The texture coordinates need to be defined as follows:
; tc0 - texcoords
;------------------------------------------------------------------------------
tex t0
tex t1
mul r0.rgb, t0, v0 + ; base times vertex color (no alpha)
mov r0.a, v0.a ; Grab alpha from vertex color
mul r0.rgb, t1, r0 ; fold in lighting (color only)
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
mul r1, c1, t0 ; Self illum * tint
lrp r0.rgb, t0.a, r1, r0 ; Blend between self-illum + base * lightmap

View File

@@ -1,27 +1,27 @@
ps.1.1
;------------------------------------------------------------------------------
; Draw a texture . . woo hoo!
; t0 - texture
;
; The texture coordinates need to be defined as follows:
; tc0 - texcoords
; c1 - self-illum tint
; c2 - envmap tint
;------------------------------------------------------------------------------
tex t0
tex t1
tex t2
mul r0.rgb, t0, v0 + ; base times vertex color (no alpha)
mov r0.a, v0.a ; Grab alpha from vertex color
mul r1, t0.a, t0 ; Self illum
mad r1, c1, r1, t1 ; Self illum * tint + lightmap
mul r0.rgb, r1, r0 ; fold in lighting (color only)
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
mad r0.rgb, t2, c2, r0 ; + envmap * envmaptint (color only)
ps.1.1
;------------------------------------------------------------------------------
; Draw a texture . . woo hoo!
; t0 - texture
;
; The texture coordinates need to be defined as follows:
; tc0 - texcoords
; c1 - self-illum tint
; c2 - envmap tint
;------------------------------------------------------------------------------
tex t0
tex t1
tex t2
mul r0.rgb, t0, v0 + ; base times vertex color (no alpha)
mov r0.a, v0.a ; Grab alpha from vertex color
mul r1, t0.a, t0 ; Self illum
mad r1, c1, r1, t1 ; Self illum * tint + lightmap
mul r0.rgb, r1, r0 ; fold in lighting (color only)
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
mad r0.rgb, t2, c2, r0 ; + envmap * envmaptint (color only)

View File

@@ -1,28 +1,28 @@
ps.1.1
;------------------------------------------------------------------------------
; Draw a texture . . woo hoo!
; t0 - texture
;
; The texture coordinates need to be defined as follows:
; tc0 - texcoords
; c1 - self-illum tint
; c2 - envmap tint
;------------------------------------------------------------------------------
tex t0
tex t1
tex t2
tex t3
mul r0.rgb, t0, v0 + ; base times vertex color (with alpha)
mov r0.a, v0.a ; Grab alpha from vertex color
mul r1, c1, t0.a ; Self illum alpha * tint
mad r1, t0, r1, t1 ; Self illum * tint + lightmap
mul r0.rgb, r1, r0 ; fold in lighting (color only)
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
mul r1, t2, t3 ; envmap * envmapmask
mad r0.rgb, r1, c2, r0 ; + envmap * envmapmask * envmaptint (color only)
ps.1.1
;------------------------------------------------------------------------------
; Draw a texture . . woo hoo!
; t0 - texture
;
; The texture coordinates need to be defined as follows:
; tc0 - texcoords
; c1 - self-illum tint
; c2 - envmap tint
;------------------------------------------------------------------------------
tex t0
tex t1
tex t2
tex t3
mul r0.rgb, t0, v0 + ; base times vertex color (with alpha)
mov r0.a, v0.a ; Grab alpha from vertex color
mul r1, c1, t0.a ; Self illum alpha * tint
mad r1, t0, r1, t1 ; Self illum * tint + lightmap
mul r0.rgb, r1, r0 ; fold in lighting (color only)
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
mul r1, t2, t3 ; envmap * envmapmask
mad r0.rgb, r1, c2, r0 ; + envmap * envmapmask * envmaptint (color only)

View File

@@ -1,36 +1,36 @@
; STATIC: "REFRACTTINTTEXTURE" "0..1"
; STATIC: "NORMALMAPALPHA" "0..1"
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
#if REFRACTTINTTEXTURE
tex t2
#endif
#if NORMALMAPALPHA
tex t3
#endif
; refracttint
#if REFRACTTINTTEXTURE
mul_x2 r0, t1, t2
#else
mov r0, t1
#endif
#if NORMALMAPALPHA
mul r0.rgb, r0, c0 +
mov r0.a, t3.a
#else
mul r0.rgb, r0, c0
#endif
; STATIC: "REFRACTTINTTEXTURE" "0..1"
; STATIC: "NORMALMAPALPHA" "0..1"
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
#if REFRACTTINTTEXTURE
tex t2
#endif
#if NORMALMAPALPHA
tex t3
#endif
; refracttint
#if REFRACTTINTTEXTURE
mul_x2 r0, t1, t2
#else
mov r0, t1
#endif
#if NORMALMAPALPHA
mul r0.rgb, r0, c0 +
mov r0.a, t3.a
#else
mul r0.rgb, r0, c0
#endif

View File

@@ -1,22 +1,22 @@
ps.1.1
;------------------------------------------------------------------------------
; Draw a texture . . woo hoo!
; t0 - texture
;
; The texture coordinates need to be defined as follows:
; tc0 - texcoords
;------------------------------------------------------------------------------
def c0,1.0f, 1.0f, 1.0f, 1.0f
tex t0 ; shadow color
texkill t1 ; Clip
texkill t2
texkill t3 ; backface cull
; Darkening equation, compute a color = (shadow color * shadow alpha + 1- shadow alpha)
;sub r1, t0, v0.a ; r1 = shadow alpha
lrp r0.rgb, t0.a, v0, c0 + ; r0.rgb = (shadow color * shadow alpha + 1 - shadow alpha)
mov r0.a, c0.a ; r0.a = 1
ps.1.1
;------------------------------------------------------------------------------
; Draw a texture . . woo hoo!
; t0 - texture
;
; The texture coordinates need to be defined as follows:
; tc0 - texcoords
;------------------------------------------------------------------------------
def c0,1.0f, 1.0f, 1.0f, 1.0f
tex t0 ; shadow color
texkill t1 ; Clip
texkill t2
texkill t3 ; backface cull
; Darkening equation, compute a color = (shadow color * shadow alpha + 1- shadow alpha)
;sub r1, t0, v0.a ; r1 = shadow alpha
lrp r0.rgb, t0.a, v0, c0 + ; r0.rgb = (shadow color * shadow alpha + 1 - shadow alpha)
mov r0.a, c0.a ; r0.a = 1

View File

@@ -1,13 +1,13 @@
ps.1.1
;------------------------------------------------------------------------------
; Draw a texture . . woo hoo!
; t0 - texture
;
; The texture coordinates need to be defined as follows:
; tc0 - texcoords
;------------------------------------------------------------------------------
tex t0 ; base color
ps.1.1
;------------------------------------------------------------------------------
; Draw a texture . . woo hoo!
; t0 - texture
;
; The texture coordinates need to be defined as follows:
; tc0 - texcoords
;------------------------------------------------------------------------------
tex t0 ; base color
mul r0, t0, v0

View File

@@ -1,19 +1,19 @@
ps.1.1
;------------------------------------------------------------------------------
; Draw a texture . . woo hoo!
; t0 - texture
;
; The texture coordinates need to be defined as follows:
; tc0 - texcoords
; c2 - envmaptint
;------------------------------------------------------------------------------
tex t0 ; base color
tex t1 ; cube map
tex t2 ; envmap mask
mul r0.rgb, t1, 1-t2.a ; can't use mad cause can't use 3 texture registers
mul r0.rgb, c2, r0 ; apply the envmaptint
mad r0.rgb, t0, v0, r0
+ mul r0.a, t0, v0
ps.1.1
;------------------------------------------------------------------------------
; Draw a texture . . woo hoo!
; t0 - texture
;
; The texture coordinates need to be defined as follows:
; tc0 - texcoords
; c2 - envmaptint
;------------------------------------------------------------------------------
tex t0 ; base color
tex t1 ; cube map
tex t2 ; envmap mask
mul r0.rgb, t1, 1-t2.a ; can't use mad cause can't use 3 texture registers
mul r0.rgb, c2, r0 ; apply the envmaptint
mad r0.rgb, t0, v0, r0
+ mul r0.a, t0, v0

View File

@@ -1,15 +1,15 @@
ps.1.1
;------------------------------------------------------------------------------
; Draw a texture . . woo hoo!
; t0 - texture
;
; The texture coordinates need to be defined as follows:
; tc0 - texcoords
;------------------------------------------------------------------------------
tex t0 ; base color
tex t3 ; detail texture
mul r0, t0, v0
ps.1.1
;------------------------------------------------------------------------------
; Draw a texture . . woo hoo!
; t0 - texture
;
; The texture coordinates need to be defined as follows:
; tc0 - texcoords
;------------------------------------------------------------------------------
tex t0 ; base color
tex t3 ; detail texture
mul r0, t0, v0
mul_x2 r0.rgb, r0, t3

View File

@@ -1,29 +1,29 @@
ps.1.1
;------------------------------------------------------------------------------
; Draw a texture . . woo hoo!
; t0 - texture
;
; The texture coordinates need to be defined as follows:
; tc0 - texcoords
; c2 - envmaptint
;------------------------------------------------------------------------------
tex t0 ; base color
tex t1 ; cube map
tex t2 ; envmap mask
tex t3 ; detail texture
; version 1: applies the mod2x *after* environment map
;mul r0.rgb, t1, 1-t2.a ; can't use mad cause can't use 3 texture registers
;mul r0.rgb, c2, r0 ; apply the envmaptint
;mad r0.rgb, t0, v0, r0
;+ mul r0.a, t0, v0
;mul_x2 r0.rgb, r0, t3 ; mod2x detail texture
; version 2: applies the mod2x *before* environment map
mul r0, t0, v0 ; Base times modulation color
mul_x2 r0.rgb, r0, t3 ; mod2x detail texture
mul r1, t1, 1-t2.a ; Have to invert the alpha for basealpha (feh!)
mul r1, c2, r1 ; apply the envmaptint
add r0.rgb, r0, r1 ; add in the envmap
ps.1.1
;------------------------------------------------------------------------------
; Draw a texture . . woo hoo!
; t0 - texture
;
; The texture coordinates need to be defined as follows:
; tc0 - texcoords
; c2 - envmaptint
;------------------------------------------------------------------------------
tex t0 ; base color
tex t1 ; cube map
tex t2 ; envmap mask
tex t3 ; detail texture
; version 1: applies the mod2x *after* environment map
;mul r0.rgb, t1, 1-t2.a ; can't use mad cause can't use 3 texture registers
;mul r0.rgb, c2, r0 ; apply the envmaptint
;mad r0.rgb, t0, v0, r0
;+ mul r0.a, t0, v0
;mul_x2 r0.rgb, r0, t3 ; mod2x detail texture
; version 2: applies the mod2x *before* environment map
mul r0, t0, v0 ; Base times modulation color
mul_x2 r0.rgb, r0, t3 ; mod2x detail texture
mul r1, t1, 1-t2.a ; Have to invert the alpha for basealpha (feh!)
mul r1, c2, r1 ; apply the envmaptint
add r0.rgb, r0, r1 ; add in the envmap

View File

@@ -1,25 +1,25 @@
ps.1.1
;------------------------------------------------------------------------------
; Draw a texture . . woo hoo!
; t0 - texture
;
; The texture coordinates need to be defined as follows:
; tc0 - texcoords
; c2 - envmaptint
;------------------------------------------------------------------------------
tex t0 ; base color
tex t1 ; cube map
tex t3 ; detail texture
; version 1: applies the mod2x *after* environment map
;mul r1, c2, t1
;mad r0.rgb, t0, v0, r1
;+ mul r0.a, t0, v0
;mul_x2 r0.rgb, r0, t3 ; mod2x detail texture
; version 2: applies the mod2x *before* environment map
mul r0, t0, v0 ; Base times modulation color
mul_x2 r0.rgb, r0, t3 ; mod2x detail texture
mad r0.rgb, c2, t1, r0 ; add in tinted envmap
ps.1.1
;------------------------------------------------------------------------------
; Draw a texture . . woo hoo!
; t0 - texture
;
; The texture coordinates need to be defined as follows:
; tc0 - texcoords
; c2 - envmaptint
;------------------------------------------------------------------------------
tex t0 ; base color
tex t1 ; cube map
tex t3 ; detail texture
; version 1: applies the mod2x *after* environment map
;mul r1, c2, t1
;mad r0.rgb, t0, v0, r1
;+ mul r0.a, t0, v0
;mul_x2 r0.rgb, r0, t3 ; mod2x detail texture
; version 2: applies the mod2x *before* environment map
mul r0, t0, v0 ; Base times modulation color
mul_x2 r0.rgb, r0, t3 ; mod2x detail texture
mad r0.rgb, c2, t1, r0 ; add in tinted envmap

View File

@@ -1,29 +1,29 @@
ps.1.1
;------------------------------------------------------------------------------
; Draw a texture . . woo hoo!
; t0 - texture
;
; The texture coordinates need to be defined as follows:
; tc0 - texcoords
; c2 - envmaptint
;------------------------------------------------------------------------------
tex t0 ; base color
tex t1 ; cube map
tex t2 ; envmap mask
tex t3 ; detail texture
; version 1: applies the mod2x *after* environment map
;mul r0.rgb, t1, t2 ; can't use mad cause can't use 3 texture registers
;mul r0.rgb, c2, r0 ; apply the envmaptint
;mad r0.rgb, t0, v0, r0
;+ mul r0.a, t0, v0
;mul_x2 r0.rgb, r0, t3 ; mod2x detail texture
; version 2: applies the mod2x *before* environment map
mul r0, t0, v0 ; Base times modulation color
mul_x2 r0.rgb, r0, t3 ; mod2x detail texture
mul r1, t1, t2 ; Envmap * envmapmask
mul r1, c2, r1 ; apply the envmaptint
add r0.rgb, r0, r1 ; add in the envmap
ps.1.1
;------------------------------------------------------------------------------
; Draw a texture . . woo hoo!
; t0 - texture
;
; The texture coordinates need to be defined as follows:
; tc0 - texcoords
; c2 - envmaptint
;------------------------------------------------------------------------------
tex t0 ; base color
tex t1 ; cube map
tex t2 ; envmap mask
tex t3 ; detail texture
; version 1: applies the mod2x *after* environment map
;mul r0.rgb, t1, t2 ; can't use mad cause can't use 3 texture registers
;mul r0.rgb, c2, r0 ; apply the envmaptint
;mad r0.rgb, t0, v0, r0
;+ mul r0.a, t0, v0
;mul_x2 r0.rgb, r0, t3 ; mod2x detail texture
; version 2: applies the mod2x *before* environment map
mul r0, t0, v0 ; Base times modulation color
mul_x2 r0.rgb, r0, t3 ; mod2x detail texture
mul r1, t1, t2 ; Envmap * envmapmask
mul r1, c2, r1 ; apply the envmaptint
add r0.rgb, r0, r1 ; add in the envmap

View File

@@ -1,21 +1,21 @@
ps.1.1
;------------------------------------------------------------------------------
; Draw a texture . . woo hoo!
; t0 - texture
;
; The texture coordinates need to be defined as follows:
; tc0 - texcoords
; c2 - envmaptint
;------------------------------------------------------------------------------
tex t1 ; cube map
tex t2 ; envmap mask
tex t3 ; detail texture
; version 1: applies the mod2x *after* environment map
; version 2 doesn't make sense here!
mul r0, t1, t2
mul r0.rgb, c2, r0
mul r0, r0, v0
ps.1.1
;------------------------------------------------------------------------------
; Draw a texture . . woo hoo!
; t0 - texture
;
; The texture coordinates need to be defined as follows:
; tc0 - texcoords
; c2 - envmaptint
;------------------------------------------------------------------------------
tex t1 ; cube map
tex t2 ; envmap mask
tex t3 ; detail texture
; version 1: applies the mod2x *after* environment map
; version 2 doesn't make sense here!
mul r0, t1, t2
mul r0.rgb, c2, r0
mul r0, r0, v0
mul_x2 r0.rgb, r0, t3 ; mod2x detail texture

View File

@@ -1,19 +1,19 @@
ps.1.1
;------------------------------------------------------------------------------
; Draw a texture . . woo hoo!
; t0 - texture
;
; The texture coordinates need to be defined as follows:
; tc0 - texcoords
; c2 - envmaptint
;------------------------------------------------------------------------------
tex t1 ; cube map
tex t3 ; detail texture
; version 1: applies the mod2x *after* environment map
; version 2 doesn't make sense here!
mul r0, v0, t1
mul r0.rgb, r0, c2
ps.1.1
;------------------------------------------------------------------------------
; Draw a texture . . woo hoo!
; t0 - texture
;
; The texture coordinates need to be defined as follows:
; tc0 - texcoords
; c2 - envmaptint
;------------------------------------------------------------------------------
tex t1 ; cube map
tex t3 ; detail texture
; version 1: applies the mod2x *after* environment map
; version 2 doesn't make sense here!
mul r0, v0, t1
mul r0.rgb, r0, c2
mul_x2 r0.rgb, r0, t3 ; mod2x detail texture

View File

@@ -1,10 +1,10 @@
ps.1.1
;------------------------------------------------------------------------------
; Just use the vertex color
;------------------------------------------------------------------------------
tex t3
mul_x2 r0.rgb, v0, t3
ps.1.1
;------------------------------------------------------------------------------
; Just use the vertex color
;------------------------------------------------------------------------------
tex t3
mul_x2 r0.rgb, v0, t3
+ mov r0.a, v0.a

View File

@@ -1,17 +1,17 @@
ps.1.1
;------------------------------------------------------------------------------
; Draw a texture . . woo hoo!
; t0 - texture
;
; The texture coordinates need to be defined as follows:
; tc0 - texcoords
; c2 - envmaptint
;------------------------------------------------------------------------------
tex t0 ; base color
tex t1 ; cube map
mul r1, c2, t1
mad r0.rgb, t0, v0, r1
+ mul r0.a, t0, v0
ps.1.1
;------------------------------------------------------------------------------
; Draw a texture . . woo hoo!
; t0 - texture
;
; The texture coordinates need to be defined as follows:
; tc0 - texcoords
; c2 - envmaptint
;------------------------------------------------------------------------------
tex t0 ; base color
tex t1 ; cube map
mul r1, c2, t1
mad r0.rgb, t0, v0, r1
+ mul r0.a, t0, v0

View File

@@ -1,19 +1,19 @@
ps.1.1
;------------------------------------------------------------------------------
; Draw a texture . . woo hoo!
; t0 - texture
;
; The texture coordinates need to be defined as follows:
; tc0 - texcoords
; c2 - envmaptint
;------------------------------------------------------------------------------
tex t0 ; base color
tex t1 ; cube map
tex t2 ; envmap mask
mul r0.rgb, t1, t2 ; can't use mad cause can't use 3 texture registers
mul r0.rgb, c2, r0 ; apply the envmaptint
mad r0.rgb, t0, v0, r0
+ mul r0.a, t0, v0
ps.1.1
;------------------------------------------------------------------------------
; Draw a texture . . woo hoo!
; t0 - texture
;
; The texture coordinates need to be defined as follows:
; tc0 - texcoords
; c2 - envmaptint
;------------------------------------------------------------------------------
tex t0 ; base color
tex t1 ; cube map
tex t2 ; envmap mask
mul r0.rgb, t1, t2 ; can't use mad cause can't use 3 texture registers
mul r0.rgb, c2, r0 ; apply the envmaptint
mad r0.rgb, t0, v0, r0
+ mul r0.a, t0, v0

View File

@@ -1,17 +1,17 @@
ps.1.1
;------------------------------------------------------------------------------
; Draw a texture . . woo hoo!
; t0 - texture
;
; The texture coordinates need to be defined as follows:
; tc0 - texcoords
; c2 - envmaptint
;------------------------------------------------------------------------------
tex t1 ; cube map
tex t2 ; envmap mask
mul r0, t1, t2
mul r0.rgb, c2, r0
mul r0, r0, v0
ps.1.1
;------------------------------------------------------------------------------
; Draw a texture . . woo hoo!
; t0 - texture
;
; The texture coordinates need to be defined as follows:
; tc0 - texcoords
; c2 - envmaptint
;------------------------------------------------------------------------------
tex t1 ; cube map
tex t2 ; envmap mask
mul r0, t1, t2
mul r0.rgb, c2, r0
mul r0, r0, v0

View File

@@ -1,15 +1,15 @@
ps.1.1
;------------------------------------------------------------------------------
; Draw a texture . . woo hoo!
; t0 - texture
;
; The texture coordinates need to be defined as follows:
; tc0 - texcoords
; c2 - envmaptint
;------------------------------------------------------------------------------
tex t1 ; cube map
mul r0, v0, t1
mul r0.rgb, r0, c2
ps.1.1
;------------------------------------------------------------------------------
; Draw a texture . . woo hoo!
; t0 - texture
;
; The texture coordinates need to be defined as follows:
; tc0 - texcoords
; c2 - envmaptint
;------------------------------------------------------------------------------
tex t1 ; cube map
mul r0, v0, t1
mul r0.rgb, r0, c2

View File

@@ -1,7 +1,7 @@
ps.1.1
;------------------------------------------------------------------------------
; Just use the vertex color
;------------------------------------------------------------------------------
mov r0, v0
ps.1.1
;------------------------------------------------------------------------------
; Just use the vertex color
;------------------------------------------------------------------------------
mov r0, v0

View File

@@ -1,13 +1,13 @@
; DYNAMIC: "WRITEONETODESTALPHA" "0..1"
ps.1.1
; Get the color from the texture
tex t0
mul r0, t0, c3
mul r0.rgb, v0, r0 ; Apply lighting
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
#if WRITEONETODESTALPHA
+mov r0.a, c4 ; make alpha 255
#endif
; DYNAMIC: "WRITEONETODESTALPHA" "0..1"
ps.1.1
; Get the color from the texture
tex t0
mul r0, t0, c3
mul r0.rgb, v0, r0 ; Apply lighting
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
#if WRITEONETODESTALPHA
+mov r0.a, c4 ; make alpha 255
#endif

View File

@@ -1,17 +1,17 @@
; DYNAMIC: "WRITEONETODESTALPHA" "0..1"
ps.1.1
tex t0 ; base color
tex t1 ; cube map
tex t2 ; envmap mask
mul r0, t0, c3 ; Base times modulation
mul r1, t1, 1-t2.a ; Envmap * mask (in alpha channel)
mul r0.rgb, v0, r0 ; apply vertex lighting
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
mad r0.rgb, r1, c2, r0 ; + envmap * mask * tint
#if WRITEONETODESTALPHA
+mov r0.a, c4 ; make alpha 255
#endif
; DYNAMIC: "WRITEONETODESTALPHA" "0..1"
ps.1.1
tex t0 ; base color
tex t1 ; cube map
tex t2 ; envmap mask
mul r0, t0, c3 ; Base times modulation
mul r1, t1, 1-t2.a ; Envmap * mask (in alpha channel)
mul r0.rgb, v0, r0 ; apply vertex lighting
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
mad r0.rgb, r1, c2, r0 ; + envmap * mask * tint
#if WRITEONETODESTALPHA
+mov r0.a, c4 ; make alpha 255
#endif

View File

@@ -1,17 +1,17 @@
; DYNAMIC: "WRITEONETODESTALPHA" "0..1"
ps.1.1
; Get the color from the texture
tex t0
mul r0, c3, t0
lrp r0.rgb, c1, c3, r0
lrp r0.rgb, t0.a, r0, t0
mul r0.rgb, v0, r0 ; Apply lighting
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
#if WRITEONETODESTALPHA
+mov r0.a, c4 ; make alpha 255
#else
+mov r0.a, c3
#endif
; DYNAMIC: "WRITEONETODESTALPHA" "0..1"
ps.1.1
; Get the color from the texture
tex t0
mul r0, c3, t0
lrp r0.rgb, c1, c3, r0
lrp r0.rgb, t0.a, r0, t0
mul r0.rgb, v0, r0 ; Apply lighting
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
#if WRITEONETODESTALPHA
+mov r0.a, c4 ; make alpha 255
#else
+mov r0.a, c3
#endif

View File

@@ -1,16 +1,16 @@
; DYNAMIC: "WRITEONETODESTALPHA" "0..1"
ps.1.1
; Get the color from the texture
tex t0
tex t3
mul r0, t0, c3
mul r0.rgb, v0, r0 ; Apply lighting
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
mul_x2 r1.rgb, r0, t3 ; detail texture
lrp r0.rgb, c1, r1, r0
#if WRITEONETODESTALPHA
+mov r0.a, c4 ; make alpha 255
#endif
; DYNAMIC: "WRITEONETODESTALPHA" "0..1"
ps.1.1
; Get the color from the texture
tex t0
tex t3
mul r0, t0, c3
mul r0.rgb, v0, r0 ; Apply lighting
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
mul_x2 r1.rgb, r0, t3 ; detail texture
lrp r0.rgb, c1, r1, r0
#if WRITEONETODESTALPHA
+mov r0.a, c4 ; make alpha 255
#endif

View File

@@ -1,18 +1,18 @@
; DYNAMIC: "WRITEONETODESTALPHA" "0..1"
ps.1.1
tex t0 ; base color
tex t1 ; cube map
tex t2 ; envmap mask
tex t3 ; detail texture
mul r0, t0, c3 ; Base times modulation
mul r1, t1, 1-t2.a ; Envmap * mask (in alpha channel)
mul r0.rgb, v0, r0 ; apply vertex lighting
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
mul_x2 r0.rgb, r0, t3 ; detail texture
mad r0.rgb, r1, c2, r0 ; + envmap * mask * tint
#if WRITEONETODESTALPHA
+mov r0.a, c4 ; make alpha 255
#endif
; DYNAMIC: "WRITEONETODESTALPHA" "0..1"
ps.1.1
tex t0 ; base color
tex t1 ; cube map
tex t2 ; envmap mask
tex t3 ; detail texture
mul r0, t0, c3 ; Base times modulation
mul r1, t1, 1-t2.a ; Envmap * mask (in alpha channel)
mul r0.rgb, v0, r0 ; apply vertex lighting
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
mul_x2 r0.rgb, r0, t3 ; detail texture
mad r0.rgb, r1, c2, r0 ; + envmap * mask * tint
#if WRITEONETODESTALPHA
+mov r0.a, c4 ; make alpha 255
#endif

View File

@@ -1,16 +1,16 @@
; DYNAMIC: "WRITEONETODESTALPHA" "0..1"
ps.1.1
tex t0 ; base color
tex t1 ; cube map
tex t3 ; detail texture
mul r0, t0, c3 ; base times modulation
mul r0.rgb, v0, r0 ; apply vertex lighting
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
mul_x2 r0.rgb, r0, t3 ; detail texture
mad r0.rgb, t1, c2, r0 ; + envmap * envmaptint (color only)
#if WRITEONETODESTALPHA
+mov r0.a, c4 ; make alpha 255
#endif
; DYNAMIC: "WRITEONETODESTALPHA" "0..1"
ps.1.1
tex t0 ; base color
tex t1 ; cube map
tex t3 ; detail texture
mul r0, t0, c3 ; base times modulation
mul r0.rgb, v0, r0 ; apply vertex lighting
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
mul_x2 r0.rgb, r0, t3 ; detail texture
mad r0.rgb, t1, c2, r0 ; + envmap * envmaptint (color only)
#if WRITEONETODESTALPHA
+mov r0.a, c4 ; make alpha 255
#endif

View File

@@ -1,18 +1,18 @@
; DYNAMIC: "WRITEONETODESTALPHA" "0..1"
ps.1.1
tex t0 ; base color
tex t1 ; cube map
tex t2 ; envmap mask
tex t3 ; detail texture
mul r0, t0, c3 ; Base times modulation
mul r1, t1, t2 ; Envmap * mask
mul r0.rgb, v0, r0 ; apply vertex lighting
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
mul_x2 r0.rgb, r0, t3 ; detail texture
mad r0.rgb, r1, c2, r0 ; + envmap * mask * tint
#if WRITEONETODESTALPHA
+mov r0.a, c4 ; make alpha 255
#endif
; DYNAMIC: "WRITEONETODESTALPHA" "0..1"
ps.1.1
tex t0 ; base color
tex t1 ; cube map
tex t2 ; envmap mask
tex t3 ; detail texture
mul r0, t0, c3 ; Base times modulation
mul r1, t1, t2 ; Envmap * mask
mul r0.rgb, v0, r0 ; apply vertex lighting
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
mul_x2 r0.rgb, r0, t3 ; detail texture
mad r0.rgb, r1, c2, r0 ; + envmap * mask * tint
#if WRITEONETODESTALPHA
+mov r0.a, c4 ; make alpha 255
#endif

View File

@@ -1,12 +1,12 @@
; DYNAMIC: "WRITEONETODESTALPHA" "0..1"
ps.1.1
tex t3
mul r0, v0, c3
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
mul_x2 r0.rgb, r0, t3 ; detail texture
#if WRITEONETODESTALPHA
+mov r0.a, c4 ; make alpha 255
#endif
; DYNAMIC: "WRITEONETODESTALPHA" "0..1"
ps.1.1
tex t3
mul r0, v0, c3
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
mul_x2 r0.rgb, r0, t3 ; detail texture
#if WRITEONETODESTALPHA
+mov r0.a, c4 ; make alpha 255
#endif

View File

@@ -1,22 +1,22 @@
; DYNAMIC: "WRITEONETODESTALPHA" "0..1"
ps.1.1
; Get the color from the texture
tex t0
tex t3
; interpolate between illuminated + non-selfilluminated
mul r0.rgb, t0, c3 + ; base times modulation
mov r0.a, c3.a
mul r0.rgb, v0, r0 ; Apply lighting
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
mul_x2 r0.rgb, r0, t3 ; detail texture
mul r1, t0, c1 ; Self illum * tint
lrp r0.rgb, t0.a, r1, r0 ; Blend between self-illum + base * lighting
#if WRITEONETODESTALPHA
mov r0.a, c4 ; make alpha 255
#endif
; DYNAMIC: "WRITEONETODESTALPHA" "0..1"
ps.1.1
; Get the color from the texture
tex t0
tex t3
; interpolate between illuminated + non-selfilluminated
mul r0.rgb, t0, c3 + ; base times modulation
mov r0.a, c3.a
mul r0.rgb, v0, r0 ; Apply lighting
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
mul_x2 r0.rgb, r0, t3 ; detail texture
mul r1, t0, c1 ; Self illum * tint
lrp r0.rgb, t0.a, r1, r0 ; Blend between self-illum + base * lighting
#if WRITEONETODESTALPHA
mov r0.a, c4 ; make alpha 255
#endif

View File

@@ -1,24 +1,24 @@
; DYNAMIC: "WRITEONETODESTALPHA" "0..1"
ps.1.1
; Get the color from the texture
tex t0
tex t1
tex t3
mul r0.rgb, t0, c3 + ; base times modulation
mov r0.a, c3.a ; use modulation alpha (don't use texture alpha)
mul r0.rgb, v0, r0 ; Apply lighting
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
mul_x2 r0.rgb, r0, t3 ; detail texture
mul r1, t0, c1 ; Self illum * tint
lrp r0.rgb, t0.a, r1, r0 ; Blend between self-illum + base * lighting
mad r0.rgb, t1, c2, r0 ; + envmap * envmaptint (color only)
#if WRITEONETODESTALPHA
+mov r0.a, c4 ; make alpha 255
#endif
; DYNAMIC: "WRITEONETODESTALPHA" "0..1"
ps.1.1
; Get the color from the texture
tex t0
tex t1
tex t3
mul r0.rgb, t0, c3 + ; base times modulation
mov r0.a, c3.a ; use modulation alpha (don't use texture alpha)
mul r0.rgb, v0, r0 ; Apply lighting
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
mul_x2 r0.rgb, r0, t3 ; detail texture
mul r1, t0, c1 ; Self illum * tint
lrp r0.rgb, t0.a, r1, r0 ; Blend between self-illum + base * lighting
mad r0.rgb, t1, c2, r0 ; + envmap * envmaptint (color only)
#if WRITEONETODESTALPHA
+mov r0.a, c4 ; make alpha 255
#endif

View File

@@ -1,26 +1,26 @@
; DYNAMIC: "WRITEONETODESTALPHA" "0..1"
ps.1.1
; Get the color from the texture
tex t0 ; base
tex t1 ; env map
tex t2 ; mask
tex t3 ; detail
mul r0.rgb, t0, c3 + ; base times modulation
mul r0.a, c3.a, t2.a ; alpha = mod alpha * mask alpha
mul r0.rgb, v0, r0 ; Apply lighting
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
mul_x2 r0.rgb, r0, t3 ; detail texture
mul r1, t0, c1 ; Self illum * tint
lrp r0.rgb, t0.a, r1, r0 ; Blend between self-illum + base * lighting
mul r1, t2, t1 ; envmapmask * envmap
mad r0.rgb, r1, c2, r0 ; + envmapmask * envmap * envmaptint (color only)
#if WRITEONETODESTALPHA
+mov r0.a, c4 ; make alpha 255
#endif
; DYNAMIC: "WRITEONETODESTALPHA" "0..1"
ps.1.1
; Get the color from the texture
tex t0 ; base
tex t1 ; env map
tex t2 ; mask
tex t3 ; detail
mul r0.rgb, t0, c3 + ; base times modulation
mul r0.a, c3.a, t2.a ; alpha = mod alpha * mask alpha
mul r0.rgb, v0, r0 ; Apply lighting
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
mul_x2 r0.rgb, r0, t3 ; detail texture
mul r1, t0, c1 ; Self illum * tint
lrp r0.rgb, t0.a, r1, r0 ; Blend between self-illum + base * lighting
mul r1, t2, t1 ; envmapmask * envmap
mad r0.rgb, r1, c2, r0 ; + envmapmask * envmap * envmaptint (color only)
#if WRITEONETODESTALPHA
+mov r0.a, c4 ; make alpha 255
#endif

View File

@@ -1,15 +1,15 @@
; DYNAMIC: "WRITEONETODESTALPHA" "0..1"
ps.1.1
; Get the color from the texture
tex t0
tex t3
lrp r0, c1, t3, t0 ; Lerp between textures
mul r0, r0, c3
mul r0.rgb, v0, r0 ; Apply lighting
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
#if WRITEONETODESTALPHA
+mov r0.a, c4 ; make alpha 255
#endif
; DYNAMIC: "WRITEONETODESTALPHA" "0..1"
ps.1.1
; Get the color from the texture
tex t0
tex t3
lrp r0, c1, t3, t0 ; Lerp between textures
mul r0, r0, c3
mul r0.rgb, v0, r0 ; Apply lighting
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
#if WRITEONETODESTALPHA
+mov r0.a, c4 ; make alpha 255
#endif

View File

@@ -1,15 +1,15 @@
; DYNAMIC: "WRITEONETODESTALPHA" "0..1"
ps.1.1
; Get the color from the texture
tex t0
tex t3
mul r1, c1, t3
mad r0, t0, c3, r1
mul r0.rgb, v0, r0 ; Apply lighting
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
#if WRITEONETODESTALPHA
+mov r0.a, c4 ; make alpha 255
#endif
; DYNAMIC: "WRITEONETODESTALPHA" "0..1"
ps.1.1
; Get the color from the texture
tex t0
tex t3
mul r1, c1, t3
mad r0, t0, c3, r1
mul r0.rgb, v0, r0 ; Apply lighting
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
#if WRITEONETODESTALPHA
+mov r0.a, c4 ; make alpha 255
#endif

View File

@@ -1,15 +1,15 @@
; DYNAMIC: "WRITEONETODESTALPHA" "0..1"
ps.1.1
; Get the color from the texture
tex t0
tex t3
mul r0, c3, t0
mul r0.rgb, v0, r0 ; Apply lighting
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
mad r0.rgb, c1, t3, r0
#if WRITEONETODESTALPHA
+mov r0.a, c4 ; make alpha 255
#endif
; DYNAMIC: "WRITEONETODESTALPHA" "0..1"
ps.1.1
; Get the color from the texture
tex t0
tex t3
mul r0, c3, t0
mul r0.rgb, v0, r0 ; Apply lighting
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
mad r0.rgb, c1, t3, r0
#if WRITEONETODESTALPHA
+mov r0.a, c4 ; make alpha 255
#endif

View File

@@ -1,14 +1,14 @@
; DYNAMIC: "WRITEONETODESTALPHA" "0..1"
ps.1.1
tex t1 ; cube map
mul r0.rgb, t1, c2 + ; envmap * envmaptint (color only) +
mov r0.a, c3.a ; Use alpha from modulation... (?)
mul r0.rgb, v0, r0 ; apply vertex lighting
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
#if WRITEONETODESTALPHA
+mov r0.a, c4 ; make alpha 255
#endif
; DYNAMIC: "WRITEONETODESTALPHA" "0..1"
ps.1.1
tex t1 ; cube map
mul r0.rgb, t1, c2 + ; envmap * envmaptint (color only) +
mov r0.a, c3.a ; Use alpha from modulation... (?)
mul r0.rgb, v0, r0 ; apply vertex lighting
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
#if WRITEONETODESTALPHA
+mov r0.a, c4 ; make alpha 255
#endif

View File

@@ -1,14 +1,14 @@
; DYNAMIC: "WRITEONETODESTALPHA" "0..1"
ps.1.1
tex t0 ; base color
tex t1 ; cube map
mul r0, t0, c3 ; base times modulation
mul r0.rgb, v0, r0 ; apply vertex lighting
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
mad r0.rgb, t1, c2, r0 ; + envmap * envmaptint (color only)
#if WRITEONETODESTALPHA
+mov r0.a, c4 ; make alpha 255
#endif
; DYNAMIC: "WRITEONETODESTALPHA" "0..1"
ps.1.1
tex t0 ; base color
tex t1 ; cube map
mul r0, t0, c3 ; base times modulation
mul r0.rgb, v0, r0 ; apply vertex lighting
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
mad r0.rgb, t1, c2, r0 ; + envmap * envmaptint (color only)
#if WRITEONETODESTALPHA
+mov r0.a, c4 ; make alpha 255
#endif

View File

@@ -1,36 +1,36 @@
ps.1.1
;------------------------------------------------------------------------------
; Environment mapping on a bumped surface
; t0 - Normalmap
; t3 - Cube environment map (*must* be a cube map!)
;
; c0 - color to multiply the results by
; Input texture coords required here are a little wonky.
; tc0.uv <- U,V into the normal map
; tc1.uvw, tc2.uvw, tc3.uvw <- 3x3 matrix transform
; from tangent space->env map space
; tc1.q, tc2.q, tc3.q <- eye vector in env map space
;------------------------------------------------------------------------------
; This version doesn't multiply by lighting.
; Get the 3-vector from the normal map
tex t0
; Perform matrix multiply to get a local normal bump. Then
; reflect the eye vector through the normal and sample from
; a cubic environment map.
texm3x3pad t1, t0_bx2
texm3x3pad t2, t0_bx2
texm3x3vspec t3, t0_bx2
; result goes in output color
mul r0.rgb, t3, c0 ; constant color
+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
ps.1.1
;------------------------------------------------------------------------------
; Environment mapping on a bumped surface
; t0 - Normalmap
; t3 - Cube environment map (*must* be a cube map!)
;
; c0 - color to multiply the results by
; Input texture coords required here are a little wonky.
; tc0.uv <- U,V into the normal map
; tc1.uvw, tc2.uvw, tc3.uvw <- 3x3 matrix transform
; from tangent space->env map space
; tc1.q, tc2.q, tc3.q <- eye vector in env map space
;------------------------------------------------------------------------------
; This version doesn't multiply by lighting.
; Get the 3-vector from the normal map
tex t0
; Perform matrix multiply to get a local normal bump. Then
; reflect the eye vector through the normal and sample from
; a cubic environment map.
texm3x3pad t1, t0_bx2
texm3x3pad t2, t0_bx2
texm3x3vspec t3, t0_bx2
; result goes in output color
mul r0.rgb, t3, c0 ; constant color
+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

View File

@@ -1,42 +1,42 @@
ps.1.1
;------------------------------------------------------------------------------
; Environment mapping on a bumped surface
; t0 - Normalmap
; t3 - Cube environment map (*must* be a cube map!)
;
; c0 - color to multiply the results by
; Input texture coords required here are a little wonky.
; tc0.uv <- U,V into the normal map
; tc1.uvw, tc2.uvw, tc3.uvw <- 3x3 matrix transform
; from tangent space->env map space
; tc1.q, tc2.q, tc3.q <- eye vector in env map space
;------------------------------------------------------------------------------
; This version doesn't multiply by lighting.
; Get the 3-vector from the normal map
tex t0
; Perform matrix multiply to get a local normal bump. Then
; reflect the eye vector through the normal and sample from
; a cubic environment map.
texm3x3pad t1, t0_bx2
texm3x3pad t2, t0_bx2
texm3x3vspec t3, t0_bx2
; result goes in output color
mul r0.rgb, t3, c0 ; constant color
+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
; Multiply the output color by the alpha channel of the normal map.
mul r0.rgb, t0.a, r0
ps.1.1
;------------------------------------------------------------------------------
; Environment mapping on a bumped surface
; t0 - Normalmap
; t3 - Cube environment map (*must* be a cube map!)
;
; c0 - color to multiply the results by
; Input texture coords required here are a little wonky.
; tc0.uv <- U,V into the normal map
; tc1.uvw, tc2.uvw, tc3.uvw <- 3x3 matrix transform
; from tangent space->env map space
; tc1.q, tc2.q, tc3.q <- eye vector in env map space
;------------------------------------------------------------------------------
; This version doesn't multiply by lighting.
; Get the 3-vector from the normal map
tex t0
; Perform matrix multiply to get a local normal bump. Then
; reflect the eye vector through the normal and sample from
; a cubic environment map.
texm3x3pad t1, t0_bx2
texm3x3pad t2, t0_bx2
texm3x3vspec t3, t0_bx2
; result goes in output color
mul r0.rgb, t3, c0 ; constant color
+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
; Multiply the output color by the alpha channel of the normal map.
mul r0.rgb, t0.a, r0

View File

@@ -1,42 +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
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

View File

@@ -1,39 +1,39 @@
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!!!
; 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
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!!!
; 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

View File

@@ -1,15 +1,15 @@
; DYNAMIC: "WRITEONETODESTALPHA" "0..1"
ps.1.1
tex t1 ; cube map
tex t2 ; envmap mask
mul r1, t1, t2 ; Envmap * mask
mul r0.rgb, r1, c2 ; envmap * mask * tint
mul r0.rgb, v0, r0 ; apply vertex lighting
mul_x2 r0.rgb, c0, r0 + ; * 2 * (overbrightFactor/2)
mul r0.a, c3.a, t2.a ; alpha = modulation * mask alpha
#if WRITEONETODESTALPHA
mov r0.a, c4 ; make alpha 255
#endif
; DYNAMIC: "WRITEONETODESTALPHA" "0..1"
ps.1.1
tex t1 ; cube map
tex t2 ; envmap mask
mul r1, t1, t2 ; Envmap * mask
mul r0.rgb, r1, c2 ; envmap * mask * tint
mul r0.rgb, v0, r0 ; apply vertex lighting
mul_x2 r0.rgb, c0, r0 + ; * 2 * (overbrightFactor/2)
mul r0.a, c3.a, t2.a ; alpha = modulation * mask alpha
#if WRITEONETODESTALPHA
mov r0.a, c4 ; make alpha 255
#endif

View File

@@ -1,16 +1,16 @@
; DYNAMIC: "WRITEONETODESTALPHA" "0..1"
ps.1.1
tex t0 ; base color
tex t1 ; cube map
tex t2 ; envmap mask
mul r0, t0, c3 ; Base times modulation
mul r1, t1, t2 ; Envmap * mask
mul r0.rgb, v0, r0 ; apply vertex lighting
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
mad r0.rgb, r1, c2, r0 ; + envmap * mask * tint
#if WRITEONETODESTALPHA
+mov r0.a, c4 ; make alpha 255
#endif
; DYNAMIC: "WRITEONETODESTALPHA" "0..1"
ps.1.1
tex t0 ; base color
tex t1 ; cube map
tex t2 ; envmap mask
mul r0, t0, c3 ; Base times modulation
mul r1, t1, t2 ; Envmap * mask
mul r0.rgb, v0, r0 ; apply vertex lighting
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
mad r0.rgb, r1, c2, r0 ; + envmap * mask * tint
#if WRITEONETODESTALPHA
+mov r0.a, c4 ; make alpha 255
#endif

View File

@@ -1,9 +1,9 @@
; DYNAMIC: "WRITEONETODESTALPHA" "0..1"
ps.1.1
mul r0, v0, c3
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
#if WRITEONETODESTALPHA
+mov r0.a, c4 ; make alpha 255
#endif
; DYNAMIC: "WRITEONETODESTALPHA" "0..1"
ps.1.1
mul r0, v0, c3
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
#if WRITEONETODESTALPHA
+mov r0.a, c4 ; make alpha 255
#endif

View File

@@ -1,5 +1,5 @@
ps.1.1
tex t0
mul r0.rgba, c0, t0
ps.1.1
tex t0
mul r0.rgba, c0, t0

View File

@@ -1,19 +1,19 @@
; DYNAMIC: "WRITEONETODESTALPHA" "0..1"
ps.1.1
; Get the color from the texture
tex t0
; interpolate between illuminated + non-selfilluminated
mul r0.rgb, t0, c3 + ; base times modulation
mov r0.a, c3.a
mul r0.rgb, v0, r0 ; Apply lighting
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
mul r1, t0, c1 ; Self illum * tint
lrp r0.rgb, t0.a, r1, r0 ; Blend between self-illum + base * lighting
#if WRITEONETODESTALPHA
+mov r0.a, c4 ; make alpha 255
#endif
; DYNAMIC: "WRITEONETODESTALPHA" "0..1"
ps.1.1
; Get the color from the texture
tex t0
; interpolate between illuminated + non-selfilluminated
mul r0.rgb, t0, c3 + ; base times modulation
mov r0.a, c3.a
mul r0.rgb, v0, r0 ; Apply lighting
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
mul r1, t0, c1 ; Self illum * tint
lrp r0.rgb, t0.a, r1, r0 ; Blend between self-illum + base * lighting
#if WRITEONETODESTALPHA
+mov r0.a, c4 ; make alpha 255
#endif

View File

@@ -1,21 +1,21 @@
; DYNAMIC: "WRITEONETODESTALPHA" "0..1"
ps.1.1
; Get the color from the texture
tex t0
tex t1
mul r0.rgb, t0, c3 + ; base times modulation
mov r0.a, c3.a ; use modulation alpha (don't use texture alpha)
mul r0.rgb, v0, r0 ; Apply lighting
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
mul r1, t0, c1 ; Self illum * tint
lrp r0.rgb, t0.a, r1, r0 ; Blend between self-illum + base * lighting
mad r0.rgb, t1, c2, r0 ; + envmap * envmaptint (color only)
#if WRITEONETODESTALPHA
+mov r0.a, c4 ; make alpha 255
#endif
; DYNAMIC: "WRITEONETODESTALPHA" "0..1"
ps.1.1
; Get the color from the texture
tex t0
tex t1
mul r0.rgb, t0, c3 + ; base times modulation
mov r0.a, c3.a ; use modulation alpha (don't use texture alpha)
mul r0.rgb, v0, r0 ; Apply lighting
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
mul r1, t0, c1 ; Self illum * tint
lrp r0.rgb, t0.a, r1, r0 ; Blend between self-illum + base * lighting
mad r0.rgb, t1, c2, r0 ; + envmap * envmaptint (color only)
#if WRITEONETODESTALPHA
+mov r0.a, c4 ; make alpha 255
#endif

View File

@@ -1,23 +1,23 @@
; DYNAMIC: "WRITEONETODESTALPHA" "0..1"
ps.1.1
; Get the color from the texture
tex t0 ; base
tex t1 ; env map
tex t2 ; mask
mul r0.rgb, t0, c3 + ; base times modulation
mul r0.a, c3.a, t2.a ; alpha = mod alpha * mask alpha
mul r0.rgb, v0, r0 ; Apply lighting
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
mul r1, t0, c1 ; Self illum * tint
lrp r0.rgb, t0.a, r1, r0 ; Blend between self-illum + base * lighting
mul r1, t2, t1 ; envmapmask * envmap
mad r0.rgb, r1, c2, r0 ; + envmapmask * envmap * envmaptint (color only)
#if WRITEONETODESTALPHA
+mov r0.a, c4 ; make alpha 255
#endif
; DYNAMIC: "WRITEONETODESTALPHA" "0..1"
ps.1.1
; Get the color from the texture
tex t0 ; base
tex t1 ; env map
tex t2 ; mask
mul r0.rgb, t0, c3 + ; base times modulation
mul r0.a, c3.a, t2.a ; alpha = mod alpha * mask alpha
mul r0.rgb, v0, r0 ; Apply lighting
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
mul r1, t0, c1 ; Self illum * tint
lrp r0.rgb, t0.a, r1, r0 ; Blend between self-illum + base * lighting
mul r1, t2, t1 ; envmapmask * envmap
mad r0.rgb, r1, c2, r0 ; + envmapmask * envmap * envmaptint (color only)
#if WRITEONETODESTALPHA
+mov r0.a, c4 ; make alpha 255
#endif

View File

@@ -1,15 +1,15 @@
ps.1.1
;------------------------------------------------------------------------------
; Draw a texture . . woo hoo!
; t0 - texture
;
; The texture coordinates need to be defined as follows:
; tc0 - texcoords
;------------------------------------------------------------------------------
; Get the color from the texture
tex t0
mul r0, t0, v0
ps.1.1
;------------------------------------------------------------------------------
; Draw a texture . . woo hoo!
; t0 - texture
;
; The texture coordinates need to be defined as follows:
; tc0 - texcoords
;------------------------------------------------------------------------------
; Get the color from the texture
tex t0
mul r0, t0, v0

View File

@@ -1,16 +1,16 @@
ps.1.1
;------------------------------------------------------------------------------
; Draw a texture . . woo hoo!
; t0 - texture
;
; The texture coordinates need to be defined as follows:
; tc0 - texcoords
;------------------------------------------------------------------------------
; Get the color from the texture
tex t0
mul_x2 r0.rgb, t0, v0
+ mul r0.a, t0, v0
ps.1.1
;------------------------------------------------------------------------------
; Draw a texture . . woo hoo!
; t0 - texture
;
; The texture coordinates need to be defined as follows:
; tc0 - texcoords
;------------------------------------------------------------------------------
; Get the color from the texture
tex t0
mul_x2 r0.rgb, t0, v0
+ mul r0.a, t0, v0

View File

@@ -1,40 +1,40 @@
ps.1.4
; 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!!!
; 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)
phase
; Sample environment map
texld r3, r2
texld r4, t5 ; Normalize the tangent-space eye vector
; dot eye-vector with per-pixel normal from r0
dp3_sat r1, r4_bx2, r0_bx2
; run Fresnel approx. on it: R0 + (1-R0) (1-cos(q))^5 in alpha channel
mul r0.a, 1-r1.a, 1-r1.a ; squared
mul r0.a, r0.a, r0.a ; quartic
mul_sat r1.a, r0.a, 1-r1.a ; quintic
; multiply color by reflecttint
mul r0, r3, c1
; blend between reflected color and fog color based on fresnel
ps.1.4
; 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!!!
; 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)
phase
; Sample environment map
texld r3, r2
texld r4, t5 ; Normalize the tangent-space eye vector
; dot eye-vector with per-pixel normal from r0
dp3_sat r1, r4_bx2, r0_bx2
; run Fresnel approx. on it: R0 + (1-R0) (1-cos(q))^5 in alpha channel
mul r0.a, 1-r1.a, 1-r1.a ; squared
mul r0.a, r0.a, r0.a ; quartic
mul_sat r1.a, r0.a, 1-r1.a ; quintic
; multiply color by reflecttint
mul r0, r3, c1
; blend between reflected color and fog color based on fresnel
lrp r0.rgb, r1.a, r0, c0

View File

@@ -1,39 +1,39 @@
ps.1.4
; 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!!!
; 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)
phase
; Sample environment map
texld r3, r2
texld r4, t5 ; Normalize the tangent-space eye vector
; dot eye-vector with per-pixel normal from r0
dp3_sat r1, r4_bx2, r0_bx2
; run Fresnel approx. on it: R0 + (1-R0) (1-cos(q))^5 in alpha channel
mul r0.a, 1-r1.a, 1-r1.a ; squared
mul r0.a, r0.a, r0.a ; quartic
mul_sat r1.a, r0.a, 1-r1.a ; quintic
; multiply color by reflecttint
mul r0.rgb, r3, c1
+mov_sat r0.a, v0.a
add_sat r0.a, r1.a, r0.a
ps.1.4
; 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!!!
; 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)
phase
; Sample environment map
texld r3, r2
texld r4, t5 ; Normalize the tangent-space eye vector
; dot eye-vector with per-pixel normal from r0
dp3_sat r1, r4_bx2, r0_bx2
; run Fresnel approx. on it: R0 + (1-R0) (1-cos(q))^5 in alpha channel
mul r0.a, 1-r1.a, 1-r1.a ; squared
mul r0.a, r0.a, r0.a ; quartic
mul_sat r1.a, r0.a, 1-r1.a ; quintic
; multiply color by reflecttint
mul r0.rgb, r3, c1
+mov_sat r0.a, v0.a
add_sat r0.a, r1.a, r0.a

View File

@@ -1,19 +1,19 @@
ps.1.1
; Get the 3-vector from the normal map
tex t0
; Perform matrix multiply to get a local normal bump. Then
; reflect the eye vector through the normal and sample from
; a cubic environment map.
texm3x3pad t1, t0_bx2
texm3x3pad t2, t0_bx2
texm3x3vspec t3, t0_bx2
mul r0, t3, c1 ; multiply color by reflecttint
lrp r0.rgb, c1.a, r0, c0 ; blend between reflected color and fog color based on constant factor
ps.1.1
; Get the 3-vector from the normal map
tex t0
; Perform matrix multiply to get a local normal bump. Then
; reflect the eye vector through the normal and sample from
; a cubic environment map.
texm3x3pad t1, t0_bx2
texm3x3pad t2, t0_bx2
texm3x3vspec t3, t0_bx2
mul r0, t3, c1 ; multiply color by reflecttint
lrp r0.rgb, c1.a, r0, c0 ; blend between reflected color and fog color based on constant factor

View File

@@ -1,18 +1,18 @@
ps.1.1
; Get the 3-vector from the normal map
tex t0
; Perform matrix multiply to get a local normal bump. Then
; reflect the eye vector through the normal and sample from
; a cubic environment map.
texm3x3pad t1, t0_bx2
texm3x3pad t2, t0_bx2
texm3x3vspec t3, t0_bx2
mul r0.rgb, t3, c1 ; multiply color by reflecttint
+mov_sat r0.a, v0.a ; NOTE: This is necessary since v0.a can be outside 0 - 1!
add_sat r0.a, c1.a, r0.a ; cheap water blend factor + constant blend factor
ps.1.1
; Get the 3-vector from the normal map
tex t0
; Perform matrix multiply to get a local normal bump. Then
; reflect the eye vector through the normal and sample from
; a cubic environment map.
texm3x3pad t1, t0_bx2
texm3x3pad t2, t0_bx2
texm3x3vspec t3, t0_bx2
mul r0.rgb, t3, c1 ; multiply color by reflecttint
+mov_sat r0.a, v0.a ; NOTE: This is necessary since v0.a can be outside 0 - 1!
add_sat r0.a, c1.a, r0.a ; cheap water blend factor + constant blend factor

View File

@@ -1,26 +1,26 @@
ps.1.1
; Get the 3-vector from the normal map
tex t0
; Perform matrix multiply to get a local normal bump. Then
; reflect the eye vector through the normal and sample from
; a cubic environment map.
texm3x3pad t1, t0_bx2
texm3x3pad t2, t0_bx2
texm3x3vspec t3, t0_bx2
mul r0, t3, c1 ; envmap color * envmaptint
dp3_sat t2, v0_bx2, t0_bx2 ; dot eye-vector with per-pixel normal from t0
; run Fresnel approx. on it: R0 + (1-R0) (1-cos(q))^5 in alpha channel
; NOTE: This is not perspective-correct and results in strange artifacts
mul r1.a, 1-t2.a, 1-t2.a ; squared
mul r1.a, r1.a, r1.a ; quartic
mul_sat r1.a, r1.a, 1-t2.a ; quintic
; t1.a is now the fresnel factor
lrp r0.rgb, r1.a, r0, c0 ; blend between reflected color and fog color based on fresnel
ps.1.1
; Get the 3-vector from the normal map
tex t0
; Perform matrix multiply to get a local normal bump. Then
; reflect the eye vector through the normal and sample from
; a cubic environment map.
texm3x3pad t1, t0_bx2
texm3x3pad t2, t0_bx2
texm3x3vspec t3, t0_bx2
mul r0, t3, c1 ; envmap color * envmaptint
dp3_sat t2, v0_bx2, t0_bx2 ; dot eye-vector with per-pixel normal from t0
; run Fresnel approx. on it: R0 + (1-R0) (1-cos(q))^5 in alpha channel
; NOTE: This is not perspective-correct and results in strange artifacts
mul r1.a, 1-t2.a, 1-t2.a ; squared
mul r1.a, r1.a, r1.a ; quartic
mul_sat r1.a, r1.a, 1-t2.a ; quintic
; t1.a is now the fresnel factor
lrp r0.rgb, r1.a, r0, c0 ; blend between reflected color and fog color based on fresnel

View File

@@ -1,31 +1,31 @@
ps.1.4
; 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!!!
; 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)
phase
; Sample environment map
texld r3, r2
; multiply color by reflecttint
mul r0, r3, c1
; blend between reflected color and fog color based on constant factor
lrp r0.rgb, c1.a, r0, c0
ps.1.4
; 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!!!
; 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)
phase
; Sample environment map
texld r3, r2
; multiply color by reflecttint
mul r0, r3, c1
; blend between reflected color and fog color based on constant factor
lrp r0.rgb, c1.a, r0, c0

View File

@@ -1,26 +1,26 @@
ps.1.1
; Get the 3-vector from the normal map
tex t0
; Perform matrix multiply to get a local normal bump. Then
; reflect the eye vector through the normal and sample from
; a cubic environment map.
texm3x3pad t1, t0_bx2
texm3x3pad t2, t0_bx2
texm3x3vspec t3, t0_bx2
mul r0.rgb, t3, c1 ; envmap color * envmaptint
+mov_sat r0.a, v0.a ; Put the cheap water blend factor here
dp3_sat t2, v0_bx2, t0_bx2 ; dot eye-vector with per-pixel normal from t0
; run Fresnel approx. on it: R0 + (1-R0) (1-cos(q))^5 in alpha channel
; NOTE: This is not perspective-correct and results in strange artifacts
mul r1.a, 1-t2.a, 1-t2.a ; squared
mul r1.a, r1.a, r1.a ; quartic
mul_sat r1.a, r1.a, 1-t2.a ; quintic
; t1.a is now the fresnel factor
add_sat r0.a, r1.a, r0.a ; Now we have the final blend factor between cheap water + refraction
ps.1.1
; Get the 3-vector from the normal map
tex t0
; Perform matrix multiply to get a local normal bump. Then
; reflect the eye vector through the normal and sample from
; a cubic environment map.
texm3x3pad t1, t0_bx2
texm3x3pad t2, t0_bx2
texm3x3vspec t3, t0_bx2
mul r0.rgb, t3, c1 ; envmap color * envmaptint
+mov_sat r0.a, v0.a ; Put the cheap water blend factor here
dp3_sat t2, v0_bx2, t0_bx2 ; dot eye-vector with per-pixel normal from t0
; run Fresnel approx. on it: R0 + (1-R0) (1-cos(q))^5 in alpha channel
; NOTE: This is not perspective-correct and results in strange artifacts
mul r1.a, 1-t2.a, 1-t2.a ; squared
mul r1.a, r1.a, r1.a ; quartic
mul_sat r1.a, r1.a, 1-t2.a ; quintic
; t1.a is now the fresnel factor
add_sat r0.a, r1.a, r0.a ; Now we have the final blend factor between cheap water + refraction

View File

@@ -1,30 +1,30 @@
ps.1.4
; 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!!!
; 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)
phase
; Sample environment map
texld r3, r2
; multiply color by reflecttint
mul r0.rgb, r3, c1
+mov_sat r0.a, v0.a ; Necessary since v0.a may be negative
add_sat r0.a, c1.a, r0.a
ps.1.4
; 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!!!
; 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)
phase
; Sample environment map
texld r3, r2
; multiply color by reflecttint
mul r0.rgb, r3, c1
+mov_sat r0.a, v0.a ; Necessary since v0.a may be negative
add_sat r0.a, c1.a, r0.a

View File

@@ -1,27 +1,27 @@
ps.1.1
; t0:
; texture: dudv map
; texcoords: dudvmap texcoords
; t1:
; texture: reflection render target
; texcoords:
; t2:
; texture: normal map (usef for fresnel calculation)
; texcoords:
; t4: texture: normalization cube map
; texcoords: eye vect
tex t0 ; sample dudv map
texbem t1, t0 ; reflection
tex t2 ; normal map
tex t3 ; eye vector (through normalization cubemap)
; dot eye-vector with per-pixel normal from t2
dp3_sat r1.rgba, t3_bx2, t2_bx2
; run Fresnel approx. on it: R0 + (1-R0) (1-cos(q))^5
mul r0.a, 1-r1.a, 1-r1.a // squared
mul r0.a, r0.a, r0.a // quartic
mul r0.rgb, t1, c0 // shove color from reflection render target into r0
ps.1.1
; t0:
; texture: dudv map
; texcoords: dudvmap texcoords
; t1:
; texture: reflection render target
; texcoords:
; t2:
; texture: normal map (usef for fresnel calculation)
; texcoords:
; t4: texture: normalization cube map
; texcoords: eye vect
tex t0 ; sample dudv map
texbem t1, t0 ; reflection
tex t2 ; normal map
tex t3 ; eye vector (through normalization cubemap)
; dot eye-vector with per-pixel normal from t2
dp3_sat r1.rgba, t3_bx2, t2_bx2
; run Fresnel approx. on it: R0 + (1-R0) (1-cos(q))^5
mul r0.a, 1-r1.a, 1-r1.a // squared
mul r0.a, r0.a, r0.a // quartic
mul r0.rgb, t1, c0 // shove color from reflection render target into r0
+mul_sat r0.a, r0.a, 1-r1.a // quintic

View File

@@ -1,24 +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
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

View File

@@ -1,13 +1,13 @@
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
mul r0, t1, c0
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
mul r0, t1, c0

View File

@@ -1,96 +1,96 @@
; STATIC: "REFLECT" "0..1"
; STATIC: "REFRACT" "0..1"
ps.1.4
; T2 - refraction
; T3 - normal map
; T4 - reflection
; TC0 - normal map coords
; TC1 - proj tex coords (reflection)
; TC2 - proj tex coords (refraction)
; TC3 - tangent space view vec
; TC4 - displacement scale
; sample normal map
texld r3, t0
#if REFLECT
; reflection coords
texcrd r4.xy, t1_dw.xyw
#endif
#if REFRACT
; refraction coords
texcrd r2.xy, t2_dw.xyw
#endif
; tangent space eye vector
texld r1, t5 ; <---- Normalizing CUBE MAP here!!!
; reflection/refraction scale (x,y)
texcrd r0.xyz, t4.xyz
; perturb coords by constant displacement
; and by normal map alpha (which has 1/(2**miplevel in it)
mul r0.rg, r0, r3.a
#if REFLECT
mad r4.rg, r3_bx2, r0.x, r4
#endif
#if REFRACT
mad r2.rg, r3_bx2, r0.y, r2
#endif
; stuff something into z so that texld will deal
#if REFLECT
mov r4.b, c5
#endif
#if REFRACT
mov r2.b, c5
#endif
phase
#if REFLECT
; reflection
texld r4, r4
#endif
#if REFRACT
; refraction
texld r2, r2
#endif
#if REFLECT
; N.V
dp3_sat r1.a, r3_bx2, r1_bx2
#endif
#if REFRACT
; tint refraction
mul r2.rgb, r2, c1
#endif
#if REFLECT
; tint reflction
mul r4.rgb, r4, c4
; (1-N.V) ^ 5
+mul r0.a, 1-r1.a, 1-r1.a
mul r0.a, r0.a, r0.a
mul_sat r0.a, r0.a, 1-r1.a
#endif
#if !REFLECT && !REFRACT
; This is wrong!!!!
mov r0.rgba, c0
#endif
#if !REFLECT && REFRACT
mov r0.rgba, r2
#endif
#if REFLECT && !REFRACT
mov r0.rgba, r4
#endif
#if REFLECT && REFRACT
; reflection * fresnel + refraction * ( 1 - fresnel )
lrp r0.rgba, r0.a, r4, r2
#endif
; STATIC: "REFLECT" "0..1"
; STATIC: "REFRACT" "0..1"
ps.1.4
; T2 - refraction
; T3 - normal map
; T4 - reflection
; TC0 - normal map coords
; TC1 - proj tex coords (reflection)
; TC2 - proj tex coords (refraction)
; TC3 - tangent space view vec
; TC4 - displacement scale
; sample normal map
texld r3, t0
#if REFLECT
; reflection coords
texcrd r4.xy, t1_dw.xyw
#endif
#if REFRACT
; refraction coords
texcrd r2.xy, t2_dw.xyw
#endif
; tangent space eye vector
texld r1, t5 ; <---- Normalizing CUBE MAP here!!!
; reflection/refraction scale (x,y)
texcrd r0.xyz, t4.xyz
; perturb coords by constant displacement
; and by normal map alpha (which has 1/(2**miplevel in it)
mul r0.rg, r0, r3.a
#if REFLECT
mad r4.rg, r3_bx2, r0.x, r4
#endif
#if REFRACT
mad r2.rg, r3_bx2, r0.y, r2
#endif
; stuff something into z so that texld will deal
#if REFLECT
mov r4.b, c5
#endif
#if REFRACT
mov r2.b, c5
#endif
phase
#if REFLECT
; reflection
texld r4, r4
#endif
#if REFRACT
; refraction
texld r2, r2
#endif
#if REFLECT
; N.V
dp3_sat r1.a, r3_bx2, r1_bx2
#endif
#if REFRACT
; tint refraction
mul r2.rgb, r2, c1
#endif
#if REFLECT
; tint reflction
mul r4.rgb, r4, c4
; (1-N.V) ^ 5
+mul r0.a, 1-r1.a, 1-r1.a
mul r0.a, r0.a, r0.a
mul_sat r0.a, r0.a, 1-r1.a
#endif
#if !REFLECT && !REFRACT
; This is wrong!!!!
mov r0.rgba, c0
#endif
#if !REFLECT && REFRACT
mov r0.rgba, r2
#endif
#if REFLECT && !REFRACT
mov r0.rgba, r4
#endif
#if REFLECT && REFRACT
; reflection * fresnel + refraction * ( 1 - fresnel )
lrp r0.rgba, r0.a, r4, r2
#endif

View File

@@ -1,14 +1,14 @@
ps.1.1
;------------------------------------------------------------------------------
; Draw a texture . . woo hoo!
; t0 - texture
;
; The texture coordinates need to be defined as follows:
; tc0 - texcoords
;------------------------------------------------------------------------------
; Get the color from the texture
tex t0
mov r0, t0
ps.1.1
;------------------------------------------------------------------------------
; Draw a texture . . woo hoo!
; t0 - texture
;
; The texture coordinates need to be defined as follows:
; tc0 - texcoords
;------------------------------------------------------------------------------
; Get the color from the texture
tex t0
mov r0, t0

View File

@@ -1,21 +1,21 @@
ps.1.1
;------------------------------------------------------------------------------
; Draw a texture . . woo hoo!
; t0 - texture
;
; The texture coordinates need to be defined as follows:
; tc0 - texcoords
;------------------------------------------------------------------------------
tex t0
tex t1
tex t2
mov r0.rgb, t0 +
mul r0.a, t0.a, v0.a ; Grab alpha from vertex color
lrp r0.rgb, t2.a, t2, r0 ; Base = base * (1 - detail alpha) + detail * detail alpha
mul r0.rgb, r0, v0 ; modulate by vertex color
mul r0.rgb, t1, r0 ; fold in lightmap (color only)
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
ps.1.1
;------------------------------------------------------------------------------
; Draw a texture . . woo hoo!
; t0 - texture
;
; The texture coordinates need to be defined as follows:
; tc0 - texcoords
;------------------------------------------------------------------------------
tex t0
tex t1
tex t2
mov r0.rgb, t0 +
mul r0.a, t0.a, v0.a ; Grab alpha from vertex color
lrp r0.rgb, t2.a, t2, r0 ; Base = base * (1 - detail alpha) + detail * detail alpha
mul r0.rgb, r0, v0 ; modulate by vertex color
mul r0.rgb, t1, r0 ; fold in lightmap (color only)
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)

View File

@@ -1,25 +1,25 @@
ps.1.1
;------------------------------------------------------------------------------
; Draw a texture . . woo hoo!
; t0 - texture
;
; The texture coordinates need to be defined as follows:
; tc0 - texcoords
;------------------------------------------------------------------------------
def c1, 1.0f, 1.0f, 1.0f, 1.0f
tex t0
tex t1
tex t2
mov_x2_sat r0.rgb, t0 + ; r0 = sat( t0 * 2 )
mul r0.a, t0.a, v0.a ; Grab alpha from vertex color
lrp_sat r0.rgb, t2.a, r0, c1 ; r0 = B*Da + (1-Da)
mul r0.rgb, r0, t2 ; modulate by detail color
mul r0.rgb, r0, v0 ; modulate by vertex color
mul r0.rgb, t1, r0 ; fold in lightmap (color only)
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
ps.1.1
;------------------------------------------------------------------------------
; Draw a texture . . woo hoo!
; t0 - texture
;
; The texture coordinates need to be defined as follows:
; tc0 - texcoords
;------------------------------------------------------------------------------
def c1, 1.0f, 1.0f, 1.0f, 1.0f
tex t0
tex t1
tex t2
mov_x2_sat r0.rgb, t0 + ; r0 = sat( t0 * 2 )
mul r0.a, t0.a, v0.a ; Grab alpha from vertex color
lrp_sat r0.rgb, t2.a, r0, c1 ; r0 = B*Da + (1-Da)
mul r0.rgb, r0, t2 ; modulate by detail color
mul r0.rgb, r0, v0 ; modulate by vertex color
mul r0.rgb, t1, r0 ; fold in lightmap (color only)
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)

View File

@@ -1,27 +1,27 @@
ps.1.1
;------------------------------------------------------------------------------
; Draw a texture . . woo hoo!
; t0 - texture
;
; The texture coordinates need to be defined as follows:
; tc0 - texcoords
;------------------------------------------------------------------------------
tex t0
tex t1
tex t2
mov r0.rgb, t0 +
mov r0.a, v0.a ; Grab alpha from vertex color
lrp r0.rgb, t2.a, t2, r0 ; Base = base * (1 - detail alpha) + detail * detail alpha
mul r0.rgb, r0, v0 ; modulate by vertex color
mul r0.rgb, t1, r0 ; fold in lightmap (color only)
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
mul r1.rgb, c1, t0 ; Self illum * tint
+ mul r1.a, t0.a, 1-t2.a ; Reduce self-illum amount based on 1 - detailalpha
lrp r0.rgb, t0.a, r1, r0 ; Blend between self-illum + base * lightmap
ps.1.1
;------------------------------------------------------------------------------
; Draw a texture . . woo hoo!
; t0 - texture
;
; The texture coordinates need to be defined as follows:
; tc0 - texcoords
;------------------------------------------------------------------------------
tex t0
tex t1
tex t2
mov r0.rgb, t0 +
mov r0.a, v0.a ; Grab alpha from vertex color
lrp r0.rgb, t2.a, t2, r0 ; Base = base * (1 - detail alpha) + detail * detail alpha
mul r0.rgb, r0, v0 ; modulate by vertex color
mul r0.rgb, t1, r0 ; fold in lightmap (color only)
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
mul r1.rgb, c1, t0 ; Self illum * tint
+ mul r1.a, t0.a, 1-t2.a ; Reduce self-illum amount based on 1 - detailalpha
lrp r0.rgb, t0.a, r1, r0 ; Blend between self-illum + base * lightmap

View File

@@ -1,10 +1,10 @@
ps.1.1
tex t0 ; basetexture
tex t1 ; lightmap
mov r0.a, 1-t1.a
;mov r0.rgb, t0 ; * 2 * (overbrightFactor/2)
;mov_x2 r0.rgb, t0 ; * 2 * (overbrightFactor/2)
mul r0.rgb, t0, t1;
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
ps.1.1
tex t0 ; basetexture
tex t1 ; lightmap
mov r0.a, 1-t1.a
;mov r0.rgb, t0 ; * 2 * (overbrightFactor/2)
;mov_x2 r0.rgb, t0 ; * 2 * (overbrightFactor/2)
mul r0.rgb, t0, t1;
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)

View File

@@ -1,18 +1,18 @@
; STATIC: "DETAIL" "0..1"
ps.1.1
tex t0 ; basetexture
tex t1 ; basetexture2
tex t2 ; lightmap
#if DETAIL
tex t3 ; detail
#endif
mov_sat r1.a, v0.a
lrp r0, r1.a, t1, t0
mul r0, r0, t2
#if DETAIL
mul_x2 r0.rgb, r0, t3
#endif
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
; STATIC: "DETAIL" "0..1"
ps.1.1
tex t0 ; basetexture
tex t1 ; basetexture2
tex t2 ; lightmap
#if DETAIL
tex t3 ; detail
#endif
mov_sat r1.a, v0.a
lrp r0, r1.a, t1, t0
mul r0, r0, t2
#if DETAIL
mul_x2 r0.rgb, r0, t3
#endif
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)

View File

@@ -1,16 +1,16 @@
ps.1.1
;------------------------------------------------------------------------------
; Draw a texture . . woo hoo!
; t0 - texture
;
; The texture coordinates need to be defined as follows:
; tc0 - texcoords
;------------------------------------------------------------------------------
tex t0
tex t1
mul r0.rgb, t1, t0 ; fold in lightmap (color)
+mov r0.a, v0.a ; fold in lightmap (alpha)
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
ps.1.1
;------------------------------------------------------------------------------
; Draw a texture . . woo hoo!
; t0 - texture
;
; The texture coordinates need to be defined as follows:
; tc0 - texcoords
;------------------------------------------------------------------------------
tex t0
tex t1
mul r0.rgb, t1, t0 ; fold in lightmap (color)
+mov r0.a, v0.a ; fold in lightmap (alpha)
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)

View File

@@ -1,10 +1,10 @@
ps.1.1
tex t0 ; basetexture
tex t1 ; basetexture2
tex t2 ; lightmap
; The editor uses vertex alpha as the blend factor
lrp r0, 1-v0.a, t1, t0
mul r0, r0, t2
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
ps.1.1
tex t0 ; basetexture
tex t1 ; basetexture2
tex t2 ; lightmap
; The editor uses vertex alpha as the blend factor
lrp r0, 1-v0.a, t1, t0
mul r0, r0, t2
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)

View File

@@ -1,23 +1,23 @@
ps.1.1
def c0, 1.0f, 0.0f, 0.0f, 0.0f
def c1, 0.0f, 1.0f, 0.0f, 0.0f
def c2, 0.0f, 0.0f, 1.0f, 0.0f
tex t0 ; basetexture zy
tex t1 ; basetexture xz
tex t2 ; basetexture xy
tex t3 ; lightmap
dp3_sat r1, v0, c0
mul r0, t0, r1
dp3_sat r1, v0, c1
mad r0, t1, r1, r0
dp3_sat r1, v0, c2
mad r0, t2, r1, r0
; multiply by lightmap
mul_x2 r0.rgb, r0, t3
+mov r0.a, v0 ; $vColor
ps.1.1
def c0, 1.0f, 0.0f, 0.0f, 0.0f
def c1, 0.0f, 1.0f, 0.0f, 0.0f
def c2, 0.0f, 0.0f, 1.0f, 0.0f
tex t0 ; basetexture zy
tex t1 ; basetexture xz
tex t2 ; basetexture xy
tex t3 ; lightmap
dp3_sat r1, v0, c0
mul r0, t0, r1
dp3_sat r1, v0, c1
mad r0, t1, r1, r0
dp3_sat r1, v0, c2
mad r0, t2, r1, r0
; multiply by lightmap
mul_x2 r0.rgb, r0, t3
+mov r0.a, v0 ; $vColor

View File

@@ -1,32 +1,32 @@
; STATIC: "DETAIL" "0..1"
; STATIC: "BLENDMODULATETEXTURE" "0..1"
ps.1.4
def c1, 3.0, -2.0, 0.5, 0.5
texld r0, t0
texld r1, t1
texld r2, t2
#if DETAIL
texld r3, t3 ; detail
#endif
#if BLENDMODULATETEXTURE
texld r4, t4 ; detail
#endif
#if BLEND_MODULATETEXTURE
sub r5.a, v0.a, r4.g
add_sat r5.a, r5.a, c1.a
mad r6.a, c1.g, r5.a, c1.r
mul r6.a, r6.a, r5.a
mul r5.a, r6.a, r5.a
#else
mov_sat r5.a, v0.a
#endif
lrp r0, r5.a, r1, r0
mul r0, r0, r2
#if DETAIL
mul_x2 r0.rgb, r0, r3
#endif
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
; STATIC: "DETAIL" "0..1"
; STATIC: "BLENDMODULATETEXTURE" "0..1"
ps.1.4
def c1, 3.0, -2.0, 0.5, 0.5
texld r0, t0
texld r1, t1
texld r2, t2
#if DETAIL
texld r3, t3 ; detail
#endif
#if BLENDMODULATETEXTURE
texld r4, t4 ; detail
#endif
#if BLEND_MODULATETEXTURE
sub r5.a, v0.a, r4.g
add_sat r5.a, r5.a, c1.a
mad r6.a, c1.g, r5.a, c1.r
mul r6.a, r6.a, r5.a
mul r5.a, r6.a, r5.a
#else
mov_sat r5.a, v0.a
#endif
lrp r0, r5.a, r1, r0
mul r0, r0, r2
#if DETAIL
mul_x2 r0.rgb, r0, r3
#endif
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)

View File

@@ -1,6 +1,6 @@
ps.1.1
tex t0
tex t1
mul r0, t0, t1
ps.1.1
tex t0
tex t1
mul r0, t0, t1

Some files were not shown because too many files have changed in this diff Show More