feat: photographed beer foam head and ShaderView texture prop - #29
Merged
Conversation
- ShaderView: optional `texture` prop, decoded on the JS thread and bound as a sampler + texture_2d at bindings 1/2 only when passed - BeerGlass: the head is a foam photo sampled in the surface frame, keyed on yellowness for its lacy seam; constant thickness; eased slide out of the mouth on drain and back up through a refill (foamOut from physics) - useBeerPhysics: volume-solved surface, weir spill, slosh modes, foamOut - Foam lab screen comparing three photo treatments Claude-Session: https://claude.ai/code/session_017HHMycxywD6TfXM83w7jHG
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
Every procedural foam head read as drawn, the head grew while pouring, and it vanished in a few frames when the glass drained.
Approach
ShaderView gains an optional
textureprop. BeerGlass samples a foam photo in the surface frame, keyed on yellowness for the lacy seam; the head keeps a constant thickness and slides out/back at an eased pace set on the JS side. Foam Lab compares three photo treatments.Tests
yarn lint,yarn typecheck, WGSL validated with nagafetchof a non-Metro asset URI), a real deviceScreenshots