# How do I inject shader code into a standardMaterial？

**URL:** <https://forum.babylonjs.com/t/how-do-i-inject-shader-code-into-a-standardmaterial/40821>\
**Category:** Questions\
**Created:** [May 15, 2023, 3:26pm UTC](https://forum.babylonjs.com/t/how-do-i-inject-shader-code-into-a-standardmaterial/40821 "2023-05-15T15:26:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ZoeLeee](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/zoeleee/32/20340_2.png) [@ZoeLeee](https://forum.babylonjs.com/u/ZoeLeee)\
**Post date:** [May 15, 2023, 3:26pm UTC](https://forum.babylonjs.com/t/how-do-i-inject-shader-code-into-a-standardmaterial/40821/1 "2023-05-15T15:26:52Z")

</div>

> **[Babylon.js Playground](https://playground.babylonjs.com/#96I31X)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

I want to modify the shader code of the standard material, how can I change the built-in shader code before the material is compiled

---

<div class="post-metadata">

**Author:** ![qq2315137135](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/qq2315137135/32/32219_2.png) [@qq2315137135](https://forum.babylonjs.com/u/qq2315137135)\
**Post date:** [May 15, 2023, 3:36pm UTC](https://forum.babylonjs.com/t/how-do-i-inject-shader-code-into-a-standardmaterial/40821/2 "2023-05-15T15:36:54Z")

</div>

You can use Material Plugin, here is the documentation

[Material Plugins | Babylon.js Documentation (babylonjs.com)](https://doc.babylonjs.com/features/featuresDeepDive/materials/using/materialPlugins)

---

<div class="post-metadata">

**Author:** ![Pryme8](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/pryme8/32/7212_2.png) [@Pryme8](https://forum.babylonjs.com/u/Pryme8)\
**Post date:** [May 15, 2023, 4:42pm UTC](https://forum.babylonjs.com/t/how-do-i-inject-shader-code-into-a-standardmaterial/40821/3 "2023-05-15T16:42:19Z")

</div>

There us CustomMaterial and a PBR CustomMaterial you can use to inject stuff.

> **[CustomMaterial | Babylon.js Documentation](https://doc.babylonjs.com/typedoc/classes/BABYLON.CustomMaterial)**
>
> Instantiates a new standard material.This is the default material used in Babylon. It is the best trade off between qualityand performances. \[API\]
