Engine GPU programs are standalone WGSL files under crates/joy-renderer/src/shaders/ and crates/joy-renderer/src/scene_effects/shaders/. Rust loads them with include_str!; wgpu translates them for WebGPU, WebGL 2, Vulkan, Metal, and DirectX 12.
Shading models own their material bindings and surface response through the shading-model contract; the renderer owns vertex layouts, depth/blend state, frame targets, pass order, lighting (light clusters, the G-buffer layout, and deferred lighting passes), shadows, and resource lifetime. Keep reusable scene, lighting, particle, terrain, and display programs in the engine.
A game whose surfaces need a look the built-in models cannot express registers its own shading model, which the engine composes into every scene pass. A project may own a behavior-specific WGSL program for other drawing (an arcade TriangleRenderer program, for example). It supplies that program through the engine renderer and never creates its own backend device. Explain coordinate conventions, packed uniforms, color space, and non-obvious numerical choices in shader comments. Do not generate substantial shader source from formatted strings.