fix(shader-transitions): show the from-scene at gravitational-lens start#1579
Open
calcarazgre646 wants to merge 1 commit into
Open
fix(shader-transitions): show the from-scene at gravitational-lens start#1579calcarazgre646 wants to merge 1 commit into
calcarazgre646 wants to merge 1 commit into
Conversation
The gravitational-lens frag multiplied the lensed color by a horizon term that darkens the center to black, but the term was not gated by progress. At progress 0 (a paused seek at the transition start, and the first rendered frame) the from-scene rendered as a black-hole vignette instead of the clean outgoing frame. Every other shader in the file collapses cleanly to the from-scene at progress 0. Ramp the horizon darkening in from progress 0 (mix(1., horizon, smoothstep(0., .3, u_progress))) so lensed == from-scene at the start. The progress-1 endpoint is unchanged (the outer mix already selects the to-scene there).
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
The
gravitational-lensfrag (registry.ts) computeslensed = vec3(r, A.g, b) * horizon, wherehorizon = smoothstep(0., .3, dist / (1. - u_progress*.85 + .001))darkens the center toward black. That term is not gated byu_progress, so atu_progress = 0the center is multiplied by ~0 (pure black at the center, fading to 1 only near the corners) while the rest of the math already resolves to the untouched from-scene. The viewer sees a black-hole vignette flash at the transition start (a paused seek at the start, and the first rendered frame, both hit progress 0). The 13 other shaders in the file collapse cleanly to the from-scene at progress 0; this is the only one that does not.Change
Ramp the horizon darkening in from progress 0:
lensed = vec3(r, A.g, b) * mix(1., horizon, smoothstep(0., .3, u_progress)). At progress 0 the factor is 1 (clean from-scene); by progress 0.3 the full lens darkening is in effect, unchanged from before. The progress-1 endpoint is unaffected (the outermix(..., smoothstep(.3, .9, u_progress))already selects the to-scene there).Verification
The center darkening factor at progress 0 goes from 0 (black) to 1 (from-scene); progress 0.3+ and the progress-1 endpoint are unchanged. This package has no headless-GL test path, so shader behavior here is verified by the math and visual inspection, consistent with how the other shaders in the file are maintained.