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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    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
    This does appear to work now. Thank you for the update. If/When you push the custom script, might I suggest calling it "URP_TileRenderFeature or something along those lines?
     
  2. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    8,998
    ah yes, it seems to pickup that script name then on that custom pass list automatically?
     
  3. Rickmc3280

    Rickmc3280

    Joined:
    Jun 28, 2014
    Posts:
    187
    I believe so. my problem was that it competes with the other one.
     
  4. Rickmc3280

    Rickmc3280

    Joined:
    Jun 28, 2014
    Posts:
    187
    I saw your post on Git. So was the issue with URP point clouds something with a project that can been improperly converted to URP? In that case I could understand since I have made several revisions and edits. Also would it make more since to keep using your fix for the issue or to rebuild my project completely?
     
  5. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    8,998
    I guess i wouldn't use the fix, unless required.
    It might help on the transparency sorting issue, since you can set the pass (on that custom renderer feature).


    *adding the link here for reference to others,
    https://github.com/unitycoder/UnityPointCloudViewer/issues/125#issuecomment-1006944687
     
  6. TokyoWarfareProject

    TokyoWarfareProject

    Joined:
    Jun 20, 2018
    Posts:
    802
    Hello,

    Do you've a roadmap and somewhere to look what you're working on?
     
  7. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    8,998
    issues list is probably best, i do want to clear them eventually..
    so commenting there is best way to push things higher/faster:
    https://github.com/unitycoder/UnityPointCloudViewer/issues

    small coming things for converter,
    i got e57 converter working recently, also added batch support for v2 format.

    then have own private issues list for ideas to try/look into, but last year was swamped on projects and part-time ML study (which finally ended last sunday : D so hopefully can bring some AI/ML stuff eventually for this tool also)
     
  8. TokyoWarfareProject

    TokyoWarfareProject

    Joined:
    Jun 20, 2018
    Posts:
    802
    Awesome.

    Great to hear your've added batch for v2!! I recently hit the wall with this!. I was failing to get points reflected in the car hood wiht SSR so told myself may be with V2 since is like some sort of mesh vertex could work aswell as work with shadows or shadow and may be don´t mess up with transparency but my cloud is like in the billion range and I had no means to merge so much into a single file. Can´t wait to test it!
     
  9. Blobityblop

    Blobityblop

    Joined:
    Jan 18, 2022
    Posts:
    3
    Hey. Does this thing work with importing point clouds at runtime from a executable ? And how about for VR ? Thanks
     
  10. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    8,998
    There are few example scenes included for runtime importing, these formats are supported:
    https://github.com/unitycoder/UnityPointCloudViewer/wiki/Import-Formats#runtime-importer

    VR works, for URP/HDRP you need to do few adjustments described here: *until they are included in the asset store version..
    HDRP https://github.com/unitycoder/UnityPointCloudViewer/issues/105
    URP https://github.com/unitycoder/UnityPointCloudViewer/issues/126


    Which is your target platform/vr device?
     
  11. Blobityblop

    Blobityblop

    Joined:
    Jan 18, 2022
    Posts:
    3
    Thanks for getting back to me.

    Most likely Vive pro. Will probably be testing on Quest 2 using link.

    Is the code ready to get it up and running quick ? Especially with importing in realtime. Can you have multiple clouds at the same time ?

    I would use simplefilebrowser to grab the destination but I can't clearly see on the wiki how you approach importing at runtime. Maybe I'm missing something

    Thanks again.
     
  12. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    8,998
    example scene ("PointCloud-RuntimeLoader.unity") is like this (image below)
    text field for file path, and button to call load method.

    so it should be simple to add your file browser, you could remove the canvas completely,
    and just check example script (RuntimeUIHelper.cs) where the button calls load file from the point cloud viewer.
    upload_2022-1-26_11-51-16.png

    You can have multiple viewers active in same scene,
    *(except not for that URP/HDRP fix, which uses singleton for a quick workaround there)

    just make sure you enable this checkbox OR use separate material, otherwise one cloud overwrites other clouds:
    upload_2022-1-26_12-0-11.png

    Vive pro and quest + link have been tested.

    If you have issues with transparent objects sorting, check:
    https://github.com/unitycoder/UnityPointCloudViewer/issues/77

    One more question is on the point count,
    How many points you would like to view?
    (for example: ~178million points is hard limit for runtime and v1/v2 viewer, and that would be slow on vr already, and parsing too).

    Other runtime example scenes are:
    - "PointCloud-Runtime-Or-Load-Cache.unity", this will parse raw cloud, and convert to custom binary format, so on next load its much faster to load.
    - "PointCloud-runtime-laz-commandline-workaround", for converting las/laz files at runtime (this could be modified to convert into v3 tiles format, which is more performant with large clouds)
     
  13. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    8,998
    TokyoWarfareProject likes this.
  14. Blobityblop

    Blobityblop

    Joined:
    Jan 18, 2022
    Posts:
    3
    Hey. Thanks for the help.
    How do I change the orientation and overall of the clouds ? When I load them in they are facing in the wrong direction and load on top of each other. This goes for both the clouds loaded in advance and the runtime Ascii clouds. They don't seem to exist as objects and the viewer doesn't impact their orientation.
     
    Last edited: Jan 31, 2022
  15. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    8,998
    If this is enabled, then cloud "center" is moved near 0,0,0 point (that means all clouds will be stacked there)
    upload_2022-1-31_10-19-55.png , same in the commandline converter: -offset=true

    If you have multiple clouds, from same scan project, can avoid that issue
    by batch converting them (then same offset is added for all clouds, to they keep relative positions).

    OR,
    if the clouds are not using big coordinate values, like x y z: 500030123.2312, 2123929.32, -838437234.234
    instead they are near 0,0,0, then you can disable that automatic offset, and they keep their original positions.


    OR,
    do you mean Z and Y axis are wrong? (its on sideways?)
    For that there is the flip option:
    upload_2022-1-31_10-17-20.png

    Same in the commandline converter,
    -swap=true (but that is enabled by default already)


    OR,
    if you just want to move, rotate them around, can you send me a private message, i'll send few files.
    (as in the next update there are extra shaders to allow move/rotate the clouds around using transform)
     
  16. TokyoWarfareProject

    TokyoWarfareProject

    Joined:
    Jun 20, 2018
    Posts:
    802
    like we will be able to correct position to fix floating point artifacts?!
    Will be expensive to move a big cloud? or will be trivial?

    I've not yet been ble to test bach v2, hopefully tonight or tomorrow
     
  17. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    8,998
    it sends transform translation matrix to shader, and then multiplies position there,
    so that could allow you to move clouds for "wrap around" world i guess..
    (haven't really tested if can see any performance difference on large clouds though..)

    i'll send you the shaders for testing shortly.
     
    TokyoWarfareProject likes this.
  18. Adel1986

    Adel1986

    Joined:
    Nov 9, 2021
    Posts:
    16
    Good afternoon, I can’t find a manual for importing las I remember that I need to unzip pcroot But where from where and what algorithm
     
  19. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    8,998
    2 ways to import las:
    - using the in editor converter (window/pointcloudtools/convert point cloud to binary (*but that doesn't support the V3 pcroot tiled output)
    - using external converter from https://github.com/unitycoder/UnityPointCloudViewer/wiki/Commandline-Tools (this is better, faster and supports larger files, and supports LAZ also)

    so download that converter exe,
    it has gui and commandline versions (run from explorer, it starts GUI, or run from commandline with -? to see help)
     
  20. Adel1986

    Adel1986

    Joined:
    Nov 9, 2021
    Posts:
    16
    I downloaded it, transferred it from LAS to pcroot, transferred these files to StreamingAssets How next?
     
  21. TokyoWarfareProject

    TokyoWarfareProject

    Joined:
    Jun 20, 2018
    Posts:
    802
    you need to use the dx11 viewer, look in the example scenes. In the viewer script simply add the path to your streaming assets folder
     
  22. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    8,998
    can open the example scene "Assets/Demos/PointCloudViewer/Scenes/PointCloud-TilesViewerV3.unity",
    and set your filename to the viewer inspector, and play.
    upload_2022-2-1_13-4-8.png

    (can use relative path inside StreamingAssets folder, so if your file is "StreamingAssets/yourfile.pcroot", can just put "yourfile.pcroot")
     
  23. Adel1986

    Adel1986

    Joined:
    Nov 9, 2021
    Posts:
    16
    Как найти изображение? Ошибок нет, но не вижу картинку после нажатия PLAY
     
  24. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    8,998
    Check console, does it say it loaded some points?
    Try rotating camera, points are not visible in scene window (unless they are visible by game camera)

    Or can open .pcroot file in notepad and paste here (or send me private message),
    from there can see if the bounds are too far, that means point cloud is far from 0,0,0 origin where camera is.

    there is also view distance in the v3 inspector, after end distance cloud tiles are not visible:
    upload_2022-2-1_14-27-32.png

    Also its possible that cloud was in different scale, so should convert with scaling enabled, some value depending on what the original point cloud scale is:
    -scale=0.001
     
  25. Adel1986

    Adel1986

    Joined:
    Nov 9, 2021
    Posts:
    16
    Large file can't send Please send mail
     
  26. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    8,998
    i'll send message. (but only need .pcroot file)
     
  27. Adel1986

    Adel1986

    Joined:
    Nov 9, 2021
    Posts:
    16
    отправил
     
  28. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    10,557
    Note that if you make short posts like this which isn't English, it'll get sent to moderators and you'll have to wait. I would suggesting posting in English to avoid this. I approved the post above for you so it should now appear. :)

    This happens to combat the crazy amount of spam that, for the most part, is filtered out.
     
  29. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    8,998
    yeah i cannot read that (used google..), even though its our probably neighbor country.. : )
     
    Last edited: Feb 1, 2022
  30. Adel1986

    Adel1986

    Joined:
    Nov 9, 2021
    Posts:
    16
    sent by mail)
     
    mgear likes this.
  31. Adel1986

    Adel1986

    Joined:
    Nov 9, 2021
    Posts:
    16
    Coordinate system linear local system of heights baltic Point cloud from aerial photography
     
  32. Adel1986

    Adel1986

    Joined:
    Nov 9, 2021
    Posts:
    16
    I can throw off the unity file. I corrected everything, but I still don’t see the cloud
     
  33. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    8,998
    Check email, replied yesterday with cloud screenshot.

    But info here also:
    - Its converted to use packed format, so need to assign v3-packed material. (otherwise cloud is not visible)
    - scale was maybe 10 or 100x too small, so don't use any scaling on the conversion (if used earlier, or otherwise need to scale up 10x perhaps, not sure whats the original point cloud scale)
     
  34. Adel1986

    Adel1986

    Joined:
    Nov 9, 2021
    Posts:
    16
  35. Adel1986

    Adel1986

    Joined:
    Nov 9, 2021
    Posts:
    16
    the display appeared in the reduced cloud When translating without scale, it issues an error
    FileNotFoundException: Could not find file "C:\Users\adel\My project (6)\Assets\StreamingAssets\ru\1_0_0_0_0.pct"
    System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.Boolean anonymous, System.IO.FileOptions options) (at <695d1cc93cca45069c528c15c9fdd749>:0)
    System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share) (at <695d1cc93cca45069c528c15c9fdd749>:0)
    (wrapper remoting-invoke-with-check) System.IO.FileStream..ctor(string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare)
    System.IO.File.OpenRead (System.String path) (at <695d1cc93cca45069c528c15c9fdd749>:0)
    System.IO.File.ReadAllBytes (System.String path) (at <695d1cc93cca45069c528c15c9fdd749>:0)
    unitycodercom_PointCloudBinaryViewer.PointCloudViewerTilesDX11.ReadPointCloudThreadedNewB (System.Object rawindex) (at Assets/PointCloudTools/PointCloudViewerDX11/Scripts/PointCloudViewerTilesDX11.cs:694)
    unitycodercom_PointCloudBinaryViewer.PointCloudViewerTilesDX11.LoaderWorkerThreadB (System.Object temp) (at Assets/PointCloudTools/PointCloudViewerDX11/Scripts/PointCloudViewerTilesDX11.cs:525)
    UnityEngine.Debug:LogException(Exception)
    unitycodercom_PointCloudBinaryViewer.PointCloudViewerTilesDX11:LoaderWorkerThreadB(Object) (at Assets/PointCloudTools/PointCloudViewerDX11/Scripts/PointCloudViewerTilesDX11.cs:536)
    System.Threading.ThreadHelper:ThreadStart(Object)
     
  36. Adel1986

    Adel1986

    Joined:
    Nov 9, 2021
    Posts:
    16
    tried different options same error Try to open my pcroot file
     
  37. Adel1986

    Adel1986

    Joined:
    Nov 9, 2021
    Posts:
    16
  38. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    8,998
    ok, i think found it. (check email).

    Even with automatic offset, most of the cloud was still far away from center. (so it was culled out).
    If move camera around 1100,192,80 can see it. (or adjust view distance in the "End Dist" param)

    In next update i'll add some tools to help with that:
    - "Move Camera to center of cloud"
    - "Frame cloud" or so.
     
  39. Adel1986

    Adel1986

    Joined:
    Nov 9, 2021
    Posts:
    16
    There is still such a problem. I see the object in the scene, but when approaching in the game mode, the points disappear, how is it solved? Maybe camera settings?
     
  40. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    8,998
    *HeadsUp*
    There will be another discount sale for this asset on "Asset Store Spring Sale from April 11 2022 to April 29"
     
    TokyoWarfareProject likes this.
  41. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    8,998
  42. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    8,998
    News:
    if you have purchased this Point Cloud Viewer plugin, you should get automatic 50% discount on the velodyne viewer plugin:

    upload_2022-5-14_21-42-1.png
     
    Rickmc3280 likes this.
  43. Rickmc3280

    Rickmc3280

    Joined:
    Jun 28, 2014
    Posts:
    187
    Do you know the maximum amount of points that can be loaded on your setup in VR?

    Still curious if you could make a runtime tool for sending vector3[] and color32[] for your Runtime NonMesh loader to upload to GPU. Is your preferred format for color still Color vs color32? I created my custom mesh based tiling system that works pretty well, but wanting to do non-mesh based loading. My problem is that with my custom file format there are a few extra steps needed during the thread operations.

    Another question I have is can a compute shader work with with bytes to get the int value of the byte?
     
  44. TokyoWarfareProject

    TokyoWarfareProject

    Joined:
    Jun 20, 2018
    Posts:
    802
    I've not had time yet to look into this either, I also whant to try something similar as I would like to try to use the the builting VFX to render the points instead of the custom shader/viewer. It's obvious at some point the streaming code must provide teh pos vector and the color data so I whanted to channel this data to the vfx particle viewer. There is the Keihiro viewer already doing something similar but with streaming data I've not yet seen anything.
     
  45. Rickmc3280

    Rickmc3280

    Joined:
    Jun 28, 2014
    Posts:
    187
    I was under the impression that the VFX particle viewer could not handle many points. It would be interesting to test that theory... From what I've seen and tested, the GPU loader has the best performance of anything available.

    Streaming data is found during the threaded operations. If I remember correctly though the format requires you to rebuild the vectors to send to vfx. Would need to see.
     
  46. TokyoWarfareProject

    TokyoWarfareProject

    Joined:
    Jun 20, 2018
    Posts:
    802
    In my tests V3 format also is by far the fastest and once the datasets gets big enough has no challenger. In theory the converter that has interface has a checkbox to convert to point cache, but seems not to work, at least would be usefull to check how mnay points can VFX render performantly.
     
  47. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    8,998
    haven't tested recently, but many years ago it was below 30m.. but that was quite old hardware for today's standard,
    i can try to test it soon with quest+link. (of course you can also test with the Create test binary cloud, make rgb cloud with 50m points, v2 format, its probably bit slow already).

    for v3, should be similar results, it only works better
    if you don't have that many points on screen at the same time (tiles are spread around, so they get culled out).

    its still vector3, but packed color format doesn't use any.

    should work if you send data as int/uint, then use bitshift to get individual byte values out.
     
  48. Rickmc3280

    Rickmc3280

    Joined:
    Jun 28, 2014
    Posts:
    187
    Quick Test Code... Works Partially, It seems to lose a certain amount of points just like a mesh where the index isnt defined to 32bit. Ill let you professionals figure it out xD.

    Handles normally at 6 million points, but when you look towards the missing points it drops frame rates significantly. My mesh version performs much better, but I assume it is because I dont have this properly setup.

    Code (CSharp):
    1. using Unity.Collections;
    2. using UnityEngine;
    3. using UnityEngine.VFX;
    4.  
    5. public class VFX_PCLoader : MonoBehaviour
    6. {
    7.     private GraphicsBuffer gBuff;
    8.     private VisualEffect vfx;
    9.     public bool loaded = false;
    10.    
    11.     public void T_Load(ref NativeArray<float> nArray)
    12.     {
    13.         Debug.Log("VFX_PCLoader - T_Load - Loading ...");
    14.         gBuff = new GraphicsBuffer(GraphicsBuffer.Target.Structured, nArray.Length/6, sizeof(float) * 6);
    15.         gBuff.SetData(nArray);
    16.         loaded = true;
    17.     }
    18.     public void Update()
    19.     {
    20.         if (loaded)
    21.         {
    22.             Debug.Log("VFX_PCLoader - Update - Loaded ...");
    23.             loaded = false;
    24.             vfx = GetComponent<VisualEffect>();
    25.             vfx.Reinit();
    26.             vfx.SetGraphicsBuffer(Shader.PropertyToID("PCBUFFER"), gBuff);
    27.             vfx.enabled = true;
    28.         }
    29.     }
    30.     public void OnDisable()
    31.     {    
    32.         if (gBuff != null)
    33.         {
    34.             gBuff.Release();
    35.         }
    36.     }
    37. }
    38. [VFXType(VFXTypeAttribute.Usage.GraphicsBuffer)]
    39. public struct VFX_PCData1
    40. {
    41.     public Vector3 position;
    42.     public Vector3 color;
    43. }
    VFX Graph looks like this.
    upload_2022-6-20_23-33-9.png
     
    Last edited: Jun 21, 2022
  49. Rickmc3280

    Rickmc3280

    Joined:
    Jun 28, 2014
    Posts:
    187
    Sorry for 2nd Post . Cant post photos
    Points In VFX
    upload_2022-6-20_23-49-29.png

    Actual Available Points...
    upload_2022-6-20_23-50-12.png
     
    TokyoWarfareProject likes this.
  50. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    8,998
    tested 1m pcache also, seems quite slow..
    upload_2022-6-23_11-25-8.png