AIR task cookbook
中文入口:粒子与点精灵、无后处理辉光、拾取与 HUD、动态网格、天空与环境。
Choose the task first, then follow only the needed owner links. These are composition routes; exact contracts remain in their existing references. Use the visual loop to check the result. Neither a route nor a copied shader establishes visual acceptance.
Each subsystem Quick Start is a standalone example and repeats app/scene/camera setup. When combining recipes in an already working page, reuse those objects and read the topic needed for the next change. Use an app or camera Quick Start when that setup is still missing; loading another subsystem does not require assembling another complete page.
Particles and point sprites
Choose Billboard for camera-facing textured quads, ParticleSystem2D for that subsystem, or a custom POINT_LIST mesh via mesh layout and custom GLSL. For points write gl_PointSize; do not assume a thick-line or billboard route is equivalent. Check size, texture ownership, topology and a visible pixel result before scaling the particle count. For many repeated meshes, choose batching after the small case renders.
Glow without post-processing
Start with visible opaque geometry, then add a soft alpha texture or shader falloff using numeric blend states. Read material instances and map macros before animating brightness. This route simulates luminous surfaces/halos; it does not spread HDR highlights across the rendered image like Bloom. If the task allows real post-processing, the owner is HDR/Bloom. Verify ordering, depth/occlusion and saturation in the final frame rather than compensating for a black object with higher intensity.
Picking and HUD
Choose native input, convert screen coordinates with the camera ray contract, then use the appropriate hit test and present the selected result through the UI owner. Do not mix DOM CSS pixels, framebuffer pixels and UI local coordinates. For wheel-controlled cameras, choose the native MOUSE_WHEEL route or an explicitly owned DOM listener; keep page-scroll capture scoped to the interaction surface. Check focus and default-event policy for action adapters rather than assuming every backend captures wheel or prevents scrolling. Remove listeners on disposal.
Dynamic mesh
Use the creation/update checklist, pair it with the complete effect template only if a custom shader is needed, then frame the bounds. First verify a few vertices and one update. Choose batching when actual workload measurements justify it; a missing draw is not a batching diagnosis.
For continuous deformation, go directly to the Component.update(dt) example. For controlled captures, use the step clock. The implementation loop and the capture clock serve different steps; a mesh animation alone does not require reading the tween/clip examples.
Instances, particles and GPU shapes
Choose by data/lifetime ownership rather than by the word "particle":
| Task | Read first |
|---|---|
| Repeated fixed meshes without per-instance Nodes | Explicit instance batches |
| Ordinary shared-material MeshRenderer auto-batching | Native instancing |
| Emission, lifetime and CPU trails | Native 3D ParticleSystem |
| Text/image/mesh point or voxel shape transitions | GPU morph fields |
| glTF mesh Morph weights or skeletal deformation | Skinning and Morph |
For a dull AirMorphField, inspect its own surface mode and normals: setSurface('polished', 0.18) enables a procedural studio reflection, not native scene lights or full PBR/IBL. Check actual highlight changes when roughness/camera changes before adding exposure. Original native material workflows keep their existing owners; do not swap a field's private material for builtin-standard or add native USE_INSTANCING to its managed stream.
Sky and environment
Choose scene globals for skybox, fog and ambient configuration, lighting units for exposure/physical magnitudes, and camera framing for scene scale. Confirm a readable scene with fog and extra effects disabled, then tune the environment incrementally. A dark frame does not identify a missing light, excessive fog or exposure on its own; compare the symptom checks.