Skip to content

Commit 209a63d

Browse files
committed
Fix syntax error, put back example that we can't do yet
1 parent 5db01ea commit 209a63d

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/webgl/material.js

+9-9
Original file line numberDiff line numberDiff line change
@@ -1373,8 +1373,8 @@ function material(p5, fn){
13731373
*
13741374
* function setup() {
13751375
* createCanvas(200, 200, WEBGL);
1376-
* myShader = baseMaterialShader().modify({
1377-
* let time = uniformFloat(() => millis());
1376+
* myShader = baseMaterialShader().modify(() => {
1377+
* let time = uniformFloat(() => millis());
13781378
* getWorldInputs((inputs) => {
13791379
* inputs.position.y +=
13801380
* 20 * sin(time * 0.001 + inputs.position.x * 0.05);
@@ -1401,19 +1401,19 @@ function material(p5, fn){
14011401
*
14021402
* function setup() {
14031403
* createCanvas(200, 200, WEBGL);
1404-
* myShader = baseMaterialShader().modify(() => {
1405-
* let myNormal = varyingVec3();
1406-
* getPixelInputs((inputs) => {
1404+
* myShader = baseMaterialShader().modify({
1405+
* declarations: 'vec3 myNormal;',
1406+
* 'Inputs getPixelInputs': `(Inputs inputs) {
14071407
* myNormal = inputs.normal;
14081408
* return inputs;
1409-
* });
1410-
* getFinalColor((color) => {
1409+
* }`,
1410+
* 'vec4 getFinalColor': `(vec4 color) {
14111411
* return mix(
1412-
* vec4(1, 1, 1, 1),
1412+
* vec4(1.0, 1.0, 1.0, 1.0),
14131413
* color,
14141414
* abs(dot(myNormal, vec3(0.0, 0.0, 1.0)))
14151415
* );
1416-
* });
1416+
* }`
14171417
* });
14181418
* }
14191419
*

0 commit comments

Comments
 (0)