////////////////////////////////// THREE POINTLIGHT CODE #define LIGHT_POS_1 POINT_LIGHT_0 #define LIGHT_POS_2 POINT_LIGHT_1 #define LIGHT_DIR_1 1+POINT_LIGHT_0 #define LIGHT_DIR_2 1+POINT_LIGHT_1 #define LIGHT_COLOR_1 2+POINT_LIGHT_0 #define LIGHT_COLOR_2 2+POINT_LIGHT_1 #define ONE_PER_FN POINT_LIGHT_ONE_PER_FN #define NEAR_PER_FN POINT_LIGHT_N_PER_FN #define LOG10_OF_2 c[POINT_LIGHT_LOG_VAL].x #define ZERO c[SPEC_POWER_CONST].x #define ONE c[SPEC_POWER_CONST].y sub r6, POS, c[LIGHT_POS_1] ; r5 = light to vertex sub r7, POS, c[LIGHT_POS_2] ; r5 = light to vertex dp3 r9.x, r6, r6 dp3 r10.x, r7, r7 rsq r9, r9.x rsq r10, r10.x mul r6, r6, r9.z mul r7, r7, r10.z /* // ANGLE FACTOR dp3 r5.x, NORMAL, c[LIGHT_DIR_1] dp3 r5.y, NORMAL, c[LIGHT_DIR_2] */ dp3 r5.x, NORMAL, -r6 dp3 r5.yzw, NORMAL, -r7 max r5, r5, ZERO mad r2, r5.x, c[LIGHT_COLOR_1], r2 mad r2, r5.y, c[LIGHT_COLOR_2], r2