# frag-canvas **A custom element providing a canvas to apply a fragment shader to.** The `` element renders an output canvas and applies a fragment shader to it. The canvas' input is either determined by an internal input canvas (that can be drawn to using the usual `getContext()` draw context) or an input image or video element, passed as a child element. The fragment shader is sourced from a script child or the element's text contents. The fragment shader may either be written in GLSL ES 100 or GLSL ES 300, but the internal context will always be created using WebGL 2. The fragment shader may use input uniforms that are roughly the same as [ShaderToy's](https://www.shadertoy.com/howto) with these uniforms being supported: - `iResolution` - `iChannelResolution` (with one channel only) - `iTime` - `iTimeDelta` - `iFrame` - `iChannel` (always `0`) - `iDate` Only one channel will be provided (`uniform sampler2D iChannel0`) ### Applying a fragment shader to an image ```html ``` ### Applying a fragment shader to canvas contents ```html ``` ### Auto-resizing the canvas while redrawing ```html ```