Search Unity

  1. Get the latest news, tutorials and offers directly to your inbox with our newsletters. Sign up now.
    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:
    97
    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:
    226
    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.
     
    Chmyke and highlyinteractive like this.
  3. highlyinteractive

    highlyinteractive

    Joined:
    Sep 6, 2012
    Posts:
    97
    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
     
unityunity