localspecular1.psh

来自「hl2 source code. Do not use it illegal.」· PSH 代码 · 共 38 行

PSH
38
字号
ps.1.1

;------------------------------------------------------------------------------
; Computes the diffuse component of lighting using lightmap + bumpmap
; t0 - Normalmap
; t1 - Lightmap1
; t2 - Lightmap2
; t3 - Lightmap3
; v0 - Eye vector in tangent space/2
;
; 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 

; Calculate reflection vector in tangent space and stick it in r5
dp3 r1.rgb, t0_bx2, v0_bx2 		; r1 = (N dot Eye/2)
mad_x4 r1.rgb, t0_bx2, r1, -v0_bx2	; r1 = 4 * N * (N dot Eye/2) - Eye/2

; r1 = reflection vector

; Compute the dot product of axis 1 and the reflection vector
dp3_sat r0.rgb, r1, c0
; Modulate the lightmap color by reflection vector dot Axis 1
mul r0.rgb, t1, r0
+mov r0.a, t0.a

;mov r0.rgb, t1
;mov r0.rgb, r1
;+mov r0.a, t0.a

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?