/****************************************************************\ * *-------------------------------------------------------------- * * Name: SetRGBColors * * Purpose: Set the RGB schema so that each time a user changes the * color we update it here. * * * Usage: * * Method: * - * * - * - * * - * - * * Returns:VOID * * \****************************************************************/ VOID SetRGBColors(VOID) { vclrFace[SURFACE] = cp.clrFace; vclrBG[SURFACE] = cp.clrBackground; vclrHands[SURFACE] = cp.clrMinuteHand; vclrMajorTicks[SURFACE] = cp.clrHourHand; /*Fill color tables*/ ShadeLight(vclrMajorTicks); vclrMinorTicks[SURFACE] = vclrFace[SURFACE]; ShadeLight(vclrMinorTicks); ShadeLight(vclrFace); vclrRing[SURFACE] = vclrFace[SURFACE]; ShadeLight(vclrRing); #ifdef DISABLE ShadeLight(vclrHands); #endif vclrHands[SHADE] = RGB_BLACK; ShadeLight(vclrBG); }
Vector4 Material::Shade(HitInfo& hit, Scene& scene) const { const Ray& ray = hit.eyeRay; const Vector3 viewDir = -ray.direction; const std::vector<Light*>& lights = scene.GetLights(); Vector4 shadedColor(0); // Loop over all lights std::vector<Light*>::const_iterator light_it = lights.begin(); for (light_it=lights.begin(); light_it != lights.end(); ++light_it) { Light* light = *light_it; stats::shadowRays += light->GetNumSamples(); ShadeLight( hit, scene, *light, scene.GetLightIntensity(*light, hit), shadedColor ); } return shadedColor; }