Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our 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:
    326
    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.