Skip to content

Files

Those are simple json files holding Environment settings object and an array of registered GameObjects with their type, name in the scene and array of components.

Example

json
{
  "environment": {
    "lighting": {
      "ambientLight": [0.5, 0.65, 1.0],
      "ambientLightStrength": 0.3,
      "sunLight": [1.0, 1.0, 1.0, 1.0],
      "sunDirection": [1.0, 1.0, 1.0],
      "clearColor": [0.2, 0.35, 1.0]
    },
    "shading": {
      "gouraud": true,
      "passiveVertexJitter": false,
      "vertexSnapping": true,
      "affineTextureWarping": true,
      "colorQuantization": true,
      "ntfsArtifacts": false
    }
  },
  "objects": [
    {
      "type": "Player",
      "name": "Player",
      "components": [
        {
          "type": "TransformComponent",
          "position": [0.0, 1.0, 0.0],
          "rotation": [0.0, 270.0, 0.0],
          "scale": [1.0, 1.0, 1.0]
        }
      ]
    },
    {
      "type": "GameObject",
      "name": "MyModel",
      "components": [
        {
          "type": "TransformComponent",
          "position": [0.0, -1.0, 0.0],
          "rotation": [0.0, 0.0, 0.0],
          "scale": [10.0, 1.0, 10.0]
        },
        {
          "type": "MeshComponent",
          "path": "Assets/cube.obj"
        }
      ]
    },
    {
      "type": "CameraObject",
      "name": "MainCamera",
      "parent": "Player",
      "components": [
        {
          "type": "TransformComponent",
          "position": [0.0, 0.0, 0.0],
          "rotation": [0.0, 0.0, 0.0],
          "scale": [1.0, 1.0, 1.0]
        },
        {
          "type": "CameraComponent",
          "fov": 90.0,
          "nearPlane": 0.1,
          "farPlane": 1000.0
        }
      ]
    }
  ]
}

Scene files allow us to define lighting condition, shader effects, and objects as well as ther properties and relations.

WARNING

Objects are loaded one after another if you want to parent Object B to Object A, Object A must be defined before Object B in the array.