;c0: RGB=terrain lightmap tint, A=far blending
;t0: RGB=color, A<127-0>=Selfillumination mask, A<128-255>=Specular, Reflection mask
;t1: RGB=Reflection
;t2: RGB=ligtmap

ps.1.1

tex t0	;RGB: color, A<127-0>: SI mask, A<128-255>: Envmask
tex t1	;RGB: reflection
tex t2	;RGB: lightmap

mul_sat		r0.rgb, t1, t0_bx2.a	;mask reflection
+mov_sat	r0.a, -t0_bx2.a			;Selfillumination mask extraction

add_sat		r0.rgb, r0, t0			;add reflection to color

add_sat		r1, r0.a, t2			;add SI mask to lightmap

mul			r0.rgb, r0, r1			;mul color by lighting
+mov		r0.a, c0.a				;farblending