Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the ability to transition between background shaders. #227

Merged
merged 2 commits into from
Jun 25, 2024

Conversation

sirdoombox
Copy link
Collaborator

Changes

  • Implemented a simple fade transition between background effects.
  • Included related properties on SukiBackground and associated ones on SukiWindow.
  • Included a new iAlpha uniform for use in blending.
  • Added controls to the demo app to test this feature.

Outstanding issues

  • This does involve - only for the duration of the fade however - rendering two full shader passes, as such it's disabled by default to avoid performance implications.
  • Fade effect isn't perfect and can look a bit harsh depending on precisely what effects are blended together.
    • This is mostly a consequence of the weird blending modes, I couldn't find one that achieved what I was looking for despite trying them all. Playing around with different easing functions may also improve the situation.
  • Can't fade between colours as of right now without expanding the shader API - would need to include a duplicate set of "old" colours so that shaders could blend between them which would further complicate shaders.
    • This is actually reasonably doable with a few minor tweaks, though it will contribute to the bloat. I can rework this PR and include that change if it's a desirable feature.
  • Adding more and more uniforms that are heavily controlled from C# is likely to cause problems both in terms of performance and the ease of implementing a desirable background effect by devs, as the raw values are so heavily twisted by the time they reach the GPU that if you wanted to use the raw colours you'd have to essentially "revert" all the calculations on the GPU.

@kikipoulet kikipoulet merged commit b8339c0 into kikipoulet:main Jun 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants