0

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 ?

compmonks
  • 647
  • 10
  • 24

1 Answers1

2

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).

Don McCurdy
  • 10,975
  • 2
  • 37
  • 75