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
Copy file name to clipboardExpand all lines: src/webgl/ShaderGenerator.js
+15-11Lines changed: 15 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -1646,7 +1646,13 @@ if (typeof p5 !== 'undefined') {
1646
1646
* @method getWorldInputs
1647
1647
* @description
1648
1648
* Registers a callback to modify the world-space properties of each vertex in a shader. This hook can be used inside <a href="#/p5/baseColorShader">baseColorShader()</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.
1649
-
*
1649
+
*
1650
+
* The callback receives a vertex object with the following properties:
1651
+
* - `position`: a vector with three components representing the original position of the vertex
1652
+
* - `normal`: a vector with three components representing the direction the surface is facing
1653
+
* - `texCoord`: a vector with two components representing the texture coordinates
1654
+
* - `color`: a vector with four components representing the color of the vertex (red, green, blue, alpha)
@@ -1875,14 +1880,15 @@ if (typeof p5 !== 'undefined') {
1875
1880
* lights();
1876
1881
* noStroke();
1877
1882
* fill('purple');
1878
-
* sphere(50);
1883
+
* circle(0, 0, 100);
1879
1884
* }
1880
1885
* </code>
1881
1886
* </div>
1882
1887
*/
1883
1888
1884
1889
/**
1885
1890
* @method shouldDiscard
1891
+
* @private
1886
1892
* @description
1887
1893
* Registers a callback to decide whether to discard (skip drawing) a fragment (pixel) in the fragment shader. This hook can be used inside <a href="#/p5/baseStrokeShader">baseStrokeShader()</a>.modify() and similar shader modify calls to create effects like round points or custom masking. The callback receives a boolean:
1888
1894
* - `willDiscard`: true if the fragment would be discarded by default
@@ -1918,8 +1924,7 @@ if (typeof p5 !== 'undefined') {
1918
1924
/**
1919
1925
* @method getFinalColor
1920
1926
* @description
1921
-
* Registers a callback to change the final color of each pixel after all lighting and mixing is done in the fragment shader. This hook can be used inside <a href="#/p5/baseColorShader">baseColorShader()</a>.modify() and similar shader modify calls to adjust the color before it appears on the screen. The callback receives a four component vector representing red, green, blue, and alpha:
1922
-
* - `[r, g, b, a]`: the current color (red, green, blue, alpha)
1927
+
* Registers a callback to change the final color of each pixel after all lighting and mixing is done in the fragment shader. This hook can be used inside <a href="#/p5/baseColorShader">baseColorShader()</a>.modify() and similar shader modify calls to adjust the color before it appears on the screen. The callback receives a four component vector representing red, green, blue, and alpha.
1923
1928
*
1924
1929
* Return a new color array to change the output color.
1925
1930
*
@@ -2009,7 +2014,6 @@ if (typeof p5 !== 'undefined') {
2009
2014
* - `texCoord`: a vector with two components representing the texture coordinates (u, v)
2010
2015
* - `canvasSize`: a vector with two components representing the canvas size in pixels (width, height)
2011
2016
* - `texelSize`: a vector with two components representing the size of a single texel in texture space
2012
-
* - `color`: a vector with four components representing the current pixel color (red, green, blue, alpha)
2013
2017
* - `canvasContent`: a texture containing the sketch's contents before the filter is applied
2014
2018
*
2015
2019
* Return a four-component vector `[r, g, b, a]` for the pixel.
@@ -2075,7 +2079,7 @@ if (typeof p5 !== 'undefined') {
2075
2079
* let t = uniformFloat(() => millis());
2076
2080
* getObjectInputs(inputs => {
2077
2081
* // Create a sine wave along the x axis in object space
0 commit comments