AMereBagatelle / fabricskyboxes

Custom skyboxes mod for Fabric
MIT License
76 stars 22 forks source link

Refactor fade system #77

Closed FlashyReese closed 1 year ago

FlashyReese commented 1 year ago

Refactor Summary

In this refactor, several changes have been made to improve the game's blending and transition systems.

Breaking Changes

Please be aware that these changes will break resource packs that have used the transitionSpeed property. The default fade transition speed has been set to 20 ticks (1 second) for such resource packs that now use transitionInDuration and transitionOutDuration. The change also breaks resource packs that used the blend modes darken and lighten.

Motivation

The motivation behind these changes is to improve the precision of transition durations and to resolve issues with blending and transition systems in the game. By using transitionInDuration and transitionOutDuration, more control can be exercised over the transition durations. Additionally, moving the alpha calculation to the main thread and improving the fade system will help ensure that transitions occur consistently and properly respect the maxAlpha value.

FlashyReese commented 1 year ago

This PR still requires a bit of testing before it can be merged.

FlashyReese commented 1 year ago

This latest commit replaces the transitionSpeed property with transitionInDuration and transitionOutDuration which are now in ticks for ultimate precision! Just a friendly reminder, some resource packs that were using transitionSpeed may have trouble, but don't worry, we made sure the default fade transition speed is set to 20 ticks (1 second) for them. The reason for this change was to make things even more precise and avoid any unhappy accidents from the previous property.