-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathrender_generic_material.cpp
55 lines (47 loc) · 2.3 KB
/
render_generic_material.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// This file is distributed under the MIT license.
// See the LICENSE file for details.
#include "render.h"
namespace visionaray
{
void render_generic_material_cpp(
index_bvh<basic_triangle<3, float>> const& bvh,
aligned_vector<vec3> const& geometric_normals,
aligned_vector<vec3> const& shading_normals,
aligned_vector<vec2> const& tex_coords,
aligned_vector<generic_material_t> const& materials,
aligned_vector<texture_t> const& textures,
aligned_vector<area_light<float, basic_triangle<3, float>>> const& lights,
unsigned bounces,
float epsilon,
vec4 bgcolor,
vec4 ambient,
host_device_rt& rt,
host_sched_t<ray_type_cpu>& sched,
camera_t const& cam,
unsigned& frame_num,
algorithm algo,
unsigned ssaa_samples
)
{
using bvh_ref = index_bvh<basic_triangle<3, float>>::bvh_ref;
aligned_vector<bvh_ref> primitives;
primitives.push_back(bvh.ref());
auto kparams = make_kernel_params(
normals_per_vertex_binding{},
primitives.data(),
primitives.data() + primitives.size(),
geometric_normals.data(),
shading_normals.data(),
tex_coords.data(),
materials.data(),
textures.data(),
lights.data(),
lights.data() + lights.size(),
bounces,
epsilon,
bgcolor,
ambient
);
call_kernel( algo, sched, kparams, frame_num, ssaa_samples, cam, rt );
}
} // visionaray