Repository navigation
A pixel on a mirror has the surface the mirror shows (frame structure, step 2) - #281
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>
| if (chain > 0u) { | ||
| mv = vec4<f32>(xf * mv.xyz, mv.w); | ||
| first_xform_store(pix, xf); | ||
| } |
There was a problem hiding this comment.
Moving mirrors drop virtual motion
Medium Severity
Motion on a mirror pixel is only the shown surface’s world offset, rotated by this frame’s chain. If the mirror itself moves or rotates, that transform does not include the virtual image’s motion, so a static wall in a moving mirror gets a zero vector and reprojection/upscaling ghost.
Reviewed by Cursor Bugbot for commit 25c60ed. Configure here.
There was a problem hiding this comment.
Known and now stated in the docs: the motion vector is the shown surface's motion turned by the chain; a mirror's own motion is not in it, nor a curved mirror's curvature. Not addressed in this step.
… 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
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
Reviewed by Cursor Bugbot for commit 83eec2f. Configure here.
…shows 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>


The second step of the frame's structure. A pixel on a mirror has the surface the mirror shows.
first_hitfollows a camera hit that has a mirror's lobe alone (roughness under 0.025, metalness 1, no glass, no coat), through 8 mirrors at most and all but one of a path's bounces (the surface shown is lit and has its bounce), and records the chain where there is one: the hit the last mirror shows and where its ray starts, the chain's transform, the way to its last mirror, what the mirrors and the segments that end at one leave of the light (Fresnel reflectance; fog's and haze's attenuation) and the light they add (a mirror's emission, fog's and haze's ambient light). It writes the motion vector of the surface shown, as the pixel sees it.mainstarts its path at the surface shown, in the camera hit's place: the guides (its distance the whole way along the camera ray, its normal turned by the chain, its albedo times the chain's weight), the light seen directly, the signals' split, the path's end in the cache a bounce later. Each mirror takes one of the path's bounces.So the filters, the reprojection and the upscaler take a mirror as a window onto what it shows, where its picture was the mirror's specular signal. Glass is as it was;
surface_guidesstays for it and skips a mirror's pixels.Which scenes. The material decides: one whose own roughness and metalness say a mirror. A scene with such a material has the kernel feature
F_MIRRORand 96 bytes more a traced pixel; another scene's kernel has none of this code.Cost. Twelve heavy clips, none with a mirror, a frame's GPU time summed: 93.58 ms against main's 93.58. With the feature forced on in all twelve (what a scene with a mirror pays on every pixel): +0.9 %. Two earlier shapes were measured the same way and dropped:
mainwalking the chain itself in its loop, +3.2 %; the chain's record held throughmain's loop, +5.2 %.Known limits
Checks
a_pixel_on_a_mirror_has_the_surface_the_mirror_shows: a tinted, faintly glowing mirror at 45 degrees shows a side wall. On its pixels: the distance the whole way, the wall's normal as seen, its albedo under the tint; the light the tint times a white mirror's; the glow in the emission signal; a lamp before the wall lights what the mirror shows; with one bounce a path the wall in the mirror is unlit; the wall moved along the view, its motion vectors go sideways; a translucent card before the mirror is drawn, one behind it is not.🤖 Generated with Claude Code