10
$\begingroup$

as described in Blender Shader in OpenGL/GLSL, it is possible to export the (unoptimized) GLSL code generated by Blender for a given material.

Since the viewport can use such GLSL for real-time shading, my understanding is that Blender could be used to fully design and preview assets for real-time applications, without restricting materials to existing shaders/parameters (since nodes can be used to design a large variety of GLSL-exportable materials).

But exporting GLSL shaders manually for each material, then exporting geometries, and finally associating them in the final render engine does not seem like an efficient workflow.

So I was wondering if there exists any Blender model exporter (whatever file format it exports to) that does export generated GLSL code alongside geometries?

Regards.

$\endgroup$
11
  • $\begingroup$ As an illustration, this material setup would benefit from such an export (should the target engine accept GLSL shaders). $\endgroup$
    – oparisy
    Commented Jun 14, 2015 at 20:20
  • $\begingroup$ I'm sorry, but as far as I am aware it is impossible to export materials with your model. You will have to export GLSL separately to the model. Using Blender as a shader editor would be cool, and is something I would want to do. $\endgroup$
    – amziraro
    Commented Jun 15, 2015 at 0:57
  • $\begingroup$ The Blend4Web addon does this and more. $\endgroup$ Commented Jun 15, 2015 at 18:02
  • $\begingroup$ @Amziraro my understanding is that easier design of GLSL shaders using Blender nodes will be a byproduct of the viewport improvements effort. $\endgroup$
    – oparisy
    Commented Jun 15, 2015 at 21:16
  • 1
    $\begingroup$ @MarcClintDion Indeed, the Blend4Web documentation states that "All shaders used in the engine are processed by a compilator", but that seem rather vague. Are Blender-generated GLSL shaders exported in the intermediary json representation of Blend4Web assets? $\endgroup$
    – oparisy
    Commented Jun 15, 2015 at 21:28

1 Answer 1

1
$\begingroup$

blender can export GLTF, which supports embedding PBR material in your export.

However it seems you are looking for exporting custom shaders. This should be doable with USD.

USD is designed to export scene data across software, and has shader export support.

You can find more info here, hopefully this helps you finding the answer https://developer.blender.org/tag/usd/

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .