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

/cocosair-materials-effects

@ed38648
by oahc09oahc09/cocosairjs3 stars
2
Run it yourself

Configure materials, effects, uniforms, defines and GLSL. Diagnose black/invisible effects, missing textures, setProperty, AIR_E_MATERIAL_NOT_READY or AIR_E_MATERIAL_TYPE.

  • 12 files
  • 116 KB
  • MIT
  • Updated last month
  • GitHub
Use this Skill: https://skilld.dev/gh/oahc09/cocosairjs/cocosair-materials-effects

Nothing lands on disk. Nothing to clean up.

Fork this Skill

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

referencestriggers.md

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

Cocos AIR materials and effects triggers

Source annotations refer to the AIR checkout.

When to use what

  • "Paint a 3D object, no lighting" -> initialize({ effectName: 'builtin-unlit' }) + mainColor.
  • "Physically shaded object" -> effectName: 'builtin-standard' + metallic/roughness/emissive; table in property-types.md.
  • "Show a texture" -> the map macro FIRST in initialize({ defines }), then setProperty; USE_TEXTURE for unlit and sprite, USE_ALBEDO_MAP for standard (defines.md).
  • "Two objects, same recipe, different colors" -> two new Material(); Material.copy(src, overrides?), never a shared builtin write.
  • "Change one renderer without touching its material" -> renderer.getMaterialInstance(i) / the renderer.material getter; semantics in builtin-effects.md.
  • "Change a macro or blend state after initialization" -> MaterialInstance.recompileShaders / MaterialInstance.overridePipelineStates; a plain Material only warns.
  • "Write my own GLSL" -> compiled-shape effect JSON + glsl3 variant + effect.onLoaded(); custom-glsl.md.
  • "Per-frame uniform" -> cache pass.getHandle(name) and call Pass.setUniform(handle, value).
  • "Fog on an unlit object" -> createAirUnlitFogEffect().
  • "Mask a Sprite" -> attachAirSpriteMask(sprite, texture, options?).
  • "What state does this material really have" -> inspectAirMaterial(material), or inspectAirMeshMaterial(mesh, material) for define-versus-attribute checks.

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
[
  "setProperty changes nothing",
  "texture missing after setProperty",
  "different colors for each renderer",
  "change blend or depth state",
  "custom GLSL shader fails"
]
owns
[
  "material",
  "effect",
  "uniform-types",
  "shader-defines",
  "custom-glsl",
  "material-instance"
]
not_for
[
  "lighting, shadows or post-process -> cocosair-rendering",
  "glTF material import -> cocosair-gltf",
  "mesh geometry and sub-models -> cocosair-primitives-mesh"
]
metadata
{
  "author": "oahc09@gmail.com",
  "version": "1.0.0",
  "last-updated": "2026-10-13",
  "description_zh": "配置材质、效果、属性类型、宏和自定义 GLSL。用于 USE_TEXTURE、uniform 类型、效果初始化或材质诊断问题。"
}

README badge

README badge for oahc09/cocosairjs/cocosair-materials-effects