Skip to content

Commit

Permalink
Stereo 3D|Fixed: Blacked out floors and other surfaces
Browse files Browse the repository at this point in the history
The alpha test was still on, preventing some surfaces from being
drawn to the framebuffer via the Oculus Rift distortion shader.

The default GL state of the legacy renderer has alpha test enabled.
  • Loading branch information
skyjake committed Oct 30, 2013
1 parent 43fc3a1 commit b688e55
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions doomsday/client/src/ui/vrcontenttransform.cpp
Expand Up @@ -132,20 +132,25 @@ DENG2_PIMPL(VRContentTransform)

GLState::pop().apply();

glEnable(GL_TEXTURE_2D); // Necessary until the legacy code uses GLState, too.
// Necessary until the legacy code uses GLState, too:
glDisable(GL_ALPHA_TEST);
glEnable(GL_TEXTURE_2D);

// Return the drawing to the full target.
GLState::setActiveRect(Rectangleui()/*, true*/);
GLState::setActiveRect(Rectangleui(), true);

canvas().renderTarget().clear(GLTarget::Color);
GLState::push()
.setBlend(false)
.setDepthTest(false);

glDisable(GL_BLEND);

// Copy contents of offscreen buffer to normal screen.
oculusRift.draw();

glBindTexture(GL_TEXTURE_2D, 0);
glEnable(GL_ALPHA_TEST);
glDepthMask(GL_TRUE);

GLState::pop().apply();
Expand Down

0 comments on commit b688e55

Please sign in to comment.