-
Notifications
You must be signed in to change notification settings - Fork 0
YAML Raytracer
Vitor Greati edited this page Jun 25, 2019
·
19 revisions
This document describes the YAML description of the omg raytracer.
raytracer:
camera:
width: 800
height: 600
position: [0.0, 0.0, 0.0]
target: [0.0, 0.0, -10.0]
up: [0.0, 1.0, 1.0]
fdist: 1.0
v_angle: 45.0
background:
type: solid
color: [255, 0, 0]
scene:
materials:
- type: flat
label: redish
color: [255, 0, 0]
objects:
- type: sphere
center: [0, 0, 2]
radius: 0.4
material: redish
settings:
integrators:
- type: flat
- type: normal_map
This is the main section of the description. It has all top level elements to produce a 3D image, like camera and background. The quick-start example is a good view of this construction.
- camera
- background
- scene
- settings
This represents a camera.
- type: [orthographic | perspective]
- width: the image width
- height: the image height
- position: camera location
- target: direction to which the camera is looking
- up: vector normal to the top of the camera
- view_normal: the normal vector with respect to the view plane (for oblique views)
- orthographic
- vpdims: l r b t
- perspective
- defining the field of view
- fdist: focal distance
- v_angle: vertical angle of view
- aspect_ratio: the aspect ratio, otherwise computed as width/height
- defining the view port
- fdist: focal distance
- vpdims: l r b t
- defining the field of view
The scene background.
- type: [solid | gradient]
- solid
- color
- gradient
- colors: up to 4 colors (more than that will be ignored), given clock-wise from the top left corner. Less than 4 colors will make the last one to be repeated in the remaining corners.
The scene elements.
- intensity: light color, 3D vector in [0,255]
- type: [point, spot, directional]
- point
- position: light position, 3D vector
- spot
- position: light position, 3D vector
- point_at: to where the source is pointing, 3D vector
- cutoff: main focus angle, float
- falloff: total angle, float
- directional
- direction: light direction
- type: [flat, blinn]
- flat
- color: the material color
- blinn
- ambient: influence of the ambient light, 3D vector in [0,1]
- diffuse: influence of diffuse light, 3D vector in [0,1]
- specular: influence of specular light, 3D vector in [0,1]
- glossiness: plastic aspect, 3D vector in [0,1]
- mirror: how much this material reflects light (mirror-like effect), 3D vector in [0,1]
- type: [sphere, triangle_mesh, aggregate]
- material: a label of some declared material
- transform: a list of transforms to be applied in the object (check misc elements for details)
- sphere
- radius: radius (float)
- center: a vector
- triangle_mesh
- obj_file: o .obj file having a mesh description
- clockwise: if triangles specified in clockwise orientation
- compute_normals: force the computation of normals (applicable for obj_file specification)
- ntriangles: number of triangles
- indices: 2*ntriangles indices for the vertices of each triangle
- vertices: list of vertices
- normals: list of vertex normals
- aggregate
- structure: a description of the acceleration structure (see below)
- objects: a list of objects
- label: a label
Running settings of the raytracer.
The integrators to be run over the description. At least the following attributes must be specified:
- type: [flat | normal_map | depth | blinn]
- depth:
- near_color: the color of the nearest objects
- far_color: the color of the fartest objects
- type: [bvh, list]
- bvh
- max_prim_nodes: the maximum number of primitives in a leaf
- split_method: [middle, equal_counts]
- list
- type: [scale, rotation_x, rotation_y, rotation_z, rotation, translation]
- scale
- xyz: scale factors in each axis
- rotation_x
- angle
- rotation_y
- angle
- rotation_z
- angle
- rotation
- axis: rotation axis
- angle
- translation
- delta: translation delta in each axis