# Hardcoded #include replacements in PBRCustomMaterial constructor

**URL:** <https://forum.babylonjs.com/t/hardcoded-include-replacements-in-pbrcustommaterial-constructor/44420>\
**Category:** Questions\
**Tags:** material, engine\
**Created:** [September 24, 2023, 7:31pm UTC](https://forum.babylonjs.com/t/hardcoded-include-replacements-in-pbrcustommaterial-constructor/44420 "2023-09-24T19:31:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![slin](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/slin/32/36084_2.png) [@slin](https://forum.babylonjs.com/u/slin)\
**Post date:** [September 24, 2023, 7:31pm UTC](https://forum.babylonjs.com/t/hardcoded-include-replacements-in-pbrcustommaterial-constructor/44420/1 "2023-09-24T19:31:52Z")

</div>

Happy weekend!

I have a question about PBRCustomMaterial implementation. Why does the constructor has 3 statements to explicitly replace shader includes? PBR shader contains many includes, why these specific 3 only? Can’t these includes be replaced centrally by ShaderProcessor.\_ProcessIncludes?

> <https://github.com/BabylonJS/Babylon.js/blob/master/packages/dev/materials/src/custom/pbrCustomMaterial.ts#L223>

---

<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:** [September 25, 2023, 9:03am UTC](https://forum.babylonjs.com/t/hardcoded-include-replacements-in-pbrcustommaterial-constructor/44420/2 "2023-09-25T09:03:04Z")

</div>

These includes are explicitely replaced by their code because they contain some `#define CUSTOM_XXX` declarations and the `PBRCustomMaterial` class requires that these defines are in the main shader code flow to be able to replace them by your custom code.

---

<div class="post-metadata">

**Author:** ![slin](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/slin/32/36084_2.png) [@slin](https://forum.babylonjs.com/u/slin)\
**Post date:** [September 25, 2023, 2:19pm UTC](https://forum.babylonjs.com/t/hardcoded-include-replacements-in-pbrcustommaterial-constructor/44420/3 "2023-09-25T14:19:23Z")

</div>

> [@slin](#):
>
> `customShaderNameResolve`

Thanks @Evgeni_Popov. Now I got it. All the CUSTOM\_XXX defines are replaced in the customShaderNameResolve implementation within PBRCustomMaterial.
