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

Resolved Random Flipbook Index causes flickering

Discussion in 'Visual Effect Graph' started by mcuevasTencent, Mar 15, 2023.

  1. mcuevasTencent

    mcuevasTencent

    Joined:
    Nov 1, 2021
    Posts:
    10
    upload_2023-3-15_14-3-59.png
    Hello, I made a custom flipbook shader where X,Y is the flipbook rows, columns and Z is the index

    I would like my particle system to choose an index randomly between 15, 16, 17. However it's causing one of the particles billboards to flicker. Any idea what's causing this?

    Thanks in advance!
     

    Attached Files:

  2. Qriva

    Qriva

    Joined:
    Jun 30, 2019
    Posts:
    1,293
    Is this caused by flipbook index? I mean if you put constant number like 15 it still does that?
    Also could you show the shader? It looks more like problem with erosion than flipbook.
     
  3. mcuevasTencent

    mcuevasTencent

    Joined:
    Nov 1, 2021
    Posts:
    10
    A constant number like 15, 16 or 17 doesn't cause a flicker, only when I hook up the Random Number Per Particle

    Attached the Shader Graph
    upload_2023-3-15_23-12-25.png
     
  4. Qriva

    Qriva

    Joined:
    Jun 30, 2019
    Posts:
    1,293
    To be honest I am not sure what is happening in the graph xD
    Why you sample some texture, then use the result as uv to sample it again? Is the green line from left the flipbook dimensions? If it is, why it's vector2, not 3?

    In any case I still don't understand how the index is used, I guess you wanted to use random texture per particle, so you provide random index to sample one from the flipbook. With this setup I would expect particles to change their texture every frame as you didn't enable "constant" in random, so it would get random number every frame, but it does not happen on the gif - it kind of happens, but in the noisy way. Also have in mind this number will not be exactly 15,16,17, but something between too (like 15.476), so I hope you round it before you use it (assuming you don't use built in flipbook node).

    My wild guess is that randomization actually happens every frame and if you enable constant it would work.
     
  5. mcuevasTencent

    mcuevasTencent

    Joined:
    Nov 1, 2021
    Posts:
    10
    That fixed it thank you