History

Disable specular highlights for ground and voxels.

Andrzej Kapolka committed 13 years ago

Commit aca15d41 parent f2a9d051 file · +11 −3Browse files

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

Unified · Split

interface/src/Application.cpp+11−3
@@ -2929,6 +2929,9 @@ void Application::displayOculus(Camera& whichCamera) { · 2928 unmodified lines
29292929 glPopMatrix();
29302930 }
29312931
2932+const GLfloat WHITE_SPECULAR_COLOR[] = { 1.0f, 1.0f, 1.0f, 1.0f };
2933+const GLfloat NO_SPECULAR_COLOR[] = { 0.0f, 0.0f, 0.0f, 1.0f };
2934+
29322935 void Application::setupWorldLight(Camera& whichCamera) {
29332936
29342937 // Setup 3D lights (after the camera transform, so that they are positioned in world space)
@@ -2943,10 +2946,9 @@ void Application::setupWorldLight(Camera& whichCamera) { · 8 unmodified lines
29432946 glLightfv(GL_LIGHT0, GL_AMBIENT, ambient_color);
29442947 GLfloat diffuse_color[] = { 0.8, 0.7, 0.7 };
29452948 glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuse_color);
2946− GLfloat specular_color[] = { 1.0, 1.0, 1.0, 1.0};
2947− glLightfv(GL_LIGHT0, GL_SPECULAR, specular_color);
29482949
2949− glMaterialfv(GL_FRONT, GL_SPECULAR, specular_color);
2950+ glLightfv(GL_LIGHT0, GL_SPECULAR, WHITE_SPECULAR_COLOR);
2951+ glMaterialfv(GL_FRONT, GL_SPECULAR, WHITE_SPECULAR_COLOR);
29502952 glMateriali(GL_FRONT, GL_SHININESS, 96);
29512953 }
29522954
@@ -3024,6 +3026,9 @@ void Application::displaySide(Camera& whichCamera) { · 71 unmodified lines
30243026 glutSolidSphere(sphereRadius, 15, 15);
30253027 glPopMatrix();
30263028
3029+ // disable specular lighting for ground and voxels
3030+ glMaterialfv(GL_FRONT, GL_SPECULAR, NO_SPECULAR_COLOR);
3031+
30273032 //draw a grid ground plane....
30283033 if (_renderGroundPlaneOn->isChecked()) {
30293034 // draw grass plane with fog
@@ -3052,6 +3057,9 @@ void Application::displaySide(Camera& whichCamera) { · 22 unmodified lines
30523057 _voxels.render(_renderVoxelTextures->isChecked());
30533058 }
30543059
3060+ // restore default, white specular
3061+ glMaterialfv(GL_FRONT, GL_SPECULAR, WHITE_SPECULAR_COLOR);
3062+
30553063 // indicate what we'll be adding/removing in mouse mode, if anything
30563064 if (_mouseVoxel.s != 0) {
30573065 glDisable(GL_LIGHTING);

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