Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

VFX Graph: Is it possible to randomise the MainTexture in an output

Discussion in 'Graphics Experimental Previews' started by highlyinteractive, Jul 15, 2019.

  1. highlyinteractive

    highlyinteractive

    Joined:
    Sep 6, 2012
    Posts:
    116
    New to VFX graph, but loving it so far.

    I'd like a way to generate particles that use a random texture from a predefined group. Is that possible?

    I've tried looking at the Texture2DArray node, but it doesn't seem possible to select a random texture.

    Has anyone done anything similar?
     
    lnwhitling likes this.
  2. JulienF_Unity

    JulienF_Unity

    Unity Technologies

    Joined:
    Dec 17, 2015
    Posts:
    328
    Hey. At the moment, you need to pack your textures in a single texture sheet and use flipbook mode on the output to select the texture you want. Frame selection is done using texIndex attribute that you can randomize per particle.
     
  3. highlyinteractive

    highlyinteractive

    Joined:
    Sep 6, 2012
    Posts:
    116
    Ah ok, thanks.

    I'm already using texture sheets, so perhaps I'll just pack a bunch of them into one.

    Thanks for your help