RTCBufferType(3)
π RTCBufferType(3) π
okay so bestie, you know how we're deep in the Embree Ray Tracing Kernels 4 manual rn? yeah. this is the page about RTCBufferType, from the embree4/rtcore_ray.h era. pull up a chair, grab a strawberry π, we're doing enum lore today.
β¨ NAME β¨
RTCFormat β specifies format of data in buffers
(yes it says RTCFormat bestie, that's literally what the page says, I'm not gonna gaslight you about it π)
πΈ SYNOPSIS πΈ
#include <embree4/rtcore_ray.h>
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_TRANSFORM = 23,
RTC_BUFFER_TYPE_FLAGS = 32
};
look at those numbers. every single one is doing its job. no notes. π
π¦ DESCRIPTION π¦
so the RTBufferType structure (it's an enum, it's giving very much "I define the slots") is what you use to tell Embree which data buffer goes in which slot. you do that through these three API calls:
rtcSetGeometryBufferrtcSetSharedGeometryBufferrtcSetNewGeometryBuffer
for most geometry types, the RTC_BUFFER_TYPE_INDEX slot is the one you hand your index buffer to, and RTC_BUFFER_TYPE_VERTEX is the one that gets the matching vertex buffer. they're a package deal, fr fr. π«Ά
π the extra vertex data one π
RTC_BUFFER_TYPE_VERTEX_ATTRIBUTE β this slot is for assigning arbitrary additional vertex data, and the glow-up is that it can get interpolated using the rtcInterpolate API call. so like. custom per-vertex vibes that you can smoothly blend. iconic.
π§ the curve buffers π§
RTC_BUFFER_TYPE_NORMAL, RTC_BUFFER_TYPE_TANGENT, and RTC_BUFFER_TYPE_NORMAL_DERIVATIVE are the special buffers you need in order to assign per-vertex normals, tangents, and normal derivatives for some curve types.
β οΈ note the "some curve types" bestie β not all of them. read the curve page, don't @ me.
π grid geometry π
RTC_BUFFER_TYPE_GRID is the slot you use to assign the grid primitive buffer for grid geometries. see RTC_GEOMETRY_TYPE_GRID for the full tea. β¨
π subdivision mesh squad π
these seven are the special buffers you need to create subdivision meshes (see RTC_GEOMETRY_TYPE_SUBDIVISION):
RTC_BUFFER_TYPE_FACERTC_BUFFER_TYPE_LEVELRTC_BUFFER_TYPE_EDGE_CREASE_INDEXRTC_BUFFER_TYPE_EDGE_CREASE_WEIGHTRTC_BUFFER_TYPE_VERTEX_CREASE_INDEXRTC_BUFFER_TYPE_VERTEX_CREASE_WEIGHTRTC_BUFFER_TYPE_HOLE
seven whole buffers. that's a whole friend group. no cap. π
π₯ instance arrays π₯
RTC_BUFFER_TYPE_TRANSFORM is the one that provides instance transformation information for instance array geometries (see RTC_GEOMETRY_TYPE_INSTANCE_ARRAY). so you're not transforming one thing, you're transforming the whole array. main character energy honestly.
β per-primitive flags β
RTC_BUFFER_TYPE_FLAGS lets you add an additional flag per primitive of a geometry, and β important detail, don't skip this β it is currently only used for linear curves.
π do not go slapping RTC_BUFFER_TYPE_FLAGS on your triangle mesh and expecting magic. it says linear curves. it means linear curves.
π EXIT STATUS π
...yeah this section is empty bestie. it's giving "the void". nothing to report. moving on. π«Ά
π SEE ALSO π
rtcSetGeometryBufferrtcSetSharedGeometryBufferrtcSetNewGeometryBuffer
okay that's the whole page!! you now know every single buffer slot Embree has, you ate that, periodt. π
this was RTCBufferType(3) from the Embree Ray Tracing Kernels 4 manual β go forth and assign buffers responsibly, bestie, and remember: the vibe is immaculate but the enum values are load-bearing. π¦β¨π
π¦ where this page comes from
- alpine 3.24: embree-doc 4.4.1-r0 Β· Apache-2.0
- arch rolling: embree 4.4.1-1 Β· Apache-2.0
- fedora 43: embree 4.4.1-1.fc43 Β· Apache-2.0
- fedora 44: embree 4.4.1-1.fc44 Β· Apache-2.0
- nixpkgs unstable: embree 4.4.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms