summaryrefslogtreecommitdiff
path: root/materialsystem/stdshaders/modeldiffusebump.psh
diff options
context:
space:
mode:
authorFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
committerFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
commit3bf9df6b2785fa6d951086978a3e66f49427166a (patch)
tree2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /materialsystem/stdshaders/modeldiffusebump.psh
downloadarchived-source-engine-2018-hl2-src-master.tar.xz
archived-source-engine-2018-hl2-src-master.zip
Diffstat (limited to 'materialsystem/stdshaders/modeldiffusebump.psh')
-rw-r--r--materialsystem/stdshaders/modeldiffusebump.psh39
1 files changed, 39 insertions, 0 deletions
diff --git a/materialsystem/stdshaders/modeldiffusebump.psh b/materialsystem/stdshaders/modeldiffusebump.psh
new file mode 100644
index 0000000..68f1850
--- /dev/null
+++ b/materialsystem/stdshaders/modeldiffusebump.psh
@@ -0,0 +1,39 @@
+ps.1.1
+
+; base texture
+tex t0
+
+; normalmap
+tex t1
+
+; rgb - tangent space light direction for first light
+texcoord t2
+
+; rgb - tangent space light direction for second light
+texcoord t3
+
+; v0.rgb : ambient color
+; c5 : light 1 color
+; c6 : light 2 color
+
+; first local light
+dp3_sat r0.rgb, t1_bx2, t2_bx2 ; n dot l
++mov r0.a, t0.a ; Get the output color alpha from the base texture
+mad r0.rgb, c5, r0, v0 ; mult by light color add add ambient color
+
+; second local light
+dp3_sat r1, t1_bx2, t3_bx2 ; n dot l
+mad r0.rgb, c6, r1, r0 ; mult by light color and add first local light
+
+; c1 = A
+; c2 = B
+; c3 = C
+; D = 0
+;mad_x2 r1.rgb, c1, r0, c2
+;mad_x2 r1.rgb, r1, r0, c3
+;mul_x4 r0.rgb, r1, r0
+
+;mul_x2 r0.rgb, r0, t0 ; mult by texture and overbright
+
+
+mov_x2 r0.rgb, r0