✨ Apply clang-format
This commit is contained in:
@@ -38,7 +38,8 @@ float WINDOW_OPEN_TIME = 0.35;
|
||||
// or disappears (which is controlled by WINDOW_OPEN_TIME) and takes
|
||||
// PORTAL_WOBBLE_TIME.
|
||||
vec2 getPortalWobble(vec2 coords) {
|
||||
float progress = (uForOpening ? (1.0 - uProgress) : uProgress) / WINDOW_OPEN_TIME * uDuration;
|
||||
float progress =
|
||||
(uForOpening ? (1.0 - uProgress) : uProgress) / WINDOW_OPEN_TIME * uDuration;
|
||||
progress = clamp(1.0 - abs((progress - 1.0) / PORTAL_WOBBLE_TIME), 0.0, 1.0);
|
||||
progress = easeInBack(progress, 1.7);
|
||||
float dist = length(coords);
|
||||
@@ -56,8 +57,7 @@ float getPortalScale() {
|
||||
if (uProgress < openTime) {
|
||||
scale = easeOutBack(uProgress / openTime, 1.5);
|
||||
} else if (uProgress > 1.0 - closeTime) {
|
||||
scale =
|
||||
easeOutBack(1.0 - (uProgress - 1.0 + closeTime) / closeTime, 1.5);
|
||||
scale = easeOutBack(1.0 - (uProgress - 1.0 + closeTime) / closeTime, 1.5);
|
||||
}
|
||||
|
||||
return scale;
|
||||
@@ -167,7 +167,8 @@ vec4 getPortalColor() {
|
||||
// window). The fraction of the animation time take for the window animation is defined by
|
||||
// WINDOW_OPEN_TIME.
|
||||
vec4 getWindowColor() {
|
||||
float progress = (uForOpening ? (1.0 - uProgress) : uProgress) / WINDOW_OPEN_TIME * uDuration;
|
||||
float progress =
|
||||
(uForOpening ? (1.0 - uProgress) : uProgress) / WINDOW_OPEN_TIME * uDuration;
|
||||
|
||||
// Add some elastic easing to make the effect more dynamic.
|
||||
progress = easeInBack(clamp(progress, 0.0, 1.0), 1.2);
|
||||
|
||||
@@ -92,12 +92,13 @@ void main() {
|
||||
}
|
||||
|
||||
// Get the window texture. We shift the texture lookup by the local derivative of
|
||||
// the claw texture in order to mimic some folding distortion. This is only possible if not using GLES.
|
||||
// the claw texture in order to mimic some folding distortion. This is only possible if
|
||||
// not using GLES.
|
||||
vec2 offset = vec2(0.0);
|
||||
|
||||
#ifndef GL_ES
|
||||
#ifndef GL_ES
|
||||
offset = vec2(dFdx(scratchMap), dFdy(scratchMap)) * progress * 0.5;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
vec4 oColor = getInputColor(coords + offset);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user