From 86a97436c1f13a29f172c128b1fdf03755232e25 Mon Sep 17 00:00:00 2001 From: Ksenia Kondrashova Date: Fri, 20 Dec 2024 23:13:48 +0400 Subject: [PATCH] docs added for dots grid --- packages/shaders-react/src/index.ts | 2 +- packages/shaders/src/shaders/dots-grid.ts | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/shaders-react/src/index.ts b/packages/shaders-react/src/index.ts index 751425a..8b49e54 100644 --- a/packages/shaders-react/src/index.ts +++ b/packages/shaders-react/src/index.ts @@ -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'; diff --git a/packages/shaders/src/shaders/dots-grid.ts b/packages/shaders/src/shaders/dots-grid.ts index 91707fd..e87058b 100644 --- a/packages/shaders/src/shaders/dots-grid.ts +++ b/packages/shaders/src/shaders/dots-grid.ts @@ -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