Skip to content

Scene Description File Format

Xiang Feng edited this page Jun 17, 2022 · 9 revisions

Scene description file

Scene is described by a json file in Asuna. A typical scene description json is shown as below:

{
  "state": { ... },
  "camera": { ... },
  "lights": [ ... ],
  "textures": [ ... ],
  "materials": [ ... ],
  "meshes": [ ... ],
  "instances": [ ... ],
  "shots": [ ... ]
}

Scene description file is typically composed of 7 parts:

  • state: settings for path integrator and post processor. This part is required for the scene file.
  • camera: settings for camera used in the scene. Up to now, Asuna supports only one camera per scene. This part is required for the scene file.
  • lights: all the lights in the scene. This part is optional.
  • materials: all the materials in the scene. This part is optional.
  • textures: all the textures in the scene. This part is optional.
  • meshes: all the meshes in the scene. This part is required for the scene file.
  • instances: all the instances in the scene. A instance is composed of a mesh, a material and a transformation used for that mesh. This part is required for the scene file.
  • shots: shot is used to describe the pose or extrinsic parameter of the camera and the state used for that pose. A scene can have multiple shots, so you can render multi view images. This part is optional.

Example scene file can be found in Cornell Box and Asuna-Scenes.

For more details of forementioned 8 parts, please refer to their corresponding pages.

Declaration-Reference

The use of textures, materials and meshes is in declaration-reference manner. For example, if you want to create a material which uses texture A as normal map, you should first do declaration: put A in textures part of scene description file; In addition, if you want to create an instance that uses mesh B and material C, you should put B in meshes part and C in materials part. A example declaration-reference procedure is shown below:

    "textures": [
        {
            "name": "cloth",
            "path": "textures/Clothes_emissive.png"
        }
    ],
    "materials": [
        {
            "name": "cloth",
            "type": "brdf_emissive",
            "radiance_texture": "cloth"
        }
    ],
    "meshes": [
        {
            "name": "cloth3",
            "path": "Cloth3.obj"
        }
    ],
    "instances": [
        {
            "mesh": "cloth3",
            "material": "cloth"
        }
    ]

where texture "cloth" is referenced by material "cloth", mesh "cloth3" and material "cloth" are referenced by instances[0].

This page is still in progress.

Clone this wiki locally