rtcSetSharedGeometryBuffer.3embree3 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. .TH "rtcSetSharedGeometryBuffer" "3" "" "" "Embree Ray Tracing Kernels 3"
  2. .SS NAME
  3. .IP
  4. .nf
  5. \f[C]
  6. rtcSetSharedGeometryBuffer\ \-\ assigns\ a\ view\ of\ a\ shared\ data\ buffer
  7. \ \ to\ a\ geometry
  8. \f[]
  9. .fi
  10. .SS SYNOPSIS
  11. .IP
  12. .nf
  13. \f[C]
  14. #include\ <embree3/rtcore.h>
  15. void\ rtcSetSharedGeometryBuffer(
  16. \ \ RTCGeometry\ geometry,
  17. \ \ enum\ RTCBufferType\ type,
  18. \ \ unsigned\ int\ slot,
  19. \ \ enum\ RTCFormat\ format,
  20. \ \ const\ void*\ ptr,
  21. \ \ size_t\ byteOffset,
  22. \ \ size_t\ byteStride,
  23. \ \ size_t\ itemCount
  24. );
  25. \f[]
  26. .fi
  27. .SS DESCRIPTION
  28. .PP
  29. The \f[C]rtcSetSharedGeometryBuffer\f[] function binds a view of a
  30. shared user\-managed data buffer (\f[C]ptr\f[] argument) to a geometry
  31. buffer type and slot (\f[C]type\f[] and \f[C]slot\f[] argument) of the
  32. specified geometry (\f[C]geometry\f[] argument).
  33. .PP
  34. One can specify the start of the first buffer element in bytes
  35. (\f[C]byteOffset\f[] argument), the byte stride between individual
  36. buffer elements (\f[C]byteStride\f[] argument), the format of the buffer
  37. elements (\f[C]format\f[] argument), and the number of elements to bind
  38. (\f[C]itemCount\f[]).
  39. .PP
  40. The start address (\f[C]byteOffset\f[] argument) and stride
  41. (\f[C]byteStride\f[] argument) must be both aligned to 4 bytes;
  42. otherwise the \f[C]rtcSetGeometryBuffer\f[] function will fail.
  43. .IP
  44. .nf
  45. \f[C]
  46. \f[]
  47. .fi
  48. .PP
  49. The buffer data must remain valid for as long as the buffer may be used,
  50. and the user is responsible for freeing the buffer data when no longer
  51. required.
  52. .PP
  53. Sharing buffers can significantly reduce the memory required by the
  54. application, thus we recommend using this feature.
  55. When enabling the \f[C]RTC_SCENE_COMPACT\f[] scene flag, the spatial
  56. index structures index into the vertex buffer, resulting in even higher
  57. memory savings.
  58. .SS EXIT STATUS
  59. .PP
  60. On failure an error code is set that can be queried using
  61. \f[C]rtcGetDeviceError\f[].
  62. .SS SEE ALSO
  63. .PP
  64. [rtcSetGeometryBuffer], [rtcSetNewGeometryBuffer]