Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

[Released] Point Cloud Viewer Tools

Discussion in 'Assets and Asset Store' started by mgear, Apr 14, 2014.

  1. Rickmc3280

    Rickmc3280

    Joined:
    Jun 28, 2014
    Posts:
    187
    Wanted to report that I have a massive point cloud loaded as las and for some reason it splits th e points into different axis groupings. It makes some of them vertical, some of them horizontal etc. It loads fine in my other programs. Something about the point cloud loader does not like it. For that reason I am working on my own. Do you have any suggestions for which one of your material/shaders would work best in unity for visualizing a mesh in URP that shows the colors. or recommendation for me to create my own using the scriptable materials?

    I really need a few larger point clouds to show my application working. Also based on your experiences, would I be better off meshing a billion points OR loading them into memory using the "other" method ( i usually refer to them as virtual point clouds vs meshed point clouds)? Neither one works for me, I also tried using the standalone converter that you made but it always crashes on my larger files.
     
  2. TokyoWarfareProject

    TokyoWarfareProject

    Joined:
    Jun 20, 2018
    Posts:
    801
    Do you need it loaded all at a time? why not use the streaming method? you could set up a large distance of view if you've enough memory and procesing power. Using streaming I've an 800M terrain dataset. With streaming the size I would say is virtually infinite. Not sure if current version already implements the hability to convert tiles to the stream format. I could not go higher because at the time you had to provide the whole cloud to the converter.
     
  3. Rickmc3280

    Rickmc3280

    Joined:
    Jun 28, 2014
    Posts:
    187
    What do you mean the "Streaming" Method? One of my issues is that I am unable to load the data to even stream it because if it works with the mesh method, the tiles are all inverted in random directions. I assume that you mean to load it into v2/v3 format as a "Virtual" cloud? (To note: They are also very large files and cannot be stream/read unless there is a feature that I have overlooked - the 4gb limit was always reached).

    I have 64gb memory on this pc and 12 cores/24 threads with a 1080ti. I feel like it is enough?

    I have been working on an advanced culling system for PCs that I will be implementing as well (ive been jumping around my project building the pieces to put the puzzle together last), but I wasnt expecting that these tools wouldnt work because they have in the past. So I am hopeful that the streaming situation will work with it to help increase performance... but cant do much in the way of implementing it due to not being able to get these clouds loaded.

    Would love to know which workflow you are using because I've seen your posts and I feel like both of us are trying to visualize the heavy data in similar use cases.

    Unless I can get it working, I will have to write my own processing script for this. I did create a universal point cloud loader (for ascii based filed) (it determines the file structure and selects the best method for reading the data), however my large clouds are in las/laz format so I am relying PCT to bring those in. I do not yet know how to read them in in any other way.
     
    Last edited: Dec 17, 2020
  4. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    8,991
    is this from the editor binary or mesh converter? (or commandline v3 format)
     
  5. TokyoWarfareProject

    TokyoWarfareProject

    Joined:
    Jun 20, 2018
    Posts:
    801
    I dont´use mesh method, the other method I don´t recall the name, but its like "pure" points. I've not used this in a while. With streaming you do not need to load all the data at once butyou can stream the data on the go. And if you've a powerfull rig you can set up far view distances, also you've a range where the density fades based on distance
     
  6. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    8,991
    v3 is the streaming format, need to use 2019.1 or later
    and enable these to release memory:
    upload_2020-12-18_13-43-10.png

    *single tile still cannot be over 2gb or so, that would be too slow anyways.. so need to adjust grid size smaller, so that the tiles dont contain too many points.

    v1/v2 is the original format, loads cloud completely into memory.
     
  7. Rickmc3280

    Rickmc3280

    Joined:
    Jun 28, 2014
    Posts:
    187
    So the one that was split up in pieces and in different directions was a las file imported in as a binary cloud. It was a 5gb file. I have been unable to bring in my larger files, they fail in all of the above. Command line, stand alone, unity mesh, unity directx11... does not seem to struggle as much when it comes to smaller files, but It does seem to fail often by piecing the tiles randomly and putting them in random directions.

    I tried v3 with the 5gb file and it finished processing, however, I could not get it to work. (PCROOT)? It acted like it was loading it into the scene, but nothing was there. I changed the materials as well, and nothing. This is why i was thinking of going the mesh route with materials as probably easier to get a shader/material to work.

    Im not sure what material colors you use (color/vs/color32) but I was thinking of trying the 32 route as most forums suggest that will increase performance a good bit.

    Also I did try to use the native array and release memory. There seems to be an issue with the las reader, possibly.
     
    Last edited: Dec 18, 2020
  8. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    8,991
    could try splitting the las into few pieces, just to see if that's the issue. https://rapidlasso.com/lastools/lassplit/ (or cloudcompare)

    for mesh its regular Color, for the binary viewers its Vector3 (but can use packed colors, to halve file sizes).

    .pcroot is text file, so can check if it looks ok, can see total point count, tile point counts,
    and most importantly those bounds (if they are some huge values, then points wont be visible, need to enable scaling and almost always [x] near 0,0,0
    https://github.com/unitycoder/Unity...-Structure#custom-v3-tiles-pcroot-and-pct-rgb
     
  9. Rickmc3280

    Rickmc3280

    Joined:
    Jun 28, 2014
    Posts:
    187

    I always shift to 0,0,0. after realizing the floating point problem and others... and my point clouds are all in meters (exported that way) so they are Unity scale. Ill have to try and see about the lassplit tool. I've done it before in cloud compare, but dread importing them in especially if they still fail because they take forever.

    Working on a custom point cloud reader for my 40gb pts files since the las importer doesnt work for me hardly ever and I will see how that goes. Would any of your materials work for me bringing the points in as point mesh?
     
  10. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    8,991
    i'll have a look at the mesh converter, what happens with huge files.
    but at least must have the [x] add meshes to current scene disabled (unity starts dying with thousands of meshes)
     
  11. Skaltum

    Skaltum

    Joined:
    Nov 1, 2013
    Posts:
    28
    Quick question: Can this plugin load raw point clouds at runtime?
    I see plenty of documentation about the conversion process to mesh or other formats from within the editor. But I am not sure this process is required or an optional optimization. I know that it would be slow, but in my case that doesn't really matter.
     
  12. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    8,991
    yes, these formats are supported at runtime (there is separate runtimeviewer.cs, and example scene for it)
    https://github.com/unitycoder/UnityPointCloudViewer/wiki/Import-Formats#runtime-importer

    there is also runtime caching option, so it would generate faster binary cloud to use in the 2nd load.

    *note runtimeviewer is tested in desktop only
     
    Skaltum likes this.
  13. jaeggman

    jaeggman

    Joined:
    Nov 25, 2020
    Posts:
    4
    I experienced the same thing with some of my files. After I deleted the scalars in CloudCompare this error did not occur anymore. Maybe this helps..

    cheers
    MJ
     
    mgear likes this.
  14. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    8,991
    few more tests with the old exe:
    Nvidia RTX 3090, i9-9900k 3.60GHZ (desktop) : 92 fps

    100m points (old test exe):
    Nvidia RTX 2080 ti, i9-9900k 3.60GHZ (desktop) : 32 fps
    Nvidia RTX 3090, i9-9900k 3.60GHZ (desktop) : 49 fps

    in editor (2018.4.8f1) not so big difference on a quick test:

    431m points:
    2080 ti
    upload_2021-1-24_20-51-31.png

    3090:
    upload_2021-1-24_20-50-22.png
     
  15. tomekkie2

    tomekkie2

    Joined:
    Jul 6, 2012
    Posts:
    949
    I have just imported your asset into my project and tried to include one of the demo scenes into the build, but can not, because of missing type/namespace kind of errors.
    I have looked into the quickstart guide page, but I can not find any hint on this.

    This is Unity 2019.4.13f1, LTS version.

    I don't understand why Unity is packing the editor scripts into the build here.

    upload_2021-1-28_11-3-36.png

    I have moved the Editor folder content from the asset to another Editor folder inside the project and that has fixed the problem.
     

    Attached Files:

    Last edited: Jan 28, 2021
  16. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    8,991
    Yeah it was issue with the AssemblyDefinition file (which i had used for test framework),
    so delete those assembly definition files there.

    one or both of these if have,
    upload_2021-1-28_14-11-18.png

    https://github.com/unitycoder/UnityPointCloudViewer/issues/104
     
    Last edited: Feb 2, 2021
    tomekkie2 likes this.
  17. QuantumTheory

    QuantumTheory

    Joined:
    Jan 19, 2012
    Posts:
    1,081
    This looks to be an excellent toolset and I'm considering purchasing it for a project of mine.

    After looking through the forum, there seems to be support for mobile devices. Are there mobile-specific shaders?

    Also, is there a shader that visualizes the point density distribution? If not, could you shed some light on how I can calculate that information so I can store it in a custom data format and load it at runtime?
     
    tomekkie2 likes this.
  18. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    8,991
    "Mobile version" means, you'll convert point clouds into regular unity mesh gameobjects (but using point rendering).
    So there's few shaders that work on mobile, with point size shader variable.

    point density info:
    If you are using mesh version (for mobile), then you can access those meshes (and their vertices) easily in scene yourself (and do any calculations for them).
    So in that case, you could assign your density information in the vertex color alpha (or other vertex property),
    and modify the shader to do something with that alpha (=density) value (for example scale pointsize).
    i can help with this if needed.

    Do you have some specific platforms or target device(s) in mind, i can then possible give more info or limitations?

    Also note that URP/HDRP is not really supported or much tested, some things and shaders work, but not all as is.
     
  19. QuantumTheory

    QuantumTheory

    Joined:
    Jan 19, 2012
    Posts:
    1,081
    Right, I expected a "mesh" version for mobile rendering. I've done some point cloud processing/rendering here in Unity so I'm somewhat familiar.

    I've packed extra info in the vertex alpha, or even in UVs. Storing the data is no problem, I'm just having issues with finding the right math to generate the density data ;) Would you know of any functions?

    I'm targeting mobile (ios, android) as I'm attempting to do photogrammetry alignments live in the field. The server receives the images, generate the point cloud data, sends it back to the phone and renders it where the user can examine the cloud to see what areas need to be re-shot. Visualizing density would be extremely helpful in that regard.

    No need for SRPs ;) I don't want to deal with all that..

    Thanks @mgear
     
  20. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    8,991
    i'd look for any available methods/algorithms, and perhaps you can do that calculation in the server already.
    the "Approximate" version here probably sounds good enough?
    https://www.cloudcompare.org/doc/wiki/index.php?title=Density#Precise_or_Approximate

    actually in your use case, there probably isn't much use for my plugin..
    just do your calculations on the server, send vertex position and color data (raw floats or your own format),
    create meshes from that received data. (i guess could use my mobile point shader as base, or point mesh generation, but pretty sure can find similar examples elsewhere too)

    in my plugin, there is runtime point cloud parser, that creates meshes too,
    but currently it loads data from file system only (not from webrequest), so that would need to be adjusted too.
     
  21. tomekkie2

    tomekkie2

    Joined:
    Jul 6, 2012
    Posts:
    949
    I am working on an Android app for Oculus Quest.
    What are the optimisation options available for that?
    The mobile demo scene - depending on view area content - sometimes runs jaggy even on this demo.
    Is it possible to get LOD levels or Dynamic Resolution to work on Android?

    I also can't get to work the PointSize settings on the Android shader. Any changes do not seem to take effect.

    I would also suggest adding more Decimate points options.
    I think the leave n-th point functionality would be a great addition to the already existing remove n-th point option.
    I have modified this myself and it works great in my case.

    Zrzut ekranu 2021-02-01 101914.png
     
    Last edited: Feb 1, 2021
  22. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    8,991
    I'll check on the pointsize, are you adjusting it runtime or in editor and then build?

    Since android uses mesh clouds, dynamic res wouldn't work there (and modifying mesh vertex counts on the fly is quite heavy operation), mesh lods can be used, but i'm not really convinced that it helps much.

    for Quest, can try using all minimal settings, even mono-rendering (not stereo),
    and must enable Split to Grid in the converter (and look for good grid size), so that the meshes get culled away better when outside view.
    i think 4-6 million points was possible last time i checked.

    decimation:
    keep/skip: yes, that would be easy (i'll add to todo list)

    in the standalone converter i've added keep and skip (but its las/laz only for now)
    https://github.com/unitycoder/PointCloudConverter/wiki/Commandline-Arguments

    still in reality it would be recommended to filter the cloud in external (professional) tools,
    meshlab/cloudcompare (free), or other paid tools to get better results (since just skipping points wouldnt make the point cloud evenly distributed, or to remove stray points, etc.)
    I do eventually want to add better processing tools, but probably not happening anytime soon.
     
    tomekkie2 likes this.
  23. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    8,991
    tomekkie2 likes this.
  24. tomekkie2

    tomekkie2

    Joined:
    Jul 6, 2012
    Posts:
    949
  25. pixeleif

    pixeleif

    Joined:
    Feb 9, 2016
    Posts:
    15
    Hi, i just wanted to show a quick test build to my boss.
    Opened a test scene and converted a cloud. Everything is good in play mode, but when i try to build I get these errors.
    Did I miss something basic ?

    Edit: I've tried in 2019.4.18 and 2020.2.1f1
     

    Attached Files:

    Last edited: Feb 2, 2021
  26. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    8,991
  27. pixeleif

    pixeleif

    Joined:
    Feb 9, 2016
    Posts:
    15
    Thanks for the quick reply!
    Sorry for not reading through all pages ;)
     
  28. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    8,991
  29. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    8,991
    submitted v2.60 update to store.

    mostly small fixes, few updates to Brekel format (requires their new V3 tool to save into that new format), which can be streamed from disk.

    https://github.com/unitycoder/UnityPointCloudViewer/blob/master/ReleaseNotes/release-notes.txt

    v2.60

    - Feature: Brekel animated cloud file streaming (stream data from disk, good for large files. Requires Brekel PointCloud V3 (beta or newer) with new unitycoder v3 format export) https://brekel.com/brekel-pointcloud-v3/

    - Added: MeshPointsDX11QuadSizeByDistance.mat (scales point sizes by distance and min-max range, can be used in DX11 mode for meshes, to make far away points bigger)

    - Improved: V1/V2 Point picking is now more accurate (and fixed slicing issues with some clouds)
    - Improved: Brekel animated cloud (.bin) parsing is now ~2-3x faster (on top of the previous 2x improvement)
    - Improved: Brekel animated cloud now uses less memory (no more padding or extra array copy/clear)

    - Fixed: MeshConverter: Don't add extra vertex padding to brekel mesh frames (smaller files, less verts)
    - Fixed: Build namespace errors (due to asmdef files, now removed) https://github.com/unitycoder/UnityPointCloudViewer/issues/104
    - Fixed: PointCloud-ModifyAndSave-V2 example, saved UCPC file was missing bounds data from header
    - Fixed: UCPC file saving failed to correct path, if output path had forward clashes

    - Changed: BinaryConverter, allow gridsize smaller than 1 (0.01) for really dense clouds (but can cause other issues, not really tested) https://github.com/unitycoder/UnityPointCloudViewer/issues/101
    - Changed: V3 viewer, hide mesh rendering toggle (since its not ready to be used yet)
     
  30. tomekkie2

    tomekkie2

    Joined:
    Jul 6, 2012
    Posts:
    949
    Is that included? I can't see.
     
  31. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    8,991
    not in this update yet, but should be in the next.
     
    tomekkie2 likes this.
  32. Jeff169

    Jeff169

    Joined:
    Feb 9, 2021
    Posts:
    2
    Hi,
    I have an issue with the v3 format to display "huge" point clouds (30 to 400 million points).
    When I enter play mode, the cloud is not displayed. It is working with the v2 format but not v3. I have tried the v3 sample and it works great, but not with my cloud.

    The export to .pcroot works properly and when I use the Point Cloud Viewer Tiles script, it loads the tiles (finishes with "Done init culling"), but nothing happened afterwards.

    I don't think it is a scaling/offset issue since it works well with v2.

    I must admit that I'm a little lost here, any help would be much appreciated!
     
  33. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    8,991
  34. Jeff169

    Jeff169

    Joined:
    Feb 9, 2021
    Posts:
    2
  35. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    8,991
  36. Reson_one

    Reson_one

    Joined:
    Oct 9, 2016
    Posts:
    21
    @mgear hello! In the test demo scene for loading v2 cloud formats, everything works well, but the point cloud is not displayed in the build. There is a .ucpc file in the build in the streaming assets folder. What could be the problem?
    upload_2021-3-22_21-50-32.png
     
  37. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    8,991
    so it works in the editor but not in the build?

    can you check the player.log, https://docs.unity3d.com/Manual/LogFiles.html
    its somewhere around C:\Users\username\AppData\LocalLow\CompanyName\ProductName\Player.log
    can private message or email to me for checking.
     
  38. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    8,991
    ok, so it was "OutOfMemoryException: Out of memory" in build only,
    fixed by using 64bit bit build (instead of 32bit) :

     
  39. tommysugg

    tommysugg

    Joined:
    Mar 13, 2021
    Posts:
    2
    Hey, just got the plug in and really liking it so far. Been using the v3 tile demo for indoor lidar scans of really large buildings. The v3 tiles are a life saver!

    I'm trying to see if I can get this to work for my quest 2 in VR. I pulled up the mobile demo and replaced your point cloud with mine after passing it through the point cloud to unity mesh process, and replaced the camera with an OVRPlayerController from oculus integration. Unfortunately, I'm getting a error message about submesh topology.

    The only difference I can really see from the demo is that my (Mesh Filter) in Inspector is empty, where yours has data there.


    upload_2021-3-24_22-41-7.png

    upload_2021-3-24_22-9-32.png

    upload_2021-3-24_22-20-32.png
     

    Attached Files:

  40. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    8,991
    @tommysugg are you in which unity version?
    but try disabling all static flags from that dropdown
    upload_2021-3-25_9-44-27.png

    also note that for DX11, pick one of the mesh shaders (with DX11 in the name), so that it supports point size in pc.
    upload_2021-3-25_9-47-7.png
     
  41. tommysugg

    tommysugg

    Joined:
    Mar 13, 2021
    Posts:
    2
    Tried with a couple different DX11 meshes and made sure static was unchecked. Still got the same error.

    I'm on 2020.2.7f1. Is that too recent of a version?
     
  42. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    8,991
    ok tested with that version, seems to happen in build, if you convert ply with normals..
    solution for now: need to uncheck that [ ] Batching static (for all those meshes in scene)
    then it should work.
    upload_2021-3-26_11-56-6.png
     

    Attached Files:

  43. jtenny

    jtenny

    Joined:
    Aug 9, 2019
    Posts:
    7
    Hi @mgear really cool package. I am wondering, does your visualization solution have any support Entwine Point Tiles (EPT)? The USGS hosts its 3DEP LiDAR data in EPT format on an AWS server. It would be really awesome to take advantage of this resource and stream LiDAR data straight to Unity.
     
  44. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    8,991
    no .ept support, i'll add to things-to-check list, at least their format seems to be open, so it should be possible to read,
    but implementing their coordinate/hierarchy/octree system could be the complicated part..
    i'll add notes here when have something (*not yet in the coming weeks most likely though) https://github.com/unitycoder/UnityPointCloudViewer/issues/114
     
  45. jtenny

    jtenny

    Joined:
    Aug 9, 2019
    Posts:
    7
    Cool, sounds good, thank you for taking a look.
     
  46. WayneVenter

    WayneVenter

    Joined:
    May 8, 2019
    Posts:
    56
    Hi all, I've been reading the forum but can't confirm the following, we want to load .ply files (Binary format, no normals, points only) from the StreamingAssets folder in run time, these files will be added in real time so we need scripting access to dynamically load .ply files. Is this possible, not in Editor, in Runtime.
     
  47. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    8,991
    PLY Binary is not supported, only Ply Ascii.
    i guess i should add that since its simple one, you can follow the issue here, i'll post there if/when have progress:
    https://github.com/unitycoder/UnityPointCloudViewer/issues/115

    if you need it right now, there's 2 options that come to mind:
    - use some external tool from commandline to do conversion into ply ascii or any of those runtime supported formats
    - make own ply binary importer (probably can find c# libraries for it), then feed read points into my viewer (see example scene PointCloud-YourOwnData.scene)


    For info, Supported formats for editor and runtime:
    https://github.com/unitycoder/UnityPointCloudViewer/wiki/Import-Formats
     
  48. Rickmc3280

    Rickmc3280

    Joined:
    Jun 28, 2014
    Posts:
    187
    There is no reason you couldnt create a file parser easily for binary, if you know the format... read it in a for loop or similar.
     
  49. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    8,991
  50. zjyzjy1121

    zjyzjy1121

    Joined:
    Dec 13, 2016
    Posts:
    1
    Hi @mgear, I have a large LAS file (over 60 million points) depicting many trees. I wanted to have each tree as a gameobject, so I saved each tree as a LAS file in CloudCompare and converted it to a mesh using the point cloud viewer tools. So far, I have added 140 trees (meshes) to the Unity scene, but the scene view performance in the gameplay mode is horrible (8 FPS). I don't think the number of points causes the problem because the original LAS file (containing 900 trees) has over 60 million points, and the scene view performance is pretty good if I convert this LAS file to meshes (108 FPS). Do you have any idea why this has happened and how I can fix it?
     
    Last edited: Jun 12, 2021