TwoβValue Display Syntax Playground - Online Outer & Inner
Explore the new twoβvalue display syntax like `display: block flex`. See what each inner/outer pair does visually.
UD5 Toolkit
A GLSL fragment shader (also called a pixel shader) is a program that runs on the GPU and determines the color of each pixel on the screen. It's written in GLSL (OpenGL Shading Language) and executes in parallel for every pixel, making it incredibly fast for creating real-time visual effects, generative art, and procedural textures.
Three uniforms are automatically provided: uniform float u_time (elapsed time in seconds), uniform vec2 u_resolution (canvas resolution in pixels), and uniform vec2 u_mouse (normalized mouse position, 0-1 range). Declare these at the top of your shader to use them.
Start with the Gradient preset and experiment by changing numbers and colors. The basic pattern is: get the UV coordinates with gl_FragCoord.xy / u_resolution, then use mathematical functions like sin(), cos(), and length() to create patterns. Try the Wave, Plasma, and Kaleidoscope presets to see different techniques in action.
Our playground uses a similar paradigm but with simpler uniforms. Shadertoy's iTime corresponds to our u_time, iResolution to u_resolution, and iMouse to u_mouse. To port a Shadertoy shader, rename the uniforms and replace mainImage(out vec4 fragColor, in vec2 fragCoord) with void main() using gl_FragColor and gl_FragCoord.
All modern browsers support WebGL, including Chrome (version 9+), Firefox (version 4+), Safari (version 8+), and Edge (version 12+). Mobile browsers on iOS and Android also support WebGL. If you see a WebGL not supported message, try updating your browser or enabling hardware acceleration in your browser settings.
Compilation errors appear in the red error panel below the editor. The error message includes the line number where the issue was detected. Common errors include missing semicolons, undeclared variables, and type mismatches. Remember that GLSL is case-sensitive and requires strict typing. Use Ctrl+Enter (or Cmd+Enter on Mac) to manually trigger compilation.
This playground is designed for pure procedural shaders without external textures. However, you can create texture-like effects using noise functions, gradients, and mathematical patterns. For advanced use with textures, consider tools like Shadertoy or desktop applications like Bonzomatic or KodeLife.
You can copy your shader code using the Copy button in the toolbar, then paste it into a text file or share it with others. You can also download a PNG screenshot of the current render using the Camera button. To resume work later, simply paste your saved code back into the editor.
Always declare precision highp float; at the top of your fragment shader for the best visual quality on all devices.
Use u_time with sin() and cos() to create looping animations. Multiply by different frequencies for varied motion speeds.
gl_FragCoord.xy / u_resolution gives normalized coordinates (0-1). Subtract 0.5 to center the origin for rotation effects.
u_mouse provides normalized coordinates. Use length(uv - u_mouse) to create effects that follow the cursor.
Explore the new twoβvalue display syntax like `display: block flex`. See what each inner/outer pair does visually.
Write modern CSS color functions like oklch(), lab(), hwb() and see the rendered color with fallback. Copy compatible code.
Write CSS like `oklch(from red l c h)` to modify colors dynamically. Preview the output and copy the code.
Chain multiple CSS filter functions and see the result on an image. Copy the filter string. No upload.
Change all alignment and justification values and see the flex items move. Indispensable for learning Flexbox.
Drag a positioned box and see the top/right/bottom/left values change. Understand containing blocks. Visual.
Type text and instantly see it rendered with textβtransform: uppercase, lowercase, capitalize, and fullβwidth. Copy CSS.
Set perspective and rotate children in 3D space. See the effect of perspectiveβorigin. Copy the CSS. Learn 3D transforms.
Click on a box to set the transformβorigin point and see how rotations and scales change. Copy the CSS.
Drag items into grid cells and see the resulting gridβarea or lineβbased placement code. Learn how autoβplacement and spanning work.
Drag to resize a box and see the Resize Observer callback fire. Get contentRect and borderBoxSize. Learn the API.
Write CSS like `oklch(from red l c h)` to modify colors. Preview the output and copy. Modern color manipulation.
Write JavaScript using element.animate() and see the result in a live preview. Compare with CSS keyframes. Debugger included.
Write compound selectors and instantly see which elements they match on a test page. Master complex CSS logic.
See every touch point with coordinates, radius, and force on your mobile device. Debug gestures with live overlay.
Write a compute shader in WGSL and run it in the browser. See the output on a canvas. Learn WebGPU. Realβtime compilation.
Move your mouse to create colorful ink swirls in a simulated fluid. Beautiful and mesmerizing. No install. Just WebGL.
Type directly into a contenteditable div with realβtime CSS filters, shadows, and colors. Download as HTML. Fun demo.
Create an animation that advances with scroll using animationβtimeline: scroll(). See the visual timeline editor. Modern CSS.
Input any JavaScript object and see if structuredClone can deepβcopy it. Compare with JSON.parse/stringify. Learn transferables.
Write a pattern and test it against URLs instantly. See which groups match. Learn the modern alternative to regex for routing. Works entirely in the browser.
Write CSS with native nesting (like SCSS) and see the browserβs native parsing. Validator and live output.
Test the powerful :has() pseudoβclass. Write selectors like .card:has(img) and see the live result. Revolutionary for CSS architecture.
Pick two images or colors and apply all 16 CSS mixβblendβmode values live. See and copy the right CSS for your design.
Experiment with the CSS color-mix() function. Pick two colors and mix them in different color spaces (srgb, oklch). Copy the CSS.
Interactively add and adjust multiple box shadows on a sample element. Drag sliders for offset, blur, spread, and color. Copy the clean CSS code instantly.
Drag points to create a custom clipβpath shape. See the CSS value update live. For creating nonβrectangular elements.
Experiment with CSS Grid properties visually. Add rows, columns, and areas. See the grid in action and copy the code.
Type any condition and see the result of the ternary operator. Understand truthy/falsy values. Quick learning tool.
Visually experiment with Flexbox container and item properties. See the layout update in real time and copy the CSS. Learn by doing, fully interactive.