Is there a way to export a general threejs shadermaterial of the type:
var the_material = new THREE.ShaderMaterial( { uniforms: u, vertexShader: vs, fragmentShader: fs ,name:id} );
into a .mtl file ?
An .mtl
file can only represent specific classic material types, like "phong" or "lambert". See this document: http://paulbourke.net/dataformats/mtl/. As a result, it is not possible to put arbitrary shader code into an .mtl
file. To export an arbitrary shader, you'll very likely need to export the entire vertex+fragment shader (e.g. .glsl
).