# \#pbrcustommaterial

**URL:** https://forum.babylonjs.com/tag/pbrcustommaterial/373.md

[Latest](https://forum.babylonjs.com/latest.md) · [Categories](https://forum.babylonjs.com/categories.md) · [Tags](https://forum.babylonjs.com/tags.md)

---

## [PBRCustomMaterial: compiledEffects memory leak](https://forum.babylonjs.com/t/pbrcustommaterial-compiledeffects-memory-leak/63468)

<div class="topic-metadata">

**Author:** [@Amarth2Estel](https://forum.babylonjs.com/u/Amarth2Estel)\
**Replies:** 6\
**Last updated:** [May 22, 2026, 7:13am UTC](https://forum.babylonjs.com/t/pbrcustommaterial-compiledeffects-memory-leak/63468 "2026-05-22T07:13:06Z")

</div>

Hi again, Still hunting memory leaks in our app, after the fix from my previous post ( PBRCustomMaterial: ShadersStore memory leak on dispose() ) has been merged. They both come from the way the entry key in caches is …

---

## [PBRCustomMaterial: ShadersStore memory leak on dispose()](https://forum.babylonjs.com/t/pbrcustommaterial-shadersstore-memory-leak-on-dispose/63452)

<div class="topic-metadata">

**Author:** [@Amarth2Estel](https://forum.babylonjs.com/u/Amarth2Estel)\
**Replies:** 2\
**Last updated:** [May 13, 2026, 3:04pm UTC](https://forum.babylonjs.com/t/pbrcustommaterial-shadersstore-memory-leak-on-dispose/63452 "2026-05-13T15:04:16Z")

</div>

Hi everyone ! I’ve been tracking a memory leak in our app for a while and finally managed to isolate it. Posting here in case it’s a known issue or if there’s a better workaround than what I’ve found. I use PBRCustomMa…

---

## [WebGPU Mode PBRCustomMaterial add sampler uniform error](https://forum.babylonjs.com/t/webgpu-mode-pbrcustommaterial-add-sampler-uniform-error/48235)

<div class="topic-metadata">

**Author:** [@zhangyahan](https://forum.babylonjs.com/u/zhangyahan)\
**Replies:** 1\
**Last updated:** [February 23, 2024, 9:03am UTC](https://forum.babylonjs.com/t/webgpu-mode-pbrcustommaterial-add-sampler-uniform-error/48235 "2024-02-23T09:03:44Z")

</div>

Adding a sampler uniform to PBRCustomMaterial in WebGL mode works fine, but trying to do the same in WebGPU mode gives the console an error.

---

## [\`varying\` cause shader error when shadow is enabled in WebGPU](https://forum.babylonjs.com/t/varying-cause-shader-error-when-shadow-is-enabled-in-webgpu/46396)

<div class="topic-metadata">

**Author:** [@slin](https://forum.babylonjs.com/u/slin)\
**Replies:** 6\
**Last updated:** [December 14, 2023, 10:04am UTC](https://forum.babylonjs.com/t/varying-cause-shader-error-when-shadow-is-enabled-in-webgpu/46396 "2023-12-14T10:04:30Z")

</div>

Dear BJS team, I wish you a happy holiday. :smiling\_face\_with\_three\_hearts: I am able to reproduce my issue in a PG. It looks like a bug in BJS code. First this PG works fine with WebGL engine: https://playground.baby…

---

## [Setting Array uniform on shader in webgpu?](https://forum.babylonjs.com/t/setting-array-uniform-on-shader-in-webgpu/42657)

<div class="topic-metadata">

**Author:** [@aWeirdo](https://forum.babylonjs.com/u/aWeirdo)\
**Replies:** 3\
**Last updated:** [July 24, 2023, 4:49pm UTC](https://forum.babylonjs.com/t/setting-array-uniform-on-shader-in-webgpu/42657 "2023-07-24T16:49:05Z")

</div>

Hey team! ( @Evgeni\_Popov :pray: ) Can we set a floatArray ( float\[nb\] ) uniform in a way that works on both webgl2 & webGPU? I’m using the PBRCustomMaterial. Passing an array causes GPUValidationError when using web…
