Okay so, Im trying to create a lightning particle effect in godot, for that ive created a GPUParticles3D Node with Amount 1 and lifetime 1s with a QuadMesh as the Mesh and a visual shader as the material.
The texture is a 3x3 of in total 9 lightning bolts on a 3000x3000px image each bolt is 1000x1000px, now I want to randomise which lightning bolt gets displayed

how do i do that?

I tried it already this way (2nd pic) but it just cycles through them without any randomness and just displays the 1st, 5th and 9th image if I input both x and y into the vectorcompose node (if its just x its the 1st, 2nd and 3rd, and if only y as the input its 1st, 4th and 7th image.) Help would be appreciated, thanks in advance!

  • xyz replied to this.
    5 days later

    xyz Like this?

    it just shows a grey quadmesh

    • xyz replied to this.
      • Edited

      LegendaryAd it just shows a grey quadmesh

      I don't see your random function using time as the seed. And expression node itself works as a function so you only need to supply the body or actually call the function. Currently the code in the expression is likely not executed at all.

      You may have other bugs in your shader network. Build it step by step, checking output each step of the way.

      May be a bit easier with two rngs (for u and v offsets in the atlas), one rng having TIME+some_offset seed.