Browse Source

fixed sample wrt instancing changes

Nicolas Cannasse 6 years ago
parent
commit
df6d23fc75
1 changed files with 3 additions and 8 deletions
  1. 3 8
      samples/ShaderAdvanced.hx

+ 3 - 8
samples/ShaderAdvanced.hx

@@ -141,16 +141,11 @@ class ShaderAdvanced extends hxd.App {
 		var cube = h3d.prim.Cube.defaultUnitCube();
 
 		var prim = new h3d.prim.Instanced();
-		var bytes = new haxe.io.BytesOutput();
-		var icount = cube.triCount() * 3;
-		bytes.writeInt32(icount);
-		bytes.writeInt32(16);
-		bytes.writeInt32(0);
-		bytes.writeInt32(0);
-		bytes.writeInt32(0);
 
 		prim.setMesh(cube);
-		prim.commands = new h3d.impl.InstanceBuffer(1, bytes.getBytes());
+		prim.commands = new h3d.impl.InstanceBuffer();
+		var icount = cube.triCount() * 3;
+		prim.commands.setCommand(16, icount);
 
 		new h3d.scene.fwd.DirLight(new h3d.Vector(-1,-2,-5),s3d);
 		new h3d.scene.CameraController(s3d).loadFromCamera();