RTCSETGEOMETRYSUBDIVISIONMODE(3embree3)

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

✨ rtcSetGeometrySubdivisionMode β€” Embree Ray Tracing Kernels 3 ✨

okay bestie, welcome to the Embree Ray Tracing Kernels 3 manual, section 3, and today's main character is rtcSetGeometrySubdivisionMode πŸ’… she's the one who decides how your subdivision geometry gets to behave at the edges, and honestly? iconic behavior.


πŸŽ€ NAME πŸŽ€

rtcSetGeometrySubdivisionMode β€” sets the subdivision mode of a subdivision geometry. that's it, that's the whole job, and she does it flawlessly 🫢


🌸 SYNOPSIS 🌸

#include <embree3/rtcore.h>

void rtcSetGeometrySubdivisionMode(
  RTCGeometry geometry,
  unsigned int topologyID,
  enum RTCSubdivisionMode mode
);

copy that exactly, no cap, don't freestyle the types πŸ™ˆ


πŸ’– DESCRIPTION πŸ’–

so the way this works: rtcSetGeometrySubdivisionMode sets the subdivision mode (that's the mode parameter, bestie) for the topology (that's topologyID) of the subdivision geometry you passed in (that's geometry). three params, one vibe, zero drama ✨

and like, why do you even care? because the subdivision modes let you force linear interpolation for certain parts of the subdivision mesh. it's giving "I want control over exactly where the smoothing happens" πŸ’…

here are your options, and yes you need to know all of them:

  • RTC_SUBDIVISION_MODE_NO_BOUNDARY β€” boundary patches get ignored. the whole point of this one is that each rendered patch ends up with a full set of control vertices. no boundary, no problem 🌈
  • RTC_SUBDIVISION_MODE_SMOOTH_BOUNDARY β€” the sequence of boundary control points gets used to generate a smooth B-spline boundary curve. this is the default mode, so if you never touch this function, this is what you're getting, periodt ✨
  • RTC_SUBDIVISION_MODE_PIN_CORNERS β€” corner vertices get pinned to their location during subdivision. they stay exactly where they are. they're not moving. they said no 🫢
  • RTC_SUBDIVISION_MODE_PIN_BOUNDARY β€” all the vertices at the border get pinned to their location during subdivision. this way the boundary is interpolated linearly. and ngl, this mode is typically used for texturing, so that texels at the border of the texture also map to the mesh. very much a texturing girlie move πŸŽ€
  • RTC_SUBDIVISION_MODE_PIN_ALL β€” all the vertices at the border get pinned to their location during subdivision, and this way all patches are linearly interpolated. everything. the whole mesh. no smoothing anywhere. she said linear and she meant it πŸ’€

πŸ¦‹ EXIT STATUS πŸ¦‹

if it fails, an error code gets set, and you can go query it with rtcGetDeviceError. so like, if something's off, that's where the receipts are πŸ”


πŸ‘‘ SEE ALSO πŸ‘‘

  • [RTC_GEOMETRY_TYPE_SUBDIVISION]

lowkey reminder: this page is rtcSetGeo...visionMode(3) from the Embree Ray Tracing Kernels 3 manual β€” that's the source, the version, the whole thing, and I'm signing off on it bestie 🫢✨ slay, go set some subdivision modes πŸ’–
πŸ“¦ where this page comes from