diff options
Diffstat (limited to 'doc/EFFECT_WORKFLOW.md')
| -rw-r--r-- | doc/EFFECT_WORKFLOW.md | 68 |
1 files changed, 34 insertions, 34 deletions
diff --git a/doc/EFFECT_WORKFLOW.md b/doc/EFFECT_WORKFLOW.md index bdec2b6..c4010db 100644 --- a/doc/EFFECT_WORKFLOW.md +++ b/doc/EFFECT_WORKFLOW.md @@ -1,8 +1,8 @@ -# Effect Creation Workflow (v2) +# Effect Creation Workflow **Target Audience:** AI coding agents and developers -Checklist for adding visual effects using Sequence v2 system. +Checklist for adding visual effects. --- @@ -10,7 +10,7 @@ Checklist for adding visual effects using Sequence v2 system. **ShaderToy:** `tools/shadertoy/convert_shadertoy.py` then follow steps below **SDF/Raymarching:** See `doc/SDF_EFFECT_GUIDE.md` -**Custom v2 effects:** Follow all steps 1-6 +**Custom effects:** Follow all steps 1-6 --- @@ -18,18 +18,18 @@ Checklist for adding visual effects using Sequence v2 system. ### 1. Create Effect Files -**Files** (v2 naming): -- Header: `src/effects/<name>_effect_v2.h` -- Implementation: `src/effects/<name>_effect_v2.cc` -- Shader: `workspaces/main/shaders/<name>_v2.wgsl` +**Files**: +- Header: `src/effects/<name>_effect.h` +- Implementation: `src/effects/<name>_effect.cc` +- Shader: `workspaces/main/shaders/<name>.wgsl` -**Class name**: `<Name>EffectV2` (e.g., `TunnelEffectV2`) +**Class name**: `<Name>Effect` (e.g., `TunnelEffect`) -**Base class**: `EffectV2` (all effects) +**Base class**: `Effect` (all effects) **Constructor**: ```cpp -MyEffectV2(const GpuContext& ctx, +MyEffect(const GpuContext& ctx, const std::vector<std::string>& inputs, const std::vector<std::string>& outputs); ``` @@ -59,7 +59,7 @@ params.aspect_ratio; // width/height **File**: `workspaces/main/assets.txt` ``` -SHADER_<UPPER_NAME>, NONE, shaders/<name>_v2.wgsl, "Description" +SHADER_<UPPER_NAME>, NONE, shaders/<name>.wgsl, "Description" ``` Asset ID: `AssetId::ASSET_SHADER_<UPPER_NAME>` @@ -68,7 +68,7 @@ Asset ID: `AssetId::ASSET_SHADER_<UPPER_NAME>` **File**: `CMakeLists.txt` -Add `src/effects/<name>_effect_v2.cc` to **BOTH** GPU_SOURCES sections: +Add `src/effects/<name>_effect.cc` to **BOTH** GPU_SOURCES sections: - Headless mode (around line 141-167) - Normal mode (around line 171-197) @@ -77,16 +77,16 @@ Add `src/effects/<name>_effect_v2.cc` to **BOTH** GPU_SOURCES sections: **File**: `src/gpu/demo_effects.h` ```cpp -#include "effects/<name>_effect_v2.h" +#include "effects/<name>_effect.h" ``` ### 5. Add to Timeline -**File**: `workspaces/main/timeline_v2.seq` +**File**: `workspaces/main/timeline.seq` ``` SEQUENCE <start> <priority> "name" - EFFECT + MyEffectV2 source -> sink 0.0 4.0 + EFFECT + MyEffect source -> sink 0.0 4.0 ``` **Priority modifiers** (REQUIRED): `+` (increment), `=` (same), `-` (decrement) @@ -95,7 +95,7 @@ SEQUENCE <start> <priority> "name" ```bash # Regenerate timeline.cc -python3 tools/seq_compiler_v2.py workspaces/main/timeline_v2.seq \ +python3 tools/seq_compiler.py workspaces/main/timeline.seq \ --output src/generated/timeline.cc # Build @@ -112,17 +112,17 @@ cmake --build build -j4 ### Standard Post-Process Effect ```cpp -// my_effect_v2.h +// my_effect.h #pragma once -#include "gpu/effect_v2.h" +#include "gpu/effect.h" #include "gpu/uniform_helper.h" -class MyEffectV2 : public EffectV2 { +class MyEffect : public Effect { public: - MyEffectV2(const GpuContext& ctx, + MyEffect(const GpuContext& ctx, const std::vector<std::string>& inputs, const std::vector<std::string>& outputs); - ~MyEffectV2() override; + ~MyEffect() override; void render(WGPUCommandEncoder encoder, const UniformsSequenceParams& params, @@ -136,27 +136,27 @@ class MyEffectV2 : public EffectV2 { ``` ```cpp -// my_effect_v2.cc -#include "effects/my_effect_v2.h" +// my_effect.cc +#include "effects/my_effect.h" #include "gpu/post_process_helper.h" #include "gpu/shaders.h" -MyEffectV2::MyEffectV2(const GpuContext& ctx, +MyEffect::MyEffect(const GpuContext& ctx, const std::vector<std::string>& inputs, const std::vector<std::string>& outputs) - : EffectV2(ctx, inputs, outputs), pipeline_(nullptr), bind_group_(nullptr) { + : Effect(ctx, inputs, outputs), pipeline_(nullptr), bind_group_(nullptr) { uniforms_buffer_.init(ctx_.device); pipeline_ = create_post_process_pipeline(ctx_.device, WGPUTextureFormat_RGBA8Unorm, - my_shader_v2_wgsl); + my_shader_wgsl); } -MyEffectV2::~MyEffectV2() { +MyEffect::~MyEffect() { if (bind_group_) wgpuBindGroupRelease(bind_group_); if (pipeline_) wgpuRenderPipelineRelease(pipeline_); } -void MyEffectV2::render(WGPUCommandEncoder encoder, +void MyEffect::render(WGPUCommandEncoder encoder, const UniformsSequenceParams& params, NodeRegistry& nodes) { WGPUTextureView input_view = nodes.get_view(input_nodes_[0]); @@ -193,11 +193,11 @@ void MyEffectV2::render(WGPUCommandEncoder encoder, ### 3D Effect with Depth ```cpp -class My3DEffectV2 : public EffectV2 { +class My3DEffect : public Effect { std::string depth_node_; - My3DEffectV2(const GpuContext& ctx, ...) - : EffectV2(ctx, inputs, outputs), + My3DEffect(const GpuContext& ctx, ...) + : Effect(ctx, inputs, outputs), depth_node_(outputs[0] + "_depth") {} void declare_nodes(NodeRegistry& registry) override { @@ -251,6 +251,6 @@ class My3DEffectV2 : public EffectV2 { ## See Also -- `doc/SEQUENCE_v2.md` - Timeline syntax and architecture -- `tools/seq_compiler_v2.py` - Compiler implementation -- `src/effects/*_v2.{h,cc}` - Example effects +- `doc/SEQUENCE.md` - Timeline syntax and architecture +- `tools/seq_compiler.py` - Compiler implementation +- `src/effects/*.{h,cc}` - Example effects |
