# Unfocused

**Group:** 3D and WebGL scenes  
**Recording:** [https://s4xw77gvirailb62.public.blob.vercel-storage.com/lab/unfocused.mp4](https://s4xw77gvirailb62.public.blob.vercel-storage.com/lab/unfocused.mp4)  
**Source:** [https://ui.aryank.space/components/unfocused](https://ui.aryank.space/components/unfocused)  
**Human:** https://blankinterfaces.com/lab/unfocused

---

## What it is

An image or video under a directional lens blur that ramps from sharp at one edge to heavy blur at the other, with red and blue split apart and a fixed grain in the shadows. On mount the blur, grain and distortion run to zero over two seconds, so the picture pulls into focus. One WebGL fragment shader, no dependencies.

## Behaviour

### The grain hashes the pixel position

Each pixel jitters its 24 disc samples with a sine hash of its uv, so the blur reads as grain rather than a smooth gaussian. The hash is sensitive to the last bits of uv, which is why the plane, camera and index order follow the source's OGL scene.

### Rests a hair short of focus

Like the source, the loop stops on the frame the focus pull completes without drawing it. The resting frame keeps a blur of about 0.03 at 60Hz, which reads as sharp.

### Media needs CORS

The image or video is uploaded as a WebGL texture, so it must be same-origin or served with CORS headers. Images get mipmaps; video frames upload every frame while playing.

---

[View all content](https://blankinterfaces.com/sitemap.md)
