cvmath 0.0.8

Computer Graphics Vector Math Library
Documentation
{
  "image": {
    "width": 960,
    "height": 540,
    "nsamples": 2048,
    "max_bounces": 6,
    "use_rayon": true
  },
  "camera": {
    "origin": [0.0, 1.25, -4.0],
    "target": [0.0, 1.0, 0.0],
    "ref_up": [0.0, 1.0, 0.0],
    "fov_y": 40.0,
    "dof_enabled": true,
    "aperture_radius": 0.05,
    "focus_distance": 4.0
  },
  "world": {
    "ambient_light": 0.3,
    "light": {
      "pos": [0.0, 100.0, 0.0],
      "color": [1.0, 1.0, 1.0],
      "radius": 5.0
    },
    "materials": {
      "ground": {
        "texture": "Ground",
        "reflectivity": 0.0,
        "hardness": 1.0,
        "diffuse_factor": 0.8,
        "specular_factor": 0.0
      },
      "sphere1": {
        "texture": "None",
        "reflectivity": 0.95,
        "hardness": 1.0,
        "diffuse_factor": 0.0,
        "specular_factor": 1.0
      },
      "sphere2": {
        "texture": {
          "Color": [1.0, 0.64705884, 0.0]
        },
        "reflectivity": 0.05,
        "hardness": 99.0,
        "diffuse_factor": 0.9,
        "specular_factor": 1.0
      },
      "mirror": {
        "texture": {
          "Color": [1.0, 1.0, 1.0]
        },
        "reflectivity": 1.0,
        "hardness": 1.0,
        "diffuse_factor": 0.1,
        "specular_factor": 1.0
      }
    },
    "objects": [
      {
        "shape": {
          "Plane": {
            "normal": [0.0, 1.0, 0.0],
            "distance": 0.0
          }
        },
        "material": "ground"
      },
      {
        "shape": {
          "Sphere": {
            "center": [-1.0, 2.0, 3.0],
            "radius": 0.5
          }
        },
        "material": "sphere1"
      },
      {
        "shape": {
          "Sphere": {
            "center": [1.25, 0.8, 0.0],
            "radius": 0.25
          }
        },
        "material": "sphere2"
      },
      {
        "shape": {
          "Triangle": {
            "p": [0.0, 0.0, 0.0],
            "u": [0.0, 1.0, 1.0],
            "v": [-1.0, 1.0, 0.0]
          }
        },
        "material": "mirror"
      },
      {
        "shape": {
          "Triangle": {
            "p": [0.0, 0.0, 0.0],
            "u": [-1.0, 1.0, 0.0],
            "v": [0.0, 1.0, -1.0]
          }
        },
        "material": "mirror"
      },
      {
        "shape": {
          "Triangle": {
            "p": [0.0, 0.0, 0.0],
            "u": [0.0, 1.0, -1.0],
            "v": [1.0, 1.0, 0.0]
          }
        },
        "material": "mirror"
      },
      {
        "shape": {
          "Triangle": {
            "p": [0.0, 0.0, 0.0],
            "u": [1.0, 1.0, 0.0],
            "v": [0.0, 1.0, 1.0]
          }
        },
        "material": "mirror"
      },
      {
        "shape": {
          "Triangle": {
            "p": [0.0, 2.0, 0.0],
            "u": [-1.0, -1.0, 0.0],
            "v": [0.0, -1.0, 1.0]
          }
        },
        "material": "mirror"
      },
      {
        "shape": {
          "Triangle": {
            "p": [0.0, 2.0, 0.0],
            "u": [0.0, -1.0, 1.0],
            "v": [1.0, -1.0, 0.0]
          }
        },
        "material": "mirror"
      },
      {
        "shape": {
          "Triangle": {
            "p": [0.0, 2.0, 0.0],
            "u": [1.0, -1.0, 0.0],
            "v": [0.0, -1.0, -1.0]
          }
        },
        "material": "mirror"
      },
      {
        "shape": {
          "Triangle": {
            "p": [0.0, 2.0, 0.0],
            "u": [0.0, -1.0, -1.0],
            "v": [-1.0, -1.0, 0.0]
          }
        },
        "material": "mirror"
      }
    ]
  }
}