# demomo demomo is my webGPU-based engine. I forked it out of [vfft](https://git.yummers.dev/yum/vfft) once I decided to start working on graphical tasks. **Demomo is not ready for general use. It currently exists solely to serve [vfft](https://git.yummers.dev/yum/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: ```glsl public ConstantBuffer camera; public ConstantBuffer transform; public ConstantBuffer light; ``` See their definitions in demomo.slang. Put all user-defined uniforms in a struct, and declare a global called `cfg`: ```glsl public struct MyUniforms { float3 foo; uint bar; float4x4 baz; ... }; public ConstantBuffer 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: * `float3 objPos`: vertex position in object space. * `float3 normal`: vertex normal vector in object space. * `float2 uv0`: 0th UV coordinate. * `float3 normal`: normal vector in object space. * `float4 tangent`: tangent vector in object space. * `float3 bitangent`: bitangent vector in object space. ## Building apps Write your wgpu app, then build like so: ```bash # 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.