From 2a58a65a8fe4f4c18e16249a47414182d0eefc60 Mon Sep 17 00:00:00 2001 From: Sam Gateau Date: Mon, 30 Mar 2015 10:10:39 -0700 Subject: [PATCH] back to the office monday morning, State almost working in the full piupeline --- interface/src/Environment.cpp | 4 +++- libraries/gpu/src/gpu/GLBackendPipeline.cpp | 2 +- libraries/gpu/src/gpu/State.h | 2 +- libraries/render-utils/src/Model.cpp | 2 ++ 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/interface/src/Environment.cpp b/interface/src/Environment.cpp index 5cc132bb7f..5389c81137 100644 --- a/interface/src/Environment.cpp +++ b/interface/src/Environment.cpp @@ -262,9 +262,11 @@ void Environment::renderAtmosphere(Camera& camera, const EnvironmentData& data) program->setUniformValue(locations[G2_LOCATION], -0.990f * -0.990f); glDepthMask(GL_FALSE); - glDisable(GL_DEPTH_TEST); + glDisable(GL_CULL_FACE); + // glDisable(GL_DEPTH_TEST); DependencyManager::get()->renderSphere(1.0f, 100, 50, glm::vec4(1.0f, 1.0f, 1.0f, 1.0f)); //Draw a unit sphere glDepthMask(GL_TRUE); +// glEnable(GL_CULL_FACE); program->release(); diff --git a/libraries/gpu/src/gpu/GLBackendPipeline.cpp b/libraries/gpu/src/gpu/GLBackendPipeline.cpp index 409cf5594c..13051b68cb 100755 --- a/libraries/gpu/src/gpu/GLBackendPipeline.cpp +++ b/libraries/gpu/src/gpu/GLBackendPipeline.cpp @@ -65,7 +65,7 @@ void GLBackend::do_setPipeline(Batch& batch, uint32 paramOffset) { } if (_pipeline._needStateSync) { - syncPipelineStateCache(); + // syncPipelineStateCache(); _pipeline._needStateSync = false; } diff --git a/libraries/gpu/src/gpu/State.h b/libraries/gpu/src/gpu/State.h index 32b91c544c..f3529da01e 100755 --- a/libraries/gpu/src/gpu/State.h +++ b/libraries/gpu/src/gpu/State.h @@ -227,7 +227,7 @@ public: public: FillMode fillMode = FILL_FACE; CullMode cullMode = CULL_NONE; - bool frontFaceClockwise = true; + bool frontFaceClockwise = false; bool depthClipEnable = false; bool scissorEnable = false; bool multisampleEnable = false; diff --git a/libraries/render-utils/src/Model.cpp b/libraries/render-utils/src/Model.cpp index 3f304fc630..9a94716637 100644 --- a/libraries/render-utils/src/Model.cpp +++ b/libraries/render-utils/src/Model.cpp @@ -120,6 +120,8 @@ void Model::RenderPipelineLib::addRenderPipeline(Model::RenderKey& key, // Backface on shadow if (key.isShadow()) { state->setCullMode(gpu::State::CULL_FRONT); + state->setDepthBias(1.1f); + state->setDepthBiasSlopeScale(4.0f); } else { state->setCullMode(gpu::State::CULL_BACK); }