Repository navigation
The last bounce lit by the directional lights alone: THREERT_LAST_DIRECT=sun - #84
Merged
Merged
Conversation
…ECT=sun (`last_sun`) A device whose budget cuts paths to one bounce lit that bounce's vertex by the sky and emitters alone unless `last_direct` was on (Android's default): on a Steam Deck Daylight Home's ceiling was near black, the sunlit floor lighting nothing. `last_direct` gives it back but costs every light's shadow rays at that vertex: on the Deck OpenStrikeRT's Foundry went from 21 to 29 ms a frame. `last_sun` takes the directional lights alone there (one shadow ray a light, `sun_light`, as `direct_light` takes them): Daylight Home lit as with `last_direct`, OpenStrikeRT 22 ms. - `KernelSwitches::last_sun`, flag `last_sun`; THREERT_LAST_DIRECT=sun sets it in place of `last_direct` (which includes it). Off unless set; the ThreeRT clients set it for a one-bounce budget off Android. - `sun_light` and the last vertex's branch are under `@if(last_sun && !last_direct)`: every other variant's WGSL is as it was. - Tests: the option parses on either platform; the variant has the function and the one branch; every variant stays valid WGSL. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Problem: on a device whose budget cuts paths to one bounce, the last vertex gets only sky and emitter light unless
last_directis on (Android's default). On a Steam Deck, Daylight Home's ceiling was near black: the sunlit floor lit nothing.last_directfixes it but adds every light's shadow rays at that vertex: on the Deck, OpenStrikeRT went from 21 to 29 ms a frame (40 → 33 fps).Change:
KernelSwitches::last_sun(THREERT_LAST_DIRECT=sun): the last vertex takes the directional lights alone (sun_light, the same sampling and MIS asdirect_light's directional loop). Measured on the Deck: Daylight Home lit the same as withlast_direct; OpenStrikeRT 22 ms. Off unless set. Everything new sits under@if(last_sun && !last_direct), so every other variant's WGSL is unchanged. Tests cover the option parsing and the variant's shape, andevery_kernel_variant_is_validnow includes it.The ThreeRT clients set it for a one-bounce budget off Android.
🤖 Generated with Claude Code