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

  • luluco250
  • Topic Author
More
5 years 3 months ago - 5 years 3 months ago #1 by luluco250 Has someone made a flashlight shader? Here's one. was created by luluco250
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.
Last edit: 5 years 3 months ago by luluco250.
The following user(s) said Thank You: crosire, NattyDread, brussell, jas01, OtisInf, WalterDasTrevas, Fu-Bama, Viper_Joe, Arkane, thalixte and 3 other people also said thanks.

Please Log in or Create an account to join the conversation.

  • WSH303
More
5 years 3 months ago #2 by WSH303 Replied by WSH303 on topic Has someone made a flashlight shader? Here's one.
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?

Please Log in or Create an account to join the conversation.

  • luluco250
  • Topic Author
More
5 years 3 months ago #3 by luluco250 Replied by luluco250 on topic Has someone made a flashlight shader? Here's one.

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.

Please Log in or Create an account to join the conversation.

  • luluco250
  • Topic Author
More
5 years 3 months ago - 5 years 3 months ago #4 by luluco250 Replied by luluco250 on topic Has someone made a flashlight shader? Here's one.
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!
Last edit: 5 years 3 months ago by luluco250.

Please Log in or Create an account to join the conversation.

  • jas01
More
5 years 3 months ago #5 by jas01 Replied by jas01 on topic Has someone made a flashlight shader? Here's one.
Isn't the new verion more washed out? I like the older verion a little more.

Please Log in or Create an account to join the conversation.

  • luluco250
  • Topic Author
More
5 years 3 months ago - 5 years 3 months ago #6 by luluco250 Replied by luluco250 on topic Has someone made a flashlight shader? Here's one.

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!
Last edit: 5 years 3 months ago by luluco250.
The following user(s) said Thank You: jas01

Please Log in or Create an account to join the conversation.

  • jas01
More
5 years 3 months ago #7 by jas01 Replied by jas01 on topic Has someone made a flashlight shader? Here's one.
I understand now. Thank you for the update. Gonna try both modes and see what works best for me.

Please Log in or Create an account to join the conversation.

  • iMAG
More
4 years 7 months ago #8 by iMAG Replied by iMAG on topic Has someone made a flashlight shader? Here's one.

luluco250 wrote: 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.


Hello there,

How do you bind a single shader to a key (not talking about the gloabl shade ON/OFF bind). I've been looking for hours but can't figure out how to do it. Do i need to edit the shader and add for exemple the file KeyCodes.fxh from reshade.me/forum/shader-presentation/4150-simple-zoom-shader ?

By the way thank you for your work. Great stuff.
-iMAG.

Please Log in or Create an account to join the conversation.

  • Duran.te
More
4 years 7 months ago #9 by Duran.te Replied by Duran.te on topic Has someone made a flashlight shader? Here's one.
Right click on the shader

Please Log in or Create an account to join the conversation.

  • Faustus86
More
4 years 7 months ago #10 by Faustus86 Replied by Faustus86 on topic Has someone made a flashlight shader? Here's one.
Being able to bind Shaders to key's is actually i good idea. Even the standard Shaders have a lot of situational and playful shaders you don't need all the time. Likes ones you would only use for screenshots but nor for gaming, or things like Nightvision.

@crosire?

Please Log in or Create an account to join the conversation.

  • marmamowl
More
4 years 7 months ago #11 by marmamowl Replied by marmamowl on topic Has someone made a flashlight shader? Here's one.
@iMAG @Faustus86 To elaborate on Duran.te's answer: With the ReShade GUI open, all you have to do is to right-click on the shader .fx of your choice. You'll see a Toggle Key field. Click on it, then tap on the button you wish to assign to toggle that shader. It works precisely the way you want it to. Multiple shaders can share the same Toggle Key, especially useful if you have a stack of shaders you only use for screenshotting etc. You can do inverse toggling too, with one shader activated and the other deactivated, giving them the same toggle key will make ReShade turn shader A off while turning shader B on, vice versa. It's a function that's been in ReShade for very long. :)

Please Log in or Create an account to join the conversation.

  • Duran.te
More
4 years 7 months ago #12 by Duran.te Replied by Duran.te on topic Has someone made a flashlight shader? Here's one.
"To elaborate on Duran.te's answer"

Indeed, maybe my reply was too brief. :lol:

Please Log in or Create an account to join the conversation.

  • WSH303
More
4 years 7 months ago #13 by WSH303 Replied by WSH303 on topic Has someone made a flashlight shader? Here's one.
Add to this depth, possibility to select place on the screen considered as a light source and Marty's ray tracing for GI and shadows and we have a perfect flash light shader :P

Please Log in or Create an account to join the conversation.

  • Marot
More
4 years 6 months ago #14 by Marot Replied by Marot on topic Has someone made a flashlight shader? Here's one.

WSH303 wrote: Add to this depth, possibility to select place on the screen considered as a light source and Marty's ray tracing for GI and shadows and we have a perfect flash light shader :P

This look about right? ninjafada and I forked this shader and made some modifications back in April which do more or less what you're asking:

github.com/Mortalitas/GShade-Shaders/blo...Shaders/Spotlight.fx
The following user(s) said Thank You: HekutoruMAC

Please Log in or Create an account to join the conversation.

We use cookies
We use cookies on our website. Some of them are essential for the operation of the forum. You can decide for yourself whether you want to allow cookies or not. Please note that if you reject them, you may not be able to use all the functionalities of the site.