MATLAB implementation of a lambertian renderer without bounce from geometry, albedo, light and camera poses.
Extract the ZIP file (or clone the git repository) somewhere you can easily reach it.
Check out the function setParameters.m
to change the camera and scene parameters.
- Basic rendering parameters are available such as image size and color type (gray or RGB).
- Camera intrinsics are stored in a 3x3 calibration matrix that includes principal point coordinates and focal length.
- Poses are stored in 3x4 matrices that represent world-to-camera transformation matrices
[ R t ]
. - Directional lighting is stored in a vector-3.
- Perspective or orthographic projection models are available.
- The scene geometry is a surface defined by a bivariate function
z(x,y)
. - Its normals are the cross product between the
x
andy
gradient of thez
function. - The albedo is a piecewise linear function of (x,y) whose coefficients are defined by an image. Any grayscale or colored image can be used to define it (see
setParameters.m
).
Once your parameters are set, run main.m
script to get the rendered images of your scene.
Corresponding depth, normal and albedo maps are computed and stored in folders defined in main.m
.