OGL examples
by oframe
Minimal WebGL library with a large commented example set (particles, flowmaps, post effects, text, shaders) that works well for light hero backgrounds.
Web animation examples and effects Code libraryOpen sourceabstract3dminimal

1. Price: oframe.github.io/ogl/examples
Fully free.
oframe.github.io/ogl/examplesNo quote yet: price is read from the official pages.
2. Commercial use: raw.githubusercontent.com
“This is free and unencumbered software released into the public domain.”
Public domain; any purpose, commercial or not.
raw.githubusercontent.com3. Credit the author: raw.githubusercontent.com
“This is free and unencumbered software released into the public domain.”raw.githubusercontent.com
4. Agent access: github.com/oframe/ogl
An agent can install it by itself with npm install ogl. No key or account is needed.
github.com/oframe/oglLicense checked Nov 5, 2026 against 1 official page. Tap a verdict to see its source. How we checked Report an error
OGL: a small 3D graphics library with examples
OGL is a free, very small code library for drawing moving graphics in the browser with WebGL, plus a long list of example pages with commented code. People use it for light animated backgrounds, particle effects and simple 3D scenes when a big 3D engine would be too heavy. It is public domain, so you can use it anywhere without credit, but you write the visual effects (shaders) yourself or adapt them from the examples.
Where you can use it
A moving background behind a headline
Fill the top of a landing page with soft moving color behind the headline. One shape covers the whole screen, so it stays light and needs no 3D camera.
Floating dots and particles
Scatter hundreds of soft dots that drift slowly, for a calm background on a hero, a sign-up page or a loading screen.
Effects that follow the mouse
Make a picture or the page background ripple and bend where the visitor moves the pointer, as an eye-catching first screen.
A 3D model people can turn
Show a product or object as a 3D model that visitors rotate with the mouse, loaded from a common 3D file format.
Learning how WebGL works
Read short, commented examples to understand how browser 3D drawing works, without a large engine hiding the details.
As reported by oframe: The whole library is about 29 kB minzipped (Core 8 kB, Math 6 kB, Extras 15 kB).
OGL examples popularity
Downloads from api.npmjs.org, stars from GitHub, checked Nov 17, 2026. How the Gid Score is calculated
How to start
Tell your AI assistant
“Add a full-screen animated background to the hero section with ogl 1.0.11 (Renderer, Triangle, Program, Mesh), keep the colors soft so the text stays readable, and stop the animation when the user prefers reduced motion.”
Or install it yourself.
npm i ogl
Show code
Import from 'ogl' when you use a bundler or an import map. The library has no other packages it depends on.
import { Renderer, Camera, Transform, Box, Program, Mesh } from 'ogl';
Mistakes to avoid
import ... from 'https://cdn.jsdelivr.net/npm/ogl' (no version)An unpinned address always fetches the newest release, and the README warns this can break code.
import { Renderer } from 'ogl' in a plain page with no bundler and no import mapThe bare name 'ogl' only resolves through a bundler or an import map.
A full-screen shader needs neither the scene graph nor the camera.
The renderer clears the canvas before each render by default; in our demo the dots pass would otherwise wipe the background.
Some example pages credit outside authors for their textures and shaders.
License
Unlicense (public domain). Public domain (the Unlicense) for the library code. Use it in free or paid work, change it and share it, with no credit needed. Pictures and fonts used inside some examples come from other people, so check them separately.
“This is free and unencumbered software released into the public domain.” raw.githubusercontent.com
“This is free and unencumbered software released into the public domain.” raw.githubusercontent.com
“This is free and unencumbered software released into the public domain.” raw.githubusercontent.com
“This is free and unencumbered software released into the public domain.” raw.githubusercontent.com
AllowedWith conditionsNot allowedNot stated or not checked yet
Is OGL examples free for commercial use? The full answer Not legal advice. Check the license page before you ship.
For your agent
License rules tell your agent what it may do with OGL examples. Paste them into your prompt or AGENTS.md.
- OGL examples (Web animation examples and effects, Video references and motion backgrounds). Minimal WebGL library with a large commented example set (particles, flowmaps, post effects, text, shaders) that works well for light hero backgrounds. Price: free; commercial use OK; no credit needed. Style: abstract, 3d, minimal.
Connect: npm ogl.
Get files: Open an example on oframe.github.io/ogl/examples and copy its source (commented); npm install ogl (js, html, glsl).
Rule: No attribution needed (public domain dedication).
Rule: Example image/model assets are separate files; check before reuse.
License: https://raw.githubusercontent.com/oframe/ogl/master/README.md (checked 2026-11-05; details: https://agentgid.com/assets/ogl-examples/)
Agent copies the code, snippet or prompt from the page (no account).
npm install oglFormats: js, html, glsl
Background made with OGL (public domain)Alternatives
OGL examples This page
Pick three.js when you need many ready features such as model loaders, lights and post effects, and hundreds of official examples.
Pick Paper Shaders for ready background effects such as mesh gradients, grain and halftone without writing shader code.
Pick React Three Fiber when your site is a React app and you want 3D scenes written as React components.
Lightweight smooth-scroll library often paired with GSAP ScrollTrigger and WebGL scroll effects.
Ready-made CSS keyframe animations (bounce, fade, slide, zoom, attention seekers) added with one class name.
Questions
Do I need to credit OGL?
No. It is released into the public domain under the Unlicense, so no credit is needed.
How is it different from three.js?
It works in a similar way but is tied closely to WebGL and has far fewer features, which keeps it small.
Can I just copy an example?
Yes, the examples are meant as reference and their source has comments. Check the credited textures and fonts before reusing those files.
Do I need a camera for a simple background?
No. A full-screen shader needs no scene graph and no camera; one triangle covering the screen is enough.