PRO

Material Spotlight

A cursor-driven material reveal on a 3D model. A near-matte standard material lit by a room-environment IBL gets a shader patch that carves a soft sphere of low-roughness, darker diffuse around the pointer's world-space hit — a wet, polished spotlight that follows the cursor and eases away. Three.js + WebGL.

Component
Install
npx shadcn@latest add https://ui.aryank.space/r/material-spotlight.json

Installs from ui.aryank.space. To add it by hand, copy the files in Usage below, or register the @compronents namespace via the docs.

Files

API
PropTypeDefaultDescription
srcstring"…/material-spotlight/model.glb"Model URL (.glb / .gltf), same-origin or CORS-enabled.
backgroundstring"#dddcd7"Clear / background color.
radiusnumber0.15Radius of the polished spotlight, in world units.
softnessnumber0.35Soft falloff width past the radius.
lerpnumber0.05Follow easing for the hit point and activation per frame.
exposurenumber0.65ACES tone-mapping exposure.
Customize
backgroundcolor

Clear color behind the model.

radius / softnesstext

Size of the polished sphere and the feather past its edge.

srcasset-url

GLB model, hosted through https://ui.aryank.space/assets/material-spotlight/model.glb.

Dependencies
three