skyrim-community-shaders
skyrim-community-shaders copied to clipboard
refactor(WetnessEffects): flatten logic for clarity and maintainability
Flatten deeply nested if-statements in the Draw function. This refactor does not introduce any new functionality or performance improvements. Makes code more redable.
Details: I disliked the deeply nested code which made it hard to read, so I have de-nested it somewhat. I did not make any new functions to de-nest it even further, as I do not know if that would be too much of a change. I can separate the logic into sub-functions to de-nest this even further.
Edit: I have a 1080 card, and there is a problem with the 1000 series and below, so I have not tested the code to see if it messes anything up. It really shouldn't as I have have just de-nested the logic here.
I tried to force-push a change so that the blame would be ignored for whitespaces, but git just does not allow that (because any changes to anything will always be recorded). So that is why there was an identical force-push.
Thanks. Normally all PRs should be tested at least on your machine. That said, there's a proposed fix for the 1K series bug that may resolve it. https://discord.com/channels/1080142797870485606/1148180928661823488/1226040081090088982.
I'll leave it to the active maintainers of wetness to provide further comments or concerns.
Given the refactor, is this still relevant?
Given the refactor, is this still relevant?
With the new code this refactor is no longer relevant, however I would still wanna split up the methods into individual specific functions to de-nest it all, with early returns too. I can make a new merge request with the changes. Just as an example I'd add private functions to separate the additions of rain effects, update timing, calculation of delta time ect.