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

[Feature Request] Implement Custom Shader Support for OverlayVideo Component #3

Open
FusionFont opened this issue Jul 2, 2024 · 0 comments

Comments

@FusionFont
Copy link

Hi @midori-profile,

I've been using the overlay-video component in my recent projects and it's been working great for high-performance web animations. However, I've encountered a need to further customize the animations with custom shaders for more complex visual effects.

Proposed Feature:

  • Custom Shader Support: Allow users to define and inject custom vertex and fragment shaders into the OverlayVideo component. This would enable advanced animations and effects beyond the current capabilities.

Use Case:

  • Currently, the component uses a fixed shader pair for rendering the video onto a canvas. The ability to use custom shaders would open up possibilities for users to manipulate the video frames in creative ways, such as applying post-processing effects, color adjustments, or even integrating with other WebGL content.

Implementation Suggestion:

  • Add two new props to the OverlayVideo component: vertexShader and fragmentShader. These would be strings containing the GLSL code for the respective shaders.
  • Update the initializeWebGL function to accept these new props and compile the provided shaders if they are present.
  • Ensure that the component's API documentation is updated to include these new props and their usage.

Impact:

  • This feature would significantly enhance the flexibility and power of the overlay-video component, making it more appealing to developers looking to implement advanced web animations.

Code Snippet Example:

<OverlayVideo
  path={video}
  vertexShader={customVertexShader}
  fragmentShader={customFragmentShader}
  // ...other props
/>

I believe this feature would be a valuable addition to the project and would love to collaborate on its implementation if possible.

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