Skip to content

Commit

Permalink
Fixed typo in p5.Shader.js documentation comment
Browse files Browse the repository at this point in the history
  • Loading branch information
ImRAJAS-SAMSE committed Jan 6, 2025
1 parent 4bcbbcd commit 6f467d7
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions src/webgl/p5.Shader.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ import p5 from '../core/main';
* ```glsl
* void main() {
* HOOK_beforeVertex();
* // Add the rest ofy our shader code here!
* // Add the rest of your shader code here!
* }
* ```
*
Expand Down Expand Up @@ -333,10 +333,7 @@ p5.Shader = class {
console.log('');
console.log('==== Helper functions: ====');
for (const key in this.hooks.helpers) {
console.log(
key +
this.hooks.helpers[key]
);
console.log(key + this.hooks.helpers[key]);
}
}

Expand Down Expand Up @@ -946,7 +943,7 @@ p5.Shader = class {
const modelMatrix = this._renderer.uModelMatrix;
const viewMatrix = this._renderer.uViewMatrix;
const projectionMatrix = this._renderer.uPMatrix;
const modelViewMatrix = (modelMatrix.copy()).mult(viewMatrix);
const modelViewMatrix = modelMatrix.copy().mult(viewMatrix);
this._renderer.uMVMatrix = modelViewMatrix;

const modelViewProjectionMatrix = modelViewMatrix.copy();
Expand Down Expand Up @@ -1334,15 +1331,14 @@ p5.Shader = class {
) {
console.log(
'🌸 p5.js says: ' +
'You\'re trying to use a number as the data for a texture.' +
'Please use a texture.'
"You're trying to use a number as the data for a texture." +
'Please use a texture.'
);
return this;
}
gl.activeTexture(data);
gl.uniform1i(location, data);
}
else {
} else {
gl.activeTexture(gl.TEXTURE0 + uniform.samplerIndex);
uniform.texture =
data instanceof p5.Texture ? data : this._renderer.getTexture(data);
Expand Down Expand Up @@ -1376,8 +1372,8 @@ p5.Shader = class {
) {
console.log(
'🌸 p5.js says: ' +
'You\'re trying to use a number as the data for a texture.' +
'Please use a texture.'
"You're trying to use a number as the data for a texture." +
'Please use a texture.'
);
break;
}
Expand Down

0 comments on commit 6f467d7

Please sign in to comment.