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
2929 glPopMatrix();2929 glPopMatrix();
2930}2930}
2931 2931
2932const GLfloat WHITE_SPECULAR_COLOR[] = { 1.0f, 1.0f, 1.0f, 1.0f };
2933const GLfloat NO_SPECULAR_COLOR[] = { 0.0f, 0.0f, 0.0f, 1.0f };
2934
2932void Application::setupWorldLight(Camera& whichCamera) {2935void Application::setupWorldLight(Camera& whichCamera) {
2933 2936
2934 // Setup 3D lights (after the camera transform, so that they are positioned in world space)2937 // 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
2943 glLightfv(GL_LIGHT0, GL_AMBIENT, ambient_color);2946 glLightfv(GL_LIGHT0, GL_AMBIENT, ambient_color);
2944 GLfloat diffuse_color[] = { 0.8, 0.7, 0.7 };2947 GLfloat diffuse_color[] = { 0.8, 0.7, 0.7 };
2945 glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuse_color);2948 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);
2948 2949
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);
2950 glMateriali(GL_FRONT, GL_SHININESS, 96);2952 glMateriali(GL_FRONT, GL_SHININESS, 96);
2951}2953}
2952 2954
@@ -3024,6 +3026,9 @@ void Application::displaySide(Camera& whichCamera) { · 71 unmodified lines
3024 glutSolidSphere(sphereRadius, 15, 15);3026 glutSolidSphere(sphereRadius, 15, 15);
3025 glPopMatrix();3027 glPopMatrix();
3026 3028
3029 // disable specular lighting for ground and voxels
3030 glMaterialfv(GL_FRONT, GL_SPECULAR, NO_SPECULAR_COLOR);
3031
3027 //draw a grid ground plane....3032 //draw a grid ground plane....
3028 if (_renderGroundPlaneOn->isChecked()) {3033 if (_renderGroundPlaneOn->isChecked()) {
3029 // draw grass plane with fog3034 // draw grass plane with fog
@@ -3052,6 +3057,9 @@ void Application::displaySide(Camera& whichCamera) { · 22 unmodified lines
3052 _voxels.render(_renderVoxelTextures->isChecked());3057 _voxels.render(_renderVoxelTextures->isChecked());
3053 }3058 }
3054 3059
3060 // restore default, white specular
3061 glMaterialfv(GL_FRONT, GL_SPECULAR, WHITE_SPECULAR_COLOR);
3062
3055 // indicate what we'll be adding/removing in mouse mode, if anything3063 // indicate what we'll be adding/removing in mouse mode, if anything
3056 if (_mouseVoxel.s != 0) {3064 if (_mouseVoxel.s != 0) {
3057 glDisable(GL_LIGHTING);3065 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