Documentation

Glass

Optically realistic glass lens driven in a custom shape

Props

center{x: number, y: number}
Default:{"x":0.5,"y":0.5}
Center position of the glass shape
scalenumber
Default:1
Scale of the glass shape (1 = default size)
cutoutboolean
Default:false
Cut out the alpha outside the glass shape
refractionnumber
Default:1
Lens refraction — how aggressively the edges warp content beneath (0 = none, 1 = max)
edgeSoftnessnumber
Default:0.1
Edge softness — higher values give a wider, softer fade at the glass boundary
blurnumber
Default:0
Frosted blur amount — 0 = clear glass, higher = frosted/diffuse
thicknessnumber
Default:0.2
Glass depth — how far inward from the edge the refraction extends
aberrationnumber
Default:0.5
Chromatic aberration — splits RGB channels along the refraction vector
innerZoomnumber
Default:1
Inner zoom level — magnifies content seen through the glass
lightAnglenumber
Default:300
Light angle in degrees
highlightnumber
Default:0.05
Directional edge highlight — bright rim on the light-facing boundary
highlightColorstring
Default:#ffffff
Color of the directional edge highlight and specular glint
highlightSoftnessnumber
Default:0.5
Specular highlight softness
fresnelnumber
Default:0.1
Fresnel rim glow — a soft luminous halo around the glass boundary
fresnelSoftnessnumber
Default:0.1
Fresnel rim width — higher values spread the glow further inward
fresnelColorstring
Default:#ffffff
Color of the fresnel rim glow
tintColorstring
Default:#ffffff
Color tint applied to the internal directional gradient
tintIntensitynumber
Default:0
Intensity of the color tint applied to the glass interior
tintPreserveLuminosityboolean
Default:true
Preserve original brightness when tinting
shapeShapeConfig
Default:circleSDF
Shape to render — choose from 11 built-in analytical shapes or supply a custom SDF. See the Shape Effects guide for all available shapes and their options.
shapeSdfUrlstring
Default:""
URL to a pre-generated SDF `.bin` file — when non-empty, activates SVG mode and triggers a shader recompile. See the Shape Effects guide for how to generate an SDF from an SVG.

Usage

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