Simple C++ parser for the .ray
scene representation format that is often used in ray-tracing applications.
We support a (hopefully sensible) subset of the .ray standard as specified here. Notable differences are as follows:
Comments are not supported. For example
point_light {
position = (1,3,-2);
// yellow light.
colour = (1,1,0);
};
is illegal.
All lists enclosed in curley braces must end in a semicolon. For example:
camera {
position = (0,0,-4);
viewdir = (0,0,1);
updir = (0,1,0);
aspectratio = 1;
};
For now, we only support polymesh objects loaded in from a .obj
file.
Transforms must be specified inside the objects instead of around them. For example:
polymesh {
filename = "cube.obj";
translate = (1,0,0);
};
instead of
translate(1, 0, 0, polymesh {
filename = "cube.obj";
});
Materials must be specified in the objects and we cannot reuse them by name. For example:
polymesh {
filename = "cube.obj";
material {
diffuse = (0.9,0.9,0);
specular = (1,1,0);
emissive = (0.1,0.1,0);
shininess = 0.92;
};
};
must be used instead of
material {
name = "gold";
diffuse = (0.9,0.9,0);
specular = (1,1,0);
emissive = (0.1,0.1,0);
shininess = 0.92;
};
polymesh {
filename = "cube.obj";
material = "gold";
};