Skip to content

fix(shader-transitions): show the from-scene at gravitational-lens start#1579

Open
calcarazgre646 wants to merge 1 commit into
heygen-com:mainfrom
calcarazgre646:fix/shader-gravitational-lens-p0
Open

fix(shader-transitions): show the from-scene at gravitational-lens start#1579
calcarazgre646 wants to merge 1 commit into
heygen-com:mainfrom
calcarazgre646:fix/shader-gravitational-lens-p0

Conversation

@calcarazgre646

Copy link
Copy Markdown
Contributor

Problem

The gravitational-lens frag (registry.ts) computes lensed = vec3(r, A.g, b) * horizon, where horizon = smoothstep(0., .3, dist / (1. - u_progress*.85 + .001)) darkens the center toward black. That term is not gated by u_progress, so at u_progress = 0 the 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 outer mix(..., 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.

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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant