Search Unity

  1. The 2022.1 beta is now available for testing. To find out what's new, have a look at our 2022.1 beta blog post.
    Dismiss Notice

details on graph traversal and code generation

Discussion in 'Visual Effect Graph' started by texone, May 28, 2020.

  1. texone

    texone

    Joined:
    Jan 26, 2018
    Posts:
    12
    I am wondering how the vfx graph is handling branches,

    in my use case I would pass a parameter going from 0 to 1 do blend in some calculated value so for 0 I do not need to calculate these values, is the code generation smart in such ways that it checks if a constant parameter leads to a branch that is always true that it does not calculate the false input?
     
  2. JulienF_Unity

    JulienF_Unity

    Unity Technologies

    Joined:
    Dec 17, 2015
    Posts:
    243
    Hi, constant lerp ratio of 0 or 1 will lead to the stripping of the lerp and will evaluate only the side needed.
    However if the ratio is exposed from outside the graph, it cannot be considered constant anymore and therefore both side will be evaluated.
     
unityunity