Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed typo in p5.Shader.js documentation comment #7458

Merged
merged 1 commit into from
Jan 20, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading