Repository navigation
fix(render): Bruneton atmosphere stays off until measured - #395
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai review |
1 similar comment
|
@coderabbitai review |
There was a problem hiding this comment.
Verdict
Do not enable this path. PresentationQuality::Measured leaving Bruneton off is the right call: the published 3.688 ms heavy-scene figure does not include the pass, and gpu_frame_budget has no --atmosphere switch. The shader and bind-group change behind PresentationQuality::Atmosphere still builds the wrong sky, and the tests never look at a pixel.
HEAD is 5e172835. The title still says the pass is on by default. c4d173cd did turn it on and called the cost “about 1 ms”. That number is an estimate. The follow-up put the default back to off and left the composite in place.
What holds
- Sim determinism. No replay case, save, or tick reads this. The diff does not write simulation state, sample wall time, or draw an unseeded RNG. The nineteen cross-OS cases stay on the CPU sim.
- Security. No new
unsafe, no discardedResulton I/O, no user-supplied shader.textureLoadoft_skysits after the workgroup bounds check. Binding 6 matches the new layout (Float { filterable: false }).sky_viewis the full-resolutionrgba16floattarget, so the coordinate is the screen pixel. The sky write and the aerial sample are separate compute passes. - Call path.
Renderer::newstill starts withatmosphere_on: false. Aravath draws throughrender_with→draw_into, which is the path that records the pass.render()never does.
Blocking
The inline comments cover the sky mask, the missing depth/HDR clear, the non-inverted view-projection, the measurement command that does not exist, the smoke test that forbids the default ever changing, and the trace gap.
I did not re-run gated_passes on a GPU in this pass. The submit test would only prove the encoder is accepted. It would not catch the mask or the ray matrix.
Sent by Cursor Automation: ASTRA PR AUDIT AGENT
5e17283 to
ac57bb6
Compare
|
@coderabbitai review |
There was a problem hiding this comment.
Verdict
Keep Bruneton off. HEAD ac57bb6f fixes the sky mask, the missing HDR/depth clear, the uninverted view-projection, the Y-up NDC mapping, and the missing --atmosphere bench flag. PresentationQuality::Measured leaving the pass off is the right default. The title still says the pass is on by default.
PresentationQuality::Atmosphere is not a safe on-switch yet. Aravath composites volumetric fog and god rays into HDR, then aerial scatters that color again, and the bench that is supposed to authorize the flip does not draw fog.
What holds
- Sim determinism. The diff is presentation-only. It does not write ECS, save, or replay state, and it does not sample a wall clock or an unseeded RNG. The star field is a hash of the view ray. The nineteen cross-OS replay cases stay on the CPU sim.
- Security. No new dependency, no new
unsafe, no discardedResulton I/O, no user-supplied shader.textureLoadoft_skysits after the workgroup bounds check. Binding 6 isFloat { filterable: false }, which matches thergba16floatsky target. The sky storage write and the aerial sample are separate compute passes. - The prior mask bugs.
depth_raw == 1.0matches theDepth32Floatclear of 1.draw_intoclears HDR withhdri_sky_clear_colorand depth to 1 before the main pass loads both.prepare_framenow gets(cached_proj * cached_view).inverse().toward_sun = -light_dirmatches the PBR shader (L = normalize(-uCamera.light_dir)). uv.y 0 maps to NDC y +1 in both sky and aerial.--atmosphereis the only gated flag that records a frame; SSGI, TAA, upscale, DoF, and the cloud raymarch bail before a submit. - Trace. §5, invariant 25, and §11 describe this path. The
--atmospherecommand in the previous trace comment now exists.
Still open
The inline comments cover the fog stack, clip_planes on the new 20 km camera, the resize hole, the pixel test that can pass on the clear color, and the campaign row that still describes the pre-change tree.
I did not re-run gated_passes on a GPU. The projection math puts the three sample points on the near quad, the far quad, and empty sky, but that does not prove the sky branch was taken.
Sent by Cursor Automation: ASTRA PR AUDIT AGENT
ac57bb6 to
d7b932c
Compare
|
@coderabbitai review |
There was a problem hiding this comment.
Verdict
Keep Bruneton off. HEAD d7b932c2 fixes the sky mask, the HDR and depth clear, the inverse view-projection, the Y-up NDC mapping, the 20 km clip_planes fallback, the resize hole, and the missing --atmosphere bench flag. PresentationQuality::Measured leaving the pass off is still the right default.
PresentationQuality::Atmosphere is not a safe on-switch. Fog and god rays composite into HDR, then aerial replaces every cleared pixel with the Bruneton sky, so the sky loses both. The pixel test never turns those passes on, and a failed fog or shaft build still prints atmosphere_with_aravath_fog.
What holds
- Sim determinism. The diff is presentation-only. It does not write ECS, save, or replay state, and it does not sample a wall clock or an unseeded RNG. Stars are a hash of the view ray. The nineteen cross-OS replay cases stay on the CPU sim.
- Security. No new dependency, no new
unsafe, no discardedResulton I/O, no user-supplied shader.textureLoadoft_skysits after the workgroup bounds check. Binding 6 isFloat { filterable: false }, which matches thergba16floatsky target. The sky storage write and the aerial sample are separate compute passes.--atmosphereis an exact argv match, and a second gated flag still bails before the device is created. - Prior mask bugs.
depth_raw == 1.0matches theDepth32Floatclear of 1.draw_intoclears HDR withhdri_sky_clear_colorand depth to 1, and the main pass loads both.prepare_framegets(cached_proj * cached_view).inverse().toward_sun = -light_dirmatches the PBR shader. uv.y 0 maps to NDC y +1, the same mapping aspbr.wgsl.Renderer::resizeresizes the pass, andrecord_gated_presentationresizes again if the extent drifted. clip_planes. For glam 0.30perspective_rh, near 0.1 / far 20 km returns about 19973 m (the f32 loss the test allows). Far 200 m and far 500 m stay on the real plane. The old 500 m fallback is gone.
Still open
The inline comments cover the sky overwrite, the pixel test that never enables Aravath fog, the bench label that survives a failed fog or shaft build, and invariant 22 still saying --atmosphere is rejected.
Two dependencies sit under the measured frame. fixed_camera is near 0.1 / far 200, while ThirdPersonCamera::new is far 500, so the froxels are not the game camera's spacing. god_rays.wgsl treats depth ≥ 0.999 as a light source (about 67 m at the bench far plane, about 83 m at Aravath's 500 m), and update_params maps NDC y with ndc * 0.5 + 0.5 while the rasterizer and the new sky use the flipped uv. Shafts on geometry can point away from the Bruneton sun. That projection predates this pull; the new sky makes the split visible.
I did not re-run gated_passes on a GPU. At the test camera, (60, 32) is empty sky, (32, 32) is the far quad, and (10, 32) is the near quad.
Sent by Cursor Automation: ASTRA PR AUDIT AGENT
|
@coderabbitai review |
There was a problem hiding this comment.
Verdict
Keep Bruneton off. HEAD 341c2ac4 copies the Bruneton sky onto HDR before volumetric fog and god rays, and gpu_frame_budget bails before a median when either of those pipelines failed to build. PresentationQuality::Measured leaving the pass off is still the right default.
The sky pixel test does not lock that composite. Fog and shafts unproject screen y with the opposite sign from the sky and from pbr.wgsl, and the new asserts sample the horizon row, where the two conventions agree.
What holds
- Sim determinism. The diff is presentation-only. It does not write ECS, save, or replay state, and it does not sample a wall clock or an unseeded RNG for a pixel. Fog time advances by a fixed
1/60per composite. Stars stay a hash of the view ray. The nineteen cross-OS replay cases stay on the CPU sim. - Security. No new dependency, no new
unsafe(astraweave-renderdenies it), no discardedResulton the new bail, no user-supplied shader.flag_onis an exact argv match, and a second gated flag still bails before the device is created.textureLoadoft_skysits after the workgroup bounds check. The aerial texture isrgba16floatwithCOPY_SRC, and HDR hasCOPY_DST. - The reorder. Both
draw_intodepth paths callrecord_brunetonand thencomposite_atmosphere. Aerial still stores the sky texture only at depth exactly 1. With fog or shafts enabled,scatter_geometryis false, so geometry is one scatter. A failedVolumetricFogPass::neworGodRayPass::with_configclears the pass, the enabled queries stay false, and the printed mode isatmosphere_without_fog,atmosphere_without_shafts, oratmosphere_without_volumetrics. - Prior mask, clear, matrix, resize, and far plane. Those fixes from
d7b932c2are still in this tree.clip_planeskeeps a 20 km plane.Renderer::resizeresizes the pass with the window.
Still open
The inline comments cover the mirrored froxel and shaft projection, the horizon pixel the new test samples, and invariant 22 still saying --atmosphere is rejected.
fixed_camera is near 0.1 / far 200. ThirdPersonCamera::new is far 500. The froxel exponential uses whichever far clip_planes returns, so the measured slices are a different spacing from the game camera. The dispatch count matches. The image does not.
Water still writes HDR with read-only depth. A water pixel left at depth 1 is replaced by the sky texture on the way into the composite. The heavy scene does not draw water.
I did not re-run gated_passes on a GPU. The horizon asserts can go green on a mirrored composite.
Sent by Cursor Automation: ASTRA PR AUDIT AGENT
Fog and god rays belong to #395, not to light_the_world. prepare_frame on this head still passes a zenith sun, and that gap stays with #395. The last matching aravath.cfg key wins. DoF writes AdvancedPostFx's "TAA History" texture, which is not TaaPass history, so both defaults stay off. Invariant 22 was re-read at 85ad478. Co-authored-by: Andrew Brown <lazyxeon@users.noreply.github.com>
Fog and god rays belong to #395, not to light_the_world. prepare_frame on this head still passes a zenith sun, and that gap stays with #395. The last matching aravath.cfg key wins. DoF writes AdvancedPostFx's "TAA History" texture, which is not TaaPass history, so both defaults stay off. Invariant 22 was re-read at 85ad478. Co-authored-by: Andrew Brown <lazyxeon@users.noreply.github.com>
The trace keeps main's v1.48 Hi-Z wording and adds the gated-flag reject sentence on the timestamp row. last_verified_commit is 83798b4. #395 owns the clear, the sky sample, and the sun. Fog and god rays stay light_the_world callers. flag_on accepts a bare flag, =true, and a two-token true, and the SSGI, TAA, and upscale errors name the uncopied history images. Co-authored-by: Andrew Brown <lazyxeon@users.noreply.github.com>
351559d to
f72defd
Compare
There was a problem hiding this comment.
Verdict
Keep Bruneton off. HEAD d49d6026 puts fog froxels and the shaft sun on the same screen mapping as the sky and pbr.wgsl (ndc.y = 1 - 2*uv.y, uv.y = 0.5 - 0.5*ndc.y). PresentationQuality::Measured leaving the pass off is still the right default.
The new pixel test does not lock that shaft mapping. Its sun is outside the frustum, so the shaft pass stores black. fog_density.wgsl no longer parses on its own. Invariant 22 still says --atmosphere is rejected.
What holds
- Sim determinism. The diff is presentation-only. It does not write ECS, save, or replay state, and it does not sample a wall clock or an unseeded RNG for a pixel. Fog time still advances by a fixed
1/60per composite. Stars stay a hash of the view ray. The nineteen cross-OS replay cases stay on the CPU sim.GAME_ZFARis the same500.0the third-person camera already used. - Security. No new dependency, no new
unsafe(astraweave-renderdenies it), no discardedResulton the degraded-build bail, no user-supplied shader.flag_onis an exact argv match (--atmosphereor--atmosphere=true). A second gated flag still bails before the device is created.textureLoadoft_skysits after the workgroup bounds check. - The mapping.
screen_uv_to_ndc/ndc_to_screen_uvmatchpbr.wgsland the sky ray.VolumetricFogPassprependsscreen_ndc.wgslon both the density and scatter pipelines.sun_above_the_view_is_the_top_of_the_texturelocks the CPU helper for a sun that is actually in frame.clip_planesstill keeps a 20 km plane. The heavy-scene grid and 64 m terrain sit inside about 46 m offixed_camera, sostep(0.999, depth)(about 83 m at zfar 500) does not treat those models as shaft lights.
Still open
The inline comments cover the off-screen sun, the standalone fog shader, and invariant 22.
Two residuals stay outside this commit. A water pixel left at depth 1 is replaced when aerial copies onto HDR; the heavy scene does not draw water. cloud_raymarching.wgsl still unprojects with uv * 2 - 1, and --clouds is still rejected before a frame.
I did not re-run gated_passes on a GPU. The projection of the test sun is outside the shaft visibility margin, so a green shaft assert would be a later fog step, not a shaft.
Sent by Cursor Automation: ASTRA PR AUDIT AGENT
|
@coderabbitai review |
flag_on treats --name=false and --name false as off, so they do not bail. The parser and its tests live in budget_gate.rs, under the lib test and clippy gates. The inventory records #395's atmosphere median and the SSGI, TAA, and upscale HDR copy blocker. Co-authored-by: Andrew Brown <lazyxeon@users.noreply.github.com>
There was a problem hiding this comment.
Verdict
Keep Bruneton off. HEAD 7fcd20b2 fixes the two defects from the previous pass: the shaft sun is inside the visibility margin, and fog_density.wgsl defines screen_uv_to_ndc itself so the standalone parse can resolve the call. PresentationQuality::Measured leaving the pass off is still the right default.
The trace does not match that binary. Invariant 22 still says gpu_frame_budget rejects --atmosphere and prints the baseline median. shaders/screen_ndc.wgsl is not the module either fog pipeline compiles.
What holds
- Sim determinism. The diff is presentation-only. It does not write ECS, save, or replay state, and it does not sample a wall clock or an unseeded RNG for a pixel. Fog time still advances by a fixed
1/60per composite. Stars stay a hash of the view ray. The nineteen cross-OS replay cases stay on the CPU sim.GAME_ZFARis the same500.0the third-person camera already used. - Security. No new dependency, no new
unsafe(astraweave-renderdenies it), no discardedResulton the degraded-build bail, no user-supplied shader.flag_onis an exact argv match (--atmosphereor--atmosphere=true). A second gated flag still bails before the device is created.textureLoadoft_skysits after the workgroup bounds check. The aerial texture isrgba16floatwithCOPY_SRC, and HDR hasCOPY_DST. - The shaft test. At this camera,
toward_sun = normalize(0.25, 0.48, -1)projects to UV about(0.716, 0.086), inside(0.55..0.95, 0.02..0.22)and inside the[-0.2, 1.2]margin, withclip.w > 0. The black quad covers pixels y 9..55. The upper march (4 steps, density about 0.75) lands on y 10, 9, 8, 7: the last two are above the quad and above the far red quad (that quad starts near UV y 0.284), so they read the depth clear.step(0.999, 1)is 1. The lower march ends at y 17, still on the quad. Depth at 24 m with far 20 km is about 0.9958, so the quad is not a shaft light. Instance color is black, the default normal is flat, snow and scene fog are 0, andNdotLagainst this sun is 0, so the quad stays under the luma gate. Fog is off andscatter_geometryis false while shafts are enabled, so the delta is the shaft add. A march that flips texture y relative to that CPU sun failsgain_upper > gain_lower + 8. - The froxel formula.
screen_uv_to_ndcmatchespbr.wgsl.integrate.wgslsamples the volume with the same screen UV (gid.y0 is the top). The unprojectndc_zmatchesperspective_rhin[0, 1].clip_planesstill keeps a 20 km plane.Renderer::resizestill resizes the pass.
Still open
The inline comments cover invariant 22 and the unused screen module.
Two residuals stay outside this commit. A water pixel left at depth 1 is replaced when aerial copies onto HDR; the heavy scene does not draw water. cloud_raymarching.wgsl still unprojects with uv * 2 - 1, and --clouds is still rejected before a frame. --atmosphere=false is not flag_on, so that token measures the baseline instead of bailing.
I did not re-run gated_passes on a GPU. The projection and the march pixels above are from the same perspective_rh / look_at_rh the test builds.
Sent by Cursor Automation: ASTRA PR AUDIT AGENT
* docs: inventory built systems that are not on the default path List the presentation passes, the live owners that must not be duplicated, and the issues this campaign will not take. Co-authored-by: Andrew Brown <lazyxeon@users.noreply.github.com> * docs: default presentation passes on when they fit 11 ms Record the 7.397 ms cloud-march measurement and the estimates scaled from it. Atmosphere, SSGI, TAA, and depth of field default on. The raymarch and temporal upscale stay off, with the reason next to the cost. Co-authored-by: Andrew Brown <lazyxeon@users.noreply.github.com> * docs: measure gated passes before any default-on 7.397 ms is the cloud-shadow amortization, not the raymarch. gpu_frame_budget can enable atmosphere, SSGI, TAA, DoF, or clouds one flag at a time and print median_gpu_frame_ms. Defaults stay off until a GTX 1660 Ti heavy-scene median is at or under 11 ms. Co-authored-by: Andrew Brown <lazyxeon@users.noreply.github.com> * fix(render): only --atmosphere can fill a budget cell Reject a second gated flag. Reject SSGI, TAA, upscale, DoF, and the cloud raymarch before a frame: those paths sample uncleared textures or never write HDR. --atmosphere replaces SkyRenderer, so its median is the whole frame. Invariant 22 records that contract. Co-authored-by: Andrew Brown <lazyxeon@users.noreply.github.com> * docs: name the cfg volumetrics switch and split the shadow rows aravath.cfg volumetrics=off turns fog and god rays off before the command-line switches. shadow_csm.rs is the second cascade map. shadow_quality.rs is the PCSS filter, not another atlas. Co-authored-by: Andrew Brown <lazyxeon@users.noreply.github.com> * fix(render): reject every gated budget flag gpu_frame_budget bails before the scene on --atmosphere as well as --ssgi, --taa, --upscale, --dof, and --clouds. The printed median stays the baseline frame. Every gated cell stays blank and every gated default stays off. Co-authored-by: Andrew Brown <lazyxeon@users.noreply.github.com> * docs: correct the inventory against the current renderer Fog and god rays belong to #395, not to light_the_world. prepare_frame on this head still passes a zenith sun, and that gap stays with #395. The last matching aravath.cfg key wins. DoF writes AdvancedPostFx's "TAA History" texture, which is not TaaPass history, so both defaults stay off. Invariant 22 was re-read at 85ad478. Co-authored-by: Andrew Brown <lazyxeon@users.noreply.github.com> * fix(render): rebase the inventory onto main and test the flag gate The trace keeps main's v1.48 Hi-Z wording and adds the gated-flag reject sentence on the timestamp row. last_verified_commit is 83798b4. #395 owns the clear, the sky sample, and the sun. Fog and god rays stay light_the_world callers. flag_on accepts a bare flag, =true, and a two-token true, and the SSGI, TAA, and upscale errors name the uncopied history images. Co-authored-by: Andrew Brown <lazyxeon@users.noreply.github.com> * fix(render): parse gated false flags in the lib gate flag_on treats --name=false and --name false as off, so they do not bail. The parser and its tests live in budget_gate.rs, under the lib test and clippy gates. The inventory records #395's atmosphere median and the SSGI, TAA, and upscale HDR copy blocker. Co-authored-by: Andrew Brown <lazyxeon@users.noreply.github.com> * fix(render): name the uncopied SSGI, TAA, and upscale views The reject reasons still cite the unwritten inputs and history samples, and now also say each pass writes its own view and that view is never copied onto hdr_tex. Co-authored-by: Andrew Brown <lazyxeon@users.noreply.github.com> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Andrew Brown <lazyxeon@users.noreply.github.com>
Sky-depth pixels load the Bruneton sky instead of the empty scene color. Aravath calls set_atmosphere_enabled(true). The estimate against the 3.688 ms heavy scene is about 1 ms, under the 11 ms limit. Co-authored-by: Andrew Brown <lazyxeon@users.noreply.github.com>
The runtime caller reads PresentationQuality, whose default leaves the flag off. Sky-depth pixels still load the Bruneton sky when a caller enables the pass. No default-on from the 1 ms estimate. Co-authored-by: Andrew Brown <lazyxeon@users.noreply.github.com>
Aerial treats only a cleared depth of 1 as sky. The ray uses the inverse view-projection, the scene sun, and the camera clip planes. draw_into clears HDR and depth when Bruneton replaces SkyRenderer. The runtime flag follows PresentationQuality, and a headless frame checks sky against near and far geometry. Co-authored-by: Andrew Brown <lazyxeon@users.noreply.github.com>
--atmosphere is the one gated flag. It clears HDR and depth, samples the Bruneton sky, and draws Aravath's fog and god rays without a second scatter. clip_planes keeps a 20 km far plane, and the pass resizes with the window. The sky pixel test rejects the debug magenta clear. Co-authored-by: Andrew Brown <lazyxeon@users.noreply.github.com>
Bruneton copies onto HDR before volumetric fog and god rays, so a cleared pixel keeps both. The sky pixel test enables those passes. A failed fog or shaft build prints the degraded mode and exits before a median instead of claiming atmosphere_with_aravath_fog. Co-authored-by: Andrew Brown <lazyxeon@users.noreply.github.com>
Fog froxels and the shaft sun follow the sky and pbr mapping: ndc.y = 1 - 2*uv.y, uv.y = 0.5 - 0.5*ndc.y. The pixel test samples an upper sky row and a lower ground row with an off-center sun, so a mirrored composite fails. The budget camera far plane is GAME_ZFAR. Co-authored-by: Andrew Brown <lazyxeon@users.noreply.github.com>
The pixel test puts the sun in the upper-right shaft margin and reads a black quad just under it, with fog off. That row brightens, the shaft texel is not black, and the y-mirrored row does not. fog_density.wgsl and scatter.wgsl define screen_uv_to_ndc themselves so the standalone naga parse resolves the call. The timestamp row is unchanged. Co-authored-by: Andrew Brown <lazyxeon@users.noreply.github.com>
The atmosphere budget calls budget_gate::flag_on, so --atmosphere false is off. record_bruneton uses the light direction, or the time-of-day sun when that vector is empty, and the game camera publishes GAME_ZNEAR with GAME_ZFAR. Invariant 22 keeps main's Hi-Z and false-flag sentences and records the --atmosphere measurement. Co-authored-by: Andrew Brown <lazyxeon@users.noreply.github.com>
7fcd20b to
8d6e986
Compare
|
@coderabbitai review |
There was a problem hiding this comment.
Verdict
Keep Bruneton off. HEAD 8d6e9867 fixes the timestamp contract: invariant 22 and the v1.51 notice now say --atmosphere alone measures atmosphere_with_aravath_fog, and a failed fog or shaft build exits before a median. PresentationQuality::Measured leaving the pass off is still the right default. There is no GTX 1660 Ti median on this head.
The live command and the tested gate are not the same function. docs/current/WIRING_CAMPAIGN.md still describes the pre-change call. Two earlier threads are still open: shaders/screen_ndc.wgsl has no includer, and the shaft pixel test never runs fog_density.wgsl.
What holds
- Sim determinism. The diff is presentation-only. It does not write ECS, save, or replay state, and it does not sample a wall clock or an unseeded RNG for a pixel. Fog time still advances by a fixed
1/60per composite. Stars stay a hash of the view ray. The nineteen cross-OS replay cases stay on the CPU sim. The atmosphere bench setscurrent_time = 16.4andtime_scale = 0beforeupdate_view, so the sampled sun is frozen. At 16.4,get_sun_position().yis about 0.41,get_light_direction()is the negation, andrecord_brunetonnegates that again, so the Bruneton sun is the time-of-day sun.GAME_ZFARis the same500.0the third-person camera already used. - Security. No new dependency (
astraweave-renderalready depends onastraweave-camera). No newunsafe. No discardedResulton the degraded-build bail. No user-supplied shader.flag_onis an exact argv match. A second enabled gated flag still bails beforeRenderer::new.textureLoadoft_skysits after the workgroup bounds check. Binding 6 isFloat { filterable: false }on thergba16floatsky target. The sky storage write and the aerial sample are separate compute passes. The aerial texture and HDR are bothRgba16Float, and HDR hasCOPY_DST. - The composite.
draw_intoclears HDR and depth, the main pass loads both,record_brunetoncopies the sky onto HDR, then fog and shafts composite. With either pass enabled,scatter_geometryis false, so geometry is one scatter. Cleared pixels (depth == 1) keep the fog and shafts that run afterward.Renderer::resizeresizes the pass.clip_planesstill keeps a 20 km plane.
Still open
The inline comments cover the forked flag gate and the campaign inventory.
shaders/screen_ndc.wgsl is still unused. VolumetricFogPass compiles the copies inside fog_density.wgsl and scatter.wgsl. §5 does not list the file. The shaft frame in gated_passes.rs still forces fog off, so a flipped ndc.y in the froxel shader still passes that test.
Two residuals stay outside this commit. A water pixel left at depth 1 is replaced when aerial copies onto HDR; run_water_pass draws with read-only depth before record_bruneton, and the heavy scene does not draw water. cloud_raymarching.wgsl still unprojects with uv * 2 - 1, and --clouds is still rejected before a frame. god_rays.wgsl still treats raw depth ≥ 0.999 as a light (about 83 m at GAME_ZFAR). The heavy grid ends near 46 m, so that cutoff does not light the bench models.
I did not re-run gated_passes on a GPU. The 16.4 sun sign and the 83 m shaft cutoff are from the same get_sun_position and perspective_rh this head builds.
Sent by Cursor Automation: ASTRA PR AUDIT AGENT
reject_gated_flags accepts --atmosphere alone and describes the HDR clear. The bin calls that function. The campaign doc names record_bruneton. screen_ndc.wgsl is deleted, and height fog on the shaft rows fails if fog_density flips ndc.y. Co-authored-by: Andrew Brown <lazyxeon@users.noreply.github.com>
|
@coderabbitai review |
There was a problem hiding this comment.
Verdict
Keep Bruneton off. HEAD 3eacf8a9 puts the budget gate in one function: reject_gated_flags accepts --atmosphere alone, rejects every other enabled gated flag, and gpu_frame_budget calls it. The unused screen_ndc.wgsl is deleted, and the new height-fog sample locks fog_density.wgsl. PresentationQuality::Measured leaving the pass off is still the right default. There is no GTX 1660 Ti median on this head.
scatter.wgsl still has its own screen_uv_to_ndc. The new assert stays green if that copy is mirrored, because ambient in-scatter follows the density written by fog_density.wgsl. The wiring order list tells the next pass that record_bruneton uses the time-of-day sun and clip_planes(GAME_ZNEAR, GAME_ZFAR). The call passes -light_dir when that vector is non-empty, and clip_planes of the bound projection.
Checked on this head: no new dependency, no new unsafe, no simulation write, replay inputs untouched. flag_on still treats bare, =true, and true as on, and =false and false as off. With Bruneton on, draw_into still clears HDR and depth and the main pass loads both. Gate (fmt, clippy, check), cargo-deny, cargo-audit, and the macOS replay hash passed. The Ubuntu affected test was still pending, so this review did not see the new lavapipe pixel assert run.
Sent by Cursor Automation: ASTRA PR AUDIT AGENT
| // ---- Froxel → world position (same exponential distribution as density pass) ---- | ||
| // uv.y 0 is the top of the texture. NDC y is +1 there. Same pair as pbr.wgsl. | ||
|
|
||
| fn screen_uv_to_ndc(uv: vec2<f32>) -> vec2<f32> { |
There was a problem hiding this comment.
screen_uv_to_ndc here is a second copy of the function in fog_density.wgsl. The new pixel assert does not read this copy.
integrate.wgsl samples the scatter volume with the screen UV as the froxel xy. The density in that voxel was written by fog_density.wgsl. scatter_main multiplies that density by the phase and the shadow, and it also adds ambient_color * density * 0.25, which does not use world_pos. A mirrored ndc.y in this file moves the phase and the shadow sample. The ambient term still follows fog_density.wgsl, so fog_lower > fog_upper + 8 still passes.
The two functions match today (ndc.y = 1 - 2*uv.y). Nothing compares the source. ndc_to_screen_uv in god_rays.rs is the CPU pair and does not compile this shader. A source compare of the two WGSL functions would fail a mirrored copy without a device.
| ## Order | ||
|
|
||
| 1. This inventory. `gpu_frame_budget` rejects an enabled gated flag, including `--atmosphere`. `--flag false` is off. Every gated cell on this binary stays blank. #395 prints `atmosphere_with_aravath_fog` only when both fog and shafts build; otherwise it bails and there is no median. Defaults stay off. | ||
| 1. This inventory. `gpu_frame_budget` accepts `--atmosphere` alone. `--flag false` is off. The run prints `atmosphere_with_aravath_fog` only when both fog and shafts build; otherwise it bails and there is no median. `record_bruneton` uses the time-of-day sun and `clip_planes(GAME_ZNEAR, GAME_ZFAR)`. Defaults stay off. |
There was a problem hiding this comment.
This sentence names a call that is not in record_bruneton.
The sun is -light_dir when light_dir_pad is non-empty. get_sun_position() runs only when that vector is empty. The bench writes current_time = 16.4 and time_scale = 0 before update_view. With no light override, get_light_direction() at 16.4 is -get_sun_position(), so the double negation is the afternoon sun. A light override, which the pixel test sets, replaces that sun. The planes are clip_planes(cached_proj). That function takes the matrix. GAME_ZNEAR / GAME_ZFAR (0.1 / 500) are what fixed_camera and ThirdPersonCamera pass to perspective. The headless atmosphere test uses far 20_000, and clip_planes recovers that far. Feeding the two constants into the prepare call would put 500 back on that camera.
ATMOSPHERE_REASON says "copies the time-of-day sun", and the lib test does not check that phrase. The atmosphere row above ("clip_planes of the bound camera") matches the code. This order line should say the same thing.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3eacf8a9ae
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (depth_raw == 1.0) { | ||
| let sky = textureLoad(t_sky, pixel, 0); | ||
| textureStore(t_output, pixel, vec4<f32>(sky.rgb, 1.0)); |
There was a problem hiding this comment.
Preserve transparent water when replacing sky pixels
When atmosphere is enabled and water is visible over the far-plane clear, this branch replaces the already-rendered water with t_sky. renderer.rs:8067-8077 records run_water_pass before Bruneton, while water.rs:584 disables water depth writes, so those water pixels still have depth 1.0; the previous shader preserved scene_color for them. Record Bruneton before transparent water/overlays or otherwise preserve their color.
Useful? React with 👍 / 👎.


Description
Draft. Does not merge. Rebased onto
mainat7427bc05.The default stays off.
gpu_frame_budgetcallsbudget_gate::reject_gated_flags.--atmospherealone is accepted. The reason is thatdraw_intoclears HDR and depth, the main pass loads both, andrecord_brunetoncopies the time-of-day sun onto that sky.--atmosphere=falseand--atmosphere falseare off. Every other enabled gated flag bails, including a second flag beside--atmosphere. The lib test is the list.record_brunetonpasses the light direction as the sun, or the time-of-day sun when that vector is empty. Near and far come fromclip_planesof the bound camera. The game camera and the budget camera areGAME_ZNEAR/GAME_ZFAR(0.1 / 500).The printed mode is
atmosphere_with_aravath_fogonly when both pipelines built. Otherwise the binary bails before a median.screen_ndc.wgslis deleted.screen_uv_to_ndcis inlined infog_density.wgslandscatter.wgsl. The shaft pixel test enables height fog on the same rows, and a flippedndc.yfails that assert.Invariant 22 keeps main's Hi-Z sentence and the false-flag sentence.
last_verified_commitis8d6e9867. The evidence column namesreject_gated_flags, which the bin calls.Water at depth 1, the cloud unproject, and the shaft depth cutoff are #405.
Type of change
Security Considerations
Checklist
Test plan
cargo test -p astraweave-render --lib reject_gated_flags_covers_each_form—--atmospherealone is accepted; the reason names the clear andrecord_brunetoncargo test -p astraweave-render --test gated_passes atmosphere_sky— shafts brighten the upper row; height fog is stronger on the lower row. A flippedndc.yfailed that fog assert (upper gain 151, lower gain 113) and was restoredcargo clippy -p astraweave-render --locked --lib --no-deps -- -D warnings3eacf8a9