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

5.6 Particle System custom data in inspector...?

Discussion in 'Editor & General Support' started by ericwd, Dec 14, 2016.

  1. ericwd

    ericwd

    Joined:
    Aug 25, 2015
    Posts:
    3
    "In Unity 5.5, we added support for attaching custom data to your particles, which can be accessed from both script and shaders. In the 5.6 beta, we have extended this system, so that you can configure it directly in the Inspector, making it simple to define curves and colors, which can be used to drive custom logic in your scripts and shaders."

    What does this mean exactly? I'm looking at the particle system in 5.6.0b1, under custom vertex streams, and don't see anything about defining curves and colors. I've been able to use the custom streams to edit color over lifetime or speed through the shader, for example. But what is this curve in the inspector stuff? Is it something that needs to be built from the shader and it shows up in the inspector?
     
  2. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    2,240
    Hey, sorry this isn't clear to you!

    There is a new module called Custom Data. Look in the list of modules e.g. Velocity over Lifetime, Shape, etc, and you should find it.

    Once you have set some data in there, you can do 2 things with it:

    1. Go to the Renderer Module and add the Custom1 or Custom2 streams. Then the custom data will appear in your shader as vertex input data.
    https://docs.unity3d.com/550/Documentation/Manual/PartSysVertexStreams.html

    2. Call GetCustomParticleData from script.
    https://docs.unity3d.com/550/Documentation/ScriptReference/ParticleSystem.GetCustomParticleData.html

    The links are to 5.5 docs but they are still relevant for figuring out how to use the custom data once you've set it up.

    Hope it helps!
     
    lab-unity3d, ericwd and karl_jones like this.
  3. ericwd

    ericwd

    Joined:
    Aug 25, 2015
    Posts:
    3
    Oh I see, thanks for the clarification.
     
    richardkettlewell likes this.
  4. Alejandro-Martinez-Chacin

    Alejandro-Martinez-Chacin

    Joined:
    Oct 15, 2013
    Posts:
    144
    Long shot at resurrecting this one.
    Trails (created by the particles themselves) do not inherit the custom data, is that correct?
     
  5. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    2,240
    Yes it's correct. Trails do not support the custom vertex data.