pnext / three-loader

Point cloud loader for ThreeJS, based on the core parts of Potree
Other
211 stars 91 forks source link

Potree not loading more than arbitrary threshold, regardless of budget #50

Open geoff-harper opened 5 years ago

geoff-harper commented 5 years ago

My starting point was the example in the repo. I'm setting the point budget in the initialize function like so:

initialize(targetEl: HTMLElement): void {
    if (this.targetEl || !targetEl) {
      throw new Error('Viewer already mounted or no target passed.');
    }

    this.targetEl = targetEl;
    targetEl.appendChild(this.renderer.domElement);

    this.potree.pointBudget = 3600000;

    // camera
    this.camera.position.set(91, 91, 91);
    this.camera.lookAt(0, 0, 0);
    this.cameraControls = new OrbitControls(this.camera, this.targetEl);

    this.resize();
    window.addEventListener('resize', this.resize);
    this.targetEl.addEventListener('click', this.handleClick);

    requestAnimationFrame(this.loop);
  }

I have verified that if I set the budget under the threshold, say 200k, that the loader does respect that and limits the points accordingly. However with my desired 3.6M for this data set, I can't cross ~940k. I've spun up the same data set with the full Potree lib and it will render all 3.6M points if the budget is >=3.6M (both minNodeSize === 30). This is the only Object in the scene.

I'm not sure what other data I should provide so let me know

hccampos commented 4 years ago

I'll see what I can find, but things seem to work on our apps at Pix4D, so it is rather strange.

hccampos commented 4 years ago

One thing that came to my mind is that you might have to set the minNodePixelSize on the PointCloudOctree. The default is 50px and if nodes would end up being smaller than 50px on the screen, we don't load them.

geoff-harper commented 4 years ago

I tried to set the material point size type to fixed in case that was telling potree to cull excess points. As far as I can tell I've matched the full potree lib's options as close as I can. Could you share what material and octree params you're using so I could investigate further? I am doing some things with the camera projection matrix but they aren't very drastic and I'm not sure how much of a bearing that has on point loading

It isn't critical at this time since the point cloud visually looks fine, I'm just concerned that it may lead to problems in the future