feat(shader-transitions): optional shader field — CSS crossfade mixing in HyperShader#886
Open
ukimsanov wants to merge 1 commit into
Open
feat(shader-transitions): optional shader field — CSS crossfade mixing in HyperShader#886ukimsanov wants to merge 1 commit into
ukimsanov wants to merge 1 commit into
Conversation
…de mixing Allow omitting the shader field in TransitionConfig to get a smooth CSS opacity crossfade instead of a WebGL effect. HyperShader manages all scene visibility regardless of transition type, so shader and CSS crossfade transitions can now be mixed freely in the same composition. When shader is omitted: - No WebGL program is compiled or cached for that transition - The existing applyFallbackTransition() path handles the crossfade - No texture prewarming needed — transition is marked ready immediately Tested: verified with a 3-scene composition (sdf-iris + CSS crossfade) rendered to MP4. Both transition types render correctly. engine/src/types.ts: HfTransitionMeta.shader is now optional to match
miguel-heygen
approved these changes
May 16, 2026
Collaborator
|
fix the failed ci checks btw |
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.
What
Makes the
shaderfield inTransitionConfigoptional. When omitted, HyperShader performs a smooth CSS opacity crossfade instead of a WebGL effect — using the existingapplyFallbackTransition()path that was already there for texture-load failures.Why
Previously, using
HyperShader.init()locked the entire composition into WebGL-only transitions. Any transition that didn't need a shader effect (smooth cuts, crossfades between related beats) still required picking the least-intrusive shader (flash-through-whiteat 0.01s). This was an all-or-nothing constraint that produced unwanted white flashes in practice.Now shader and CSS crossfade transitions can be mixed freely in the same composition:
How
TransitionConfig.shaderchanged fromShaderName(required) toShaderName | undefined(optional)isCssFallback = !t.shader— fallback transitions getprog: null,ready: true,fallback: true,dirty: false— no prewarming neededrenderShadercall uses non-null assertion (state.prog!) — safe because the fallback path returns before this pointHfTransitionMeta.shaderin both the local interface andengine/src/types.tsmade optional to matchCachedTransition.progtype widened toWebGLProgram | nullTest plan
packages/shader-transitions— clean TypeScript, no errorssdf-irisshader + CSS crossfade +domain-warpshaderapplyFallbackTransition()smooth opacity interpolationHyperShader.init()withouttimeline:option)