|
From: Tapio V. <aa...@us...> - 2010-11-03 00:01:38
|
Module: performous
Branch: opengl2
Commit: fce1dabed4b256d9ded74665dc0678879e63905a
Author: Tapio Vierros <tap...@gm...>
Date: Wed Nov 3 01:57:49 2010 +0200
Switch shader in Object3d::draw to avoid having to deal with tail lighting.
---
game/3dobject.hh | 1 +
game/guitargraph.cc | 9 ++++-----
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/game/3dobject.hh b/game/3dobject.hh
index 29f6d66..6a32cb7 100644
--- a/game/3dobject.hh
+++ b/game/3dobject.hh
@@ -70,6 +70,7 @@ class Object3d: boost::noncopyable {
glutil::PushMatrix pm;
glTranslatef(x, y, z); // Move to position
if (s != 1.0) glScalef(s,s,s); // Scale if needed
+ UseShader objectShader(*shader); // Switch shader
if (m_texture) {
UseTexture tex(*m_texture, *shader);
drawVBO();
diff --git a/game/guitargraph.cc b/game/guitargraph.cc
index 5420862..ad04389 100644
--- a/game/guitargraph.cc
+++ b/game/guitargraph.cc
@@ -778,8 +778,8 @@ namespace {
color.a = y2a(y);
{
glutil::Color c(color);
- va.Color(c).Normal(0.0f, 1.0f, 0.0f).TexCoord(0.0f, ty).Vertex(x - fretW, y);
- va.Color(c).Normal(0.0f, 1.0f, 0.0f).TexCoord(1.0f, ty).Vertex(x + fretW, y);
+ va.Color(c).TexCoord(0.0f, ty).Vertex(x - fretW, y);
+ va.Color(c).TexCoord(1.0f, ty).Vertex(x + fretW, y);
}
}
}
@@ -855,8 +855,7 @@ void GuitarGraph::draw(double time) {
}
// Draw the notes
- { UseShader objectShader(*Object3d::shader);
- glutil::UseDepthTest depthtest;
+ { glutil::UseDepthTest depthtest;
// Draw drum fills / Big Rock Endings
bool drumfill = m_dfIt != m_drumfills.end() && m_dfIt->begin - time <= future;
if (drumfill) {
@@ -922,7 +921,7 @@ void GuitarGraph::draw(double time) {
}
glutil::GLErrorChecker::reset(); // FIXME: There are errors here.
//glutil::GLErrorChecker glerror("GuitarGraph::draw - objects");
- } //< restore core shader and disable depth test
+ } //< disable depth test
// Draw flames
for (int fret = 0; fret < m_pads; ++fret) { // Loop through the frets
if (m_drums && fret == 0) { // Skip bass drum
|