make room for future sketches

This commit is contained in:
Joshua Seigler 2019-11-05 16:57:43 -05:00
parent 0e271449a6
commit 7c824da05e
5 changed files with 81 additions and 26 deletions

15
app/assets/1/index.html Normal file
View file

@ -0,0 +1,15 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Generative Art - seigler.github.io</title>
<link rel="stylesheet" href="DIGEST(../app.css)">
</head>
<body>
<script src="../modules/p5.min.js"></script>
<script src="../modules/p5.sound.min.js"></script>
<script src="DIGEST(../app.js)"></script>
<footer><code>Space</code> or double click for a new one. <code>S</code> to save.</footer>
</body>
</html>

View file

@ -1,15 +1,17 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Generative Art - seigler.github.io</title>
<link rel="stylesheet" href="DIGEST(app.css)">
</head>
<body>
<footer>Press space or double click for a new one</footer>
<script src="modules/p5.min.js"></script>
<script src="modules/p5.sound.min.js"></script>
<script src="DIGEST(app.js)"></script>
</body>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Generative Art - seigler.github.io</title>
<link rel="stylesheet" href="DIGEST(app.css)">
</head>
<body>
<main>
<h1>P5.js generative art</h1>
<ol>
<li><a class="sketch" href="1/">gradient burst</a></li>
</ol>
</main>
</body>
</html>

View file

@ -1,17 +1,21 @@
precision mediump float;
uniform vec2 u_resolution;
uniform float u_alpha;
float random (vec2 st) {
return fract(sin(dot(st.xy,
vec2(12.9898,78.233)))*
43758.5453123);
highp float random(vec2 co) {
highp float a = 12.9898;
highp float b = 78.233;
highp float c = 43758.5453;
highp float dt= dot(co.xy, vec2(a, b));
highp float sn= mod(dt, 3.14);
return fract(sin(sn) * c);
}
void main() {
vec2 st = gl_FragCoord.xy/u_resolution.xy;
float rnd = random( st );
float rnd = random(st);
gl_FragColor = vec4(vec3(rnd),0.05);
gl_FragColor = vec4(vec3(rnd), u_alpha);
}