Skip to documentation

Components

Physical Glass Logo

An SVG-defined glass volume with a sculpted bevel, refraction at both surfaces, spectral dispersion, volumetric absorption, and GGX reflections.

  • pixi.js@^8.20.1

Preparing preview…

Installation

Choose your framework. The registry installs one component file and its PixiJS dependency.

Installation unavailable

This preview is not assigned to the free or paid catalog. Installation is unavailable.

The registry command writes the component to src/lib/components/ui/PhysicalGlassLogo.svelte and installs its dependencies.

The registry command writes the component to src/components/ui/PhysicalGlassLogo.tsx and installs its dependencies.

The registry command writes the component to src/components/ui/PhysicalGlassLogo.vue and installs its dependencies.

The generated component builds its SVG distance field in the browser and does not upload artwork to a server.

PixiJS provides matching WebGPU and WebGL implementations, with WebGL used as the fallback backend.

Overview

The SVG silhouette is converted to a signed-distance field. One height profile uses its distance and gradient to shape the raised front bevel and derive its normals; a flat rear surface completes the glass volume.

Light rays refract at entry and exit according to Snell’s law. Schlick Fresnel balances reflection and transmission, Beer-Lambert absorption tints the internal path, and a GGX microfacet lobe shapes the highlights.

Basic usage

The shader fills its parent. Your layout decides whether that parent is a card, hero, or viewport.

Hero.svelte
<script lang="ts">
	import PhysicalGlassLogo from '$lib/components/ui/PhysicalGlassLogo.svelte';
</script>

<section class="relative h-128 overflow-hidden">
	<PhysicalGlassLogo
		class="absolute inset-0"
		svgSource="/images/your-logo.svg"
		speed={0.8}
	/>

	<div class="relative z-10">Your content</div>
</section>
<script lang="ts">
	import PhysicalGlassLogo from '$lib/components/ui/PhysicalGlassLogo.svelte';
</script>

<section class="relative h-128 overflow-hidden">
	<PhysicalGlassLogo
		class="absolute inset-0"
		svgSource="/images/your-logo.svg"
		speed={0.8}
	/>

	<div class="relative z-10">Your content</div>
</section>
import { PhysicalGlassLogo } from '@/components/ui/PhysicalGlassLogo';

export function Hero() {
	return (
		<section className="relative h-128 overflow-hidden">
			<PhysicalGlassLogo
				className="absolute inset-0"
				svgSource="/images/your-logo.svg"
				speed={0.8}
			/>

			<div className="relative z-10">Your content</div>
		</section>
	);
}
import { PhysicalGlassLogo } from '@/components/ui/PhysicalGlassLogo';

export function Hero() {
	return (
		<section className="relative h-128 overflow-hidden">
			<PhysicalGlassLogo
				className="absolute inset-0"
				svgSource="/images/your-logo.svg"
				speed={0.8}
			/>

			<div className="relative z-10">Your content</div>
		</section>
	);
}
<script setup lang="ts">
import PhysicalGlassLogo from '@/components/ui/PhysicalGlassLogo.vue';
</script>

<template>
	<section class="relative h-128 overflow-hidden">
		<PhysicalGlassLogo
			class="absolute inset-0"
			svgSource="/images/your-logo.svg"
			:speed="0.8"
		/>

		<div class="relative z-10">Your content</div>
	</section>
</template>
<script setup lang="ts">
import PhysicalGlassLogo from '@/components/ui/PhysicalGlassLogo.vue';
</script>

<template>
	<section class="relative h-128 overflow-hidden">
		<PhysicalGlassLogo
			class="absolute inset-0"
			svgSource="/images/your-logo.svg"
			:speed="0.8"
		/>

		<div class="relative z-10">Your content</div>
	</section>
</template>
  • The defaults form a wide, shallow bevel with a quadratic slope falloff. Width controls its footprint, height controls its slope, and curvature concentrates the bend toward the outline.
  • Index of refraction controls bending at both surfaces. Glass thickness and background distance determine how far the transmitted image is displaced.
  • Set dispersion to 0 for neutral refraction, or increase it to separate the red and blue ray paths.
  • The current version refracts its built-in animated color field rather than arbitrary page content.
  • Simple, filled SVG silhouettes produce the cleanest normals and internal ridges.

Component API

Types below match the selected Svelte component.

Property Type Default Range / values
class
string
svgSource
string Inline SVG, URL, or data URL
speed
number 1 0–2
scale
number 1 0.2–2
offsetX
number 0 -0.5–0.5
offsetY
number 0 -0.5–0.5
rotation
number 0 -180–180
bevelWidth
number 0.04 0.01–0.5
bevelHeight
number 0.05 0–0.25
bevelCurve
number 0.5 0.25–6
surfaceSmoothing
number 0.01 0.0005–0.04
glassThickness
number 0.35 0.01–1
ior
number 1.5 1–2.5
dispersion
number 1 0–3
sceneDepth
number 0.7 0–2
blur
number 1 0–2.5
swirlColorA
string "#131315"
swirlColorB
string "#5867D3"
absorptionColor
string "#E4E8FF"
absorptionStrength
number 0.15 0–2
lightAngle
number 300 0–360
lightElevation
number 2 0.1–5
lightIntensity
number 1.5 0–5
roughness
number 0.18 0.04–1
paused
boolean false
interactive
boolean false
maxDpr
number 2 1–3
resolutionScale
number 1 0.25–1
onReady
(backend: ShaderBackend) => void webgpu, webgl
onRendererChange
(backend: ShaderBackend, reason: string) => void webgl
onError
(error: Error) => void
bind:this
Component public instance pause, resume, reset, resize, destroy

Types below match the selected React component.

Property Type Default Range / values
className
string
svgSource
string Inline SVG, URL, or data URL
speed
number 1 0–2
scale
number 1 0.2–2
offsetX
number 0 -0.5–0.5
offsetY
number 0 -0.5–0.5
rotation
number 0 -180–180
bevelWidth
number 0.04 0.01–0.5
bevelHeight
number 0.05 0–0.25
bevelCurve
number 0.5 0.25–6
surfaceSmoothing
number 0.01 0.0005–0.04
glassThickness
number 0.35 0.01–1
ior
number 1.5 1–2.5
dispersion
number 1 0–3
sceneDepth
number 0.7 0–2
blur
number 1 0–2.5
swirlColorA
string "#131315"
swirlColorB
string "#5867D3"
absorptionColor
string "#E4E8FF"
absorptionStrength
number 0.15 0–2
lightAngle
number 300 0–360
lightElevation
number 2 0.1–5
lightIntensity
number 1.5 0–5
roughness
number 0.18 0.04–1
paused
boolean false
interactive
boolean false
maxDpr
number 2 1–3
resolutionScale
number 1 0.25–1
onReady
(backend: ShaderBackend) => void webgpu, webgl
onRendererChange
(backend: ShaderBackend, reason: string) => void webgl
onError
(error: Error) => void
ref
PhysicalGlassLogoHandle pause, resume, reset, resize, destroy

Types below match the selected Vue component.

Property Type Default Range / values
class
string
svgSource
string Inline SVG, URL, or data URL
speed
number 1 0–2
scale
number 1 0.2–2
offsetX
number 0 -0.5–0.5
offsetY
number 0 -0.5–0.5
rotation
number 0 -180–180
bevelWidth
number 0.04 0.01–0.5
bevelHeight
number 0.05 0–0.25
bevelCurve
number 0.5 0.25–6
surfaceSmoothing
number 0.01 0.0005–0.04
glassThickness
number 0.35 0.01–1
ior
number 1.5 1–2.5
dispersion
number 1 0–3
sceneDepth
number 0.7 0–2
blur
number 1 0–2.5
swirlColorA
string "#131315"
swirlColorB
string "#5867D3"
absorptionColor
string "#E4E8FF"
absorptionStrength
number 0.15 0–2
lightAngle
number 300 0–360
lightElevation
number 2 0.1–5
lightIntensity
number 1.5 0–5
roughness
number 0.18 0.04–1
paused
boolean false
interactive
boolean false
maxDpr
number 2 1–3
resolutionScale
number 1 0.25–1
@ready
(backend: ShaderBackend) => void webgpu, webgl
@rendererchange
(backend: ShaderBackend, reason: string) => void webgl
@error
(error: Error) => void
ref
Component public instance pause, resume, reset, resize, destroy