Rendering half the screen in negative

Hello,
I have very little experience with shaders and post processing effects and I am not even sure if this is possible.

I have a 2D game, portrait, mobile.

I would like the bottom half of the screen to be rendered in negative colours.

Any suggestions to gaining this effect would be appreciated.

I would use 2 camera with a custom replacement shader to invert the color for the bottom camera.

1 Like

Wouldn’t that double the draw calls? Looking from a performance perspective.

Yes, 2 cameras will do that. Are you rendering 2 scene or the same scene just with the color inverted on the bottom half of the screen?

Also, doubling your draw calls may be worth it if you really want this effect. Get it running and see what the performance hit is.

1 Like

I am looking at having white contrasting with black in the top half, and the opposite in the bottom.

Also, how would I stitch two cameras together to make it appear as only one? I have only every used multiple camereas when displaying them via RawImage on a canvas.

depending on how complex are your models you could simply duplicate each object and apply a material with the inversed colours, then put it on a separated layer, then select the culling of each camera so one renders the inversedobjectsand the other the inverse, you will have twice as much objects but if they are low poly it should not affect much, so well you have choices, just try them till one works good for you.

1 Like

Another approach could be to overlay the bottom half with an UI image that is using a shader/material that inverts colors using the blend mode hardware. It’s rather easy to setup and does not require additional cameras or modifying other assets.

Maybe it works for your project. I created a small example project, download link can be found at the bottom of this post.

Download Unity 5.3 example project:
http://www.console-dev.de/bin/Unity5_Example_UI_InvertColor.zip

1 Like

I was thinking this could be an option, thanks for the links!

You can do it with a simple image effect.

Hi,
Actually I am looking for the same effect (negative part of the screen) But the solution that Peter77 provided only works on UI elements and I need it to work on sprites outside the canvas.
How to achieve this result? Does the shader need to be edited ?

I added a Sprite version to the example project.
The project contains two folders now, “UI” and “Sprite”. In each folder you can find a scene that shows the effect.

Download it from here:
http://www.console-dev.de/bin/Unity5_Example_UI_InvertColor.zip

Thank you for your reply
Is there a way to use one shader to do both UI and sprites?
Or can i overlay two UI images one of them has negative for UI and the other has negative for sprites?
Or are those shaders functional for both?
Thanks again