Index of every page on this site: llms.txt
All skills
oahc09 avatar

/cocosair-rendering

@ed38648
by oahc09oahc09/cocosairjs3 stars
2
Run it yourself

Configure lighting, shadows, render targets, MSAA and sRGB. Use for offscreen pixels, post-processing, AIR_E_RENDER_TARGET_SAMPLES or AIR_E_TEXTURE_COLOR.

  • 11 files
  • 159.1 KB
  • MIT
  • Updated last month
  • GitHub
Use this Skill: https://skilld.dev/gh/oahc09/cocosairjs/cocosair-rendering

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencescontext.md

≈1.7k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Working context

Use package imports and shipped docs for an application; use source paths and repository commands only in a confirmed AIR checkout. A copied host skill is not a runtime installation.

Read the shared environment rules when locating these roots. If sibling resources are unavailable, use the installed canonical chapter and disclose the limitation. Tool declarations identify workflow capabilities; they do not authorize installation, writes, publication or any action outside the user and host scope.

Related skills

  • cocosair - routing and shared Code First constraints; reuse it if already loaded.
  • cocosair-camera - the Camera component an offscreen pass needs: priority, rect, visibility, targetTexture.
  • cocosair-materials-effects - authoring the effect and setting a material's sampler2D; this skill owns only the texture color contract and target bindings.
  • cocosair-scene-graph - node activation order, layer bits and camera visibility masks, which decide what a shadow pass or an offscreen camera sees at all; Vec3 directions come from cocosair-math.
  • cocosair-application - when the scene and its native render scene exist, which gates every light query below.
  • cocosair-project-setup - which entry exposes a symbol, and variant-build options such as AIR_FEATURES.

Offscreen passes for 2D and DOM content belong to cocosair-graphics-and-dom. glTF loading, primitive geometry, animation, UI, input, physics, audio and broad performance work belong to the cocosair-gltf, cocosair-primitives-mesh, cocosair-animation-tween, cocosair-ui-2d, cocosair-input-action, cocosair-physics, cocosair-audio-video and cocosair-performance skills; load the matching existing skill only for the task's direct dependencies.

Original entry guidance

The original entry wording below is an on-demand archive, not a second routing source.

Use the environment rules to locate the checkout or installed package; sibling skills are optional direct dependencies, not a recursive load list.

Configure what the legacy forward pipeline actually draws - light units and the one main light, shadow casting, offscreen camera targets, texture color contracts - and know which pipeline surfaces a Code First app can reach.

Read references/quick-start.md when constructing the minimal example. It preserves the complete setup and teardown sequence; select the source-checkout or npm-consumer environment first.

Read references/context.md to select the owner of this step and only its directly needed dependencies. Reuse already loaded skills; this is not a recursive load list.

Original mistake navigation

Before implementing the relevant path, read its wrong/right examples in references/common-mistakes.md:

  • [HIGH] Turning on one shadow switch and expecting a shadow map
  • [HIGH] Importing the custom pipeline namespace and expecting post-processing to run
  • [HIGH] Adding a second directional light to fill the dark side
  • [MEDIUM] Treating a requested sample count as the negotiated one
  • [MEDIUM] Letting the color validator stand in for building the texture

Original metadata

Description and description_en

The two original fields contained exactly the same value, retained once here.

Drives the Cocos AIR rendering contracts in code - legacy forward lighting units with illuminance in Lux, the single mainLight rule for multiple directional lights and inspectAirDirectionalLights, the per-light-type shadow matrix with the four switches a ShadowMap cast needs, offscreen rendering through createAirRenderTarget and camera targetTexture with requested-versus-effective MSAA samples and sampleFallback, the one-per-scene AirTransmissionCapture behind transmission materials, texture format and sRGB decode preflight with resolveAirTextureFormat and validateAirTextureColorContract, and which post-process and custom-pipeline names a Code First app can really reach. Use when lighting looks flat, asking why there are no shadows, rendering a mirror or refraction into a texture, reading back a target's pixels, hitting AIR_E_RENDER_TARGET_SAMPLES or AIR_E_TEXTURE_COLOR, choosing rgba8, rgba16f or hardware-srgb, or deciding whether bloom and other post-processing run without a variant build.

Keywords

Cocos AIR, cocosair.js, rendering

References

  • lighting-units.md - light component surface and defaults, LightType ordinals, illuminance and luminous-flux ranges with their HDR/LDR slots, nt2lm, the exposure and light-meter constants written into the UBO, the mainLight limitation text, the full inspectAirDirectionalLights return shape, light symbol reachability.
  • shadow-matrix.md - the per-light-type support grid with its three contract IDs, the ShadowFlow gate, ShadowType/PCFType/CSMLevel/CSMOptimizationMode/ShadowSize ordinals, Shadows defaults, DirectionalLight and SpotLight shadow fields with ranges and clamps, fields the shipped pipeline ignores, silent-miss symptoms, shadow symbol reachability.
  • render-target.md - AirTargetColorFormat and its GFX map, the options table with defaults and validation, MSAA negotiation and sampleFallback, every AirRenderTargetInfo field, method behaviors, the full AIR_E_RENDER_TARGET_* message table, the camera targetTexture relationship, AirTransmissionCapture lifecycle, target symbol reachability.
  • color-contract.md - module face and re-export chain, AirColorContractError, resolveAirTextureFormat rules with the accepted custom PixelFormat values, the sRGB format set with ordinals, validateAirTextureColorContract rejection literals and the accepted-cell grid, the prefiltered environment contract and receipt, texture row-order and UV rules, color symbol reachability and evidence scoping.
  • pipeline-reachability.md - the default AIR_FEATURES unit list, how a name reaches the built ESM face, postProcess on the delivery face, the custom-pipeline gate table, legacy pipeline entry points and flow-name constants, custom-pipeline binding ordinals, the four-layer reachability grid, the evidence-fingerprint caveat.

Canonical docs

docs/manual/rendering-contracts.md, docs/manual/lighting-units.md, docs/manual/shadow-support-matrix.md, docs/reference/rendering-color-diagnostics.md, docs/reference/texture-uv-verification.md, docs/reference/web-features.md, docs/notes/post-process-notes.md.

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No third-party reports yet.

Signed by skilld at ed38648. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated last month
layer
subsystem
All 1 allowed tools
Read Edit Write Bash
Other metadata
compatibility
Cocos AIR source checkout or installed cocosair.js package. Browser rendering requires WebGL 2; source tooling requires Node.js >=18. Use the host-provided tools and user-authorized workspace.
when_to_use
[
  "scene brightness looks wrong",
  "no shadows from lights",
  "render mirror or refraction into a texture",
  "texture looks washed out after load",
  "can bloom or post-processing run"
]
owns
[
  "lighting",
  "shadows",
  "render-target",
  "msaa",
  "srgb",
  "post-process"
]
not_for
[
  "material property types -> cocosair-materials-effects",
  "camera framing or projection -> cocosair-camera",
  "DOM offscreen textures -> cocosair-graphics-and-dom"
]
metadata
{
  "author": "oahc09@gmail.com",
  "version": "1.0.0",
  "last-updated": "2026-10-13",
  "description_zh": "配置灯光、阴影、渲染目标、MSAA、颜色契约和管线可达性。用于光照、阴影、离屏渲染、读回或后处理问题。"
}

README badge

README badge for oahc09/cocosairjs/cocosair-rendering