Search Unity

SetFloat x 3 vs. SetVector3 and break it up in the graph

Discussion in 'Visual Effect Graph' started by HB_VFX, Jul 7, 2021.

  1. HB_VFX

    HB_VFX

    Joined:
    Nov 15, 2019
    Posts:
    3
    I am sending information into the particle systems and trying to sort out if it makes more sense to usethree separate VisualEffect.SetFloat() commands or if I should be combining them in C# to a single VisualEffect.SetVector3 and then accessing the Vector3 as separate components within the Shadergraph. Am I splitting hairs or will this make a difference?

    Thanks
     
  2. JulienF_Unity

    JulienF_Unity

    Unity Technologies

    Joined:
    Dec 17, 2015
    Posts:
    326
    Hi! Packing your 3 floats in 1 single Vector3 will be more performant in essence (less calls/overhead) but it's highly likely this will be neglictible. So I would advised to use the most convenient/straightforward method unless this is clearly identified to be a performance bottleneck.