Download

Post Process Material - Inverting object color, but not shadow or AO.

Hey all!

I’m currently working a rough prototype of a game I’d like to develop. One of the core mechanics is swapping between two characters. I help illiterate which character the player is currently controlling I’d like to invert the (almost monochrome) world color. The aim is something similar to bellow without having to actually modify the materials (i.e avoiding having everything in the world be a blueprint / dynamic object). I don’t think I can get it to be this perfect, but that’s the target.

[shot]http://puu.sh/mpRK4/e16a728219.jpg[/shot][shot]http://puu.sh/mpRL5/b1e4c8790f.jpg[/shot]

My first implementation was really simple; A Post Process Material that took the Post Process input and ran it through a one minus, simple. While this effectively gave me what I wanted I wasn’t completely happy with how clearly inverted it looked. My main issue was the white shadows and AO. I pulled the AO out and multiplied it with the inverted Post Process input and got the following;

[shot]http://puu.sh/mpEKF/8407cf596a.jpg[/shot][shot]http://puu.sh/mpEPR/79a4661392.jpg[/shot]

From there I wanted to try and pull out the shadow info by dividing the Post Process input with the Base Color, but it didn’t really work. I made a few variations on this but never got a better result than above. The thing I ran into was the black becoming way too dark, I think it was largely because what I thought was just shadows actually wasn’t at all.

I was hoping someone would be able to give me a few pointers here. I don’t actually think I can get something like the example shots, but I’m sure there’s a better version of what I’m doing out there. FYI, I’m not a c++ dev, so I’m sticking to BP with this project.

Thanks for any help!

You can’t just invert albedo color at post process stage. I have many similar gbuffer modification needs and I have just added them as material functions for my master materials.
Edit: You should use Material parameter collection. Then you can with single blueprint globally set material input. Then just invert base color from all materials. This way you can avoid making all objects for needing dynamic materials.

Thanks Jenny! I was talking to a few irc friends about this and one of them suggested using a material parameter collection. I wasn’t sure but I looked into it and it does look like the best option! Thanks for posting, having a second opinion suggest them really helps!