Voxels
MITRebuild any shape out of voxels — a flat shape becomes chunky pixel art, a 3D shape a lit voxel model with smooth ambient occlusion, cast shadows, a key light you can orbit or drive, and per-cube color
Cargando shader…
Ajústalo
1
0
0.035
1
0
0.08
0.12
Instalación
Terminal
npx shadcn@latest add https://<tu-dominio>/r/shader-voxels.json
Crea components/bastard/ShaderVoxels.tsx e instala shaders. Más opciones
Uso
Demo.tsx
1import ShaderVoxels from '@/components/bastard/ShaderVoxels';23export default function Demo() {4 return (5 <ShaderVoxels6 scale={1}7 rotation={0}8 voxelSize={0.035}9 voxelShape="cube"10 voxelScale={1}11 fill={0}12 bevel={0.08}13 depth={0.12}14 gridSpace="shape"15 colorA="#6ea8ff"16 />17 );18}
Props
| Prop | Tipo | Por defecto | Descripción |
|---|---|---|---|
| scale | number | 1 | Scale |
| rotation | number | 0 | Rotation |
| voxelSize | number | 0.035 | Voxel Size |
| voxelShape | 'cube' | 'rounded' | 'sphere' | "cube" | Voxel Shape |
| voxelScale | number | 1 | Voxel Fill |
| fill | number | 0 | Surface Bias |
| bevel | number | 0.08 | Bevel |
| depth | number | 0.12 | Depth |
| gridSpace | 'shape' | 'view' | "shape" | Grid |
| colorA | string | "#6ea8ff" | Color A |
Aquí aparecen las props ajustables. El componente acepta más: revisa el código fuente.
Créditos
Basado en Voxels · Shaders.com, adaptado para BSTRD UI.Licencia: MIT. Puedes usarlo, modificarlo y venderlo, conservando el aviso de copyright que va dentro del archivo.