Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[WIP] Docs: Add initial draft of Strands documentation (feedback wanted)#7940

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Merged
Changes from1 commit
Commits
Show all changes
16 commits
Select commitHold shift + click to select a range
a3aeaa2
docs: Add initial draft of Strands documentation
Abhayaj247Jun 24, 2025
8e199d8
docs: move p5.strands JSDoc to end of shaderGenerator.js and remove s…
Abhayaj247Jun 26, 2025
c9d07c1
docs: fix JSDoc syntax for p5.js compatibility
Abhayaj247Jun 29, 2025
06cf619
docs: clarify combineColors and getPointSize documentation per mainta…
Abhayaj247Jul 9, 2025
1d01ca8
docs: remove getPointSize documentation as it is not present in publi…
Abhayaj247Jul 10, 2025
e73b524
Add documentation for remaining public shader hooks in ShaderGenerato…
Abhayaj247Jul 11, 2025
6b54ecd
Address maintainer feedback: update shader hook docs and examples for…
Abhayaj247Jul 17, 2025
1146190
Update ShaderGenerator docs and examples
Abhayaj247Aug 7, 2025
36c4c2d
Address maintainer feedback: Update ShaderGenerator docs and examples
Abhayaj247Aug 8, 2025
6e1311d
Fix shouldDiscard example
Abhayaj247Aug 8, 2025
58d8e5d
Fix getPixelInputs description and getFinalColor example
Abhayaj247Aug 8, 2025
483edcb
Fix getPixelInputs description and getColor description
Abhayaj247Aug 8, 2025
29fbe52
Address Maintainer feedbacks: Update ShaderGenerator docs and examples
Abhayaj247Aug 9, 2025
be56924
Address maintainer feedback by refining references, param annotations…
Abhayaj247Aug 19, 2025
17992d7
updated .modify() links
Abhayaj247Aug 19, 2025
ff81847
Address maintainer feedback by updating fill color, adjusting sphere …
Abhayaj247Aug 20, 2025
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
PrevPrevious commit
NextNext commit
updated .modify() links
  • Loading branch information
@Abhayaj247
Abhayaj247 committedAug 19, 2025
commit17992d75bdd6250f1d0d011e0089af80e6839b82
24 changes: 12 additions & 12 deletionssrc/webgl/ShaderGenerator.js
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -1645,7 +1645,7 @@ if (typeof p5 !== 'undefined') {
/**
* @method getWorldInputs
* @description
* 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 <a href="#/p5.Shader/modify">modify</a> 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.
* 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 <a href="#/p5.Shader/modify">modify()</a> 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.
*
* The callback receives a vertex object with the following properties:
* - `position`: a three-component vector representing the original position of the vertex.
Expand DownExpand Up@@ -1694,7 +1694,7 @@ if (typeof p5 !== 'undefined') {
/**
* @method combineColors
* @description
* 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 <a href="#/p5.Shader/modify">modify</a> calls to control the final color output of a material. The callback receives an object with the following properties:
* 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 <a href="#/p5.Shader/modify">modify()</a> calls to control the final color output of a material. The callback receives an object with the following properties:
*
* - `baseColor`: a three-component vector representing the base color (red, green, blue).
* - `diffuse`: a single number representing the diffuse reflection.
Expand DownExpand Up@@ -1749,7 +1749,7 @@ if (typeof p5 !== 'undefined') {
* @method beforeVertex
* @private
* @description
* Registers a callback to run custom code at the very start of the vertex shader. This hook can be used inside <a href="#/p5/baseColorShader">baseColorShader()</a>.modify() and similar shader <a href="#/p5.Shader/modify">modify</a> calls to set up variables or perform calculations that affect every vertex before processing begins. The callback receives no arguments.
* Registers a callback to run custom code at the very start of the vertex shader. This hook can be used inside <a href="#/p5/baseColorShader">baseColorShader()</a>.modify() and similar shader <a href="#/p5.Shader/modify">modify()</a> calls to set up variables or perform calculations that affect every vertex before processing begins. The callback receives no arguments.
*
* Note: This hook is currently limited to per-vertex operations; storing variables for later use is not supported.
*
Expand All@@ -1767,7 +1767,7 @@ if (typeof p5 !== 'undefined') {
* @method afterVertex
* @private
* @description
* Registers a callback to run custom code at the very end of the vertex shader. This hook can be used inside <a href="#/p5/baseColorShader">baseColorShader()</a>.modify() and similar shader <a href="#/p5.Shader/modify">modify</a> calls to perform cleanup or final calculations after all vertex processing is done. The callback receives no arguments.
* Registers a callback to run custom code at the very end of the vertex shader. This hook can be used inside <a href="#/p5/baseColorShader">baseColorShader()</a>.modify() and similar shader <a href="#/p5.Shader/modify">modify()</a> calls to perform cleanup or final calculations after all vertex processing is done. The callback receives no arguments.
*
* Note: This hook is currently limited to per-vertex operations; storing variables for later use is not supported.
*
Expand All@@ -1785,7 +1785,7 @@ if (typeof p5 !== 'undefined') {
* @method beforeFragment
* @private
* @description
* Registers a callback to run custom code at the very start of the fragment shader. This hook can be used inside <a href="#/p5/baseColorShader">baseColorShader()</a>.modify() and similar shader <a href="#/p5.Shader/modify">modify</a> calls to set up variables or perform calculations that affect every pixel before color calculations begin. The callback receives no arguments.
* Registers a callback to run custom code at the very start of the fragment shader. This hook can be used inside <a href="#/p5/baseColorShader">baseColorShader()</a>.modify() and similar shader <a href="#/p5.Shader/modify">modify()</a> calls to set up variables or perform calculations that affect every pixel before color calculations begin. The callback receives no arguments.
*
* This hook is available in:
* - <a href="#/p5/baseColorShader">baseColorShader()</a>
Expand DownExpand Up@@ -1828,7 +1828,7 @@ if (typeof p5 !== 'undefined') {
/**
* @method getPixelInputs
* @description
* Registers a callback to modify the properties of each fragment (pixel) before the final color is calculated in the fragment shader. This hook can be used inside <a href="#/p5/baseMaterialShader">baseMaterialShader()</a>.modify() and similar shader <a href="#/p5.Shader/modify">modify</a> calls to adjust per-pixel data before lighting/mixing.
* Registers a callback to modify the properties of each fragment (pixel) before the final color is calculated in the fragment shader. This hook can be used inside <a href="#/p5/baseMaterialShader">baseMaterialShader()</a>.modify() and similar shader <a href="#/p5.Shader/modify">modify()</a> calls to adjust per-pixel data before lighting/mixing.
*
* The callback receives an `Inputs` object. Available fields depend on the shader:
*
Expand DownExpand Up@@ -1890,7 +1890,7 @@ if (typeof p5 !== 'undefined') {
* @method shouldDiscard
* @private
* @description
* 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 <a href="#/p5.Shader/modify">modify</a> calls to create effects like round points or custom masking. The callback receives a boolean:
* 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 <a href="#/p5.Shader/modify">modify()</a> calls to create effects like round points or custom masking. The callback receives a boolean:
* - `willDiscard`: true if the fragment would be discarded by default
*
* Return true to discard the fragment, or false to keep it.
Expand DownExpand Up@@ -1924,7 +1924,7 @@ if (typeof p5 !== 'undefined') {
/**
* @method getFinalColor
* @description
* 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 <a href="#/p5.Shader/modify">modify</a> calls to adjust the color before it appears on the screen. The callback receives a four component vector representing red, green, blue, and alpha.
* 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 <a href="#/p5.Shader/modify">modify()</a> calls to adjust the color before it appears on the screen. The callback receives a four component vector representing red, green, blue, and alpha.
*
* Return a new color array to change the output color.
*
Expand DownExpand Up@@ -1966,7 +1966,7 @@ if (typeof p5 !== 'undefined') {
* @method afterFragment
* @private
* @description
* Registers a callback to run custom code at the very end of the fragment shader. This hook can be used inside <a href="#/p5/baseColorShader">baseColorShader()</a>.modify() and similar shader <a href="#/p5.Shader/modify">modify</a> calls to perform cleanup or final per-pixel effects after all color calculations are done. The callback receives no arguments.
* Registers a callback to run custom code at the very end of the fragment shader. This hook can be used inside <a href="#/p5/baseColorShader">baseColorShader()</a>.modify() and similar shader <a href="#/p5.Shader/modify">modify()</a> calls to perform cleanup or final per-pixel effects after all color calculations are done. The callback receives no arguments.
*
* This hook is available in:
* - <a href="#/p5/baseColorShader">baseColorShader()</a>
Expand DownExpand Up@@ -2009,7 +2009,7 @@ if (typeof p5 !== 'undefined') {
/**
* @method getColor
* @description
* Registers a callback to set the final color for each pixel in a filter shader. This hook can be used inside <a href="#/p5/baseFilterShader">baseFilterShader()</a>.modify() and similar shader <a href="#/p5.Shader/modify">modify</a> calls to control the output color for each pixel. The callback receives the following arguments:
* Registers a callback to set the final color for each pixel in a filter shader. This hook can be used inside <a href="#/p5/baseFilterShader">baseFilterShader()</a>.modify() and similar shader <a href="#/p5.Shader/modify">modify()</a> calls to control the output color for each pixel. The callback receives the following arguments:
* - `inputs`: an object with the following properties:
* - `texCoord`: a two-component vector representing the texture coordinates (u, v).
* - `canvasSize`: a two-component vector representing the canvas size in pixels (width, height).
Expand DownExpand Up@@ -2052,7 +2052,7 @@ if (typeof p5 !== 'undefined') {
/**
* @method getObjectInputs
* @description
* Registers a callback to modify the properties of each vertex before any transformations are applied in the vertex shader. This hook can be used inside <a href="#/p5/baseColorShader">baseColorShader()</a>.modify() and similar shader <a href="#/p5.Shader/modify">modify</a> calls to move, color, or otherwise modify the raw model data. The callback receives an object with the following properties:
* Registers a callback to modify the properties of each vertex before any transformations are applied in the vertex shader. This hook can be used inside <a href="#/p5/baseColorShader">baseColorShader()</a>.modify() and similar shader <a href="#/p5.Shader/modify">modify()</a> calls to move, color, or otherwise modify the raw model data. The callback receives an object with the following properties:
*
* - `position`: a three-component vector representing the original position of the vertex.
* - `normal`: a three-component vector representing the direction the surface is facing.
Expand DownExpand Up@@ -2099,7 +2099,7 @@ if (typeof p5 !== 'undefined') {
/**
* @method getCameraInputs
* @description
* Registers a callback to adjust vertex properties after the model has been transformed by the camera, but before projection, in the vertex shader. This hook can be used inside <a href="#/p5/baseColorShader">baseColorShader()</a>.modify() and similar shader <a href="#/p5.Shader/modify">modify</a> calls to create effects that depend on the camera's view. The callback receives an object with the following properties:
* Registers a callback to adjust vertex properties after the model has been transformed by the camera, but before projection, in the vertex shader. This hook can be used inside <a href="#/p5/baseColorShader">baseColorShader()</a>.modify() and similar shader <a href="#/p5.Shader/modify">modify()</a> calls to create effects that depend on the camera's view. The callback receives an object with the following properties:
*
* - `position`: a three-component vector representing the position after camera transformation.
* - `normal`: a three-component vector representing the normal after camera transformation.
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp