rtcSetGeometryOccludedFunction.3embree3 3.1 KB

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