Search Unity

  1. Unity 2020.1 has been released.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Feedback Wanted: Visual Effect Graph

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

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

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,433
    I think I saw them working on a fix for this at some point in recent weeks on github.

    You may well need to be on Universal Render Pipeline & Unity 2019.3 for it though:

    https://github.com/Unity-Technologies/ScriptableRenderPipeline/pull/4612
     
    kkrg001 likes this.
  2. blai30

    blai30

    Joined:
    Aug 18, 2015
    Posts:
    8
    Hi, is it possible to get Lit Output nodes in VFX Graph using LWRP? I'm on Unity 2019.2.6 and LWRP 6.9.1. VFX Graph is also 6.9.1.

    I know it's possible to have Lit Output nodes using HDRP but what about LWRP?

    Thanks
     
    kevdome3000 likes this.
  3. andybak

    andybak

    Joined:
    Jan 14, 2017
    Posts:
    403
    I agree. It seems like a strange limitation. Is it arbitrary or is there a solid technical reason why it wouldn't be simple?

    I've got several VR demos and experiments using HDRP for no other reason than the need for lit particles.
     
    Lars-Steenhoff likes this.
  4. MrPaparoz

    MrPaparoz

    Joined:
    Apr 14, 2018
    Posts:
    80
    I can relate. It's absurdly plain limitation which shouldn't be, imho.
     
  5. unity_za9Qi-bWJOSMPA

    unity_za9Qi-bWJOSMPA

    Joined:
    Sep 30, 2019
    Posts:
    2
    Is it possible to read Particle data/attributes in the Shader Graph with the new VFX shader?
    Trying to create a flipbook player in the Shader Graph based on particle age.
     
  6. andybak

    andybak

    Joined:
    Jan 14, 2017
    Posts:
    403
    QUOTE="unity_za9Qi-bWJOSMPA, post: 5015321, member: 3753368"]Is it possible to read Particle data/attributes in the Shader Graph with the new VFX shader?
    Trying to create a flipbook player in the Shader Graph based on particle age.[/QUOTE]

    If you grab Unity 2019.3.0b4 and 7.1.2 of Shader Graph/HDRP/VFX Graph then yes.

    You don't read VFX Graph particle data in Shader Graph - instead you set exposed Shader Graph properties in VFX Graph.

    (Question - what are you trying to do that the built in flipbook in VFX Graph doesn't do?)
     
    unity_za9Qi-bWJOSMPA likes this.
  7. unity_za9Qi-bWJOSMPA

    unity_za9Qi-bWJOSMPA

    Joined:
    Sep 30, 2019
    Posts:
    2
    WOW SO EASY! Thanks!

    I find the flipbook to be well made in the VFX graph, what I'm looking to do is mainly other custom things.

    1. Create some fake light light effect. (No lit particles in URP)
    2. Other color changes/effects that I just find easier to do with the shader graph.
     
  8. sergiusz308

    sergiusz308

    Joined:
    Aug 23, 2016
    Posts:
    114
    Hi there, VFX graph effect shows black texture for particles in editor and gameplay mode. However texture is displayed properly in effect preview window - how to fix this?

    Editor / gameplay:
    vfx_not_working_1.jpg

    Preview:
    vfx_not_working_2.jpg
     
  9. mouurusai

    mouurusai

    Joined:
    Dec 2, 2011
    Posts:
    342
    If you use HDRP, multiply color by 100500. It's caused by light exposure control.
     
  10. sergiusz308

    sergiusz308

    Joined:
    Aug 23, 2016
    Posts:
    114
    Thanks for the tip.

    That's interesting - this black thing happening for unlit quad. When I picked lit quad output texture is visible.

    Shouldn't be unlit material unaffected by the exposure/light settings?
     
  11. mephistonight

    mephistonight

    Joined:
    Dec 14, 2016
    Posts:
    75
    This might be a stupid question but it has me a bit stumped:

    In the Lit Quad Output context of the Grass VFX graph sample, there are nodes such as "Add Target Position from Map", that samples a noise texture to bend the grass as wind. However, I can't seem to find the node 'Add Target Position from Map' when I try to recreate this graph. It also doesn't show up when I search for it in the sample project itself even though it's right there in the graph!

    Anyone have any ideas?
     
  12. sergiusz308

    sergiusz308

    Joined:
    Aug 23, 2016
    Posts:
    114
    One more thing: checking "Use Soft Particles" makes particles disappear - any ideas?
     
  13. andybak

    andybak

    Joined:
    Jan 14, 2017
    Posts:
    403
    There's quite a few block variants not listed. If you select a block then there are usually several dropdowns in the inspector that modify it's behaviour and create these "variants".

    I guess Unity felt there would have been too many to list but it's a bit confusing until you figure it out.
     
    mephistonight likes this.
  14. mephistonight

    mephistonight

    Joined:
    Dec 14, 2016
    Posts:
    75
    You're a life saver! Thank you for replying. If I add a 'Set Target Position from Map' in the graph and then select it, I can change its behaviour in the inspector from 'overwrite' to 'add'.

    Thanks again.
     
  15. sergiusz308

    sergiusz308

    Joined:
    Aug 23, 2016
    Posts:
    114
    What about these soft particles - is it only me or it's a general problem, that it does not work, with current HDRP version?
     
  16. florianhanke

    florianhanke

    Joined:
    Jun 8, 2018
    Posts:
    265
    Is it possible to expose a PointCacheAsset parameter?

    Screenshot 2019-10-02 at 22.18.00.png

    I'm generating point caches automatically based on the terrain data, for positioning grass on the terrain using the Effects Graph. This works well, but I'd like to have it as a parameter, so I can plug in various terrains (levels/scenarios).

    Thanks in advance!
     
  17. sergiusz308

    sergiusz308

    Joined:
    Aug 23, 2016
    Posts:
    114
    Hello there, what about these soft particles? Am I supposed to do anything more than just checking "soft particle" checkbox to make it work? Right now I am doing it and particles not rendering at all.

    I don't know what to do, basically day-as-usual with Unity "experimental" features released to the public and advertised hell out of it: new, shiny stuff what does not work, no documentation, no support - I got it already, that can be fun, for a while, but now I need to actually know is it broken, am I doing anything wrong, or there is just some secret kung-fu required to make it work?

    @ThomasVFX Would really appreciate any help here.
     
  18. JulienF_Unity

    JulienF_Unity

    Unity Technologies

    Joined:
    Dec 17, 2015
    Posts:
    185
    Point cache cannot be exposed yet unfortunately. You can however exposed each attribute maps and point count individually.
     
    florianhanke likes this.
  19. JulienF_Unity

    JulienF_Unity

    Unity Technologies

    Joined:
    Dec 17, 2015
    Posts:
    185
    We havent noticed issues with soft particles. Do you have more information (version, srp...) about that issue ? Maybe a minimal repro too.

    What happens if you set the soft particle distance to very low ?
     
    Last edited: Oct 4, 2019
  20. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,379
    Is this planned for the future? I have a similar use case where I need multiple point caches used with the same graph.
     
    savorygreatness likes this.
  21. andybak

    andybak

    Joined:
    Jan 14, 2017
    Posts:
    403
    Can't you achieve the same thing with position maps via an exposed texture?
     
  22. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,379
    You can if you only want positions baked in. But if you have additional per particle data it is nice to have the wrapper of the point cache, exposing all the data nice in the inspector. No need to bake and assign multiple textures. You also need to set width/height of the textures for sampling the correct point etc. Works without just much nicer if the point cache could be assigned.
     
  23. sergiusz308

    sergiusz308

    Joined:
    Aug 23, 2016
    Posts:
    114
    HDRP 6.9.1
    VFXG 6.9.1
    SRP 1.5.2
    Unity 2019.2.6f1

    Geforce GTX 1050

    As for repro it does not matter is it just sample graph or created by me - behaviour is all the same.
     

    Attached Files:

  24. sergiusz308

    sergiusz308

    Joined:
    Aug 23, 2016
    Posts:
    114
    Couple of general / guideline kind of questions about using multiple instances of VFXG.

    I saw in one of the presentations that output can render multiple effects at different positions the same time - what's the limit here? By "limit" I mean is this designed to work with dozens, hundreds or thousands of provided positions?

    When I want to populate scene with multiple instances of the same graph - I just instance game object with the visual effect attached or there's a more optimized way to do it (like using position parameters for the output)? Not asking about general performance optimization techniques just if there's any special care that should be taken for the VFX.

    When I am instancing visual effects in a such a way - how to know that effect is done playing, so I can remove it / return to the pool? For non-looping effects of course.

    Also please explain this documentation bit - is this a mistake (that "play" method stops spawning)?

    upload_2019-10-7_14-40-14.png

    Thanks!
     
  25. mephistonight

    mephistonight

    Joined:
    Dec 14, 2016
    Posts:
    75
    Hi,

    I'm experimenting with the VFX graph and attempting to change the mesh of the Lit Mesh Output based on the distance of the attribute's position from 0, 0, 0. Kind of like in the screenshot of the graph section attached.

    However, when I try this, I get the following error, which I'm struggling to understand.
    Is anyone familiar with what I'm doing wrong here?

    Thanks,
    M


    Exception while compiling expression graph: System.InvalidOperationException: Unable to compute CPU expression for mapping : mesh
    at UnityEditor.VFX.VFXDataParticle.FillDescs (System.Collections.Generic.List`1[T] outBufferDescs, System.Collections.Generic.List`1[T] outSystemDescs, UnityEditor.VFX.VFXExpressionGraph expressionGraph, System.Collections.Generic.Dictionary`2[TKey,TValue] contextToCompiledData, System.Collections.Generic.Dictionary`2[TKey,TValue] contextSpawnToBufferIndex, System.Collections.Generic.Dictionary`2[TKey,TValue] attributeBuffer, System.Collections.Generic.Dictionary`2[TKey,TValue] eventBuffer, System.Collections.Generic.Dictionary`2[TKey,TValue] effectiveFlowInputLinks) [0x00874] in C:\Users\m\Documents\m\Library\PackageCache\com.unity.visualeffectgraph@6.9.1-preview\Editor\Data\VFXDataParticle.cs:609
    at UnityEditor.VFX.VFXGraphCompiledData.Compile (UnityEditor.VFX.VFXCompilationMode compilationMode, System.Boolean forceShaderValidation) [0x00748] in C:\Users\m\Documents\m\Library\PackageCache\com.unity.visualeffectgraph@6.9.1-preview\Editor\Compiler\VFXGraphCompiledData.cs:905 : at UnityEditor.VFX.VFXDataParticle.FillDescs (System.Collections.Generic.List`1[T] outBufferDescs, System.Collections.Generic.List`1[T] outSystemDescs, UnityEditor.VFX.VFXExpressionGraph expressionGraph, System.Collections.Generic.Dictionary`2[TKey,TValue] contextToCompiledData, System.Collections.Generic.Dictionary`2[TKey,TValue] contextSpawnToBufferIndex, System.Collections.Generic.Dictionary`2[TKey,TValue] attributeBuffer, System.Collections.Generic.Dictionary`2[TKey,TValue] eventBuffer, System.Collections.Generic.Dictionary`2[TKey,TValue] effectiveFlowInputLinks) [0x00874] in C:\Users\m\Documents\m\Library\PackageCache\com.unity.visualeffectgraph@6.9.1-preview\Editor\Data\VFXDataParticle.cs:609
    at UnityEditor.VFX.VFXGraphCompiledData.Compile (UnityEditor.VFX.VFXCompilationMode compilationMode, System.Boolean forceShaderValidation) [0x00748] in C:\Users\m\Documents\m\Library\PackageCache\com.unity.visualeffectgraph@6.9.1-preview\Editor\Compiler\VFXGraphCompiledData.cs:905
    UnityEditor.EditorApplication:Internal_CallUpdateFunctions()
     

    Attached Files:

    Last edited: Oct 8, 2019
  26. alexandre-fiset

    alexandre-fiset

    Joined:
    Mar 19, 2012
    Posts:
    455
    Wouldn't it be nice to have a specific section of the forums for discussing the VFX graph?

    This is a 16-pages mess and there are a lot of questions that need their own thread to not get lost in this sea of information :)
     
    andybak and mephistonight like this.
  27. andybak

    andybak

    Joined:
    Jan 14, 2017
    Posts:
    403
    Apparently we should request this in a meta forum. It strikes me as a bit strange that none of the mods or forum managers would cover this but hey... At least the forums are less of a wreck than Unity Answers (which seems like "Stack Overflow run by people that have never used Stack Overflow"...)
     
  28. andybak

    andybak

    Joined:
    Jan 14, 2017
    Posts:
    403
    Errors aside - I don't think that will work unless you're using multiple Output blocks. Simply modifying the mesh of a single Output changes all particles using that Output.
     
  29. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,433
    Well posting about it in the meta-forum was just a suggestion by me, I dont know if it will work.

    I doubt mods and community/forum managers have the power to unilaterally make such decisions themselves. There will be whatever Unity management decision making process they have in place for this sort of thing.

    Paging @UnityMaru as you were the helpful, friendly community manager who brought us the forums for URP and HDRP. Whats the story with a subforum for VFX Graph please? Cheers :)
     
    andybak likes this.
  30. mephistonight

    mephistonight

    Joined:
    Dec 14, 2016
    Posts:
    75
    That makes sense given it's instancing. I had hoped (though probably unreasonably) it would just interrupt the drawing and start a new call. I guess LOD'ing a mesh that's at a fixed point in space using the VFX graph is probably asking it to do something it's not designed to do.

    Thanks for your reply.
     
  31. andybak

    andybak

    Joined:
    Jan 14, 2017
    Posts:
    403
    I wasn't having a dig at you. It's just a tiny bit disheartening that there's nobody to spot a 16 page thread and do something about it - without being asked.

    Or rather - even with being asked several times.
     
  32. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,433
    Don't worry I didnt take it that way, I was just saying it was only a suggestion because I can't actually claim it is certain to get a result.

    Although whole topics being crammed into one long thread is not ideal, the length of the thread isnt really what triggered my interest in there being a subforum for the VFX Graph right now - for me its because VFX Graph is coming out of preview in 2019.3 so this graphics experimental preview forum wont be the right place for it any more.
     
  33. sergiusz308

    sergiusz308

    Joined:
    Aug 23, 2016
    Posts:
    114
    @ThomasVFX - guys, c'mon, some help maybe? It's basic stuff and it's not covered anywhere and it's not working.

    I also posted details on broken soft particles - anyone cares to help?
     
  34. nonnicram

    nonnicram

    Joined:
    Apr 3, 2014
    Posts:
    20
    Hey Folks,

    has someone an solution how to draw vfx particles in combination with an procedural sky? Somehow they don`t work together. My idea would be to set the render queue of the vfx shader to maybe "5000". But i can`t make changes in the vfx shader (Hidden/VFX/System 1/Quad). It doesn`t save the changes in the code.
    Could this be an solution or has someone other ideas? Maybe with the Rendering Layer Mask of the VFX Component? Could also not get it to work.
    Thanks for every tip!
    Cheers, Marc
     
  35. xDavidLeon

    xDavidLeon

    Joined:
    Jun 9, 2014
    Posts:
    103
    Each time I try to modify a VFX Graph it throws me this error:

    upload_2019-10-15_16-32-47.png

    The VFX Graph only gets properly "updated" if I click on Save Project.

    I'm using Unity 2019.3.0b6 and Vissual Effect Graph 7.1.2
     
  36. Olmi

    Olmi

    Joined:
    Nov 29, 2012
    Posts:
    1,103
    @xDavidLeon I just updated to 2019.3.0b6 and to the latest VFX Graph two days ago and noticed that at least in the project I created value changes etc. don't update on the screen in the scene as they used to on 2018.x. i.e. if I change effect parameters, they don't seem to get applied.

    I have to save project or disable/enable blocks in VFX Graph editor to get the changes visible.
     
  37. Reddevildragg

    Reddevildragg

    Joined:
    May 19, 2014
    Posts:
    42
    Does anyone know if there is (or planned to be) a way of figuring out if a particle is infront of the camera and as such is being rendered? Im trying to kill points that are behind the camera so they can be used to create a denser point infront of the camera (working with position maps of millions of points).

    Any help with this would be welcomed :)
     
  38. TheRealGrendel

    TheRealGrendel

    Joined:
    Jun 17, 2016
    Posts:
    4
    Hello! I'm looking for a way to change the render order layer of the particles. Right now I have two systems spawning from one event and I'd like to place the one which spawns last behind everything. I've looked though this forum and I can't seem to find any solutions for this. I'm basing my searches off of Shuriken's Order in Layer integer. Is it possible to do this, or will this feature be added later on?
     
  39. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,433
    There is an output render order list in the inspector for the .vfx file.

    I havent actually used it myself yet, but I saw it at the end of this tutorial, from the 11 minute point onwards:

     
    TheRealGrendel likes this.
  40. TheRealGrendel

    TheRealGrendel

    Joined:
    Jun 17, 2016
    Posts:
    4
    This worked perfectly, thank you!
     
    elbows likes this.
  41. ManaWorksKirill

    ManaWorksKirill

    Joined:
    Oct 15, 2019
    Posts:
    14
    I would the particle flip book frame rate to speed up when the particle slows down. The setup below is doing the opposite, the frame rate slows down when the particle slows down.

    upload_2019-10-17_11-42-6.png

    Thank you.
     
  42. Olmi

    Olmi

    Joined:
    Nov 29, 2012
    Posts:
    1,103
    @ManaWorksKirill I think you could use InverseLerp, not sure when it was added (was it always in VFX Graph?) but at least on 2019.3 there's an inverse lerp block. With that you can get proportionally (or atleast something to that direction...) larger values as the velocity goes down.
     
  43. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    3,199
    One thing I was kind of hoping for from VFX graph, compared to the standard particle system, was per-particle depth. That is, that the individual particles from two different systems could independently be in front or or behind the other particle, rather than it being all-or-nothing with all particles in the system.

    For example, here are two distinct VFX graphs. You'll note that the "B" particles are always in front of the "A" particles, even though they're actually moving in all directions:

    VFX.gif

    If I move the "A" VFX graph a tiny distance closer to the camera, now instead all the "A" particles are on top:

    VFX2.gif

    I'd been hopeful that with VFX graph, there might be some improvement to this, so that the actual position of each particle was used rather than the average position of the whole system (or whatever it's using.) Is there any possibility of this kind of behavior being added in the future? Or is it just considered too costly to track the relative positions of all the particles?
     
  44. andybak

    andybak

    Joined:
    Jan 14, 2017
    Posts:
    403
  45. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    3,199
    Thanks, I'll look into that. I'm still learning VFX Graph, and I'm unfamiliar with most of its behaviors. The link you provided mentiones "GPU Sorting for per particle sorting", which sounds like what I'm looking for. Not sure if it's available under 2019.1's version of VFX Graph, or whether it's a newer feature, but I'll dig deeper. Thanks.
     
  46. EddieChristian

    EddieChristian

    Joined:
    Oct 9, 2012
    Posts:
    708
    So I am just getting started with the VFX Graph and looking online at a few videos. One thing I noticed was people using "Lit Quad Output". But in 2019.2.6 in the Universal/Lightweight pipeline this doesn't seem to exist. Am I missing something???
     
  47. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,433
    Universal only supports unlit VFX Graph output at the moment. A lot of tutorials etc use HDRP, which is why they are able to use lit output nodes.
     
    EddieChristian likes this.
  48. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,379
    I had a look at the new Visual Effect Master node in the shader graph.
    It looks good and I like they way the properties integrates in the VFX Graph.

    Does anyone know if there is a plan to allow for vertex manipulation also? I have some meshes I would like to animate in the vertex shader while using the VFX graph.

    Image 280.png
     
    Lars-Steenhoff likes this.
  49. Little_Narwhal_13

    Little_Narwhal_13

    Joined:
    Feb 6, 2017
    Posts:
    15
    I want to make an audiovisualization with a swarm particle system, and ive got an array of vectors sampled around a sphere all corresponding to a certain range of frequency. The problem I have is converting this array of vectors into a vectorfield (or maybe there is another way) so that the particles are attracted to points on the sphere depending on how present the corresponding point's frequency is in the sound currently playing.
     
  50. pbritton

    pbritton

    Joined:
    Nov 14, 2016
    Posts:
    74
    Is there an option to disable looping and setting overall duration?
     
Thread Status:
Not open for further replies.
unityunity