This file contains hidden or 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 highp float; | |
#endif | |
uniform float time1; | |
uniform vec2 resolution; | |
uniform vec2 mouse; | |
uniform vec3 spectrum; | |
uniform sampler2D texture0; |
This file contains hidden or 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
# its dependencies are gifsicle and ffmpeg | |
gifify() { | |
if [[ -n "$1" ]]; then # if the input lengt≈h is non-zero | |
randomPlace=0 #lazy, i use it for filename regurdless if its needed or not | |
if [[ $2 != '--random' && $3 != '--random' ]]; then | |
ffmpeg -i $1 -r 10 -vcodec png out-static-%05d.png | |
else | |
#s=$(ffprobe -i $1 -show_entries format=duration -v quiet -of csv="p=0") | |
s=$(ffprobe -i $1 -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1) | |
seconds=$(echo "$s - 2" | bc) |
This file contains hidden or 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 highp float; | |
#endif | |
// These are defined by Kodelife, or whatever environment you are using. | |
uniform float time; | |
uniform vec2 resolution; | |
varying vec3 v_normal; | |
varying vec2 v_texcoord; |
This file contains hidden or 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
// Example Pixel Shader | |
// uniform float exampleUniform; | |
out vec4 fragColor; | |
uniform float time; | |
float circ(vec2 p){ |
This file contains hidden or 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
const int step = 128; | |
const float maxDist = 10.3; | |
const float smallNumber = 0.02; | |
// http://www.iquilezles.org/www/articles/palettes/palettes.htm | |
// As t runs from 0 to 1 (our normalized palette index or domain), | |
//the cosine oscilates c times with a phase of d. | |
//The result is scaled and biased by a and b to meet the desired constrast and brightness. | |
vec3 cosPalette( float t, vec3 a, vec3 b, vec3 c, vec3 d ) | |
{ |
This file contains hidden or 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
// http://www.iquilezles.org/www/articles/palettes/palettes.htm | |
// As t runs from 0 to 1 (our normalized palette index or domain), | |
//the cosine oscilates c times with a phase of d. | |
//The result is scaled and biased by a and b to meet the desired constrast and brightness. | |
vec3 cosPalette( float t, vec3 a, vec3 b, vec3 c, vec3 d ) | |
{ | |
return a + b*cos( 6.28318*(c*t+d) ); | |
} | |
float sphere(vec3 pos, float rad){ |
This file contains hidden or 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 some constants | |
const int steps = 128; // This is the maximum amount a ray can march. | |
const float smallNumber = 0.001; | |
const float maxDist = 10.; // This is the maximum distance a ray can travel. | |
float scene(vec3 position){ | |
// So this is different from the prev sphere equation in that I am | |
// splitting the position into it's three different parts | |
// and adding a 10th of a cos wave to the x position so it oscillates left |
This file contains hidden or 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 scene(vec3 pos){ | |
float s = length(pos) - 0.4; | |
return s; | |
} | |
void main() { | |
This file contains hidden or 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 some constants | |
const int steps = 128; // This is the maximum amount a ray can march. | |
const float smallNumber = 0.001; | |
const float maxDist = 10.; // This is the maximum distance a ray can travel. | |
float scene(vec3 position){ | |
// So this is different from the normal sphere equation in that I am | |
// splitting the position into it's three different parts | |
// and adding a 10th of a cos wave to the x position so it oscillates left |
This file contains hidden or 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
void main() { | |
vec2 pos = uv(); // origin is in center | |
float r = sin(time + pos.x); | |
// x is left to right, why we see red moving from right to left think about us as a camera moving around | |
// sin returns a number from -1 to 1, and colors are from 0 to 1, so it clips to no red half the time | |
float g = sin(-time + pos.y * 20.); // higher frequency green stripes |