Getting rid of glLIghts and replacing by the model::Light
Showing the changes to interface/src/Application.cpp (1 of 23 files). Show all
Unified · Split
| @@ -2599,6 +2599,9 @@ const GLfloat WORLD_AMBIENT_COLOR[] = { 0.525f, 0.525f, 0.6f }; · 2598 unmodified lines | ||
| 2599 | 2599 | const GLfloat WORLD_DIFFUSE_COLOR[] = { 0.6f, 0.525f, 0.525f }; |
| 2600 | 2600 | const GLfloat WORLD_SPECULAR_COLOR[] = { 0.94f, 0.94f, 0.737f, 1.0f }; |
| 2601 | 2601 | |
| 2602 | +const glm::vec3 GLOBAL_LIGHT_COLOR = { 0.6f, 0.525f, 0.525f }; | |
| 2603 | +const float GLOBAL_LIGHT_INTENSITY = 1.0f; | |
| 2604 | + | |
| 2602 | 2605 | void Application::setupWorldLight() { |
| 2603 | 2606 | |
| 2604 | 2607 | // Setup 3D lights (after the camera transform, so that they are positioned in world space) |
| @@ -2613,6 +2616,7 @@ void Application::setupWorldLight() { · 8 unmodified lines | ||
| 2613 | 2616 | glLightfv(GL_LIGHT0, GL_SPECULAR, WORLD_SPECULAR_COLOR); |
| 2614 | 2617 | glMaterialfv(GL_FRONT, GL_SPECULAR, WORLD_SPECULAR_COLOR); |
| 2615 | 2618 | glMateriali(GL_FRONT, GL_SHININESS, 96); |
| 2619 | + | |
| 2616 | 2620 | } |
| 2617 | 2621 | |
| 2618 | 2622 | bool Application::shouldRenderMesh(float largestDimension, float distanceToCamera) { |
| @@ -2819,7 +2823,7 @@ void Application::displaySide(Camera& theCamera, bool selfAvatarOnly, RenderArgs · 200 unmodified lines | ||
| 2819 | 2823 | |
| 2820 | 2824 | { |
| 2821 | 2825 | DependencyManager::get<DeferredLightingEffect>()->setAmbientLightMode(getRenderAmbientLight()); |
| 2822 | − | |
| 2826 | + DependencyManager::get<DeferredLightingEffect>()->setGlobalLight(-getSunDirection(), GLOBAL_LIGHT_COLOR, GLOBAL_LIGHT_INTENSITY); | |
| 2823 | 2827 | PROFILE_RANGE("DeferredLighting"); |
| 2824 | 2828 | PerformanceTimer perfTimer("lighting"); |
| 2825 | 2829 | DependencyManager::get<DeferredLightingEffect>()->render(); |