Source Filmmaker

Source Filmmaker

547 valoraciones
Volumetric colour banding fix
3
   
Premio
Favoritos
Favorito
Quitar
Universe: Original IP
Material
Etiquetas: SFM
Tamaño
Publicado el
Actualizado el
68.394 KB
10 ABR 2018 a las 5:25 a. m.
10 ABR 2018 a las 5:59 a. m.
2 notas sobre cambios ( ver )

Suscríbete para descargar
Volumetric colour banding fix

Descripción
This is a fairly basic (but nonetheless reasonably effective) fix for colour banding in SFM, most often noticable in the haze of volumetric lights.
Without going into too much detail, this banding is caused by Source using simplistic rounding when converting from its internal HDR format into the 8 bits per colour formats used by most picture formats and many screens.

Although one way to fix this is by exporting using HDR-compatible PFM image sequences, not everyone wants to (or can) mess around with HDR formats all the time, so a post on Reddit got me thinking about the possibility of more user friendly solutions.

And this is what I've come up with. This uses SFM's overlay materials to add in a specially designed noise layer before SFM converts to 8 bits per colour - this stops SFM rounding off the pixel colours into solid bands, and gives a dithering effect that results in a gradient perceptually closer to the colours SFM originally calculated.

Of course, this does add a pinch of grain to the image, but the effect generally looks much more natural than colour banding, and it's a necessary compromise within the limits of 8 bit-per-channel colour.

Using this fix
This fix is applied as an overlay material effect (and therefore will not work in poster mode - see below).
If you need a guide on the basics of applying and adjusting overlay materials, it is covered in the official Valve tutorials, starting here.

There are several variants of this material, optimised for different export resolutions. Use the material that matches the resolution you're using - I've given you a choice of 360p, 480p*, 540p, 720p, 1080p, 1440p and 2160p (4K).
If there's any common or semi-common video resolutions that I've forgotten, feel free to ask and I can add that in**.
* Note that because of the unusual aspect ratio SFM uses as its default 480p setting, the effect may be less than ideal if you use the default 720x480 resolution. These materials are all optimised for SFM's normal 16:9 aspect ratio.
** Unless it's a potato or toaster resolution. If you're exporting at 144p or 240p, you deserve all you get.


After applying the material, you will need to adjust the alpha/transparency of the overlay to taste. (Again, doing this is covered in the official Valve guides).
A scene with moderate colour banding will probably work well with an overlay transparency of about 10-20% (or a value of 25 to 50, depending whether your colour picker is in integer or percentage mode), but scenes with heavier banding may require higher settings. Note that the higher the value, the more noise may be visible, particularly in very dark shadows.

(Note: To copy in some feedback, a user has noted that if your video software has decent colour correction, darkening the shadow regions will reduce the "static" this overlay can cause in the blackest areas. It may be possible that SFM's internal colour correction can be used for the job, but I've not tried this yet).

Although this fix is primarily made for colour bands in volumetrics and smoke particles, it should also stop SFM calculating bands around the edges of shadows as well.
(It can't do much about low quality textures that have banding in the actual file though - sorry!).

Image/Video compression
Because noise does not compress efficiently, using this overlay will increase the file-size needed for the same final image/video quality. For this reason, I recommend that you only use this layer over shots that have visible colour banding, such as dark scenes with volumetric lights.

This is however a (deliberately) non-animated overlay, which means the noise is constant from frame to frame, which should make it compress somewhat more efficiently in a decent video format.

Poster exports
This will NOT work for poster exports, because overlay materials don't work in this mode.
(Summarising a lot, because posters are rendered as several tiles, SFM can't apply post-processing effects to the individual tiles without causing seams between the tiles, and it can't apply them to the final image because the final image no longer contains the original HDR data).

Please don't waste your time (or mine) by posting comments telling me it doesn't work if you're trying to use posters; I know, but I can't do anything about it.

If you want to export a high resolution still, you will instead need to use an image or image sequence export with SFM running with either the 1080p or 4K launch option:
https://developer.valvesoftware.com/wiki/SFM/Rendering_at_1080p
https://developer.valvesoftware.com/wiki/SFM/Rendering_at_4K
(This is advisable anyway - poster exports don't render effects like bloom, often have problems with particles or flexes resetting, and sometimes even have seams between tiles).

How you can help me (and others)
I wouldn't normally ask (I think items should succeed on their own merits), but if you've found this useful, please remember to rate and favourite it - this isn't the kind of thing users will naturally know to search for, so it will be able to help more people in future if it can get to a decent position on the all time "popular" lists.

Includes:
MarcoSkoll\Volumetric Fix\360p.vmt
MarcoSkoll\Volumetric Fix\480p.vmt
MarcoSkoll\Volumetric Fix\540p.vmt
MarcoSkoll\Volumetric Fix\720p.vmt
MarcoSkoll\Volumetric Fix\1080p.vmt
MarcoSkoll\Volumetric Fix\1440p.vmt
MarcoSkoll\Volumetric Fix\2160p.vmt


Additional keyword: Color, for people who spell it without a U.

Posting spam chain messages in the comments will result in a summary deletion and ban from commenting on any of my items, and I won't be accepting appeals. Given that I'm planning some complex items (e.g. bokeh gobos) you might actually want to ask questions about using, do yourself the favour and don't get banned.
Discusiones populares Ver todo (1)
2
10 SEP 2023 a las 4:44 a. m.
How to use.
JIIINGJING
92 comentarios
👾 🅼 🅰❎👾 15 MAR a las 6:31 p. m. 
GENIUS! :brown_bomb::praisesun:
Brad 10 AGO 2023 a las 8:09 a. m. 
This fix worked WONDERS. Thank you so much! a transparency value of 59 was the sweet spot for me, with a particularly dark scene at 2160p(4k) with harsh volumetrics. I can't thank you enough for this! <3
Mr. Egg 3 JUL 2023 a las 9:17 a. m. 
I have never in my life heard of comment banning :sotxbones:
JIIINGJING 15 JUN 2023 a las 2:34 a. m. 
Thanks!
RaiSokudo 24 MAR 2023 a las 3:22 p. m. 
it might be perfectly normal if you can't see the difference

i could be wrong but you may have to be a "tetrachromat" to see the difference

which is rare, especially for men




...which means i'm special, ah kee kee kee
Marco Skoll  [autor] 6 DIC 2022 a las 4:16 p. m. 
@TNT_NINJASHARK If you genuinely cannot see a difference in the image, your screen may require calibration or have a low luminance.

As is, I actually boosted the contrast in the example image to make it clearer, and yet many people still see the problem at its normal contrast level.
tactical_grilledcheese 6 DIC 2022 a las 3:52 p. m. 
Bro is it just me because i can't tell the differance on the picture
steeledgator 27 MAY 2022 a las 9:16 p. m. 
Beautiful effect for the volumetric lights, but it adds a lot of grain (I read the entirety of the description before, but I haven't now when I"m using it, so I may be using it wrong), alpha adjustments help though.
{4D$KNЙ}_[DR].4.CH[i]LL(a) 26 OCT 2021 a las 2:47 p. m. 
Why, when I turn on the volumetric light, is it missing in the rendered image? I can’t do the effect of the "stream of light" type now
skullmxde 30 NOV 2020 a las 6:59 a. m. 
so it's basically the same method used in Titanfall 2?