import { GpuShaderDefinition } from '../../gpu/porters'; import { transformPosition, transformColor } from '../../utilities/transformations'; import { BoundingBoxOrigin, MousePositionConfig } from '../../types'; /** One light: where it sits (a mouse-position driver may stand in), its colour, its brightness. */ export interface IrradianceLight extends Record { position: { x: number; y: number; } | MousePositionConfig; color: string; intensity: number; } export interface ComponentProps { /** * Reference edge the center position is measured from (center default). Lets you pin the shape relative to a corner or the canvas centre. * * @default "center" */ origin: BoundingBoxOrigin; /** * Center position of the shape * * Accepts `{ x, y }` objects with values from 0 to 1, or CSS positions like `top center`. * @default {"x":0.5,"y":0.5} */ center: Parameters[0]; /** * Scale of the shape (1 = default size) * * Accepts a number between 0.1 and 3. * @default 1 */ scale: number; /** * Rotation of the shape in degrees * * Accepts a number between 0 and 360. * @default 0 */ rotation: number; lights: IrradianceLight[]; /** * Height of the lights above the shape plane, relative to the shape — low lights graze the body, high lights flood it evenly * * @default 0.5 */ lightHeight: number; /** * Reach of each light — the distance at which it has fallen to half strength, relative to the shape * * @default 1.2 */ lightRange: number; /** * How far from the shape the spilled light is gathered, relative to the shape — the glow fades out toward this distance * * @default 3 */ reach: number; /** * The lit edge seen directly — the white-hot line along the rim where the lights strike * * @default 1 */ core: number; /** * How far light wraps around edges that face away from it — 0 leaves the far side dark * * @default 0.1 */ wrap: number; /** * Cast shadows — the body blocks each light from edges it stands in front of (keeps holes and concave pockets dark) * * Accepts a boolean value (`true` or `false`). * @default true */ shadows: boolean; /** * Penumbra width of the cast shadows — 0 is razor sharp * * @default 0.15 */ shadowSoftness: number; /** * Color of the shape itself — black for a pure occluder, lighter to see the lights land on its form * * Accepts hex strings (`#ff0000`), RGB objects (`{ r, g, b }`), or CSS color names (`limegreen`). * @default "#000000" */ bodyColor: Parameters[0]; /** * How much the lights illuminate the body — the bevel of a flat shape or the form of a 3D one * * @default 0.6 */ bodyLight: number; /** * Width of the rounded edge a flat shape catches the light on, relative to the shape * * @default 0.01 */ bevelWidth: number; edgeSoftness: number; /** * Serialized shape configuration (JSON) * * @default "DEFAULT_SHAPE_CONFIG" */ shape: string | Record; /** * URL to a pre-generated SDF .bin file * * @default "" */ shapeSdfUrl: string; /** * Active SDF shape type * * @default "" */ shapeType: string; } export declare const componentDefinition: GpuShaderDefinition; export default componentDefinition; //# sourceMappingURL=index.d.ts.map