Skip to content

Commit

Permalink
fix uninitialized depth for some pixels in helide
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffamstutz committed Nov 22, 2024
1 parent 21adf37 commit 72f5edd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/helide/renderer/Renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,15 +163,15 @@ void Renderer::shadeRay(PixelSample &retval,
const float4 bgColorOpacity =
m_bgImage ? backgroundColorFromImage(*m_bgImage, screen) : m_bgColor;

// Write depth //

retval.depth = hitVolume ? std::min(ray.tfar, vray.t.lower) : ray.tfar;

if (!hitGeometry && !hitVolume) {
retval.color = bgColorOpacity;
return;
}

// Write depth //

retval.depth = hitVolume ? std::min(ray.tfar, vray.t.lower) : ray.tfar;

// Write ids //

if (hitGeometry || hitVolume) {
Expand Down

0 comments on commit 72f5edd

Please sign in to comment.