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
* @property {{x: number, y: number, z: number}} position - The position of the vertex in world space.
1648
-
* @property {{x: number, y: number, z: number}} normal - The normal vector at the vertex in world space.
1649
-
* @property {{x: number, y: number}} texCoord - The texture coordinates (x, y) for the vertex.
1650
-
* @property {{r: number, g: number, b: number, a: number}} color - The color at the vertex.
1651
-
*/
1652
-
1653
1645
/**
1654
1646
* @function getWorldInputs
1655
1647
* @experimental
1656
1648
* @description
1657
-
* Registers a callback to modify the world-space properties of each vertex in a shader. This hook can be used inside {@link p5.baseMaterialShader}.modify() and similar shader modify calls to customize vertex positions, normals, texture coordinates, and colors before rendering. "World space" refers to the coordinate system of the 3D scene, before any camera or projection transformations are applied.
1649
+
* Registers a callback to modify the world-space properties of each vertex in a shader. This hook can be used inside <a href="#/p5/baseMaterialShader">baseMaterialShader()</a>.modify() and similar shader modify calls to customize vertex positions, normals, texture coordinates, and colors before rendering. "World space" refers to the coordinate system of the 3D scene, before any camera or projection transformations are applied.
* A callback function which receives and returns a Vertex struct.
1667
-
*
1668
-
* @see {@link p5.baseMaterialShader}
1669
-
* @see {@link p5.Shader#modify}
1657
+
* @param {function} callback
1658
+
* A callback function which receives a vertex object containing position (vec3), normal (vec3), texCoord (vec2), and color (vec4) properties. The function should return the modified vertex object.
1670
1659
*
1671
1660
* @example
1672
1661
* <div modernizr='webgl'>
@@ -1700,19 +1689,16 @@ if (typeof p5 !== 'undefined') {
1700
1689
* @function combineColors
1701
1690
* @experimental
1702
1691
* @description
1703
-
* Registers a callback to customize how color components are combined in the fragment shader. This hook can be used inside {@link p5.baseMaterialShader}.modify() and similar shader modify calls to control the final color output of a material. The callback receives a ColorComponents struct and should return an object with a `color` property ({ r, g, b }) and an `opacity` property (number).
1692
+
* Registers a callback to customize how color components are combined in the fragment shader. This hook can be used inside <a href="#/p5/baseMaterialShader">baseMaterialShader()</a>.modify() and similar shader modify calls to control the final color output of a material. The callback receives color components (baseColor, diffuse, ambientColor, ambient, specularColor, specular, emissive, opacity) and returns a vec4 for the final color.
* A callback function which receives color components (baseColor, diffuse, ambientColor, ambient, specularColor, specular, emissive, opacity) and returns a vec4 for the final color.
1716
1702
*
1717
1703
* @example
1718
1704
* <div modernizr='webgl'>
@@ -1723,21 +1709,20 @@ if (typeof p5 !== 'undefined') {
@@ -1757,20 +1742,17 @@ if (typeof p5 !== 'undefined') {
1757
1742
* @function getPointSize
1758
1743
* @experimental
1759
1744
* @description
1760
-
* Registers a callback to modify the size of points when rendering with a shader. This hook can be used inside {@link p5.baseMaterialShader}.modify() or similar, when drawing points (e.g., with the point() function in WEBGL mode). The callback receives the current point size (number) and should return the new size (number).
1745
+
* Registers a callback to modify the size of points when rendering with a shader. This hook can be used inside <a href="#/p5/baseMaterialShader">baseMaterialShader()</a>.modify() or similar, when drawing points (e.g., with the point() function in WEBGL mode). The callback receives the current point size (number) and should return the new size (number).
0 commit comments