Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
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
Prev Previous commit
Next Next commit
docs: remove getPointSize documentation as it is not present in publi…
…c shaders
  • Loading branch information
Abhayaj247 committed Jul 10, 2025
commit 1d01ca8f085677adc172263b81ef1e4528577ac0
52 changes: 1 addition & 51 deletions src/webgl/ShaderGenerator.js
Original file line number Diff line number Diff line change
Expand Up @@ -1746,54 +1746,4 @@ if (typeof p5 !== 'undefined') {
* }
* </code>
* </div>
*/

/**
* @function getPointSize
* @experimental
* @description
* Registers a callback to modify the size of points when rendering with a shader.
*
* This hook can be used inside the following shader modify functions:
* - <a href="#/p5/baseMaterialShader">baseMaterialShader()</a>.modify()
* - <a href="#/p5/baseNormalShader">baseNormalShader()</a>.modify()
* - <a href="#/p5/baseColorShader">baseColorShader()</a>.modify()
* - <a href="#/p5/baseStrokeShader">baseStrokeShader()</a>.modify()
* - <a href="#/p5/baseFilterShader">baseFilterShader()</a>.modify()
*
* Use this hook when drawing points (for example, with the point() function in WEBGL mode).
* The callback receives the current point size (number) and should return the new size (number).
*
* This hook is available in:
* - <a href="#/p5/baseMaterialShader">baseMaterialShader()</a>
* - <a href="#/p5/baseNormalShader">baseNormalShader()</a>
* - <a href="#/p5/baseColorShader">baseColorShader()</a>
* - <a href="#/p5/baseStrokeShader">baseStrokeShader()</a>
* - <a href="#/p5/baseFilterShader">baseFilterShader()</a>
*
* @param {function} callback
* A callback function which receives and returns the point size.
*
* @example
* <div modernizr='webgl'>
* <code>
* let myShader;
* function setup() {
* createCanvas(200, 200, WEBGL);
* myShader = baseMaterialShader().modify(() => {
* getPointSize(size => {
* // Make points pulse in size over time
* return size * (1.0 + 0.5 * sin(millis() * 0.002));
* });
* });
* }
* function draw() {
* background(255);
* shader(myShader);
* strokeWeight(20);
* stroke('blue');
* point(0, 0);
* }
* </code>
* </div>
*/
*/