#Can you show some screenshots of the
1 messages · Page 1 of 1 (latest)
This is the effect I achieved with the fog. The posterization, outlines, and crt effect are all made by me (with some help)
(I created a thread because I dont want this seen as a devlog)
Do you mainly need it for the street lights, like this screenshot? If so, and if you don't require volumetric shadow support, which should not be required to achieve the effect in the screenshot, then I would recommend an analytical fog approach. It is much, much faster compared to the raymarched, volumetric fog in HDRP or equivalent in URP. It's only limited by not supporting casting shadows within the volume.
I've used this asset with URP in this game jam project, specifically to achieve the street light fog effect.
https://assetstore.unity.com/packages/vfx/shaders/fullscreen-camera-effects/analytical-volumetric-lighting-urp-performant-raytraced-volumetr-266586
https://peturdarri.itch.io/finding-home
Not free, but cheaper than the $70 dollar asset you were looking for.
Have you also looked for free, open source solutions for URP, such as this one?
https://github.com/CristianQiu/Unity-URP-Volumetric-Light
This package is not analytical, which means it's heavier on performance and can be visibly low resolution depending on your settings, compared to the analytical fog, which is not limited by voxel resolution.
But if you're intentionally rendering at low resolution and crunching the fidelity with post processing, that might not matter to you as much.
so the analytical fog uses a raytracing technique, but its more performant than voxel based? That is very interesting.
I guess that makes sense, since constant rendering of a 3d texture would use more vram than raytracing
Yeah, my game is meant to look old, for the analog horror aspect.
It's faster because it doesn't need to ray march. It makes some assumptions to simplify the math, such as perfectly uniform fog density, which is why it can't support volumetric noise textures or shadows. But if you don't need those, it's a much simpler and faster method.
HDRP and most volumetric lighting solutions use raymarching.
Here's an explanation of how it works. I wouldn't really call it ray tracing, at least it's nothing like the ray tracing most people refer to.
https://ijdykeman.github.io/graphics/simple_fog_shader
I want a simple, fast shader that gives me fog illuminated by point lights. To do this, I created a screen-space effect that achieves the results below. Th...
The asset I linked adds some additional culling optimizations to make multiple lights cheaper to render.
the paid one or the foss one?
The paid one
hmm, alright
I'm gonna try out the foss one and if it doesnt work I'll see if I can get the paid asset.
I feel like you can obtain that effect with just quads honestly
From afar, maybe. Harder to maintain that illusion if the camera goes into the volume.
I need to kinda get an idea to how it's supposed to look inside of the street lamp
cause you can also do something like an inward sphere, and maybe some masking
With the crt effect disabled, this is how it looks
Hmm, potentionally able to do that with the depth buffer
and the similar idea of an inward sphere
I just tried this one and it looks great, but it has some weird dithering going on.
looking at it in runtime, it seems its just noise
Could be because that face of the box is almost exactly parallel to the light direction, so it's right on the edge of casting a shadow.
it actually seems to be directly caused by the fog, viewing at an angle you can see the noise only appears in the locations with high density.
Mm okay. There's almost always noise added to raymarched volumetrics, because it has to be done at lower resolution for performance and upscaled. Noise helps hide the low resolution.
right, but normally the noise is denoised using blur techniques, but turning up the blur in the asset doesnt seem to effect this.
I just messed with some settings, and turning down the attenuation distance does this
turning it up does the opposite, but also increases the brightness of unlit areas of fog
This issue I have just discovered with these two assets, is they don't support proper rendering of transparents. Like Screenspace - Camera GUI or a custom glass texture.
I think for the UI, you can prevent it from getting rendered on top like that by have two cameras: a base camera that only has the analytical volumetric lighting and an overlay camera that has everything else and then have the UI render on the overlay camera. This shouldn't have any extra performance cost over just one camera, it's just splitting the same workload.
But yeah, transparent materials are trickier. These assets usually implement these as post processing effects, which is very convenient and can be applied to any scene easily, but doesn't work correctly with transparency. The fix would be to calculate the fog in the object's shaders directly, but that means every shader on every object needs to be custom, with support for the volumetric lighting asset.
HDRP's fog likely works by applying the effect as a post processing step immediately after rendering opaque objects and then apply the fog in each transparent object's shader directly in the transparent pass. Which means every HDRP shader likely has special consideration for volumetric fog.
I went into the asset and made the fog render before transparents
now transparents, like UI and TMP World Space are rendered on top of fog
The result might look a bit better, but still won't be correct.
What do you mean?
That is, if you have a transparent material far away, it will render on top of the fog, so you'll be able to see it through the fog, when everything opaque near it will be obscured.
If you have heavy fog that is
Thats actually kind of useful for my game
Also depends on how transparent the material is. If it's very transparent glass, it will mostly show the fog behind it as well, but still cut through a little.
the only things in world space that have transparency are items that you can find on the ground, and it would be pretty useful for the items to show through the fog.
Well, that's good. But if you ever add particle effects, those will also cut through unless you use alpha clip.
Did you modify the FOSS asset? I figured the analytical asset is harder to reorder since it's implemented as a post processing effect, but maybe that's easy to change.
I modified the foss asset