# Pbr custom shader failed to load

**URL:** <https://forum.babylonjs.com/t/pbr-custom-shader-failed-to-load/3467>\
**Category:** Bugs\
**Created:** [May 23, 2019, 2:59am UTC](https://forum.babylonjs.com/t/pbr-custom-shader-failed-to-load/3467 "2019-05-23T02:59:50Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![phaselock](https://avatars.discourse-cdn.com/v4/letter/p/da6949/32.png) [@phaselock](https://forum.babylonjs.com/u/phaselock)\
**Post date:** [May 23, 2019, 2:59am UTC](https://forum.babylonjs.com/t/pbr-custom-shader-failed-to-load/3467/1 "2019-05-23T02:59:51Z")

</div>

So this was working before, now it won’t load. I can’t spot anything that might be from the nightly build. console shows ‘varying’ : Illegal use of reserved word  
Help ?

[https://www.babylonjs-playground.com/#0GG6MR#28](https://www.babylonjs-playground.com/#0GG6MR#28)

---

<div class="post-metadata">

**Author:** ![phaselock](https://avatars.discourse-cdn.com/v4/letter/p/da6949/32.png) [@phaselock](https://forum.babylonjs.com/u/phaselock)\
**Post date:** [May 23, 2019, 4:19am UTC](https://forum.babylonjs.com/t/pbr-custom-shader-failed-to-load/3467/2 "2019-05-23T04:19:15Z")

</div>

ok, so the pg works if the ‘varying’ keyword is now removed. Appears that some work is being done on shaderProcessor that’s breaking stuff. On my local machine, scene.render is throwing ‘computeShadowWithPCF5’ : no matching overloaded function found.

Gonna give it a few days for this to clear up. Cheers !

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [May 23, 2019, 7:38am UTC](https://forum.babylonjs.com/t/pbr-custom-shader-failed-to-load/3467/3 "2019-05-23T07:38:31Z")

</div>

Sorry about that, we ll check with @Deltakosh ASAP 🙂 and yes it might be the new Processor breaking it.

This will get fixed today.

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [May 23, 2019, 8:12am UTC](https://forum.babylonjs.com/t/pbr-custom-shader-failed-to-load/3467/4 "2019-05-23T08:12:20Z")

</div>

It is due to the processing taking varying or attributes only on the line start not inside:

> <https://github.com/BabylonJS/Babylon.js/blob/master/src/Engines/Processors/shaderCodeNode.ts#L20>

> <https://github.com/BabylonJS/Babylon.js/blob/master/src/Engines/Processors/shaderCodeNode.ts#L22>

In your case the varying appears in the middle of the line:

`uniform mat4 textureMatrix;varying vec2 vUv;`

I guess we should expand this but I ll check with @Deltakosh later today to be sure we are doing it wisely 🙂

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [May 23, 2019, 3:13pm UTC](https://forum.babylonjs.com/t/pbr-custom-shader-failed-to-load/3467/5 "2019-05-23T15:13:19Z")

</div>

I’m on it ;D

---

<div class="post-metadata">

**Author:** ![phaselock](https://avatars.discourse-cdn.com/v4/letter/p/da6949/32.png) [@phaselock](https://forum.babylonjs.com/u/phaselock)\
**Post date:** [May 25, 2019, 12:13pm UTC](https://forum.babylonjs.com/t/pbr-custom-shader-failed-to-load/3467/6 "2019-05-25T12:13:10Z")

</div>

Another one for you, this one is from the doc on shadows:

[https://playground.babylonjs.com/#B48X7G#1](https://playground.babylonjs.com/#B48X7G#1)  
[https://playground.babylonjs.com/#B48X7G#2](https://playground.babylonjs.com/#B48X7G#2)

console throws:  
‘computeShadowWithPCF5’ : no matching overloaded function found  
‘computeShadowWithPCSS64’ : no matching overloaded function found

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [May 25, 2019, 1:50pm UTC](https://forum.babylonjs.com/t/pbr-custom-shader-failed-to-load/3467/7 "2019-05-25T13:50:39Z")

</div>

Good catch! I’ll fix that asap
