mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 19:59:28 +02:00
Merge pull request #953 from Phil-Palmer/fix/alpha-zwrite
Disable z-write for transparent draws
This commit is contained in:
commit
a1fe046350
4 changed files with 6 additions and 6 deletions
|
@ -415,7 +415,7 @@ gpu::PipelinePointer ParabolaPointer::RenderState::ParabolaRenderItem::getParabo
|
||||||
|
|
||||||
for (auto& key : keys) {
|
for (auto& key : keys) {
|
||||||
gpu::StatePointer state = gpu::StatePointer(new gpu::State());
|
gpu::StatePointer state = gpu::StatePointer(new gpu::State());
|
||||||
state->setDepthTest(true, true, gpu::LESS_EQUAL);
|
state->setDepthTest(true, !std::get<0>(key), gpu::LESS_EQUAL);
|
||||||
if (std::get<0>(key)) {
|
if (std::get<0>(key)) {
|
||||||
PrepareStencil::testMask(*state);
|
PrepareStencil::testMask(*state);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -125,7 +125,7 @@ Procedural::Procedural() {
|
||||||
opaqueStencil(_opaqueState);
|
opaqueStencil(_opaqueState);
|
||||||
|
|
||||||
_transparentState->setCullMode(gpu::State::CULL_NONE);
|
_transparentState->setCullMode(gpu::State::CULL_NONE);
|
||||||
_transparentState->setDepthTest(true, true, gpu::LESS_EQUAL);
|
_transparentState->setDepthTest(true, false, gpu::LESS_EQUAL);
|
||||||
_transparentState->setBlendFunction(true,
|
_transparentState->setBlendFunction(true,
|
||||||
gpu::State::SRC_ALPHA, gpu::State::BLEND_OP_ADD, gpu::State::INV_SRC_ALPHA,
|
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);
|
gpu::State::FACTOR_ALPHA, gpu::State::BLEND_OP_ADD, gpu::State::ONE);
|
||||||
|
|
|
@ -2027,7 +2027,7 @@ void GeometryCache::useGridPipeline(gpu::Batch& batch, GridBuffer gridBuffer, bo
|
||||||
|
|
||||||
for (auto& key : keys) {
|
for (auto& key : keys) {
|
||||||
gpu::StatePointer state = gpu::StatePointer(new gpu::State());
|
gpu::StatePointer state = gpu::StatePointer(new gpu::State());
|
||||||
state->setDepthTest(true, true, gpu::LESS_EQUAL);
|
state->setDepthTest(true, !std::get<0>(key), gpu::LESS_EQUAL);
|
||||||
if (std::get<0>(key)) {
|
if (std::get<0>(key)) {
|
||||||
PrepareStencil::testMask(*state);
|
PrepareStencil::testMask(*state);
|
||||||
} else {
|
} else {
|
||||||
|
@ -2135,7 +2135,7 @@ gpu::PipelinePointer GeometryCache::getWebBrowserProgram(bool transparent, bool
|
||||||
auto pipeline = (transparent || forward) ? web_browser_forward : web_browser;
|
auto pipeline = (transparent || forward) ? web_browser_forward : web_browser;
|
||||||
|
|
||||||
gpu::StatePointer state = gpu::StatePointer(new gpu::State());
|
gpu::StatePointer state = gpu::StatePointer(new gpu::State());
|
||||||
state->setDepthTest(true, true, gpu::LESS_EQUAL);
|
state->setDepthTest(true, !transparent, gpu::LESS_EQUAL);
|
||||||
// FIXME: do we need a testMaskDrawNoAA?
|
// FIXME: do we need a testMaskDrawNoAA?
|
||||||
PrepareStencil::testMaskDrawShapeNoAA(*state);
|
PrepareStencil::testMaskDrawShapeNoAA(*state);
|
||||||
state->setBlendFunction(transparent,
|
state->setBlendFunction(transparent,
|
||||||
|
@ -2207,7 +2207,7 @@ gpu::PipelinePointer GeometryCache::getSimplePipeline(bool textured, bool transp
|
||||||
} else {
|
} else {
|
||||||
state->setCullMode(gpu::State::CULL_BACK);
|
state->setCullMode(gpu::State::CULL_BACK);
|
||||||
}
|
}
|
||||||
state->setDepthTest(true, true, gpu::LESS_EQUAL);
|
state->setDepthTest(true, !config.isTransparent(), gpu::LESS_EQUAL);
|
||||||
if (config.hasDepthBias()) {
|
if (config.hasDepthBias()) {
|
||||||
state->setDepthBias(1.0f);
|
state->setDepthBias(1.0f);
|
||||||
state->setDepthBiasSlopeScale(1.0f);
|
state->setDepthBiasSlopeScale(1.0f);
|
||||||
|
|
|
@ -276,7 +276,7 @@ void Font::setupGPU() {
|
||||||
for (auto& key : keys) {
|
for (auto& key : keys) {
|
||||||
auto state = std::make_shared<gpu::State>();
|
auto state = std::make_shared<gpu::State>();
|
||||||
state->setCullMode(gpu::State::CULL_BACK);
|
state->setCullMode(gpu::State::CULL_BACK);
|
||||||
state->setDepthTest(true, true, gpu::LESS_EQUAL);
|
state->setDepthTest(true, !std::get<0>(key), gpu::LESS_EQUAL);
|
||||||
state->setBlendFunction(std::get<0>(key),
|
state->setBlendFunction(std::get<0>(key),
|
||||||
gpu::State::SRC_ALPHA, gpu::State::BLEND_OP_ADD, gpu::State::INV_SRC_ALPHA,
|
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);
|
gpu::State::FACTOR_ALPHA, gpu::State::BLEND_OP_ADD, gpu::State::ONE);
|
||||||
|
|
Loading…
Reference in a new issue