Combined Post-Process Implementation Guide
Implement Combined post-processing effects across three modules following the dependency chain:
LumeRender → Lume3D → LumeScene
Task and Boundaries
This skill guides implementation of single-pass post-processing effects in OpenHarmony Graphics3D.
Applicable:
- Effects running in single fullscreen shader pass (tone mapping, color grading, vignette)
- Adding effects to Combined post-process system
Not Applicable:
- Effects requiring separate render passes (bloom with blur passes, depth-of-field, motion blur)
Module Dependency Overview
LumeRender (AGPRender)
↓
Lume3D (AGP3D)
↓
LumeScene
- LumeRender: Low-level rendering module, provides shader/render node infrastructure
- Lume3D: 3D scene module, provides ECS components, depends on LumeRender
- LumeScene: High-level scene module, provides user-friendly interfaces, depends on Lume3D
Pre-Implementation Checklist
Before implementing any Combined post-process effect, ask yourself:
- Visual Effect Goal: What visual effect do you want to achieve? (tone mapping, color grading, vignette, custom effect)
- Parameter Complexity: How many parameters does the effect need?
- 1-4 parameters: Use
factors[]Vec4 only - 5-8 parameters: Split into
factors[]+userFactors[] - >8 parameters: Consider if this is appropriate for Combined system
- Render Pass Requirement: Does the effect need intermediate framebuffers?
- Single fullscreen pass: ✓ Use Combined post-process (this skill)
- Blur passes, downscale/upscale, temporal: ✗ Use multi-pass system (not this skill)
- Index Availability: Are indices 0-7 available in Combined system?
- Currently used: 0 (tone), 1 (vignette), 2 (dither), 3 (color conversion), 4 (fringe), 5 (upscale), 6 (white balance), 7 (color adjustments)
- Need unused index: Must register new index in both shader and C++
Decision Tree:
Effect needs >4 params? ─────YES──→ Split: factors[] + userFactors[]
│
NO
↓
Effect needs blur/temporal? ─YES──→ Use multi-pass system (EXIT this skill)
│
NO
↓
Index 0-7 available? ──────YES──→ Continue with Combined implementation ✓
│
NO
↓
Need to register new index → Follow LumeRender Step 1-3 first
Workflow
LumeRender (8 steps):
- Define configuration structure
- Register metadata
- Define shader constants
- Implement config-to-shader conversion
- Fill post-process stack
- Add conversion in RenderNodeUtil
- Implement shader processing function
- Integrate into render pipeline
Lume3D (5 steps):
- Add flag bit
- Define component property
- Register metadata
- Integrate into render system
- Integrate into Lume3D shader
LumeScene (9 steps):
- Define interface
- Add to IPostProcess interface
- Implement API wrapper
- Implement effect class
- Register in PostProcess
- Register component type
- Register plugin type
- Register Any type
- Update build files
LumeRender Implementation
MANDATORY - READ ENTIRE FILE: Before starting LumeRender steps, you MUST read