Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Composable Shaders #11

Closed
hmans opened this issue Jun 7, 2022 · 1 comment
Closed

feat: Composable Shaders #11

hmans opened this issue Jun 7, 2022 · 1 comment

Comments

@hmans
Copy link
Owner

hmans commented Jun 7, 2022

As is:

As of now, the library uses two monolithic shader chunks that are injected into the built-in materials of Three.js through three-custom-shader-material. All animation input is passed to this shader code by way of vertex attributes attached to the material.

This approach has a couple of limitations:

  • The same shader code needs to support all possible effects, which is bound to make it more complex than we'd want it to be.
  • Since the only way to configure it is through uniforms and attribute buffers, we will quickly run into their respective limits.
  • All animations are currently implemented using linear interpolation; supporting easing functions would need additional uniforms/buffers; see above.

To be:

For these reasons (and, admittedly, because it feels like a fun challenge), one of the goals for this library has always been to change this into a system that generates per-effect shader code. Basically, each effect would declaratively build a pipeline of operations that would then be compiled to shader code. The individual steps might be:

  • Billboarding
  • Velocity + Acceleration/Damping (with or without easing)
  • Animating Opacity
  • Animating Color
  • etc.
@hmans hmans mentioned this issue Jun 7, 2022
@hmans hmans changed the title Composable Shaders feat: Composable Shaders Jun 8, 2022
@hmans
Copy link
Owner Author

hmans commented Jun 18, 2022

Closing this, as we now have a "starting version" of this thanks to #32.

@hmans hmans closed this as completed Jun 18, 2022
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

No branches or pull requests

1 participant