Skip to content

Commit

Permalink
docs added for dots grid
Browse files Browse the repository at this point in the history
  • Loading branch information
uuuulala committed Dec 20, 2024
1 parent 508dd38 commit 86a9743
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/shaders-react/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export { type DotsOrbitProps } from './shaders/dots-orbit';
export { type DotsOrbitParams } from './shaders/dots-orbit';
export { type DotsOrbitUniforms } from '@paper-design/shaders';

// Static grid made of dots (or other shapes)
// Static grid made of dots
export { DotsGrid, dotsGridPresets } from './shaders/dots-grid';
export { type DotsGridProps } from './shaders/dots-grid';
export { type DotsGridParams } from './shaders/dots-grid';
Expand Down
9 changes: 8 additions & 1 deletion packages/shaders/src/shaders/dots-grid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,19 @@ export type DotsGridUniforms = {
};

/**
* Dots Pattern
* Dots Grid Pattern
*
* Uniforms include:
* u_colorBack: Background color
* u_colorFill: Dots fill color
* u_colorStroke: Dots stroke color
* u_dotSize: The base dot radius, px
* u_strokeWidth: The stroke (to be subtracted from u_dotSize), px
* u_gridSpacingX: Horizontal grid spacing, px
* u_gridSpacingY: Vertical grid spacing, px
* u_sizeRange: Variety of dot size, 0..1
* u_opacityRange: Variety of dot opacity to be applied equally to fill and stroke, 0..1
*
*/

export const dotsGridFragmentShader = `#version 300 es
Expand Down

0 comments on commit 86a9743

Please sign in to comment.