Blender V4.3
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#ifndef __BVH_EMBREE_H__
6#define __BVH_EMBREE_H__
7
8#ifdef WITH_EMBREE
9
10# if EMBREE_MAJOR_VERSION >= 4
11# include <embree4/rtcore.h>
12# include <embree4/rtcore_scene.h>
13# else
14# include <embree3/rtcore.h>
15# include <embree3/rtcore_scene.h>
16# endif
17
18# include "bvh/bvh.h"
19# include "bvh/params.h"
20
21# include "util/string.h"
22# include "util/thread.h"
23# include "util/types.h"
24# include "util/vector.h"
25
27
28class Hair;
29class Mesh;
30class PointCloud;
31
32class BVHEmbree : public BVH {
33 public:
34 void build(Progress &progress,
35 Stats *stats,
36 RTCDevice rtc_device,
37 const bool isSyclEmbreeDevice = false);
38 void refit(Progress &progress);
39
40# if defined(WITH_EMBREE_GPU) && RTC_VERSION >= 40302
41 RTCError offload_scenes_to_gpu(const vector<RTCScene> &scenes);
42# endif
43
44 const char *get_error_string(RTCError error_code);
45
46 RTCScene scene;
47
48 protected:
49 friend class BVH;
50 BVHEmbree(const BVHParams &params,
51 const vector<Geometry *> &geometry,
52 const vector<Object *> &objects);
53 virtual ~BVHEmbree();
54
55 void add_object(Object *ob, int i);
56 void add_instance(Object *ob, int i);
57 void add_curves(const Object *ob, const Hair *hair, int i);
58 void add_points(const Object *ob, const PointCloud *pointcloud, int i);
59 void add_triangles(const Object *ob, const Mesh *mesh, int i);
60
61 private:
62 void set_tri_vertex_buffer(RTCGeometry geom_id, const Mesh *mesh, const bool update);
63 void set_curve_vertex_buffer(RTCGeometry geom_id, const Hair *hair, const bool update);
64 void set_point_vertex_buffer(RTCGeometry geom_id,
65 const PointCloud *pointcloud,
66 const bool update);
67
68 RTCDevice rtc_device;
69 bool rtc_device_is_sycl;
70 enum RTCBuildQuality build_quality;
71};
72
74
75#endif /* WITH_EMBREE */
76
77#endif /* __BVH_EMBREE_H__ */
struct Mesh Mesh
struct Object Object
struct PointCloud PointCloud
in reality light always falls off quadratically Particle Retrieve the data of the particle that spawned the object for example to give variation to multiple instances of an object Point Retrieve information about points in a point cloud Retrieve the edges of an object as it appears to Cycles topology will always appear triangulated Convert a blackbody temperature to an RGB value Normal Generate a perturbed normal from an RGB normal map image Typically used for faking highly detailed surfaces Generate an OSL shader from a file or text data block Image Sample an image file as a texture Gabor Generate Gabor noise Gradient Generate interpolated color and intensity values based on the input vector Magic Generate a psychedelic color texture Voronoi Generate Worley noise based on the distance to random points Typically used to generate textures such as or biological cells Brick Generate a procedural texture producing bricks Texture Retrieve multiple types of texture coordinates nTypically used as inputs for texture nodes Vector Convert a vector
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:66
Definition hair.h:14
#define CCL_NAMESPACE_END
uiWidgetBaseParameters params[MAX_WIDGET_BASE_BATCH]
ccl_device bool BVH_FUNCTION_FULL_NAME BVH(KernelGlobals kg, ccl_private const Ray *ray, ccl_private LocalIntersection *local_isect, int local_object, ccl_private uint *lcg_state, int max_hits)
Definition local.h:28
void add_curves(bke::CurvesGeometry &curves, const Span< int > new_sizes)
static void update(bNodeTree *ntree)