<commit_before>Small more or less self-contained library to read and write an intrinsic scene format. This library depends on [Epsilon-Intersection](https://github.com/Jojendersie/Epsilon-Intersection) and the Cpp standard library.

The managed scene format consists of to files: a binary model (.bim) and a JSON file for materials and light sources. Moreover, it supports chunked parallel loading processes for out-of-core scenarios.

## How to use? ##
To include the library into a project add it (and ε) as submodules and simply compile the cpp files along with the other files from your project. (This is still the most compatible way to include a cpp library - cross platform).

To load a bim do the following:

    #include "bim.hpp"

    ...
    bim::BinaryModel model;
    model.load("test.json");
    model.makeChunkResident(ei::IVec3(0));

The load() function only loads meta information for the scene (e.g. the number of chunks). The last line is necessary to get the actual data. Each chunk must be made resident for itself. This allows to handle scene files larger than the current RAM (as long as at least the requested number of chunks fits into the memory). Usually smaller files only have a single chunk.

## Json File Structure

A json file is used to define a scene environment. It references exactly one \*.bim binary file.
An example for a JSON file looks as follows:

    {
        "scene": "blabla.bim",
        "accelerator": "aabox",
        "cameras": {
            "controlVelocity": 2.5 // Allows to change the movement speed in the scene for interaction
            "perspective": {
                "scenario": ["stresstest"],
                "position": [1.0, 2.0, 3.0],
                "fov": 67.0,
                "lookAt": [0.0, 0.0, 0.0]
            }
            "orthographic": {
                "scenario": ["baking"],
                "direction": [0.0, 0.0, 1.0],
                "position": [1.0, 2.0, 3.0],
                "left": -4.0,
                "right": 4.0,
                "top": 4.0,
                "bottom": -4.0,
                "near": 0.0,
                "far": 10.0,
            }
            "focus": {
                "scenario": ["day"],
                "position": [1.0, 2.0, 3.0],
                "lookAt": [0.0, 0.0, 0.0],
                "focalLength": 20.0,
                "focusDistance": 1.0,
                "sensorSize": 24.0,
                "aperture": 1.4
            }
        },
        "sensor": {
            "resolution": [1024, 512],
            "filter": {"type": "none"},
            "toneMapper": {"type": "none"}
        },
        "materials": {
            "physical": {
                "name": <matname>,
                "albedo": [0.5, 0.5, 0.5],
                "roughness": "rough.png"
            }
        },
        "lights": {
            "point": {
                "position": [1, 2, 3],
                "intensity": [10, 50, 10],
                "scenario": ["day", "stresstest", ...]
            }
        }
    }

### "scene" ###
Required property which references the binary scene file.
Currently only a single binary file is supported.
The given file name is interpreted as relative to the json-file.

### "accelerator" ###
The ray tracing structure which should be used. The binary file must contain
the precomputed structure to be used. Then, valid choices are `aabox` (BVH) and `obox` (BVH).
The default is `aabox`.

### "sensor" ###
Defines the image resolution and post processing.

`filter` `type` can be:
* `none`  
* `bilateral`: bilateral noise reduction. Has additional parameter `radius`.

`toneMapper` `type` can be:
* `none`  
* `gamma`: gamma curve correction (will be made on Luma channel in YCoCg). Has additional parameter `exponent`.
<commit_msg>fixed: json cannot have multiple objects of the same name -> changed scene format description<commit_after>Small more or less self-contained library to read and write an intrinsic scene format. This library depends on [Epsilon-Intersection](https://github.com/Jojendersie/Epsilon-Intersection) and the Cpp standard library.

The managed scene format consists of to files: a binary model (.bim) and a JSON file for materials and light sources. Moreover, it supports chunked parallel loading processes for out-of-core scenarios.

## How to use? ##
To include the library into a project add it (and ε) as submodules and simply compile the cpp files along with the other files from your project. (This is still the most compatible way to include a cpp library - cross platform).

To load a bim do the following:

    #include "bim.hpp"

    ...
    bim::BinaryModel model;
    model.load("test.json");
    model.makeChunkResident(ei::IVec3(0));

The load() function only loads meta information for the scene (e.g. the number of chunks). The last line is necessary to get the actual data. Each chunk must be made resident for itself. This allows to handle scene files larger than the current RAM (as long as at least the requested number of chunks fits into the memory). Usually smaller files only have a single chunk.

## Json File Structure

A json file is used to define a scene environment. It references exactly one \*.bim binary file.
An example for a JSON file looks as follows:

    {
        "scene": "blabla.bim",
        "accelerator": "aabox",
        "cameras": {
            "controlVelocity": 2.5 // Allows to change the movement speed in the scene for interaction
            <camname>: {
				"type": "perspective",
                "scenario": ["stresstest"],
                "position": [1.0, 2.0, 3.0],
                "fov": 67.0,
                "lookAt": [0.0, 0.0, 0.0]
            },
            <camname>: {
				"type": "orthographic",
                "scenario": ["baking"],
                "direction": [0.0, 0.0, 1.0],
                "position": [1.0, 2.0, 3.0],
                "left": -4.0,
                "right": 4.0,
                "top": 4.0,
                "bottom": -4.0,
                "near": 0.0,
                "far": 10.0,
            },
            <camname>: {
				"type": "focus",
                "scenario": ["day"],
                "position": [1.0, 2.0, 3.0],
                "lookAt": [0.0, 0.0, 0.0],
                "focalLength": 20.0,
                "focusDistance": 1.0,
                "sensorSize": 24.0,
                "aperture": 1.4
            }
        },
        "sensor": {
            "resolution": [1024, 512],
            "filter": {"type": "none"},
            "toneMapper": {"type": "none"}
        },
        "materials": {
            <matname>: {
                "type": "physical",
                "albedo": [0.5, 0.5, 0.5],
                "roughness": "rough.png"
            }
        },
        "lights": {
            <lightname>: {
				"type": "point",
                "position": [1, 2, 3],
                "intensity": [10, 50, 10],
                "scenario": ["day", "stresstest", ...]
            }
        }
    }

### "scene" ###
Required property which references the binary scene file.
Currently only a single binary file is supported.
The given file name is interpreted as relative to the json-file.

### "accelerator" ###
The ray tracing structure which should be used. The binary file must contain
the precomputed structure to be used. Then, valid choices are `aabox` (BVH) and `obox` (BVH).
The default is `aabox`.

### "sensor" ###
Defines the image resolution and post processing.

`filter` `type` can be:

* `none`  
* `bilateral`: bilateral noise reduction. Has additional parameter `radius`.

`toneMapper` `type` can be:

* `none`  
* `gamma`: gamma curve correction (will be made on Luma channel in YCoCg). Has additional parameter `exponent`.

{'fraction_non_alphanumeric': 0.1228912535686478, 'fraction_numerical': 0.022839345964183754, 'mean_word_length': 2.0223529411764707, 'pattern_counts': {'":': 85, '<': 9, '<?xml version=': 0, '>': 10, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4835565', 'n_tokens_mistral': 2350, 'n_tokens_neox': 2153, 'n_words': 854}