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
25992599 const GLfloat WORLD_DIFFUSE_COLOR[] = { 0.6f, 0.525f, 0.525f };
26002600 const GLfloat WORLD_SPECULAR_COLOR[] = { 0.94f, 0.94f, 0.737f, 1.0f };
26012601
2602+const glm::vec3 GLOBAL_LIGHT_COLOR = { 0.6f, 0.525f, 0.525f };
2603+const float GLOBAL_LIGHT_INTENSITY = 1.0f;
2604+
26022605 void Application::setupWorldLight() {
26032606
26042607 // 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
26132616 glLightfv(GL_LIGHT0, GL_SPECULAR, WORLD_SPECULAR_COLOR);
26142617 glMaterialfv(GL_FRONT, GL_SPECULAR, WORLD_SPECULAR_COLOR);
26152618 glMateriali(GL_FRONT, GL_SHININESS, 96);
2619+
26162620 }
26172621
26182622 bool Application::shouldRenderMesh(float largestDimension, float distanceToCamera) {
@@ -2819,7 +2823,7 @@ void Application::displaySide(Camera& theCamera, bool selfAvatarOnly, RenderArgs · 200 unmodified lines
28192823
28202824 {
28212825 DependencyManager::get<DeferredLightingEffect>()->setAmbientLightMode(getRenderAmbientLight());
2822−
2826+ DependencyManager::get<DeferredLightingEffect>()->setGlobalLight(-getSunDirection(), GLOBAL_LIGHT_COLOR, GLOBAL_LIGHT_INTENSITY);
28232827 PROFILE_RANGE("DeferredLighting");
28242828 PerformanceTimer perfTimer("lighting");
28252829 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