pmndrs / drei-vanilla

🍦 drei-inspired helpers for threejs
https://pmndrs.github.io/drei-vanilla/
MIT License
448 stars 17 forks source link

feat: add generic uniform types to shaderMaterial #24

Closed mattrossman closed 1 year ago

mattrossman commented 1 year ago

Why

Resolves #23

What

I added a generic type parameter to shaderMaterial() that can be inferred from its uniforms argument or provided explicitly. I also updated the Storybook examples to use explicit uniform types. This resolves some TS errors in the examples. Lastly I added a "TypeScript usage" dropdown to the README showing how to provide uniform types.

Checklist

codesandbox-ci[bot] commented 1 year ago

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 27eaafec2be8bc7685b59f3e3043d75986f53256:

Sandbox Source
lively-snow-7hfynd Configuration
Ground reflections and video textures Configuration
arc-x-pmndrs-colors Configuration
vis-prime commented 1 year ago

Thanks!

Ready to merge ?

mattrossman commented 1 year ago

I think so, the examples seem to be working still.

github-actions[bot] commented 1 year ago

:tada: This PR is included in version 1.7.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: