added comments and cleaned up

This commit is contained in:
Anna 2019-06-21 11:34:10 -07:00
parent 250d18d7df
commit 3d36c5714f
2 changed files with 6 additions and 3 deletions

View file

@ -574,9 +574,10 @@ std::function<void(gpu::Batch&, const gpu::TexturePointer&, bool mirror)> OpenGL
std::array<glm::ivec4, 2> hudEyeViewports;
for_each_eye([&](Eye eye) { hudEyeViewports[eye] = eyeViewport(eye); });
return [=](gpu::Batch& batch, const gpu::TexturePointer& hudTexture, bool mirror) {
if (hudPipeline && hudTexture) {
auto pipeline = mirror ? hudMirrorPipeline : hudPipeline;
if (pipeline && hudTexture) {
batch.enableStereo(false);
batch.setPipeline(mirror ? hudMirrorPipeline : hudPipeline);
batch.setPipeline(pipeline);
batch.setResourceTexture(0, hudTexture);
if (hudStereo) {
for_each_eye([&](Eye eye) {
@ -954,6 +955,9 @@ gpu::PipelinePointer OpenGLDisplayPlugin::getCompositeScenePipeline() {
return _drawTexturePipeline;
}
// Added this to allow desktop composite framebuffer to be RGBA while mobile is SRGBA, so that tone mapping looks right on both platforms
// Overridden by Basic2DWindowDisplayPlugin to achieve this
// FIXME: Eventually it would be ideal to have both framebuffers be of the same type
gpu::Element OpenGLDisplayPlugin::getCompositeFBColorSpace() {
return gpu::Element::COLOR_RGBA_32;
}

View file

@ -167,7 +167,6 @@ void OculusDisplayPlugin::hmdPresent() {
batch.setStateScissorRect(ivec4(uvec2(), _outputFramebuffer->getSize()));
batch.resetViewTransform();
batch.setProjectionTransform(mat4());
//batch.setPipeline(_drawTexturePipeline);
batch.setPipeline(_drawTexturePipeline);
batch.setResourceTexture(0, _compositeFramebuffer->getRenderBuffer(0));
batch.draw(gpu::TRIANGLE_STRIP, 4);