← back

yum/demomo

A graphics engine built on wgpu.

git clone https://git.yummers.dev/yum/demomo

yumMake it possible to pan on touchpad7bc7aa9

master
4 folders5 files
languages

files

.zed/
demos/hello-web/
shaders/
src/
.gitignore76 B
Cargo.toml1.3 KiB
LICENSE1.0 KiB
README.md2.0 KiB
build.rs210 B

demomo

demomo is my webGPU-based engine. I forked it out of vfft once I decided to start working on graphical tasks.

Demomo is not ready for general use. It currently exists solely to serve vfft. Over time I expect that it will mature enough to be of use to others. I will delete this disclaimer once I believe it has reached that point.

Conventions

Right is +x, up is +y, near is +z.

If you declare these globals, the engine will plumb them for you:

public ConstantBuffer<Camera> camera;
public ConstantBuffer<Transform> transform;
public ConstantBuffer<Light> light;

See their definitions in demomo.slang.

Put all user-defined uniforms in a struct, and declare a global called cfg:

public struct MyUniforms {
    float3 foo;
    uint bar;
    float4x4 baz;
    ...
};
public ConstantBuffer<MyUniforms> cfg;

The engine will automatically generate a UI for it, allowing you to manipulate them without recompiling the shader.

Vertex shaders must take a single struct input. Its inputs must conform to these names and types:

Building apps

Write your wgpu app, then build like so:

# Set this to any path you want. The slang compiler will be cloned and built
# here. If you don't set this, then every time you change configs, you'll
# have to reacquire and recompile slang, which takes ~5-10 minutes.
$ export DMM_SLANG=$HOME/Documents/slang
# Include --dev if you want useful stack traces in browser console.
$ wasm-pack build . --target web --dev

AI Disclosure

This source code was written by a human and checked for errors with an LLM.

License.

MIT License.