# Intended Usage Of the NME Export Shaders Button

**URL:** <https://forum.babylonjs.com/t/intended-usage-of-the-nme-export-shaders-button/22946>\
**Category:** Questions\
**Created:** [August 9, 2021, 8:35pm UTC](https://forum.babylonjs.com/t/intended-usage-of-the-nme-export-shaders-button/22946 "2021-08-09T20:35:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![MackeyK24](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mackeyk24/32/3741_2.png) [@MackeyK24](https://forum.babylonjs.com/u/MackeyK24)\
**Post date:** [August 9, 2021, 8:35pm UTC](https://forum.babylonjs.com/t/intended-usage-of-the-nme-export-shaders-button/22946/1 "2021-08-09T20:35:42Z")

</div>

Hey Guys,

Whats up with the export shaders button in node material editor ?

Is that supposed to export fully functional glsl code that we simply use as the vertex and fragment shader code for a BABYLON.ShaderMaterial ???

---

<div class="post-metadata">

**Author:** ![MackeyK24](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mackeyk24/32/3741_2.png) [@MackeyK24](https://forum.babylonjs.com/u/MackeyK24)\
**Post date:** [August 10, 2021, 1:19am UTC](https://forum.babylonjs.com/t/intended-usage-of-the-nme-export-shaders-button/22946/2 "2021-08-10T01:19:32Z")

</div>

Yo @Evgeni_Popov or @sebavan or @Deltakosh

Can you help explain to me the shaders.txt and code.txt… Is that to make a shader material ?

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [August 10, 2021, 9:32am UTC](https://forum.babylonjs.com/t/intended-usage-of-the-nme-export-shaders-button/22946/3 "2021-08-10T09:32:17Z")

</div>

The “Generate code” allows you to get the js code that can recreate the shader by instantiating programmatically the NME blocks. That way, you don’t depend on an external .json file.

The “Export shaders” is another beast. I think it’s more for educational purpose as it can be quite hard to use in your own program (depending on which functionalities you are using in the node shader). See for eg:

> [@\#include directives in shader code output from Node Material Editor](https://forum.babylonjs.com/t/include-directives-in-shader-code-output-from-node-material-editor/10730/2):
>
> The shader code generated by the NME can’t be used “as is”, you must at the very least bind the uniform and sampler variables with the right values. In your example, u\_world, u\_viewProjection, u\_Diffusecolor, etc must be bound with a value, else they are empty by default. Even the standard matrices must be, because, for eg, u\_world is not the standard name used by Babylon, it is world instead. All those things (and much others) are done for you by the NodeMaterial class so you don’t have to wor…

---

<div class="post-metadata">

**Author:** ![MackeyK24](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mackeyk24/32/3741_2.png) [@MackeyK24](https://forum.babylonjs.com/u/MackeyK24)\
**Post date:** [August 10, 2021, 5:53pm UTC](https://forum.babylonjs.com/t/intended-usage-of-the-nme-export-shaders-button/22946/4 "2021-08-10T17:53:59Z")

</div>

Got it… Thanks @Evgeni_Popov
