BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/remocn/camera-lens

Camera Lens

remocn/camera-lens
FreeComponent

Put a scene behind real glass: resolution falls off toward the corners, highlights bloom through the optics, colour fringes at the edges — a screencast that reads as filmed rather than rendered.

Install it

npx shadcn@latest add https://www.remocn.dev/r/camera-lens.json

Source

registry/remocn/camera-lens/index.tsxwww.remocn.dev/r/camera-lens.json
1"use client";
2
3import type React from "react";
4import { AbsoluteFill } from "remotion";
5import {
6 type CanvasFilterProps,
7 makeCanvasFilter,
8 makeFilterShader,
9} from "@/lib/remocn/canvas-presentation";
10
11export type CameraLensProps = {
12 softness?: number;
13 bloom?: number;
14 aberration?: number;
15 vignette?: number;
16 distortion?: number;
17};
18
19const DEFAULTS = {
20 softness: 0.5,
21 bloom: 0.5,
22 aberration: 0.5,
23 vignette: 0.5,
24 distortion: 0.05,
25};
26
27const FRAGMENT_SHADER = `#version 300 es
28precision highp float;
29
30uniform sampler2D u_scene;
31uniform float u_aspect;
32uniform float u_softness;
33uniform float u_bloom;
34uniform float u_aberration;
35uniform float u_vignette;
36uniform float u_distortion;
37
38in vec2 v_uv;
39out vec4 outColor;
40
41const int SOFT_TAPS = 6;
42const int GLARE_TAPS = 8;
43const float GOLDEN = 2.39996323;
44
45vec2 lensUv(vec2 direction, float distance) {
46 vec2 q = direction * distance;
47 q.x /= u_aspect;
48 return q * 0.5 + 0.5;
49}
50
51vec2 spiral(int index, int count, float radius, float turn) {
52 float angle = float(index) * GOLDEN + turn;
53 float step = sqrt((float(index) + 0.5) / float(count)) * radius;
54 return vec2(cos(angle) * step / u_aspect, sin(angle) * step);
55}
56
57vec4 softSample(vec2 uv, float radius) {
58 vec4 sum = texture(u_scene, uv);
59 if (radius <= 0.00002) {
60 return sum;
61 }
62 for (int i = 0; i < SOFT_TAPS; i++) {
63 sum += texture(u_scene, uv + spiral(i, SOFT_TAPS, radius, 0.0));
64 }
65 return sum / float(SOFT_TAPS + 1);
66}
67
68void main() {
69 vec2 p = (v_uv - 0.5) * 2.0;
70 p.x *= u_aspect;
71
72 float span = sqrt(u_aspect * u_aspect + 1.0);
73 float reach = length(p);
74 float radius = reach / span;
75 vec2 direction = reach > 0.0001 ? p / reach : vec2(0.0);
76
77 float bend = 1.0 / (1.0 + clamp(u_distortion, 0.0, 1.0) * radius * radius);
78 float focused = reach * bend;
79 vec2 base = lensUv(direction, focused);
80
81 float soft = u_softness * 0.011 * smoothstep(0.22, 1.0, radius);
82 float split = u_aberration * 0.0035 * radius;
83
84 vec4 mid = softSample(base, soft);
85 float red = softSample(lensUv(direction, focused * (1.0 + split)), soft).r;
86 float blue = softSample(lensUv(direction, focused * (1.0 - split)), soft).b;
87 vec3 color = vec3(red, mid.g, blue);
88
89 vec3 glare = vec3(0.0);
90 for (int i = 0; i < GLARE_TAPS; i++) {
91 vec3 tap =
92 texture(u_scene, base + spiral(i, GLARE_TAPS, u_bloom * 0.026, 0.7)).rgb;
93 glare += max(tap - 0.62, vec3(0.0));
94 }
95 color += (glare / float(GLARE_TAPS)) * u_bloom * 1.4;
96
97// … truncated

What it pulls in

npm packages

  • remotion

Other registry items

  • @remocn/canvas-presentation

Files it writes

  • registry/remocn/camera-lens/index.tsx

Facts

Registry
remocn
Type
registry:component
Access
Free
Files written
1
Licence
the repository states none
First indexed
2026-08-04
Last confirmed
today

Go to the source

www.remocn.dev Remocn/remocn on GitHub Raw registry item This item as JSON

More from remocn

All 277 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
UI AccordionaccordionremocnComponentsFree1 dep · 2 files
UI AI Prompt Flowai-prompt-flowremocnComponentsFree1 dep
UI Alert Dialogalert-dialogremocnComponentsFree1 dep · 2 files
Animated Bar Chartanimated-bar-chartremocnComponentsFree1 dep
Animated Line Chartanimated-line-chartremocnComponentsFree1 dep
ASCII Dissolveascii-dissolveremocnComponentsFree2 deps
ASCII Renderascii-renderremocnComponentsFree1 dep
BackdropbackdropremocnComponentsFree1 dep
BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex