back to the office monday morning, State almost working in the full piupeline

This commit is contained in:
Sam Gateau 2015-03-30 10:10:39 -07:00
parent 3baa4eadeb
commit 2a58a65a8f
4 changed files with 7 additions and 3 deletions

View file

@ -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<GeometryCache>()->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();

View file

@ -65,7 +65,7 @@ void GLBackend::do_setPipeline(Batch& batch, uint32 paramOffset) {
}
if (_pipeline._needStateSync) {
syncPipelineStateCache();
// syncPipelineStateCache();
_pipeline._needStateSync = false;
}

View file

@ -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;

View file

@ -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);
}