Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

VFX Graph - Flipbook

Discussion in 'Graphics Experimental Previews' started by whidzee, Jan 16, 2019.

  1. whidzee

    whidzee

    Joined:
    Nov 20, 2012
    Posts:
    166
    Hello, I have a 4x4 texture sheet which i am trying to get set up to work with the particle life.

    I cannot work out how to connect my texture into the render graph in order to achieve this.

    I have my texture plugged into the MainTexture slot in the quadoutput
    UV mode is set to Flipbook (although i get the same nonresponsiveness from FlipbookBlend)
    FlipbookSize is set to 4x4 so i can see one of my cells showing up fine.

    I just have no idea on how to get this texture to be animated on the particles.
     
  2. JulienF_Unity

    JulienF_Unity

    Unity Technologies

    Joined:
    Dec 17, 2015
    Posts:
    326
    Flipbook frame is selected using texIndex attribute. You can manipulate it in the graph like any other attribute. There's also a built in flipbook player block that will update the texIndex based on a playrate.
     
    DavidMiranda and Mehrdad995 like this.
  3. whidzee

    whidzee

    Joined:
    Nov 20, 2012
    Posts:
    166
    Thanks for this Julien :)
     
  4. koirat

    koirat

    Joined:
    Jul 7, 2012
    Posts:
    2,074
    HDRP 9.****
    Was just playing with Flipbook player.
    In Curve over life mode it looks like player is displaying more frames than it should. (looping but not completely)
    I have not messed around with a curve manually it shows proper number of frames (in my case it starts at (0,25) and ends (1,0).

    Or am I not understanding how it works ? Could not find the documentation.
    I assume it should make full cycle in lifetime of a particle.

     
  5. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,365
    Yes it's extremely counter intuitive because instead of a sane value like in shuriken where 0 represents the beginning of the flipbook and 1 represents the end, it's in fact playback velocity... I'm not making that up. So because it provides no sensible time markers you need to try it interactively and push the values way past 1.

    Here is what I did: I started with a flat curve at 1, it'll be 1 fps, meaning that all frames of the sequence will last 1 second, then slid the curve to a sensible framerate, then added the second key at the end of the lifetime and moved it to 10 until I got a nice acceleration of the animation through lifetime.
     
  6. koirat

    koirat

    Joined:
    Jul 7, 2012
    Posts:
    2,074
    laurentlavigne yes this block is a total failure. There should be option over life without curve. And are you sure this is speed and not raw index ?
    I had many problem with flipbook node in VFX graph and I decided to create my own node with calculations and then use SetTexIndex explicitly.
     
  7. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,365
    Yeah it took me a while to realize that vfx graph is not an artist's tool. This explains why why youtube is filled with the same swarmy particles, it's the lensflare 2020.
    positive, hence the name "frame rate"
    you prefer that over [0,1]? please do share anyway, I'm sure it's better than the mad loop of "add a point to the curve, need to change all the other points to make sure all frames play"
     
  8. koirat

    koirat

    Joined:
    Jul 7, 2012
    Posts:
    2,074
    laurentlavigne (btw. when I copy your name like this do you get a notification ? ) here it is:


     
    STAndreiBelov likes this.
  9. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,365
    Thank you I just added that to the graph. It is much easier to control but it doesn't play the last frame of the flipbook. [EDIT: I removed the range and it works, don't know why]
    I would like to try out exchanging subgraph, hopefully they won't change the graph definition like they did with urp...
    See if that works for you
     

    Attached Files:

    Last edited: Dec 14, 2020
    STAndreiBelov likes this.
  10. koirat

    koirat

    Joined:
    Jul 7, 2012
    Posts:
    2,074
    It was empty when I added it. You can do print screen and paste it here.

    it will not play the last frame because in this example sample position must be 1 to play it and it is only 1 when lifetime is over.

    Also I don't know what range are you talking about,
     
  11. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,365
    mult produces a 3 which is the index of my last frame as a result of rounding to the upper value so it works.
    this range
    upload_2020-12-13_18-16-57.png

     
  12. koirat

    koirat

    Joined:
    Jul 7, 2012
    Posts:
    2,074
    Range from 0 to 0 ? This should do nothing. Also I see some Rambo image instead of your image (I suppose).
     
  13. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,365
    the image was to answer your question, i toggled it quickly so it defaults at 0,0. it was set at 0,1 when I was getting the last frame skip. In fact it should recall the previous range value of 0,1 like in the inspector so this is a bug. i'm past my quota for today ;)
     
  14. delevinying

    delevinying

    Joined:
    Jul 18, 2018
    Posts:
    2
    upload_2021-8-6_17-46-7.png


    How to set Normal Map on right? why different ?
     
  15. NastassiaZ

    NastassiaZ

    Joined:
    Dec 18, 2020
    Posts:
    3
    In the Inspector window you can tick "Use Normal Map"
     
  16. lpelletier_bhvr

    lpelletier_bhvr

    Joined:
    Mar 16, 2021
    Posts:
    2
    Stumbling upon this - has anyone tried to make a vfx graph using an output shader in which a flipbook is played ? It doesn't use any of the vfxgraph flipbook nodes and seems to be stuck on frame 1 ? is it something that anyone can share their knowledge about ? thanks !
     
  17. koirat

    koirat

    Joined:
    Jul 7, 2012
    Posts:
    2,074
    Paste your vfx graph here.