FarazzShaikh/THREE-CustomShaderMaterial ? reverse-engineered prompt
Reverse engineered prompt
Build me a small TypeScript library for Three.js that lets me take the usual built in materials and add my own vertex and fragment shader code on top of them.
I want it to work in both plain Three.js and React Three Fiber, so I can use it either as a normal material class or as a React component. It should let me pass a base material, custom shaders, uniforms, and still keep the normal material look and settings like color, roughness, metalness, and flat shading. Please make sure the shader hooks are easy to use, with simple outputs for changing position, normals, point size, and fragment color.
Also set it up with a few clear demos, like a waving mesh, point effects, and a caustics style example, so I can see how to use it right away. If you need to check current Three.js or React Three Fiber docs online, go ahead and do that.
Are you gonna build this?
make sure you review the code using coderabbit