Hi all, thought I’d share this little library I wrote and used for a couple production projects: https://github.com/leoncvlt/three-extended-material
Sometimes I 'm happy with the appearance / functionality of a default three.js material, but need some additional effects (for example dithered transparency or a fresnel-based glow). This library allows me to define these “extensions” as modular units, and add them to a three.js material as needed.
A quick demo: Extended Material
I know there’s already a couple of “material extensions” library out there, but they seem to do a lot of heavy lifting by using a completely custom ShaderMaterial and copying all relevant properties over. My approach extends the original Material class and patches the shader, so everything should “just work”. Happy to hear feedback from any three.js expert about the potential disadvantages of this approach