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 namingtesting
--- name: ohos-req-value-decision description: Use after review meeting to record decision and route to next step. Triggers: 评审决策纪要, 评审结论回流, value decision, 评审接纳, 评审不接纳, 评审退回, 下次重新上会. Do NOT use for feature baseline (ohos-req-feature-baseline), review gate checks (ohos-req-review-gate), or IR generation (ohos-req-feature-to-ir). metadata: author: openharmony scope: common stage: requirements capability: value-decision version: 0.3.0 status: draft tags: - sdd - requirements
development
Use when converting an OpenHarmony requirement document, spec, or design proposal into an OpenHarmony review slide deck (需求评审 / 需求变更评审 / 设计评审 PPTX) — produces the fixed OpenHarmony-branded review-deck structure (OH logo on every page) with architecture/flow diagrams and field tables. Triggers on "需求评审PPT", "需求变更评审", "把需求文档转成评审PPT", "spec转评审PPT", "requirement/spec to review deck". NOT for arbitrary or generic slide decks unrelated to OpenHarmony requirement/design review.
testing
Use when performing the Phase 0 Step 0.5 Review Ready Gate on a 04-feature.md, especially when the user says "evaluate gate", "review readiness", "feature ready?", "should we generate IR", or when the ohos-req-intake-orchestration main session needs a structured Ready / Conditional Ready / Not Ready judgment instead of doing the check inline. Reads 01-04, runs seven fixed checks plus a conditional-items check, and returns a machine-readable JSON summary plus a human-readable table that the main session can route on. Do NOT use for feature baseline generation (ohos-req-feature-baseline), value decision recording (ohos-req-value-decision), or IR generation (ohos-req-feature-to-ir).
testing
--- name: ohos-req-requirement-intake description: Use when importing an OHOS requirement into Phase 0.1, especially for 01-requirement.md, requirement intake, background, user value, scenarios, scope, FR/NFR, affected modules, or priority. Triggers: 需求导入, 01-requirement, 需求基线, RR单号. Do NOT use for feasibility analysis (ohos-req-feasibility-analysis), architecture decision (ohos-req-arch-decision), or feature baseline (ohos-req-feature-baseline). metadata: author: openharmony scope: common