Search Unity

  1. Unity wants to learn about your experiences working on a Unity project today. We'd like to hear from you via this survey.
    Dismiss Notice
  2. Get the latest news, tutorials and offers directly to your inbox with our newsletters. Sign up now.
    Dismiss Notice
  3. Read here for Unity's latest plans on OpenXR.
    Dismiss Notice

Feature Request Better control over point cloud visualization

Discussion in 'AR' started by alexanderameye, Mar 31, 2021.

  1. alexanderameye

    alexanderameye

    Joined:
    Nov 27, 2013
    Posts:
    1,312
    Right now the point cloud prefab uses a particle system of which we can set the color, size and material.

    Only setting color/size/material is pretty limited. Would it be possible to allow us to set more properties?

    Specifically I would want to control the color/alpha over lifetime, and also I want to add noise to the position of the particles (only visually of course). Also instead of just having a constant size, I would want to have a random size between 2 constants. I'm already setting this in the particle system inspector, but ARPointCloudParticleVisualizer.cs just doesn't pick up on it.

    If anybody knows a way to control these types of things, that would be great!

    Cheers,

    Alex
     
    Last edited: Mar 31, 2021
  2. KirillKuzyk

    KirillKuzyk

    Joined:
    Nov 4, 2013
    Posts:
    565
    I'm afraid you have to write a custom ARPointCloudParticleVisualizer to support these features. The current implementation sets these particle properties, so any modification done in ParticleSystem inspector will be overwritten:
    Code (CSharp):
    1. for (int i = 0; i < numParticles; ++i)
    2. {
    3.     m_Particles[i].startColor = color;
    4.     m_Particles[i].startSize = size;
    5.     m_Particles[i].position = points[i];
    6.     m_Particles[i].remainingLifetime = 1f;
    7. }
     
  3. alexanderameye

    alexanderameye

    Joined:
    Nov 27, 2013
    Posts:
    1,312
    Yup that's what I saw :/ I'll try writing my own them, not sure how to hook it up though but I'll do some research. Thanks!
     
unityunity