Search Unity

Feedback Wanted: Visual Effect Graph

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

  1. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    25,343
    Indeed, exposure weight is missing, seems broken. Using any kind of exposure in your project makes particles invisible with additive or black with alpha. Bug? Tested with latest Unity VFX sample (glowing UnityLogo example is invisible unless exposure is disabled in HDRP)
     
    Mbot and Raive like this.
  2. VladVNeykov

    VladVNeykov

    Unity Technologies

    Joined:
    Sep 16, 2016
    Posts:
    39
    Hey @Raive ,
    We don't have the exposure weight slider, but you should still be able to bloom overexposed particles. Unlit particles should just work, just remember if you are using Lit particles and are using an overexposed color as the source of your emission to include emissiveness in the color mode of the lit output:
     

    Attached Files:

  3. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    25,343
    @
    Hi @VladVNeykov this does not work well with HDRP exposure and HDRP sky exposure. It only works well on scene without exposure (tested with Unity's own samples).

    So I can get things to bloom fine providing there is no Unity exposure control. So I have to set Sky volume Exposure to 1 and regular volume Exposure to 1 to reproduce your results.

    Regular materials work fine with my current setup including Shuriken so I believe VFX to be broken in any scenario where volume exposure deviates from the default.

    Should we remove exposure from the project and use artificial
     
  4. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    25,343
    upload_2019-5-1_16-53-55.png

    .... one million? :/ I have a light that's correct sunlight lux and so forth. I think we need some proper pre-exposure going on because any more than this I head to float limitations.

    While a nearby standard material with emission slider requires no effort to get the correct lighting for the scene.

    So I can't accept this is a working thing. Is it known and tested at Unity with correctly exposed scenes with real LUX values?
     
    GameDevCouple_I, Mbot and Raive like this.
  5. mhazani

    mhazani

    Joined:
    Jun 18, 2014
    Posts:
    11
    Brilliant; I couldn't find any proper explanation of how to utilize target position but it's incredibly intuitive once looking at the example. Thank you *so* much for this!
     
    VladVNeykov likes this.
  6. VladVNeykov

    VladVNeykov

    Unity Technologies

    Joined:
    Sep 16, 2016
    Posts:
    39
    Hi @hippocoder,
    My reply was in response to @Raive as they mentioned lit materials and in VFX adding emission to the color mode is often overlooked.

    Not having the exposure weight is definitely a legit concern, just not one we have addressed yet. Since both HDRP and VFX are in preview, we will occasionally need to catch up with features and changes introduced during development.

    Possibly, or using (as you noted) really high values. But really, the most reliable thing would be to upgrade to a future package which implements the exposure weight.
     
    hippocoder likes this.
  7. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    25,343
    OK, thank you for clearing that up. I'll do exactly what you said - and wait for a future update, this is perfect :)
     
    VladVNeykov likes this.
  8. turboturboturbo

    turboturboturbo

    Joined:
    Dec 2, 2018
    Posts:
    8
    Hi,

    Is the trail renderer availble in 2019.2a ?
     
  9. mhazani

    mhazani

    Joined:
    Jun 18, 2014
    Posts:
    11
    Following up on this. Any chance there's a way to make the latest version compatible w/legacy?

    the use case is basically *everything* that relies on Single Pass Instancing - namely, all recent XR. Since there hasn't been word about compatibilty timelines, for now, legacy fallback (instead of HRDP/LWRP) would be one workaround. Unity folks - any thoughts would be appreciated!

    (EDIT: it might already be? Creating a standard project with the 3D template, importing the latest package and setting the pipeline path under VFX settings to "legacy" doesn't seem to do the trick.)
     
  10. racarate

    racarate

    Joined:
    Jul 14, 2012
    Posts:
    62
    sorry if this is a dumb question... getting back into VEG after six months off... does HDRP-VEG combo support motion blur? i don't see it happening on any of the the sample effects (ideal use case would be something like "Portal")

    https://github.com/Unity-Technologies/VisualEffectGraph-Samples

    is there a way to force the VEG renderer to write into the velocity buffer so that HDRP motion blur works?
     
  11. SE_BERLIN

    SE_BERLIN

    Joined:
    Nov 24, 2017
    Posts:
    13
    Oh boy...
    today i tried to have another look into this... seems rather broken at the moment.
    On a MacBook Pro (15-inch, 2017) with Radeon Pro 555 2048 MB
    with Mac Os Mojave and Unity3d 2019.1

    - i tried to have a look at the refreshed examples. Updated to hdrp 5.13 and VFXG 5.13
    - the older examples (Volumetric and Butterfly) don't render at all or everything is green.
    - newly setup VFX render particles black (conflict in exposure)
    - 2x times the macbook completely froze. One time just so, second time showing funny colorful artefacts on the garbled screen
     
  12. VladVNeykov

    VladVNeykov

    Unity Technologies

    Joined:
    Sep 16, 2016
    Posts:
    39
    Hey @racarate, not yet, but quite close. We used motion blur for the VFX in The Heretic, but there's still a bit of work left before motion blur for the VFX graph gets to a public VFX pacakge.
     
    racarate and Lars-Steenhoff like this.
  13. VladVNeykov

    VladVNeykov

    Unity Technologies

    Joined:
    Sep 16, 2016
    Posts:
    39
    Hi @turboturboturbo, we don't have trails implemented for the VFX Graph yet. There are some cool examples of people doing things which look like trails with the VFX Graph, but these typically use something else, like the Line output, a quad output with a Connect Target block, and/or GPU events to "drop" particles behind and make a trail.

    Hey @SE_BERLIN, indeed, thanks for flagging this (happens on Win as well, btw). We'll take a look :)

    Edit: looks like it's an HDRP issue with translucency (increasing the thickness of the butterfly wings above 0 should alleviate what you see in that particular scene, but the issue is more widespread. I'll poke the HDRP team, thanks!
    Edit #2: It's fixed it in 5.14
     
    Last edited: May 8, 2019
  14. racarate

    racarate

    Joined:
    Jul 14, 2012
    Posts:
    62
    @VladVNeykov thanks! speaking of graphics things in general, (like trails), i have written custom force nodes for VEG (just different flavors of curl noise) but is it possible to write a custom output block (like "Lit Output")? i would like to try my hand at a ribbon renderer!
     
  15. VladVNeykov

    VladVNeykov

    Unity Technologies

    Joined:
    Sep 16, 2016
    Posts:
    39
    @racarate it is, but it's not user-friendly, and there is no documentation/support for it at the moment. It'll involve creating a new Context node (the ones found in com.unity.visualeffectgraph\Editor\Models\Contexts\Implementations), have it point to a corresponding template (i.e. com.unity.visualeffectgraph\Shaders\RenderPipeline\HDRP\Templates) and then look at the corresponding shader files which will need to be modified (com.unity.visualeffectgraph\Shaders). The VFX Graph is using an expression system, so you'd need to look at examples to see how to pass inputs to the shader and access per-particle data (i.e. particle size, age, etc.)

    I'd recommend making copies of the files you need in Assets and use an asmdef file to link them to the package assembly as modifying the package directly can get messy when trying to upgrade it down the road.

    The planned user-facing solution for custom outputs is Shader Graph integration, which hopefully will make this more accessible. And of course, more docs down the road.
     
  16. racarate

    racarate

    Joined:
    Jul 14, 2012
    Posts:
    62
    oh badass! no worries on the lack of documentation or portability, this is a strictly curiosity-driven side project... excited to dive in, thanks again for the notes!
     
    VladVNeykov likes this.
  17. andybak

    andybak

    Joined:
    Jan 14, 2017
    Posts:
    143
    @racarate Please share your progress. I too wanted to write a custom output block but was put off by the potential complexity and brittleness. (really hoping there will be an official way to do this!)

    Mind me asking what you plan to make? I wanted to make a triangle renderer where each vertex was controllable. The idea was to render exploding/morphing meshes and the like.
     
  18. racarate

    racarate

    Joined:
    Jul 14, 2012
    Posts:
    62
    i'd like to try a ribbon renderer (triangle strips) and a volume renderer (treating the particles as spheres of density and ray-marching them)... how far did you get?
     
    thinksquirrel_lily likes this.
  19. coldpizzapunk

    coldpizzapunk

    Joined:
    Aug 20, 2014
    Posts:
    22
    This is very cool, I was playing around with the connect target and I ran into two questions.

    First if I am using the Trigger Event Always but only want to do it once, can I do some sort of INT subtract count to switch the count from 1 to 0 in the graph editor? Or is it possible to get a Trigger Event Only Once option that isn't based on the particle death?

    Second, unrelated to Events and Trails, as I build more complex graphs I do a lot of trial stuff to see various art I can make. A lot of times finding interesting new things I wasn't even planning on. I find that my blackboard will have a lot of different testing variables when all is said and done. So I was wondering if adding some sort of count in the Blackboard UI based on how many times a variable is actually connected to a Context Container would be useful. For me I could then tell if a variable is no longer being used (Or how many times I've used it) and go ahead and simplify/delete without searching around to see if I am using it still and worrying I might break something. Just a thought.
     
  20. andybak

    andybak

    Joined:
    Jan 14, 2017
    Posts:
    143
    I didn't really get started. Instead I played around with custom blocks instead (The custom SDF block here: https://github.com/IxxyXR/Parametric-VFX )

    It was a fairly simple hack of the inbuilt Conform to SDF block to accept code definitions of SDFs.
     
  21. Mozq8

    Mozq8

    Joined:
    Dec 30, 2016
    Posts:
    12
    Greetings, guys, I am very interested in Visual Effect Graph, but all this new variables and words are confusing to me, is there any documents or manuals about all these terms and blocks?
     
  22. andybak

    andybak

    Joined:
    Jan 14, 2017
    Posts:
    143
    Last edited: May 10, 2019
    Mozq8 likes this.
  23. Freaking-Pingo

    Freaking-Pingo

    Joined:
    Aug 1, 2012
    Posts:
    303
    I just upgraded my HDRP pet project from 2018 to 2019.1.2f1 and now my VFX does not render. I have already rebuild all visual effect graphs. Both HDRP and Visual Effect Graph are running 5.13 preview. Are there any other upgrade steps I am missing?
     
  24. racarate

    racarate

    Joined:
    Jul 14, 2012
    Posts:
    62
    Oh that's nice! I really like the Conform to SDF node, I actually ported it to Houdini! I'd like to go the other way around (the Houdini Curl Noise VOP has an input for an SDF but the actual motion feels different... unfortunately source is not available).

    Related, does anybody know if Unity's mesh-to-SDF generator was ever released? Would love to play with it, thought it would be out by now (maybe I am looking wrong place):

    https://twitter.com/robertcupisz/status/1058079181412687872?lang=en
     
  25. andybak

    andybak

    Joined:
    Jan 14, 2017
    Posts:
    143
    pojoih likes this.
  26. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,226
    As of the last time I spoke to him around 3 weeks ago, he still needed to find a few days to finish polishing it and publish it, but still hoped to do so soon.
     
    pojoih likes this.
  27. pojoih

    pojoih

    Joined:
    Mar 30, 2013
    Posts:
    170
    Can anyone explain this? Same here, it's really hard to conform to text because all points not directly spawned inside the SDF are conforming to the mid point of the Distance Field.
     
  28. Vaspra

    Vaspra

    Joined:
    Apr 15, 2018
    Posts:
    19
    Hi @VladVNeykov - you mentioned that trail rendering isn't included yet. Is this type of thing simply not possible in VFX graph currently? I have experimented with "dropping particles behind" but it looks a bit off.

    Thanks!

    Edit: Source is 0:30 into the VFX demo video

    upload_2019-5-14_0-12-25.png
     
  29. racarate

    racarate

    Joined:
    Jul 14, 2012
    Posts:
    62
    That looks sick, "dropping particles off" is basically a growth system!

    @andybak thanks for the recs, I'll take a look.
     
  30. pojoih

    pojoih

    Joined:
    Mar 30, 2013
    Posts:
    170
    Looks more like Keijiros KvantSwarm
     
  31. Adnaro

    Adnaro

    Joined:
    Mar 1, 2015
    Posts:
    2
    Hello, I'm having a hard time figuring out how I can check 'current position' realtime simulation values from an external script. It generally seems there is no output for these kinds of values?

    I'm basically trying to map audio volume to the Y axis of the particle, so as they move up, the volume goes up, but I need to retrieve the y axis position for this. Any clues?

    Thanks!
     
  32. VladVNeykov

    VladVNeykov

    Unity Technologies

    Joined:
    Sep 16, 2016
    Posts:
    39
    Hey @coldpizzapunk, you can use a custom attribute and change if either after the spawn, or after a certain condition to control when Trigger Event Always will execute. Here's a simple example with a bool custom attribute:


    Thanks for the suggestion, I've passed this on to the GraphView devs :)

    Hey @Mozq8, the docs are still very much still in development as well (as the VFX Graph is itself evolving), but this blog post by John O'Reilly should be a good starting point:
    https://blogs.unity3d.com/2018/11/27/creating-explosive-visuals-with-the-visual-effect-graph/

    Hi @Freaking-Pingo , are you getting any particular errors? Lots has changed from 18.3 to 19.1, so it's a bit hard to say. Also, did you upgrade the Core RP Library package as well to 5.13?

    Hey @pojoih, can you post an image of your graph? On the top of my head, I'd say if you are not doing so already, spawn the particles in Initialize in a bigger shape so they have a chance to sample different parts of the SDF.

    Hey @Vaspra , this was done exactly with the dropping particles behind / connecting them with a Connect Target block. The original was made by @ThomasVFX , I just put together a quick example (not sure if that's 100% how the original was made, but should be enough to get the idea :) You can get it here


    Hey @Adnaro , you can't get individual particle data from GPU back to the CPU as it's quite costly. Often the use case you are describing is the opposite - the particles match the music, not the other way around. If you do want the particle's position to drive the sound volume, you can drive both with an exposed parameter like this:

    Then you can set SoundLevel from script to move the particles up on Y and at the same time use it also to control the volume.
     

    Attached Files:

  33. andybak

    andybak

    Joined:
    Jan 14, 2017
    Posts:
    143
    That's fantastic and has given me loads to work with. This will be fun with the parametric vector field block I've been looking for an excuse to work on.

    One thing I don't understand - How is "Connect Target" working when you're setting it to the same value as the original position (as far as I can see).

    And a small fix - the normal map wasn't completely smooth in the green channel which led to visible segmentation when you looked closely. See attached for a fixed version. (Incidentally - .tga files? Wow. That takes me way back. I'll see your .tga and raise you a .pcx and a couple of .iff's ;-)
     

    Attached Files:

  34. thinksquirrel_lily

    thinksquirrel_lily

    Joined:
    Feb 8, 2011
    Posts:
    1,175
    This works by setting the original position, but not moving the particle after that.
     
  35. andybak

    andybak

    Joined:
    Jan 14, 2017
    Posts:
    143
    Sorry. I still don't follow. The spawned particle - at the point it's rendered seems to have the same value for both position and target position.

    1. Is this correct or have I got this part wrong?
    2. Assuming the answer to the above is "yes that's correct" = what does "connect target" do when you feed it two identical positions?
     
  36. VladVNeykov

    VladVNeykov

    Unity Technologies

    Joined:
    Sep 16, 2016
    Posts:
    39
    To avoid using more bandwidth and add more memory consumption, we are fetching the attributes from the end of Update. The position of the Trigger block within Update doesn't actually matter, here is what's happening:

    (I've exposed EulerIntegration to visualize the position update, typically it's invisible and executes at the end of Update). UX-wise it needs a bit more love, as you are right, it can raise some questions.

    Surprised that's all that's wrong with it, I took the normals from a some sphere normal texture off the web and cut quickly out a strip to put together an example. It's definitely not production-grade material ;)
     

    Attached Files:

  37. andybak

    andybak

    Joined:
    Jan 14, 2017
    Posts:
    143
    OK. I understand a lot better now. I think there's a lot of stuff about when properties are updated that isn't terribly clear and the hidden implicit integrations probably contribute to this.

    With "Get property (source)" nodes - what does "source" refer to? Is it only relevant when spawning particles via GPU events or does it have other uses?

    (on a related topic - I seem to have to add angular euler integration manually if I want to use angular velocity. It never seems to work automatically?)
     
    VladVNeykov likes this.
  38. VladVNeykov

    VladVNeykov

    Unity Technologies

    Joined:
    Sep 16, 2016
    Posts:
    39
    Agreed, that's why GPU events are marked as experimental as there will be a UI refactor later to make things more clear.

    It's used for GPU Events, attributes set in Spawner or if you send an event with event attributes. Anything that requires particle data that existed before Initialize.

    What's your setup? Seems to work fine:
     

    Attached Files:

  39. Vaspra

    Vaspra

    Joined:
    Apr 15, 2018
    Posts:
    19
    @VladVNeykov Thank you so much for this, much appreciated!
     
    VladVNeykov likes this.
  40. andybak

    andybak

    Joined:
    Jan 14, 2017
    Posts:
    143
    > What's your setup? Seems to work fine:

    Damn. Can't recreate it now. And I just deleted the scene where it last happened.

    Another question - I'm having lots of issues with lit output in VR. VR and HDRP are pretty fussy anyway but even when I've made the right offerings to the gods to get it working in general, I find that lit output is still unreliable. At the moment on a minimal test project (2018.2.0b1 and 6.5.3) only lit quad and mesh work. I get nothing rendering with lit spheres and cubes.
     
  41. Vaspra

    Vaspra

    Joined:
    Apr 15, 2018
    Posts:
    19
    Forgive me if this is a dumb question, but I can't seem to apply a normal map to my lit quad output. I don't have the option - is there a setting I need to enable to expose it?
    upload_2019-5-16_15-56-30.png

    @coldpizzapunk Doh, inspector. Thanks
     
    Last edited: May 16, 2019
  42. coldpizzapunk

    coldpizzapunk

    Joined:
    Aug 20, 2014
    Posts:
    22
    @Vaspra When you click on the entire Lit Quad Output box in the graph, the standard Unity Inspector showcases a lot of features you can turn on and off, such as normal map.
     
    VladVNeykov and Vaspra like this.
  43. VladVNeykov

    VladVNeykov

    Unity Technologies

    Joined:
    Sep 16, 2016
    Posts:
    39
    There are a number of issues with the sphere/cube outputs, even outside of VR; best to use the mesh output with a sphere/cube mesh until those are resolved.
     
  44. Korindian

    Korindian

    Joined:
    Jun 25, 2013
    Posts:
    437
    @VladVNeykov Hi, in the Shuriken particle system where we can select "Custom Space" in addition to "Local" and "World". With "Custom Space", we can define a specific transform for the effect to be local to. This is useful if we want effects to be in world space, but we also need to shift the world (and the effects) when using floating origin. We can then make the effect local to the shifting origin.

    In the beginning of the thread, it was mentioned by Unity that this is possible, but not straightforward. Would it be possible to post an example graph of how to achieve this? Thanks.
     
  45. Nessito

    Nessito

    Joined:
    May 23, 2017
    Posts:
    2
    I've search the thread and don't find anything...
    Maybe I'm missing something, but it woul'd be nice to have an "active toggle" for any context. Especially for output contexts.
    If you deactivate a context that change the output data (ie initialize context), all subsequent contexts will be deactivated also.
    Just an idea....
     
    andybak likes this.
  46. VladVNeykov

    VladVNeykov

    Unity Technologies

    Joined:
    Sep 16, 2016
    Posts:
    39
    Hey @Korindian, attached is a package with a custom sim space example. In the gif below, the white particles are with Shuriken, the green ones with VFX to show they have the same behavior. Hope this helps!


    You are correct, @Nessito - we do not have toggles for the context nodes. To remove a single output, you have to disconnect it manually. If you just want to leave it connected, but toggle some/all particles off, you can also set their alive state (Set Alive) to false; doing this in an Output, unlike doing this in Initialize or Update, will not kill the particles but will just toggle their rendering.
     

    Attached Files:

    Korindian likes this.
  47. Korindian

    Korindian

    Joined:
    Jun 25, 2013
    Posts:
    437
    I really appreciate you taking the time to provide the example and the notes in the graph. It really helped in understanding. Perhaps it could be added to the VFX Samples for others to see how it's done.

    After playing around with it a lot, I noticed a little oddness in the VFX behavior compared to Shuriken when moving the transforms in Edit mode (existing VFX velocities getting multiplied more so than Shuriken), but that issue didn't exist anymore after entering into Play mode once.

    Some feedback: would it be possible to streamline the custom space option workflow in the graph UI? As of now, that's quite a lot of nodes and connections to add to every single effect in a floating origin setup, whereas with Shuriken, it's a simple dropdown and reference. Thanks for listening.
     
  48. DuvE

    DuvE

    Joined:
    May 22, 2016
    Posts:
    107
    Is it possible to get access to mesh UVs? And for pixel/vertex positions of particles?
     
  49. KrzysiekDev

    KrzysiekDev

    Joined:
    Jan 7, 2016
    Posts:
    1
    Hi, quick question,
    Can I make an effect using Visual Effect Graph and save it as texture atlas for use in 2d games (with transparency, etc.)
     
  50. eizenhorn

    eizenhorn

    Joined:
    Oct 17, 2016
    Posts:
    1,364
    Record it by Unity Recoder? :)