“broken sketch” by Matthew Ortega
https://openprocessing.org/sketch/1471103
License CreativeCommons Attribution NonCommercial ShareAlike
https://creativecommons.org/licenses/by-nc-sa/3.0
{{filePath}}
{{width}} x {{height}}
Report Sketch
Oh, that naughty sketch! Please let us know what the issue is below.
Apply Template
Applying this template will reset your sketch and remove all your changes. Are you sure you would like to continue?
Report Sketch
Report Comment
Please confirm that you would like to report the comment below.
We will review your submission and take any actions necessary per our Community Guidelines. In addition to reporting this comment, you can also block the user to prevent any future interactions.
Please report comments only when necessary. Unnecessary or abusive use of this tool may result in your own account being suspended.
Are you sure you want to delete your sketch?
Any files uploaded will be deleted as well.
Delete Comment?
This will also delete all the replies to this comment.
Delete this tab? Any code in it will be deleted as well.
Select a collection to submit your sketch
We Need Your Support
Since 2008, OpenProcessing has provided tools for creative coders to learn, create, and share over a million open source projects in a friendly environment.
Niche websites like ours need your continued support for future development and maintenance, while keeping it an ad-free platform that respects your data and privacy!
Please consider subscribing below to show your support with a "Plus" badge on your profile and get access to many other features!
A fork of shader template by Matthew Ortega
CC Attribution NonCommercial ShareAlike
broken sketch
Ortega
xxxxxxxxxx
//p5.js shader basic structure ref from https://www.openprocessing.org/sketch/920144
let theShader;
let SEED;
function preload() {
theShader = new p5.Shader(this.renderer, vert, frag)
}
function setup() {
createCanvas(windowWidth, windowHeight, WEBGL);
// createCanvas(1920, 1080, WEBGL);
noStroke()
background(0);
SEED = random(100);
}
function draw() {
shader(theShader)
theShader.setUniform('u_resolution', [width / 1000, height / 1000])
theShader.setUniform('u_time', millis() / 1000)
theShader.setUniform('u_mouse', [mouseX / width, mouseY / height])
theShader.setUniform('u_col', [1.0, 1.0, 1.0])
randomSeed(SEED);
background(255);
translate(-width / 2, -height / 2);
rect(0, 0, width, height);
for (let i = 0; i < 25; i++) {
push();
translate(random(0, width), random(0, width));
scale(randomGaussian() * random(1, 20), randomGaussian() * random(1, 20));
rect(0, 0, 20, 20);
pop();
}
for (let i = 0; i < 1; i++) {
theShader.setUniform('u_id', i)
push();
translate(width / 2, height / 2);
noiseWave();
pop();
}
// noLoop();
}
function noiseWave() {
let steps = 100;
let radius = 100;
push();
shader(theShader)
beginShape();
for (let i = 0; i < steps; i++) {
let step = TWO_PI / steps;
let x = sin(step * i) * radius;
let y = cos(step * i) * radius;
let u = map(x, -radius, radius, 0, 1);
let v = map(y, -radius, radius, 0, 1);
vertex(x, y, u, v);
}
endShape();
pop();
}
See More Shortcuts