I have a selective toon shader that is a post-process material. It calculates and uses colour & lighting information from the SceneTextures PostProcessInput0 and DiffuseColor, and uses the custom stencil buffer to selectively apply it. The intention is to only toon shade characters (and not the environment) like so:
But when I add volumetric fog, it obviously doesn’t render on top of this post process. The fog in this image is blue and thickened for illustrative purposes:
I noticed some seemingly unused PostProcessInputs from my material editor:
I also noticed in Engine\Shaders\Private\BasePassPixelShader.usf, there is a “Fogging” calculation that ends up getting combined with the scene albedo. Is there a way for me to write that “Fogging” info to one of these PostProcessInputs? If so, I could un-blend the fog from the scene colour to get the correct lighting information for my toon shader again, and then re-blend afterwards so that it renders on top of my toon shader.
Has anyone written custom information of any kind to these PostProcessInputs before? I’m comfortable editing engine code to make this work. It’s pretty essential for the visual style of our game. Any help would be hugely appreciated!