diff options
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/ASSET_SYSTEM.md | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/doc/ASSET_SYSTEM.md b/doc/ASSET_SYSTEM.md index 250be07..bd5a266 100644 --- a/doc/ASSET_SYSTEM.md +++ b/doc/ASSET_SYSTEM.md @@ -55,3 +55,14 @@ we need a simple tool that: * generates the assets_data.cc file with all the data * put these in the source tree * this process needs a script for automation + +# Shader Snippets + +Shader code (WGSL) can also be managed as assets. +1. Create `.wgsl` files in `assets/final/shaders/` (or similar). +2. Add them to `assets/final/demo_assets.txt` with compression `NONE`. + Example: `SHADER_COMMON, shaders/common.wgsl, NONE` +3. In C++, retrieve them using `GetAsset()`. Since they are binary blobs, + construct a `std::string` or `std::string_view` using the returned pointer + and size. +4. Register them with the `ShaderComposer`. |
