inversed 0 and 1 value for glStencil
This commit is contained in:
parent
34bfe8d419
commit
69c79c303d
@ -148,6 +148,7 @@ void DeferredPipeline::renderGL(Scene *scene)
|
|||||||
glClearColor(0.0f, 0.0f, 0.0f, 1.f);
|
glClearColor(0.0f, 0.0f, 0.0f, 1.f);
|
||||||
glClearDepth(1.0f);
|
glClearDepth(1.0f);
|
||||||
glClearStencil(0);
|
glClearStencil(0);
|
||||||
|
glStencilMask(0xFF);
|
||||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
|
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
|
||||||
glStencilMask(0x01);
|
glStencilMask(0x01);
|
||||||
glStencilFunc(GL_ALWAYS, 0x01, 0x01); // always draw fragments (ignore the stencil buffer values for now)
|
glStencilFunc(GL_ALWAYS, 0x01, 0x01); // always draw fragments (ignore the stencil buffer values for now)
|
||||||
@ -204,12 +205,12 @@ void DeferredPipeline::renderGL(Scene *scene)
|
|||||||
{
|
{
|
||||||
shader->bind();
|
shader->bind();
|
||||||
shader->bindInteger(shader->getLocation("emissionBuffer"), GBuffer::EMISSION);
|
shader->bindInteger(shader->getLocation("emissionBuffer"), GBuffer::EMISSION);
|
||||||
glStencilFunc(GL_EQUAL, 1, 0x01);
|
glStencilFunc(GL_EQUAL, 0, 0x01);
|
||||||
SparrowRenderer::drawQuad();
|
SparrowRenderer::drawQuad();
|
||||||
}
|
}
|
||||||
|
|
||||||
// loop on light sources
|
// loop on light sources
|
||||||
glStencilFunc(GL_EQUAL, 0, 0x01);
|
glStencilFunc(GL_EQUAL, 1, 0x01);
|
||||||
for(SceneIterator<Light*>* lightIt = scene->getLights();
|
for(SceneIterator<Light*>* lightIt = scene->getLights();
|
||||||
lightIt->isValid(); lightIt->next())
|
lightIt->isValid(); lightIt->next())
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user