You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/tutorials/en/coordinates-and-transformations.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -49,7 +49,7 @@ function draw() {
49
49
50
50

51
51
52
-
You can call [`debugMode()`](https://p5js.org/reference/#/p5/debugMode) in your `setup()` function to add a grid on the x- and z-axes and the red-green-blue x, y, and z arrows to your sketch, similar to the illustration above.
52
+
You can call [`debugMode()`](https://p5js.org/reference/p5/debugMode) in your `setup()` function to add a grid on the x- and z-axes and the red-green-blue x, y, and z arrows to your sketch, similar to the illustration above.
53
53
54
54
55
55
## Transformations: Position and Size of 3D Shapes
Copy file name to clipboardExpand all lines: src/content/tutorials/en/field-guide-to-debugging.mdx
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -244,7 +244,7 @@ function draw() {
244
244
<Column>
245
245
#### Solution:
246
246
247
-
The programmer solved the problem by adding a parenthesis between the last argument and a semicolon. They discovered this by visiting the p5.js reference page for [`rect()`](https://p5js.org/reference/#/p5/rect) and comparing code.
247
+
The programmer solved the problem by adding a parenthesis between the last argument and a semicolon. They discovered this by visiting the p5.js reference page for [`rect()`](https://p5js.org/reference/p5/rect) and comparing code.
248
248
249
249
#### Pro Tips:
250
250
@@ -283,7 +283,7 @@ p5.js says: [sketch.js, line 9] circle() was expecting at least 3 arguments but
283
283
284
284
#### Bug:
285
285
286
-
According to the message in the console, [`circle()`](https://p5js.org/reference/#/p5/circle) only received 2 inputs when it expected 3. The message also specifies that the error is on line 9 of the sketch.
286
+
According to the message in the console, [`circle()`](https://p5js.org/reference/p5/circle) only received 2 inputs when it expected 3. The message also specifies that the error is on line 9 of the sketch.
287
287
288
288
</Column>
289
289
<Column>
@@ -306,9 +306,9 @@ function draw() {
306
306
<Column>
307
307
#### Solution:
308
308
309
-
The programmer solved the problem by adding a third argument in [`circle()`](https://p5js.org/reference/#/p5/circle).
309
+
The programmer solved the problem by adding a third argument in [`circle()`](https://p5js.org/reference/p5/circle).
310
310
311
-
They discovered this by visiting the p5.js reference page for [`circle()`](https://p5js.org/reference/#/p5/circle) and comparing code.
311
+
They discovered this by visiting the p5.js reference page for [`circle()`](https://p5js.org/reference/p5/circle) and comparing code.
312
312
313
313
#### Pro Tips:
314
314
@@ -376,9 +376,9 @@ function draw() {
376
376
<Column>
377
377
#### Solution:
378
378
379
-
The programmer solved the problem by adding a *closing curly bracket* (`}`) on line 11 to close the [`draw()`](https://p5js.org/reference/#/p5/draw) function.
379
+
The programmer solved the problem by adding a *closing curly bracket* (`}`) on line 11 to close the [`draw()`](https://p5js.org/reference/p5/draw) function.
380
380
381
-
They discovered this by visiting the p5.js reference page for [`draw()`](https://p5js.org/reference/#/p5/draw) and comparing code.
381
+
They discovered this by visiting the p5.js reference page for [`draw()`](https://p5js.org/reference/p5/draw) and comparing code.
382
382
383
383
#### Pro Tips:
384
384
@@ -489,7 +489,7 @@ p5.js says: [sketch.js, line 10] circle() was expecting Number for the first par
489
489
490
490
#### Bug:
491
491
492
-
According to the message in the console, the programmer made an error on line 10 - the [circle()](https://p5js.org/reference/#/p5/circle) function needs a [number](https://p5js.org/reference/#/p5/number) as the first parameter, but it was given a [string](https://p5js.org/reference/#/p5/string).
492
+
According to the message in the console, the programmer made an error on line 10 - the [circle()](https://p5js.org/reference/p5/circle) function needs a [number](https://p5js.org/reference/p5/number) as the first parameter, but it was given a [string](https://p5js.org/reference/p5/string).
493
493
494
494
</Column>
495
495
<Column>
@@ -516,7 +516,7 @@ function draw() {
516
516
517
517
#### Solution:
518
518
519
-
The programmer solved the problem by noticing that the variable `myX` was initialized with `"forty-five"`, which cannot be recognized as a [number](https://p5js.org/reference/#/p5/number). p5.js thinks it’s just a word with a [string](https://p5js.org/reference/#/p5/string) data type.
519
+
The programmer solved the problem by noticing that the variable `myX` was initialized with `"forty-five"`, which cannot be recognized as a [number](https://p5js.org/reference/p5/number). p5.js thinks it’s just a word with a [string](https://p5js.org/reference/p5/string) data type.
520
520
521
521
#### Pro Tip:
522
522
@@ -589,7 +589,7 @@ function draw() {
589
589
590
590
#### Solution:
591
591
592
-
The programmer solved the problem by declaring `localVariable` outside of [`setup()`](https://p5js.org/reference/#/p5/setup) and [`draw()`](https://p5js.org/reference/#/p5/draw) and initializing it in [`setup()`](https://p5js.org/reference/#/p5/setup).
592
+
The programmer solved the problem by declaring `localVariable` outside of [`setup()`](https://p5js.org/reference/p5/setup) and [`draw()`](https://p5js.org/reference/p5/draw) and initializing it in [`setup()`](https://p5js.org/reference/p5/setup).
Copy file name to clipboardExpand all lines: src/content/tutorials/en/intro-to-shaders.mdx
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -95,7 +95,7 @@ A shader program consists of two parts, a **vertex shader** and a **fragment sha
95
95
96
96
</table>
97
97
98
-
{/* Note for contributors: Images/gifs generated from https://editor.p5js.org/davepagurek/sketches/gs-DbLzqV */}
98
+
{/* Note for contributors: Images/gifs generated from https://editor.p5js.org/davepagurek/sketches/gs-DbLzqV */}
99
99
100
100
Each of these live in separate files and are loaded into p5.js using the `loadShader()` function. Once a shader is loaded, it can be used within `setup()` or `draw()`. The following example will show how to set up a basic shader within p5.js:
101
101
@@ -671,7 +671,7 @@ In p5.js, a filter is something that looks at all the pixels on the canvas and t
671
671
672
672
Filter shaders only need a fragment shader. Vertex shaders are primarily responsible for positioning shapes, and filters always apply to the whole canvas, so p5.js provides a default vertex shader for you. Rather than using `loadShader`, you use `createFilterShader(src)`, passing in a string with your shader source code.
673
673
674
-
There are a number of `uniform`s that will be available to you in a filter shader, and you can read about all of them [in the `createFilterShader` documentation.](https://p5js.org/reference/#/p5/createFilterShader) There are two main ones to know about to get started:
674
+
There are a number of `uniform`s that will be available to you in a filter shader, and you can read about all of them [in the `createFilterShader` documentation.](https://p5js.org/reference/p5/createFilterShader) There are two main ones to know about to get started:
675
675
676
676
-`uniform sampler2D tex0` is a texture containing the contents of the canvas.
677
677
-`varying vec2 vTexCoord` contains the coordinates on the canvas of the current pixel, ranging from 0 to 1.
Copy file name to clipboardExpand all lines: src/content/tutorials/en/layered-rendering-with-framebuffers.mdx
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -73,7 +73,7 @@ Final image with focal blur using color + depth
73
73
74
74
</table>
75
75
76
-
{/*Note for contributors: Image generated from https://editor.p5js.org/davepagurek/sketches/OUBu-yXuk*/}
76
+
{/*Note for contributors: Image generated from https://editor.p5js.org/davepagurek/sketches/OUBu-yXuk*/}
77
77
78
78
## Using a `p5.Framebuffer`
79
79
@@ -366,7 +366,7 @@ function draw() {
366
366
`} />
367
367
368
368
<Callout>
369
-
Lots of music player software uses feedback to create audio visualizations. Try using feedback in a sketch that [reacts to music!](https://p5js.org/reference/#/p5.Amplitude)
369
+
Lots of music player software uses feedback to create audio visualizations. Try using feedback in a sketch that [reacts to music!](https://p5js.org/reference/p5.sound/p5.Amplitude)
370
370
</Callout>
371
371
372
372
Here are some tips that will help as you create more advanced feedback effects.
@@ -541,7 +541,7 @@ function draw() {
541
541
}
542
542
`} />
543
543
544
-
If you want to customize how close to or far from the camera an object needs to be to get depth values of 0 or 1, specify near and far values in [`perspective()`](https://p5js.org/reference/#/p5/perspective).
544
+
If you want to customize how close to or far from the camera an object needs to be to get depth values of 0 or 1, specify near and far values in [`perspective()`](https://p5js.org/reference/p5/perspective).
545
545
546
546
*Depth-based blur shaders are more advanced and are beyond the scope of this tutorial.*
0 commit comments