RTCBufferType(3)

πŸ“¦ version 3.13.5, in epel 9, fedora 43, fedora 44

πŸ’… RTCBufferType(3) β€” bestie's guide to buffer slots ✨

okay so real talk, this whole page is about RTCBufferType, and it's from the Embree Ray Tracing Kernels 3 era, so if you're out here doing ray tracing in Embree you're literally in the right place 🫢


🌸 NAME 🌸

RTCFormat β€” it specifies the format of data in buffers. that's the whole job. icon behaviour honestly πŸ’…


✨ SYNOPSIS ✨

first, you gotta invite the header in:

#include <embree3/rtcore_ray.h>

then boom, here's the enum, copy it exactly bestie, do not freestyle:

enum RTCBufferType
{
  RTC_BUFFER_TYPE_INDEX            = 0,
  RTC_BUFFER_TYPE_VERTEX           = 1,
  RTC_BUFFER_TYPE_VERTEX_ATTRIBUTE = 2,
  RTC_BUFFER_TYPE_NORMAL           = 3,
  RTC_BUFFER_TYPE_TANGENT          = 4,
  RTC_BUFFER_TYPE_NORMAL_DERIVATIVE = 5,

  RTC_BUFFER_TYPE_GRID                 = 8,

  RTC_BUFFER_TYPE_FACE                 = 16,
  RTC_BUFFER_TYPE_LEVEL                = 17,
  RTC_BUFFER_TYPE_EDGE_CREASE_INDEX    = 18,
  RTC_BUFFER_TYPE_EDGE_CREASE_WEIGHT   = 19,
  RTC_BUFFER_TYPE_VERTEX_CREASE_INDEX  = 20,
  RTC_BUFFER_TYPE_VERTEX_CREASE_WEIGHT = 21,
  RTC_BUFFER_TYPE_HOLE                 = 22,

  RTC_BUFFER_TYPE_FLAGS = 32
};

πŸ¦‹ DESCRIPTION πŸ¦‹

so the RTBufferType structure (yes, the page title says RTCBufferType, we love a little ✨mystery✨) defines the slots you assign data buffers to. you do that through the rtcSetGeometryBuffer, rtcSetSharedGeometryBuffer, and rtcSetNewGeometryBuffer API calls. those three are your ride-or-dies for getting buffers in place, no cap πŸ”₯

for most geometry types you're gonna use the RTC_BUFFER_TYPE_INDEX slot to assign an index buffer, and RTC_BUFFER_TYPE_VERTEX to assign the matching vertex buffer. like, that's the classic combo, the peanut butter and jelly of geometry setup πŸ₯ͺ

the RTC_BUFFER_TYPE_VERTEX_ATTRIBUTE slot can get used to assign arbitrary additional vertex data, and that data can get interpolated using the rtcInterpolate API call. so if you ever wanted extra per-vertex vibes, this is the slot for it πŸ’–

then there's RTC_BUFFER_TYPE_NORMAL, RTC_BUFFER_TYPE_TANGENT, and RTC_BUFFER_TYPE_NORMAL_DERIVATIVE β€” these are special buffers that you need to assign per vertex normals, tangents, and normal derivatives for some curve types. not all of them! some. iykyk 🌈

the RTC_BUFFER_TYPE_GRID buffer is what you use to assign the grid primitive buffer for grid geometries β€” go peek at RTC_GEOMETRY_TYPE_GRID for that whole situation πŸ‘‘

and for subdivision meshes (see RTC_GEOMETRY_TYPE_SUBDIVISION), you've got a whole lil squad of special buffers you need:

  • RTC_BUFFER_TYPE_FACE
  • RTC_BUFFER_TYPE_LEVEL
  • RTC_BUFFER_TYPE_EDGE_CREASE_INDEX
  • RTC_BUFFER_TYPE_EDGE_CREASE_WEIGHT
  • RTC_BUFFER_TYPE_VERTEX_CREASE_INDEX
  • RTC_BUFFER_TYPE_VERTEX_CREASE_WEIGHT
  • RTC_BUFFER_TYPE_HOLE

that's the full lineup, seven of them, all required, all iconic πŸ’œ

last one: RTC_BUFFER_TYPE_FLAGS can get used to add an additional flag per primitive of a geometry, and it's currently only used for linear curves. that's it, that's the whole lore πŸ“


πŸ’€ EXIT STATUS πŸ’€

literally nothing here bestie. the section exists and it's giving empty. we move on πŸ™ˆ


πŸŽ€ SEE ALSO πŸŽ€

  • rtcSetGeometryBuffer
  • rtcSetSharedGeometryBuffer
  • rtcSetNewGeometryBuffer

and that's the page!! 🧚 this was RTCBufferType(3) from Embree Ray Tracing Kernels 3 β€” go set some buffers, slay, and remember: every flag, every slot, every number stayed exactly where it was, periodt πŸ’…βœ¨

πŸ“¦ where this page comes from