Examples

Sky and Environment

Current sky workaround using a large cubemap mesh and an unlit material.

Current Pattern

Nevo-base currently represents a sky/environment with a large mesh around the scene, not a dedicated skybox component.

Reference files:

Nevo-base/game/levels/outside.json
Nevo-base/game/assets/cubemap.glb
Nevo-base/game/materials/cubemap.json
Nevo-base/game/textures/StandardCubeMap.png

Scene Entity

outside.json includes a large cubemap mesh entity:

{
  "id": 1,
  "components": [
    {
      "type": "Transform",
      "data": {
        "position": [0.0, 0.0, 0.0],
        "rotation": [0.0, 0.0, 0.0, 1.0],
        "scale": [53.140747, 53.140747, 53.140747]
      }
    },
    {
      "type": "MeshRenderer",
      "data": {
        "enabled": true,
        "mesh": "assets/cubemap.glb",
        "material": ["cubemap"]
      }
    }
  ]
}

The scale is intentionally large enough to surround the playable space.

Material

cubemap.json uses the normal material system:

{
  "version": 0,
  "shader": "basic",
  "color": [1.0, 1.0, 1.0, -1.0],
  "emissionColor": [1.0, 1.0, 1.0, -1.0],
  "castShadows": false,
  "params": {
    "unlit": true,
    "receiveShadows": false
  },
  "textures": [
    {
      "path": "textures/StandardCubeMap.png",
      "type": "diffuse"
    }
  ]
}

Important flags:

FieldWhy
unlit: trueSky should ignore scene lights.
receiveShadows: falseSky should not be darkened by shadows.
castShadows: falseSky should not cast shadows.
color.w: -1.0Current texture-only material mode used by this shader setup.

Lighting Pairing

outside.json pairs the sky with a directional light and ShadowProjector:

{
  "type": "Light",
  "data": {
    "type": 1,
    "color": [1.0, 1.0, 1.0, 1.0],
    "range": 34.3
  }
}

For directional shadows, use a ShadowProjector with directional type and enough volumeExtents to cover the scene.

Limitations

This is a workaround, not a dedicated sky system:

  • The sky is normal scene geometry.
  • It can be selected and edited as a mesh entity.
  • It must be kept large enough for the camera area.
  • Material flags are important; otherwise it can interact with lighting/shadows like normal geometry.

When a dedicated skybox/cubemap component lands, this page should be updated to prefer that API.