Skip to content

Commit d5d73fb

Browse files
committed
Put back index.html
1 parent 3b2cac2 commit d5d73fb

File tree

1 file changed

+10
-30
lines changed

1 file changed

+10
-30
lines changed

preview/index.html

Lines changed: 10 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -20,37 +20,17 @@
2020
import p5 from '../src/app.js';
2121

2222
const sketch = function (p) {
23-
let myShader
24-
let tex
2523
p.setup = function () {
26-
p.createCanvas(20, 10, p.WEBGL);
27-
p.background(255);
28-
29-
myShader = p.baseMaterialShader().modify({
30-
uniforms: {
31-
'sampler2D myTex': undefined,
32-
},
33-
'Inputs getPixelInputs': `(Inputs inputs) {
34-
inputs.color = texture(myTex, inputs.texCoord);
35-
return inputs;
36-
}`
37-
})
38-
39-
// Make a red texture
40-
tex = p.createFramebuffer();
41-
tex.draw(() => p.background('red'));
42-
43-
p.translate(-p.width/2, -p.height/2)
44-
p.shader(myShader);
45-
p.noStroke();
46-
myShader.setUniform('myTex', tex);
47-
48-
// Draw once to the left
49-
p.rect(0, 0, 10, 10);
50-
51-
// Draw once to the right
52-
p.rect(10, 0, 10, 10);
53-
console.log(p.canvas.toDataURL())
24+
p.createCanvas(200, 200);
25+
};
26+
27+
p.draw = function () {
28+
p.background(0, 50, 50);
29+
p.circle(100, 100, 50);
30+
31+
p.fill('white');
32+
p.textSize(30);
33+
p.text('hello', 10, 30);
5434
};
5535
};
5636

0 commit comments

Comments
 (0)