Unity-Technologies / VisualEffectGraph-Samples

Visual Effect Graph - Samples Project
Other
1.89k stars 392 forks source link

Why Line output contains multiple "Set Position"? #4

Open ice-github opened 5 years ago

ice-github commented 5 years ago

I checked ARRadar sample however I couldn't understand why Line output of "Radar Lines" contains two "Set Position". image I'd like to know how VFXGraph processes such a multiple "Set Position". Second "Set Position" loads "Get Attribute position(Current)" and the current position means the value of the first "Set Position"?

peeweek commented 3 years ago

In this output every line particle is actually a wireframe segment (2 points) controlled by attributes:

The first set position/target position are computing the values in 2d to make the grid), then are remapped as a vortex in separate set position/targetposition (basically these read the from values from the values stored previously using Get Position / Get Target Position operators.

This is something that is allowed in VFX, where you can perform some computations early in a context, then re-read again later in the same function.

As the blocks are executed top to bottom, you can chain computations this way.