Giter Site home page Giter Site logo

Comments (6)

mkkellogg avatar mkkellogg commented on July 30, 2024 1

@yufeng1103 I'm not sure if you're still interested, but I just released a version that supports loading multiple splats simultaneously via the Viewer.loadFiles() function: v0.1.3

from gaussiansplats3d.

yufeng1103 avatar yufeng1103 commented on July 30, 2024 1

@yufeng1103 I'm not sure if you're still interested, but I just released a version that supports loading multiple splats simultaneously via the Viewer.loadFiles() function: v0.1.3

Great job, I just saw your reply, it's a big improvement

from gaussiansplats3d.

mkkellogg avatar mkkellogg commented on July 30, 2024

I have never tried to load more than one .splat scene at a time, and my immediate guess is that it won't work correctly simply because it is not currently designed to work that way. Ultimately I plan on adding support for loading &viewing multiple .splat files simultaneously. Can you share your code and maybe I can see if there's a quick work-around in the mean-time?

from gaussiansplats3d.

yufeng1103 avatar yufeng1103 commented on July 30, 2024

Yeah,Due to the urgent need to implement the rendering effects of two splats, I have only made simple modifications to your code as follows

const group = new THREE.Group();
const viewer = new GaussianSplats3D.Viewer({
  'cameraUp': [0, -1, -0.54],
  'initialCameraPosition': [-3.15634, -0.16946, -0.51552],
  'initialCameraLookAt': [1.52976, 2.27776, 1.65898],
  'group': group
});

viewer.init();

let path = 'assets/data/garden/garden';
path += isMobile() ? '.splat' : '_high.splat';

viewer.loadFile(path, {
    'halfPrecisionCovariancesOnGPU': true
})
.then(() => {
  path = 'assets/data/garden/pingzi_high.splat';
  viewer.loadFile(path, {
      'halfPrecisionCovariancesOnGPU': false
  }).then(() => {
    group.children[1].position.set(0,1.3,-0.5);
    group.children[1].scale.set(0.3,0.3,0.3);
    viewer.start();
  });
});

;

    this.splatMesh = SplatMesh.buildMesh(splatBuffer, splatAlphaRemovalThreshold, halfPrecisionCovariancesOnGPU);

    this.splatMesh.position.copy(position);

    this.splatMesh.quaternion.copy(quaternion);

    this.splatMesh.frustumCulled = false;

    this.splatMesh.renderOrder = 10;

    this.group.add(this.splatMesh);
    
    this.updateSplatMeshUniforms();

this.renderer.render(this.group, this.camera);

It seems that I just loaded it in and didn't do any other work,

from gaussiansplats3d.

mkkellogg avatar mkkellogg commented on July 30, 2024

Right now when you load a splat mesh into the viewer via loadFile(), it stores that mesh internally using a single member variable (above it is this.splatMesh). So when you load a second splat file, the first one gets overwritten. That's why in the above screen shots you're only seeing the second splat mesh render correctly. There really isn't a great way to force the viewer to support multiple simultaneous splat meshes right now. You might try creating two instances of Viewer and passing in your own three.js renderer with autoClear set to false because Viewer.render() clears the screen before rendering. It still won't look quite right because the splats for each scene would be sorted separately.

from gaussiansplats3d.

yufeng1103 avatar yufeng1103 commented on July 30, 2024

Thank you for your suggestion. I will continue to try

from gaussiansplats3d.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.