Repository navigation
A camera ray's fog light is seen directly - #286
Merged
Merged
Conversation
…, step 2): the kernel The first pass follows a chain of mirrors and leaves its length and transform; the paths walk the chain again and give the surface it shows the camera hit's place: the guides, the light seen directly, the signals' split. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
… its weight a Fresnel reflectance Measured on twelve heavy clips without a mirror: the step cost 5.3 % of a frame in every one, the chain's code being in every kernel. A material whose own numbers say a mirror makes the feature. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
… the light, a translucent card before and behind the mirror Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A step in the middle of main's loop cost 3 to 5 % of a frame wherever a scene had a mirror (measured with the feature forced on); the first pass's walk 0.2 %. The chain's record: the hit shown, its ray's start, the transform, the chain's weight and light. The hits' buffer follows the traced size, with a chain's room in a scene with a mirror. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The chain's record read at the top of the loop's first turn, and again after the loop for the guides' turn and weight: nothing of it is kept through the loop but its length and its way. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…e bounce; the last vertex's light behind a chain Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
… shows; the merged cache after the hits grow From review: a chain as long as a path's bounces left the surface shown unlit (now all but one of them at most); homogeneous media on the segment the last mirror shows were dropped (main has them there as on a later segment); the merged layout's radiance cache is another buffer once the hits' buffer grows, and the view's cache is that one. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
# Conflicts: # renderer/src/live/inplace_tests.rs
…shows Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The ambient light height fog scatters towards the camera joins the emission signal, as the aerial haze does. As the surface's diffuse light it was divided by the surface's albedo and filtered with it: fog before a black surface was lost. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…e what is left of the camera's Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
# Conflicts: # docs/ROADMAP.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The first step of taking fog out of the path's signals.
The ambient light height fog scatters towards the camera on a camera ray joins the emission signal, as the aerial haze already does. It was part of the surface's diffuse light, which the filters divide by the surface's albedo (floored at 0.02) and filter with the surface: fog before a black surface was lost, and fog was blurred with what stood behind it.
Not in this step: the fog's attenuation stays the path's, and so does its sampled scattering from lights (outside the diffuse signal it would be unfiltered noise). Both leave with a volume of their own, the next step.
Checks
the_fogs_ambient_light_is_seen_directly: a black surface in fog with no light in the scene: the diffuse signal is empty, the emission signal holds the fog's light by the distance, and the picture shows it.🤖 Generated with Claude Code
Note
Medium Risk
Touches live path-tracing signal layout and denoiser inputs for foggy camera rays; behaviour change is targeted and covered by a new inplace GPU test, with small reported GPU cost.
Overview
First step of separating fog from path signals: ambient height-fog scattered toward the camera on the primary ray is recorded as directly seen light in the emission signal (
e0), the same way aerial haze already is—not mixed into diffuse irradiance that denoisers divide by surface albedo.In
pathtrace.wgsl, fog along the camera march still adds to pathradiance, but whendepth == 0the ambient termthr * (1.0 - tr) * P.fog_color.rgbis also accumulated intoe0. That fixes black (or very dark) surfaces in fog: fog colour was effectively lost when folded into diffuse and filtered with albedo.Still on the path for later work: fog attenuation and light-sampled scattering remain path signals; docs note a future volume pass for those.
Adds GPU live test
the_fogs_ambient_light_is_seen_directly(no scene lights, black quad in fog: empty diffuse, emission matches fog by hit distance, framebuffer shows fog tint). ROADMAP and RUNTIME live-architecture notes updated.Reviewed by Cursor Bugbot for commit 4df89f2. Bugbot is set up for automated code reviews on this repo. Configure here.