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

GSplatComponent API improvements #6734

Open
willeastcott opened this issue Jun 20, 2024 · 1 comment
Open

GSplatComponent API improvements #6734

willeastcott opened this issue Jun 20, 2024 · 1 comment
Assignees
Labels
area: assets area: graphics Graphics related issue V2 Work for initial release of V2 engine

Comments

@willeastcott
Copy link
Contributor

Check out: https://playcanvas.github.io/#/loaders/gsplat

To create the 3DGS entity, the example does:

    const createSplatInstance = (resource, px, py, pz, scale, vertex, fragment) => {
        const splat = resource.instantiate({
            debugRender: false,
            fragment: fragment,
            vertex: vertex
        });
        splat.setLocalPosition(px, py, pz);
        splat.setLocalScale(scale, scale, scale);
        app.root.addChild(splat);
        return splat;
    };

    const biker = createSplatInstance(assets.biker.resource, -1.5, 0.05, 0, 0.7);

Is there any reason this can't adhere to our standard addComponent style? Here's a sketch:

    const biker = new pc.Entity();
    biker.addComponent('gsplat', {
        asset: assets.biker,
        debugRender: false,
        fragment: fragment,
        vertex: vertex
    });
    biker.setLocalPosition(px, py, pz);
    biker.setLocalScale(scale, scale, scale);
    app.root.addChild(biker);
@willeastcott
Copy link
Contributor Author

Interestingly enough, debugRender doesn't actually seem to do anything!

@mvaligursky mvaligursky added the V2 Work for initial release of V2 engine label Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: assets area: graphics Graphics related issue V2 Work for initial release of V2 engine
Projects
None yet
Development

No branches or pull requests

3 participants