rtcNewGeometry(3)
π rtcNewGeometry β the glow-up page for Embree Ray Tracing Kernels 3 π
okay so bestie, welcome to the rtcNewGeometry(3) manual page, but make it cute. this one lives in the Embree Ray Tracing Kernels 3 family and it's literally the "birth a geometry" call. let's get into it π«Ά
β¨ NAME β¨
rtcNewGeometry β creates a new geometry object. that's it, that's the whole job, and she does it flawlessly π
β¨ SYNOPSIS β¨
#include <embree3/rtcore.h>
enum RTCGeometryType
{
RTC_GEOMETRY_TYPE_TRIANGLE,
RTC_GEOMETRY_TYPE_QUAD,
RTC_GEOMETRY_TYPE_SUBDIVISION,
RTC_GEOMETRY_TYPE_FLAT_LINEAR_CURVE,
RTC_GEOMETRY_TYPE_FLAT_BEZIER_CURVE,
RTC_GEOMETRY_TYPE_FLAT_BSPLINE_CURVE,
RTC_GEOMETRY_TYPE_FLAT_HERMITE_CURVE,
RTC_GEOMETRY_TYPE_FLAT_CATMULL_ROM_CURVE,
RTC_GEOMETRY_TYPE_NORMAL_ORIENTED_BEZIER_CURVE,
RTC_GEOMETRY_TYPE_NORMAL_ORIENTED_BSPLINE_CURVE,
RTC_GEOMETRY_TYPE_NORMAL_ORIENTED_HERMITE_CURVE,
RTC_GEOMETRY_TYPE_NORMAL_ORIENTED_CATMULL_ROM_CURVE,
RTC_GEOMETRY_TYPE_CONE_LINEAR_CURVE,
RTC_GEOMETRY_TYPE_ROUND_LINEAR_CURVE,
RTC_GEOMETRY_TYPE_ROUND_BEZIER_CURVE,
RTC_GEOMETRY_TYPE_ROUND_BSPLINE_CURVE,
RTC_GEOMETRY_TYPE_ROUND_HERMITE_CURVE,
RTC_GEOMETRY_TYPE_ROUND_CATMULL_ROM_CURVE,
RTC_GEOMETRY_TYPE_GRID,
RTC_GEOMETRY_TYPE_SPHERE_POINT,
RTC_GEOMETRY_TYPE_DISC_POINT,
RTC_GEOMETRY_TYPE_ORIENTED_DISC_POINT,
RTC_GEOMETRY_TYPE_USER,
RTC_GEOMETRY_TYPE_INSTANCE
};
RTCGeometry rtcNewGeometry(
RTCDevice device,
enum RTCGeometryType type
);
β¨ DESCRIPTION β¨
so like, geometries are objects that represent an array of primitives of the same type. same type only, no mixing, she's monogamous like that π
rtcNewGeometry creates a new geometry of the specified type (that's the type argument) bound to the specified device (that's the device argument), and it hands you back a handle to this geometry. π
the geometry object is reference counted with an initial reference count of 1. when you're done with it, release that handle using the rtcReleaseGeometry API call. don't ghost her, actually release her β¨
π supported geometry types (the whole roster, no skips)
- triangle meshes β type
RTC_GEOMETRY_TYPE_TRIANGLE - quad meshes (that's triangle pairs, iykyk) β type
RTC_GEOMETRY_TYPE_QUAD - Catmull-Clark subdivision surfaces β type
RTC_GEOMETRY_TYPE_SUBDIVISION - curve geometries with different bases β types
RTC_GEOMETRY_TYPE_FLAT_LINEAR_CURVE,RTC_GEOMETRY_TYPE_FLAT_BEZIER_CURVE,RTC_GEOMETRY_TYPE_FLAT_BSPLINE_CURVE,RTC_GEOMETRY_TYPE_FLAT_HERMITE_CURVE,RTC_GEOMETRY_TYPE_FLAT_CATMULL_ROM_CURVE,RTC_GEOMETRY_TYPE_NORMAL_ORIENTED_BEZIER_CURVE,RTC_GEOMETRY_TYPE_NORMAL_ORIENTED_BSPLINE_CURVE,RTC_GEOMETRY_TYPE_NORMAL_ORIENTED_HERMITE_CURVE,RTC_GEOMETRY_TYPE_NORMAL_ORIENTED_CATMULL_ROM_CURVE,RTC_GEOMETRY_TYPE_CONE_LINEAR_CURVE,RTC_GEOMETRY_TYPE_ROUND_LINEAR_CURVE,RTC_GEOMETRY_TYPE_ROUND_BEZIER_CURVE,RTC_GEOMETRY_TYPE_ROUND_BSPLINE_CURVE,RTC_GEOMETRY_TYPE_ROUND_HERMITE_CURVE,RTC_GEOMETRY_TYPE_ROUND_CATMULL_ROM_CURVE - grid meshes β type
RTC_GEOMETRY_TYPE_GRID - point geometries β types
RTC_GEOMETRY_TYPE_SPHERE_POINT,RTC_GEOMETRY_TYPE_DISC_POINT,RTC_TYPE_ORIENTED_DISC_POINT - user-defined geometries β type
RTC_GEOMETRY_TYPE_USER - instances β type
RTC_GEOMETRY_TYPE_INSTANCE
π¦ the curve lore (pay attention bestie)
the types RTC_GEOMETRY_TYPE_ROUND_BEZIER_CURVE, RTC_GEOMETRY_TYPE_ROUND_BSPLINE_CURVE, and RTC_GEOMETRY_TYPE_ROUND_CATMULL_ROM_CURVE will treat the curve as a sweep surface of a varying-radius circle swept tangentially along the curve. that's giving real geometry energy, no cap π
meanwhile RTC_GEOMETRY_TYPE_FLAT_BEZIER_CURVE, RTC_GEOMETRY_TYPE_FLAT_BSPLINE_CURVE, and RTC_GEOMETRY_TYPE_FLAT_CATMULL_ROM_CURVE use ray-facing ribbons as a faster-to-intersect approximation. faster, slightly less fancy, still slaying.
π life cycle stuff (enabled, attached, detached, assigned)
after construction, geometries are enabled by default and not attached to any scene. so she's awake but not in the group chat yet.
- geometries can be disabled β that's the
rtcDisableGeometrycall - and enabled again β that's the
rtcEnableGeometrycall
a geometry can be attached to multiple scenes using the rtcAttachGeometry call (or the rtcAttachGeometryByID call), and detached using the rtcDetachGeometry call.
during attachment, a geometry ID is assigned to the geometry (or assigned by the user when using the rtcAttachGeometryByID call), which uniquely identifies the geometry inside that scene. this identifier is returned when primitives of the geometry are hit in later ray queries for the scene. so like, that's how you know who got hit π
π modifying stuff
geometries can also be modified, including their vertex and index buffers. after modifying a buffer, rtcUpdateGeometryBuffer must be called to notify that the buffer got modified. must. she doesn't read minds, bestie.
the application can use the rtcSetGeometryUserData function to set a user data pointer to its own geometry representation, and later read out this pointer using the rtcGetGeometryUserData function. cute little pocket for your own stuff π
β committing + interpolating
after setting up the geometry or modifying it, rtcCommitGeometry must be called to finish the geometry setup. after committing the geometry, vertex data interpolation can be performed using the rtcInterpolate and rtcInterpolateN functions. commit first, interpolate second, that's the order, periodt β¨
π build quality
a build quality can be specified for a geometry using the rtcSetGeometryBuildQuality function, to balance between acceleration structure build performance and ray query performance.
the build quality per geometry will be used if a two-level acceleration structure is built internally, which is the case if the RTC_BUILD_QUALITY_LOW is set as the scene build quality. see Section [rtcSetSceneBuildQuality] for more details. go read that one, she's the source of truth π§
β¨ EXIT STATUS β¨
on failure NULL is returned and an error code is set that can be queried using rtcGetDeviceError. so if you get nothing back, go ask rtcGetDeviceError what went down π
lowkey always check the error code. NULL is not a vibe, it's a signal.
β¨ SEE ALSO β¨
[rtcEnableGeometry][rtcDisableGeometry][rtcAttachGeometry][rtcAttachGeometryByID][rtcUpdateGeometryBuffer][rtcSetGeometryUserData][rtcGetGeometryUserData][rtcCommitGeometry][rtcInterpolate][rtcInterpolateN][rtcSetGeometryBuildQuality][rtcSetSceneBuildQuality][RTC_GEOMETRY_TYPE_TRIANGLE][RTC_GEOMETRY_TYPE_QUAD][RTC_GEOMETRY_TYPE_SUBDIVISION][RTC_GEOMETRY_TYPE_CURVE][RTC_GEOMETRY_TYPE_GRID][RTC_GEOMETRY_TYPE_POINT][RTC_GEOMETRY_TYPE_USER][RTC_GEOMETRY_TYPE_INSTANCE]
and that's the whole page, bestie π this one came to you straight out of Embree Ray Tracing Kernels 3, filed under rtcNewGeometry(3), and yeah the date is whatever it says at the bottom of the original, she's timeless like that π
go make some geometries, you're gonna ate πΈπ¦
π¦ where this page comes from
- epel 9: embree 3.13.5-4.el9 Β· Apache-2.0
- fedora 43: embree3 3.13.5-9.fc41 Β· Apache-2.0
- fedora 44: embree3 3.13.5-16.fc44 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms