mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 05:57:29 +02:00
Merge pull request #831 from ey6es/master
Disable specular highlights for ground and voxels.
This commit is contained in:
commit
4279d508b7
1 changed files with 11 additions and 3 deletions
|
@ -2929,6 +2929,9 @@ void Application::displayOculus(Camera& whichCamera) {
|
||||||
glPopMatrix();
|
glPopMatrix();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const GLfloat WHITE_SPECULAR_COLOR[] = { 1.0f, 1.0f, 1.0f, 1.0f };
|
||||||
|
const GLfloat NO_SPECULAR_COLOR[] = { 0.0f, 0.0f, 0.0f, 1.0f };
|
||||||
|
|
||||||
void Application::setupWorldLight(Camera& whichCamera) {
|
void Application::setupWorldLight(Camera& whichCamera) {
|
||||||
|
|
||||||
// Setup 3D lights (after the camera transform, so that they are positioned in world space)
|
// Setup 3D lights (after the camera transform, so that they are positioned in world space)
|
||||||
|
@ -2943,10 +2946,9 @@ void Application::setupWorldLight(Camera& whichCamera) {
|
||||||
glLightfv(GL_LIGHT0, GL_AMBIENT, ambient_color);
|
glLightfv(GL_LIGHT0, GL_AMBIENT, ambient_color);
|
||||||
GLfloat diffuse_color[] = { 0.8, 0.7, 0.7 };
|
GLfloat diffuse_color[] = { 0.8, 0.7, 0.7 };
|
||||||
glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuse_color);
|
glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuse_color);
|
||||||
GLfloat specular_color[] = { 1.0, 1.0, 1.0, 1.0};
|
|
||||||
glLightfv(GL_LIGHT0, GL_SPECULAR, specular_color);
|
|
||||||
|
|
||||||
glMaterialfv(GL_FRONT, GL_SPECULAR, specular_color);
|
glLightfv(GL_LIGHT0, GL_SPECULAR, WHITE_SPECULAR_COLOR);
|
||||||
|
glMaterialfv(GL_FRONT, GL_SPECULAR, WHITE_SPECULAR_COLOR);
|
||||||
glMateriali(GL_FRONT, GL_SHININESS, 96);
|
glMateriali(GL_FRONT, GL_SHININESS, 96);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3024,6 +3026,9 @@ void Application::displaySide(Camera& whichCamera) {
|
||||||
glutSolidSphere(sphereRadius, 15, 15);
|
glutSolidSphere(sphereRadius, 15, 15);
|
||||||
glPopMatrix();
|
glPopMatrix();
|
||||||
|
|
||||||
|
// disable specular lighting for ground and voxels
|
||||||
|
glMaterialfv(GL_FRONT, GL_SPECULAR, NO_SPECULAR_COLOR);
|
||||||
|
|
||||||
//draw a grid ground plane....
|
//draw a grid ground plane....
|
||||||
if (_renderGroundPlaneOn->isChecked()) {
|
if (_renderGroundPlaneOn->isChecked()) {
|
||||||
// draw grass plane with fog
|
// draw grass plane with fog
|
||||||
|
@ -3052,6 +3057,9 @@ void Application::displaySide(Camera& whichCamera) {
|
||||||
_voxels.render(_renderVoxelTextures->isChecked());
|
_voxels.render(_renderVoxelTextures->isChecked());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// restore default, white specular
|
||||||
|
glMaterialfv(GL_FRONT, GL_SPECULAR, WHITE_SPECULAR_COLOR);
|
||||||
|
|
||||||
// indicate what we'll be adding/removing in mouse mode, if anything
|
// indicate what we'll be adding/removing in mouse mode, if anything
|
||||||
if (_mouseVoxel.s != 0) {
|
if (_mouseVoxel.s != 0) {
|
||||||
glDisable(GL_LIGHTING);
|
glDisable(GL_LIGHTING);
|
||||||
|
|
Loading…
Reference in a new issue