# Mark implicitly created material plugins doNotSerialize by default

**URL:** <https://forum.babylonjs.com/t/mark-implicitly-created-material-plugins-donotserialize-by-default/60326>\
**Category:** Questions\
**Tags:** material, material-plugin, materialpluginbase, compatiblity\
**Created:** [September 1, 2025, 2:16am UTC](https://forum.babylonjs.com/t/mark-implicitly-created-material-plugins-donotserialize-by-default/60326 "2025-09-01T02:16:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kzhsw](https://avatars.discourse-cdn.com/v4/letter/k/848f3c/32.png) [@kzhsw](https://forum.babylonjs.com/u/kzhsw)\
**Post date:** [September 1, 2025, 2:16am UTC](https://forum.babylonjs.com/t/mark-implicitly-created-material-plugins-donotserialize-by-default/60326/1 "2025-09-01T02:16:11Z")

</div>

In recent versions 2 implicitly created material plugins added, `DepthSensingMaterialPlugin`, and `TAAJitterMaterialPlugin`

> <https://github.com/BabylonJS/Babylon.js/blob/d78c12fb7aa5732d1a9291784c3e9a6d407d9d3e/packages/dev/core/src/XR/features/WebXRDepthSensing.ts#L710>

> <https://github.com/BabylonJS/Babylon.js/blob/d78c12fb7aa5732d1a9291784c3e9a6d407d9d3e/packages/dev/core/src/PostProcesses/RenderPipeline/Pipelines/taaMaterialManager.ts#L154>

Material plugins with RegisterMaterialPlugin are created in [constructor](https://github.com/BabylonJS/Babylon.js/blob/d78c12fb7aa5732d1a9291784c3e9a6d407d9d3e/packages/dev/core/src/Materials/materialPluginManager.ts#L480), which is far before serialized material plugin parsed

> <https://github.com/BabylonJS/Babylon.js/blob/d78c12fb7aa5732d1a9291784c3e9a6d407d9d3e/packages/dev/core/src/Materials/material.ts#L2081>

And since they are not parsed since they are already created via constructor event, there is no need to be serialized, so it should be doNotSerialize by default.

Also, why would this kind of implicitly created material plugins needed since plugins are [already allowed to be created](https://github.com/BabylonJS/Babylon.js/pull/15710) at runtime? Is there any chance that all those implicitly creation of material plugins removed, and only be created when needed?

---

<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 1, 2025, 8:23am UTC](https://forum.babylonjs.com/t/mark-implicitly-created-material-plugins-donotserialize-by-default/60326/2 "2025-09-01T08:23:45Z")

</div>

Regarding TAA, the plugin is injected only if TAA is used, so we should be ok. You’re right regarding the WebXR depth sensing plugin, it should be injected only if this feature is used:

> <https://github.com/BabylonJS/Babylon.js/pull/17094>
>
> See https://forum.babylonjs.com/t/mark-implicitly-created-material-plugins-donot…serialize-by-default/60326

I also added the **doNotSerialize** flag.

Thanks for the feedback!
