Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Join us on Dec 8, 2022, between 7 am & 7 pm EST, in the DOTS Dev Blitz Day 2022 - Q&A forum, Discord, and Unity3D Subreddit to learn more about DOTS directly from the Unity Developers.
    Dismiss Notice
  3. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

Feedback [2021.2] Some feedback about VFX graph

Discussion in 'Visual Effect Graph' started by Qriva, Aug 6, 2021.

  1. Qriva

    Qriva

    Joined:
    Jun 30, 2019
    Posts:
    741
    I want to spill some feedback related to VFX graph.
    Everything is based on Unity 2020.3, so if something has been already implemented/fixed in 2021 then just ignore it. Also I excluded from the list most of the things that are already known or planned.



    It would be very nice if it was possible to add an empty subgraph without drag and drop from project files. There is an “Empty Operator Subgraph” node, but there is no “Empty Subgraph” with asset selection slot. Currently to add some subgraph I must search the project for it.

    ExposedProperty is a small, but very nice and handy addition. In my opinion there should be very similar helper in Mecanim (animator) and shader system. (I think both shaders and vfx uses the same hash method, so it could be part of main package)

    Separate inputs/outputs for channels - this is a really great feature that is missing in shader graph. In VFX graph I can easily connect single x, y, z channels or even swizzle them (xxx, zyx), while the shader graph is very bad in this (why???).

    Direction attribute is confusing. There is no documentation in Standard Attribute reference, so at the beginning I had no clue such a thing exists. The only mention about direction can be found in docs of nodes Position From Cone, Sphere, etc. It was even more confusing in 2019 when I wanted to set velocity based on the sphere surface. Above node names has no word ‘direction’ in the name, there was no documentation for nodes, so at that time it was magic for me.

    For some reason save asterisk (*) shows up in the graph window after opening it for the first time and other time there is none. Sometimes to save the graph I must press Save once, and other time it requires two clicks to get rid of the star. In short, save system behaviour is confusing/strange.

    It would be great if gizmos for properties and blocks were correct when space is changed between local and world.

    It might be required sometimes to change global VFX speed. There is an option to do so via VFXManager.fixedTimeStep, but it changes the value in project settings unlike Time.timeScale or fixedScale. Maybe there should be additional property for this?

    I still don’t know if shader keywords are supported in VFX graph and why Particle Output uses reference property names instead of names set in the shader graph, but improved display of properties would be amazing. Creating a custom property drawer for the shader used in Output Particle XYZ would be really great, but even simple categories/groups of properties would be a nice improvement.

    Global VFX properties - It might be useful if there was a way to set global properties for all graphs on scene or application. It sounds like a decent feature, but actually I am not so sure about that, because it can be “hacked” anyway.

    Local variables - I mean something like get/set attribute does, but for operator blocks. You can input to some variable and place the output anywhere you like (I think amplify and unreal has it). It would improve readability of more complicated graphs as it allows to avoid connections between operators and systems. The same applies to shader graph.

    Better crash debugging and info about errors - I experienced many, many crashes of Unity caused by VFX graph, but except log there is nothing that says what happened (but for me log is hard to read).
    I would report many bugs with reproduction steps if I knew what actually caused it. For example It looks like there are some reserved names that should not be used as graph property names - at least this is my conclusion after testing and searching for bug some time ago, but I still don’t know if this is true and there is no way to check it. If there are such things like reserved names it should be mentioned in docs.

    There is a missing tool to measure performance or debug particles (profiler). Sometimes I make more complicated operator blocks and I would like to debug if it produces the correct result. Other time it might be useful to see what is particle lifetime, id, rotation or anything else.

    VFX batcher - I know this is a planned feature, but I think it's a very important feature, that's why I want to mention it here.

    Alpha erosion in default shader. I know I can implement whatever I want in a custom shader graph, but I think alpha erosion is super common in VFX, so why not make dropdown to enable alpha erosion instead of default opacity fade?

    Recently I found this site https://vfxdoc.readthedocs.io/ made by @ThomasVFX and I think it is a piece of good work. It's a shame there is so much missing content currently, but despite this there is tons of useful information, so I wanted to say thank you for this initiative and effort you put so far to make it.

    The last thing, but very important is about technical support from dev side. I think someone said something similar already, but it would be way more difficult to use VFX graph without your help. Also maybe it's illusion, maybe they pay you better :p, but I think it is way easier to get answers here, than in other forum section, especially implementation details that only you can know and no one else. This opinion is not even based on my own threads, there are many helpful posts, you even provide images and gifs how to make or fix things.
    In short, I just feel like you care and this gives me positive experience. Keep it up and thank you!
     
  2. JulienF_Unity

    JulienF_Unity

    Unity Technologies

    Joined:
    Dec 17, 2015
    Posts:
    280
    Thanks a lot for having taken the time to write down your detailed feedbacks. It's very valuable for us.

    SG and VFX Graph are developed by 2 different teams and this explains some discrepancies between the tools. Node based tools is still quite recent at Unity and we're working to unify and bring more consistency across all node based systems in Unity (existing and to come)

    Agreed. We plan to improve that in the near future

    From 10.6, modified state should be a lot more consistent

    Not sure what you refer to exactly, Gizmos should already be in correct space. Probably a bug

    Agreed. VFX should have a serialized time scale.

    shader keywords are not yet supported. Shader graph integration is being improved and worked on from versions to versions

    Agreed. Could be useful

    This is similar to what we refer to as graph attribute in the roadmap: https://portal.productboard.com/uni...ndering-visual-effects/c/121-graph-attributes Basically having variables global to a graph. We also plan to improve "custom attributes" to give them a more defined scope (for instance local to a context)

    If you get a crash, reporting it is the best way to get it fixed yes.

    Yes we plan to add more debugging / profiling and helper tools. Such tools are being added from versions to versions

    This is one of our big focus for 2022

    We do have alpha threshold that can be animated in the graph already. For anything more "advanced", a shader graph should be used.

    Thomas has been working on that on his spare time. This has nothing to do with Unity. But he'll be glad you like it and it is useful.

    Thanks a lot for the kind words, the whole team appreciates :)
     
    landonth, Ruchir, NotaNaN and 4 others like this.
  3. Qriva

    Qriva

    Joined:
    Jun 30, 2019
    Posts:
    741
    Sorry, I just realized I described it in a wrong way. The issue is a bit more than drawing Gizmo:
    Let's say I want to rotate cone [Position From Cone] in world space. Fortunately, Vlad provided example how to do it with Transform node, but the thing is it happens "after" the cone block, so Gizmo is never rotated.

    cone1.png

    There is one more problem, direction is not rotated and when velocity is applied, particles will still go up (along the cone) and to fix this, direction must be transformed separately.

    cone2.png

    Currently I know how to rotate it, but I can imagine how problematic it could be for someone else, especially if we combine this with unclear direction attribute documentation. But even if this is possible to fix, it is not nice to work with and gizmo is still not rotated, so I would consider adding rotation to cone block (and other similar blocks), so there was no need to bother with transform, plus gizmo would be positioned and rotated correctly.
     
  4. JulienF_Unity

    JulienF_Unity

    Unity Technologies

    Joined:
    Dec 17, 2015
    Posts:
    280
    Ok, got it. This will be adressed soon in 21.2 as we're adding a transform field directly in the shape types.
     
    landonth and Qriva like this.
  5. Qriva

    Qriva

    Joined:
    Jun 30, 2019
    Posts:
    741
    I upgraded project to Unity 2021.2 and I would like to add some new feedback, mostly about new version:


    URP Decal Output - it's nice to have particle decals, there are obviously missing some features or docs, but one thing was extremely unintuitive and hidden to me: particle scale Z controlling decal box "depth". It is not explained anywhere and there is no gizmo, so it is hard to debug what is actually happening with particles or how far they can cast decal.

    Normally when I change node parameters like "Set Position" vector, visual effects are updated instantly on the scene. For some unknown reason at some point it stops working and any further changes are not updated, I must manually click save every time to recompile graph and see changes.

    EDIT: Graph window is sometimes not updated (desynchronized) when undo is performed, serialized values are reversed, but UI still displays old numbers.

    When I noticed shader graph property categories I really expected VFX graph output to consider them.
    Custom property drawer might be a bit too much, but it would be really great to have properties grouped by categories.

    Texture inputs in Particle Outputs do not reflect texture mode. If I set in shader graph black or white mode I expect to be the same in vfx graph, meanwhile any texture input set to "none" is gray, even without custom shaders. This behaviour is not just confusing (It took me a while to figure out why my particles are gray), but also not desired - there is reason these modes exist.

    I posted this in my other thread, but moved here: I think Simple Ribbon (System) template is broken currently, looks like someone forgot to clean up and it looks like this: https://i.imgur.com/3gPy9bH.png
    If that's not the case, then it might be related to this warning I get quite often:
    What is the current state of shader keywords support? I can't find anything on the roadmap.

    I think I am delusional and there was no such feature, but for some reason I believed that particle vertex color in primitive outputs was equal to particle color attribute. I don't know how particles are constructed under the hood, but would it be possible to initialize particle with vertex color or even update it every frame? Still, this is definitely just "nice to have" feature and not something very important.

    When block is added to context, the next connected context is moved down, but sometimes it does not work and for example Update is moved down while Output not and they overlap.

    What this warning means actually? Is that something I should care, what causes that.
    Particle strip lacks documentation. Ribbons are not complicated, but I would rather read docs for 10-15 minutes, than experimenting for one hour or more. Currently there is literally nothing about particle strips, except for a few snippets to indicate that there is such a thing.

    More gifs and great pages like 'Orient Particle' or 'Perlin Curl Noise' and less "hidden" undocumented attributes.
    (there are many undocumented options)

    What is the difference between shader graph with Visual Effect target and common Unlit URP graph with checked option "Support VFX"? Is there any significant difference?
     
    Last edited: Dec 1, 2021
  6. Vita-

    Vita-

    Unity Technologies

    Joined:
    Jul 2, 2019
    Posts:
    99
    Hi! Let me see, if we can clarify some things out here.

    Speaking of decal box, I think this is a valid point, will raise this to the team to see what we can do regarding this. :)

    Thanks for raising this! You are bumping into the issue where the runtime mode is being forced, it is fixed and is awaiting backport to 2021.2

    Are you speaking of categories in the Blackboard? Properties can be categorized in VFX Graph as well. Do not hesitate to clarify on this if I am missing something.

    It is fixed. Fix should be available in 2022.1 and 2021.2

    Not supported :p EDIT: There are plans to support Shader Keywords in the future

    Short answer - no. Here's the forum post containing the thorough answer with lots of visuals. If you have any additional questions or want to clarify something, let me know.

    It is fixed. Changes are available in 2022.1 currently, backport to 2021.2 is on its way.
    Yes, 100% agree. We are aware of this, strips are currently in a experimental state and gonna be worked on including docs.

    Visual Effect target is used for old SG Integration where you were able to access operations per fragment only.

    URP Target with Support VFX Graph is used for new SG integration which allows you to use URP shaders and access both fragment and vertex stages.

    Could you elaborate on this? What do you mean setting SG to black or white mode?

    We had many UI changes recently, possible that something left uncaught. I'll keep this in mind during testing passes. If by any chance you will catch this with reliable reproduction, please report a bug. And one question - what version are you using?


    __________
    And a huge thank you for the feedback and all the time and effort it took to write all this. I look forward hearing from you. :)
     
    Last edited: Jan 25, 2022
    NotaNaN, daneobyrd, PutridEx and 2 others like this.
  7. Qriva

    Qriva

    Joined:
    Jun 30, 2019
    Posts:
    741
    I mean I can categorize variables in shader graph and I expected these categories will show up in VFX graph or there will be at least some space between "groups". (Sorry, variables are out of order for some reason, not quite expected too)
    upload_2021-12-1_21-3-25.png

    This is sad, I think it would be great to have 2-3 checkboxes for variants instead of creating these variants manually.

    Does it mean that when I set VFX as target, then vertex stage will not work, but if I set URP target + VFX supporte enabled then the same shader is going to work (in vertex stage)? If thats the case it should be mentioned in docs or property tooltip.

    Oh my, sorry I ate the word :D I meant "shader graph texture to black or white mode", this is shader graph setup:
    upload_2021-12-1_21-21-11.png
    It should be white by default, meanwhile whatever it is custom shader or default one, when I do this:
    upload_2021-12-1_21-22-43.png
    The default color of texture is always gray when set to None.

    Unity 2021.2.3 and VFX Graph 12.1.1
     
  8. Vita-

    Vita-

    Unity Technologies

    Joined:
    Jul 2, 2019
    Posts:
    99
    Can agree on this, this is something nice to have, will forward to the team to discuss it.

    Yes that's how you could switch from VFX Shader Graph to URP/HDRP Shader Graphs and vice versa. When you switch to Visual Effect target you can see that Vertex Stack blocks with all the connected nodes are greyed out, but agree docs should reflect that to avoid confusion. Nice catch, will look into it :)


    Ah, this is an ancient issue where it fallbacks to grey texture when there's no texture assigned, there are plans to improve this. Speaking of Texture Mode will add a note to the raised issue so we could discuss it before implementation.

    _____
    Is there anything I've missed and you'd like to be discussed? :)
     
  9. Qriva

    Qriva

    Joined:
    Jun 30, 2019
    Posts:
    741
    Shader graph gets more and more features and I think it should be taken into account during the same cycle (and vice versa). As I mentioned the texture bug or categories, there is new checkbox for tiling and offset of textures and it's not taken into account in vfx graph. Not big deal (I can add it manually as property), but if I have shader for URP with VFX support enabled I would expect them to work in the same way, but in reality there will be no tiling/offset control in vfx graph.
    Also I think there are more tests required for shader graph integration, changing keywords and VFX support checkbox probably caused a lot of bugs you may be not aware. (It is quite common to get a lot of warnings and error logs in various situations, but most of them not related to VFX though)
    upload_2021-12-2_11-51-51.png

    EDIT: I want to propose one thing, there are ocurring some common problems and questions and many of them are already answered, but buried in depths of the forum or hard to google. I think it would be worth to create pinned thread or even better, whole page in documentation with simple examples of how to do certain things (this is good example), something similar to what Input System package have.


    Thank you for your time and attention :)
     
    Last edited: Dec 2, 2021
    Vita- likes this.
  10. Vita-

    Vita-

    Unity Technologies

    Joined:
    Jul 2, 2019
    Posts:
    99
    Speaking of ShaderGraph bit - will set up a playground for SG VFX to catch at least some of these nasty issues, thank you!

    Honestly, I find it so awesome and didn't know that Input System has such thing existing. Will look into it definitely!
     
  11. Qriva

    Qriva

    Joined:
    Jun 30, 2019
    Posts:
    741
    VFX Graph do not follow order of properties declared in shader graph. Order of properties is determined by their time of creation - this is really annoying and reduces readability, I added 'Tiling' property for texture and it landed between properties from completely different category.
    Display names are not used too, but this can be at least controlled by reference name.

    EDIT: I am not sure if everything works correctly in Output inspector in new SG integration.
    After adding both URP and visual effect target, information box appeared and it says it is deprecated and should not be used. Is VisualEffect target deprecated completely or it should not be used with URP target? If I made shader dedicated for VFX graph and I don't need vertex stage should I use visual effect target and or it should be always URP with support enabled?

    The thing is I made URP shader with VFX support enabled and this is how inspector looks like:

    There are two options "Cast Shadows", is first one overriding the second?
    I ticked and unticked one of them and then it disappeared and moved to the info box.
    Also why there is no sorting priority option, is it provided by visual effect automaticaly?
     
    Last edited: Dec 5, 2021
    Vita- likes this.
  12. koirat

    koirat

    Joined:
    Jul 7, 2012
    Posts:
    1,779
    I would definitely add one more thing. As I remember there were already some request about this.
    I'm talking about in graph I will call it portals or In/Out nodes.
    So we don't have to suffer from all the chaotic lines crossing eachother on the screen.
     
  13. Qriva

    Qriva

    Joined:
    Jun 30, 2019
    Posts:
    741
    According to Julien's post above it should be this (I hope):
    https://portal.productboard.com/uni...ndering-visual-effects/c/121-graph-attributes
    the funny part this feature is even more important in shader graph, but it's not even on their roadmap xD
     
  14. koirat

    koirat

    Joined:
    Jul 7, 2012
    Posts:
    1,779
    Theoretically you can use such a attribute to solve this problem, actually this is more expanded of a solution but less safe in a way since "portals" would allow only single input but multiple outputs.
    And since such an attribute is doing more, than I would assume a performance might be hurt.
     
  15. Vita-

    Vita-

    Unity Technologies

    Joined:
    Jul 2, 2019
    Posts:
    99
    That's correct. We have this information box because it is highly recommended to use SRP target + VFX Graph Support instead of Visual Effect Target.

    Depends on your needs, our recommendation is to use new SG integration. A tiny comparison:

    New SG integration (SRP + Visual Effect Support)
    - Allows access to both Fragment and Vertex Stage
    - Support every kind of material (in URP Decal and Sprite materials are not supported for now)

    Old SG integration (Visual Effect Target)
    - Lighting model is limited, we are tied to metallic worklfow
    - Operations per vertex are not allowed

    If Allow Material Override is ticked in the SG Graph Inspector, then Cast Shadows option of VFX Output gonna be overridden by SG Cast Shadows setting.

    ______
    Does this helped to clear things out a bit?
     
    Qriva and VladVNeykov like this.
  16. Qriva

    Qriva

    Joined:
    Jun 30, 2019
    Posts:
    741
    Yes, thank you for clarification about targets. About SG, I suggest to always hide the overriden values (checkbox) to avoid confusion in future.

    One more thing I found: when nothing is connected to position:cone it works as expected, but if there is conection to position, the gizmo stays in default zero position while white particles spawned correctly above. Also I don't unerstand why gizmo disappears completely when something is connected to single X/Y/Z slot or angle (as whole), I would expect to be able to change other parameters (like Top Radius) and still see the gizmo.
    upload_2021-12-8_0-16-37.png
     
  17. Vita-

    Vita-

    Unity Technologies

    Joined:
    Jul 2, 2019
    Posts:
    99
    Just tried tweaking gizmos on 2021.2.5f1 and cannot reproduce your mentioned behavior. Is there anything exotic in your setup or am I missing something? HSpKXK33Ol.gif
     
  18. Qriva

    Qriva

    Joined:
    Jun 30, 2019
    Posts:
    741
    I am still in 2012.2.3, but I made new system with similar setup, it worked, and then I did something and it bugged again. Once I copied block to other system and changing Arc cone space W/L lagged cone always in world position instead to local one and other time it worked ok. Sorry I can't find way to reproduce it from scratch, but I can give you graph, maybe this will help. https://drive.google.com/file/d/1eXjFTZvFATTuJeRurEmWuFzDHq2josCT/view?usp=sharing

    I noticed some things: Vector3 connected to position makes gizmo invisible, meanwhile Position makes it visible, but can't move. Certain combinations of connections produce different results. Also I got this error in console this time:
    Code (CSharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2. UnityEditor.VFX.UI.VFXDataAnchorGizmoContext+<>c__DisplayClass11_0.<BuildValue>b__3 (System.Collections.Generic.List`1[T] o) (at Library/PackageCache/com.unity.visualeffectgraph@12.1.1/Editor/GraphView/Elements/Controllers/VFXDataAnchorController.cs:742)
    3. UnityEditor.VFX.UI.VFXDataAnchorGizmoContext.get_value () (at Library/PackageCache/com.unity.visualeffectgraph@12.1.1/Editor/GraphView/Elements/Controllers/VFXDataAnchorController.cs:671)
    4. UnityEditor.VFX.UI.VFXGizmoUtility.Draw (UnityEditor.VFX.UI.VFXGizmoUtility+Context context, UnityEngine.VFX.VisualEffect component, UnityEditor.VFX.VFXGizmo gizmo, System.Boolean forceRegister) (at Library/PackageCache/com.unity.visualeffectgraph@12.1.1/Editor/Gizmo/VFXGizmoUtility.cs:237)
    5. UnityEditor.VFX.UI.VFXGizmoUtility.Draw (UnityEditor.VFX.UI.VFXGizmoUtility+Context context, UnityEngine.VFX.VisualEffect component) (at Library/PackageCache/com.unity.visualeffectgraph@12.1.1/Editor/Gizmo/VFXGizmoUtility.cs:172)
    6. UnityEditor.VFX.UI.VFXDataAnchorController.DrawGizmo (UnityEngine.VFX.VisualEffect component) (at Library/PackageCache/com.unity.visualeffectgraph@12.1.1/Editor/GraphView/Elements/Controllers/VFXDataAnchorController.cs:524)
    7. UnityEditor.VFX.UI.VFXNodeController.DrawGizmos (UnityEngine.VFX.VisualEffect component) (at Library/PackageCache/com.unity.visualeffectgraph@12.1.1/Editor/GraphView/Elements/Controllers/VFXNodeController.cs:272)
    8. VFXSlotContainerEditor.OnSceneGUI (UnityEditor.SceneView sv) (at Library/PackageCache/com.unity.visualeffectgraph@12.1.1/Editor/Inspector/VFXSlotContainerEditor.cs:191)
    9. UnityEngine.Debug:LogException(Exception)
    10. VFXSlotContainerEditor:OnSceneGUI(SceneView) (at Library/PackageCache/com.unity.visualeffectgraph@12.1.1/Editor/Inspector/VFXSlotContainerEditor.cs:211)
    11. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

    Also one more thing not related to gizmo, when I select particle texture in output it finds a lot of (editor?) icons and stuff that should not be there - I think that was in previous version too. The interesting part is for some reason if I want to select "DefaultParticle" it's not there, but in other output system its searchable. I found it just now, because I wanted to set back to default particle in attached system (link above) and I could not do that (so there will be missing particle texture btw).
     
    Last edited: Dec 13, 2021
    Vita- likes this.
  19. Vita-

    Vita-

    Unity Technologies

    Joined:
    Jul 2, 2019
    Posts:
    99
    Heya @Qriva,

    Gotcha! Reproduced the issue with your help and forwarded it developers to take a closer look. You can track it's progress here: https://issuetracker.unity3d.com/product/unity/issues/guid/1389076/ (It takes a bit to show the bug in Issue Tracker)

    Speaking of the texture search noticed that it is a global issue in the search, I will look into it.

    Thank you for raising these to us, greatly appreciated!
     
    Qriva likes this.
  20. daneobyrd

    daneobyrd

    Joined:
    Mar 29, 2018
    Posts:
    94
    I just wanted to chime in and offer this resource as a great list of possible examples for a pinned thread/page in documentation - similar to that orbital velocity example.

    http://foxcodex.html.xdomain.jp/index.html
     
    Last edited: Jan 20, 2022
    Vita- likes this.
  21. andybak

    andybak

    Joined:
    Jan 14, 2017
    Posts:
    558
    This is a fantastic way to do documentation. "Cookbook" style info is the most helpful I come across. I'd happily trade every long form tutorial out there in return for a bunch of short "how to" examples.
     
    Vita- likes this.
  22. Qriva

    Qriva

    Joined:
    Jun 30, 2019
    Posts:
    741
    I think the goal would be to create series of short, minimalistic examples of common tasks, for example "How to send event with payload", "How to use direct link", but also more artistic "How to set particle velocity along spawn shape" or orbiting thing from above.

    I am not sure about the exact form (not everything can be done by code, gifs and pictures are needed too), however if Unity devs decided to make something like this, then I would happily contribute a bit. Maybe it's good idea to create pinned thread, so people can put ideas what they would like to see/need or post complete examples or samples.
     
  23. Vita-

    Vita-

    Unity Technologies

    Joined:
    Jul 2, 2019
    Posts:
    99
    Hi! Thanks for all the messages and suggestions! As promised, it is being worked on. As you already mentioned above, it will contain examples of common struggles (gifs and pictures are included), useful forum links, presentations, samples.

    Once it is ready and will go through polishing stage, I'll create a separate post to collect your feedback and the missing parts. :)
     
    landonth and Qriva like this.