فهرست منبع

Merge pull request #6419 from TrevorDev/contextLossFixBlack

add internal texture to texture cache when creating a EnvironmentBRDF…
David Catuhe 6 سال پیش
والد
کامیت
294883c56d
3فایلهای تغییر یافته به همراه7 افزوده شده و 1 حذف شده
  1. 1 0
      dist/preview release/what's new.md
  2. 5 0
      src/Materials/Textures/internalTexture.ts
  3. 1 1
      src/Materials/Textures/texture.ts

+ 1 - 0
dist/preview release/what's new.md

@@ -50,6 +50,7 @@
 - Runtime animation `goToFrame` when going back in time now correctly triggers future events when reached ([zakhenry](https://github.com/zakhenry))
 - Fixed bug in Ray.intersectsTriangle where the barycentric coordinates `bu` and `bv` being returned is actually `bv` and `bw`. ([bghgary](https://github.com/bghgary))
 - Do not call onError when creating a texture when falling back to another loader ([TrevorDev](https://github.com/TrevorDev))
+- Context loss should not cause PBR materials to render black ([TrevorDev](https://github.com/TrevorDev))
 - Only cast pointer ray input when pointer is locked in webVR ([TrevorDev](https://github.com/TrevorDev))
 
 ## Breaking changes

+ 5 - 0
src/Materials/Textures/internalTexture.ts

@@ -454,6 +454,11 @@ export class InternalTexture {
         if (index !== -1) {
             cache.splice(index, 1);
         }
+
+        var index = cache.indexOf(target);
+        if (index === -1) {
+            cache.push(target);
+        }
     }
 
     /**

+ 1 - 1
src/Materials/Textures/texture.ts

@@ -730,4 +730,4 @@ export class Texture extends BaseTexture {
 }
 
 // References the dependencies.
-SerializationHelper._TextureParser = Texture.Parse;
+SerializationHelper._TextureParser = Texture.Parse;