Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Meshes are missing parts when multiple batches are needed to render scene #6814

Open
pavels opened this issue May 7, 2024 · 0 comments
Open

Comments

@pavels
Copy link

pavels commented May 7, 2024

When multiple batches are used to render scene (lot of triangles), meshes are missing parts

Here is reproduction code:

class Example extends Phaser.Scene
{
    constructor ()
    {
        super();
    }

    preload ()
    {
        this.load.image('ayu', 'assets/pics/ayu.png');
    }

    create ()
    {
        var cnt = 10;

        for(var i = 0; i < cnt; i++) {
            for(var j = 0; j < cnt; j++) {        
                const mesh = this.add.mesh(50 + i * 100, 50 + j  * 100, 'ayu');
                Phaser.Geom.Mesh.GenerateGridVerts({
                    mesh,
                    widthSegments: 10
                });
                mesh.hideCCW = false;
                mesh.panZ(20);
            }
        }
    }

    update ()
    {
    }
}

const config = {
    type: Phaser.AUTO,
    width: 1000,
    height: 800,
    backgroundColor: '#0a440a',
    parent: 'phaser-example',
    scene: Example,
    batchSize: 512,
};

let game = new Phaser.Game(config);

The problem is artificially exaggerated by setting small batchSize but happens even on default settings - you will just need more triangles on scene for this to happen.

This happens on 3.80.1 and down to at lest 3.55.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant