Search Unity

Feedback Wanted: Visual Effect Graph

Discussion in 'Graphics Experimental Previews' started by ThomasVFX, Oct 21, 2018.

  1. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,085
    Feature Request (Unless this is already possible ;-) )

    We frequently update: Unity, Visual Effect Graph, other packages ... and change between HDRP and Legacy. Especially the change between HDRP and Legacy requires re-compiling all VFX Graphs. I had assumed that a simple Re-Import would also re-compile them all, but that apparently isn't (or wasn't) the case.

    So, at the moment, it seems I have to open each and every VFX Graph to make sure it is being re-compiled.

    I think really, the expected behavior should be "recompile on Reimport". But if that isn't feasible, something like "recompile all my shader graphs" would be really important to have.
     
  2. Grimreaper358

    Grimreaper358

    Joined:
    Apr 8, 2013
    Posts:
    533
    You can recompile all at once with a script included with the VFX Graph. Edit -> Visual Effects -> Rebuild All Visual Effect Graphs
     
    jashan likes this.
  3. ThomasVFX

    ThomasVFX

    Unity Technologies

    Joined:
    Jan 14, 2016
    Posts:
    24
    By Connect Block, Julien Referred to the "Connect target" block (I advise you try it using the latest 4.8.0-preview as we did a bug fix). Connect block just stretches a quad so the top and the bottom are located at a given position, and a target position (you can use target position attribute for the target position). Then the quads can align differently (towards camera, towards axis, towards lookat position)

    This is basically how we did the pin-screen in the demo, I have attached an effect with an example of these two features.
     

    Attached Files:

    patrick_scheper likes this.
  4. PaulDemeulenaere

    PaulDemeulenaere

    Unity Technologies

    Joined:
    Sep 29, 2016
    Posts:
    9
    Actually, you can use the "Remap" node to do this, but, you are right, for consistency (and parity with shaderGraph), we should add an InverseLerp node, thanks for reporting this !

    upload_2019-1-21_15-19-58.png


    Your issue is really interesting, first things first : about bug tracker, you can use it as usual, even for an experimental features, you can simply refer to VFX Graph and you don't need to specify if it's a package or built-in issue.

    About fixed delta time, the default mode should be as you described with physics.
    If asset is set up with "FixedDeltaTime", for each frame, we have something like this :
    Code (CSharp):
    1. m_TimeAccum += deltaTime; //m_TimeAccum is never reseted, initial value is zero.
    2. int stepsCount = round(m_TimeAccum / m_FixedTimeStep); //m_FixedTimeStep comes from VFXManager, default value is 1.0f/60.0f
    3. m_TimeAccum -= stepsCount * m_FixedTimeStep;
    4. stepsCount = clamp(stepsCount, 0, (int)m_MaxFixedTimeStepCount); //m_MaxFixedTimeStepCount computed from m_MaxDeltaTime (default, 1.0f/20.0) & m_FixedTimeStep, thus, default is 3u, this clamp leads to a slower simulation when we didn't reach target frame time
    5. float actualDeltaTime = stepsCount * m_FixedTimeStep; //At this stage, actualDeltaTime should be between [0.0f, m_MaxDeltaTime]
    If asset is set up with "DeltaTime", the computation of actualDeltaTime is simpler :
    Code (CSharp):
    1. float actualDeltaTime = clamp(currentDeltaTime, 0.0f, m_MaxDeltaTime);
    So, indeed, with "m_TimeAccum -= stepsCount * m_FixedTimeStep;", we consume steps which are actually not processed (due to the following clamp).

    In both cases, the total time is an accumulation of "actualDeltaTime" computed per component.

    Could you give us a bit more context for this one ? Or maybe a test project ? I'm worried about "This makes for unstable simulation (since integration can happen larger timesteps)", it looks like you are able to run too large step in your simulation...
     
    Last edited: Jan 21, 2019
  5. Danua

    Danua

    Joined:
    Feb 20, 2015
    Posts:
    183
    I want kill particles from constant spawner after N time, how to do that?
     
  6. Danua

    Danua

    Joined:
    Feb 20, 2015
    Posts:
    183
    also
    I want to start my particle slow and after 2 second rise it's speed.
    So question is, how to properly sample whole particle lifetime?
     
  7. PaulDemeulenaere

    PaulDemeulenaere

    Unity Technologies

    Joined:
    Sep 29, 2016
    Posts:
    9
    You can use the LoopAndDelay custom spawner (actually implemented in C# if you are curious about how it works) :
    upload_2019-1-21_16-3-50.png

    This block is still pretty experimental, it will change the playing state of this spawn context after a while. In this screenshot, after four seconds, constant spawn rate will be disabled.

    There isn't any "speed" attribute writable, you will have to update velocity in Update context, the simplest is using a "Set Velocity over Life" :
    upload_2019-1-21_16-17-40.png

    But admitting there isn't any moment where the velocity reaches a zero magnitude, you can do it within the graph updating a single scale velocity curve :
    upload_2019-1-21_16-15-17.png
     
    Danua likes this.
  8. Danua

    Danua

    Joined:
    Feb 20, 2015
    Posts:
    183
    "LoopAndDelay custom spawner"
    yes, that work for me, particle correctly stop after n seconds. ty

    Is the Age over Lifetime 0..1 a whole particle play time? What's mean every of this times? upload_2019-1-21_22-31-34.png
     
  9. PaulDemeulenaere

    PaulDemeulenaere

    Unity Technologies

    Joined:
    Sep 29, 2016
    Posts:
    9
    I will try to be concise :
    - TotalTime & DeltaTime are uniform provided by VisualEffect.
    - Age & Lifetime are particles attributes
    - Age Over Lifetime is an helper of a simple division between age (automatically incremented in Update) and lifetime (particle are killed after lifetime in Update, by default).
    upload_2019-1-21_16-43-34.png

    - Per Particle Total Time is also a helper, it helps to avoid discretization as explained here : https://twitter.com/peeweekVFX/status/1055599003989987328
    upload_2019-1-21_16-50-36.png
    (About this, we planned to provide a better way to handle discretization & interpolation with parameter of the visual effect graph)

    - SpawnTime is an attribute, it is used with custom spawner block "SetSpawnTime" which copies the internal total time of a spawner context (which is different from the global total time) into a custom attribute. It's pretty specific and completely experimental...
    upload_2019-1-21_17-0-15.png
     
  10. noahortega

    noahortega

    Joined:
    Sep 26, 2018
    Posts:
    2
    Alright, I have a few questions with more definitely on the way. First off, how do the "Get Attribute" blocks work? It seems like once you switch them from current to source there's no way to choose the source it's drawing from which kinda makes them useless? Basically what I'm attempting to do is have 2 different particle systems where particles from system 2 spawn in the same position as particles from system 1 (with completely different behavior otherwise). The problem is I have no idea how to get the current position from system 1 plugged into system 2. On top of this, whenever I switch the "Get Attribute: position" block from "current" to "source" I get an error in the console (I'll add a screencap). Finally, one last thing, how could I set up a 2 particle system where particles from system 2 spawn when particles from system 1 die? attribute_position_error.jpg
     
  11. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,085
    So, we got it working in Legacy! Yeah!!! :)

    And as expected, performance is significantly better (also, it will be much easier to get the rest of this project properly working when we stay with legacy for now). We probably need to tweak the color grading and even with that, I'm not sure we'll get the exact same quality as with HDRP - probably not. But for VR, performance matters more than slightly better visuals. This is a prototype visualization for our upcoming VR game Beat the Rhythm (I put the HMD on a little chair to get consistent results):


    [EDIT: Seems you can't easily watch this directly on Vimeo from this embedded video, so here's a direct link: Beat the Rhythm - The Singularity - VFX Particles Prototype on Vimeo]

    In this video, we compare performance of VFX Graph 4.8.0, in Unity 2018.3.2f1:

    First with HDRP (also 4.8.0), which does look a little better, but has unacceptable performance (this is on a GeForce 980Ti). Then, at 2:18, we use a build of the same visualization where we used Unity's legacy render pipeline - and even at the craziest particle counts (8x the particles count we had originally planned for), performance is butter smooth - not a single frame dropped.

    One interesting thing about this is also that when we reduce the particle count to "basically nothing", we have 2-3ms per frame GPU time in legacy, and about 6-7ms per frame GPU time for HDRP. So, for now, it very much looks like HDRP will only really work for VR on very high end hardware (in other tests, rendering just a single cube, I got around 5ms or 6ms per frame).

    I'll certainly give this another try with LWRP, once there is an implementation of VFX Graph for LWRP. But just as a data point, for me, HDRP is irrelevant for now, and legacy is all that matters (might become LWRP once that works but I haven't tried moving our project over to LWRP and it might turn out to not be feasible).

    [EDIT 2: Ah, let me add some raw data:

    Windows 10 (10.0.0) 64bit
    Processor: Intel(R) Core(TM) i7-5820K CPU @ 3.30GHz --- Cores: 12 --- Frequency: 3298
    Graphics device: 'NVIDIA GeForce GTX 980 Ti', vendor: 'NVIDIA'
    VR SDK: OpenVR
    HMD: Vive MV (HTC Vive)
    Initial resolution: 1789x1988 (game SS: 1)


    With HDRP:

    [21:18:38.38 / 15s]
    FXCount: 22, Spawn Rate Multiplier: 1.00 | Max Particle #: 425207, Avg Particle #: 223135
    Max GPU Frame Time: 37ms, Total Frames: 1173, Dropped Frames: 0, Frames over 7ms: 1068 | 9ms: 74 | 11ms: 1

    [21:18:53.53 / 30s]
    FXCount: 22, Spawn Rate Multiplier: 1.00 | Max Particle #: 508720, Avg Particle #: 493339
    Max GPU Frame Time: 10ms, Total Frames: 1343, Dropped Frames: 0, Frames over 7ms: 1073 | 9ms: 89 | 11ms: 0

    [21:19:08.08 / 45s]
    FXCount: 22, Spawn Rate Multiplier: 8.00 | Max Particle #: 2288908, Avg Particle #: 1159863
    Max GPU Frame Time: 33ms, Total Frames: 901, Dropped Frames: 24, Frames over 7ms: 490 | 9ms: 456 | 11ms: 446

    [...]

    [21:21:53.53 / 210s]
    FXCount: 22, Spawn Rate Multiplier: 8.00 | Max Particle #: 2430592, Avg Particle #: 2098061
    Max GPU Frame Time: 29ms, Total Frames: 704, Dropped Frames: 60, Frames over 7ms: 704 | 9ms: 704 | 11ms: 592


    With Legacy:

    [22:02:42.42 / 15s]
    FXCount: 22, Spawn Rate Multiplier: 1.00 | Max Particle #: 256335, Avg Particle #: 140388
    Max GPU Frame Time: 21ms, Total Frames: 649, Dropped Frames: 0, Frames over 7ms: 1 | 9ms: 1 | 11ms: 1

    [22:02:57.57 / 30s]
    FXCount: 22, Spawn Rate Multiplier: 1.00 | Max Particle #: 512601, Avg Particle #: 440878
    Max GPU Frame Time: 4ms, Total Frames: 1343, Dropped Frames: 0, Frames over 7ms: 0 | 9ms: 0 | 11ms: 0

    [...]

    [22:03:42.42 / 75s]
    FXCount: 22, Spawn Rate Multiplier: 8.00 | Max Particle #: 2497997, Avg Particle #: 1170713
    Max GPU Frame Time: 6ms, Total Frames: 1343, Dropped Frames: 0, Frames over 7ms: 0 | 9ms: 0 | 11ms: 0

    [22:03:57.57 / 90s]
    FXCount: 22, Spawn Rate Multiplier: 8.00 | Max Particle #: 2597701, Avg Particle #: 651528
    Max GPU Frame Time: 6ms, Total Frames: 1343, Dropped Frames: 0, Frames over 7ms: 0 | 9ms: 0 | 11ms: 0




    ]
     
    Last edited: Jan 21, 2019
    interpol_kun likes this.
  12. andybak

    andybak

    Joined:
    Jan 14, 2017
    Posts:
    143
    @jashan What was your setup to get it working in legacy? I tried a few things a week ago and nothing seemed to work.
     
  13. Danua

    Danua

    Joined:
    Feb 20, 2015
    Posts:
    183
    Ty for quick responding!
    How to choose random frame from flipbook? We can sampling flip book play speed only?
    It's all about debris particles when explosion came
     
  14. Danua

    Danua

    Joined:
    Feb 20, 2015
    Posts:
    183
    I can't find analogue of noise like with legacy particle system?
    I found somethibg called turbulence, how to work with that? I want to simulate smoke after burning fuel.
     
  15. thinksquirrel_lily

    thinksquirrel_lily

    Joined:
    Feb 8, 2011
    Posts:
    1,175
    @PaulDemeulenaere

    Thanks for letting me know about Remap! Missed that one :)

    Good to know, thanks.

    So the above code looks like it would still cause an issue when it comes to simulating a fixed timestep system. It depends on how and where advancing the system is called. For simplicity's sake, let's say the VFX system is advanced with a simulate(dt) method:

    Code (CSharp):
    1.  
    2. m_TimeAccum -= stepsCount * m_FixedTimeStep;
    3. stepsCount = clamp(stepsCount, 0, (int)m_MaxFixedTimeStepCount); //m_MaxFixedTimeStepCount computed from m_MaxDeltaTime (default, 1.0f/20.0) & m_FixedTimeStep, thus, default is 3u, this clamp leads to a slower simulation when we didn't reach target frame time
    4. float actualDeltaTime = stepsCount * m_FixedTimeStep; //At this stage, actualDeltaTime should be between [0.0f, m_MaxDeltaTime]
    5.  
    6. // This would be unstable, because actualDeltaTime is now variable (between m_FixedTimestep and m_MaxDeltaTime)
    7. // simulate(actualDeltaTime);
    8.  
    9. // This would be stable, as dt will be constant within the system between frames
    10. for(int i = 0; i < stepsCount; ++i)
    11. {
    12.     simulate(m_FixedTimeStep);
    13. }
    14.  
     
    Last edited: Jan 22, 2019
  16. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,085
    Hi Andy,

    The important thing is to use a current version: They've had a typo in one of the shaders that caused shader compilation errors a few weeks ago. So, I used Unity 2018.3.2f1 and Visual Effect Graph 4.8.0.

    Then, all you need to do is Edit -> Project Settings, select last section in that panel: VFX and for Render Pipe Settings Path put in: Packages/com.unity.visualeffectgraph/Shaders/RenderPipeline/Legacy (instead of Packages/com.unity.visualeffectgraph/Shaders/RenderPipeline/HDRP). So basically replace HDRP with Legacy)

    And after that, make sure to recompile all VFX Graphs in your project, using: Edit -> Visual Effects -> Rebuild All Visual Effect Graphs (thanks to @Grimreaper358 for making me aware of how to do that).

    Just to be sure, I also restarted Unity. That never hurts ;-)

    There are some limitations with legacy; IIRC one was that VFX Graph does not support lighting with legacy. See posting #248 by @JulienF_Unity for the limitations with legacy support.
     
  17. peeweekVFX

    peeweekVFX

    Joined:
    Oct 19, 2015
    Posts:
    1
    frames from flipbooks are selected using the `texIndex` attribute (integer part selects the frame, fractional part is used for the blending when using flipbook blend mode in your output.

    to start your particle at a random frame, you can use a `set texIndex` block and change the random mode to uniform in the inspector.

    if you need to play an animation, I'd suggest you use a `flipbook player` block in update or a `texIndex from Curve` (over life) in update/output

    Turbulence is one way to go indeed, it applies procedural 3d noise based on particle position. As you increase drag, the force will proportionally become the particle's velocity.

    Other method is using Vector Field Force (if you have 3d vector fields, otherwise i'd advise you get some files here)

    If you are still not satisfied with these methods, you can also compute your own procedural noise using Noise Operators, then plugging these into a Force node and do the math yourself :)

    You can push the particles a bit towards the camera by using the `Set Pivot` block in output, the Z component pushes towards/away the particles based on their normal. To avoid particle shifting while moving them towards camera, I advise you use the orientation "Face Camera Position"

    Hope that helps :)
     
    Danua likes this.
  18. Danua

    Danua

    Joined:
    Feb 20, 2015
    Posts:
    183
    Ty for helps. Another question packages here:
    1)Is there any way to rotate world space vfx system via unity transform through inspector?
    2) How to play flipbook only 1 time (there is video which show my issue
    3) How to set random position for every particle?


    here you can look at wip's vfx
     
    Last edited: Jan 22, 2019
    petersx likes this.
  19. noahortega

    noahortega

    Joined:
    Sep 26, 2018
    Posts:
    2
    What happened to the block: "Trigger Event on Die" that they showed off in the genie demo? Apparently it doesn't exist in the VFX graph anymore. Is there some other way to trigger an event on die now? Also I would really appreciate it if someone could answer the previous questions I posted.

    check it out in their example:
     
  20. Danua

    Danua

    Joined:
    Feb 20, 2015
    Posts:
    183
    Greatings! Does it exist way to add more variation to explosion, something like random horizontal flip?
    upload_2019-1-23_13-18-1.png
    upload_2019-1-23_13-20-57.png
     
  21. RavenLiquid

    RavenLiquid

    Joined:
    May 5, 2015
    Posts:
    38
    It's part of the experimental blocks.

    In the preferences (of Unity) under visual effects you can check experimental blocks and then it will be available.
     
  22. andybak

    andybak

    Joined:
    Jan 14, 2017
    Posts:
    143
    @jashan Thanks so much for your help. That worked for getting legacy working.

    Question for Unity staff - is there an ETA for LWRP support for VFX Graphs? Is there an experimental branch that supports it?

    I took a look on Github to see if any branches had LWRP files inside \com.unity.visualeffectgraph\Shaders\RenderPipeline but couldn't see any. Am I correct in thinking that this is the right place to look for signs of support?
     
    jashan likes this.
  23. Danua

    Danua

    Joined:
    Feb 20, 2015
    Posts:
    183
    I have short life time effect called muzzle flash it's life time 300 ms and another effect called "exhaust smoke" it's life time 2 sec, I want to trigger muzzle flash and smoke seperately via c# code
    Is there any way to trigger resimulate only part of vfx graph? upload_2019-1-23_17-15-52.png
     
  24. Danua

    Danua

    Joined:
    Feb 20, 2015
    Posts:
    183
    update i found that. Just create Event onPlayCustomName and trigger it via code
    every 300 ms send event (OnPlayFlash)
    every 2000 ms send event (OnPlaySmoke)
    also make onstop even for it
     
  25. Danua

    Danua

    Joined:
    Feb 20, 2015
    Posts:
    183
    New problem here. How to make smoke trail for rocket? I need spawn one particle =rocket give it very fast movement and attach to them smoke.
    1) How to get position and velocity of rocket?
    2) How to spawn smoke trail on rocket trajectory?
    upload_2019-1-23_20-38-16.png
     
  26. patrick_scheper

    patrick_scheper

    Joined:
    Mar 18, 2015
    Posts:
    16
    Thanks Tomas for explaining, that really helped. A problem appeared the last few days, hope someone could help me:

    I've been using the Turbulence block for the last days, which works really cool. I'm positioning two million pixels (1920x1080) across the screen, and with turbulence I 'morph' a texture. (In theory I just map the particle color based on the UV coordinates)

    After the morph is done, I lerp the particles back to their original position by setting the target position to their own position on initialize.

    One problem that keeps occuring is that after a while, only when I use the turbulence, the particles don't move back to their target position. They either disseapeared, or 'forget' their target position. I am not setting any lifetime, so I assume that the particles don't die.

    I've made a gif of it, if the quality is too bad to understand, I can create a better one.

    https://i.gyazo.com/9bc4d809e91ce5057120e0f02a5feb32.mp4

    The pink is the background, the dark grey are the particles. In the first 10 iterations or so, you don't notice the gaps, but the pink spots grow bigger and bigger over time.
     
  27. PaulDemeulenaere

    PaulDemeulenaere

    Unity Technologies

    Joined:
    Sep 29, 2016
    Posts:
    9
    Ah yes, thanks, you are right. The actual system provides a delta time which can reach the maxDeltaTime (n*fixedTimeStep, where n is an integer) for a single simulation step. Maybe it's wrongly named. I understood why it would be more stable to simulate explicitly several frames, maybe we should consider another mode or at least a better way to handle this simulation time/loop yourself...

    P.S.: InverseLerp node is coming !
     
    thinksquirrel_lily likes this.
  28. thinksquirrel_lily

    thinksquirrel_lily

    Joined:
    Feb 8, 2011
    Posts:
    1,175
    A new mode would be great (this would be pretty hard to handle on the user end since it means the passes all need to run multiple times).

    At the very least I would consider renaming it as it's not in line with typical expectations with fixed time (including Unity's own 2D and 3D physics).
     
    PaulDemeulenaere likes this.
  29. RavenLiquid

    RavenLiquid

    Joined:
    May 5, 2015
    Posts:
    38
    So maybe I'm missing something but I can't get this to work:

    I wan't my particles to change color over life based on a gradient, but I want this gradient to come from a property that I can set.

    So far so good, I create the property and set this to the gradient of alpha/color in quad output.

    But, what I want is that when I change the gradient is that this only applies to new particles. Doing this in the quad block changes it for all particles in the scene.

    I would have guessed that adding a color over life block in Initialize would do it, but this only seems to set the particle color to a fixed color. It does not change.

    What am I missing here? Shouldn't the color over life move through the gradient?
     
  30. SiriusRU

    SiriusRU

    Joined:
    Sep 29, 2018
    Posts:
    21
    You could try sample gradient with age or something, but I'm not sure that's what you want, cause when I change gradient this still changes the appearance of existing particles. On the other hand, for this not to happen, it would be necessary for each particle to remember its gradient, and this is not very effective from memory perspective, isn't it.

    Снимок.PNG
     
    createtheimaginable likes this.
  31. Danua

    Danua

    Joined:
    Feb 20, 2015
    Posts:
    183
    Up that question
     
  32. RavenLiquid

    RavenLiquid

    Joined:
    May 5, 2015
    Posts:
    38
    I think I get what the problem is, it is indeed not storing the gradient information but only the color and alpha of the particle. It is a bit confusing because it lets you set Color over life during initialization, but it seems to function more just like Set Color.

    It is a bit annoying because it seemed like the easiest way to have a particle change color over life based on the situation when it spawns.
     
  33. thinksquirrel_lily

    thinksquirrel_lily

    Joined:
    Feb 8, 2011
    Posts:
    1,175
    You could do the following (you'd need to enable experimental custom attributes in preferences):

    1. Set a "startColor" attribute in the Initialize context, based on sampling your gradient
    2. In the Output context, set color from the custom attribute "startColor"

    Changing the gradient from script (or in the editor) would then only change newly emitting particles.
     
  34. Danua

    Danua

    Joined:
    Feb 20, 2015
    Posts:
    183
    yo devs, maybe we organize vfx graph discord group?
     
    patrick_scheper likes this.
  35. Danua

    Danua

    Joined:
    Feb 20, 2015
    Posts:
    183
    #Vfx_hint
    Use add velocity (Direction) instead add velocity and you will able to rotate gameobject transform when world space simulation used
    upload_2019-1-25_13-56-25.png
     
  36. Danua

    Danua

    Joined:
    Feb 20, 2015
    Posts:
    183
    Node setup to play flipbook animation only 1 time, when it reach last tex index of your flipbook it kill particle
    upload_2019-1-25_16-15-5.png
     
    createtheimaginable and konsic like this.
  37. Danua

    Danua

    Joined:
    Feb 20, 2015
    Posts:
    183
    upload_2019-1-25_17-18-51.png
    Random particle flip along y axis
     
    konsic likes this.
  38. Danua

    Danua

    Joined:
    Feb 20, 2015
    Posts:
    183
    The way how to add delay to constant spawner. Use random spawn factor also

    upload_2019-1-25_20-36-50.png upload_2019-1-25_20-35-22.png
     
    konsic likes this.
  39. Danua

    Danua

    Joined:
    Feb 20, 2015
    Posts:
    183
    How to get position from another particle system that into one graph?
     
  40. vamky

    vamky

    Joined:
    Aug 9, 2014
    Posts:
    67
    Hi! Could we import Houdini rdb stuff into unity visual effect graph? Like what was shown in this video:
     
  41. Danua

    Danua

    Joined:
    Feb 20, 2015
    Posts:
    183
    Up tha question agan
     
  42. ratonmalo

    ratonmalo

    Joined:
    Apr 12, 2010
    Posts:
    273
    Hi guys, any idea how to set the old shuriken Prewarm into Visual Effect? Thanks
     
    soroush-abasian likes this.
  43. hvent90

    hvent90

    Joined:
    Jun 18, 2018
    Posts:
    19
    Does anyone get entirely different particle behaviours when they restart unity? Sometimes I get an accretion disk, and sometimes I just get a chaotic ball .
     
  44. konsic

    konsic

    Joined:
    Oct 19, 2015
    Posts:
    634
    Is it possible to download VEG as package and put it in project folder ?
     
  45. Danua

    Danua

    Joined:
    Feb 20, 2015
    Posts:
    183
    Please add able to share update context beween multiple diffrent Initialize context, I have many simillar context chain, that difference only in spawn and initialize contexts. there is void update. It's will work way much faster if it share one single update like this
    upload_2019-1-29_23-41-55.png upload_2019-1-29_23-43-7.png
     
  46. Livealot

    Livealot

    Joined:
    Sep 2, 2013
    Posts:
    95
    Three suggestions that would make the newbie experience better
    1. Add to the compatibility section of the sticky post for this forum to included the recommended (most stable) package versions of related/required packages (e.g., HDRP, Shader Graph). After successfully working with the sample project, I tried updating those packages to the latest versions, and the project went nuts.
    2. VFX wiki table of contents on Github. The wiki page for Visual Effect Graph has great links to the key content but there's also a "Content" outline nav box that goes to other stuff like Shader Graph where it's easy to confuse the Shader Graph "Node Library" with the VFX Graph "Block Library". I was looking for info on a "flipbook node" and got lost
    3. I'm guessing the majority of VFX graph users are pretty advanced users of Particle Systems, and I think there's going to be an endless stream of "how do I replicate what I used to do in a particle system in the new VFX graph?" So that might be a good approach for tutorials/docs to just go module by module through the legacy particle system to show how to do the equivalent in VFX graph. For example, there's several posts in this forum about how to work with Texture Sheets, and it's still not clear how to do all the common tasks in the new system.
     
    Danua likes this.
  47. Danua

    Danua

    Joined:
    Feb 20, 2015
    Posts:
    183
    Maybe some of may post will help you. I've found way how to set random tex index at spawn, how to play flipbook only one time.
     
  48. Livealot

    Livealot

    Joined:
    Sep 2, 2013
    Posts:
    95
    Your posts are certainly helpful. The suggestion I was making was a way to componetize the teaching more efficiently than surfing an ever-expanding forum. The node library for Shader Graph does this well. Here's an example for picking a random Texture from a texture sheet.
    RandomFlipbookTexture.JPG
     
  49. Danua

    Danua

    Joined:
    Feb 20, 2015
    Posts:
    183
  50. RavenLiquid

    RavenLiquid

    Joined:
    May 5, 2015
    Posts:
    38
    So I managed to get what I wanted working based on this.

    What I really wanted was just a way to create a gradient from two colors that are fixed on initalization, but there is no way to create a new gradient. The only input for a gradient node is another gradient.

    So the creative fix was to use SetColor in initialize and sample from the gradient at time 0, and then use SetAttribute to store a Vector3 (i think 4 should also work for alpha but I had some strange issues). In update I then use blend color and GetAttribute for the color and Age Over Life with a divide to control the gradient over the particle life.

    After this a gradient as input is not really needed anymore and it can be swapped out for two color parameters, saves the sampling as it adds nothing when blending between two colors.

    I also started looking in to creating a gradient from color operator but it seems like a real hassle with everything being internal and the actual operators seem to be an enum? Maybe they start supporting extensibility over time.