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