import { GpuShaderDefinition } from '../../gpu/porters'; import { transformPosition, transformColor } from '../../utilities/transformations'; import { BoundingBoxOrigin } from '../../types'; 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 voxel model * * 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 voxel model (1 = default size) * * Accepts a number between 0.1 and 3. * @default 1 */ scale: number; /** * Rotation of the voxel model in degrees * * Accepts a number between 0 and 360. * @default 0 */ rotation: number; /** * Edge length of one voxel relative to the shape field — small for fine detail, large for chunky blocks * * Accepts a number between 0.006 and 0.15. * @default 0.035 */ voxelSize: number; /** * What each cell is built from: hard cubes, rounded cubes (see Bevel) or spheres * * Accepts one of: `"cube"`, `"rounded"`, `"sphere"`. * @default "cube" */ voxelShape: string; /** * Size of each voxel inside its cell — 1 = touching neighbours, lower opens gaps between the blocks * * Accepts a number between 0.3 and 1. * @default 1 */ voxelScale: number; /** * How eagerly cells fill in along the surface — negative carves a thinner model, positive puffs it out * * Accepts a number between -0.5 and 0.5. * @default 0 */ fill: number; /** * Edge rounding of each voxel as a fraction of its size — a hairline chamfer catching light on cubes, the corner radius of rounded cubes * * Accepts a number between 0 and 1. * @default 0.08 */ bevel: number; /** * Thickness given to flat shapes (2D shapes and flat SVGs) so they become a slab of voxels — 3D shapes ignore it * * Accepts a number between 0.01 and 0.6. * @default 0.12 */ depth: number; /** * Model: the grid rotates with the shape like a built voxel model. Screen: the grid is fixed to the canvas and the shape moves through it like a 3D pixelation * * Accepts one of: `"shape"`, `"view"`. * @default "shape" */ gridSpace: string; /** * Base colour of the voxels (the first colour of the palette mode) * * Accepts hex strings (`#ff0000`), RGB objects (`{ r, g, b }`), or CSS color names (`limegreen`). * @default "#6ea8ff" */ colorA: Parameters[0]; /** * Second palette colour — blended in by height, depth, per voxel or on the side faces * * Accepts hex strings (`#ff0000`), RGB objects (`{ r, g, b }`), or CSS color names (`limegreen`). * @default "#1d2b4f" */ colorB: Parameters[0]; /** * How the two colours are laid over the model: one solid colour, a gradient by height or depth, a random pick per voxel, or Color A on top faces and Color B on the sides * * Accepts one of: `"solid"`, `"height"`, `"depth"`, `"random"`, `"faces"`. * @default "height" */ colorMode: string; /** * Per-voxel tonal jitter — the slightly-off shades that make blocks read as individual bricks * * @default 0.25 */ colorVariation: number; /** * Color space for color interpolation * * Accepts one of the predefined option values. * @default "oklab" */ colorSpace: string; /** * Direction the key light comes from, in degrees around the canvas — shadows fall away from it * * @default 225 */ lightAngle: number; /** * How high the key light sits above the canvas — low for long raking shadows, high for a flat top-down light * * @default 42 */ lightElevation: number; /** * Colour of the key light * * Accepts hex strings (`#ff0000`), RGB objects (`{ r, g, b }`), or CSS color names (`limegreen`). * @default "#fff2df" */ lightColor: Parameters[0]; /** * Strength of the key light * * @default 1.1 */ lightIntensity: number; /** * Sky colour of the ambient light — the fill on faces the key light misses * * Accepts hex strings (`#ff0000`), RGB objects (`{ r, g, b }`), or CSS color names (`limegreen`). * @default "#9fb4d8" */ ambientColor: Parameters[0]; /** * Strength of the ambient sky/ground fill * * @default 0.55 */ ambient: number; /** * Darkness of the shadows voxels cast onto each other * * @default 0.85 */ shadows: number; /** * Penumbra of the cast shadows — 0 is razor sharp, higher spreads the light into a soft area source whose shadows sharpen at contact * * @default 0.35 */ shadowSoftness: number; /** * Ambient occlusion in the creases between voxels — the soft contact darkening that sells the geometry * * @default 1 */ ao: number; /** * How tight the specular highlight is — satin plastic at 0, lacquered at 1 * * @default 0.35 */ glossiness: number; /** * Strength of the specular highlight and the fresnel rim on grazing faces * * @default 0.6 */ specular: number; /** * Dark seam lines along every voxel edge — 0 for seamless blocks, higher for a drawn-outline brick look * * @default 0.2 */ seams: 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