Browse Source

don't sync particles when hidden, support alwaysSync to force it

ncannasse 7 years ago
parent
commit
684ee9dec2
2 changed files with 5 additions and 1 deletions
  1. 4 0
      h3d/parts/GpuParticles.hx
  2. 1 1
      h3d/scene/Skin.hx

+ 4 - 0
h3d/parts/GpuParticles.hx

@@ -841,6 +841,10 @@ class GpuParticles extends h3d.scene.MultiMaterial {
 			if( !allocated )
 				return; // was removed
 		}
+
+		if( !ctx.visibleFlag && !alwaysSync )
+			return;
+
 		if( primitive != null )
 			for( g in groups )
 				if( g.needRebuild ) {

+ 1 - 1
h3d/scene/Skin.hx

@@ -164,7 +164,7 @@ class Skin extends MultiMaterial {
 	}
 
 	override function sync( ctx : RenderContext ) {
-		if( !ctx.visibleFlag )
+		if( !ctx.visibleFlag && !alwaysSync )
 			return;
 		syncJoints();
 	}