Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    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:
    9,350
    Converted point meshes worked on iphone6, so should be fine.

    But please note that the Brekel to PointCloudMeshConverter outputs each frame as an separate unity mesh asset,
    so you need to work with those meshes to play animations..
    (like hide/show them 1 by one, disabling mesh renderer or gameobject or moving in/out to view)
     
  2. steffanPL

    steffanPL

    Joined:
    Oct 9, 2014
    Posts:
    40
    Are you aware of any other methods of using Kinect animations (saved as point clouds) with your plugin?
    Or is this one anyway the most convenient ?
     
  3. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,350
    its not really convenient, but i think haven't really seen other ways either..
     
  4. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,350
  5. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,350
    v1.91 update is now live in store
    https://www.assetstore.unity3d.com/#!/content/16019?aid=1101lGti

    new interesting points:
    - you can easily feed your own point cloud data to the viewer with pretty much 2 lines of code (example scene included)
    - initial *.pcd importer is added
    - one VR SinglePass shader included for testing
     
    sjm-tech likes this.
  6. FLYUPAV

    FLYUPAV

    Joined:
    Aug 1, 2013
    Posts:
    34
    Hi

    How can I extract position transform information of the points using right mouse click button?
     
  7. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,350
    Do you mean getting single point position in DX11 viewer? For that there is measurement scene example, see the measurement script how it listens for the point selected event to get position.
     
  8. wharfbanger

    wharfbanger

    Joined:
    Nov 9, 2017
    Posts:
    2
    Hello,
    I am unfamiliar with Unity, so looking for some basic setup advice. I have a stack of point clouds from my aerial photogrammetry work, RGB LAS files, around 20 million points each. I have a client interested in viewing the clouds in VR and I am wanting to develop a workflow for this. I am considering the HTC Vive and the DX11 viewer. Please can you confirm the basic steps and likely time requirement...I am thinking I will need to buy an HTC VIve and PC, download Unity and the point cloud viewer, and I should be good to go in a couple of days of playing around with Unity. Does this sound realistic? Also, how tricky is this all going to be for me to teach other people to setup and use?
     
  9. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,350
    Somewhat possible with a bit of effort,
    - if possible could filter the clouds a bit to make them lighter (using external tools)
    - setup/install unity, vive etc
    - create new project, import plugin *plugin is released with 5.5, but works with later versions too
    - adjust project settings, enable vr *use multipass for now, not all shaders are converted to single pass rendering yet
    - convert .las file for dx11 viewer https://github.com/unitycoder/UnityPointCloudViewer/wiki/Quickstart
    - assign converted file into viewer inspector field (to load it)
    - press play, should see the cloud in vr now

    so after that,
    - you'll need to think about how the player should move there, this probably helps https://unity3d.com/learn/tutorials/s/virtual-reality
    - how the application starts, are there menus?, make a build, how to switch clouds (maybe with controller you point to a sphere in scene, to load cloud next there..)
     
  10. Volkerku

    Volkerku

    Joined:
    Nov 23, 2016
    Posts:
    113
    Distance shader in DX11, i get a message with Unity 2017 :
    Shader warning in 'UnityCoder/PointCloud/DX11/ColorSizeByDistance': Use of UNITY_MATRIX_MV is detected. To transform a vertex into view space, consider using UnityObjectToViewPos for better performance.
    This shader performs really slow now. Is there an easy fix, a line of code I can replace in the shader?
    thx, volker
     
  11. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,350
    try:
    Code (CSharp):
    1. // find line
    2. float depth = -mul( UNITY_MATRIX_MV, half4(buf_Points[id],1.0f) ).z;
    3.  
    4. // replace with
    5. float depth = -UnityObjectToViewPos(half4(buf_Points[id],1.0f)).z;
    6.  
     
  12. wharfbanger

    wharfbanger

    Joined:
    Nov 9, 2017
    Posts:
    2

    Thank you for this thoughtful and detailed response. I will give this some consideration. Regards, Mark
     
  13. LaserSaber

    LaserSaber

    Joined:
    Jul 20, 2010
    Posts:
    11
    Excellent plugin! I just have one problem. When using a point light in the scene with the PointCloudColorNormalMesh material only half the light works. See the attached image. Any ideas on how to correct this issue?
     

    Attached Files:

  14. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,350
    Is that the sample point cloud file? (it doesn't have proper normals, so that would happen)
    Or if its your own data with normals, is it possible to send it for me to test? (pm or email download link)
     
  15. LaserSaber

    LaserSaber

    Joined:
    Jul 20, 2010
    Posts:
    11
    It is doing the same thing with my own .LAS point cloud. Maybe I am going about this all wrong. The effect I want is a flashlight attached to the player camera. The PointCloudColorMesh material works perfectly with the main color set darker than the Spec color. The only problem is that the light effect only works facing one direction. When I noticed that I had the same issue with your default scene I thought I would take the screen capture from there.

    Here's a video showing the issue: https://www.dropbox.com/s/jkyudb8m7vkqdyk/LightTest.mp4?dl=0
     
  16. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,350
    Oh i see, normals are actually imported for .ply file only..
    I do have the code ready there for LAS normals, but i think never had file to test it, so its not taking the values :)

    If you can send me some las file, with normals, i can add it.
     
  17. LaserSaber

    LaserSaber

    Joined:
    Jul 20, 2010
    Posts:
    11
    I just sent you a PM with links to the files.
     
  18. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,350
    Just to update here about the @LaserSaber 's normals issue:
    - turned out CloudCompare saves normals in different order than MeshLab .PLY
    - PLY importer had bugs, if normals were in wrong place, even if normal importing was disabled
    - that LAS file was using different pointDataRecordFormat (only #2 & #3 are supported, file used #26)

    Pushing update to store over the weekend for the PLY normals fix.
     
  19. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,350
    v1.92 is now live in store

    whats new
    - Added: PCD header binary checking (as only ascii .pcd is supported)
    - Added: PLY header binary checking (as only ascii .ply is supported)
    - Added: "BinaryViewerDX11-LoadNewCloud.scene" (Example scene for loading new cloud with script)
    - Added: Example point cloud data file "StreamingAssets/sample2.bin" from http://graphics.stanford.edu/data/3Dscanrep/ (used in the "LoadMultipleDX11CloudsThreaded.scene")

    - Fixed: Multiple PLY importer bugs (CloudCompare Normals order, header parsing)
    - Fixed: Multiple LAS importer bugs (Missing colors, unused arrays)
    - Fixed: Shader error in 2017.x https://github.com/unitycoder/UnityPointCloudViewer/issues/37

    https://www.assetstore.unity3d.com/#!/content/16019?aid=1101lGti
     
    sjm-tech likes this.
  20. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,350
    Also, planning to update to 2017.1(?) maybe in or after the next update,
    unless there are many people using older unity versions?
     
  21. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,350
    TooManySugar likes this.
  22. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,350
    asset store team 'doing it live' ?
    got this email today (31.01.2018), and no previous warning emails..


    It seems to be still visible in the store though, and there are no unityscript files in the project so will see what happens..
     
  23. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,350
    Someone reported issues with point meshes + point size on iphone7 and later, saying that iphone6 and lower works fine:
    https://github.com/unitycoder/UnityPointCloudViewer/issues/40

    i dont have device to test on that, so if anyone else has same issues, feel free to report your findings here..
    like if there are warnings/errors in xcode compiler etc.

    ** Unity replied to bug report that it works fine for their devices, so that issue is closed for now.

    iPad mini 4 iOS 9.2.1 A8
    iPad Pro 10.5 iOS 10.3.3 A10X
    iPhone 7 iOS 11.0 A10
    iPhone 8 iOS 11.0 A11
     
    Last edited: Mar 3, 2018
  24. TooManySugar

    TooManySugar

    Joined:
    Aug 2, 2015
    Posts:
    864
    I'm having a weird conversion on a cloud:

    This is the vegetation cloud in Unity , has all sort of colorfull dots.
    upload_2018-3-6_2-5-41.png


    This is how it looks in cloud compare:
    upload_2018-3-6_2-6-35.png

    I did bake PCV iluminance Scalar Field into the colour channel and merged with existing colours, but in other dataset I saw this dots too (in much, MUCH lower number, I thought this was dataset colour). I did reconvert just in case:

    Please give it a look to the atached dataset:
    https://1drv.ms/u/s!AuliwwO_siw1izZTIIkh2-ybsr_9
     
  25. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,350
    ok, ill check that file later this week.

    I'd presume its because of the LAS format, color data might be in some different version/format/range..
    If you export to some other format (ply, xyzrgb, ..) it probably works?
     
  26. TooManySugar

    TooManySugar

    Joined:
    Aug 2, 2015
    Posts:
    864
    I will do the export thing, I'll edit this post with ressults. As this has merged PCV iluminance values, as you say range may have extended.

    I tried to export Las 1.4 (there is previous las version in CC too). Las 1.4 export from CC seems glitched. I reported a bug in its forum

    The other ascii formats I seem not to be able to properly export....
     
    Last edited: Mar 6, 2018
  27. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,350
    Didnt yet find a cause for the .las problem.. the file format and version is correct, las 1.2 and pointformat#3..

    but tested with xyzrgb export, seems to work:
    upload_2018-3-7_16-9-18.png
    *note the order is point (xyz), color(rgb int)
     
  28. TooManySugar

    TooManySugar

    Joined:
    Aug 2, 2015
    Posts:
    864
    I will export with theese setings and update this post whrnndone. Tx for exports params.
     
  29. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,350
  30. TooManySugar

    TooManySugar

    Joined:
    Aug 2, 2015
    Posts:
    864
    F
    TX! Fixed!
    Importing as xyzrgb fixed, dunno why did not work yesterday.

    Anyways there is an strange thing when importing XYZ rgb

    This is how it looks import panel with XYZ
    upload_2018-3-7_13-5-46.png

    Normally I do input aerial lidar with this shfit when usint .las

    AERIAL LIDAR
    550054.4 362 4763897
    But notice I had to swap values in XYZ. So I told myself ok, dissable Flip YZ toggle. and input
    550054.4 362 4763897
    And lol, it does not work, cloud is not in visible range.

    -------------------------------------------------
    You may whant to add to the wiki that when exporting to las from CC not to use 1.4 format as seems to have some issue.
     
  31. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,350
    manual offset should be negative value usually,
    so if data is around 550054.4 362 4763897, offset should be -550054.4 -362 -4763897.

    although its a bit rarely used feature so could have bugs if that doesnt work..

    I tested another file from cloudcompare to las, it seemed to work.
    so it could be some other settings or value in the data..not sure yet.
     
  32. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,350
  33. TooManySugar

    TooManySugar

    Joined:
    Aug 2, 2015
    Posts:
    864
    Just to clarify. I've been using to date .las files and converting them without issues. That said there is one .las tha also had some random R G B points but in so little number that I thought was the data itself .

    I also thought that shift values had to be negative but ther may something in teh converter that multiplies by -1. In CC I use pretty much this values in negative (automatically sugested).

    But if I use the autocenter to 0,0, in your converter and after conversion switch to manual shift, the values used by converter are shown and theese are positive too. And using theese positive values shifts cloud near to 0,0 :D

    I use manual shift because I overlay different clouds. I do so so I can asign different materials to each cloud.

    I'm not in the need for animated clouds XD. Not sure even how ppl will create them :D.

    I've a txt where I store the shifts for this scene and is funny cause are a bit messy

    00 microstation attachment
    -550000.000 -4762989.000 361.67

    MOBILE LIDAR
    550054.4 361.67 4763897


    AERIAL LIDAR
    550054.4 362 4763897
    en formato XYZRGB
    550054.4 4763897 362
     
  34. TooManySugar

    TooManySugar

    Joined:
    Aug 2, 2015
    Posts:
    864
    Points being lit would be very expensive?
    Ambient light + light objects like point lights.
    no shadow project. Althought receiving would be cool if not too expensive/ complex to do

    Also I've noticed the poitns render over any type transparent objects like particles regardless of the renderqueue values of the point shaders. Anyone else noticed?
     
    Last edited: Mar 17, 2018
  35. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,350
    Last time i checked, its because of the drawprocedural() call.. so hopefully this will be solved once the plugin is updated for commandbuffers or the new pipelines.. (so can define on which pass to draw objects).

    for particles could try this,
    https://forum.unity.com/threads/dra...ver-transparent-geometry.220143/#post-1479028
     
    TooManySugar likes this.
  36. TooManySugar

    TooManySugar

    Joined:
    Aug 2, 2015
    Posts:
    864
    I was in the need of seeing the points in editor to properly place some assets around so I did convert into mesh cloud.

    All process whent fine and as I saw there where auto LODs I told myself lets try performance in runtime. It starts fine but rendering freezes after a little. Its just the rendering because all behind keeps roling. I can even stop and save changes but screen keeps showing freezed gameplay screen. I need to reboot unity. The time it works performance seems as good as with clouds but the LOD thing loosk to me like a good plus since I could dissable far clouds.
    Please give it a look. May be is just because of 2018 beta.

    I tested using mesh quad hsader with a mid size.
     
  37. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,350
    that lod is not really adding much to performance from what i checked last time,
    although it draws less points when far, but gameobject count is still same (those lower point count mesh lods are not combined).. so it might not help that much anyways..

    in a quick 2018 test last time it seemed like just increasing the point count per mesh to millions or more was much better
    (even though it then draws all of them all the time). *that mesh point limit is currently set to that 65k in the converter

    *added to checklist, although i'm upgrading to 2017 next, so probably not much focus on 2018 yet..
    https://github.com/unitycoder/UnityPointCloudViewer/issues/42

    ** side note: my current day job project should end after 3 months, after that ill be spending much more on this plugin updates, so do list all the things/requests, then i can check them soon.
     
  38. TooManySugar

    TooManySugar

    Joined:
    Aug 2, 2015
    Posts:
    864
    Cool, no rush!

    I see, I was specting wome performance from lods yes :D

    May be I miss a slider so LOD can be finetuned before it is generated like being able to set distances per each lod.

    Now that you say.. vetices per mesh is limited to 65k converter but I believe this limit was removed or raised recently.
    Will check. Still I've all the cloud visible in editor now I can draw the terrain vegetation and hide the mesh clouds before entering runtime.

    I'll tonight check the vertex limit and try to do less chunks so I can even manually setup the lods without dying.
     
  39. TooManySugar

    TooManySugar

    Joined:
    Aug 2, 2015
    Posts:
    864
    and I use 2018 because as you said it yes does render more points and still the 2017 update sure benefits 2018 because I'm not using the Scriptable pipeline and I wont in a while tbh
     
  40. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,350
    TooManySugar likes this.
  41. Klaus_Weismor

    Klaus_Weismor

    Joined:
    Mar 15, 2018
    Posts:
    1
    Hi, cool work!
    Is the messurement function of the SJM Tech demo part of your Viewer Release? If yes, is it possible to combine it with a mesh rendering? So a plan (mesh) and real (pointcloud) comparison is possible?
     
  42. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,350
    The included version is less fancy, it just draws gl line between first point to second, and displays distance in ui text.
    and currently it only works with single point cloud (not meshes), but that is definitely good idea, will add into wish list.
    it should not be too complicated to do though, just add points from meshes into to the same octree as the point cloud..

    you could test it by checking BinaryViewerDX11.cs, around line "Debug.Log("Building octree...");",
    just collect all meshes that you need, add their vertex points to that pointTree list.
     
  43. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,350
    preview of 'fake' dynamic resolution adjust coming up soon for dx11 viewer
    (can adjust point count easily, improves performance, points are still fully loaded though)
    pointcloud-resolution-adjust.gif

    planning to add option that can automatically adjust point count while moving, to keep some given fps rate,
    and perhaps combine with point size adjust, so with less points they get bigger.
     
    IsDon and sjm-tech like this.
  44. hooraypublic

    hooraypublic

    Joined:
    Feb 8, 2014
    Posts:
    13
    Hi,

    Thinking about buying this but having a question:
    I'm planing to use the pointcloud scans of a performer inside an actual 3D environment in Unity. My question is, can the pointclound have simple animation? Like whether I can use keyframe to move them around or scale them.

    Thanks
     
  45. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,350
    If you use the pointcloud2mesh convert, to create point meshes, those are regular gameobjects (so can do all that). But that would mean your data has to be cleaned up before that, your performer should be within 1 cloud per frame.. (also, from which format your data would be coming from?)

    If you happen to have example data that you can send, i can test it and let you know if it works with that.
     
    Last edited: Mar 31, 2018
  46. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,350
    previews from some of the coming updates:

    shadows for point meshes *point size is not taken into account though
    point-shadows.gif

    ---
    also then ambient occlusion post effect kind of works with point meshes too
    ambiento.gif
    *floor here is regular unity plane (had realtime reflection probe on this one)

    ---
    pointmesh receive shadows *directional light only
    selfshadows.gif
     
  47. hooraypublic

    hooraypublic

    Joined:
    Feb 8, 2014
    Posts:
    13

    Thanks for your reply! How should I send the file to you? It's a .bin file around 100M
     
  48. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,350
    try dropbox.com or other file sharing sites, can email or pm me the link
     
  49. TheMrTyner

    TheMrTyner

    Joined:
    Jan 21, 2018
    Posts:
    2
    This is what we did for another game engine. We would render the points in the players local volume. The volume was dynamically expandable. We were able to load up to 50GB point clouds that way.
     
  50. EntangledOthers

    EntangledOthers

    Joined:
    Nov 23, 2016
    Posts:
    10
    Does anyone else also have issues with the extra DX11 shaders for meshes? I get the following error message after bringing them into my assets:

    "'UnityObjectToClipPos': cannot implicitly convert from 'float4x4' to 'float4'

    I'm using Unity 2017.3.f1 & Pointcloud Viewer & Tools 1.9.3 (sadly, using DX11 binaries isn't possible for this project, so I'm a little dependent on getting the size controls working in DX11).