fix(shader-transitions): preserve gravitational lens start frame (#3660)

Builds on #1579, verified with hardware WebGL endpoint and intermediate pixel comparisons.

Co-authored-by: Carlos Alcaraz <193642530+calcarazgre646@users.noreply.github.com>
This commit is contained in:
James Russo
2026-09-04 18:40:00 -04:00
committed by GitHub
co-authored by Carlos Alcaraz
parent 0ad9c700ac
commit dd06b321cd
@@ -87,6 +87,7 @@ const shaders: Record<string, ShaderDef> = {
},
"gravitational-lens": {
// Begin with the untouched source; full horizon darkening starts at progress 0.3.
frag:
H +
"void main(){vec4 B=texture2D(u_to,v_uv);" +
@@ -98,7 +99,8 @@ const shaders: Record<string, ShaderDef> = {
"float shift=pull*.02/(dist+.2);" +
"float r=texture2D(u_from,clamp(v_uv-uv*(warpStr+shift),0.,1.)).r;" +
"float b=texture2D(u_from,clamp(v_uv-uv*(warpStr-shift),0.,1.)).b;" +
"vec3 lensed=vec3(r,A.g,b)*horizon;" +
"float horizonStrength=smoothstep(0.,.3,u_progress);" +
"vec3 lensed=vec3(r,A.g,b)*mix(1.,horizon,horizonStrength);" +
"gl_FragColor=vec4(mix(lensed,B.rgb,smoothstep(.3,.9,u_progress)),1.);}",
},