File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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;
You can’t perform that action at this time.
0 commit comments