1RTC_GEOMETRY_TYPE_INSTANCEE(m3b)ree Ray Tracing KernelRsTC3_GEOMETRY_TYPE_INSTANCE(3)
2
3
4
5 NAME
6 RTC_GEOMETRY_TYPE_INSTANCE - instance geometry type
7
8 SYNOPSIS
9 #include <embree3/rtcore.h>
10
11 RTCGeometry geometry =
12 rtcNewGeometry(device, RTC_GEOMETRY_TYPE_INSTANCE);
13
14 DESCRIPTION
15 Embree supports instancing of scenes using affine transformations (3×3
16 matrix plus translation). As the instanced scene is stored only a sin‐
17 gle time, even if instanced to multiple locations, this feature can be
18 used to create very complex scenes with small memory footprint. Only
19 single-level instancing is supported natively by Embree, however,
20 multi-level instancing can be manually implemented through user geome‐
21 tries.
22
23 Instances are created by passing RTC_GEOMETRY_TYPE_INSTANCE to the rtc‐
24 NewGeometry function call. The instanced scene can be set using the
25 rtcSetGeometryInstancedScene call, and the affine transformation can be
26 set using the rtcSetGeometryTransform function.
27
28 Please note that rtcCommitScene on the instanced scene should be called
29 first, followed by rtcCommitGeometry on the instance, followed by rtc‐
30 CommitScene for the top-level scene containing the instance.
31
32 If a ray hits the instance, the geomID and primID members of the hit
33 are set to the geometry ID and primitive ID of the hit primitive in the
34 instanced scene, and the instID member of the hit is set to the geome‐
35 try ID of the instance in the top-level scene.
36
37 The instancing scheme can also be implemented using user geometries.
38 To achieve this, the user geometry code should set the instID member of
39 the intersection context to the geometry ID of the instance, then trace
40 the transformed ray, and finally set the instID field of the intersec‐
41 tion context again to -1. The instID field is copied automatically by
42 each primitive intersector into the instID field of the hit structure
43 when the primitive is hit. See the [User Geometry] tutorial for an
44 example.
45
46 For multi-segment motion blur, the number of time steps must be first
47 specified using the rtcSetGeometryTimeStepCount function. Then a
48 transformation for each time step can be specified using the rtcSetGe‐
49 ometryTransform function.
50
51 See tutorial [Instanced Geometry] for an example of how to use
52 instances.
53
54 EXIT STATUS
55 On failure NULL is returned and an error code is set that can be
56 queried using rtcGetDeviceError.
57
58 SEE ALSO
59 [rtcNewGeometry], [rtcSetGeometryInstancedScene], [rtcSetGeometryTrans‐
60 form]
61
62
63
64 RTC_GEOMETRY_TYPE_INSTANCE(3)