float rand(float n){return fract(sin(n) * 43758.5453123);}
float noise(float p){
float fl = floor(p);
float fc = fract(p);
return mix(rand(fl), rand(fl + 1.0), fc);
}
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
// Reference: http://easings.net | |
module.exports = { | |
'linear': 'linear', | |
'ease': 'ease', | |
'ease-in': 'ease-in', | |
'ease-out': 'ease-out', | |
'ease-in-out': 'ease-in-out', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
uniform float U_BRICK_WIDTH; | |
uniform float U_BRICK_HEIGHT; | |
uniform float U_MORTAR_THICKNESS; | |
uniform float Ka;//0:1:1.00 | |
uniform float Kd;//0:1:1.00 | |
uniform vec4 BRICK_COLOR;//#ff0000 | |
uniform vec4 MORTAR_COLOR;//#e8d0ad | |
#define BRICK_MORTAR_WIDTH (U_BRICK_WIDTH + U_MORTAR_THICKNESS); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
uniform vec4 u_gradient_color_1;//#fa67ba | |
uniform vec4 u_gradient_color_2;//#b17ff5 | |
uniform float u_gradient_alpha_color_1;//0:1:0.53 | |
uniform float u_gradient_alpha_color_2;//0:1:1.00 | |
uniform float u_gradient_location_color_1;//0:1:0.00 | |
uniform float u_gradient_location_color_2;//0:1:0.96 | |
vec4 LinearVertGradient(float yCoord, vec4 color_1, float alpha_color_1, float location_color_1, vec4 color_2, float alpha_color_2, float location_color_2) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* varying vec2 vUV; */ | |
uniform vec2 u_resolution; | |
#define PI 3.14159265359 | |
//Anti-aliased coordinate system grid | |
float coordinateGrid(vec2 coords) { | |
//These colors are unused and irrelevant in current implementation. | |
vec3 axesColor = vec3(0.0, 0.0, 1.0); | |
float axesThickness = 0.015; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//uniform vec2 resolution; | |
#define PI 3.14159265359 | |
//Anti-aliased coordinate system grid | |
float coordinateGrid(vec2 coords) { | |
//These colors are unused and irrelevant in current implementation. | |
vec3 axesColor = vec3(0.0, 0.0, 1.0); | |
float axesThickness = 0.015; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
float circleLocation(vec2 r, vec2 center, float radius) { | |
float aaTolerance = 0.005; | |
float distanceFromCenter = length(r-center); | |
float antiAliasOutsideCircle = smoothstep(radius - aaTolerance, radius + aaTolerance, distanceFromCenter); | |
float insideCircle = 1.0 - antiAliasOutsideCircle; | |
return insideCircle; | |
} | |
void main() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Base on Tutorial #17, https://www.shadertoy.com/view/Md23DV | |
#define PI 3.14159265359 | |
void main() { | |
//coordinate systems | |
vec2 r = vec2((gl_FragCoord.xy - 0.5*resolution.xy)/resolution.y) * 2.0; // Is [-1, 1] coordinate system | |
vec2 p = vec2(gl_FragCoord.xy/resolution.xy); //[0,1] coordinate system | |
//Set background color | |
vec3 bgCol = vec3(0.0); // black |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//uniform vec2 resolution | |
void main() { | |
//coordinate systems | |
vec2 r = vec2((gl_FragCoord.xy - 0.5*resolution.xy)/resolution.y) * 2.0; // Is [-1, 1] coordinate system | |
vec2 p = vec2(gl_FragCoord.xy/resolution.xy); //[0,1] coordinate system | |
//Set background color | |
vec3 bgCol = vec3(0.0); // black | |
vec3 pixel = bgCol; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
uniform float u_alpha; | |
void main() { | |
vec2 r = vec2((gl_FragCoord.xy - 0.5*resolution.xy)/resolution.y) * 2.0; | |
float xMax = resolution.x/resolution.y; | |
vec3 bgCol = vec3(0.0); // black | |
vec3 col1 = vec3(0.216, 0.471, 0.698); // blue | |
vec3 col2 = vec3(1.00, 0.329, 0.298); // yellow |
NewerOlder