Skip to content

Using same material on multiple batched meshes causes shader compile error #9

@brianchirls

Description

@brianchirls

If initUniformsPerInstance is called to use per-instance uniforms, the material passed to the BatchedMesh constructor is modified, adding an onBeforeCompile callback to customize the shader. If the same material is used for multiple batches, that material will have the callback added one time for each batch, resulting in a shader compile error.

It is useful to use the same material across multiple batches if there are other differences between the batches. For example, one may have a normalized geometry attribute where the other does not. Or a batch may be big and have to be split into multiple batches.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions