Skip to content

Commit 5739dec

Browse files
committed
Merge branch 'devel' of gitlab.com:embree/embree into devel
2 parents 2cb9ab8 + 014f4ca commit 5739dec

File tree

102 files changed

+3707
-4461
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+3707
-4461
lines changed

CHANGELOG.md

+30
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,36 @@
11
Version History
22
---------------
33

4+
### New Features in Embree 3.0.0
5+
- Switched to a new version of the API which provides improved
6+
flexibility but is not backwards compatible. Please see "Upgrading
7+
from Embree 2 to Embree 3" section of documentation for upgrade
8+
instructions. In particular, we provide a python script that performs
9+
most of the transition work.
10+
- User geometries inside an instanced scene and a top-level scene no
11+
longer need to handle instID field of ray differently. They both
12+
just need to copy the context.instID into the ray.instID field.
13+
- Support for context filter functions that can get assigned to a ray
14+
query.
15+
- User geometries can now invoke filter functions using the
16+
rtcFilterIntersection and rtcFilterOcclusion calls.
17+
- Higher flexibility through specifying build quality per scene and
18+
geometry.
19+
- Geometry normal uses commonly used right hand rule from now on.
20+
- Added self intersection avoidance to ribbon curves and
21+
lines. Applications do not have to implement self intersections workarounds
22+
for these primitive types anymore.
23+
- Added support for 4 billion primitives in a single scene.
24+
- Removed RTC_MAX_USER_VERTEX_BUFFERS and RTC_MAX_INDEX_BUFFERS
25+
limitation.
26+
- Reduced memory consumption by 192 bytes per instance.
27+
- Individual Contributor License Agreement (ICLA) and Corporate
28+
Contributor License Agreement (CCLA) no longer required to
29+
contribute to the project.
30+
31+
### New Features in Embree 2.17.2
32+
- Made BVH build of curve geometry deterministic.
33+
434
### New Features in Embree 2.17.1
535
- Improved performance of occlusion ray packets by up to 50%.
636
- Fixed detection of Clang for CMake 3 under MacOSX

README.md

+1,107-2,322
Large diffs are not rendered by default.

man/man3/RTCHit.3embree3

+19-18
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
.IP
44
.nf
55
\f[C]
6-
RTCHit\ \-\ type\ of\ single\ hit
6+
RTCHit\ \-\ single\ hit\ structure
77
\f[]
88
.fi
99
.SS SYNOPSIS
@@ -14,37 +14,38 @@ RTCHit\ \-\ type\ of\ single\ hit
1414

1515
struct\ RTCHit
1616
{
17-
\ \ float\ Ng_x;\ \ \ \ \ \ \ \ //!<\ x\ coordinate\ of\ geometry\ normal
18-
\ \ float\ Ng_y;\ \ \ \ \ \ \ \ //!<\ y\ coordinate\ of\ geometry\ normal
19-
\ \ float\ Ng_z;\ \ \ \ \ \ \ \ //!<\ z\ coordinate\ of\ geometry\ normal
17+
\ \ float\ Ng_x;\ \ \ \ \ \ \ \ \ \ //\ x\ coordinate\ of\ geometry\ normal
18+
\ \ float\ Ng_y;\ \ \ \ \ \ \ \ \ \ //\ y\ coordinate\ of\ geometry\ normal
19+
\ \ float\ Ng_z;\ \ \ \ \ \ \ \ \ \ //\ z\ coordinate\ of\ geometry\ normal
2020

21-
\ \ float\ t;\ \ \ \ \ \ \ \ \ \ //!<\ hit\ distance
22-
\ \ float\ u;\ \ \ \ \ \ \ \ \ \ //!<\ Barycentric\ u\ coordinate\ of\ hit
23-
\ \ float\ v;\ \ \ \ \ \ \ \ \ \ //!<\ Barycentric\ v\ coordinate\ of\ hit
21+
\ \ float\ u;\ \ \ \ \ \ \ \ \ \ \ \ \ //\ barycentric\ u\ coordinate\ of\ hit
22+
\ \ float\ v;\ \ \ \ \ \ \ \ \ \ \ \ \ //\ barycentric\ v\ coordinate\ of\ hit
2423

25-
\ \ unsigned\ primID;\ \ //!<\ primitive\ ID
26-
\ \ unsigned\ geomID;\ \ //!<\ geometry\ ID
27-
\ \ unsigned\ instID;\ \ //!<\ instance\ ID
24+
\ \ unsigned\ int\ primID;\ //\ geometry\ ID
25+
\ \ unsigned\ int\ geomID;\ //\ primitive\ ID
26+
\ \ unsigned\ int\ instID[RTC_MAX_INSTANCE_LEVEL_COUNT];\ //\ instance\ ID
2827
};
2928
\f[]
3029
.fi
3130
.SS DESCRIPTION
3231
.PP
3332
The \f[C]RTCHit\f[] type defines the type of a ray/primitive
34-
intersection result as passed to some callback functions.
33+
intersection result.
3534
The hit contains the unnormalized geometric normal in object space at
3635
the hit location (\f[C]Ng_x\f[], \f[C]Ng_y\f[], \f[C]Ng_z\f[] members),
37-
the parametric hit distance (\f[C]t\f[] member), the barycentric u/v
38-
coordinates of the hit (\f[C]u\f[] and \f[C]v\f[] members), as well as
39-
the primitive, geometry, and instance ID of the hit (\f[C]primID\f[],
40-
\f[C]geomID\f[], and \f[C]instID\f[] member).
36+
the barycentric u/v coordinates of the hit (\f[C]u\f[] and \f[C]v\f[]
37+
members), as well as the primitive ID (\f[C]primID\f[] member), geometry
38+
ID (\f[C]geomID\f[] member), and instance ID (\f[C]instID\f[] member) of
39+
the hit.
40+
The parametric intersection distance is not stored inside the hit, but
41+
stored inside the \f[C]tfar\f[] member of the ray.
4142
.PP
4243
The \f[C]embree3/rtcore_ray.h\f[] header additionally defines the same
43-
hit structure in structure of array layout (SOA) for hit packets of size
44+
hit structure in structure of array (SOA) layout for hit packets of size
4445
4 (\f[C]RTCHit4\f[] type), size 8 (\f[C]RTCHit8\f[] type), and size 16
4546
(\f[C]RTCHit16\f[] type).
46-
The header additionally defines an \f[C]RTCHitNt\f[] template to
47-
generate hit packets of an arbitrary compile time size.
47+
The header additionally defines an \f[C]RTCHitNt\f[] template for hit
48+
packets of an arbitrary compile\-time size.
4849
.SS EXIT STATUS
4950
.SS SEE ALSO
5051
.PP

man/man3/RTCHitN.3embree3

+18-20
Original file line numberDiff line numberDiff line change
@@ -14,38 +14,36 @@ RTCHitN\ \-\ hit\ packet\ of\ runtime\ size
1414

1515
struct\ HitN;
1616

17-
float&\ RTCHitN_Ng_x(RTCHitN*\ hits,\ size_t\ N,\ size_t\ i);
18-
float&\ RTCHitN_Ng_y(RTCHitN*\ hits,\ size_t\ N,\ size_t\ i);
19-
float&\ RTCHitN_Ng_z(RTCHitN*\ hits,\ size_t\ N,\ size_t\ i);
17+
float&\ RTCHitN_Ng_x(RTCHitN*\ hit,\ unsigned\ int\ N,\ unsigned\ int\ i);
18+
float&\ RTCHitN_Ng_y(RTCHitN*\ hit,\ unsigned\ int\ N,\ unsigned\ int\ i);
19+
float&\ RTCHitN_Ng_z(RTCHitN*\ hit,\ unsigned\ int\ N,\ unsigned\ int\ i);
2020

21-
unsigned&\ RTCHitN_primID(RTCHitN*\ hits,\ size_t\ N,\ size_t\ i);
22-
unsigned&\ RTCHitN_geomID(RTCHitN*\ hits,\ size_t\ N,\ size_t\ i);
23-
unsigned&\ RTCHitN_instID(RTCHitN*\ hits,\ size_t\ N,\ size_t\ i);
21+
float&\ RTCHitN_u(RTCHitN*\ hit,\ unsigned\ int\ N,\ unsigned\ int\ i);
22+
float&\ RTCHitN_v(RTCHitN*\ hit,\ unsigned\ int\ N,\ unsigned\ int\ i);
2423

25-
float&\ RTCHitN_u\ \ \ (RTCHitN*\ hits,\ size_t\ N,\ size_t\ i);
26-
float&\ RTCHitN_v\ \ \ (RTCHitN*\ hits,\ size_t\ N,\ size_t\ i);
27-
float&\ RTCHitN_t\ \ \ (RTCHitN*\ hits,\ size_t\ N,\ size_t\ i);
24+
unsigned&\ RTCHitN_primID(RTCHitN*\ hit,\ unsigned\ int\ N,\ unsigned\ int\ i);
25+
unsigned&\ RTCHitN_geomID(RTCHitN*\ hit,\ unsigned\ int\ N,\ unsigned\ int\ i);
26+
unsigned&\ RTCHitN_instID(RTCHitN*\ hit,\ unsigned\ int\ N,\ unsigned\ int\ i,\ unsigned\ int\ l);
2827
\f[]
2928
.fi
3029
.SS DESCRIPTION
3130
.PP
3231
When the hit packet size is not known at compile time (e.g.
33-
when Embree returns a potential hit packet in the
34-
\f[C]RTCFilterFuncN\f[] callback function), Embree uses the
35-
\f[C]RTCHitN\f[] type for hit packets.
36-
These hit packets can only have size 1, 4, 8, or 16, no other packet
37-
size will get used.
32+
when Embree returns a hit packet in the \f[C]RTCFilterFuncN\f[] callback
33+
function), Embree uses the \f[C]RTCHitN\f[] type for hit packets.
34+
These hit packets can only have sizes of 1, 4, 8, or 16.
35+
No other packet size will be used.
3836
.PP
3937
You can either implement different special code paths for each of these
40-
possible packet sizes and cast the hit to the appropiate hit packet
38+
possible packet sizes and cast the hit to the appropriate hit packet
4139
type, or implement one general code path that uses the
42-
\f[C]RTCHit_XXX\f[] helper functions to access hit packet components.
40+
\f[C]RTCHitN_XXX\f[] helper functions to access hit packet components.
4341
.PP
44-
These helper functions get a pointer to the hit packet (\f[C]ptr\f[]
42+
These helper functions get a pointer to the hit packet (\f[C]hit\f[]
4543
argument), the packet size (\f[C]N\f[] argument), and returns a
46-
reference to some component (e.g.
47-
x\-component of Ng) of the the ith hit of the packet (\f[C]i\f[]
48-
argument).
44+
reference to a component (e.g.
45+
x component of \f[C]Ng\f[]) of the the i\-th hit of the packet
46+
(\f[C]i\f[] argument).
4947
.SS EXIT STATUS
5048
.SS SEE ALSO
5149
.PP

man/man3/RTCRay.3embree3

+28-34
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
.IP
44
.nf
55
\f[C]
6-
RTCRay\ \-\ type\ of\ single\ ray
6+
RTCRay\ \-\ single\ ray\ structure
77
\f[]
88
.fi
99
.SS SYNOPSIS
@@ -12,35 +12,22 @@ RTCRay\ \-\ type\ of\ single\ ray
1212
\f[C]
1313
#include\ <embree3/rtcore_ray.h>
1414

15-
struct\ RTCORE_ALIGN(16)\ RTCRay
15+
struct\ RTC_ALIGN(16)\ RTCRay
1616
{
17-
\ \ float\ org_x;\ \ \ \ \ \ \ \ //!<\ x\ coordinate\ of\ ray\ origin
18-
\ \ float\ org_y;\ \ \ \ \ \ \ \ //!<\ y\ coordinate\ of\ ray\ origin
19-
\ \ float\ org_z;\ \ \ \ \ \ \ \ //!<\ z\ coordinate\ of\ ray\ origin
20-
\ \ float\ tnear;\ \ \ \ \ \ \ \ //!<\ Start\ of\ ray\ segment
17+
\ \ float\ org_x;\ \ \ \ \ \ \ \ //\ x\ coordinate\ of\ ray\ origin
18+
\ \ float\ org_y;\ \ \ \ \ \ \ \ //\ y\ coordinate\ of\ ray\ origin
19+
\ \ float\ org_z;\ \ \ \ \ \ \ \ //\ z\ coordinate\ of\ ray\ origin
20+
\ \ float\ tnear;\ \ \ \ \ \ \ \ //\ start\ of\ ray\ segment
2121

22-
\ \ float\ dir_x;\ \ \ \ \ \ \ \ //!<\ x\ coordinate\ of\ ray\ direction
23-
\ \ float\ dir_y;\ \ \ \ \ \ \ \ //!<\ y\ coordinate\ of\ ray\ direction
24-
\ \ float\ dir_z;\ \ \ \ \ \ \ \ //!<\ z\ coordinate\ of\ ray\ direction
25-
\ \ float\ tfar;\ \ \ \ \ \ \ \ \ //!<\ End\ of\ ray\ segment\ (set\ to\ hit\ distance)
22+
\ \ float\ dir_x;\ \ \ \ \ \ \ \ //\ x\ coordinate\ of\ ray\ direction
23+
\ \ float\ dir_y;\ \ \ \ \ \ \ \ //\ y\ coordinate\ of\ ray\ direction
24+
\ \ float\ dir_z;\ \ \ \ \ \ \ \ //\ z\ coordinate\ of\ ray\ direction
25+
\ \ float\ time;\ \ \ \ \ \ \ \ \ //\ time\ of\ this\ ray\ for\ motion\ blur
2626

27-
\ \ float\ time;\ \ \ \ \ \ \ \ \ \ //!<\ Time\ of\ this\ ray\ for\ motion\ blur
28-
\ \ unsigned\ mask;\ \ \ \ \ \ \ //!<\ Used\ to\ mask\ out\ objects\ during\ traversal
29-
30-
\ \ unsigned\ int\ id;\ \ \ \ //!<\ ray\ ID
31-
\ \ unsigned\ int\ flags;\ //!<\ ray\ flags
32-
\ \
33-
\ \ /*\ hit\ data\ */
34-
\ \ float\ Ng_x;\ \ \ \ \ \ \ \ \ //!<\ x\ coordinate\ of\ geometry\ normal
35-
\ \ float\ Ng_y;\ \ \ \ \ \ \ \ \ //!<\ y\ coordinate\ of\ geometry\ normal
36-
\ \ float\ Ng_z;\ \ \ \ \ \ \ \ \ //!<\ z\ coordinate\ of\ geometry\ normal
37-
\ \ \
38-
\ \ float\ u;\ \ \ \ \ \ \ \ \ \ \ //!<\ Barycentric\ u\ coordinate\ of\ hit
39-
\ \ float\ v;\ \ \ \ \ \ \ \ \ \ \ //!<\ Barycentric\ v\ coordinate\ of\ hit
40-
41-
\ \ unsigned\ primID;\ \ \ //!<\ primitive\ ID\ of\ hit\ primitive
42-
\ \ unsigned\ geomID;\ \ \ //!<\ geometry\ ID\ of\ hit\ geometry
43-
\ \ unsigned\ instID;\ \ \ //!<\ instance\ ID\ of\ hit\ instance
27+
\ \ float\ tfar;\ \ \ \ \ \ \ \ \ //\ end\ of\ ray\ segment\ (set\ to\ hit\ distance)
28+
\ \ unsigned\ int\ mask;\ \ //\ ray\ mask
29+
\ \ unsigned\ int\ id;\ \ \ \ //\ ray\ ID
30+
\ \ unsigned\ int\ flags;\ //\ ray\ flags
4431
};
4532
\f[]
4633
.fi
@@ -52,22 +39,29 @@ The ray contains the origin (\f[C]org_x\f[], \f[C]org_y\f[],
5239
\f[C]dir_y\f[], \f[C]dir_z\f[] members), and ray segment (\f[C]tnear\f[]
5340
and \f[C]tfar\f[] members).
5441
The ray direction does not have to be normalized, and only the parameter
55-
range specified by the tnear/tfar interval is considered valid.
42+
range specified by the \f[C]tnear\f[]/\f[C]tfar\f[] interval is
43+
considered valid.
5644
.PP
57-
The ray segment has to be in the range [0, ∞], thus ranges that start
45+
The ray segment must be in the range [0, ∞], thus ranges that start
5846
behind the ray origin are not allowed, but ranges can reach to infinity.
59-
For rays inside a ray stream, tfar>tnear identifies inactive rays.
47+
For rays inside a ray stream, \f[C]tfar\f[] < \f[C]tnear\f[] identifies
48+
an inactive ray.
6049
.PP
6150
The ray further contains a motion blur time in the range [0, 1]
6251
(\f[C]time\f[] member), a ray mask (\f[C]mask\f[] member), a ray ID
63-
(\f[C]id\f[] member), and some ray flags (\f[C]flags\f[] member).
52+
(\f[C]id\f[] member), and ray flags (\f[C]flags\f[] member).
53+
The ray mask can be used to mask out some geometries for some rays (see
54+
\f[C]rtcSetGeometryMask\f[] for more details).
55+
The ray ID can be used to identify a ray inside a callback function,
56+
even if the order of rays inside a ray packet or stream has changed.
57+
The ray flags are reserved.
6458
.PP
6559
The \f[C]embree3/rtcore_ray.h\f[] header additionally defines the same
66-
ray structure in structure of array layout (SOA) for API functions
60+
ray structure in structure of array (SOA) layout for API functions
6761
accepting ray packets of size 4 (\f[C]RTCRay4\f[] type), size 8
6862
(\f[C]RTCRay8\f[] type), and size 16 (\f[C]RTCRay16\f[] type).
69-
The header additionally defines an \f[C]RTCRayNt\f[] template to
70-
generate ray packets of an arbitrary compile time size.
63+
The header additionally defines an \f[C]RTCRayNt\f[] template for ray
64+
packets of an arbitrary compile\-time size.
7165
.SS EXIT STATUS
7266
.SS SEE ALSO
7367
.PP

man/man3/RTCRayHit.3embree3

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
.TH "RTCRay" "3" "" "" "Embree Ray Tracing Kernels 3"
2+
.SS NAME
3+
.IP
4+
.nf
5+
\f[C]
6+
RTCRayHit\ \-\ combined\ single\ ray/hit\ structure
7+
\f[]
8+
.fi
9+
.SS SYNOPSIS
10+
.IP
11+
.nf
12+
\f[C]
13+
#include\ <embree3/rtcore_ray.h>
14+
15+
struct\ RTCORE_ALIGN(16)\ RTCRayHit
16+
{
17+
\ \ struct\ RTCRay\ ray;
18+
\ \ struct\ RTCHit\ hit;
19+
};
20+
\f[]
21+
.fi
22+
.SS DESCRIPTION
23+
.PP
24+
The \f[C]RTCRayHit\f[] structure is used as input for the
25+
\f[C]rtcIntersect\f[]\-type functions and stores the ray to intersect
26+
and some hit fields that hold the intersection result afterwards.
27+
.PP
28+
The \f[C]embree3/rtcore_ray.h\f[] header additionally defines the same
29+
ray/hit structure in structure of array (SOA) layout for API functions
30+
accepting ray packets of size 4 (\f[C]RTCRayHit4\f[] type), size 8
31+
(\f[C]RTCRayHit8\f[] type), and size 16 (\f[C]RTCRayHit16\f[] type).
32+
The header additionally defines an \f[C]RTCRayHitNt\f[] template to
33+
generate ray/hit packets of an arbitrary compile\-time size.
34+
.SS EXIT STATUS
35+
.SS SEE ALSO
36+
.PP
37+
[RTCRay], [RTCHit]

man/man3/RTCRayHitN.3embree3

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
.TH "RTCRayHitN" "3" "" "" "Embree Ray Tracing Kernels 3"
2+
.SS NAME
3+
.IP
4+
.nf
5+
\f[C]
6+
RTCRayHitN\ \-\ combined\ ray/hit\ packet\ of\ runtime\ size
7+
\f[]
8+
.fi
9+
.SS SYNOPSIS
10+
.IP
11+
.nf
12+
\f[C]
13+
#include\ <embree3/rtcore_ray.h>
14+
15+
struct\ RTCRayHitN;
16+
17+
struct\ RTCRayN*\ RTCRayHitN_RayN(struct\ RTCRayHitN*\ rayhit,\ unsigned\ int\ N);
18+
struct\ RTCHitN*\ RTCRayHitN_HitN(struct\ RTCRayHitN*\ rayhit,\ unsigned\ int\ N);
19+
\f[]
20+
.fi
21+
.SS DESCRIPTION
22+
.PP
23+
When the packet size of a ray/hit structure is not known at compile time
24+
(e.g.
25+
when Embree returns a ray/hit packet in the
26+
\f[C]RTCIntersectFunctionN\f[] callback function), Embree uses the
27+
\f[C]RTCRayHitN\f[] type for ray packets.
28+
These ray/hit packets can only have sizes of 1, 4, 8, or 16.
29+
No other packet size will be used.
30+
.PP
31+
You can either implement different special code paths for each of these
32+
possible packet sizes and cast the ray/hit to the appropriate ray/hit
33+
packet type, or extract the \f[C]RTCRayN\f[] and \f[C]RTCHitN\f[]
34+
components using the \f[C]rtcGetRayN\f[] and \f[C]rtcGetHitN\f[] helper
35+
functions and use the \f[C]RTCRayN_XXX\f[] and \f[C]RTCHitN_XXX\f[]
36+
functions to access the ray and hit parts of the structure.
37+
.SS EXIT STATUS
38+
.SS SEE ALSO
39+
.PP
40+
[RTCHitN]

0 commit comments

Comments
 (0)