Pārlūkot izejas kodu

BugFix mixed shadows

ShiroSmith 6 gadi atpakaļ
vecāks
revīzija
28ae5184cc
3 mainītis faili ar 8 papildinājumiem un 1 dzēšanām
  1. 3 1
      h3d/pass/DirShadowMap.hx
  2. 2 0
      h3d/pass/PointShadowMap.hx
  3. 3 0
      h3d/pass/SpotShadowMap.hx

+ 3 - 1
h3d/pass/DirShadowMap.hx

@@ -167,7 +167,9 @@ class DirShadowMap extends Shadows {
 		if( staticTexture != null ) staticTexture.dispose();
 		staticTexture = new h3d.mat.Texture(size, size, [Target], format);
 		staticTexture.uploadPixels(pixels);
-		staticTexture.name = "defaultDirShadowMap";
+		staticTexture.name = "staticTexture";
+		staticTexture.realloc = null;
+		staticTexture.preventAutoDispose();
 		syncShader(staticTexture);
 		return true;
 	}

+ 2 - 0
h3d/pass/PointShadowMap.hx

@@ -92,6 +92,8 @@ class PointShadowMap extends Shadows {
 		if( staticTexture != null ) staticTexture.dispose();
 		staticTexture = new h3d.mat.Texture(size, size, [Target, Cube], format);
 		staticTexture.name = "staticTexture";
+		staticTexture.realloc = null;
+		staticTexture.preventAutoDispose();
 
 		for(i in 0 ... 6){
 			var len = buffer.readInt32();

+ 3 - 0
h3d/pass/SpotShadowMap.hx

@@ -83,6 +83,9 @@ class SpotShadowMap extends Shadows {
 		var pixels = new hxd.Pixels(size, size, haxe.zip.Uncompress.run(buffer.read(len)), format);
 		if( staticTexture != null ) staticTexture.dispose();
 		staticTexture = new h3d.mat.Texture(size, size, [Target], format);
+		staticTexture.name = "staticTexture";
+		staticTexture.realloc = null;
+		staticTexture.preventAutoDispose();
 		staticTexture.uploadPixels(pixels);
 		syncShader(staticTexture);
 		return true;