AmbientLight.fx (with dither toggle)
- SoZ
- Topic Author
Download: pastebin.com/Pjqg0unK
I am completely new to ReShade and this is my first post here, so apologies in advance if I'm doing anything wrong. I've seen plenty of ReShade/SweetFX screenshots over the years but I hadn't looked into using ReShade before today. I wanted to make my screenshots a little more interesting, so I figured I would download it and give it a go.
After an hour or so of fiddling, I am very happy with the results, but the AmbientLight.fx shader was introducing a pattern of diagonal lines running through the image. Unable to find any mention of the issue on this forum, I traced the source of the pattern back to the "dither" code within the shader. Funnily enough, determining the origin of the problem gave me the keyword I had been missing to search for other posts on the topic on the forum, such as this one where Marty McFly had identified the cause of the problem previously: TOPIC: Shaders Problems
I have modified the version of AmbientLight.fx that was automatically downloaded when I installed ReShade earlier to allow dithering to be turned on and off via the AL_Dither toggle in the UI. It fixes my problem and I figured I would share the modification in case it's of use to anyone else. Hopefully there are no issues with sharing modifications to existing shaders that are already publicly available here; the forum rules weren't clear.
Regarding the dither code itself, not having used ReShade before, I am unsure whether or not it is working as intended. While it is technically a dither, the harsh pattern produced is very distracting. A more subtle pattern or random noise might produce a better result. Perhaps I'll experiment when I have more time.
Please Log in or Create an account to join the conversation.
- One3rd
Please Log in or Create an account to join the conversation.
- Diego0920
Please Log in or Create an account to join the conversation.
- aaronth07
You should consider submitting a pull request on Github, so that this can replace the normal ambient light.
Please Log in or Create an account to join the conversation.
- HekutoruMAC
If anybody wishes to confirm it is working as intended, be my guest!
Code: Pastebin
Differences between SoZ original version and my update:
AmbientLightDither2017 vs AmbientLightDither2020
Differences between current github version and my update:
AmbientLight2020 vs AmbientLightDither2020
In short, it now uses some constants from ReShadeUI.fxh and fixes the logic of dither and adaptation.
Thanks to SoZ for making your contribution public and Ganossa for the awesome shader.
Please Log in or Create an account to join the conversation.
- canceralp
HekutoruMAC wrote: Hello. After finding it by chance I updated and corrected this shader mod to make the pull possible.
If anybody wishes to confirm it is working as intended, be my guest!
Code: Pastebin
Differences between SoZ original version and my update:
AmbientLightDither2017 vs AmbientLightDither2020
Differences between current github version and my update:
AmbientLight2020 vs AmbientLightDither2020
In short, it now uses some constants from ReShadeUI.fxh and fixes the logic of dither and adaptation.
Thanks to SoZ for making your contribution public and Ganossa for the awesome shader.
Thank you.
I just got the chance to try it. However, dithering option still causes diagonal stripes. It is slightly less visible than the 2017 version.
I use it with Lightroom (increased contrast) and some sharpening. Considering they all add banding issues, I always add a very tiny amount of film grain at the end to compensate.
BTW, would you please explain what is different in the "new logic of adaptation" part? Is the 2020 adaptation more accurate? or performance-friendly?
Please Log in or Create an account to join the conversation.
- Daemonjax
Making it texture based might be good enough (a static noise texture)... would look more like screen dirt if you looked closely enough, though, but would be fine at lower strength levels. I mean, how much dithering is really necessary to remove banding? Because that's all you'd need. I'd start with a static noise texture because it's easier, faster, and easier to play with different pixel sizes of noise.
Please Log in or Create an account to join the conversation.
- Reticuli
Please Log in or Create an account to join the conversation.
- Jesped
Please Log in or Create an account to join the conversation.