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 sampler2D renderedTexture; | |
uniform bool bloom; | |
uniform float bloomIntensity; | |
uniform float windowWidth; | |
uniform float windowHeight; | |
varying vec4 texCoord; | |
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
uniform sampler2D texture; | |
uniform vec2 textureSize; | |
varying vec2 uv; | |
void main(){ | |
vec2 puv = uv*textureSize; | |
vec2 hfw = fwidth(puv)/2.0; | |
vec2 fl = floor(puv - 0.5) + 0.5; |
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_fogMaxDist; | |
uniform float u_fogMinDist; | |
uniform vec4 u_fogColor; | |
varying vec4 v_eyePos; | |
float computeLinearFogFactor() | |
{ | |
float factor; | |
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
// XOR'd carpets | |
#ifdef GL_ES | |
precision mediump float; | |
#endif | |
uniform float time; | |
uniform vec2 mouse; | |
uniform vec2 resolution; |
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
#ifdef GL_ES | |
precision mediump float; | |
#endif | |
// burl figure | |
// - trick, use far less iterations! | |
uniform vec2 resolution; | |
uniform float time; |
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
// | |
// Cheap critters contours | |
// Wipe/cirn0 | |
// | |
#version 110 | |
#ifdef VERTEX_SHADER | |
uniform mat4 ProjectionMatrix; |
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
#define MAX_BALLS 10 | |
precision mediump float; | |
varying lowp vec2 v_texCoord; | |
uniform float u_width; | |
uniform int numballs; | |
uniform vec3 balls[MAX_BALLS]; //.xy is position .z is radius | |
float energyField(in vec2 p, in float iso) |
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
// fragment shader | |
// | |
// RGBA color to RGBA greyscale | |
// | |
// smooth transition based on u_colorFactor: 0.0 = original, 1.0 = greyscale | |
// | |
// http://www.johndcook.com/blog/2009/08/24/algorithms-convert-color-grayscale/ | |
// "The luminosity method is a more sophisticated version of the average method. | |
// It also averages the values, but it forms a weighted average to account for human perception. | |
// We’re more sensitive to green than other colors, so green is weighted most heavily. The formula |
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 sampler2D tex; | |
float M_2PI = 6.283185307179586; | |
float SQRT2 = 1.4142135623730951; | |
void main() | |
{ | |
float x = (gl_TexCoord[0].x - 0.5); | |
float y = (gl_TexCoord[0].y - 0.5); | |
float r = sqrt(x*x+y*y); |
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
#define R 1.1 | |
float wave(in vec2 uv, in vec2 center, in float radius) { | |
vec2 s = uv - center; | |
float r = length(s); | |
float h = sin(r * 50.0 + float(iFrame) / 10.0) * 0.1 * (radius - r); | |
if(r >= radius) | |
return 0.0; | |
else | |
return h; |