Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice

Official [VFX Graph] Introducing six-way lighting for smoke, dust, and clouds VFX

Discussion in 'Visual Effect Graph' started by Matjio, Jan 19, 2023.

  1. Matjio

    Matjio

    Unity Technologies

    Joined:
    Dec 1, 2014
    Posts:
    108
    upload_2023-1-19_12-6-5.gif

    Welcome to the six way ligting discussion thread. You can use this thread to ask for help, share feedback, and have discussions about the new six-way lighting feature in VFX Graph.

    Introduction
    Rendering smoke in games is most often done with textured sprites because computing fully volumetric lighting is too expensive for a real-time budget. Six-way lighting is an alternative approach to this problem that uses a set of lightmaps that contain the lighting response of the smoke for light coming from six different directions. These lightmaps are baked into a set of two textures, along with an alpha channel and an optional emissive mask. The 2022.2 Tech Stream introduces a complete end-to-end workflow (from DCC to Unity) that allows you to realistically render smoke under any lighting conditions from baked simulations, using VFX Graph. It is currently only available for the High Definition Render Pipeline.

    Resources
    For more information, please have a look at our dedicated blog post and the new Output Lit option documentation.
    To get you up to speed, we’ve created a library of ready-to-use maps. We provide both high-fidelity assets that you can process and pack as you want – for example, using the VFX Toolbox – and more compact versions that are lightweight and ready for your game.

    Requirements

    • The minimum required Unity version is 2022.2
    • VFX Graph + HDRP
    Getting started
    1. Download Unity 2022.2 or newer through the Hub.
    2. Download the ready-to-use maps or generate your own ones in Houdini or Blender with the plugins we provide in the VFX Toolbox
    3. Drag and drop the maps in Unity’s Asset folder.
    4. Create and open a new VFX Graph asset.
    5. Create a new Particle Lit Output and select it.
    6. In the Inspector, select Six Way Smoke Lit in the Material Type dropdown.
    Current state
    This feature is fully supported and ready for production. Since it is a new feature, please don't hesitate to share feedback and report any bug you may find.

    What's next

    For the next iterations on six-way lighting, we will be focusing on Shader Graph integration and Universal Render Pipeline (URP) support. We also have ideas to lift up some inherent limitations of the technique (flatness revealed upon receiving shadows, lightmaps local to a particle and not taking occluding neighbors into account, and more).
    We are also working on adding Volumetric Fog output to VFX Graph, allowing visual effects to generate volumetric fog. Combining this with six-way lighting will allow pushing smoke effects even further. If you want to give it a spin, it is already available in Alpha as of 2023.1.a25.
    And, of course, we are looking toward actual volumetric fluid simulation, playback, and rendering. All these will give you a full palette of techniques to render beautiful and realistic smoke effects based on your target platforms and budget.

    Feedback
    In terms of feedback, we're especially looking for:
    • Can you think of any use cases that are not covered yet?
    • Are there any workflows that are unclear or missing?
    • Is there anything that is unclear or that you don’t understand?
    Please share your feedback in this thread.

    How to report bugs
    Ideally, we'd like any bugs reported through the built-in bug reporter tool, as that will automatically provide us with some relevant context. When reporting bugs, please:
    • Attach a (stripped) project when there are issues with X.
    • Attach X files when there are issues with X.
    Have a look at this page for more information and best practices around bug reporting.

    Once you have submitted a bug report through the bug reporter, please feel free to start a discussion about it in this thread.

    Thank you for your interest, we're looking forward to your feedback!
    The VFX Graph team
     
  2. jRocket

    jRocket

    Joined:
    Jul 12, 2012
    Posts:
    700
    Looking forward to seeing this in URP
     
  3. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    Thanks for doing this.

    Should there be a TX_Pyro_Clouds_A_2x4_P.tga in the ready to use library? It seems to be missing for me.
     
  4. bluescrn

    bluescrn

    Joined:
    Feb 25, 2013
    Posts:
    642
    At this point, they might be better off adding simplified lighting paths to HDRP to make it more 'universal' (more performant on lesser hardware), and deprecate URP.

    URP just seems to be getting left further behind. Still waiting for TAA.
     
  5. Qriva

    Qriva

    Joined:
    Jun 30, 2019
    Posts:
    1,306
    Behind what? in what category?
     
  6. jRocket

    jRocket

    Joined:
    Jul 12, 2012
    Posts:
    700
    TAA is now in URP, but I get your point. It wasn't a good idea to make two render pipelines, as now the developers have to either choose which pipeline make something like this on (and risk upsetting some people) or spend extra time to port it so it works on both.

    Six-way particle lighting for example. Let's hope that changes soon.
     
  7. Qriva

    Qriva

    Joined:
    Jun 30, 2019
    Posts:
    1,306
    So we shall scrap whole pipeline, because there is no six-way lighting.

    I get the point, and it's not like I am fan of what unity higherups doing, but HDRP is one to be scraped in favor of URP :D
     
  8. OrsonFavrel

    OrsonFavrel

    Unity Technologies

    Joined:
    Jul 25, 2022
    Posts:
    187
    You're right , will update the folder ASAP. Thanks for letting me know.
     
    elbows likes this.
  9. OrsonFavrel

    OrsonFavrel

    Unity Technologies

    Joined:
    Jul 25, 2022
    Posts:
    187
    Done
     
    PutridEx and elbows like this.
  10. Slaktarkuno

    Slaktarkuno

    Joined:
    Dec 3, 2021
    Posts:
    10
    Great stuff.
    Here's some feedback to inform of some common VFX workflows that cannot be done right now. If ShaderGraph support is in the works the following feedback might be moot, but until then:
    • Separate UVs for emissive textures - I usually use way shorter flipbook textures (fewer frames) for emissive, this cannot be done as there's just one UV channel available.
    • Emissive Texture per channel multiplier - A common workflow is to use multiple channels in an emissive texture. For example, in an explosion it's useful to be able to have soft scattered emissive in one channel and sharper flames in another for more beauty and more control. The content of these channels are then of course gradient mapped, which right now we can't do for separate emissive textures.
     
    laurentlavigne likes this.
  11. OrsonFavrel

    OrsonFavrel

    Unity Technologies

    Joined:
    Jul 25, 2022
    Posts:
    187
    Morning, and thanks a lot for your detailed feedback.
    Some of your recommendation were considered, but it became obvious in the end that we won't be able to cover all the VFX needs.
    VFX needs can be very different from one project to another, so the ShaderGraph integration seems to be the most effective way to find a right balance between ease of use and flexibility for the users.
    While waiting for ShaderGraph integration, you must have seen it, but a lot of options are available in the inspectors.
    upload_2023-1-27_10-2-55.png

    upload_2023-1-27_10-3-54.png

    On my end, I'm also missing some UVs Distortion and Alpha Erosion that could help a lot for looping Smoke Dissipation.
    Thanks again for taking the time for your feedback, and don't hesitate to share what you do with this feature, as we're always eager to see what the community is creating.
     
    laurentlavigne likes this.
  12. Claytonious

    Claytonious

    Joined:
    Feb 16, 2009
    Posts:
    902
    This looks extremely useful, but only relevant for us once urp is supported.

    I hate the fractured pipelines*so* much.
     
    laurentlavigne and jRocket like this.
  13. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
  14. Qriva

    Qriva

    Joined:
    Jun 30, 2019
    Posts:
    1,306
    There are some advantages of this, they implement various features in HDRP in messy way, then they do it again in URP, but better.
     
    laurentlavigne likes this.
  15. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    Thanks for including some tips about generating content for this using Embergen in the blog post. I was able to get it working with minimal effort. Though I do need to do much more testing to make sure I actually got completely expected results, its a promising start.
     
  16. YuriyPopov

    YuriyPopov

    Joined:
    Sep 5, 2017
    Posts:
    237
    Hi there,
    I’m noticing a significant drop in performance when this is viewed close to the camera. We created some smoke effects for bullet hits. Look and perform e great when viewing from a distance even with multiple instances of the effect. But when it starts to take up the whole screen we drop like 50 frames. Any idea what is going on?
     
  17. OrsonFavrel

    OrsonFavrel

    Unity Technologies

    Joined:
    Jul 25, 2022
    Posts:
    187
    Morning. What you are describing seems to be caused by overdraw. Overdraw can happen when pixel on screen are drawn multiples time. Usually VFX can cause overdraw issue as we often use transparent shaders. It's especially true when you have a lot of Transparent Particles Quads that are stacks on top of each others. This is pretty common and not specific to the 6-way smoke lit Shader.
    What I can suggest to you is to go into :
    Window> Analysis> Rendering Debugger.
    In the Rendering Tab, change the Fullscreen Debug Mode to "Transparency Overdraw"

    This will allow you To Visualize Overdraw and adjust the Number of particles to reduce to overdraw.
    As you can see in this screen, the Overdraw is Pretty Correct. As I only have a maximum of two transparent quads that overlap.
    upload_2023-6-23_9-56-32.png

    But on this screen I've increased a lot the number of particles, so there's a lot of quad overlapping, asking the pixels affected to be drawn a lot of time. And the closer my camera is from the particles, the more each quad will fill the screen, meaning more pixel to be affected.
    upload_2023-6-23_9-59-24.png

    So, use this view to control the number of Particles and reduce overdraw.
    Another thing that you can do to reduce overdraw is to use Octagon instead of Quad.
    This can help you reduce wasted space that don't need to be rendered (Fully transparent areas):
    upload_2023-6-23_10-7-55.png upload_2023-6-23_10-9-26.png

    To do this, select your Output Context.
    From here, in the inspector, change the Primitive Type to Octagon.
    You can now use the Crop Factor to avoid fully transparent areas and reduce overdraw.
    upload_2023-6-23_10-12-45.png

    Hope that this will help you.
     
    laurentlavigne and borgstation like this.
  18. YuriyPopov

    YuriyPopov

    Joined:
    Sep 5, 2017
    Posts:
    237
    Hi, Orson, good to see you again.
    Yes I too suspected that overdraw was the culprit here, so I switched to octagons as you said and made a distance to camera cull in the graph that kills the particles. Fps drops are fixed now :) .
     
    ludovic-theobald and OrsonFavrel like this.
  19. OrsonFavrel

    OrsonFavrel

    Unity Technologies

    Joined:
    Jul 25, 2022
    Posts:
    187
    Glad to know that you resolve your FPS drop. Have a great weekend.
     
  20. gattusoarthur

    gattusoarthur

    Joined:
    Apr 29, 2020
    Posts:
    5
    Thank you very much for sharing. I am not using VFX Graph so I implemented myself based on your ideas, and it works like a charm.
     
  21. jjejj87

    jjejj87

    Joined:
    Feb 2, 2013
    Posts:
    1,116
    What's the license on the library textures? Can we use it in commercial projects?
     
    gattusoarthur likes this.
  22. JulienF_Unity

    JulienF_Unity

    Unity Technologies

    Joined:
    Dec 17, 2015
    Posts:
    326
    The license is Creative Commons. They are provided as is, in public domain. So yes you can use/modify them for commercial projects.
     
  23. RamType0

    RamType0

    Joined:
    Sep 11, 2018
    Posts:
    67
    How can we suppress far clip artifacts for cloud VFX?
    We need very large far clip distance only for cloud VFX.

    I want disabling far clip (by saturating depth) option for cloud VFX.
     
  24. cubrman

    cubrman

    Joined:
    Jun 18, 2016
    Posts:
    412
    The smoke is awesome indeed. It's really sad you still did not add semitransparent shadows for it, even though it's supereasy to do using dithering effect.
     
  25. shikhrr

    shikhrr

    Joined:
    Nov 19, 2013
    Posts:
    68
    Any update for URP?
     
  26. OrsonFavrel

    OrsonFavrel

    Unity Technologies

    Joined:
    Jul 25, 2022
    Posts:
    187
    Yes :) . 6-Way lighting has been exposed in ShaderGraph as a shader for both URP and HDRP in Unity 2023.2.0a19 and above.
    You can keep track of the different features on this board.
    Have a great day.
     
    Slaktarkuno, jRocket and shikhrr like this.
  27. Slaktarkuno

    Slaktarkuno

    Joined:
    Dec 3, 2021
    Posts:
    10
    Awesome progress. Any chance it might end up in any 2022 lts version?
     
  28. OrsonFavrel

    OrsonFavrel

    Unity Technologies

    Joined:
    Jul 25, 2022
    Posts:
    187
    It is not currently planned.
     
  29. Marie_G

    Marie_G

    Unity Technologies

    Joined:
    Mar 9, 2021
    Posts:
    72
    Hello!
    New content has been released to showcase the six way smoke lighting feature, including a VFX Graph sample and a breakdown video!
    See the full announcement here.

    Have a nice day.
     
  30. peterkungen

    peterkungen

    Joined:
    Feb 5, 2015
    Posts:
    18
    Hello! Great news about 6 Light to URP. So I tried to make 6 light to UPR. But I need content to understand it. It differs from HDRP. In UPR it seems like you should make your own "6 way light shader graph" and plug it into your "Output particle six-way lit mesh" (after you toggled it to be 6 way that is) So now I have a vfx urp output linked to my empty shader graph node. Whats next? I have textures and that stuff.
     
  31. koirat

    koirat

    Joined:
    Jul 7, 2012
    Posts:
    2,070
    Are there some good looking examples to download, for example this effect that is shown on the gif in first post in this thread ?
     
  32. peterkungen

    peterkungen

    Joined:
    Feb 5, 2015
    Posts:
    18
    Does anybody has a 6 light shader for URP to share :)
     
  33. atcarter714

    atcarter714

    Joined:
    Jul 25, 2021
    Posts:
    65
    Can someone direct me to the information on how to use the VFX Toolkit HDAs in Houdini to bake the maps properly? My default Labs Flipbook and Mantra setups do things quite differently, apparently, and bake out a series of maps that don't correlate to the inputs in Shadergraph. It looks like Unity wants a lighting buffer encoded into R, G and B channels? I'm not even clear on that, as the information is quite sparse and only "as-is" examples of finished work shown. I'd really like to go nuts with these effects in Houdini and VFX/Shader Graphs but there's no obvious path to using it ... o_O
     
  34. Marie_G

    Marie_G

    Unity Technologies

    Joined:
    Mar 9, 2021
    Posts:
    72
    Hello, this video from the blog post might answer your questions about how to export from Houdini!

     
    lilacsky824 and FredMoreau like this.
  35. atcarter714

    atcarter714

    Joined:
    Jul 25, 2021
    Posts:
    65
    Hey there!

    I've figured out how to render frames but it appears there's no sort of compositing settings for selecting the row/column sizes for a texture sheet, I just seem to get a ton of single frames in individual textures. Also looks like maybe I'm only getting one channel? I'll watch/re-watch that video you've posted and review the steps again, try to sort it out myself, but if you have any more tips about it please let me know. Very close now. :)
     
  36. Marie_G

    Marie_G

    Unity Technologies

    Joined:
    Mar 9, 2021
    Posts:
    72
    Hello,
    To use your exported flipbook in VFX Graph and select individual frames, in the UV mode of your output you can swith to Flipbook, that will give you access to rows and columns selection. Then, using either Flipbook Player block in update or manipulating Text Index attribute, you will be able to achieve complete flipbook workflow.

    Here is the output on URP but it's the same in both pipelines
    upload_2024-3-12_11-38-40.png
     
    laurentlavigne likes this.
  37. atcarter714

    atcarter714

    Joined:
    Jul 25, 2021
    Posts:
    65
    I've managed to get it to the point of rendering sprite sheets, found it kinda tricky to position/setup camera and stuff because it's hidden inside the node/otl from VFX Toolbox ... however, I can't really tell what is going on with "lightmap B" ... it looks like I'm just getting an empty/blank image, and it's not clear how to control the lighting rig position/setup either ... would really appreciate a bit of explanation on how to use this. Gotten quite far on my own but still seem to be short on one of the lightmaps ("B") ...
     

    Attached Files:

  38. atcarter714

    atcarter714

    Joined:
    Jul 25, 2021
    Posts:
    65
    If I use mplay to make a video of the sequence frames and convert it to a gif you can see what the animation looks like ...



    Problem is we don't seem to be able to touch the lights, the "lightmap B" is empty/blank and it's unclear how to address this ... only alternative I know is manually building my own setup from scratch lol
     
  39. OrsonFavrel

    OrsonFavrel

    Unity Technologies

    Joined:
    Jul 25, 2022
    Posts:
    187
    Morning.
    So, The compositing settings can be found in the "Output" Section.
    upload_2024-3-15_10-50-15.png

    First, you need to render your Image Sequence by setting an output folder and Image Sequence name, a per-frame resolution and the Frame Range.
    upload_2024-3-15_10-53-20.png

    Once this is done, you can “Composite” your frame sequence and stitch them together by going into the Compositing Tab.
    upload_2024-3-15_10-54-40.png
    Here, you select an Output Folder and name for your Flipbook and some options : Emissive ? Channel packing etc..
    You need to set the Number of images per Line then the Max Number of Frames.
    It's the same control that you can find on the "Mosaic" Node in Houdini that allows you to create Spritesheet/flipbook thanks to an image sequence.

    When this is done, you can click on RenderLightmap A and then Render Lightmap B.
    You should be able then to find your two textures in the folder that you choosed earlier.
    upload_2024-3-15_11-1-14.png
     
    Marie_G and lilacsky824 like this.
  40. OrsonFavrel

    OrsonFavrel

    Unity Technologies

    Joined:
    Jul 25, 2022
    Posts:
    187
    Normally, you shouldn't have to touch the lighting setup, as everything is done for you. You can change the lighting intensity or Light Angle, but I would suggest that you mostly play with the Smoke/Fire Shading settings.

    Before rendering, be sure that the 6-way light check box and LightRig A and LightRig B are turned on.
    If not, you'll be missing light information. If your Lightmap B is blank, my first guess would be that the LightRig B is turned off.

    The ability to turn them on/off allows you to preview in the viewport your smoke and how it reacts to light, but before rendering, this should be turned back on.

    houdini_nuSaDbz5rB_0000-0140_1000x534.gif
    Here, I can see how the Smoke reacts to lights, but before rendering I need to be sure that those lights are turned on.

    Hope this helps.
     
    Last edited: Mar 15, 2024
  41. atcarter714

    atcarter714

    Joined:
    Jul 25, 2021
    Posts:
    65
    Thanks so much for the response!

    However, it seems like you're more or less describing exactly what I've done. Is there any chance that clicking that "Compositing Network" button or having an additional camera around is interfering/confusing the OTL network ? Or maybe creating things in the wrong order or something?

    upload_2024-3-15_10-51-7.png

    The light rigs are definitely on/enabled and I've been through just about everything, tried changing everything. Maybe the .hip scene has something screwed up or misconfigured in it. I'm gonna try a brand-new scene, simple smoke off the shelf and see if I can get this to work correctly in a different .hip scene. I've dived into and unlocked these nodes and even tried messing around inside them to get something to show up, to no avail. One thing that confuses me is I get a ton of "missing frame" messages if I try to composite a spritesheet unless I render the entire frame range ... ideally, I want my sprite sheet to be 8x8 and skip 4 frames but it seems like it forces me to render all 256 frames into a folder before compositing anything no matter what frame range and increment settings.

    Thank you for the additional information/explanation on things, and let me know if you have any other ideas. I'm hoping that I'm just overlooking something painfully obvious, haha. In the meantime, I'll try a brand new .hip and quick fx smoke to see if I can make something come out!

    Thanks again,

    Aaron
     
  42. OrsonFavrel

    OrsonFavrel

    Unity Technologies

    Joined:
    Jul 25, 2022
    Posts:
    187
    No idea currently, but if your hip file is small enough, you can link it here so I can take a look.
     
  43. atcarter714

    atcarter714

    Joined:
    Jul 25, 2021
    Posts:
    65
    I just realized there seems to be a 6-way smoke rendering node for both the object and stage context that are a bit different. I was messing with the `stage` context, and haven't tried the node for `obj` so I will give that a shot right fast and if it doesn't work out I'll post the .hip files :)
     
  44. atcarter714

    atcarter714

    Joined:
    Jul 25, 2021
    Posts:
    65
    So at first it appeared the same thing happened ... I got two .tga file outputs, lightmap A looked OK, but lightmap B was blank ... but I went to the other folder (`\render`) and found there were 3 `.piclc` (Houdini image) files in there, and those appeared to have captured the information. I converted those to png and attached them, and let me know if these indeed captured the information (looks like it to me).

    I also zipped the brand-new Houdini .hip and output folders and attached that, so we can try to figure out what is going on. I mainly left things alone other than making a more interesting smoke source and some slight tweaks to the DOP net and pyro setttings so it wouldn't be the "default" shelf tool smoke. Perhaps there's some kind of little bug/glitch in the compositing or exporting setup, not really sure. And if you can explain the intended usage and differences between the `stage` and `obj` context versions of the 6-way render node, I'd also greatly appreciate that! I've got a long history with graphics and game development but this is only my first year working with Houdini, so I doubtless have many gaps in my knowledge of the tools to fill in! :D

    Regards and thanks so much!

    Aaron
     

    Attached Files:

  45. atcarter714

    atcarter714

    Joined:
    Jul 25, 2021
    Posts:
    65
    @OrsonFavrel forgot to tag you in my previous response so I figure you might have missed the above post. If you haven't had time to look into this yet though no big deal, I will wait. :)
     
  46. atcarter714

    atcarter714

    Joined:
    Jul 25, 2021
    Posts:
    65
    Still nothing on this? I guess maybe @OrsonFavrel has been super busy or away from work or something. I'm still really interested in the subject and VFX Toolbox in general and curious if that was all working correctly. I'd also really like to see the package get some TLC and maintenance/updates, and would be willing to help out. I've kinda had this on pause while waiting to find out and have been working on custom Houdini Engine integrations :)
     
  47. OrsonFavrel

    OrsonFavrel

    Unity Technologies

    Joined:
    Jul 25, 2022
    Posts:
    187
    I’m truly sorry, I’ve started looking into it but sadly there’s some issues on my end with the karma renderer license that prevent me from testing the this part of the tool. I’m doing my best to sort this out to be able to test this. Now, as you noticed they’re two tools. One in the Obj context and the other in the stage context. The one that you can find in the OBJ context is using OpenGL renderer . This means that it’s very fast to render your spritesheet while still getting decent results. To get a better quality with nice scattering effects it’s better to use the one in the stage context that relies on karma XPU renderer, but the render time is longer.On my end I was mostly using the OpenGL renderer tool for quick iteration to bring the simulation in Unity. This allow for quick iteration and back and forth. When happy I was rendering with the other tool to get a better quality result. Hope this helps to clarify the differences between the two tools.
     
    atcarter714 likes this.
  48. atcarter714

    atcarter714

    Joined:
    Jul 25, 2021
    Posts:
    65
    Ah, yes, that definitely brings some clarity to it and explains why there are two different nodes! :)

    Sorry to hear about the complications with Karma and licensing! I know that sort of stuff can be a real pain, especially at an organizational level where you have to go through other people to get something taken care of (worked in some tech director/engineering manager roles before and those kinds of issues always got piled on me, haha). Hopefully you guys can iron it out sometime soon so we can resume some Houdini/Pyro fun! :)

    I had a couple other big technical hurdles to deal with in pre-production though, so I've been chipping away at those and waiting patiently for more information about this. And I can keep myself occupied a while longer with those other things (mostly character/animation pipeline and tech art stuff -- been making a facial animation pipeline with Omniverse + Houdini --> Unity!) ... that being said, the OpenGL renderer is actually still pretty good and sort of analogous to using OpenCL/Sparse Pyro sims for quicker iterations, so I'm very glad to know the purpose of those nodes/contexts! :D

    I'll be hanging around here though if you come up with any more interesting information (the documentation for VFXG is a bit "sparse", lol, pun intended) and will be thrilled to hear of it! :D
     
  49. impheris

    impheris

    Joined:
    Dec 30, 2009
    Posts:
    1,652
    Thank you! i did not understood this feature but now i see and i must say it is pretty good! i like it, specially how it looks those clouds on that test project, it is kind of heavy on performance tho...


    i think i can use it in a scene with a dense fog on a interior, kind of a terror scene