@@ -59,6 +59,7 @@ function lightingSetup() {
59
59
60
60
function setup() {
61
61
createCanvas(200, 200, WEBGL);
62
+ pixelDensity(1);
62
63
}
63
64
64
65
function draw() {
@@ -110,6 +111,7 @@ function firstShaderCallback() {
110
111
111
112
async function setup() {
112
113
createCanvas(200, 200, WEBGL);
114
+ pixelDensity(1);
113
115
// p5.strands are made using the modify function on a shader
114
116
firstShader = baseColorShader().modify(firstShaderCallback);
115
117
}
@@ -173,6 +175,7 @@ function instancingCallback() {
173
175
174
176
async function setup() {
175
177
createCanvas(300, 300, WEBGL);
178
+ pixelDensity(1);
176
179
particleModel = buildGeometry(() => sphere(10, 10, 2));
177
180
instancingShader = baseColorShader().modify(instancingCallback);
178
181
instancingStrokeShader = baseStrokeShader().modify(instancingCallback);
@@ -227,6 +230,7 @@ getWorldInputs((inputs) => {
227
230
228
231
async function setup() {
229
232
createCanvas(400, 400, WEBGL);
233
+ pixelDensity(1);
230
234
particleModel = buildGeometry(() => sphere(10, 4, 2));
231
235
instancingShader = baseColorShader().modify(instancingCallback);
232
236
instancingStrokeShader = baseStrokeShader().modify(instancingCallback);
@@ -301,6 +305,7 @@ getWorldInputs((inputs) => {
301
305
302
306
async function setup() {
303
307
createCanvas(400, 400, WEBGL);
308
+ pixelDensity(1);
304
309
particleModel = buildGeometry(() => sphere(10, 4, 2));
305
310
instancingShader = baseColorShader().modify(instancingCallback);
306
311
instancingStrokeShader = baseStrokeShader().modify(instancingCallback);
@@ -410,6 +415,7 @@ function fresnelCallback() {
410
415
411
416
async function setup() {
412
417
createCanvas(400, 400, WEBGL);
418
+ pixelDensity(1);
413
419
fresnelShader = baseColorShader().modify(fresnelCallback);
414
420
}
415
421
@@ -456,6 +462,7 @@ function pixelateCallback() {
456
462
457
463
async function setup() {
458
464
createCanvas(200, 200);
465
+ pixelDensity(1);
459
466
pixelateShader = baseFilterShader().modify(pixelateCallback)
460
467
}
461
468
@@ -489,6 +496,7 @@ function pixelateCallback() {
489
496
490
497
async function setup() {
491
498
createCanvas(200, 200, WEBGL);
499
+ pixelDensity(1);
492
500
pixelateShader = baseFilterShader().modify(pixelateCallback)
493
501
}
494
502
@@ -526,7 +534,7 @@ function draw() {
526
534
image (originalImage, 0 , 0 );
527
535
528
536
// changing this value affects the spread of the bloom
529
- filter (BLUR , 20 );
537
+ filter (BLUR , 15 );
530
538
}
531
539
```
532
540
@@ -570,6 +578,7 @@ function bloomCallback() {
570
578
571
579
async function setup() {
572
580
createCanvas(200, 200, WEBGL);
581
+ pixelDensity(1);
573
582
originalImage = createFramebuffer();
574
583
bloomShader = baseFilterShader().modify(bloomCallback);
575
584
}
@@ -715,6 +724,7 @@ function bloomShaderCallback() {
715
724
716
725
async function setup(){
717
726
createCanvas(800, 600, WEBGL);
727
+ pixelDensity(1);
718
728
stars = buildGeometry(() => sphere(8, 4, 2))
719
729
originalImage = createFramebuffer();
720
730
@@ -752,7 +762,7 @@ function draw(){
752
762
imageMode(CENTER)
753
763
image(originalImage, 0, 0)
754
764
755
- filter(BLUR, 25 )
765
+ filter(BLUR, 15 )
756
766
filter(bloomShader);
757
767
}
758
768
` } />
0 commit comments