cocos_set_ambient
Configure ambient lighting parameters including sky color, ground color, and illumination levels for Cocos Creator scenes to achieve realistic environmental lighting effects.
Instructions
Configure ambient lighting on the scene's cc.AmbientInfo.
Colors are floats 0..1 (NOT 0..255 — sky/ground colors in Cocos are normalized like material PBR inputs). Pass None to leave unchanged. sky_illum is in lux, default ~20000. The scene must have been created via cocos_create_scene (which auto-attaches AmbientInfo).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| scene_path | Yes | ||
| sky_color_r | No | ||
| sky_color_g | No | ||
| sky_color_b | No | ||
| sky_color_a | No | ||
| sky_illum | No | ||
| ground_r | No | ||
| ground_g | No | ||
| ground_b | No | ||
| ground_a | No |