# {{ display_name }}

A multi-pass GPU-accelerated video effect for Adobe Premiere Pro and After Effects, scaffolded using `create-video-effect`.

## Project Structure

- `src/lib.rs`: Defines the `Effect` trait implementation, coordinates the multi-pass pipeline/render graph, registration adapters, and dynamic parameter UI (reload shaders, etc.).
- `src/params.rs`: Declares After Effects/Premiere UI parameters and groups.
- `src/kernel.rs`: Bridges UI parameters into GPU-safe parameter structs using the `kernel_params!` macro for each individual pass, and registers the compute shader kernels.
- `shaders/{{ pass1_kernel_name }}.slang`: The first-pass Slang compute shader (e.g., edge detection).
- `shaders/{{ pass2_kernel_name }}.slang`: The second-pass/composite Slang compute shader (e.g., tint and overlay).
- `benches/{{ crate_name }}_cpu.rs`: Criterion-based CPU-kernel benchmarks.
- `tests/render_basic.rs`: Basic end-to-end integration rendering test running the full two-pass pipeline on a mock Premiere Pro host.

## Customizing this Template

### 1. Add/Modify UI Parameters
Edit `src/params.rs` to declare new parameters in the `Params` enum and define their UI configuration inside `SetupParams::setup`.

### 2. Map Parameters to the GPU
In `src/kernel.rs`, update the `kernel_params!` blocks. Define separate parameter structs for each shader pass that requires host-side values. Map them using appropriate extractors like `float(V)`, `color_r(V)`, etc.

### 3. Update the Shader Structs & Logic
Modify the compute shaders in `shaders/`:
- Update `struct {{ pass1_kernel_params_name }}` and `struct {{ pass2_kernel_params_name }}` to match their Rust counterparts.
- Implement the shader logic for each pass inside their respective entry points.

### 4. Coordinate Shaders in the Pipeline
In `src/lib.rs`, customize the `pipeline(g: &mut RenderGraph<Self::FrameData>)` method. You can declare intermediate textures, adjust mip levels, or add more passes to the rendering chain.

### Single-pass vs. Multi-pass Customization
- **Single-pass**: The entire effect is rendered in a single pass. The primary input texture (`outgoing`) is processed directly to the write-target output buffer (`dst`).
- **Multi-pass**: Customization involves coordinating multiple distinct shader passes. In a multi-pass effect, intermediate render textures (auxiliary/depth buffers) are declared and populated by earlier passes (e.g., edge detection) before being combined or composited in subsequent shader passes to produce the final output.
