rtcNewGeometry.3embree3 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. .TH "rtcNewGeometry" "3" "" "" "Embree Ray Tracing Kernels 3"
  2. .SS NAME
  3. .IP
  4. .nf
  5. \f[C]
  6. rtcNewGeometry\ \-\ creates\ a\ new\ geometry\ object
  7. \f[]
  8. .fi
  9. .SS SYNOPSIS
  10. .IP
  11. .nf
  12. \f[C]
  13. #include\ <embree3/rtcore.h>
  14. enum\ RTCGeometryType
  15. {
  16. \ RTC_GEOMETRY_TYPE_TRIANGLE,
  17. \ RTC_GEOMETRY_TYPE_QUAD,
  18. \ RTC_GEOMETRY_TYPE_SUBDIVISION,
  19. \ RTC_GEOMETRY_TYPE_FLAT_LINEAR_CURVE,
  20. \ RTC_GEOMETRY_TYPE_ROUND_BEZIER_CURVE,
  21. \ RTC_GEOMETRY_TYPE_FLAT_BEZIER_CURVE,
  22. \ RTC_GEOMETRY_TYPE_ROUND_BSPLINE_CURVE,
  23. \ RTC_GEOMETRY_TYPE_FLAT_BSPLINE_CURVE,
  24. \ RTC_GEOMETRY_TYPE_NORMAL_ORIENTED_BEZIER_CURVE,
  25. \ RTC_GEOMETRY_TYPE_NORMAL_ORIENTED_BSPLINE_CURVE,
  26. \ RTC_GEOMETRY_TYPE_GRID,
  27. \ RTC_GEOMETRY_TYPE_SPHERE_POINT,
  28. \ RTC_GEOMETRY_TYPE_DISC_POINT,
  29. \ RTC_GEOMETRY_TYPE_ORIENTED_DISC_POINT,
  30. \ RTC_GEOMETRY_TYPE_USER,
  31. \ RTC_GEOMETRY_TYPE_INSTANCE
  32. };
  33. RTCGeometry\ rtcNewGeometry(
  34. \ \ RTCDevice\ device,
  35. \ \ enum\ RTCGeometryType\ type
  36. );
  37. \f[]
  38. .fi
  39. .SS DESCRIPTION
  40. .PP
  41. Geometries are objects that represent an array of primitives of the same
  42. type.
  43. The \f[C]rtcNewGeometry\f[] function creates a new geometry of specified
  44. type (\f[C]type\f[] argument) bound to the specified device
  45. (\f[C]device\f[] argument) and returns a handle to this geometry.
  46. The geometry object is reference counted with an initial reference count
  47. of 1.
  48. The geometry handle can be released using the
  49. \f[C]rtcReleaseGeometry\f[] API call.
  50. .PP
  51. Supported geometry types are triangle meshes
  52. (\f[C]RTC_GEOMETRY_TYPE_TRIANGLE\f[] type), quad meshes (triangle pairs)
  53. (\f[C]RTC_GEOMETRY_TYPE_QUAD\f[] type), Catmull\-Clark subdivision
  54. surfaces (\f[C]RTC_GEOMETRY_TYPE_SUBDIVISION\f[] type), curve geometries
  55. with different bases (\f[C]RTC_GEOMETRY_TYPE_FLAT_LINEAR_CURVE\f[],
  56. \f[C]RTC_GEOMETRY_TYPE_ROUND_BEZIER_CURVE\f[],
  57. \f[C]RTC_GEOMETRY_TYPE_FLAT_BEZIER_CURVE\f[],
  58. \f[C]RTC_GEOMETRY_TYPE_ROUND_BSPLINE_CURVE\f[],
  59. \f[C]RTC_GEOMETRY_TYPE_FLAT_BSPLINE_CURVE\f[],
  60. \f[C]RTC_GEOMETRY_TYPE_NORMAL_ORIENTED_BEZIER_CURVE\f[],
  61. \f[C]RTC_GEOMETRY_TYPE_NORMAL_ORIENTED_BSPLINE_CURVE\f[] types), grid
  62. meshes (\f[C]RTC_GEOMETRY_TYPE_GRID\f[]), point geometries
  63. (\f[C]RTC_GEOMETRY_TYPE_SPHERE_POINT\f[],
  64. \f[C]RTC_GEOMETRY_TYPE_DISC_POINT\f[],
  65. \f[C]RTC_TYPE_ORIENTED_DISC_POINT\f[]), user\-defined geometries
  66. (\f[C]RTC_GEOMETRY_TYPE_USER\f[]), and instances
  67. (\f[C]RTC_GEOMETRY_TYPE_INSTANCE\f[]).
  68. .PP
  69. The types \f[C]RTC_GEOMETRY_TYPE_ROUND_BEZIER_CURVE\f[] and
  70. \f[C]RTC_GEOMETRY_TYPE_ROUND_BSPLINE_CURVE\f[] will treat the curve as a
  71. sweep surface of a varying\-radius circle swept tangentially along the
  72. curve.
  73. The types \f[C]RTC_GEOMETRY_TYPE_FLAT_BEZIER_CURVE\f[] and
  74. \f[C]RTC_GEOMETRY_TYPE_FLAT_BSPLINE_CURVE\f[] use ray\-facing ribbons as
  75. a faster\-to\-intersect approximation.
  76. .PP
  77. After construction, geometries are enabled by default and not attached
  78. to any scene.
  79. Geometries can be disabled (\f[C]rtcDisableGeometry\f[] call), and
  80. enabled again (\f[C]rtcEnableGeometry\f[] call).
  81. A geometry can be attached to a single scene using the
  82. \f[C]rtcAttachGeometry\f[] call (or \f[C]rtcAttachGeometryByID\f[]
  83. call), and detached using the \f[C]rtcDetachGeometry\f[] call.
  84. During attachment, a geometry ID is assigned to the geometry (or
  85. assigned by the user when using the \f[C]rtcAttachGeometryByID\f[]
  86. call), which uniquely identifies the geometry inside that scene.
  87. This identifier is returned when primitives of the geometry are hit in
  88. later ray queries for the scene.
  89. .PP
  90. Geometries can also be modified, including their vertex and index
  91. buffers.
  92. After modifying a buffer, \f[C]rtcUpdateGeometryBuffer\f[] must be
  93. called to notify that the buffer got modified.
  94. .PP
  95. The application can use the \f[C]rtcSetGeometryUserData\f[] function to
  96. set a user data pointer to its own geometry representation, and later
  97. read out this pointer using the \f[C]rtcGetGeometryUserData\f[]
  98. function.
  99. .PP
  100. After setting up the geometry or modifying it,
  101. \f[C]rtcCommitGeometry\f[] must be called to finish the geometry setup.
  102. After committing the geometry, vertex data interpolation can be
  103. performed using the \f[C]rtcInterpolate\f[] and \f[C]rtcInterpolateN\f[]
  104. functions.
  105. .PP
  106. A build quality can be specified for a geometry using the
  107. \f[C]rtcSetGeometryBuildQuality\f[] function, to balance between
  108. acceleration structure build performance and ray query performance.
  109. The build quality per geometry will be used if a two\-level acceleration
  110. structure is built internally, which is the case if the
  111. \f[C]RTC_BUILD_QUALITY_LOW\f[] is set as the scene build quality.
  112. See Section [rtcSetSceneBuildQuality] for more details.
  113. .SS EXIT STATUS
  114. .PP
  115. On failure \f[C]NULL\f[] is returned and an error code is set that can
  116. be queried using \f[C]rtcGetDeviceError\f[].
  117. .SS SEE ALSO
  118. .PP
  119. [rtcEnableGeometry], [rtcDisableGeometry], [rtcAttachGeometry],
  120. [rtcAttachGeometryByID], [rtcUpdateGeometryBuffer],
  121. [rtcSetGeometryUserData], [rtcGetGeometryUserData], [rtcCommitGeometry],
  122. [rtcInterpolate], [rtcInterpolateN], [rtcSetGeometryBuildQuality],
  123. [rtcSetSceneBuildQuality], [RTC_GEOMETRY_TYPE_TRIANGLE],
  124. [RTC_GEOMETRY_TYPE_QUAD], [RTC_GEOMETRY_TYPE_SUBDIVISION],
  125. [RTC_GEOMETRY_TYPE_CURVE], [RTC_GEOMETRY_TYPE_GRID],
  126. [RTC_GEOMETRY_TYPE_POINT], [RTC_GEOMETRY_TYPE_USER],
  127. [RTC_GEOMETRY_TYPE_INSTANCE]