Docs/Formas

Voxels

MIT

Rebuild 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';
2
3export default function Demo() {
4 return (
5 <ShaderVoxels
6 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

PropTipoPor defectoDescripción
scalenumber1Scale
rotationnumber0Rotation
voxelSizenumber0.035Voxel Size
voxelShape'cube' | 'rounded' | 'sphere'"cube"Voxel Shape
voxelScalenumber1Voxel Fill
fillnumber0Surface Bias
bevelnumber0.08Bevel
depthnumber0.12Depth
gridSpace'shape' | 'view'"shape"Grid
colorAstring"#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.