npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

null-graph

v0.0.4

Published

A direct-to-GPU rendering framework for massive web worlds. Zero scene graph. Zero copy. Infinite scale.

Readme

NullGraph Engine

Zero scene graph. Zero copy. Infinite scale.

A Data-Oriented WebGPU rendering framework for massive web worlds.

NullGraph is a brutalist, high-performance rendering library designed specifically for Web Workers and Data-Oriented Design (DOD).

It completely abandons the traditional Object-Oriented Scene Graph (Root -> Node -> Mesh -> Geometry) in favor of mapping raw, contiguous ArrayBuffers directly to WebGPU Storage Buffers.

If you are building an MMO, a voxel engine, or a multiverse with tens of thousands of dynamic entities, NullGraph ensures your main thread stays at a flat 0ms overhead.


⚡ Why NullGraph?

Traditional WebGL frameworks (like Three.js or Babylon.js) are built for ease of use, heavily relying on the new keyword, dynamic memory, and Garbage Collection. When scaling up to massive open worlds, this OOP overhead causes main-thread stuttering and shader compilation lag.

NullGraph solves this by doing less:

  • Zero Scene Graph: No .traverse(), no .updateMatrixWorld(). The GPU reads your flat array directly.
  • Zero-Copy Streaming: Calculate your ECS layout in a Web Worker, pass the Float32Array to the main thread, and blast it straight to VRAM.
  • Render Queues (Batches): Render thousands of unique object types simultaneously with minimal GPU state changes.
  • No GC Spikes: Memory is pre-allocated. No runtime object creation or destruction.

The Architecture Demo Suite

Play the Live Demo: null-graph.web.app

NullGraph includes an interactive dashboard to test and benchmark different memory layouts and compute paradigms in real-time. Explore the following patterns:

Memory Layout Benchmarks

  • AoS (Array of Structs): The standard DOD baseline.
  • SoA (Struct of Arrays): Cache-friendly contiguous memory maximizing CPU cache hits.
  • AoSoA (Chunked SoA): The AAA industry standard aligning with CPU L1 cache lines for SIMD auto-vectorization.
  • OOP Scene Graph: A purposeful stress-test demonstrating the CPU bottleneck of traditional pointer-chasing and recursive math.

Advanced Rendering Demos

  • 3D Lighting & Depth: Demonstrates Z-Buffer occlusion and Dot-Product normal lighting entirely within the shader.
  • Space Fleet (Multi-Batch): Showcases the Render Queue architecture, Object Pooling, and rendering distinct geometries (Ships, Asteroids, Lasers) in a single pass.
  • Voxel Fireworks (DOD Physics): Simulates 15,000+ physics-driven particles by separating CPU-side physics state arrays from GPU-side render buffers.

Quick Start (Batch Rendering)

NullGraph uses a Render Batch architecture. You define the 3D geometry once, set up your WGSL shader pipeline, and then blast your ECS array to the GPU every frame.

import { NullGraph, Camera } from 'null-graph';

async function init() {
    const canvas = document.getElementById('gpuCanvas') as HTMLCanvasElement;

    // 1. Initialize the WebGPU Device
    const engine = new NullGraph();
    await engine.init(canvas);

    const camera = new Camera(75, canvas.width / canvas.height, 0.1, 1000.0);
    camera.updateView([0, 20, 80], [0, 0, 0]);
    engine.updateCamera(camera);

    // 2. Upload Static Geometry via BufferManager
    const vertices = new Float32Array([...]); // [X,Y,Z, NormalX,NormalY,NormalZ...]
    const indices = new Uint16Array([...]);
    
    const vbo = engine.bufferManager.createVertexBuffer(vertices);
    const ibo = engine.bufferManager.createIndexBuffer(indices);

    // 3. Create a Render Batch
    const myBatch = engine.createBatch({
        shaderCode: `/* Your WGSL Code Here */`,
        strideFloats: 14,
        maxInstances: 10000,
        vertexLayouts: [{
            arrayStride: 24, // 6 floats * 4 bytes
            attributes: [
                { shaderLocation: 0, offset: 0, format: 'float32x3' },  // Position
                { shaderLocation: 1, offset: 12, format: 'float32x3' }  // Normal
            ]
        }]
    });
    
    // Attach geometry to the batch
    engine.setBatchGeometry(myBatch, vbo, ibo, indices.length);

    // 4. Generate DOD ArrayBuffer (From your ECS)
    const MAX_INSTANCES = 10000;
    const ecsBuffer = new Float32Array(MAX_INSTANCES * 14);
    // ... Populate buffer with [PosX, PosY, PosZ, ...Scale, ...Color] ...

    // 5. Render Loop
    function frame() {
        // Update the specific batch with new data
        engine.updateBatchData(myBatch, ecsBuffer, MAX_INSTANCES);
        
        // Let NullGraph iterate the render queue
        engine.render(); 
        requestAnimationFrame(frame);
    }

    frame();
}

init();

Roadmap

NullGraph is in active development for the Axion Engine.

-[x] Multi-Object Render Queue / Batching

-[x] Depth / Z-Buffer Integration (Proper 3D occlusion)

-[x] VBO/IBO Geometry Buffer Manager

-[ ] PBR Textures & Material ID Injection -[ ] Raw GLTF Mesh Parsing

-[ ] Directional Shadows / Cascaded Shadow Maps

-[ ] GPU Compute Frustum Culling

License

NullGraph is released under the MIT License.