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

Closed
pavels opened this issue May 7, 2024 · 1 comment · May be fixed by jonesrussell/nishman#6
Closed

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

pavels opened this issue May 7, 2024 · 1 comment · May be fixed by jonesrussell/nishman#6

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

@photonstorm
Copy link
Collaborator

Thank you for submitting this issue. We have fixed this and the fix has been pushed to the master branch. It will be part of the next release. If you get time to build and test it for yourself we would appreciate that.

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

Successfully merging a pull request may close this issue.

3 participants