aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesse Barker <jesse.barker@linaro.org>2012-12-11 11:47:05 -0800
committerJesse Barker <jesse.barker@linaro.org>2012-12-11 11:47:05 -0800
commit11732cabe90df44a62936c73ea406791323597c6 (patch)
tree60c77ca75e10aea10a31d68d1a72d1fc715853e1
parent6f52195da3b55bf19e8f9093b73cc45e9a0288f8 (diff)
downloadglmark2-11732cabe90df44a62936c73ea406791323597c6.tar.gz
SceneRefract: Pull the face culling and depth func switches into the render
target object.
-rw-r--r--src/scene-refract.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/scene-refract.cpp b/src/scene-refract.cpp
index fcbb863..e7fa659 100644
--- a/src/scene-refract.cpp
+++ b/src/scene-refract.cpp
@@ -253,12 +253,16 @@ DistanceRenderTarget::enable(const mat4& mvp)
tex_[COLOR], 0);
glViewport(0, 0, width_, height_);
glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
+ glCullFace(GL_FRONT);
+ glDepthFunc(GL_GREATER);
}
void DistanceRenderTarget::disable()
{
glBindFramebuffer(GL_FRAMEBUFFER, 0);
glViewport(0, 0, canvas_width_, canvas_height_);
+ glCullFace(GL_BACK);
+ glDepthFunc(GL_LEQUAL);
}
bool
@@ -408,7 +412,6 @@ RefractPrivate::draw()
modelview_.pop();
// Enable the depth render target with our transformation and render.
- glCullFace(GL_FRONT);
depthTarget_.enable(mvp);
vector<GLint> attrib_locations;
attrib_locations.push_back(depthTarget_.program()["position"].location());
@@ -421,10 +424,6 @@ RefractPrivate::draw()
mesh_.render_array();
}
depthTarget_.disable();
- glCullFace(GL_BACK);
-
- // Ground rendering using the above generated texture...
- //ground_.draw();
// Draw the "normal" view of the horse
modelview_.push();