Search Unity

Feedback Wanted: Visual Effect Graph

Discussion in 'Visual Effect Graph' started by ThomasVFX, Oct 21, 2018.

Thread Status:
Not open for further replies.
  1. LavieA

    LavieA

    Joined:
    Apr 25, 2017
    Posts:
    4
    I am trying really hard, but how can I make a particle points towards the velocity direction along only one axis? Without using "Along Velocity" because it changes all axis
    upload_2020-1-3_18-6-47.png
     
  2. andybak

    andybak

    Joined:
    Jan 14, 2017
    Posts:
    569
    20 pages and counting. How's that work on a dedicated VFX Graph forum coming along?

    Gee. It must be a complex task. Not anything like "log in as admin and click create subforum" like most forum software.

    No siree... Can't be as simple as that or someone would have done it by now...
     
    PNiermann likes this.
  3. noob101

    noob101

    Joined:
    Nov 3, 2013
    Posts:
    38
    Hi all , is VFX Graph supported with the 2D Renderer in URP ? 2019.3.0f3. I understand that it should work with URP and the 2D renderer is a customization of it so I would expect it to work.

    All my effects are invisible with the 2D renderer . I would like to utilize the 2D lights and VFX in my game.

    If I set the add a forward renderer and set it as default the VFX works but 2D lights dont and vice versa

    upload_2020-1-5_11-39-50.png
     
    vx4 likes this.
  4. diggablegames

    diggablegames

    Joined:
    Aug 26, 2014
    Posts:
    2
    Hey all, I am working with 2019.2.2 and 6.9.1 version of visual effect graph and LWRP.

    I had an issue where some of my vfx files were not working. The ones that wouldn't work in the scene would show up in the Inspector preview window just fine but as soon as I exited the editor it would throw an error "Exception while compiling expression graph: System.NotImplementedException: UnityEditor.VFX.VFXExpressionInverseMatrix" and would stop working in the preview and scene. If I re-opened the editor it was fine in preview again.

    I uninstalled and re-installed the visual effect graph and now none of my vfx files work in the scene or inspector. I tried uninstalling and re-installing visual effect graph and LWRP several times and it doesn't seem to help at all. I have reverted my project back to my last commit but it doesn't seem to change anything.

    anyone have any suggestions/recommendations/ideas before I just re-create all of my effects in the standard particle system.
     
  5. JulienF_Unity

    JulienF_Unity

    Unity Technologies

    Joined:
    Dec 17, 2015
    Posts:
    326
    Hello,

    Can you file a bug with the incriminated vfx asset so we can take a look and fix it ?

    It seems related to runtime mode compilation of the fx. So in the meantime, as a workaround, you can try to enable "Force Compilation in Edition Mode" in the vfx preference window.
     
  6. andybak

    andybak

    Joined:
    Jan 14, 2017
    Posts:
    569
    I was wondering about that option yesterday. What does "Edition mode" mean?
     
  7. diggablegames

    diggablegames

    Joined:
    Aug 26, 2014
    Posts:
    2
    That did the trick. I will post a bug as soon as I get a chance. Thanks JulienF_Unity
     
  8. Elliott-Mitchell

    Elliott-Mitchell

    Joined:
    Oct 8, 2015
    Posts:
    88
    Is there a method for enabling lit quads to cast shadows onto the world? Am I missing something?
    Thanks!
     
  9. Elliott-Mitchell

    Elliott-Mitchell

    Joined:
    Oct 8, 2015
    Posts:
    88
    NVM, I forgot you had to click on the context and then the inspector. I'm used to just looking at the graph itself.
     
  10. MarkA2049

    MarkA2049

    Joined:
    Jan 2, 2019
    Posts:
    2
    This is great, and I enjoy using it. However, I am unable to get lit outputs working. Any time I even add the node, it spits out errors and stops displaying the particles. It seems others have similar issues, but with no resolve. I have tried updating the HDRP and graph packages. No luck on anything.

    https://pastebin.com/TARJDt2N
     
  11. Neogene

    Neogene

    Joined:
    Dec 29, 2010
    Posts:
    95
    Hi, I'm searching a way to stop a particle when it hits a collider, to generate dust/snow effect. There is some way to implement this? The portal example uses a simply Y value check but if terrain is not flat this won't work well. Any tips? thanks.
     
  12. andybak

    andybak

    Joined:
    Jan 14, 2017
    Posts:
    569
    Quick off the cuff thought - die on collision and spawn a new particle with a velocity of zero?
     
  13. Neogene

    Neogene

    Joined:
    Dec 29, 2010
    Posts:
    95
    I didn't find a block to detect collision only different Collider blocks, this is why I asked.
     
  14. qoly

    qoly

    Joined:
    Jun 18, 2019
    Posts:
    12
    I have Unity 2019.1.8f1, but:
    What's can be wrong?
     
  15. andybak

    andybak

    Joined:
    Jan 14, 2017
    Posts:
    569
    Hard to say because you've given us hardly any information!

    What platform have you got selected in Build Settings?
     
  16. Aaron-Meyers

    Aaron-Meyers

    Joined:
    Dec 8, 2009
    Posts:
    305
    I'm using Visual Effect Graph to draw points (Output Particle Cube) from a volumetric video sequence. I'm going to be creating some more special effects later, but right now I'm just using it for straightforward playback where in the legacy pipeline I used Graphics.DrawMeshInstancedIndirect to draw meshes at each point contained in each frame. The volumetric sequence is 30fps so I figured I could set particle lifetimes to .03333333, but in practice that left me with some flickering where particles died before the next frame spawned. A lifetime of .05 seems like a decent compromise... sometimes it is detectable that two overlapping frames are drawing at the same time though.

    Most of the work I do with volumetric video is Timeline-driven and I make as much stuff as I can work without entering play mode to speed up my workflow, but with the current setup, my volumetric video can only draw when the timeline is playing and creating new frames... if its paused, the particles just die right away.

    Anyway, what I'd really like to be able to do is use an Event to kill all the particles in the system right before I add the particles in the next frame. Then I wouldn't have to bother worrying about lifetimes, etc.

    As far as I can tell, Events can only be used right now to spawn new particles. Any plans to allow an event to force the Update Particle section to run? That way, I could have a Kill block where the bounding box is 0,0,0 size until I need to kill off all the particles, make it huge, kill the particles, then send the next frame.

    Or am I thinking about this the wrong way? Any other suggestions for how to accomplish this?
     
  17. Aaron-Meyers

    Aaron-Meyers

    Joined:
    Dec 8, 2009
    Posts:
    305
    Figured out a way! Added an int property "CurrentGroup" that gets flipped back and forth between 0 and 1 every time the Spawn event gets fired from my script. Assigning it to the Alpha attribute because I don't think I'll need it.

    Then in the Update section, I do a simple Compare of the particle's Alpha attribute with the CurrentGroup property. If they aren't equal, particle is set to not alive! Cool!
     
  18. qoly

    qoly

    Joined:
    Jun 18, 2019
    Posts:
    12
    Platform: PC, Mac & Linux Standalone.
    OS: Windows 10 x64.
    GPU: Geforce 8800GT, Driver 342.01
    DirectX 12.

    What's more?

    So. Geforce 8800GT don't support DirectX 11/12 and Visual Effects Grath? That's problem?
     
    Last edited: Jan 16, 2020
  19. andybak

    andybak

    Joined:
    Jan 14, 2017
    Posts:
    569
    Another suggestion - create all the particles you need in frame 0 and keep them alive. Just set their position each frame.

    (this might limit some effects you might want to do in future but you can probably have the best of both worlds by spawning fx particles from each "pixel" particle)
     
  20. Aaron-Meyers

    Aaron-Meyers

    Joined:
    Dec 8, 2009
    Posts:
    305
    I'm trying to do a thing where the particle position gets transformed into another Transform's local space where some calculations are performed to effect its visual output. However, I'm a bit confused by how an exposed Transform property is handled with the VFX Graph.

    I was expecting to find a slot for a Transform in the inspector, but instead its broken out to the three separate components (TRS). Ok so I have to write a script to pass in the values? No obvious way to even know what the property names to assign the Vector3's to. I had to put the inspector in Debug mode and crawl through the property sheet to find the names ( TransformPropertyName_position, TransformPropertyName_angles, TransformPropertyName_scale).

    Ok... I'm assigning the values successfully now. I can see them change in the inspector. So far so good-ish.

    Now I pass the particle position attribute and my transform property into a Transform (Position) node and I take the output y position and visualize it with something like this (goes to attribute color): upload_2020-1-17_17-49-22.png

    What I get is not what I expect. The black to white gradient moves in the opposite direction I expect it to when I move the linked Transform up and down in my scene. When I rotate the Transform, it also behaves unexpectedly as if the pivot point is somewhere else? Kind of hard to tell. Anyways, this all seems pretty straightforward, but the wonky way that I had to go about getting the information from a Transform into the VFX graph has me thinking that maybe Transform-related nodes might not work how I expect or something is just off here.

    Any thoughts?
     
  21. Aaron-Meyers

    Aaron-Meyers

    Joined:
    Dec 8, 2009
    Posts:
    305
    Lol ok... minutes later, I figured it out... inverted the transform first and now it works as expected!
     
  22. iamarugin

    iamarugin

    Joined:
    Dec 17, 2014
    Posts:
    883
    How to disable Play On Awake?
    Every time I disable camera and reenable it, particles start playing. How to avoid this behavior? I want to enable/disable particles from the code.
     
    angelomoro likes this.
  23. Olmi

    Olmi

    Joined:
    Nov 29, 2012
    Posts:
    1,553
    @iamarugin,
    Have you considered just enabling/disabling the GameObject your Visual Effect script is applied to? I've used it that way, not sure if it's correct but then again, there's not that much documentation.
     
  24. id0

    id0

    Joined:
    Nov 23, 2012
    Posts:
    455
    I can send events to VFX. OK. But how can I do opposite? Say, play audio when effect start burst? I mean periodic burst, it is not I just can play sound on start.
     
  25. andybak

    andybak

    Joined:
    Jan 14, 2017
    Posts:
    569
    What triggers the burst?
     
  26. id0

    id0

    Joined:
    Nov 23, 2012
    Posts:
    455
    andybak what do you mean? Just a periodic burst with random delay.
     
  27. angelomoro

    angelomoro

    Joined:
    Sep 4, 2018
    Posts:
    13
    Hei! I was wondering how to debug a variable from the Visual Effect Graph.
    I'm looking what's inside the Attribute particleId, since I need this variable to access at a specific particle within the system.

    Thanks :)
     
  28. andybak

    andybak

    Joined:
    Jan 14, 2017
    Posts:
    569
    I played around with having a "Debug Output Block" which is basically just set up with a flipbook texture containing the numbers 0 - 99.
     
    angelomoro likes this.
  29. andybak

    andybak

    Joined:
    Jan 14, 2017
    Posts:
    569
    That's exactly what I was asking.

    So - you've got a random delay and the random value is generated inside the particle system, right?

    But you can't trigger stuff in C# because (currently) you can't get values out of a particle system.

    So - instead of generating the random value inside the particle system, generate it in C# and feed it into the particle system. This is easy and obviously getting this event to trigger a C# script is also easy.
     
  30. JulienF_Unity

    JulienF_Unity

    Unity Technologies

    Joined:
    Dec 17, 2015
    Posts:
    326
    Edition mode is the compilation mode used when editing a vfx asset, it allows to be able to modify all values in the graph without recompiling. This is the mode used when working on an asset. When the asset is compiled for runtime (when not being edited) it is complied in runtime mode and all values that are not accesible from outside are folded and optimized out. This reduces the amount of expressions to evaluated and uniforms to pass to shaders.

    We don't handle Unity colliders at the moment in VFX Graph. This is because simulation happens on GPU and Unity physics engine is on CPU. For collision with environment in VFX Graph, you have 3 choices atm:
    • Depth buffer collisions
    • Bake part of your scene in SDF
    • Use simple primitives
    This is a feature that will be available in 2020.1. You will be able to output events from VFX Graph to your C# code. Just CPU events though (from spawners) not GPU events from particles yet.
     
    Neogene and id0 like this.
  31. angelomoro

    angelomoro

    Joined:
    Sep 4, 2018
    Posts:
    13
    Thanks for the reply.

    So do you use this block as debug? And then creating a 10x10 texture?

    upload_2020-1-22_18-31-50.png
     

    Attached Files:

    Last edited: Jan 23, 2020
  32. andybak

    andybak

    Joined:
    Jan 14, 2017
    Posts:
    569
    Yep. You could probably also do it via just the digits 0-9 and some blocks to work out the right placement.

    A bit more crazy would be to generate the characters directly via https://github.com/IxxyXR/Text-VFX
     
  33. DepreCats

    DepreCats

    Joined:
    Jun 3, 2016
    Posts:
    39
    Is the VFX graph compatible with custom SRPs yet?
     
  34. saahaajcool

    saahaajcool

    Joined:
    Jan 25, 2020
    Posts:
    2
    I am trying to generate particles from what camera sees. The idea is to spawn particles from objects based on their depth. or just at the areas from whatever is in front.

    I tried creating a simple render texture from camera ( the silhouette) and feeding in position map but that didnt work. any examples or how would you go about it?
     
  35. BluShine

    BluShine

    Joined:
    Aug 19, 2013
    Posts:
    5
    The "orient" block for "Output ParticleStrip Quad" nodes seems broken. No matter how I change the Orient settings, the strip quads will always face towards the camera.


    I'm trying to create some nice wide trail effects. Imagine a tire track going along the ground, a corkscrewing ribbon in the air, or a glowy arc behind a lightsaber. From a top-down view, this looks fine:

    But from a side view, it looks pretty crappy. You can see the parts where the trail twists around awkwardly, and you can even see jagged edges clipping through the ground.


    I'm on Unity 2019.3, VFX graph 7.1.7, default render pipeline. The screenshots are taken from the example project that I've attached.

    Is this a known issue, and is there a workaround or plans to support this feature soon? I tried accomplishing a similar thing with Shuriken particle trails, but it just wasn't flexible enough for everything I want to do. Right now, I'm gonna have to go back to the good old LineRenderer, which works fine but obviously won't let me render bazillions of trails at once.
     

    Attached Files:

  36. JulienF_Unity

    JulienF_Unity

    Unity Technologies

    Joined:
    Dec 17, 2015
    Posts:
    326
    Orient is not working with Strip outputs and wont be because the particle in strips need to always be oriented with respect to neighbours so that strip tangents are correct. To then derive the face vector, the default behaviour is to use the direction to eye to orient the front vector of the particle (but stll with the constraint of being on the plane normal to the tangent). You can override this behaviour via a toggle in the output inspector named "custom orient" or something like this. (If you dont have it, you probably have a too old version of VFX Graph package).
     
    laurentlavigne and BluShine like this.
  37. Deleted User

    Deleted User

    Guest

    Hi.
    Any tips on how to use a Depth Buffer based collision, please?
    I have a camera with a almost top view and I just want falling particles to stop on the surface.

    I use URP and noticed the option to use main camera in collision, which is, well, convenient. So it's just ignore everything in scene at any angle and settings setup I choose.
    But VFX clearly got it's link to main camera and uses its parameters - when I change camera clipping planes settings it's clamped properly, but particles falling trough anything anyway.
    At the same time in shader graph effects with depth work absolutely fine. Differend types of VFX collissions works fine too.

    Also, running on Unity 2020.1a20, VFX graph and URP versions both 7.1.8. Windows 10 64bit, nVidia GTX 750.
     
  38. BluShine

    BluShine

    Joined:
    Aug 19, 2013
    Posts:
    5
    Thanks, I managed to get this to work. The toggle is called "Use Custom Z Axis" if anyone else is searching for it. I wish the toggle was more obvious. I feel like it should automatically override the default strip behavior if the user adds the Orient block.

    I played around with some of the different Orient settings, and most of them felt quite squirrelly and had strange visual artifacts at certain camera angles. Orient: Advanced worked quite well, though. I was able to get a nice flat strip with these settings. I'm using this on a Spawn Over Distance strip, to get a sort of tire-tracks effect.
     
  39. saahaajcool

    saahaajcool

    Joined:
    Jan 25, 2020
    Posts:
    2
    Hi Any context on how to generate RenderTexture for position in vfx graph containing depth of the objects the camera is seeing..?
     
  40. JulienF_Unity

    JulienF_Unity

    Unity Technologies

    Joined:
    Dec 17, 2015
    Posts:
    326
    Yes keep in mind, particle strips are in experimental stage and still need to be improved. In 7.2.0 we'll fix and add various things. Orientation mode for strips will be reworked and should be more straighforward
     
    BluShine likes this.
  41. bjedlowski97

    bjedlowski97

    Joined:
    Feb 13, 2018
    Posts:
    46
    Is it possible to make particle change color based on distance from the main camera?
     
  42. JulienF_Unity

    JulienF_Unity

    Unity Technologies

    Joined:
    Dec 17, 2015
    Posts:
    326
    There's an node called "main camera". Just use a distance operator between the position of the main camera and the particle position and use it to drive the particle color in any way you want.
     
  43. kevdome3000

    kevdome3000

    Joined:
    Jun 9, 2019
    Posts:
    17
    To the VFX gods who inhabit this forum, I need your help.

    (Just an FYI, I'm a total newb, so please keep that in mind when responding so we can limit the back and forth.)

    Keijiro posted a repo a few weeks back (https://github.com/keijiro/ProcCharVfx), and I'm trying to recreate a vfx setup he had.

    Here is video of the desired effect:

    https://www.dropbox.com/s/9a5j7r5e79g0sb7/example.mov?dl=0
    (you can also see the vfx graph and shadergraph vfx asset used below.)

    I am looking to emulate this effect but instead of outputting procedural characters, I'd like the output to be text (TMP 3D text preferred). The idea is to feed the graph words, one character at a time, so I'm getting the typing effect with the visual eye candy as the output. An approach to consider, at least from what I've gathered through research, would be to select the proper character from the TextMeshPro Font Atlas and pass the geometry to the shader graph vfx asset, then use position coordinates to pass to the vfx graph. Seems feasible? I've tried to implement this myself, but haven't been able to make progress. If I'm totally off, please point me in the right direction.

    Thanks in advanced :)

    Screen Shot 2020-01-28 at 6.00.53 PM.png Screen Shot 2020-01-28 at 6.02.06 PM.png
     
  44. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,325
    isn't that stuff normally at the shader level ? it'd create 10000 frame flipbook... poor vram
     
  45. JulienF_Unity

    JulienF_Unity

    Unity Technologies

    Joined:
    Dec 17, 2015
    Posts:
    326
    The idea behind having an additionnal motion vector flipbook is on the contrary to be able to have a lot smoother flipbook animation with less frames. The motion vector map generally does not need to be high resolution.

    We've added motion vector interpolation mode at runtime in VFX Graph but not the motion vector map generation yet and an external tool has to be used at the moment.
     
    laurentlavigne likes this.
  46. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,325
    I see, that makes more sense.
     
  47. L4Z3RC47

    L4Z3RC47

    Joined:
    Jun 21, 2015
    Posts:
    46
    Anyone else getting these annoying UI glitches when using VFX graph with a camera using a solid background color?

    #bug
     
  48. bjedlowski97

    bjedlowski97

    Joined:
    Feb 13, 2018
    Posts:
    46
    I am making a lightning vfx with my coder friend, what could I do in my vfx graph to help with making it possible to the lightning can bounce between enemies
     
  49. bolska

    bolska

    Joined:
    Jul 19, 2018
    Posts:
    8
    I am trying to use the vfx with the new 2D Renderer, but All my effects are invisible with the 2D renderer .Can someone help me?
     
  50. andybak

    andybak

    Joined:
    Jan 14, 2017
    Posts:
    569
    You could potentially do most of that using the VFX graph.

    Do some tutorials and come back when you have a specific question you're stuck on.
     
Thread Status:
Not open for further replies.