Can I use custom shader chunks with batched models?

Hi @NokFrt,

You can definitely use custom shaders or override shder chunks on batched models. The batcher will group the mesh instances based on their material/shader and same uniform values.

I am not sure why your shader changes aren’t respected after the batcher runs, most likely a race condition or something. You can easily get a reference to the material used by any batch group and further override its shader after the batcher ran. That will be automatically applied to all of the mesh instances included in that batch group.

var batches = this.app.batcher._batchList;
batches.forEach( function(batch){

   var material = batch.meshInstance.material;
   // this is the material used by this batch instance
}); 
1 Like