Skip to content

Commit 91789d3

Browse files
committed
✨ Apply clang-format
1 parent 3ab1ffb commit 91789d3

File tree

8 files changed

+333
-415
lines changed

8 files changed

+333
-415
lines changed

extension.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export default class BurnMyWindows extends Extension {
8080
new Matrix(), new PaintBrush(), new Pixelate(), new PixelWheel(),
8181
new PixelWipe(), new Portal(), new RGBWarp(), new SnapOfDisintegration(),
8282
new TeamRocket(), new TRexAttack(), new TVEffect(), new TVGlitch(),
83-
new Wisps(), new Mushroom()
83+
new Wisps(), new Mushroom()
8484
];
8585

8686
// Load all of our resources.

prefs.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ export default class BurnMyWindowsPreferences extends ExtensionPreferences {
8383
Pixelate, PixelWheel, PixelWipe,
8484
Portal, RGBWarp, SnapOfDisintegration,
8585
TeamRocket, TRexAttack, TVEffect,
86-
TVGlitch, Wisps,
86+
TVGlitch, Wisps,
8787
];
8888

8989

resources/shaders/aura-glow.frag

+104-121
Original file line numberDiff line numberDiff line change
@@ -39,25 +39,23 @@ uniform float uFadeOut;
3939
uniform float uBlur;
4040
uniform vec2 uSeed;
4141

42-
4342
/*
4443
this controls the end shape
4544
-5.0 large Star
4645
-3.0 Star
4746
1.0 Dimond
4847
2.0 Circle
49-
3.0 Squircle
48+
3.0 Squircle
5049
5.0 Square
5150
*/
5251
uniform float uEdgeShape;
5352

54-
//the size of the edge color
53+
// the size of the edge color
5554
uniform float uEdgeSize;
5655

57-
//soft <--> hard
56+
// soft <--> hard
5857
uniform float uEdgeHardness;
5958

60-
6159
// A simple blur function
6260
vec4 blur(vec2 uv, float radius, float samples) {
6361
vec4 color = vec4(0.0);
@@ -77,122 +75,107 @@ vec4 blur(vec2 uv, float radius, float samples) {
7775

7876
void main() {
7977

80-
// This gradually dissolves from [1..0] from the outside to the center. We
81-
// switch the direction for opening and closing.
82-
float progress = uForOpening ? uProgress : 1.0 - uProgress ;
83-
84-
//adjusting for Gnome
85-
if (uPadding > 0.0)
86-
{
87-
progress = remap(
88-
progress, 0.0, ((uSize.x - (uPadding*2.0)) / uSize.x)
89-
,0.0, 1.0
90-
);
91-
}
92-
93-
94-
// Get the color from the window texture.
95-
vec4 oColor = getInputColor(iTexCoord.st);
96-
97-
// Calculate the aspect ratio of the render area
98-
float aspect = uSize.x / uSize.y;
99-
100-
//standard uv
101-
vec2 uv = iTexCoord.st;
102-
103-
// tuv is for when progress is near 0
104-
vec2 tuv = uv;
105-
tuv -= 0.5; // Shift UV coordinates to center (from [-0.5 to 0.5])
106-
tuv.x *= aspect; // Scale x-coordinate to match aspect ratio
107-
tuv += 0.5; // Shift UV coordinates back (from [0 to 1])
108-
109-
//mixing the UVs
110-
uv = mix(tuv,uv,easeOutExpo(progress));
111-
112-
// this controls the shape
113-
// -1.0 would be a diamond-ish
114-
// 0.0 would be a rounded diamond
115-
// 1.0 would be a circle
116-
// 2.0 will be sqircle
117-
// 1000.0 will be very square
118-
float p = mix(uEdgeShape,1000.0,
119-
easeInExpo(progress)
120-
);
121-
122-
//this will be used later to make a mask
123-
float m = mix(
124-
0.0,
125-
1.0,
126-
clamp(
127-
pow(abs(uv.x-0.5)*2.0,p) + pow(abs(uv.y-0.5)*2.0,p),0.0,1.0
128-
)
129-
);
130-
131-
132-
//this calculates the edge of the effect
133-
float edge = abs(m-progress) ;
134-
float e = mix(0.0,uEdgeSize,1.0 - progress);
135-
edge = remap(edge,0.0,e,0.0,1.0);
136-
edge = clamp(edge,0.0,1.0);
137-
edge = 1.0 - edge;
138-
139-
//this is the mask
140-
float mask = (m > progress) ? 0.0 : 1.0 ;
141-
142-
//we need two of these
143-
float mask0 = mix(mask,mask+edge,1.0 - uEdgeHardness);
144-
float mask1 = mix(edge,edge*mask,uEdgeHardness);
145-
146-
//calculate color
147-
vec3 color = cos(progress*uColorSpeed+uv.xyx+vec3(0,2,4)).xyz;
148-
//coloroffset
149-
float colorOffset = (uRandomColorOffset) ? hash12(uSeed) : uColorOffset ;
150-
color = offsetHue(color, colorOffset + 0.10);
151-
//clamp and saturate
152-
color = clamp(color * uColorSaturation,vec3(0.0),vec3(1.0));
153-
154-
//save this for later
155-
float oColorAlpha = oColor.a;
156-
157-
//blur-ify
158-
if (uBlur > 0.0)
159-
{
160-
//used for blur later ...
161-
//calculate this before saturating it
162-
float b = (color.r + color.g + color.b)/3.0;
163-
164-
165-
oColor = blur( iTexCoord.st, b * uBlur * mask1, 7.0);
166-
}
78+
// This gradually dissolves from [1..0] from the outside to the center. We
79+
// switch the direction for opening and closing.
80+
float progress = uForOpening ? uProgress : 1.0 - uProgress;
16781

168-
//apply masks and colors
169-
oColor.a *= mask0;
170-
171-
//i was doing this to try to adjust for light mode
172-
// i don;t like the way these make the effect look
173-
// ...maybe a toggle for it later
174-
/*
175-
float oColorPercent = (oColor.r + oColor.g + oColor.b)/3.0;
176-
oColor.r = mix(oColor.r , 1.0 - oColor.r, mask1 * oColorPercent);
177-
oColor.g = mix(oColor.g , 1.0 - oColor.g, mask1 * oColorPercent);
178-
oColor.b = mix(oColor.b , 1.0 - oColor.b, mask1 * oColorPercent);
179-
// --or
180-
oColor.r = mix(oColor.r , 0.0, mask1 * oColorPercent);
181-
oColor.g = mix(oColor.g , 0.0, mask1 * oColorPercent);
182-
oColor.b = mix(oColor.b , 0.0, mask1 * oColorPercent);
183-
*/
184-
185-
oColor += mask1 * vec4(color.rgb,1.0);
186-
oColor.a *= oColorAlpha;
187-
188-
//i want to fade out the last ~10% of the animation
189-
float lastfade = remap(progress,0.0,uFadeOut,0.0,1.0);
190-
lastfade = clamp(lastfade,0.0,1.0);
191-
lastfade = easeInSine(lastfade);
192-
193-
//apply the lastfade
194-
oColor.a *= lastfade;
195-
196-
setOutputColor(oColor);
82+
// adjusting for Gnome
83+
if (uPadding > 0.0) {
84+
progress = remap(progress, 0.0, ((uSize.x - (uPadding * 2.0)) / uSize.x), 0.0, 1.0);
85+
}
86+
87+
// Get the color from the window texture.
88+
vec4 oColor = getInputColor(iTexCoord.st);
89+
90+
// Calculate the aspect ratio of the render area
91+
float aspect = uSize.x / uSize.y;
92+
93+
// standard uv
94+
vec2 uv = iTexCoord.st;
95+
96+
// tuv is for when progress is near 0
97+
vec2 tuv = uv;
98+
tuv -= 0.5; // Shift UV coordinates to center (from [-0.5 to 0.5])
99+
tuv.x *= aspect; // Scale x-coordinate to match aspect ratio
100+
tuv += 0.5; // Shift UV coordinates back (from [0 to 1])
101+
102+
// mixing the UVs
103+
uv = mix(tuv, uv, easeOutExpo(progress));
104+
105+
// this controls the shape
106+
// -1.0 would be a diamond-ish
107+
// 0.0 would be a rounded diamond
108+
// 1.0 would be a circle
109+
// 2.0 will be sqircle
110+
// 1000.0 will be very square
111+
float p = mix(uEdgeShape, 1000.0, easeInExpo(progress));
112+
113+
// this will be used later to make a mask
114+
float m =
115+
mix(0.0, 1.0,
116+
clamp(pow(abs(uv.x - 0.5) * 2.0, p) + pow(abs(uv.y - 0.5) * 2.0, p), 0.0, 1.0));
117+
118+
// this calculates the edge of the effect
119+
float edge = abs(m - progress);
120+
float e = mix(0.0, uEdgeSize, 1.0 - progress);
121+
edge = remap(edge, 0.0, e, 0.0, 1.0);
122+
edge = clamp(edge, 0.0, 1.0);
123+
edge = 1.0 - edge;
124+
125+
// this is the mask
126+
float mask = (m > progress) ? 0.0 : 1.0;
127+
128+
// we need two of these
129+
float mask0 = mix(mask, mask + edge, 1.0 - uEdgeHardness);
130+
float mask1 = mix(edge, edge * mask, uEdgeHardness);
131+
132+
// calculate color
133+
vec3 color = cos(progress * uColorSpeed + uv.xyx + vec3(0, 2, 4)).xyz;
134+
// coloroffset
135+
float colorOffset = (uRandomColorOffset) ? hash12(uSeed) : uColorOffset;
136+
color = offsetHue(color, colorOffset + 0.10);
137+
// clamp and saturate
138+
color = clamp(color * uColorSaturation, vec3(0.0), vec3(1.0));
139+
140+
// save this for later
141+
float oColorAlpha = oColor.a;
142+
143+
// blur-ify
144+
if (uBlur > 0.0) {
145+
// used for blur later ...
146+
// calculate this before saturating it
147+
float b = (color.r + color.g + color.b) / 3.0;
148+
149+
oColor = blur(iTexCoord.st, b * uBlur * mask1, 7.0);
150+
}
197151

152+
// apply masks and colors
153+
oColor.a *= mask0;
154+
155+
// i was doing this to try to adjust for light mode
156+
// i don;t like the way these make the effect look
157+
// ...maybe a toggle for it later
158+
/*
159+
float oColorPercent = (oColor.r + oColor.g + oColor.b)/3.0;
160+
oColor.r = mix(oColor.r , 1.0 - oColor.r, mask1 * oColorPercent);
161+
oColor.g = mix(oColor.g , 1.0 - oColor.g, mask1 * oColorPercent);
162+
oColor.b = mix(oColor.b , 1.0 - oColor.b, mask1 * oColorPercent);
163+
// --or
164+
oColor.r = mix(oColor.r , 0.0, mask1 * oColorPercent);
165+
oColor.g = mix(oColor.g , 0.0, mask1 * oColorPercent);
166+
oColor.b = mix(oColor.b , 0.0, mask1 * oColorPercent);
167+
*/
168+
169+
oColor += mask1 * vec4(color.rgb, 1.0);
170+
oColor.a *= oColorAlpha;
171+
172+
// i want to fade out the last ~10% of the animation
173+
float lastfade = remap(progress, 0.0, uFadeOut, 0.0, 1.0);
174+
lastfade = clamp(lastfade, 0.0, 1.0);
175+
lastfade = easeInSine(lastfade);
176+
177+
// apply the lastfade
178+
oColor.a *= lastfade;
179+
180+
setOutputColor(oColor);
198181
}

0 commit comments

Comments
 (0)