History

Merge pull request #4256 from samcake/temp1

Getting rid of glLIghts and replacing by the model::Light

Brad Hefta-Gaub committed 11 years ago

Commit 1827d9f2 parents d69efa0 11beb5123 files · +950 −396Browse files

Showing the changes to interface/src/Application.cpp (1 of 23 files). Show all

Unified · Split

interface/src/Application.cpp+5−1
@@ -2599,6 +2599,9 @@ const GLfloat WORLD_AMBIENT_COLOR[] = { 0.525f, 0.525f, 0.6f }; · 2598 unmodified lines
2599const GLfloat WORLD_DIFFUSE_COLOR[] = { 0.6f, 0.525f, 0.525f };2599const GLfloat WORLD_DIFFUSE_COLOR[] = { 0.6f, 0.525f, 0.525f };
2600const GLfloat WORLD_SPECULAR_COLOR[] = { 0.94f, 0.94f, 0.737f, 1.0f };2600const GLfloat WORLD_SPECULAR_COLOR[] = { 0.94f, 0.94f, 0.737f, 1.0f };
2601 2601
2602const glm::vec3 GLOBAL_LIGHT_COLOR = { 0.6f, 0.525f, 0.525f };
2603const float GLOBAL_LIGHT_INTENSITY = 1.0f;
2604
2602void Application::setupWorldLight() {2605void Application::setupWorldLight() {
2603 2606
2604 // Setup 3D lights (after the camera transform, so that they are positioned in world space)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 glLightfv(GL_LIGHT0, GL_SPECULAR, WORLD_SPECULAR_COLOR);2616 glLightfv(GL_LIGHT0, GL_SPECULAR, WORLD_SPECULAR_COLOR);
2614 glMaterialfv(GL_FRONT, GL_SPECULAR, WORLD_SPECULAR_COLOR);2617 glMaterialfv(GL_FRONT, GL_SPECULAR, WORLD_SPECULAR_COLOR);
2615 glMateriali(GL_FRONT, GL_SHININESS, 96);2618 glMateriali(GL_FRONT, GL_SHININESS, 96);
2619
2616}2620}
2617 2621
2618bool Application::shouldRenderMesh(float largestDimension, float distanceToCamera) {2622bool 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 DependencyManager::get<DeferredLightingEffect>()->setAmbientLightMode(getRenderAmbientLight());2825 DependencyManager::get<DeferredLightingEffect>()->setAmbientLightMode(getRenderAmbientLight());
2822 2826 DependencyManager::get<DeferredLightingEffect>()->setGlobalLight(-getSunDirection(), GLOBAL_LIGHT_COLOR, GLOBAL_LIGHT_INTENSITY);
2823 PROFILE_RANGE("DeferredLighting"); 2827 PROFILE_RANGE("DeferredLighting");
2824 PerformanceTimer perfTimer("lighting");2828 PerformanceTimer perfTimer("lighting");
2825 DependencyManager::get<DeferredLightingEffect>()->render();2829 DependencyManager::get<DeferredLightingEffect>()->render();

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t