From fddf0cf6e95f2ed1bbb77caa090aabe3a56c565f Mon Sep 17 00:00:00 2001 From: Nick Gasson <nick@nickg.me.uk> Date: Mon, 17 Aug 2009 19:48:50 +0100 Subject: [PATCH] Fiddle with the lighting a bit --- src/Light.cpp | 8 ++++---- src/Mesh.cpp | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Light.cpp b/src/Light.cpp index 2685345..70589b1 100644 --- a/src/Light.cpp +++ b/src/Light.cpp @@ -24,13 +24,13 @@ struct SunLight : ILight { void apply() const { - const GLfloat globalAmbient[] = { 0.25f, 0.25f, 0.25f, 1.0f }; + const GLfloat globalAmbient[] = { 0.35f, 0.35f, 0.35f, 1.0f }; glLightModelfv(GL_LIGHT_MODEL_AMBIENT, globalAmbient); const GLfloat ambient[] = { 0.0f, 0.0f, 0.0f, 1.0f }; - const GLfloat diffuse[] = { 0.5f, 0.5f, 0.5f, 1.0f }; - const GLfloat specular[] = { 0.5f, 0.5f, 0.5f, 1.0f }; - const GLfloat position[] = { 1.0f, 5.0f, 0.0f, + const GLfloat diffuse[] = { 0.4f, 0.4f, 0.4f, 1.0f }; + const GLfloat specular[] = { 0.4f, 0.4f, 0.4f, 1.0f }; + const GLfloat position[] = { 1.0f, 1.0f, 0.0f, 0.0f }; // => non-directional glLightfv(GL_LIGHT0, GL_AMBIENT, ambient); diff --git a/src/Mesh.cpp b/src/Mesh.cpp index 3d77f00..00913ee 100644 --- a/src/Mesh.cpp +++ b/src/Mesh.cpp @@ -231,7 +231,7 @@ void Material::apply() const if (texture) { glEnable(GL_TEXTURE_2D); texture->bind(); - + glEnable(GL_COLOR_MATERIAL); glColor3f(1.0f, 1.0f, 1.0f); } @@ -425,9 +425,9 @@ void VertexArrayMesh::render() const } if (hasTexture) { - glEnableClientState(GL_TEXTURE_COORD_ARRAY); - glTexCoordPointer(2, GL_FLOAT, sizeof(VertexData), - reinterpret_cast<GLvoid*>(&myVertexData->tx)); + glEnableClientState(GL_TEXTURE_COORD_ARRAY); + glTexCoordPointer(2, GL_FLOAT, sizeof(VertexData), + reinterpret_cast<GLvoid*>(&myVertexData->tx)); } glEnableClientState(GL_VERTEX_ARRAY); -- 2.39.5