Skip to content

Commit 3474112

Browse files
committed
Rename content to canvasContent
1 parent 6af0ab5 commit 3474112

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

src/image/filterRenderer2D.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,8 @@ class FilterRenderer2D {
131131
{
132132
vertex: {},
133133
fragment: {
134-
"vec4 getColor": `(FilterInputs inputs, in sampler2D content) {
135-
return getTexture(content, inputs.texCoord);
134+
"vec4 getColor": `(FilterInputs inputs, in sampler2D canvasContent) {
135+
return getTexture(canvasContent, inputs.texCoord);
136136
}`,
137137
},
138138
}

src/webgl/material.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -1535,18 +1535,18 @@ function material(p5, fn){
15351535
* </td><td>
15361536
*
15371537
* Output the final color for the current pixel. It takes in two parameters:
1538-
* `FilterInputs inputs`, and `in sampler2D content`, and must return a color
1538+
* `FilterInputs inputs`, and `in sampler2D canvasContent`, and must return a color
15391539
* as a `vec4`.
15401540
*
15411541
* `FilterInputs inputs` is a scruct with the following properties:
15421542
* - `vec2 texCoord`, the position on the canvas, with coordinates between 0 and 1. Calling
1543-
* `getTexture(content, texCoord)` returns the original color of the current pixel.
1543+
* `getTexture(canvasContent, texCoord)` returns the original color of the current pixel.
15441544
* - `vec2 canvasSize`, the width and height of the sketch.
15451545
* - `vec2 texelSize`, the size of one real pixel relative to the size of the whole canvas.
15461546
* This is equivalent to `1 / (canvasSize * pixelDensity)`.
15471547
*
1548-
* `in sampler2D content` is a texture with the contents of the sketch, pre-filter. Call
1549-
* `getTexture(content, someCoordinate)` to retrieve the color of the sketch at that coordinate,
1548+
* `in sampler2D canvasContent` is a texture with the contents of the sketch, pre-filter. Call
1549+
* `getTexture(canvasContent, someCoordinate)` to retrieve the color of the sketch at that coordinate,
15501550
* with coordinate values between 0 and 1.
15511551
*
15521552
* </td></tr>
@@ -1574,11 +1574,11 @@ function material(p5, fn){
15741574
* },
15751575
* 'vec4 getColor': `(
15761576
* FilterInputs inputs,
1577-
* in sampler2D content
1577+
* in sampler2D canvasContent
15781578
* ) {
15791579
* inputs.texCoord.y +=
15801580
* 0.01 * sin(time * 0.001 + inputs.position.x * 5.0);
1581-
* return getTexture(content, inputs.texCoord);
1581+
* return getTexture(canvasContent, inputs.texCoord);
15821582
* }`
15831583
* });
15841584
* }

src/webgl/p5.RendererGL.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -2103,8 +2103,8 @@ class RendererGL extends Renderer {
21032103
{
21042104
vertex: {},
21052105
fragment: {
2106-
"vec4 getColor": `(FilterInputs inputs, in sampler2D content) {
2107-
return getTexture(content, inputs.texCoord);
2106+
"vec4 getColor": `(FilterInputs inputs, in sampler2D canvasContent) {
2107+
return getTexture(canvasContent, inputs.texCoord);
21082108
}`,
21092109
},
21102110
}

test/unit/webgl/p5.Shader.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ suite('p5.Shader', function() {
380380
}
381381
},
382382
{
383-
name: 'content',
383+
name: 'canvasContent',
384384
type: {
385385
typeName: 'sampler2D',
386386
qualifiers: ['in'],

0 commit comments

Comments
 (0)