Skip to content

Commit

Permalink
added additional information about shader behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
deveshidwivedi committed Dec 1, 2023
1 parent 0c174c6 commit b6bedb0
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/webgl/material.js
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,14 @@ p5.prototype.createFilterShader = function (fragSrc) {
* Use <a href="#/p5/resetShader">resetShader()</a> to
* restore the default shaders.
*
* **Additional Information:**
* The shader will be used for:
- Fills when a texture is enabled if it includes a uniform `sampler2D`.
- Fills when lights are enabled if it includes the attribute `aNormal`, or if it has any of the following uniforms: `uUseLighting`, `uAmbientLightCount`, `uDirectionalLightCount`, `uPointLightCount`, `uAmbientColor`, `uDirectionalDiffuseColors`, `uDirectionalSpecularColors`, `uPointLightLocation`, `uPointLightDiffuseColors`, `uPointLightSpecularColors`, `uLightingDirection`, or `uSpecular`.
- Fills whenever there are no lights or textures.
- Strokes if it includes the uniform `uStrokeWeight`.
* **Note:** This behavior is considered experimental, and changes are planned in future releases.
*
* Note, shaders can only be used in WEBGL mode.
*
* @method shader
Expand Down

0 comments on commit b6bedb0

Please sign in to comment.