📄 localspecular3.psh
字号:
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
;
; 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, c2
; Modulate the lightmap color by reflection vector dot Axis 1
mul r0.rgb, t3, r0
+mov r0.a, t0.a
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -