1rtcSetGeometryOccludedFuncEtmiborne(e3)Ray Tracing KerrtnceSlestG3eometryOccludedFunction(3)
2
3
4
5 NAME
6 rtcSetGeometryOccludedFunction - sets the callback function to
7 test a user geometry for occlusion
8
9 SYNOPSIS
10 #include <embree3/rtcore.h>
11
12 struct RTCOccludedFunctionNArguments
13 {
14 int* valid;
15 void* geometryUserPtr;
16 unsigned int primID;
17 struct RTCIntersectContext* context;
18 struct RTCRayN* ray;
19 unsigned int N;
20 unsigned int geomID;
21 };
22
23 typedef void (*RTCOccludedFunctionN)(
24 const struct RTCOccludedFunctionNArguments* args
25 );
26
27 void rtcSetGeometryOccludedFunction(
28 RTCGeometry geometry,
29 RTCOccludedFunctionN filter
30 );
31
32 DESCRIPTION
33 The rtcSetGeometryOccludedFunction function registers a ray/primitive
34 occlusion callback function (filter argument) for the specified user
35 geometry (geometry argument).
36
37 Only a single callback function can be registered per geometry, and
38 further invocations overwrite the previously set callback function.
39 Passing NULL as function pointer disables the registered callback func‐
40 tion.
41
42 The registered callback function is invoked by rtcOccluded-type ray
43 queries to test whether the rays of a packet of variable size are oc‐
44 cluded by a user-defined primitive. The callback function of type RT‐
45 COccludedFunctionN gets passed a number of arguments through the RTCOc‐
46 cludedFunctionNArguments structure. The value N specifies the ray
47 packet size, valid points to an array of integers which specify whether
48 the corresponding ray is valid (-1) or invalid (0), the geometryUserPtr
49 member points to the geometry user data previously set through rtcSet‐
50 GeometryUserData, the context member points to the intersection context
51 passed to the ray query, the ray member points to a ray packet of vari‐
52 able size N, and the geomID and primID member identifies the geometry
53 ID and primitive ID of the primitive to intersect.
54
55 The task of the callback function is to intersect each active ray from
56 the ray packet with the specified user primitive. If the user-defined
57 primitive is missed by a ray of the ray packet, the function should re‐
58 turn without modifying the ray. If an intersection of the user-defined
59 primitive with the ray was found in the valid range (from tnear to
60 tfar), it should set the tfar member of the ray to -inf.
61
62 As a primitive might have multiple intersections with a ray, the occlu‐
63 sion filter function needs to be invoked by the user geometry occlusion
64 callback for each encountered intersection, if filtering of intersec‐
65 tions is desired. This can be achieved through the rtcFilterOcclusion
66 call.
67
68 Within the user geometry occlusion function, it is safe to trace new
69 rays and create new scenes and geometries.
70
71 EXIT STATUS
72 On failure an error code is set that can be queried using rtcGetDe‐
73 viceError.
74
75 SEE ALSO
76 [rtcSetGeometryIntersectFunction], [rtcSetGeometryUserData], [rtcFilte‐
77 rOcclusion]
78
79
80
81 rtcSetGeometryOccludedFunction(3)