Summary
Add Robert Penner's easing functions as a TSL utility shader, sourced from @y11i-3d/tsl-easings by Yuichiroh Arai.
Upstream
Available Functions (30 total)
10 families × 3 variants (In, Out, InOut):
| Family |
In |
Out |
InOut |
| Sine |
sineIn |
sineOut |
sineInOut |
| Quad |
quadIn |
quadOut |
quadInOut |
| Cubic |
cubicIn |
cubicOut |
cubicInOut |
| Quart |
quartIn |
quartOut |
quartInOut |
| Quint |
quintIn |
quintOut |
quintInOut |
| Expo |
expoIn |
expoOut |
expoInOut |
| Circ |
circIn |
circOut |
circInOut |
| Back |
backIn |
backOut |
backInOut |
| Elastic |
elasticIn |
elasticOut |
elasticInOut |
| Bounce |
bounceIn |
bounceOut |
bounceInOut |
Back and Elastic also have custom* variants accepting parameters (overshoot, amplitude/period).
All functions accept float, vec2, vec3, or vec4 TSL nodes.
What to do
-
Create a tsl-easings shader entry in shaders/tsl-easings/ with:
shader.json manifest with language: "tsl", proper provenance pointing to upstream repo, Robert Penner attribution, and Yuichiroh Arai credit
source.ts containing the easing functions (adapted to ShaderBase's createMaterial contract or as a utility export)
- Recipe showing usage in a Three.js material
-
Provenance: sourceKind: "port" with sources linking to the upstream repo and Robert Penner's original equations
-
Compatibility: Note the higher Three.js minimum (>=0.183.0) vs our existing TSL shader (>=0.170.0)
-
Consider: Whether to ship as one combined tsl-easings shader or split per family (e.g. tsl-ease-sine, tsl-ease-bounce). A single entry is simpler and matches how the upstream ships it.
Credit
Summary
Add Robert Penner's easing functions as a TSL utility shader, sourced from
@y11i-3d/tsl-easingsby Yuichiroh Arai.Upstream
@y11i-3d/tsl-easingsv1.0.0>=0.183.0Available Functions (30 total)
10 families × 3 variants (In, Out, InOut):
sineInsineOutsineInOutquadInquadOutquadInOutcubicIncubicOutcubicInOutquartInquartOutquartInOutquintInquintOutquintInOutexpoInexpoOutexpoInOutcircIncircOutcircInOutbackInbackOutbackInOutelasticInelasticOutelasticInOutbounceInbounceOutbounceInOutBack and Elastic also have
custom*variants accepting parameters (overshoot, amplitude/period).All functions accept
float,vec2,vec3, orvec4TSL nodes.What to do
Create a
tsl-easingsshader entry inshaders/tsl-easings/with:shader.jsonmanifest withlanguage: "tsl", proper provenance pointing to upstream repo, Robert Penner attribution, and Yuichiroh Arai creditsource.tscontaining the easing functions (adapted to ShaderBase'screateMaterialcontract or as a utility export)Provenance:
sourceKind: "port"with sources linking to the upstream repo and Robert Penner's original equationsCompatibility: Note the higher Three.js minimum (
>=0.183.0) vs our existing TSL shader (>=0.170.0)Consider: Whether to ship as one combined
tsl-easingsshader or split per family (e.g.tsl-ease-sine,tsl-ease-bounce). A single entry is simpler and matches how the upstream ships it.Credit