[RELEASED] Hx Volumetric Lighting

Hx Volumetric Lighting is the easiest way to get high quality volumetric lighting in your Unity scene, adding depth and realism with rays of light and fog of variable density. It’s easy to use and runs efficiently.

Asset Store link

Documentation

IMPROTANT - Unity 5.6 currently has a bug with rendering Particle emitters in a command buffer. So Density particle support is unsupported in 5.6 till unity fixes the bug.

Features

  • Supports Shadow casting lights
  • Supports multiple lights - any number and combination of point lights, spot lights, and directional lights.
  • It’s dynamic - you can move lights around in real-time.
  • Vary the air density with your own particle emitters or 3D noise.
  • Use height fog to get a low hanging fog look.
  • Mie scattering for more realistic results
  • Supports transparency (included standard shader)
  • Supports light cookies.
  • Supports low resolution rendering with advanced up-sampling, allowing faster frame rates.
  • Easy to use. Just drop a few scripts on your camera and lights.

Requirements

  • Forward/deferred render Path *
  • Linear Color space is recommended (gamma version awaiting approval)
  • Directx 9/OpenGL3 and above.
  • Shader Model 3 and above.
  • Desktop and console support.(mobile is not supported)
  • Custom transparency shaders will need to be modified

*Is not friendly with MSAA in forward rendering mode (yet), Has the same issue as the directional light shadows because its a screen space effect.
Roadmap

  • Downsampling depth speed improvements
  • Better depth downsampling
  • Various speed improvements
  • Refactoring of existing code
  • VR support (untested, may already work)
  • Faster transparency and Density support for dx11 (currently using dx9 implementation)

Known Bugs

  • [2017.3 beta] New version has been submitted to fix compatibly issues with the beta, should be live before the end of Nov

https://www.youtube.com/watch?v=lQ2xMp7X9MA

21 Likes

Excellent work, will be picking this up in the very near future.

@Lexie - What about using this with UBER or ShaderForge, etc.?

Also, would it work with water solutions, like AQUAS or Ceto, and sky solutions like TrueSky, and Time of Day?

Just curious how this behaves in the wider world of Unity environment plugins.

it will work with any none transparent shaders you make in ShaderForge and will work with any of the none transparent versions of UBER.

Transparent versions would need to be edited. Its only a few lines of code.

1 Like

I’ll push a new build tomorrow that adds some features / bug fixes.

  • Included shader variant collection to fix frame skips when using occlusion culling and different light settings.
  • Gamma support.
  • Option to remove random noise in final apply (used to remove color banding)

I’ve owned almost all volumetric/fog solutions that have been in the Asset Store over the years and I have no hesitation in saying that this is the best one :slight_smile:

4 Likes

Hey @Lexie how many custom shader keywords are you using?

For working custom transparency shaders it adds 6.
The spot point and directional lights use 12-14. But no other shaders reference most of these keywords.

I’m cutting these numbers in half in the next build. I was using keywords for features that where turned off (for debugging purposes)

1 Like

Thankfully, they’re doubling the shader keyword limit in 5.5!

6 keywords is not terrible in the end although I do find myself avoiding using the keyword heavy assets. This looks really great and while I have something else for mobile thankfully, this looks the bees knees for desktop use

That’s awesome :smile: I’m running out

:slight_smile: they need to!

1 Like

I’ve pushed an update that adds Gamma support, Automatic shader warming and cuts the shader keyword usage in half.
Just awaiting approval. Transparency only needs 3 keywords now.

I’m currently working on some web demos and some demo videos to show off the tool.

2 Likes

Has anyone tested how well this works with Alloy?

What are the expected performance for the asset? Can you post some screenshot or demo with profiler readings?

Looks just brutal :smile:

has anybody tested this with UBER and/or SEGI?

performance? :slight_smile:

“*Is not friendly with MSAA in forward rendering mode (yet)”

I guess that means VR is basically out of the question at this moment depending what the “not friendly” part means? :slight_smile:

Added to wish list anyways.

@Lexie : This looks fantastic!

Three questions, though:

  1. How does this interact with emission light sources?
  2. How would this asset interact with an asset such as SEGI (https://www.assetstore.unity3d.com/en/#!/content/64763)?
  3. Is the current price expected to be the final price, or is the price expected to raise over time?

Thank you and be well!

  • S.

The volumetric effect doesn’t get effected MSAA, So if you have really strong volumetric rays going behind an object, the volumetric effect will have an aliased line which can give the effect of AA being turned off. I’m looking into applying the effect before the MSAA resolves.

It wont interface with SEGI bounced lights, but you could have this running along side it. The way SEGI stores its information should mean I can add support for it. I’m waiting till @sonicether adds cascade volumes before I look into support

Uber should work out of the box for any opaque shaders, The transparent ones will need a modification, There is a tutorial in the docs.

Ill answer performance below.

  1. It only interacts with dynamic light sources right now (spot, point, direction). The baked data of enlighten isnt in a format that i can access/raymarch. I’m looking into using light probes to get some ambient light added.

  2. see above answer

  3. no idea.

Performance is hard to pin down. it depends on the amount of volumetric lights in your scene, how many pixels each light volume takes up, sample count and the volumetric resolution your rendering at. I’ve spent a long time working on upsampling to make quarter resolution rendering a viable option.

So far every studio that has tested out my volumetric lighting has reported better results and performance then the methods they where using before.

I’m working on a video and and some test scenes right now. Hopefully ill have them live soon.

6 Likes

I’m currently working on adding unity Terrain support for all the tree and grass shaders, I’ll also convert all the other transparency shaders while I’m at it.

2 Likes