Add Acceleration Structure Interface
This commit is contained in:
parent
0b3daf9441
commit
24bf8753b2
8 changed files with 519 additions and 2 deletions
|
|
@ -226,12 +226,12 @@ impl<R: Rng> TriangleBVH<R> {
|
|||
count: triangles.len() as Index,
|
||||
}];
|
||||
let aabb = calculate_aabb(&vertices, &triangles);
|
||||
build_bvh(&vertices, &mut triangles, &mut bvh, 0, aabb);
|
||||
let lights: Vec<_> = triangles
|
||||
.iter()
|
||||
.filter(|f| materials[f.material as usize].light.is_some())
|
||||
.map(Triangle::clone)
|
||||
.collect();
|
||||
build_bvh(&vertices, &mut triangles, &mut bvh, 0, aabb);
|
||||
Self {
|
||||
vertices,
|
||||
bvh,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue