Skip to content

Commit

Permalink
--address hbao image transparency oddness (#2214)
Browse files Browse the repository at this point in the history
  • Loading branch information
jturner65 authored Sep 26, 2023
1 parent 4b7f3cd commit 9826bd1
Show file tree
Hide file tree
Showing 24 changed files with 9 additions and 6 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified data/test_assets/hbao_tests/van-gogh-room.hbao-cache-geom.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified data/test_assets/hbao_tests/van-gogh-room.hbao-cache-ortho.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified data/test_assets/hbao_tests/van-gogh-room.hbao-cache-strong.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified data/test_assets/hbao_tests/van-gogh-room.hbao-cache.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified data/test_assets/hbao_tests/van-gogh-room.hbao-classic.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 0 additions & 3 deletions src/esp/gfx/RenderTarget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,6 @@ struct RenderTarget::Impl {
if (!hbao_) {
return;
}
// TODO:Support a toggle between cache-aware and classic algorithm. For now
// we just use cache aware
bool useCacheAware = true;

hbao_->drawEffect(visualSensor_->getProjectionMatrix(),
gfx_batch::HbaoType::CacheAware, depthRenderTexture_,
Expand Down
12 changes: 9 additions & 3 deletions src/esp/gfx_batch/Hbao.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -882,7 +882,9 @@ void Hbao::drawHbaoBlur(Mn::GL::AbstractFramebuffer& output) {
Mn::GL::Renderer::enable(Mn::GL::Renderer::Feature::Blending);
Mn::GL::Renderer::setBlendFunction(
Mn::GL::Renderer::BlendFunction::Zero,
Mn::GL::Renderer::BlendFunction::SourceColor);
Mn::GL::Renderer::BlendFunction::SourceColor,
Mn::GL::Renderer::BlendFunction::Zero,
Mn::GL::Renderer::BlendFunction::One);
// TODO multi samples masking

// Only special blur
Expand Down Expand Up @@ -944,7 +946,9 @@ void Hbao::drawClassicInternal(Mn::GL::AbstractFramebuffer& output) {
Mn::GL::Renderer::enable(Mn::GL::Renderer::Feature::Blending);
Mn::GL::Renderer::setBlendFunction(
Mn::GL::Renderer::BlendFunction::Zero,
Mn::GL::Renderer::BlendFunction::SourceColor);
Mn::GL::Renderer::BlendFunction::SourceColor,
Mn::GL::Renderer::BlendFunction::Zero,
Mn::GL::Renderer::BlendFunction::One);
// TODO Set sample mask if samples > 1
} else {
state_->hbaoCalc.mapForDraw(Mn::GL::Framebuffer::ColorAttachment{0}).bind();
Expand Down Expand Up @@ -1054,7 +1058,9 @@ void Hbao::drawCacheAwareInternal(Mn::GL::AbstractFramebuffer& output) {
Mn::GL::Renderer::enable(Mn::GL::Renderer::Feature::Blending);
Mn::GL::Renderer::setBlendFunction(
Mn::GL::Renderer::BlendFunction::Zero,
Mn::GL::Renderer::BlendFunction::SourceColor);
Mn::GL::Renderer::BlendFunction::SourceColor,
Mn::GL::Renderer::BlendFunction::Zero,
Mn::GL::Renderer::BlendFunction::One);
// TODO Set sample mask if samples > 1

} else {
Expand Down

0 comments on commit 9826bd1

Please sign in to comment.