Wayverb
image_source.h
1 #pragma once
2 
3 #include "raytracer/image_source/reflection_path_builder.h"
4 
5 #include "core/cl/common.h"
6 #include "core/environment.h"
7 #include "core/spatial_division/scene_buffers.h"
8 
9 namespace wayverb {
10 namespace raytracer {
11 namespace reflection_processor {
12 
14 public:
15  image_source_group_processor(size_t max_order, size_t items);
16 
17  template <typename It>
18  void process(It b,
19  It e,
20  const core::scene_buffers& /*buffers*/,
21  size_t step,
22  size_t /*total*/) {
23  if (step < max_image_source_order_) {
24  builder_.push(b, e);
25  }
26  }
27 
28  auto get_results() const { return builder_.get_data(); }
29 
30 private:
31  size_t max_image_source_order_;
32 
34 };
35 
37 
39 public:
41  const glm::vec3& source,
42  const glm::vec3& receiver,
43  const core::environment& environment,
45  cl_float3,
47  size_t max_order);
48 
49  image_source_group_processor get_group_processor(
50  size_t num_directions) const;
51  void accumulate(const image_source_group_processor& processor);
52 
53  util::aligned::vector<impulse<8>> get_results() const;
54 
55 private:
56  glm::vec3 source_;
57  glm::vec3 receiver_;
58  core::environment environment_;
59  const core::voxelised_scene_data<cl_float3,
61  voxelised_;
62  size_t num_directions_;
63 
64  size_t max_order_;
65 
67 };
68 
70 
71 class make_image_source final {
72 public:
73  make_image_source(size_t max_order);
74 
75  image_source_processor get_processor(
76  const core::compute_context& cc,
77  const glm::vec3& source,
78  const glm::vec3& receiver,
79  const core::environment& environment,
81  cl_float3,
82  core::surface<core::simulation_bands>>& voxelised) const;
83 
84 private:
85  size_t max_order_;
86 };
87 
88 } // namespace reflection_processor
89 } // namespace raytracer
90 } // namespace wayverb
Definition: scene_buffers.h:12
Definition: reflection_path_builder.h:10
Definition: pressure.h:22
Definition: environment.h:6
Definition: capsule_base.h:9
invariant: device is a valid device for the context
Definition: common.h:13
Definition: voxelised_scene_data.h:14