A thought... Why doesn't unreal allow postprocessing before lighting.

I was thinking, wouldn’t it be incredibly useful if you could apply post processing shaders to gbuffers, before any lighting was calculated? Doing so would enable you to modify things like roughness, normals and basecolour, within a post-process.

Does anyone know why epic have never done this?

not sure what effects you would want to get out of it. modifying normals for sure will mess things up. roughness would control what exactly? basecolor would be a general tint or some disco rendering?

i theory you could use the dbuffer and a huge camera aligned decal to force a kinda response. i’ve not messed with it alot but prismatica has a good video that explains a fair bit howto pass data thru the buffers. and decals are processed before the lighting pass, afaik.

The main uses that came to mind for me, are weather effects, and stylized postprocessing.
Currently, if you want to do these things, you may need to add a material function into every one of your shaders. A post process could replace that in some cases, this could result in better performance, and lower shader compile times.

Dbuffer decals have the limitation that they cannot read the gbuffers that they are modifying. Maybe the postprocessing I described would have the exact same limitation though, im not sure.

yes. you need mfs for weather. i see the point tho. like a custom lighting function. instead of using the default gbuffer “composite”. you can’t do this in the material editor tho. i’m sure it could be done modifying the private engine shaders. this is a lot of shader code to learn tho.