# What Happened to CUSTOM\_FRAGMENT\_UPDATE\_ALBEDO

**URL:** <https://forum.babylonjs.com/t/what-happened-to-custom-fragment-update-albedo/10276>\
**Category:** Questions\
**Created:** [April 24, 2020, 9:34am UTC](https://forum.babylonjs.com/t/what-happened-to-custom-fragment-update-albedo/10276 "2020-04-24T09:34:32Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![MackeyK24](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mackeyk24/32/3741_2.png) [@MackeyK24](https://forum.babylonjs.com/u/MackeyK24)\
**Post date:** [April 24, 2020, 9:34am UTC](https://forum.babylonjs.com/t/what-happened-to-custom-fragment-update-albedo/10276/1 "2020-04-24T09:34:32Z")

</div>

What happened to CUSTOM\_FRAGMENT\_UPDATE\_ALBEDO … i dont see that in PBR shader code…

Yo @Deltakosh… Can you shed some light here ???

---

<div class="post-metadata">

**Author:** ![MackeyK24](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mackeyk24/32/3741_2.png) [@MackeyK24](https://forum.babylonjs.com/u/MackeyK24)\
**Post date:** [April 24, 2020, 9:41am UTC](https://forum.babylonjs.com/t/what-happened-to-custom-fragment-update-albedo/10276/2 "2020-04-24T09:41:24Z")

</div>

Also missing:

CUSTOM\_FRAGMENT\_UPDATE\_METALLICROUGHNESS

CUSTOM\_FRAGMENT\_UPDATE\_MICROSURFACE

CUSTOM\_FRAGMENT\_BEFORE\_FOG

This breaks the **PBRCustomMaterial**

Did someone go in a remove these #define blocks ???

---

<div class="post-metadata">

**Author:** ![aWeirdo](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/aweirdo/32/52_2.png) [@aWeirdo](https://forum.babylonjs.com/u/aWeirdo)\
**Post date:** [April 24, 2020, 9:52am UTC](https://forum.babylonjs.com/t/what-happened-to-custom-fragment-update-albedo/10276/3 "2020-04-24T09:52:10Z")

</div>

I can find them in the preview [https://raw.githubusercontent.com/BabylonJS/Babylon.js/master/dist/preview%20release/babylon.max.js](https://raw.githubusercontent.com/BabylonJS/Babylon.js/master/dist/preview%20release/babylon.max.js)  
with ctrl + f, so it’s still there for sure  
but it’s all being split up and moved around compared to 4.1 stable, maybe related to node material?

---

<div class="post-metadata">

**Author:** ![MackeyK24](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mackeyk24/32/3741_2.png) [@MackeyK24](https://forum.babylonjs.com/u/MackeyK24)\
**Post date:** [April 24, 2020, 10:26am UTC](https://forum.babylonjs.com/t/what-happened-to-custom-fragment-update-albedo/10276/4 "2020-04-24T10:26:10Z")

</div>

They are missing from latest preview release **pbr.fragment.fx** (There should be 10 CUSTOM Fragment defines… there are only 6 now)

[https://raw.githubusercontent.com/BabylonJS/Babylon.js/master/src/Shaders/pbr.fragment.fx](https://raw.githubusercontent.com/BabylonJS/Babylon.js/master/src/Shaders/pbr.fragment.fx)

---

<div class="post-metadata">

**Author:** ![aWeirdo](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/aweirdo/32/52_2.png) [@aWeirdo](https://forum.babylonjs.com/u/aWeirdo)\
**Post date:** [April 24, 2020, 11:17am UTC](https://forum.babylonjs.com/t/what-happened-to-custom-fragment-update-albedo/10276/5 "2020-04-24T11:17:52Z")

</div>

Seems moved around for node material

CUSTOM\_FRAGMENT\_UPDATE\_ALBEDO  
[Babylon.js/pbrBlockAlbedoOpacity.fx at master · BabylonJS/Babylon.js · GitHub](https://github.com/BabylonJS/Babylon.js/blob/master/src/Shaders/ShadersInclude/pbrBlockAlbedoOpacity.fx)

CUSTOM\_FRAGMENT\_UPDATE\_METALLICROUGHNESS  
CUSTOM\_FRAGMENT\_UPDATE\_MICROSURFACE  
[Babylon.js/pbrBlockReflectivity.fx at master · BabylonJS/Babylon.js · GitHub](https://github.com/BabylonJS/Babylon.js/blob/master/src/Shaders/ShadersInclude/pbrBlockReflectivity.fx)

and CUSTOM\_FRAGMENT\_BEFORE\_FOG should be in default.fragment  
[Babylon.js/default.fragment.fx at master · BabylonJS/Babylon.js · GitHub](https://github.com/BabylonJS/Babylon.js/blob/master/src/Shaders/default.fragment.fx)

---

<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:** [April 24, 2020, 12:49pm UTC](https://forum.babylonjs.com/t/what-happened-to-custom-fragment-update-albedo/10276/6 "2020-04-24T12:49:01Z")

</div>

There has been a big refactoring of the PBR shader code to split it into functions to be able to implement the NME PBR blocks as well as to ease future PBR improvements (and also for the sanity of the developpers who had to deal with a big chunk of linear code previously, as everything was held in pbr.fragment.fx).

All the custom defines are still there, but possibly in one of those news functions, meaning some variables may not be available to you at this point: you only have access to the variables defined inside the function or to the parameters passed to the function.

This can be a breaking change depending on your use of the custom defines, but unfortunately the pbr shader code (and all the internal shader code in Babylon) is not guaranteed to stay backward compatible as it will evolve according to the needs. Of course, we try as much as possible to avoid such breaking changes whenever possible, but sometimes it is not possible.

Hopefully, the PBR support in the NME will help to get around some of these problems!

---

<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:** [April 24, 2020, 12:51pm UTC](https://forum.babylonjs.com/t/what-happened-to-custom-fragment-update-albedo/10276/7 "2020-04-24T12:51:14Z")

</div>

Having said that, the 4 defines moved to other functions/files are not accessible from the PBR custom material, going to have a look at that…

---

<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:** [April 24, 2020, 3:45pm UTC](https://forum.babylonjs.com/t/what-happened-to-custom-fragment-update-albedo/10276/8 "2020-04-24T15:45:17Z")

</div>

Will be fixed after this PR is live:

> <https://github.com/BabylonJS/Babylon.js/pull/8071>

---

<div class="post-metadata">

**Author:** ![MackeyK24](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mackeyk24/32/3741_2.png) [@MackeyK24](https://forum.babylonjs.com/u/MackeyK24)\
**Post date:** [April 24, 2020, 8:57pm UTC](https://forum.babylonjs.com/t/what-happened-to-custom-fragment-update-albedo/10276/9 "2020-04-24T20:57:34Z")

</div>

Yo @Evgeni_Popov… thanks for the help bro…

I just don’t see how the fixes above will help… do I still have the custom fragment defines for update Albedo ???

---

<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:** [April 24, 2020, 9:00pm UTC](https://forum.babylonjs.com/t/what-happened-to-custom-fragment-update-albedo/10276/10 "2020-04-24T21:00:12Z")

</div>

Yes, as said above all defines are still existing, but 4 of them are dispatched in other files than pbr.fragment.fx. The PR will make those defines local to pbr.fragment.fx and so available to PBRCustomMaterial.

---

<div class="post-metadata">

**Author:** ![MackeyK24](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mackeyk24/32/3741_2.png) [@MackeyK24](https://forum.babylonjs.com/u/MackeyK24)\
**Post date:** [April 24, 2020, 10:09pm UTC](https://forum.babylonjs.com/t/what-happened-to-custom-fragment-update-albedo/10276/11 "2020-04-24T22:09:57Z")

</div>

Thanks for clearing that up for me 😊
