Hi,
first time posting, threejs newb here, complicated naive question…
I want to use a shadertoy glsl shader as a map source in a meshStandardMaterial, so I can get lighting, pbr juiciness, etc.
I am well aware of the shaderMaterial, and how to use that to implement shadertoy generative shaders as a texture in a material, and have made a simple demo that does this. (yes it uses AFrame, but it’s Threejs underneath)
The problem with the shaderMaterial, is that it does not have lighting, or reflections, and renders looking emissive.
I’m just wondering if there is some hack to get the output of a glsl shader and use it as a texture in a meshStandardMaterial. I kind of already know this is not possible, but just wanted to ask in case someone has actually done this.
I also understand that the serious way to do this is to start with the fragment and vertex shader of a meshStandardMaterial, which I found here
and weave in the shadertoy code somewhere in the middle, and feed it through the lighting functions, etc. But that is rather a daunting task, given the length of the shader (about 600 lines of glsl code).
I come from the world of Touch Designer, which is a 3d game engine for performance (not web based).
They have a built in tool that exports a (pbr) material to a glsl shader, that has simplified code, which is much more managable (all of the lighting functions are accessible as calls, but not exposed in all verbosity in the exported shader).
Touch is a node based programming environment that makes it easy to create a glsl texture and import that into a material. Just wondering (hoping) if anyone has made or is making, anything close to that for THREEjs.
I have seen and played with Shaderfrog, which is a very cool node based online glsl editor that exports to threejs. But it also does not support lighting, or vertex normal reflections, but does support enviromenment map reflections.
If Shaderfrog evolved into something like substance designer, with the ability to export a pbr material with the power of shadertoy, that would be exactly what I am hoping for.
Just wondering if anyone else has craved for, or worked on, tools like this.
thanks
Thomas