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

8741817--1183878--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

  • Download Unity 2022.2 or newer through the Hub.
  • Download the ready-to-use maps or generate your own ones in Houdini or Blender with the plugins we provide in the VFX Toolbox
  • Drag and drop the maps in Unity’s Asset folder.
  • Create and open a new VFX Graph asset.
  • Create a new Particle Lit Output and select it.
  • 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

14 Likes

Looking forward to seeing this in URP

4 Likes

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.

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.

Behind what? in what category?

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.

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 :smile:

You’re right , will update the folder ASAP. Thanks for letting me know.

1 Like

Done

2 Likes

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.
1 Like

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.
8760703--1187608--upload_2023-1-27_10-2-55.png

8760703--1187611--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.

1 Like

This looks extremely useful, but only relevant for us once urp is supported.

I hate the fractured pipelinesso much.

2 Likes

I like this test project:

(you still need to download the ready-to-use maps and put them in the right folder before loading this project in Unity)

There are some advantages of this, they implement various features in HDRP in messy way, then they do it again in URP, but better.

1 Like

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.

3 Likes

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?

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.
9099820--1261084--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.
9099820--1261096--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):
9099820--1261117--upload_2023-6-23_10-7-55.png9099820--1261120--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.
9099820--1261123--upload_2023-6-23_10-12-45.png

Hope that this will help you.

3 Likes

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 :slight_smile: .

2 Likes

Glad to know that you resolve your FPS drop. Have a great weekend.

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.