Skip to content

Commit 20dbb7f

Browse files
committed
Update docs
1 parent 7df621e commit 20dbb7f

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/webgl/p5.Shader.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,8 @@ class Shader {
239239
* p5.strands functions are special, since they get turned into a shader instead of being
240240
* run like the rest of your code. They only have access to p5.js functions, and variables
241241
* you declare inside the `modify` callback. If you need access to local variables, you
242-
* can pass them into `modify` with an optional second parameter, `variables`. If you are
242+
* can pass them into `modify` with an optional second parameter, `variables`. These will
243+
* then be passed into your function as an argument. If you are
243244
* using instance mode, you will need to pass your sketch object in this way.
244245
*
245246
* ```js example
@@ -248,7 +249,7 @@ class Shader {
248249
*
249250
* sketch.setup = function() {
250251
* sketch.createCanvas(200, 200, sketch.WEBGL);
251-
* myShader = sketch.baseMaterialShader().modify(() => {
252+
* myShader = sketch.baseMaterialShader().modify(({ sketch }) => {
252253
* sketch.getPixelInputs((inputs) => {
253254
* inputs.color = [inputs.texCoord, 0, 1];
254255
* return inputs;

0 commit comments

Comments
 (0)