RTCFeatureFlags(3)
โจ NAME โจ
RTCFeatureFlags โ it's the enum that says which ray-tracing features you're enabling, bestie ๐
This one lives in the Embree Ray Tracing Kernels 4 manual, section 3, and it's giving "pick your features, queen" energy ๐
๐ SYNOPSIS ๐
#include <embree4/rtcore_ray.h>
enum RTCFeatureFlags
{
RTC_FEATURE_FLAG_NONE = 0,
RTC_FEATURE_FLAG_MOTION_BLUR = 1 << 0,
RTC_FEATURE_FLAG_TRIANGLE = 1 << 1,
RTC_FEATURE_FLAG_QUAD = 1 << 2,
RTC_FEATURE_FLAG_GRID = 1 << 3,
RTC_FEATURE_FLAG_SUBDIVISION = 1 << 4,
RTC_FEATURE_FLAG_POINT = ... ,
RTC_FEATURE_FLAG_CURVES = ... ,
RTC_FEATURE_FLAG_CONE_LINEAR_CURVE = 1 << 5,
RTC_FEATURE_FLAG_ROUND_LINEAR_CURVE = 1 << 6,
RTC_FEATURE_FLAG_FLAT_LINEAR_CURVE = 1 << 7,
RTC_FEATURE_FLAG_ROUND_BEZIER_CURVE = 1 << 8,
RTC_FEATURE_FLAG_FLAT_BEZIER_CURVE = 1 << 9,
RTC_FEATURE_FLAG_NORMAL_ORIENTED_BEZIER_CURVE = 1 << 10,
RTC_FEATURE_FLAG_ROUND_BSPLINE_CURVE = 1 << 11,
RTC_FEATURE_FLAG_FLAT_BSPLINE_CURVE = 1 << 12,
RTC_FEATURE_FLAG_NORMAL_ORIENTED_BSPLINE_CURVE = 1 << 13,
RTC_FEATURE_FLAG_ROUND_HERMITE_CURVE = 1 << 14,
RTC_FEATURE_FLAG_FLAT_HERMITE_CURVE = 1 << 15,
RTC_FEATURE_FLAG_NORMAL_ORIENTED_HERMITE_CURVE = 1 << 16,
RTC_FEATURE_FLAG_ROUND_CATMULL_ROM_CURVE = 1 << 17,
RTC_FEATURE_FLAG_FLAT_CATMULL_ROM_CURVE = 1 << 18,
RTC_FEATURE_FLAG_NORMAL_ORIENTED_CATMULL_ROM_CURVE = 1 << 19,
RTC_FEATURE_FLAG_SPHERE_POINT = 1 << 20,
RTC_FEATURE_FLAG_DISC_POINT = 1 << 21,
RTC_FEATURE_FLAG_ORIENTED_DISC_POINT = 1 << 22,
RTC_FEATURE_FLAG_ROUND_CURVES = ... ,
RTC_FEATURE_FLAG_FLAT_CURVES = ... ,
RTC_FEATURE_FLAG_NORMAL_ORIENTED_CURVES = ... ,
RTC_FEATURE_FLAG_LINEAR_CURVES = ... ,
RTC_FEATURE_FLAG_BEZIER_CURVES = ... ,
RTC_FEATURE_FLAG_BSPLINE_CURVES = ... ,
RTC_FEATURE_FLAG_HERMITE_CURVES = ... ,
RTC_FEATURE_FLAG_INSTANCE = 1 << 23,
RTC_FEATURE_FLAG_FILTER_FUNCTION_IN_ARGUMENTS = 1 << 24,
RTC_FEATURE_FLAG_FILTER_FUNCTION_IN_GEOMETRY = 1 << 25,
RTC_FEATURE_FLAG_FILTER_FUNCTION = ... ,
RTC_FEATURE_FLAG_USER_GEOMETRY_CALLBACK_IN_ARGUMENTS = 1 << 26,
RTC_FEATURE_FLAG_USER_GEOMETRY_CALLBACK_IN_GEOMETRY = 1 << 27,
RTC_FEATURE_FLAG_USER_GEOMETRY = ... ,
RTC_FEATURE_FLAG_32_BIT_RAY_MASK = 1 << 28,
RTC_FEATURE_FLAG_ALL = 0xffffffff
};
๐ธ DESCRIPTION ๐ธ
okay so. RTCFeatureFlags is an enum that's literally just a bit mask, and its whole job is to turn specific ray tracing features on for ray query operations โจ You hand these feature flags over to the rtcIntersect1/4/8/16 and rtcOccluded1/4/8/16 functions, passing them through the RTCIntersectArguments and RTCOccludedArguments structures ๐ซถ
The rule is simple, bestie: only a ray tracing feature whose bit is enabled in the feature mask can get used ๐
And if a feature bit is NOT set? The behaviour is undefined. Not "it fails politely," not "it errors out" โ undefined. So the feature may work or it may not. It's giving chaos ๐
If you want multiple features, you combine them with a bitwise OR operation. That's it, that's the whole trick ๐ฅ
Why does this exist, though? The purpose of feature flags is to reduce code size on the GPU by enabling just the features you actually need to render your scene ๐ On the CPU there's genuinely no need to use feature flags at all, and you can just keep the default of all features enabled (RTC_FEATURE_FLAG_ALL). Slay, no notes ๐
Here's every feature you can switch on, one by one ๐
RTC_FEATURE_FLAG_MOTION_BLURโ turns on motion blur for all geometry types ๐ซRTC_FEATURE_FLAG_TRIANGLEโ turns on triangle geometries (RTC_GEOMETRY_TYPE_TRIANGLE) ๐บRTC_FEATURE_FLAG_QUADโ turns on quad geometries (RTC_GEOMETRY_TYPE_QUAD) ๐ทRTC_FEATURE_FLAG_GRIDโ turns on grid geometries (RTC_GEOMETRY_TYPE_GRID) ๐ธ๏ธRTC_FEATURE_FLAG_SUBDIVISIONโ turns on subdivision geometries (RTC_GEOMETRY_TYPE_SUBDIVISION) ๐งRTC_FEATURE_FLAG_POINTโ turns on all point geometry types (RTC_GEOMETRY_TYPE_XXX_POINT) ๐RTC_FEATURE_FLAG_CURVESโ turns on all curve geometry types (RTC_GEOMETRY_TYPE_XXX_YYY_CURVE) ๐ฆRTC_FEATURE_FLAG_ROUND_CURVESโ turns on all round curves (RTC_GEOMETRY_TYPE_ROUND_XXX_CURVE) ๐ธRTC_FEATURE_FLAG_FLAT_CURVESโ turns on all flat curves (RTC_GEOMETRY_TYPE_FLAT_XXX_CURVE) ๐RTC_FEATURE_FLAG_NORMAL_ORIENTED_CURVESโ turns on all normal oriented curves (RTC_GEOMETRY_TYPE_NORMAL_ORIENTED_XXX_CURVE) ๐งญRTC_FEATURE_FLAG_LINEAR_CURVESโ turns on all linear curves (RTC_GEOMETRY_TYPE_XXX_LINEAR_CURVE) ๐RTC_FEATURE_FLAG_BEZIER_CURVESโ turns on all Bรฉzier curves (RTC_GEOMETRY_TYPE_XXX_BEZIER_CURVE) โจRTC_FEATURE_FLAG_BSPLINE_CURVESโ turns on all B-spline curves (RTC_GEOMETRY_TYPE_XXX_BSPLINE_CURVE) ๐RTC_FEATURE_FLAG_HERMITE_CURVESโ turns on all Hermite curves (RTC_GEOMETRY_TYPE_XXX_HERMITE_CURVE) ๐ฟRTC_FEATURE_FLAG_CONE_LINEAR_CURVEโ turns on the cone geometry type (RTC_GEOMETRY_TYPE_CONE_LINEAR_CURVE) ๐ฆRTC_FEATURE_FLAG_ROUND_LINEAR_CURVEโ turns on round linear curves (RTC_GEOMETRY_TYPE_ROUND_LINEAR_CURVE) ๐RTC_FEATURE_FLAG_FLAT_LINEAR_CURVEโ turns on flat linear curves (RTC_GEOMETRY_TYPE_FLAT_LINEAR_CURVE) ๐RTC_FEATURE_FLAG_ROUND_BEZIER_CURVEโ turns on round Bรฉzier curves (RTC_GEOMETRY_TYPE_ROUND_BEZIER_CURVE) ๐RTC_FEATURE_FLAG_FLAT_BEZIER_CURVEโ turns on flat Bรฉzier curves (RTC_GEOMETRY_TYPE_FLAT_BEZIER_CURVE) ๐จRTC_FEATURE_FLAG_NORMAL_ORIENTED_BEZIER_CURVEโ turns on normal oriented Bรฉzier curves (RTC_GEOMETRY_TYPE_NORMAL_ORIENTED_BEZIER_CURVE) ๐งญRTC_FEATURE_FLAG_ROUND_BSPLINE_CURVEโ turns on round B-spline curves (RTC_GEOMETRY_TYPE_ROUND_BSPLINE_CURVE) ๐RTC_FEATURE_FLAG_FLAT_BSPLINE_CURVEโ turns on flat B-spline curves (RTC_GEOMETRY_TYPE_FLAT_BSPLINE_CURVE) ๐RTC_FEATURE_FLAG_NORMAL_ORIENTED_BSPLINE_CURVEโ turns on normal oriented B-spline curves (RTC_GEOMETRY_TYPE_NORMAL_ORIENTED_BSPLINE_CURVE) ๐งญRTC_FEATURE_FLAG_ROUND_HERMITE_CURVEโ turns on round Hermite curves (RTC_GEOMETRY_TYPE_ROUND_HERMITE_CURVE) ๐ซRTC_FEATURE_FLAG_FLAT_HERMITE_CURVEโ turns on flat Hermite curves (RTC_GEOMETRY_TYPE_FLAT_HERMITE_CURVE) ๐RTC_FEATURE_FLAG_NORMAL_ORIENTED_HERMITE_CURVEโ turns on normal oriented Hermite curves (RTC_GEOMETRY_TYPE_NORMAL_ORIENTED_HERMITE_CURVE) ๐งญRTC_FEATURE_FLAG_ROUND_CATMULL_ROM_CURVEโ turns on round Catmull Rom curves (RTC_GEOMETRY_TYPE_ROUND_CATMULL_ROM_CURVE) ๐RTC_FEATURE_FLAG_FLAT_CATMULL_ROM_CURVEโ turns on flat Catmull Rom curves (RTC_GEOMETRY_TYPE_FLAT_CATMULL_ROM_CURVE) ๐งตRTC_FEATURE_FLAG_NORMAL_ORIENTED_CATMULL_ROM_CURVEโ turns on normal oriented Catmull Rom curves (RTC_GEOMETRY_TYPE_NORMAL_ORIENTED_CATMULL_ROM_CURVE) ๐งญRTC_FEATURE_FLAG_SPHERE_POINTโ turns on the sphere geometry type (RTC_GEOMETRY_TYPE_SPHERE_POINT) ๐ฎRTC_FEATURE_FLAG_DISC_POINTโ turns on the disc geometry type (RTC_GEOMETRY_TYPE_DISC_POINT) ๐ฟRTC_FEATURE_FLAG_ORIENTED_DISC_POINTโ turns on oriented disc geometry types (RTC_GEOMETRY_TYPE_ORIENTED_DISC_POINT) ๐ชฉRTC_FEATURE_FLAG_INSTANCEโ turns on instance geometries (RTC_GEOMETRY_TYPE_INSTANCE) ๐ชRTC_FEATURE_FLAG_FILTER_FUNCTION_IN_ARGUMENTSโ turns on filter functions passed through intersect arguments ๐ซงRTC_FEATURE_FLAG_FILTER_FUNCTION_IN_GEOMETRYโ turns on filter functions passed through geometry ๐ซงRTC_FEATURE_FLAG_FILTER_FUNCTIONโ turns on filter functions (both the argument version and the geometry version) ๐ซงRTC_FEATURE_FLAG_USER_GEOMETRY_CALLBACK_IN_ARGUMENTSโ turns onRTC_GEOMETRY_TYPE_USERwith the function pointer passed through intersect arguments ๐งRTC_FEATURE_FLAG_USER_GEOMETRY_CALLBACK_IN_GEOMETRYโ turns onRTC_GEOMETRY_TYPE_USERwith the function pointer passed through the geometry object ๐งRTC_FEATURE_FLAG_USER_GEOMETRYโ turns onRTC_GEOMETRY_TYPE_USERgeometries (both the argument callback version and the geometry callback version) ๐งRTC_FEATURE_FLAG_32_BIT_RAY_MASKโ turns on full 32 bit ray masks. If you don't use this one, only the lower 7 bits in the ray mask are handled correctly โ ๏ธRTC_FEATURE_FLAG_ALLโ turns on all the features (this is the default) ๐
๐ EXIT STATUS ๐
crickets. Bestie there is literally nothing in this section. Not a single exit status. It's giving empty group chat at 3am ๐ญ Moving on ๐
๐ซถ SEE ALSO ๐ซถ
rtcIntersect1rtcIntersect4/8/16rtcOccluded1rtcOccluded4/8/16
and that's the whole page, babe ๐ It came from the Embree Ray Tracing Kernels 4 docs and it's filed under RTCFeatureFlags(3) โ go enable exactly the features you need, keep RTC_FEATURE_FLAG_ALL on the CPU, and remember: unset bits are undefined behaviour, so don't play with that. periodt ๐โจ
๐ฆ 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