Skip to content

Commit

Permalink
Merge pull request #7432 from processing/hooks-updates
Browse files Browse the repository at this point in the history
Updates to shader hooks for 2.0
  • Loading branch information
davepagurek authored Dec 18, 2024
2 parents 2ada04a + 5f81f8f commit 8d68d48
Show file tree
Hide file tree
Showing 50 changed files with 636 additions and 208 deletions.
2 changes: 1 addition & 1 deletion src/accessibility/outputs.js
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ function outputs(p5, fn){
fn._getPos = function (x, y) {
const untransformedPosition = new DOMPointReadOnly(x, y);
const currentTransform = this._renderer.isP3D ?
new DOMMatrix(this._renderer.states.uMVMatrix.mat4) :
new DOMMatrix(this._renderer.calculateCombinedMatrix()) :
this.drawingContext.getTransform();
const { x: transformedX, y: transformedY } = untransformedPosition
.matrixTransform(currentTransform);
Expand Down
4 changes: 2 additions & 2 deletions src/webgl/GeometryBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class GeometryBuilder {
if (!this.hasTransform) return normals;

return normals.map(
v => this.renderer.states.uNMatrix.multiplyVec(v) // this is a vec3
v => this.renderer.scratchMat3.multiplyVec(v) // this is a vec3
);
}

Expand All @@ -51,7 +51,7 @@ class GeometryBuilder {
.every((v, i) => v === this.identityMatrix.mat4[i]);

if (this.hasTransform) {
this.renderer.states.uNMatrix.inverseTranspose4x4(this.renderer.states.uModelMatrix);
this.renderer.scratchMat3.inverseTranspose4x4(this.renderer.states.uModelMatrix);
}

let startIdx = this.geometry.vertices.length;
Expand Down
Loading

0 comments on commit 8d68d48

Please sign in to comment.