Screen brightness and contrast settings and tilt shift effect

#1

Hey everyone!

Is there a quick way to add brightness/contrast setting to main render script for the whole screen and layers? Found no info on that matter. Hope that topic will be useful for other newbies too.

And maybe someone knows any info on how to add render effects like tilt shift lens to one of my render layers? Something like that:

Thanks a lot!
I’ll keep searching, just thought that someone already could do something like that.

0 Likes

#2

The general technique for brightness, contrast, etc. is: Instead of rendering things directly to the screen, you draw them onto a separate texture (a “render target”), then you use a flat quad model with that texture applied to it, and you can give it a custom shader to do whatever per-pixel effects you want.

Check you the thread on 2D lighting for more info: Simple 2D Lighting

For a tilt-shift that depends on actual depth, I’m not so sure. I think it would be about the same, but you would need to use the depth buffer as well.

3 Likes

#3

Thanks! Quite obvious) That’s where I’ll start.
We’re making a 2d isometry, so guess tilt-shift should work same as with any photo just centered on cursor maybe. There should be a bunch of algorithms for C#. I’ll keep looking.

1 Like

#4

There are some tilt shift shaders on Shadertoy, such as this one. Getting the shader to work in Defold is easy if you know what you’re doing. If you don’t, well, it’s a great learning experience if you have a day or two to spare =P

This tutorial should tell you all you need to know.

3 Likes

#5

Sure, I have! That’s why I was asking. Tutorials are very welcome. Thanks! =)

0 Likes