Search Unity

Best way to render a large pointcloud in unity

Discussion in 'Visual Effect Graph' started by jacobmh98, May 2, 2022.

  1. jacobmh98

    jacobmh98

    Joined:
    Dec 19, 2021
    Posts:
    1
    Hello everyone,
    We are trying to display a pointcloud from a list of Vector3's, and currently we are rendering each point as a cube which is working fine up about 300.000 points where it starts lagging. Therefore, we looked into other methods for rendering it, such as VFX graph and compute shader, however these methods do not seem very intuitive as beginners in Unity, and therefore we are wondering if the performance boost from switching to one of these is even worth it?
     
  2. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,428
    yes, those can easily render millions of points.

    check also this
    https://github.com/keijiro/Pcx

    asset store has at least 2 point cloud viewer plugins (one free and i have one paid solution there).

    *oops, didnt notice this was specifically in the VFX board.. but yeah, have seen vfx demos with points clouds, with millions of points, so certainly should try that.
     
    Last edited: May 2, 2022
  3. Olmi

    Olmi

    Joined:
    Nov 29, 2012
    Posts:
    1,553
    I would definitely pick VFX Graph, it's much more easier route than compute shaders.
    At least for your initial tests you could use the Point Cache feature in VFX Graph.

    See the following link for information about the Point Cache:
    https://docs.unity3d.com/Packages/c...aph@12.0/manual/point-cache-in-vfx-graph.html
    Point caches can be baked with the Point Cache Bake Tool:
    https://docs.unity3d.com/Packages/com.unity.visualeffectgraph@12.0/manual/point-cache-bake-tool.html

    But if you need to do something specific and interactive, then you probably need to resort to a combination of VFX Graph and some kind of compute shader implementation.

    EDIT: I didn't notice you already had a point cloud in Vector3 format. Then you need to probably use a compute shader.
     
    Last edited: May 2, 2022
  4. andybak

    andybak

    Joined:
    Jan 14, 2017
    Posts:
    569
    Why? You can easily pump data into VFX Graph
     
    Olmi likes this.
  5. Olmi

    Olmi

    Joined:
    Nov 29, 2012
    Posts:
    1,553
    @andybak Yeah well it would be quite trivial to also use the Graphics Buffer now. I was too tired (it was late when I replied.)
     
  6. Olmi

    Olmi

    Joined:
    Nov 29, 2012
    Posts:
    1,553
  7. TokyoWarfareProject

    TokyoWarfareProject

    Joined:
    Jun 20, 2018
    Posts:
    814