Search Unity

Feedback Wanted: Visual Effect Graph

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

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

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    I havent used point cache stuff myself yet. But they are used in at least one of the test scenes that I spoke about earlier in this thread (and shared some of them in an easier format than having to get them off a specific github branch).

    They are used in test 09_AttributeMaps, and here is a screenshot from the relevant part of the graph. Sorry for the lack of wires in this screenshot, I seem to have a problem with invisible wired recently and I havent tried to work out why yet.

    pointcache.PNG

    I havent given this much thought, but possible advantages compared to sdfs is that additional info such as colour can be stored, and there are different sample mode options, and its probably easier to manipulate the data during use in other ways that I havent thought through properly.

    As for SDFs, see earlier in the thread, Unity intend to provide more tools for importing/generating this sort of thing. And I already went on about how just because tools already exist to generate 3D textures using 2D textures, doesnt mean these textures actually contain proper and valid SDF data. But I dont want to become a signed distance field bore, and I'm not qualified to really say much more than that.
     
  2. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    Not sure if private forum conversations support file attachments. But you can send me a message anyway if you want me to try something. Unfortunately I have now run out of time for today, probably, but should have some time tomorrow.

    Do keep in mind that I doubt the authors of Mega Flow have any Visual Effects Graph experience yet, that tool was written years ago and we are lucky it even supports the generation of 3D textures (probably offered that feature as there have been 3rd party GPU poarticle systems that could use velocity vector fields in the past). And hard for me to know if there is anything wrong at all with the textures it generates as opposed to our understanding of the data and implications for its use, and how best to use it in VEG. eg off the top of my head, I certainly wouldnt be surprised to see particles not moving at all in certain places if I was using vector info to set absolute velocity. Which is why I posted screenshot of me using that other node, which uses the data to add force to particles, as opposed to completely overriding their velocity (although in my examples I was rather cancelling that out by setting velocity to 0 in previous block). Anyway I am rambling on and am in danger of causing more confusion, I'm still getting used to talking about this stuff.
     
  3. racarate

    racarate

    Joined:
    Jul 14, 2012
    Posts:
    62
    Thanks again for the help... I just now found some documentation on the wiki, this might answer some questions for others as well. Apologies if this was already linked.

    https://github.com/Unity-Technologies/ScriptableRenderPipeline/wiki/VFX-Systems-Contexts-and-Blocks

    One thing I am wondering if there is a "POP Wrangle" style node where I can just write a simple snippet of HLSL instead of relying on these blocks and nodes. Is that possible? It is sometimes more powerful and a quicker workflow to write a quick expression instead of building a node graph.
     
    tap_unity likes this.
  4. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    Probably better to link to this page, since it has more links to other relevant wiki pages than the one you've found. https://github.com/Unity-Technologies/ScriptableRenderPipeline/wiki/Visual-Effect-Graph
     
    racarate likes this.
  5. andybak

    andybak

    Joined:
    Jan 14, 2017
    Posts:
    569
    Ha! No - I had no idea that tiny symbol was clickable. Thank you.
     
    elbows likes this.
  6. Hovl

    Hovl

    Joined:
    Apr 14, 2017
    Posts:
    7
    Hi, I would like to know how to create vector fields in Unity. There are no tutorials on the Internet at all. Can you make at least a small feedback how you created a vector field for the Unity logo? upload_2018-10-29_17-3-48.png
    If I use my own vector field in effect, all particles just fly away. And why open button don't work? upload_2018-10-29_17-5-41.png
     
    AthrunVLokiz likes this.
  7. AlexStrook

    AlexStrook

    Joined:
    Oct 19, 2013
    Posts:
    31
    Thanks you so much, I feel so dumb that I didn't that they could expand...
     
  8. Grimreaper358

    Grimreaper358

    Joined:
    Apr 8, 2013
    Posts:
    789
    Ah yea, forgot to mention this as feedback. Seems the devs could make this more noticeable. I only knew this could have been expanded because I saw it expanded in one of the example graphs they have on GitHub.
     
  9. racarate

    racarate

    Joined:
    Jul 14, 2012
    Posts:
    62
    ErbGameArt, the only way to create your own vector field in Unity is to create a Texture3D in script. Tool-wise, there are a few things out there that convert between FGA and Texture3D (Mega Flow and VectorrayGen) but I found a bug in Mega Flow and have not yet tried VectorayGen.

    There is also some sort of script called "VectorFieldImporter" in the Visual Effect Graph package but I have no idea what it does or how to use it. Presumably it turns VF files into Texture3D.

    Since this is a feedback wanted thread, my main feedback would be to add a VEG node that ingests FGA files. It is a big speedbump for art directing our effects that we have to spend all this time on troubleshooting conversion utilities. Make it an actual VEG node, not a standalone tool like the Point Cache tool.
     
  10. JulienF_Unity

    JulienF_Unity

    Unity Technologies

    Joined:
    Dec 17, 2015
    Posts:
    326
    No playback built in yet. You can always do it with nodes by packing your frame in a single point cache (as there's no multi frame point caches built in yet too).

    target position is used in the connect block and in the line output and more generically where we need to have 2 positions. Else you can also use it as a generic attribute to store a vector3.

    inline transform node does exactly what you're looking for.

    mmm that strange we didnt encounter issues with undo/redo so far. We gonna take a look. If you're able to find a repro step for this, this would be very useful!

    Thanks guys for your feedbacks!

    We will add an FGA importer for vector fields soon and also rework the UI of the slot expand/collapse icon so it's obvious that it is clickable and what it does.
     
    BjoUnity3d, Desoxi and elbows like this.
  11. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    I wouldnt bother even trying VectorrayGen at the moment, since if you do all you will discover is that it does not actually include anything that allows 3D textures to be saved to your unity assets.

    Yes thats what it does, so there is no point trying to use it until Unity make information & exporters available to create VF files.

    VEG nodes generally create compute shader code. And the compute shaders themselves are really not the place to handle conversion of file formats. And compute shaders really want to work with data in certain formats - either textures or buffers. So its probably not a good idea to imagine VEG consuming .fga files directly. However, since the VectorFieldImporter that works with VF files and turns them into 3D textures seems to do so pretty automatically in the editor, without having to manually run a tool to do the conversion of each file, it is possible that they will make their .fga importer work in the same way. So you wont have speedbumps in future, even without a VEG node that works with fga files directly.
     
  12. Nevl

    Nevl

    Joined:
    May 8, 2018
    Posts:
    1
    hi guys, I think it is use a volume texture to create the vector fields, And I found this tools to make volume texture. but I don’t know how to use it… I had try a lot of times, but also fail to create a useable volume texture…
    if someone want to try, click here! https://github.com/mattatz/unity-volume-rendering
    and if you make it work to create the useable volume texture to control the vector fields, please tell me how it work!
     
  13. Almgp

    Almgp

    Joined:
    Dec 9, 2014
    Posts:
    19

    Attached Files:

  14. xuqiushi

    xuqiushi

    Joined:
    Nov 23, 2017
    Posts:
    1
    Shader error in 'Hidden/VFX/ParticleQuads': failed to open source file: 'Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl' at /Users/Windows10/Downloads/ScriptableRenderPipeline-release-2018.3/com.unity.visualeffectgraph/Shaders/RenderPipeline/HDRP/VFXCommon.cginc(2) (on d3d11)

    Compiling Vertex program
    Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP UNITY_COLORSPACE_GAMMA UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_LIGHTMAP_FULL_HDR

    How to solve this problem, thanks!
     
    Tulsisvt likes this.
  15. YuriyPopov

    YuriyPopov

    Joined:
    Sep 5, 2017
    Posts:
    237
    Hey. Guys I manged to set up the visual effects graph to work with the HDRP 4.01 and so on from the package manager. How ever I'm having a slight issue. If the Actual Transfrom of the effect is not in camera view the entire effect get culled. Am I doing something wrong ?
     
    yc960, PaulBrooke, xvrsl and 2 others like this.
  16. racarate

    racarate

    Joined:
    Jul 14, 2012
    Posts:
    62
    I have two quick feedback questions about point caches and vector fields (I checked the source but still don't exactly get it):

    1. How do the addressing modes for the point cache work? I can only get decent results when I use "sequential" but it seems like "index" and "index relative" should work too. I also tried modulo-ing the particle index by the point cache total point count to no avail. What is the correct way to sample a point cache?

    2. For vector fields, are their centers at 0, 0, 0 and their extents 1,1, 1 by default? Does that mean I have to give a field transform of -0.5 in each direction to match it up with a spherical emitter of size one at the origin? I have been using this source to try to figure out the addressing mode:

    https://github.com/Unity-Technologi...ks/Implementations/Forces/VectorFieldForce.cs

    Thanks!
     
  17. JulienF_Unity

    JulienF_Unity

    Unity Technologies

    Joined:
    Dec 17, 2015
    Posts:
    326
    A bit of explanation about the sampling modes available in the block SetAttributeFromMap to sample a map from a point cache:
    • Sequential: the sampling is based on the id of the particle (and its looping): First particle samples first point and so on...
    • Index: You specify manually the point to sample via the slot "index"
    • RelativeIndex: Same as above except the slot is a float between 0 and 1. The point index is selected with index * pointCount
    • Random: The point is selected randomly
    • RandomUniform: The point is selected randomly but the random number is constant per particle (meaning sampling in 2 maps in this mode gives the same point)
    • Sample2DLod: Sample direcly by providing the uv of the texture. More useful for generic textures than for point caches
    • Sample3DLod: Same as above but for 3D textures
    All this may vary a bit during the preview (especially the naming)

    About vector fields: the Box in which the vector field texture is mapped is by default centered at 0 and has a side of 1.
    You can see the vector field box gizmo (and modify it) in the scene by selecting the block (For local vector fields, a Visual Effect component must be attached to the Visual Effect asset being edited).
     
    Last edited: Oct 30, 2018
    racarate likes this.
  18. racarate

    racarate

    Joined:
    Jul 14, 2012
    Posts:
    62
    Thanks! Definitely clears stuff up... maybe "relative index" can be "normalized index" and "random uniform" can be "deterministic random" or something with the word "hash" in it.

    Can you elaborate a bit more on how the Sample2DLod and Sample3DLod addressing modes work for point caches? How would the 0-1 uv/uvw coordinates map to a point in the point cache? Is it based on bounding box or something? And are looked-up point cache values then interpolated?
     
  19. Ziboo

    Ziboo

    Joined:
    Aug 30, 2011
    Posts:
    356
    Can we send arrays to the VEG ?
    Like an array of Vector3[] to be used in a loop or something ?
     
  20. augminded

    augminded

    Joined:
    Apr 26, 2016
    Posts:
    1
    Just a quick question: Does this work on Mac Unity 2018.3 beta 7 ? I have downloaded the SRP from github and changed my manifest.json file so that I have Access to HDRP and the Visual FX Graph but I cant seem to get any output. a lot of shader errors reported when I import an effect for example... Just dont want to be struggling in vain.
     
  21. unity_RuwGDfd2lVx01A

    unity_RuwGDfd2lVx01A

    Joined:
    Oct 25, 2017
    Posts:
    23
    Is there a way to scroll simplex (or any) noise to animate turbulence, or somehow animate the turbulence module? Even the shuriken particle system has that. I must be missing something... because why on earth would there be a turbulence module without animation? :confused:

    Any help is greatly appreciated!
     
  22. Ziboo

    Ziboo

    Joined:
    Aug 30, 2011
    Posts:
    356
    Some bugs:
    - Exposing a Gradient parameter doesn't allow to set color in HDR... pretty annoying for particles
    - In exemples files I saw a "trigger" block that is link to a "GPU Event", but doesn't seem to be able to add it to new graphs, doesn't appear in the list
     
    gasanoff likes this.
  23. andybak

    andybak

    Joined:
    Jan 14, 2017
    Posts:
    569
    Anyone managed to get the VFX Parameter Binder component working? Nothing happens when I click the "add item" button under "parameter bindings"...
     
    createtheimaginable likes this.
  24. Grimreaper358

    Grimreaper358

    Joined:
    Apr 8, 2013
    Posts:
    789
    ThomasVFX shared a quick tutorial how to do this on Twitter - https://twitter.com/peeweekVFX/status/1057665614909726720
     
    createtheimaginable likes this.
  25. racarate

    racarate

    Joined:
    Jul 14, 2012
    Posts:
    62
  26. JulienF_Unity

    JulienF_Unity

    Unity Technologies

    Joined:
    Dec 17, 2015
    Posts:
    326
    Not yet, but it may come at some point

    Can you be more specific about the errors you're getting?

    Sure every input of the noises can be animated via nodes. Try plugging a totalTime node to the input coord or to the angle of the boc of the turbulance block for instance. Then you have access to all the node library (waves, beziers, point caches...)

    We are aware of the gradient bug, it will be fixed soon. For GPU Event stuff, you need to enable experimental features in preferences/vfx. This is because GPU events are currently limited and will be entirely reworked at some point.

    Yes you can pass any type of textures. It just needs to match the actual dimensions (2D/3D/Cube...) of the exposed texture parameter or you'll get an error.
     
    racarate likes this.
  27. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
  28. Grimreaper358

    Grimreaper358

    Joined:
    Apr 8, 2013
    Posts:
    789
    Just saw this talk on VFX in Star Citizen (They switched over to GPU particles) that they did at their convention about a week Before Unite LA. At one point the speaker talks about collision from scene depth buffer



    and I thought "This is probably in the VFX Editor/Graph let me check" Load up a project and I find the Collider (Depth) Node

    upload_2018-11-1_15-52-58.png

    so I was happy to see that it's in but I have no Idea how to hook the scene depth buffer to the texture slot. Any info on if that's how it should be used or if it needs a premade SDF texture?
     
  29. racarate

    racarate

    Joined:
    Jul 14, 2012
    Posts:
    62
    Hey all, I've been writing some custom nodes (different analytic SDF etc.) and it is all pretty straightforward but I can't figure out how to write a custom renderer. I'd like to try my hand at a ribbon renderer at first to get some fake-ey spline trails. Does anybody have any guidance?
     
  30. YuriyPopov

    YuriyPopov

    Joined:
    Sep 5, 2017
    Posts:
    237
    hey guys I would like to know how to generate custom Vector fields and SDF for this new system. For example the VFX graph comes with a default SDF that is a teapot. Can someone tell me how to turn a custom mesh into a SDF file to use in the graphs ?
     
  31. Pikkewynman

    Pikkewynman

    Joined:
    Jul 16, 2017
    Posts:
    4
    upload_2018-11-2_13-23-22.png
    im getting issues getting the vfx graph to work. using your easysetup here I actually get it to open and see the graph and can edit it there. (previously i get no nodes). but now with this getting all these shader errors. no changes. just using the this repo after running the .bat. using unity 2018.3.0b8
     
  32. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
  33. Pikkewynman

    Pikkewynman

    Joined:
    Jul 16, 2017
    Posts:
    4
    @rizu ive tried this. it runs, no errors. but for some reason the graph nodes are not working and no fx display if I open any examples. the vfx editor panel is there. I can see the blackboard and gameobject attachment things. but if I try to view any node graphs or add a new node or do anything else nothing happens. so kind of stumped.

    edit: seem to have gotten it to work after the 4th time importing the package. dont know what i did wrong. thanks for the assist
    no not actually. graphs dont load and still cant view any effects
     
    Last edited: Nov 2, 2018
  34. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    This subject has come up multiple times on this thread already. Unity plan to make tools to help with this stuff, but they arent available yet. I've spoken at length about various things that can fill this gap for now, but there are no perfect and simple answers, especially not with SDFs.

    See this post for example of Unity talking about future plans for SDP etc utils: #21
     
  35. racarate

    racarate

    Joined:
    Jul 14, 2012
    Posts:
    62
    Re: custom SDF you can make a one-channel 3D texture in C# script. To make it useful you would need to import a SDF from another program. Try a basic Python script in Houdini to export a SDF where each line of the file is a single float.

    Basically you gotta make your own SDF-to-3DTexture converter because Unity doesn't include one!

    Mega Flow and VectorayGen both include code for a FGA-to-3DTexture converter which is a somewhat similar problem (that is how I have been generating vectorfields for VEG).
     
    Last edited: Nov 3, 2018
  36. JulienF_Unity

    JulienF_Unity

    Unity Technologies

    Joined:
    Dec 17, 2015
    Posts:
    326
    @Grimreaper358

    Yes we have depth buffer collision and also a block to spawn particles and project them on scene using the depth buffer (Project On Depth in Init IIRC)

    However at the moment, it is not easy to set the zbuffer. In the spaceship demo, we used depth buffer collisions for the sparks but hacked HDRP to insert a custom hook to copy the depth buffer to use it during particle simulation.

    We plan to finish the implementation for 19.1 by adding buffers to the camera type directly (There's a node MainCamera to retrieve the tagged main camera), so getting the depth and color buffers will be automatic.

    For 18.3 I'm afraid you have to provide the buffers manually.

    Thomas did it manually for this effect for instance: he renders the mesh in an offscreen render target, then provides the depth and color buffer of the render texture to the VFX Graph to spawn particles for the hologram (using the project on depth block):

    https://twitter.com/peeweekVFX/status/1055934102887575552
     
    Last edited: Nov 3, 2018
    id0, racarate and elbows like this.
  37. Grimreaper358

    Grimreaper358

    Joined:
    Apr 8, 2013
    Posts:
    789
    Ah, so I can use a render texture for the input? When I tried that it removed the texture as soon as I drag it to the slot or select it. I must have setup the render texture wrong, going to mess around with it some more and see. looking forward to it being supported in 19.1 thanks for the info Julien
     
  38. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    937
    Great Stuff here.

    I and some others in different forums have similar problem
    with an Shader error in
    Hidden/VFX/ParticleQuads:
    EvaluateAtmosphericScattering:
    no matching 1 parameter function......

    I set
    (80) float4 fog = 0.0;
    in
    VFXCommon.cginc
    for a dirty fix.

    I use
    HDRP, CoreRP, ShaderGraph, VisualEffectGraph 4.1.0 preview in Unity 2018.3.0b7 and
    VisualEffectGraphEasySetup

    Anyone an idea how to fix it without disabling the EvaluateAtmosphericScattering(posInput) call.
     
    Last edited: Nov 4, 2018
    hvent90, roccobruno78 and Pikkewynman like this.
  39. Grimreaper358

    Grimreaper358

    Joined:
    Apr 8, 2013
    Posts:
    789
    Is there any plan to add a Kelvin Temperature node like the one for the lights in HDRP? This would be nice to have when creating energy effects to get accurate color values and the gradient would still be there for something more artistic. It would also be nice if you are able to have a range selection (if the effect will change temperature over time) as well as being able to set a single value for it.
     
  40. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    createtheimaginable likes this.
  41. konsic

    konsic

    Joined:
    Oct 19, 2015
    Posts:
    995
    When will VEG come to LWRP?
     
  42. eco_bach

    eco_bach

    Joined:
    Jul 8, 2013
    Posts:
    1,601
    When laying back any of the GraphicsTests scenes am getting the following error>

    VFXViewPreference.cs(74,67): error CS0103: The name 'SettingsScope' does not exist in the current context

    I have switched Scripting runtime to .Net4. Is there some other preference that needs changing?
     
    Alverik likes this.
  43. roccobruno78

    roccobruno78

    Joined:
    Apr 23, 2015
    Posts:
    7
    Hidden/VFX/ParticleQuads:
    EvaluateAtmosphericScattering:
    no matching 1 parameter function......

    pls fix this
     
    keeponshading likes this.
  44. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    937
    Last edited: Nov 5, 2018
    createtheimaginable and gasanoff like this.
  45. mananapeejay

    mananapeejay

    Joined:
    Mar 21, 2018
    Posts:
    2
    No particles are seen (or rendering) kindly resolve
     
  46. mananapeejay

    mananapeejay

    Joined:
    Mar 21, 2018
    Posts:
    2
    Same here
     
    roccobruno78 likes this.
  47. MaT227

    MaT227

    Joined:
    Jul 3, 2012
    Posts:
    628
  48. YuriyPopov

    YuriyPopov

    Joined:
    Sep 5, 2017
    Posts:
    237
    Mind sharing your graph. Would be nice if we could get an early start on some learning resources. I might start a collection of things I find on the forums and my own experiments with this one so people can learn from it.
     
  49. Yakiiz

    Yakiiz

    Joined:
    Nov 6, 2018
    Posts:
    1
    I made a little tutorial to fix it step by step. You can find it here : https://imgur.com/a/EJtWiSG

    Not sure if it works for all of those these Hidden/VFX/ParticleQuads
     
    Last edited: Nov 6, 2018
    Tulsisvt likes this.
  50. andybak

    andybak

    Joined:
    Jan 14, 2017
    Posts:
    569
    A bit hard for anyone to help you without knowing a bit more. It's working for other people so it's something specific to you.
     
Thread Status:
Not open for further replies.