Difficulty |
5 |
Prerequisites |
|
Reading material |
|
def material(c)
{
Materials.uniform( [ "ambient": Colors.white() * 0.1,
"diffuse": c * 0.8,
"specular": Colors.white() * 0.5,
"specular_exponent": 10,
"reflectivity": 0.0,
"transparency": 0,
"refractive_index": 0 ] )
}
global m = mesh("G:/repos/ucll/3dcg/raytracer/meshes-v3/meshes/optimized-lucy.bmesh")
def scene_at(now)
{
var camera = Cameras.perspective( [ "eye": pos(0,0,3),
"look_at": pos(0,0,0) ] )
var angle = Animations.animate(degrees(0), degrees(360), seconds(5))
var m2 = rotate_around_x(degrees(-90), center( pos(0, 0, 0), m))
var m3 = resize_y_uniform(m2, 2)
var root = rotate_around_y( degrees(180) + angle[now], decorate( material(Colors.white()), m3 ) )
var lights = [ Lights.omnidirectional( pos(5, 5, 5), Colors.white() ) ]
create_scene(camera, root, lights)
}
var raytracer = Raytracers.latest()
var renderer = Renderers.standard( [ "width": 500,
"height": 500,
"sampler": Samplers.multijittered(2),
"ray_tracer": raytracer ] )
pipeline( scene_animation(scene_at, seconds(5)),
[ Pipeline.animation(30),
Pipeline.renderer(renderer),
Pipeline.studio() ] )
1. Implementation
For this extension, you will have to optimize a mesh. More concretely, given a file containing an unoptimized mesh (i.e., a mesh with all its triangles in a single box) and will have to create a bounding box hierarchy and store the results in a new file.
Create a tool that builds bounding box hierarchies for meshes. You can implement it in any language you want. |
2. Evaluation
Render the following scene in under 2 minutes.
|