Skip to content

Commit

Permalink
Fix initialisation bug, adjust gradient shader.
Browse files Browse the repository at this point in the history
  • Loading branch information
sirdoombox committed Jun 20, 2024
1 parent d648c1e commit 87627cd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 4 additions & 4 deletions SukiUI/Content/Shaders/gradient.sksl
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ vec4 main(vec2 fragCoord) {
tuv *= Rot(radians((degree - .5) * 720. + 180.));
tuv.y *= ratio;

float frequency = 2.;
float amplitude = 10.;
float frequency = 10.;
float amplitude = 15.;
float speed = iTime * 0.1;
tuv.x += sin(tuv.y * frequency + speed) / amplitude;
tuv.y += sin(tuv.x * frequency * 1.5 + speed) / (amplitude * .5);

vec3 layer1 = mix(iAccent, iPrimary * 0.45, smoothstep(-.3, .2, (tuv * Rot(radians(-5.))).x));
vec3 layer2 = mix(iPrimary, iPrimary * 0.25, smoothstep(-.3, .2, (tuv * Rot(radians(-5.))).x));
vec3 layer1 = mix(iAccent, iPrimary * 0.85, smoothstep(-.3, .2, (tuv * Rot(radians(-5.))).x));
vec3 layer2 = mix(iPrimary, iAccent * 0.65, smoothstep(-.3, .2, (tuv * Rot(radians(-5.))).x));
vec3 finalComp = mix(layer1, layer2, smoothstep(.5, -.3, tuv.y));
vec3 col = blendOverlay(iBase, finalComp);

Expand Down
4 changes: 3 additions & 1 deletion SukiUI/Utilities/Background/ShaderBackgroundDraw.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ internal bool AnimEnabled
public ShaderBackgroundDraw(Rect bounds)
{
Bounds = bounds;
SukiTheme.GetInstance().OnBaseThemeChanged += v => _activeVariant = v;
var sTheme = SukiTheme.GetInstance();
sTheme.OnBaseThemeChanged += v => _activeVariant = v;
_activeVariant = SukiTheme.GetInstance().ActiveBaseTheme;
}

public bool Equals(ICustomDrawOperation other) => false;
Expand Down

0 comments on commit 87627cd

Please sign in to comment.