Glass

Optically realistic glass lens driven in a custom shape

Props

PropTypeDefaultDescription
originorigincenterReference edge the center position is measured from (center default). Lets you pin the shape relative to a corner or the canvas centre.
centerposition{"x":0.5,"y":0.5}Center position of the glass shape
scalerange1Scale of the glass shape (1 = default size)
rotationrange0Rotation of the glass shape in degrees
cutoutcheckboxfalseCut out the alpha outside the glass shape
refractionrange1Lens refraction — how aggressively the edges warp content beneath (0 = none, 1 = max)
edgeSoftnessrange0.1Edge softness — higher values give a wider, softer fade at the glass boundary
blurrange0Frosted blur amount — 0 = clear glass, higher = frosted/diffuse
thicknessrange0.2Glass depth — how far inward from the edge the refraction extends
aberrationrange0.5Chromatic aberration — splits RGB channels along the refraction vector
innerZoomrange1Inner zoom level — magnifies content seen through the glass
lightAnglerange300Light angle in degrees
highlightrange0.05Directional edge highlight — bright rim on the light-facing boundary
highlightColorcolor#ffffffColor of the directional edge highlight and specular glint
highlightSoftnessrange0.5Specular highlight softness
fresnelrange0.1Fresnel rim glow — a soft luminous halo around the glass boundary
fresnelSoftnessrange0.1Fresnel rim width — higher values spread the glow further inward
fresnelColorcolor#ffffffColor of the fresnel rim glow
tintColorcolor#ffffffColor tint applied to the internal directional gradient
tintIntensityrange0Intensity of the color tint applied to the glass interior
tintPreserveLuminositycheckboxtruePreserve original brightness when tinting
shapeshape{"type":"sphere3D","radius":0.35}Serialized shape configuration (JSON)
shapeSdfUrlshape-uploadURL to a pre-generated SDF .bin file — when non-empty, activates SVG mode and triggers a shader recompile
shapeType-Active SDF shape type — triggers recompile when shape is switched. When empty, derived from shape JSON at mount time.

Usage

vue
<Shader>
  <Glass>
    <Circle />
  </Glass>
</Shader>