fand / vfx-js

WebGL effects made easy.
https://amagi.dev/vfx-js
626 stars 19 forks source link

feat: add VFXProps.zIndex #80

Closed fand closed 2 months ago

fand commented 2 months ago

This PR addes VFXProps.zIndex, which allows users to specify the rendering order of the elements.

VFX-JS renders elements in ascending order by the zIndex. Elements that have the same zIndex will be rendered by the order they were added.

For example, when we add elements like this:

vfx.add(a, { shader }); 
vfx.add(b, { shader, zIndex: -1 }); 
vfx.add(c, { shader, zIndex: 1 }); 
vfx.add(d, { shader, zIndex: 1 }); 

Then the rendering order will be b -> a -> c -> d.

This PR solves #79 .

vercel[bot] commented 2 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-vfx-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 5, 2024 11:54pm