source2006/materialsystem/stdshaders/sdk_lightmappedgeneric_multiplybylightingselfillum.psh
2020-02-25 05:28:57 +02:00

32 lines
No EOL
791 B
Text

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
#ifndef _XBOX
mul_x2 r1.rgb, c0, t1 ; Apply overbright to lightmap
+ mov_sat r1.a, v0 ; opacity == vertex opacity (no alpha in texture)
#else
mul_x2 r1.rgb, c0, t1
+ mov r1.a, v0
#endif
lrp r0.rgb, t0.a, c1, r1 ; Blend between self-illum + lightmap
+ mov r0.a, c2.a
#ifndef _XBOX
lrp r0.rgb, r1.a, r0, c2 ; interpolate between white + color
#else
lrp r0.rgb, r1_sat.a, r0, c2
#endif