mirror of
https://github.com/overte-org/overte.git
synced 2025-04-08 08:14:48 +02:00
Fix z-write enabled for transparent draws.
Fix z-write being enabled for transparencies in GeometryCache::getSimplePipeline and Procedural::Procedural (fixes https://github.com/vircadia/vircadia/issues/224). Z-write is controlled by the 'writeMask' parameter of gpu::State::setDepthTest.
This commit is contained in:
parent
f1576aba78
commit
90799e10da
2 changed files with 2 additions and 2 deletions
|
@ -125,7 +125,7 @@ Procedural::Procedural() {
|
|||
opaqueStencil(_opaqueState);
|
||||
|
||||
_transparentState->setCullMode(gpu::State::CULL_NONE);
|
||||
_transparentState->setDepthTest(true, true, gpu::LESS_EQUAL);
|
||||
_transparentState->setDepthTest(true, false, gpu::LESS_EQUAL);
|
||||
_transparentState->setBlendFunction(true,
|
||||
gpu::State::SRC_ALPHA, gpu::State::BLEND_OP_ADD, gpu::State::INV_SRC_ALPHA,
|
||||
gpu::State::FACTOR_ALPHA, gpu::State::BLEND_OP_ADD, gpu::State::ONE);
|
||||
|
|
|
@ -2207,7 +2207,7 @@ gpu::PipelinePointer GeometryCache::getSimplePipeline(bool textured, bool transp
|
|||
} else {
|
||||
state->setCullMode(gpu::State::CULL_BACK);
|
||||
}
|
||||
state->setDepthTest(true, true, gpu::LESS_EQUAL);
|
||||
state->setDepthTest(true, !config.isTransparent(), gpu::LESS_EQUAL);
|
||||
if (config.hasDepthBias()) {
|
||||
state->setDepthBias(1.0f);
|
||||
state->setDepthBiasSlopeScale(1.0f);
|
||||
|
|
Loading…
Reference in a new issue