Help making custom scene color tint post-process effect

For reasons, I need more flexibility to control what objects in the scene have color tint applied to them. Does anyone know how to replicate the default Scene Color Tint post process effect in a post process material?

If I take the scene color and multiply by a color, it ends up being far too monochromatic. I’ve tried desaturating and using power, but can’t get there. Any rendering gurus who could point me in the right direction?

Thanks



If you are multiplying the green and blue channels by 0, then yes, there will be absolutely no green or blue in the result.

try (1.25,0.75, 0.75) or something along those lines; you want to ENHANCE the red, not REMOVE other colors.

You can also fade by distance, pixel-depth, etc, etc so stuff blends over an axis.

I should have probably been more clear, I was looking for a solution that works for any color… I just picked (1,0,0) as an example.

Maybe a better question should have been ‘Is there a way to crack open the engine code and see how Unreal’s Scene Color function works?’

For now, I’ve created a [rather complex] post process material that does a pretty decent job of faking it, and I’m calling the problem solved, for now, but it definitely feels more expensive than what the engine is doing.

The source for the engine is available.

Try looking at the Custom Depth option. It allows one to render something to a depth-buffer at different levels/values, which you can then pick out and isolate in a material. It ought to allow you to ‘tag’ or otherwise have ‘those objects’ render to depth-buffer layer 222 (for example) and you can isolate layer 222 in your material so the maths only affect those objects.

Try this for info: https://www.tomlooman.com/multi-color-outline-post-process-in-unreal-engine-4/

Yep! Custom depth is exactly what I’m using to mask, within my PP materials. I’ve got a handful of comments on Tom’s post, from years ago, as a matter of fact. :wink:

I was only asking about the tinting function… I guess I just need to take some time to learn how to explore the source code properly.

Personally, i am still unsure, what exactly you are trying to get as endresult, do you have an example picture of a before and after applying your desired tint and how it should look in both cases?
Because… if i would use your shown math in a normal material, wouldn´t i get the very same insanely red color for that object?
Because you use a multiply with zero for green and blue channel as second step → your shown example color 1 red, zero green, zero blue, which indeed erase every other color from your first step, that is not red. Thats why Frenetic mentioned, that you should multiply with a not so pure red.

Do you just want some kind of red overlay over your scene color? Then maybe lerp or add your result, that you get right now, with the normal scene color as an additional step, before feeding it into the emissive color input.