Blender V5.0
embree.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2018-2022 Blender Foundation
2 *
3 * SPDX-License-Identifier: Apache-2.0 */
4
5#pragma once
6
7#ifdef WITH_EMBREE
8
9# include <embree4/rtcore.h>
10# include <embree4/rtcore_scene.h>
11
12# include "bvh/bvh.h"
13# include "bvh/params.h"
14
15# include "util/vector.h"
16
18
19class Hair;
20class Mesh;
21class PointCloud;
22
23class BVHEmbree : public BVH {
24 public:
25 void build(Progress &progress,
26 Stats *stats,
27 RTCDevice rtc_device,
28 const bool rtc_device_is_sycl_ = false);
29 void refit(Progress &progress);
30
31# if defined(WITH_EMBREE_GPU) && RTC_VERSION >= 40302
32 RTCError offload_scenes_to_gpu(const vector<RTCScene> &scenes);
33# endif
34
35 const char *get_error_string(RTCError error_code);
36
37 RTCScene scene;
38
39 BVHEmbree(const BVHParams &params,
40 const vector<Geometry *> &geometry,
41 const vector<Object *> &objects);
42 ~BVHEmbree() override;
43
44 protected:
45 void add_object(Object *ob, const int i);
46 void add_instance(Object *ob, const int i);
47 void add_curves(const Object *ob, const Hair *hair, const int i);
48 void add_points(const Object *ob, const PointCloud *pointcloud, const int i);
49 void add_triangles(const Object *ob, const Mesh *mesh, const int i);
50
51 private:
52 void set_tri_vertex_buffer(RTCGeometry geom_id, const Mesh *mesh, const bool update);
53 void set_curve_vertex_buffer(RTCGeometry geom_id, const Hair *hair, const bool update);
54 void set_point_vertex_buffer(RTCGeometry geom_id,
55 const PointCloud *pointcloud,
56 const bool update);
57
58 RTCDevice rtc_device;
59 bool rtc_device_is_sycl;
60 enum RTCBuildQuality build_quality;
61};
62
64
65#endif /* WITH_EMBREE */
struct Mesh Mesh
struct Object Object
struct PointCloud PointCloud
void refit(btStridingMeshInterface *triangles, const btVector3 &aabbMin, const btVector3 &aabbMax)
void build(btStridingMeshInterface *triangles, bool useQuantizedAabbCompression, const btVector3 &bvhAabbMin, const btVector3 &bvhAabbMax)
Definition bvh/bvh.h:67
Definition hair.h:13
#define CCL_NAMESPACE_END
uiWidgetBaseParameters params[MAX_WIDGET_BASE_BATCH]
void add_curves(bke::CurvesGeometry &curves, const Span< int > new_sizes)
static void update(bNodeTree *ntree)
i
Definition text_draw.cc:230