skills/ohos-dev-graphics3d-combined-postprocess/SKILL.md
Implement Combined post-processing effects (tone mapping, color grading, vignette) in Graphics3D. MUST use when: (1) Adding effect to Combined post-process, (2) User mentions 'Combined post-process' or 'post-processing'. DOES NOT apply to multi-pass effects (bloom, depth-of-field).
npx skillsauth add openharmonyinsight/openharmony-skills ohos-dev-graphics3d-combined-postprocessInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Implement Combined post-processing effects across three modules following the dependency chain: LumeRender → Lume3D → LumeScene
This skill guides implementation of single-pass post-processing effects in OpenHarmony Graphics3D.
Applicable:
Not Applicable:
LumeRender (AGPRender)
↓
Lume3D (AGP3D)
↓
LumeScene
Before implementing any Combined post-process effect, ask yourself:
factors[] Vec4 onlyfactors[] + userFactors[]8 parameters: Consider if this is appropriate for Combined system
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
LumeRender (8 steps):
Lume3D (5 steps):
LumeScene (9 steps):
MANDATORY - READ ENTIRE FILE: Before starting LumeRender steps, you MUST read references/code_templates.md "LumeRender Templates" section (Steps 1-8, ~300 lines) completely. Do NOT set any range limits when reading this file.
Do NOT load advanced_reference.md yet — save for troubleshooting phase.
File: api/render/datastore/render/render_data_store_render_pods.h
Define effect configuration struct with properties and default values. Add enum indices, flag bits, and property type declaration.
Details: See references/code_templates.md#step-1-define-configuration-structure
File: src/postprocesses/render_post_process_combined_node.cpp
Register enum values, type metadata, and configuration structure metadata for reflection system.
Details: See references/code_templates.md#step-2-register-metadata
File: api/render/shaders/common/render_post_process_structs_common.h
Define shader macro constants for effect specialization bits and indices.
Details: See references/code_templates.md#step-3-define-shader-constants
File: src/datastore/render_data_store_post_process.h
Implement conversion functions to pack configuration into shader-friendly Vec4 factors.
Details: See references/code_templates.md#step-4-implement-config-to-shader-conversion
File: src/datastore/render_data_store_post_process.cpp
Add effect to post-process stack with built-in data and factors.
Details: See references/code_templates.md#step-5-fill-post-process-stack
File: src/nodecontext/render_node_util.cpp
Add factor conversion call in GetRenderPostProcessConfiguration() function.
Details: See references/code_templates.md#step-6-add-conversion-in-rendernodeutil
File: api/render/shaders/common/render_post_process_blocks.h
Implement GLSL shader processing function with effect logic.
Details: See references/code_templates.md#step-7-implement-shader-processing-function
File: assets/render/shaders/shader/fullscreen_combined_post_process.frag
Call shader processing function in fullscreen render pipeline.
Details: See references/code_templates.md#step-8-integrate-into-render-pipeline
MANDATORY - READ SECTION: Now read references/code_templates.md "Lume3D Templates" section (Steps 1-5, ~100 lines) for ECS integration examples.
Do NOT load advanced_reference.md yet — continue following workflow steps.
File: api/3d/ecs/components/post_process_component.h
Add flag bit to PostProcessComponent::FlagBits enum.
Details: See references/code_templates.md#lume3d-step-1-add-flag-bit
File: api/3d/ecs/components/post_process_component.h
Define component property with DEFINE_PROPERTY macro.
Details: See references/code_templates.md#lume3d-step-2-define-component-property
File: src/ecs/components/post_process_component_manager.cpp
Register enum values and configuration metadata.
Details: See references/code_templates.md#lume3d-step-3-register-metadata
File: src/ecs/systems/render_system.cpp
Assign configuration in ProcessPostProcessComponents() function.
Details: See references/code_templates.md#lume3d-step-4-integrate-into-render-system
File: api/3d/shaders/common/3d_dm_inplace_post_process.h
Call shader processing function in Lume3D inplace post-process.
Details: See references/code_templates.md#lume3d-step-5-integrate-into-lume3d-shader
MANDATORY - READ SECTION: Read references/code_templates.md "LumeScene Templates" section (Steps 1-9, ~400 lines) for API wrapper and registration examples.
Do NOT load advanced_reference.md yet — only load when encountering errors or need data flow diagrams.
File: include/scene/interface/postprocess/intf_your_effect.h
Define interface class with META_INTERFACE and property declarations.
Details: See references/code_templates.md#lumescene-step-1-define-interface
File: include/scene/interface/intf_postprocess.h
Add include and META_READONLY_PROPERTY for effect interface.
Details: See references/code_templates.md#lumescene-step-2-add-to-ipostprocess-interface
File: include/scene/api/post_process.h
Implement wrapper class with META_INTERFACE_OBJECT and property macros.
Details: See references/code_templates.md#lumescene-step-3-implement-api-wrapper
Files:
src/postprocess/your_effect.hsrc/postprocess/your_effect.cppImplement effect class inheriting from PostProcessEffect template with META_OBJECT macros.
Details: See references/code_templates.md#lumescene-step-4-implement-effect-class
Files:
src/postprocess/postprocess.hsrc/postprocess/postprocess.cppAdd static property data and InitDynamicProperty handler.
Details: See references/code_templates.md#lumescene-step-5-register-in-postprocess
File: src/component/postprocess_component.h
Add META_TYPE registration and property macros.
Details: See references/code_templates.md#lumescene-step-6-register-component-type
File: src/plugin.cpp
Add RegisterObjectType and UnregisterObjectType calls.
Details: See references/code_templates.md#lumescene-step-7-register-plugin-type
File: src/register_anys.cpp
Add interface pointer type to ObjectTypes list.
Details: See references/code_templates.md#lumescene-step-8-register-any-type
Files:
include/CMakeLists.txtsrc/CMakeLists.txtBUILD.gnAdd interface and source files to build targets.
Details: See references/code_templates.md#lumescene-step-9-update-build-files
Effects requiring separate render passes (bloom with blur, depth-of-field, motion blur, FXAA, TAA):
fullscreen_combined_post_process.frag) only handles indices 0-7. Multi-pass effects use indices 8+ with separate shaders and intermediate framebuffers.factors[INDEX_BLOOM] (index 9) to be ignored in Combined shader. Effect won't render, or may read garbage data from wrong memory offset.Index consistency between GLSL constants and C++ enums:
uGlobalData.factors[POST_PROCESS_INDEX_TONEMAP] directly. If shader defines POST_PROCESS_INDEX_TONEMAP 0 but C++ defines INDEX_TONEMAP 1, shader reads wrong Vec4 from factors array.POST_PROCESS_GLOBAL_VEC4_FACTOR_COUNT (14).render_post_process_structs_common.h → POST_PROCESS_INDEX_* valuesrender_data_store_render_pods.h → PostProcessConfiguration::INDEX_* valuesrender_data_store_post_process.cpp → factors[INDEX_*] assignmentEffects needing more than 4 float parameters:
factors[14] (Vec4 array) and userFactors[16] (Vec4 array). If effect has 5+ parameters, must split into factors + userFactors.uGlobalData.userFactors[USER_INDEX_*] but constant undefined → compilation error "undefined macro". Or if defined but not filled → shader reads zero Vec4 → effect parameters wrong.USER_INDEX_* constant defined in render_data_store_render_pods.hGetFactorXXX() function for userFactors in render_data_store_post_process.huGlobalData.userFactors[POST_PROCESS_USER_INDEX_*]USER_INDEX_* constant, implement conversion function, call in FillDefaultPostProcessData.All three modules must be updated:
PostProcessXXXBlock() function → compilation errorPostProcessComponent missing property → ECS system won't propagate configuration → shader receives zero factorsSymptom: Effect needs blur passes, downscale/upscale, temporal accumulation.
uImgSampler + uBloomSampler + intermediate framebuffers (like bloom). If yes → multi-pass.Symptom: "undefined macro POST_PROCESS_INDEX_XXX" or "array index out of bounds".
Symptom: Wrong colors, parameters ignored, effect invisible.
render_data_store_post_process.cpp (Step 5) and render_node_util.cpp (Step 6).references/code_templates.md (785 lines): Complete code templates with Generic Template and Tone Mapping Example for all 22 steps. MANDATORY loading during implementation.references/advanced_reference.md (306 lines): Advanced reference with data flow diagrams, implementation checklists, and troubleshooting guide. Load ONLY when troubleshooting or need data flow understanding.Phase 1 - Initial Implementation:
code_templates.md in three stages (LumeRender → Lume3D → LumeScene sections)advanced_reference.md (save for later)Phase 2 - Troubleshooting:
advanced_reference.md if encountering errors, need data flow diagrams, or implementation checklistscode_templates.md if already loadedArchitecture: Configuration-Conversion Separation
Critical: Shader-C++ Index/Bit Consistency
POST_PROCESS_INDEX_* ↔ PostProcessConfiguration::INDEX_*POST_PROCESS_SPECIALIZATION_*_BIT ↔ FlagBits enumMandatory: Dual Path Support
Naming and Macro Conventions
PostProcess<Effect>Block namingdevelopment
Run local code quality checks covering a subset of OpenHarmony gate CI (copyright, CodeArts C/C++) plus additional local checks (pylint/flake8, shellcheck/bashate, gn format). Use before committing to reduce gate failures. Triggers on: /oh-precommit-codecheck, "门禁检查", "门禁预检", "检查代码", "run codecheck", "check code quality", "lint my code", "代码检查", or after completing code implementation. WHEN to use: before git commit, before creating PR, after modifying C/C++/Python/Shell/GN files, when gate CI fails with codecheck defects, or when you want to preview what gate will flag.
development
OpenHarmony PR full lifecycle workflow. Five modes: - Commit: standardized commit with DCO sign-off and Issue linking - Create PR: commit + push to fork + create Issue + create PR on upstream - Fix Codecheck: fetch gate CI codecheck defects from a PR and auto-fix them - Review PR: fetch a PR's changes to local for code review - Fix Review: fetch unresolved review comments from a PR and auto-fix them Triggers on: /oh-pr-workflow, "提交代码", "创建PR", "提个PR", "commit", "修复告警", "修复门禁", "修复codecheck", "fix codecheck", "review pr", "review这个pr", "看下这个pr", "检视pr", "修复review", "修复检视意见", "fix review", or a GitCode PR URL with fix/review intent.
testing
分析 HM Desktop PRD 文档,提取需求信息、验证完整性、检查章节顺序(需求来源→需求背景→需求价值分析→竞品分析→需求描述)、检查 KEP 定义、检测需求冲突并生成结构化分析报告。适用于用户请求:(1) 分析或审查 PRD 文档, (2) 从需求中提取 KEP 列表, (3) 检查 PRD 完整性或一致性, (4) 将需求映射到模块架构, (5) 验证 PRD 格式合规性, (6) 验证竞品分析章节完整性。关键词:PRD分析, requirement extraction, KEP验证, completeness check, chapter order validation, 竞品分析检查, analyze PRD, 需求提取, 完整性检查, 章节顺序验证
development
基于 PRD 文档自动生成鸿蒙系统设计文档,包括架构设计文档和功能设计文档。生成前会分析 OpenHarmony 存量代码结构,确保与现有架构兼容。架构设计文档第2章必须为竞品方案分析,位于需求背景之后。适用于用户请求:(1) 生成架构设计文档, (2) 生成功能设计文档, (3) 从 PRD 生成设计文档, (4) 创建系统架构设计, (5) 编写功能规格说明, (6) 分析 OH 代码结构。关键词:architecture design, functional design, design doc, 竞品方案分析, OpenHarmony code analysis, 架构设计, 功能设计, 设计文档生成, OH代码分析, analyze codebase, competitor analysis