Search Unity

Feedback Wanted: Visual Effect Graph

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

  1. arionarcama

    arionarcama

    Joined:
    Apr 25, 2017
    Posts:
    3
    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:
    267
    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:
    34
    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:
    95
    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:
    267
    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:
    56
    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:
    56
    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:
    1
    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:
    78
    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:
    267
    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:
    78
    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:
    9
    I have Unity 2019.1.8f1, but:
    What's can be wrong?
     
  15. andybak

    andybak

    Joined:
    Jan 14, 2017
    Posts:
    267
    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:
    216
    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:
    216
    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:
    9
    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:
    267
    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:
    216
    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:
    216
    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:
    288
    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:
    625
    @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:
    349
    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:
    267
    What triggers the burst?
     
  26. id0

    id0

    Joined:
    Nov 23, 2012
    Posts:
    349
    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:
    267
    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:
    267
    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:
    95
    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 at 8:49 AM
  32. andybak

    andybak

    Joined:
    Jan 14, 2017
    Posts:
    267
    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. Jovssen

    Jovssen

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

    saahaajcool

    Joined:
    Saturday
    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:
    2
    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:
    95
    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).
     
    BluShine likes this.
  37. SiriusRU

    SiriusRU

    Joined:
    Sep 29, 2018
    Posts:
    25
    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:
    2
    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:
    Saturday
    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:
    95
    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
     
unityunity