Search Unity

Question Random question...no, really, a question about Random Nodes

Discussion in 'Visual Effect Graph' started by Livealot, May 15, 2021.

  1. Livealot

    Livealot

    Joined:
    Sep 2, 2013
    Posts:
    228
    I use random values to get variety in my vfxgraphs. When cloning systems within a graph, or vfx components across gameobjects, the perception of "randomness" falls apart since it's seed-based. There's this note in the docs
    Cool. But what if I don't want that? And don't want to create a separate vfx component for every variant just to get a different seed?

    Here's an example. The top half is a vfxgraph with 3 nearly-identical systems (except for color and position). You can see that the SetPosition: AABox generates the same positions for each system of 5 lanterns.

    The bottom half is a gameobject clone of the first, so it has a different seed, but still generates identical spawn points across the 3 systems in the graph NotSoRandomLanterns.JPG


    I feel like there should be an easy way for all 6 to be different (i.e., don't use global seed).
     
  2. Livealot

    Livealot

    Joined:
    Sep 2, 2013
    Posts:
    228
    The follow up question on randomness is how best to randomize randomness across systems and vfx components when you CAN control the seed.

    In this example, my goal is a random flicker across ALL the lanterns.

    In the top row, I get randomness within a system, but suffer the same problem across systems of the same vfx component. Random per particle is still the SAME value for each system. You can see identical flashes.
    randomPerParticle.JPG

    In the bottom row, I'm able to correct that by setting the Random Node to CONSTANT and using a DIFFERENT seed for each system.
    differentConstantSeeds.JPG


    RandomFlickerTest.gif

    Is there a better/simpler way to do this?

    This technique would be great to answer the first problem, but I can't figure out how to apply this technique in the Initialize Context with the SetPosition blocks. So I'm hoping someone else has figured it out.