You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently you have registered your own Material with its Vertex and Fragment shader code which is mostly copied from ThreeJs' source code.
Because you make only small changes to the fragment shader, please consider using the onBeforeCompile callback, so that the the Mesh works on any ThreeJS shipped Material and is future proof...
See this article for an in-depth usage using onBeforeCompile.
If you want I can also try to provide a PR ... (if I find time next week)
The text was updated successfully, but these errors were encountered:
Ah yes, I wasn't really satisfied with my option to copy-paste the entire ShaderMaterial glsl code anyway but wasn't aware of any good alternative...
The interesting bit seems to be this part:
varmyMaterial=newTHREE.MeshStandardMaterial()myMaterial.onBeforeCompile=shader=>{shader.fragmentShader=//this is the fragment program string in the template formatshader.fragmentShader.replace(//we have to transform the string'#include <alphamap_fragment>',//we will swap out this chunkrequire('my_alphamap_fragment.glsl')//with our own)}
Thank you for your contributions! If you find time for a PR, just update the issue to let me know, so we don't both work on it ;) that would be awesome!
great, so i think you can manage to integrate it. shouldn't be that hard for you considering how your coding skills. i am a bit busy at the moment. thx
Currently you have registered your own Material with its Vertex and Fragment shader code which is mostly copied from ThreeJs' source code.
Because you make only small changes to the fragment shader, please consider using the onBeforeCompile callback, so that the the Mesh works on any ThreeJS shipped Material and is future proof...
See this article for an in-depth usage using onBeforeCompile.
If you want I can also try to provide a PR ... (if I find time next week)
The text was updated successfully, but these errors were encountered: