aaron1011/naga_oil — explained in plain English
Analysis updated 2026-07-18 · repo last pushed 2023-12-23
Write a lighting calculation once and reuse it across vertex and fragment shaders.
Override a module's function in your own shader without editing the original.
Strip unused functions and bindings from a shader to optimize it.
Conditionally include or exclude shader code using build-time flags.
| aaron1011/naga_oil | 0verflowme/alarm-clock | 0verflowme/seclists | |
|---|---|---|---|
| Language | — | CSS | — |
| Last pushed | 2023-12-23 | 2022-10-03 | 2020-05-03 |
| Maintenance | Dormant | Dormant | Dormant |
| Setup difficulty | moderate | easy | easy |
| Complexity | 4/5 | 2/5 | 1/5 |
| Audience | developer | vibe coder | ops devops |
Figures from each repo's GitHub metadata at analysis time.
Documentation for prune and redirect features is still in progress per the README.
Naga Oil is a tool for building and managing shaders, the code that tells your graphics card how to render images. Instead of writing one monolithic shader file, this library lets you compose shaders from reusable modules, much like how you'd organize code into libraries and import them where needed. The core feature is the "compose" module, which treats shaders as building blocks. You write small, self-contained shader modules and give them names using a special directive. Then other shaders can import those modules and use their functions, constants, and types without rewriting the code. Under the hood, each module is compiled separately into an intermediate representation, then the final shader combines them together. This is faster than parsing duplicate code repeatedly, and it keeps your codebase cleaner and more organized. For example, you might write a lighting calculation once in a module and reuse it across a vertex shader and a fragment shader. The library also supports "virtual functions" and "overrides", a way to customize imported behavior without editing the original module. If a module defines a virtual function, you can override it in your own shader to change how it works. You can even stack multiple overrides, so module A can override a function from module B, and then your main shader can override it again. Calls throughout your shader automatically use the most recent version in the stack. The library supports two shader languages (WGSL and GLSL) and allows conditional compilation using preprocessor directives, so you can include or exclude code based on build-time flags. Beyond composition, the library includes utilities to "prune" dead code (strip out unused functions and bindings) and to "redirect" function calls, useful for optimizing shaders or adapting them to different contexts. The README notes that detailed documentation for these features is still in progress. Overall, this is aimed at graphics programmers, game engine developers, or anyone building systems where shaders need to be modular, reusable, and maintainable.
Naga Oil lets graphics programmers build shaders from reusable modules instead of one giant file, with overrides and dead-code stripping.
Dormant — no commits in 2+ years (last push 2023-12-23).
The README does not state license terms.
Setup difficulty is rated moderate, with roughly 1h+ to a first successful run.
Mainly developer.
This repo across BitVibe Labs
double-check against the repo, no cap.