You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Makes the modelViewProjection matrix available as a uniform for users to use in their shader programs.
As a result, the minimum code that a user needs to write in their program decreases (and the final code is more performant).
Most appropriate sub-area of p5.js?
WebGL
Feature enhancement details:
The modelViewProjection (mvp) matrix is needed by all vertex shaders that seek to display 3D coordinates on a 2D screen.
Currently, only the uModelViewMatrix and uProjectionMatrix are provided by p5 for use in shader programs. As a result, the mvpMatrix must be calculated in the vertex shader.
This simplification makes the vertex shader code less dense.
Since currently this calculation is done per vertex, there is also a performance boost earned by doing this calculation once on the CPU and passing the value on to the shader as a uniform.
Add a uModelViewProjectionMatrix uniform
How would this new feature help increase access to p5.js?
Makes the modelViewProjection matrix available as a uniform for users to use in their shader programs.
As a result, the minimum code that a user needs to write in their program decreases (and the final code is more performant).
Most appropriate sub-area of p5.js?
Feature enhancement details:
The modelViewProjection (mvp) matrix is needed by all vertex shaders that seek to display 3D coordinates on a 2D screen.
Currently, only the
uModelViewMatrix
anduProjectionMatrix
are provided by p5 for use in shader programs. As a result, the mvpMatrix must be calculated in the vertex shader.If available as a uniform, vertex shaders can be simplified to:
This simplification makes the vertex shader code less dense.
Since currently this calculation is done per vertex, there is also a performance boost earned by doing this calculation once on the CPU and passing the value on to the shader as a uniform.
---
More discussion on this can be found on the related issue on the p5.js-website repo.
This discussion is also related.
A live example of this workflow can be found here.
The text was updated successfully, but these errors were encountered: