trethaller преди 5 години
родител
ревизия
1af34c026d
променени са 1 файла, в които са добавени 2 реда и са изтрити 1 реда
  1. 2 1
      h3d/scene/pbr/Environment.hx

+ 2 - 1
h3d/scene/pbr/Environment.hx

@@ -217,7 +217,8 @@ class Environment  {
 		} else {
 		} else {
 			if( source.width != source.height * 2 )
 			if( source.width != source.height * 2 )
 				throw "Unrecognized environment map format";
 				throw "Unrecognized environment map format";
-			env = new h3d.mat.Texture(source.height, source.height, [Cube, Target]);
+			if(env == null)
+				env = new h3d.mat.Texture(source.height, source.height, [Cube, Target]);
 			var pass = new h3d.pass.ScreenFx(new IrradEquiProj());
 			var pass = new h3d.pass.ScreenFx(new IrradEquiProj());
 			var engine = h3d.Engine.getCurrent();
 			var engine = h3d.Engine.getCurrent();
 			pass.shader.texture = source;
 			pass.shader.texture = source;