소스 검색

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;
 	}