# PBR Metallic Roughness Texture and useDelayedTextureLoading scene option

**URL:** <https://forum.babylonjs.com/t/pbr-metallic-roughness-texture-and-usedelayedtextureloading-scene-option/6946>\
**Category:** Bugs\
**Created:** [November 12, 2019, 9:53am UTC](https://forum.babylonjs.com/t/pbr-metallic-roughness-texture-and-usedelayedtextureloading-scene-option/6946 "2019-11-12T09:53:17Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![matdav](https://avatars.discourse-cdn.com/v4/letter/m/5daacb/32.png) [@matdav](https://forum.babylonjs.com/u/matdav)\
**Post date:** [November 12, 2019, 9:53am UTC](https://forum.babylonjs.com/t/pbr-metallic-roughness-texture-and-usedelayedtextureloading-scene-option/6946/1 "2019-11-12T09:53:17Z")

</div>

Hello everyone!

A problem occurs when the “useDelayedTextureLoading” option is used in combination with metallicTexture and metallicRoughnessTexture on PBRMetallic and PBRMetallicRoughnessMaterial materials. In essence, the material completely loses the roughness and becomes completely smooth (see images attached).

I have prepared a playground with two different loadable scene files.

[https://playground.babylonjs.com/#42GEV7](https://playground.babylonjs.com/#42GEV7)

One with the activated option “scene\_delayed.babylon” and the other with the option not activated “scene\_not\_delayed.babylon”.

I couldn’t figure out where the problem is, can you give me a hand?

Thanks,  
Matteo

 ![DelayedTextureLoading](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/2X/5/593f314b8782989cc9e7561aa4c74d35acee5a76.png) ![NotDelayedTextureLoading](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/2X/e/e30e5a2a4d2bd34e0108ca62b2e0c03ad20809d0.png)

---

<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:** [November 12, 2019, 11:57am UTC](https://forum.babylonjs.com/t/pbr-metallic-roughness-texture-and-usedelayedtextureloading-scene-option/6946/2 "2019-11-12T11:57:31Z")

</div>

Your two scene files are not identical (not counting `useDelayedTextureLoading`).

There are a couple of differences in light/camera position/parameters that I don’t think are important (still you should fix that to minimize the possible causes of the problem), but you have also in your metallicTexture:

- “url”: “mr\_08.png” in the not delayed scene
- “url”: “[https://test3d.blob.core.windows.net/assets/scenes/mr\_08.png](https://test3d.blob.core.windows.net/assets/scenes/mr_08.png)” in the delayed scene

Can you try to set the same value here to be sure it is not part of the problem? The texture is found in both cases by the browser, so it’s likely not the problem but one never knows…

---

<div class="post-metadata">

**Author:** ![Vinc3r](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/vinc3r/32/25340_2.png) [@Vinc3r](https://forum.babylonjs.com/u/Vinc3r)\
**Post date:** [November 12, 2019, 1:06pm UTC](https://forum.babylonjs.com/t/pbr-metallic-roughness-texture-and-usedelayedtextureloading-scene-option/6946/3 "2019-11-12T13:06:17Z")

</div>

Weird, seems OK to me (we just have to replace the scene name in the loader, right?)

 ![debug](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/2X/9/9d49b01e23469507cd047b6fe582850128b4a0b3.gif)

---

<div class="post-metadata">

**Author:** ![matdav](https://avatars.discourse-cdn.com/v4/letter/m/5daacb/32.png) [@matdav](https://forum.babylonjs.com/u/matdav)\
**Post date:** [November 12, 2019, 1:32pm UTC](https://forum.babylonjs.com/t/pbr-metallic-roughness-texture-and-usedelayedtextureloading-scene-option/6946/4 "2019-11-12T13:32:39Z")

</div>

Hi Evgeni,  
now the scene files should be identical, except for the useDelayedTextureLoading property.  
Thanks

---

<div class="post-metadata">

**Author:** ![matdav](https://avatars.discourse-cdn.com/v4/letter/m/5daacb/32.png) [@matdav](https://forum.babylonjs.com/u/matdav)\
**Post date:** [November 12, 2019, 1:35pm UTC](https://forum.babylonjs.com/t/pbr-metallic-roughness-texture-and-usedelayedtextureloading-scene-option/6946/5 "2019-11-12T13:35:28Z")

</div>

Hi Vinc3r  
If you move camera to look at the object from below (see the images I attached) you should see the material completely smooth in the delayed loading case.  
Thanks

---

<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:** [November 12, 2019, 4:47pm UTC](https://forum.babylonjs.com/t/pbr-metallic-roughness-texture-and-usedelayedtextureloading-scene-option/6946/6 "2019-11-12T16:47:05Z")

</div>

Here is a temp fix:  
[https://playground.babylonjs.com/#42GEV7#1](https://playground.babylonjs.com/#42GEV7#1)

The problem is that the CreatePrefilteredData should turn off delay loading to get the data prepared and this is not the case for now. By moving outside I can fix it for now as the scene is not yet flagged as delayed but I will send a fix asap

---

<div class="post-metadata">

**Author:** ![matdav](https://avatars.discourse-cdn.com/v4/letter/m/5daacb/32.png) [@matdav](https://forum.babylonjs.com/u/matdav)\
**Post date:** [November 12, 2019, 5:17pm UTC](https://forum.babylonjs.com/t/pbr-metallic-roughness-texture-and-usedelayedtextureloading-scene-option/6946/7 "2019-11-12T17:17:44Z")

</div>

Hi Deltakosh,  
thanks for your reply, I will wait for the fix and try to use your suggestion about CreatePrefilteredData.  
Thanks,  
Matteo

---

<div class="post-metadata">

**Author:** ![matdav](https://avatars.discourse-cdn.com/v4/letter/m/5daacb/32.png) [@matdav](https://forum.babylonjs.com/u/matdav)\
**Post date:** [November 13, 2019, 8:29am UTC](https://forum.babylonjs.com/t/pbr-metallic-roughness-texture-and-usedelayedtextureloading-scene-option/6946/8 "2019-11-13T08:29:17Z")

</div>

Hi @Deltakosh,  
just to better understand, with the fix it will be possible to use PBR materials with delayed texture loading? Working on a product configurator, I need to have scenes with many materials but with only a few actually used, based on the particular configuration chosen by the user. With the delayed loading of the textures I avoid downloading all the textures initially, but only when necessary.  
Thanks

---

<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:** [November 13, 2019, 3:38pm UTC](https://forum.babylonjs.com/t/pbr-metallic-roughness-texture-and-usedelayedtextureloading-scene-option/6946/9 "2019-11-13T15:38:10Z")

</div>

Actually the fix is live so you can see that your PG is now working 🙂

---

<div class="post-metadata">

**Author:** ![matdav](https://avatars.discourse-cdn.com/v4/letter/m/5daacb/32.png) [@matdav](https://forum.babylonjs.com/u/matdav)\
**Post date:** [November 13, 2019, 4:35pm UTC](https://forum.babylonjs.com/t/pbr-metallic-roughness-texture-and-usedelayedtextureloading-scene-option/6946/10 "2019-11-13T16:35:53Z")

</div>

Great! Thanks a lot! 🙂
