# OGL examples — card for AI agents

Minimal WebGL library with a large commented example set (particles, flowmaps, post effects, text, shaders) that works well for light hero backgrounds.

Category: Web animation examples and effects (also: Video references and motion backgrounds) · maker oframe · checked 2026-11-05 · style: abstract, 3d, minimal

## Price
- Price: Free
- Free tier: Fully free.

## License
Unlicense (public domain) — https://raw.githubusercontent.com/oframe/ogl/master/README.md

- commercial: **yes** (Commercial use OK)
  > This is free and unencumbered software released into the public domain.
  (https://raw.githubusercontent.com/oframe/ogl/master/README.md)
- attribution: **no** (No credit needed)
  > This is free and unencumbered software released into the public domain.
  (https://raw.githubusercontent.com/oframe/ogl/master/README.md)
- in app: **yes** (Can ship inside your app)
  > This is free and unencumbered software released into the public domain.
  (https://raw.githubusercontent.com/oframe/ogl/master/README.md)
- redistribute: **yes** (Can pass the files on to your own users)
  > This is free and unencumbered software released into the public domain.
  (https://raw.githubusercontent.com/oframe/ogl/master/README.md)

## Rules to follow
- No attribution needed (public domain dedication).
- Example image/model assets are separate files; check before reuse.

## Can an AI agent use it by itself?
**Yes** · copy-code: Agent copies the code, snippet or prompt from the page (no account)

## How an agent gets files
- Open an example on oframe.github.io/ogl/examples and copy its source (commented); npm install ogl. (sign-in: none)
- Formats: js, html, glsl

## How to connect
- Package (npm/PyPI)
- npm: `npm install ogl`
- Repository: https://github.com/oframe/ogl
- Website: https://oframe.github.io/ogl/examples

## Notes
No LICENSE file is detected by GitHub's API; the Unlicense text is in the README and npm 'ogl' 1.0.11 declares Unlicense. OGL is also in AgentGid's background-generator recipe.

## Numbers (AgentGid data)
- Gid Score: 49
- GitHub stars: 4,759
- Downloads last week: 1,083,034
- Used in 15 public projects set up for AI coding agents

## Lines to paste 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/)
```

## Links
- AgentGid page: https://agentgid.com/assets/ogl-examples/
- Is it free for commercial use? https://agentgid.com/assets/ogl-examples/commercial-use/
- Source: https://oframe.github.io/ogl/examples
- Source: https://raw.githubusercontent.com/oframe/ogl/master/README.md
- Source: https://registry.npmjs.org/ogl/latest


## 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 to 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.

### How to start
- Install the package, or download the source files and import them from your project folder.

```
npm i ogl
```

- 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';
```

- Open the example closest to your idea, read its commented source, and copy the parts you need.

### License
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.

### Good to know
- You or your AI assistant write the visual effect code (shaders) yourself. OGL has far fewer ready features than three.js.
- The license is written at the end of the README; the LICENSE file the README links to does not exist, and the package lists Unlicense.
- The latest release, 1.0.11, came out in January 2025. Pin that version.
- Example pages credit outside authors for some textures and shader ideas. Copy the code freely, but not those files without checking their own terms.
- Loading it from a public file host is possible; pin an exact version there, or updates can break your page.

Checked 2026-11-09 against: https://oframe.github.io/ogl/, https://oframe.github.io/ogl/examples/, https://oframe.github.io/ogl/examples/triangle-screen-shader.html, https://oframe.github.io/ogl/examples/particles.html, https://oframe.github.io/ogl/examples/mouse-flowmap.html, https://oframe.github.io/ogl/examples/post-fluid-distortion.html, https://oframe.github.io/ogl/examples/msdf-text.html, https://github.com/oframe/ogl, https://github.com/oframe/ogl/blob/master/README.md, https://raw.githubusercontent.com/oframe/ogl/master/package.json, https://registry.npmjs.org/ogl/latest, https://registry.npmjs.org/ogl

### Mistakes to avoid
- Don't: import ... from 'https://cdn.jsdelivr.net/npm/ogl' (no version) → Do: Install ogl@1.0.11, or pin it in the address, e.g. https://cdn.jsdelivr.net/npm/ogl@1.0.11 (An unpinned address always fetches the newest release, and the README warns this can break code.)
- Don't: import { Renderer } from 'ogl' in a plain page with no bundler and no import map → Do: Use a bundler (Vite), add an import map entry for 'ogl', or import the file path ./node_modules/ogl/src/index.js (The bare name 'ogl' only resolves through a bundler or an import map.)
- Don't: Building a full-screen background from a Plane with a Camera and projection matrices → Do: Use the Triangle class (or one big triangle) and render the mesh directly with no camera (A full-screen shader needs neither the scene graph nor the camera.)
- Don't: Calling renderer.render twice per frame (background, then dots) with default settings → Do: Pass clear: false to the second render call (The renderer clears the canvas before each render by default; in our demo the dots pass would otherwise wipe the background.)
- Don't: Copying an example together with its texture or font files into a product → Do: Copy the code (public domain) and use your own images, or check the credited author's terms first (Some example pages credit outside authors for their textures and shaders.)

### 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.

---
AgentGid's catalog is curated: every entry was checked against the maker's official pages (registry, repository, license and pricing pages) on the date shown; a license value shows the quote it stands on wherever AgentGid has one. Usage numbers come from AgentGid's own scan of public repositories set up for AI coding agents. Claims by makers are reported, not tested by AgentGid.
