Search Unity

  1. All Pro and Enterprise subscribers: find helpful & inspiring creative, tech, and business know-how in the new Unity Success Hub. Sign in to stay up to date.
    Dismiss Notice
  2. Dismiss Notice

[Released] Point Cloud Viewer Tools

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

  1. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    6,773
    hi,

    Now available, basic point cloud viewer for DX11 (+mesh version included for non-dx11)

    Current Features
    - DX11 Point Cloud Viewer (up to 150 million points *depends on your hardware stats) *with v3 format, 432 million visible points have been tested, ~10billion point dataset was also tested)
    - Single color and RGB point cloud shaders included (for both DX11 non-dx11 modes)
    - Supported import formats: XYZ, XYZRGB, CGO, ASC, CATIA ASC, PLY (ASC)
    - Editor plugin#1: Point Cloud To Binary (saves data to custom binary format for faster reading)
    - Editor plugin#2: Point Cloud To Unity Meshes (splits point cloud data into 65k meshes)

    * This is first version, so more features are coming and can be requested.
    ** Warning: You need to be familiar working with point clouds, otherwise you'll have problems also, this is NO USE for games, and finally, if you want to view point clouds then use proper point cloud viewers for it, Unity is not good for large clouds.

    Asset Store
    https://assetstore.unity.com/packag...int-cloud-viewer-and-tools-16019?aid=1101lGti

    More Info images (support blog)
    https://unitycoder.com/blog/2014/03/19/asset-store-point-cloud-viewer-unity/

    Github for Issues and Wiki Documentation
    https://github.com/unitycoder/UnityPointCloudViewer

    Video from @sjm-tech : point cloud viewer in action

    *Note that they have added extra features like measurements, custom UI to control material etc.


    Images
    $pointcloudviewer_ss02.jpg
    $pointcloudviewer_ss01.jpg
    $pointcloudviewer_ss08.jpg
    $pointcloudviewer_ss03.jpg

    (more images in the blog page)

    *22/12/19 edit info, update links
     
    Last edited: Dec 30, 2020
    sjm-tech and Gozdek like this.
  2. TylerPerry

    TylerPerry

    Joined:
    May 29, 2011
    Posts:
    5,577
    Could you make a webplayer? Or a downloadable demo?
     
  3. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    6,773
  4. krillmcrawl0

    krillmcrawl0

    Joined:
    Jan 13, 2014
    Posts:
    35
    Hi!

    I'm really interested in this.


    Is it possible today to use lod in the system?
    Example, I have 20 files with about 5 million points in each one. I divide these into a high 5 million, medium 1 million and low 500 k point cloud. Based on distance from camera it would switch to a lower lod. Or would that lag when switching between poitclouds?

    Have you considered lodding the pointclouds using an octree? For example using pcl; http://docs.pointclouds.org/1.7.0/group__octree.html. That would solve the lod problem instantly:)

    +1 for point size
    +1 for point normals
     
  5. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    6,773
    LOD,
    Basically its just a vector3 array, can re-initialize it and load new points in (takes several seconds depending on the amount and your harddisk..)
    Main problem is that only one dx11 cloud "object" can be viewed at a time.. so LODding single object doesnt really help much, since you could read the full cloud on it at start anyways..

    For the non-dx11 version, that might work nicer, since it uses unity mesh assets..

    But adding to wishlist for later testing.
     
  6. krillmcrawl0

    krillmcrawl0

    Joined:
    Jan 13, 2014
    Posts:
    35
  7. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    6,773
    havent seen that before, didnt seem to work straigth away.. (no dx11 there?, and not sure if there are some import formats supported? or what the dll does, needs pro for that dll?)

    lods,
    tested: dx11 version can load new cloud anytime, but doesnt really since there is only 1 cloud at a time..

    mesh version, to be tested.
    - load low res cloud, split to meshes, "group" them
    - load med res cloud, split to meshes, "group" them
    - load high res cloud, split to meshes, "group" them

    then hide/show those groups based on distance.. not really sure yet how would that look and if that really helps much.

    *Update on that^, no progress yet, have added normals support for PLY format (for the mesh converter)
     
    Last edited: May 24, 2014
  8. jeffries7

    jeffries7

    Joined:
    Jun 25, 2014
    Posts:
    44
    I have a quick question with regards to the input formats, I have some point cloud data in the format of RCS files, are these supported?(i'm new to point clouds). I know they aren't listed but I thought I'd ask.
     
  9. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    6,773
    Not supported, but if you can send me a sample file (or the file specifications), I can take a look.
     
  10. jeffries7

    jeffries7

    Joined:
    Jun 25, 2014
    Posts:
    44
    Thanks for the quick reply. Unfortunately I can't provide a sample file, all I know is that it comes from a Faro camera and my boss has asked if it's possible to get it into Unity.
     
  11. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    6,773
    If you can then open it in faro scene or some other tool, then its easy to export into other formats (like .xyz)

    Seems like it could be "Autodesk ReCap Point Cloud .rcs and .rcp", i'll check if can find some sample file..
     
  12. Half_Res

    Half_Res

    Joined:
    Apr 16, 2013
    Posts:
    12
    Hi,

    Just bought the Point Cloud Viewer yesterday and have been experimenting with it for a project were working on. We've been really impressed with it.

    Is there anyway to get it to read the .las file format as this is becoming fairly standard to lots of scanners?
     
  13. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    6,773
    Thanks!

    I'll have a look (and adding to wishlist).

    Next update should be within 10days, mainly:
    - faster binary loading
    - 1 new import format
    - original mobile point-mesh demo scene included in the package
     
  14. Half_Res

    Half_Res

    Joined:
    Apr 16, 2013
    Posts:
    12
    Thanks for the quick reply. Its a really good asset, I'm looking forward to the next point release.
     
  15. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    6,773
    V1.4 is now live in the asset store:
    http://u3d.as/6Xx

    • Experimental binary import support for Brekel Point Cloud Pro V2 (can view single cloud or animated frames) *DX11 only
    • Can also convert animated Brekel point cloud frames into unity meshes
    • Much faster binary loading (somewhat experimental still)
    • Mobile demo scene included (its currently quite heavy, will be adjusted in coming updates, and hangs on iphone5, works better on androids)
    "Brekel Pro Pointcloud V2 is a Windows application that records 3D pointcloud using a Kinect sensor" : http://brekel.com/brekel-pro-pointcloud-v2/ *Note v2.08 or later requirer
     
    Last edited: Jan 13, 2015
  16. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    6,773
    Some progress, can parse .LAS header file,
    next step is just to get the points and colors out from the file.
     
  17. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    6,773
  18. Vern_Shurtz

    Vern_Shurtz

    Joined:
    Mar 6, 2009
    Posts:
    264
    Hello, I'm trying to make a Unity mesh of the dragon point cloud example from Stanford and I have tried numerous times with different settings but the dragon seems to always come in with the pieces misaligned. Here are a couple screenshots

    DragonA.jpg DragonB.jpg

    Any ideas where I am going wrong?

    Thanks
    Vern

    Edit: On the DragonA image for each PC_ # the X position was incremented by 1. So for PC_1 X=1, for PC_2 X=2 and so on. PC_56 X=56. I changed all of them to X=0 and the mesh looks like it should.
     
    Last edited: Feb 15, 2015
  19. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    6,773
    Hi,

    Yes, had forgotton one test line on the last update, can fix it here:

    Code (CSharp):
    1. //OPEN FILE
    2. PointCloud2MeshConverter.cs
    3.  
    4. //FIND LINE
    5. target.transform.position+=Vector3.right*meshCounter;
    6.  
    7. //REMOVE OR COMMENT IT OUT
    8. //target.transform.position+=Vector3.right*meshCounter;
     
    Last edited: Feb 23, 2015
  20. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    6,773
    Some progress on LAS importer, can get point coordinates out from the file,
    so hopefully this gets in the next update (probably coming later in March)

    Got one more bug report & fix for the current version (v1.4)

    Code (CSharp):
    1.  
    2. //OPEN FILE(s)
    3. PointCloud2MeshConverter.cs
    4. PointCloud2BinaryConverter.cs
    5.  
    6. //FIND LINE(s)
    7. x-=offset.x;
    8. y-=offset.x;
    9. z-=offset.x;
    10.  
    11. //REPLACE WITH
    12. x-=offset.x;
    13. y-=offset.y;
    14. z-=offset.z;
     
  21. Aurecon_Unity

    Aurecon_Unity

    Joined:
    Jul 6, 2011
    Posts:
    241
    Hi mgear, I'm really interested in your plugin but I have a question about file formats - have you considered adding .pts to the list of available formats?

    My understanding is that .pts is very similar to .xyz, and it means that I could use your plugin in tandem with Autodesk Recap which can only output to .pts, .pcg, .rcs and .e57.

    Of those formats, .pts is the one that has the most cross compatibility with other point cloud software and means we could use our Autodesk based approach directly with your plugin which would be simply awesome.

    Thanks, and well done on such a great and robust plugin!
     
  22. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    6,773
    Yes, its ascii so that should be quite easy to add, i'll try to add for March update.
    (It might even work using the current XYZ importer, if there is no intensity value before RGB..)

    Thanks!
     
  23. Aurecon_Unity

    Aurecon_Unity

    Joined:
    Jul 6, 2011
    Posts:
    241
    Awesome news! Yeah, I've heard some people on the internet say that they have just changed the extension from .pts to .xyz and it loaded into their preferred software with varyting degrees of success, so hopefully they are structurally very similar.
     
  24. karonte

    karonte

    Joined:
    Jun 2, 2013
    Posts:
    38
    Hi all, just one question.
    Is it possible to visualize a point cloud in "realtime" taking kinect V2 input? so i can do some visual effects on them...
     
  25. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    6,773
    Not possible with this plugin.

    You could use this external software to record point cloud with kinect,
    and then export to this viewer, but it would be pre-recorded data not live.
    http://brekel.com/brekel-pro-pointcloud-v2/

    Or otherwise, maybe could take kinect depth texture and draw extruded mesh using that (with point rendering enabled for mesh), havent tested..
     
  26. topofsteel

    topofsteel

    Joined:
    Dec 2, 2011
    Posts:
    996
    Is publishing to a webplayer supported yet?
     
  27. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    6,773
    Yes, it works (since 1.3)
    Note: using WWW to load binary data, so it must load the complete file first, until it can be displayed..

    There is example scene included, it loads point cloud binary data from my website (about 2.5m points), using DX11.
     
  28. topofsteel

    topofsteel

    Joined:
    Dec 2, 2011
    Posts:
    996
    How long does it take to load that file? How is the file stored on your site? I assume it would support streaming and additive scene loading. If my client doesn't have DX11 capability for whatever reason, would a pre-build mesh format work? Thank you.
     
  29. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    6,773
    Yes, the mesh version would probably be easier to stream also,
    using normal asset bundles (as they are default unity meshes).
    Yes, mesh version works without DX11.

    Webplayer loaded about 1min 15secs, tested just now in the editor,
    Sample file size is 60mb, single binary file.

    Would be actually good idea to split it to smaller pieces and display the parts already after each chunk is loaded,
    also to cache it locally after loading for next run etc.. but those are not implemented yet.
     
  30. Aurecon_Unity

    Aurecon_Unity

    Joined:
    Jul 6, 2011
    Posts:
    241
    Hi mgear, can you advise if you can somehow tweak the PointCloudColorsMesh shader to expose the alpha variable? I'd love to be able to tweak the alpha of this particular shader.

    Thanks very much, and well done - this plugin is great and I've been getting some pretty impressive results.
     
  31. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    6,773
    Hi,

    Thanks! Try the shader in your pm.
     
  32. Aurecon_Unity

    Aurecon_Unity

    Joined:
    Jul 6, 2011
    Posts:
    241
    Thanks mgear, that new shader works great.

    I've been kicking some serious goals thanks to you - our GIS teams are losing their lunch over my early demos of interactive point clouds. I've found that a point cloud mesh is giving much better performance than the DirectX11 version, with the added benefit of being a physical object that can tie into our layering systems.

    That shader you so kindly sent to me is the backbone of a culling system where the cloud chunks fade over distance before disabling the renderer altogether, giving even better performance and theoretically allowing us to significantly exceed the 20 million limit that the DirectX11 version offers.

    I'm not sure if you are still actively developing the plugin but if so, I have a few suggestions for your consideration:

    1) An option in the Point Cloud Mesh generation window to 'decimate' the cloud - only read every 'nth' line from the source file when generating the mesh. Quite often, the cloud does not need to be quite so dense so being able to reduce the density by a user-inputted variable would be awesome.

    2) Splitting the mesh when the distance between 2 points is greater than a certain amount. So, by default it reads 65,000 lines, creates a mesh and then splits to a new mesh for the next 65,000 points. What would be awesome, would be if you could specify a distance (say, 5 metres), and if the distance from one point on a line to the next point on a line exceeds this distance, it creates a manual split at that point (regardless of the number of verts).

    This will ensure that the chunks are always spaced tightly together, with no instance where the mesh could span a large distance if, say, the scan was performed in strips and it transitions from one strip to the next within the 65,000 points of one mesh. The reason for this is that it will aid in the culling system I mentioned above, which gets the distance from camera to the bounds.centre of the mesh. So, I guess this is a pretty selfish request :p

    3) Finally, sometimes errant points can get picked up in the scan that don't fit with the other points (don't know if this is an error in the scan or something else). Normally, these errant points will appear at the very top of the source file because they are different from the other points coordinates... It would be great of you could have an 'ignore first line' or 'ignore first nth lines' option. Editing the .txt file of a large scan to delete the first line is a nightmare, so having this option in the plugin would be great.

    That's about it - once again, well done on such an awesome plugin... we are getting our money's worth and more!!
     
  33. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    6,773
    I've added those into todo-list, at least (1) and (3) should be quite simple.
    (2) Yes, I've been thinking something similar, sorting the points so that the generated meshes would take smaller area.

    I'll test those out later this week, so hopefully can get all those into the next update.
     
    Aurecon_Unity likes this.
  34. Aurecon_Unity

    Aurecon_Unity

    Joined:
    Jul 6, 2011
    Posts:
    241
    You are awesome. One bug which I just noticed - if I split the mesh with a smaller vertex count than 65,000, I can't seem to set the meshes to 'static' - it throws the following error at runtime:

    Failed getting triangles. Submesh topology is on lines or points.

    In this instance, I was trying to split at 20,000 verts. The error only comes up if I try to make the meshes static.
     
  35. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    6,773
    Thanks, I'll check that also.
     
    Aurecon_Unity likes this.
  36. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    6,773
    some progress,

    1) Decimate: Basic decimate added, skipping every nth point. (later will add other options, like "merge by distance" or others)
    2) Splitting: Started, points are now sorted, so currently each mesh becomes a thin slice. Adding other options to it.
    3) Probably refers to noise or stray points? If yes, these could be probably filtered out by checking if there are no other near points (within given distance). Testing it out.

    I didnt manage to get that message anywhere.. which unity version you are using, pc or mac?
    Maybe you can you email me some sample mesh/scene.
     
  37. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    6,773
    submitted v1.6 update to store just now (published with 5.1.0f3)

    v1.6
    - Added: New material "PointCloudColorsMeshAlpha.material" (and shader "PointCloudMeshColorsAlpha.shader") with adjustable color tint & alpha
    - Added: PointCloud2Mesh now imports .LAS & .PTS files
    - Added: **Experimental** PseudoLight & VertexPush scene "scene_MeshPointPush" for mesh clouds (sets point brightness based on distance to give object and pushes(displaces) points away form given object)
    - Added: Basic decimate cloud for PointCloud2Mesh (remove every #nth point)
    - Added: Display selected file size (below sourcefile field)
    - Added: **Experimental** [x] Optimize Points for PointCloud2Mesh (easier to see from scene view while playing), it sorts the points along X axis (to allow mesh pieces to get culled easier), but doesnt work well with all values, if your cloud seems to be missing points, disable Optimize points.

    - Changed: Project is now updated to Unity5.1.0f3
    - Changed: Point data is now internally read as doubles instead of floats (to avoid loss of precision during scaling)
    - Changed: DX11 viewer & DX11 shaders now use less memory
    - Changed: Improved .LAS parsing PointDataRecordFormats #2 & #3 are now supported
    - Changed: With PointCloud2Mesh you dont need to select import format anymore, instead parser tries to read any suitable point cloud data (in common formats)
    - Changed: Progress bar now also display during mesh saving
    - Changed: Deleted 20 mesh clouds from "scene_mobile_heavy01.scene" to make it lighter

    - Fixed: PointCloud2Mesh AutoOffset (it didnt work if FlipYZ was not enabled)
    - Fixed: Fixed several parsing problems with some files (.asc, .pts, .las, .xyz)
    - Fixed: .LAS colors values are now scaled to 0-255 (some files had different ranges)

    - Note: DX11 Point clouds doesnt seem to work if Unity v5.x "[x] Virtual Reality Supported" is enabled
    - Note: DX11 point clouds or Mesh point clouds doesnt seem to work with WebGL viewer
     
  38. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    6,773
    1) Decimate is added (it skips points)
    2) Splitting is partially added as [x] optimize points, but has some issues still so its off by default (it sorts the points on x axis)
    3) Not added yet
     
  39. Aurecon_Unity

    Aurecon_Unity

    Joined:
    Jul 6, 2011
    Posts:
    241
    Awesome stuff, I'll check this out!
     
  40. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,487
    You shouldn't expect that to work. The Unity Web Player could use DX11 on Windows. By the nature of the technology used, the new WebGL stuff can only use WebGL as its graphics stack. And WebGL is based on the OpenGL ES 2.0 spec.
     
    mgear likes this.
  41. jacknorrisuk

    jacknorrisuk

    Joined:
    Jun 17, 2014
    Posts:
    38
    Hi Mgear,
    Firstly thanks for a great set of tools, works smoothly for me, even as part of a mobile workflow thanks to the mesh conversion.

    I've been following Brekel's progress lately with the Kinect V2 recordings, and wondered if it is possible to convert a recording to a mesh (assuming it understands there is a whole stack of pointcloud frames instead of just one)?

    I'm just trying to find the most efficient/effective way of displaying Kinect recordings on mobile devices really :)
     
  42. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    6,773
    From version v1.4 the PointCloud2Mesh converter imports Brekel .bin files, including animated ones and creates meshes from them (in Brekel there should be export option for saving to unitycoder binary file or such).
     
  43. jacknorrisuk

    jacknorrisuk

    Joined:
    Jun 17, 2014
    Posts:
    38
    Great, will give this a go. Thanks!
     
  44. salgado18

    salgado18

    Joined:
    Jul 15, 2010
    Posts:
    84
    You mean it wouldn't work with an Occulus Rift, right?
    Does it work when converted to meshes?
     
  45. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    6,773
    it should work, since they are standard meshes, gameobjects in scene. (unable to test yet after the 0.6 changed those minimum specs..)
     
  46. percycampos

    percycampos

    Joined:
    Aug 25, 2015
    Posts:
    2
    I am looking for instructions on how to convert a Brekel Point Cloud Pro (v1 or v2) into Unity meshes. I've looked over a lot of the information, but specifically, I need to know, if not using DX11, then what should we switch it to in Unity?

    Also, where should the BPC file (after converted with the Brekel Unity Shader) be saved? Asset folder?

    I am also trying to get my mobile pipeline complete, with converting the Brekel Clouds into something useful for mobile devices, but with specific instructions for Unity, if possible. Wonderful software!!!
     
  47. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    6,773
    There used to be option to export as *.bin for unitycoder pointcloud,
    actually not sure if its still available in latest version, since he has also added his own custom .BPC parses there.

    if the export format is still there, then you can load that .bin with BinaryViewerDX11,
    or use PointCloud2Mesh-converter so save it as normal mesh assets. (these would work in mobile).
     
  48. fuzzywobs1

    fuzzywobs1

    Joined:
    Feb 28, 2015
    Posts:
    6
    Hi mgear, well done on the asset, from what I've read here it sounds like a very powerful tool. I am very interested in potentially using it for some virtual reality (Oculus Rift) visualisation projects. I have a number of questions first:

    1. Can you comment on its functionality and performance with the Oculus Rift, bearing in mind that they recommend running at a minimum of 60+ FPS. Obviously this will depend on the power of your PC, but have you any indicative or estimated figures on how well it runs with different numbers of points?

    2. I see the tool includes a Point Cloud to Mesh converter. Does this help performance much for VR experiences? If a project needs to reduce the poly count, can this converter be used in conjunction with the 'decimate' function of the point cloud to decrease the size of the point cloud first, and then create a mesh from it? You would obviously lose accuracy with this?

    3. Have you had or heard of any success on getting it working on any mobile VR devices? Obviously the models/point clouds would need to be heavily optimised. They recommend having no more than 50K triangles rendering at any one time which would be hard to achieve with detailed point clouds.
     
  49. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    6,773
    1. Using Oculus roughly halves the performance (when last tested bigger clouds on 4.x), will have to test again in latest versions soon, but 3-10 million points should be fine.

    2. Mesh version is slower, since each mesh is separate gameobject (and not batched), but its quite suitable for 1-2million points still (with oculus too).

    Decimate: Yes, you can remove points when converting to meshes, so its bit lighter, but the drawcall count is the main limit there.
    In next update there is mesh LOD generator, less vertices(points) when viewed far away, not really huge performance gain, but in the coming updates will try to add LOD combining or grouping, so there would be less objects (draw calls).

    3. this app used my plugin: http://datumexplorer.universalassemblyunit.com/ i think it would still run fine with cardboard on top of that.

    But I'lll update those figures here once I test the performance with latest unity versions (most likely within next week).
     
  50. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    6,773
    Couple quick tests with oculus, created random cloud with 10m and 50m points:

    in editor (5.1.3p3, [x] vr supported)
    10million rgb points: 25fps
    50million rgb points: 9fps *same in exe

    specs: intel xeon E5-1630 v3 @ 3.70Ghz, NVidia Quadro 5000, Oculus 0.6.x
     
unityunity