Преглед изворни кода

make sure to rebuild shaders

Nicolas Cannasse пре 4 година
родитељ
комит
7ca69c160c
1 измењених фајлова са 5 додато и 3 уклоњено
  1. 5 3
      hrt/prefab/l3d/MeshSpray.hx

+ 5 - 3
hrt/prefab/l3d/MeshSpray.hx

@@ -151,9 +151,11 @@ class MeshSprayObject extends h3d.scene.Object {
 		super.emitRec(ctx);
 	}
 
-	public function redraw() {
-		for( b in batches )
+	public function redraw(updateShaders=false) {
+		for( b in batches ) {
+			if( updateShaders ) b.shadersChanged = true;
 			b.begin();
+		}
 		for( c in children ) {
 			c.culled = false;
 			if( c.alwaysSync ) continue;
@@ -901,7 +903,7 @@ class MeshSpray extends Object3D {
 			if( c.type != "model" )
 				makeChildren(ctx, c);
 		// rebuild to apply per instance shaders
-		cast(ctx.local3d, MeshSprayObject).redraw();
+		cast(ctx.local3d, MeshSprayObject).redraw(true);
 		return ctx;
 	}