// EMERGENT GAME TECHNOLOGIES PROPRIETARY INFORMATION // // This software is supplied under the terms of a license agreement or // nondisclosure agreement with Emergent Game Technologies and may not // be copied or disclosed except in accordance with the terms of that // agreement. // // Copyright (c) 1996-2007 Emergent Game Technologies. // All Rights Reserved. // // Emergent Game Technologies, Chapel Hill, North Carolina 27517 // http://www.emergent.net ;Light the skin with a directional lights and a bump map. ; ;B = Base map ;N = Per pixel normal from normal map ;D1 = Light 1 Direction in t2 ;C1 = Light 1 Color in c2 ;AL = Ambient lighting in oD0 ;MC = Material color in oD1 ;Oc = Output color ;Oa = Output alpha ; ;Oc = B * ((((N dot D1) * C1) * MC) + AL) ;Oa = 1 ps_1_1 def c0, 1.0,0.0,0.0,1.0 tex t0 ; base map tex t1 ; normal map texcoord t2 ; light vector 1 in tangent space texcoord t3 ; light vector 2 in tangent space ; N dot L. Both vectors are biased coming out of the vertex shader. dp3_sat r1, t1_bx2, t2_bx2 ;N dot L for Light1 mul_sat r1, r1, c2 ;Color for Light1 dp3_sat r0, t1_bx2, t3_bx2 ;N dot L for Light2 mad_sat r1, c3, r0, r1 ;Color for Light2 mad r1, r1, v1, v0 ;material diffuse + ambient mul r0, r1, t0 ;Modulate base map.