Welcome, Guest.
Username: Password: Remember me

TOPIC: Has someone made a flashlight shader? Here's one.

Has someone made a flashlight shader? Here's one. 2 months 2 weeks ago #1

I was missing a flashlight in Deus Ex Mankind Divided, so I ended up making a shader that replicates one.



Download: Right click and save as...

It supports adjusting the halo size, color, brightness and distance. You can also disable the small texturing effect I added, as well as the distance effect (for games with no depth buffer, or if you don't need it). The macros are pretty self-explanatory.

I didn't implement in-shader shortcut keys as I feel toggling the shader on/off with a bound key is a simpler and more easily customizable solution.
Likes to reinvent the wheel.

My shaders repository: www.github.com/luluco250/FXShaders
Last Edit: 2 months 2 weeks ago by luluco250.
The administrator has disabled public write access.
The following user(s) said Thank You: crosire, NattyDread, brussell, jas01, OtisInf, WalterDasTrevas, Fu-Bama, Viper_Joe, Arkane, thalixte and this user have 2 others thankyou

Has someone made a flashlight shader? Here's one. 2 months 1 week ago #2

Cool. Just an idea, you have an access to depth information and you know where is the source of light. Would it be possible to add some flashlight shadows, using that information?
The administrator has disabled public write access.

Has someone made a flashlight shader? Here's one. 2 months 1 week ago #3

WSH303 wrote:
Cool. Just an idea, you have an access to depth information and you know where is the source of light. Would it be possible to add some flashlight shadows, using that information?

I've thought about that, possibly, but you must understand that perfectly centered spotlights don't produce shadows that are very visible to someone behind the light, so the effect would be minimal. I guess I could depth-test and then cast some blurred shadows from it onto the flashlight texture itself, could look pretty interesting.
Likes to reinvent the wheel.

My shaders repository: www.github.com/luluco250/FXShaders
The administrator has disabled public write access.

Has someone made a flashlight shader? Here's one. 2 months 1 week ago #4

I made a small update that improves how the flashlight texture blends into dark environments. It's already updated in my repo so the link should already point to the latest version.

Screenshots - Left is the old version, right is the new one.
Warning: Spoiler! [ Click to expand ]
Likes to reinvent the wheel.

My shaders repository: www.github.com/luluco250/FXShaders
Last Edit: 2 months 1 week ago by luluco250.
The administrator has disabled public write access.

Has someone made a flashlight shader? Here's one. 2 months 1 week ago #5

Isn't the new verion more washed out? I like the older verion a little more.
The administrator has disabled public write access.

Has someone made a flashlight shader? Here's one. 2 months 1 week ago #6

jas01 wrote:
Isn't the new verion more washed out? I like the older verion a little more.

Either that or you literally can't see anything too dark at all.

The problem is that there's literally no light information in pixels very close or equal to zero, making it impossible to increase the brightness, so I basically "create" information, thus it can look washed out, but I limited it as close as I could to only pixels that need it.

If you'd like I can make an update to make it optional.

UPDATE:

Done, you can now revert back to the previous blending method by defining a FLASHLIGHT_NO_BLEND_FIX=1 macro.

Warning: Spoiler! [ Click to expand ]
Likes to reinvent the wheel.

My shaders repository: www.github.com/luluco250/FXShaders
Last Edit: 2 months 1 week ago by luluco250.
The administrator has disabled public write access.
The following user(s) said Thank You: jas01

Has someone made a flashlight shader? Here's one. 2 months 1 week ago #7

I understand now. Thank you for the update. Gonna try both modes and see what works best for me.
The administrator has disabled public write access.