rtcSetGeo...diusScale(3)

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

✨ rtcSetGeometryMaxRadiusScale ✨

okay bestie, welcome to rtcSetGeo...diusScale(3) from the Embree Ray Tracing Kernels, version 3 πŸŽ€ β€” yes the title is abbreviated because the full name is a lot, and no we will not be shortening it in the actual text, sit down, hydrate, let's go πŸ’…


🌸 NAME 🌸

rtcSetGeometryMaxRadiusScale β€” assigns a maximal curve radius scale factor for the min-width feature ✨


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <embree3/rtcore.h>

void rtcSetGeometryMaxRadiusScale(RTCGeometry geometry, float maxRadiusScale);

πŸ’– DESCRIPTION πŸ’–

so the rtcSetMaxGeometryScale function specifies a maximal scaling factor for curve radii used by the min-width feature. that's it, that's the whole job, she's a one-trick pony and she's iconic for it πŸ‘‘

the min-width feature can increase the radius of curves and points β€” the whole point (hehe) is to reduce aliasing and improve render times. it is disabled by default tho, so you literally have to go enable it yourself using the EMBREE_MIN_WIDTH cmake option. no cap, she will not turn herself on πŸ™ˆ

to actually use the feature, you have to specify a maximal curve radius scaling factor using the rtcSetGeometryMaxRadiusScale function. this factor should be a small number (e.g. 4) β€” because the constructed BVH bounds get increased in order to bound the curve in the worst case of maximal radii. big factor = big bounds = big sad 😭

you also have to set the minWidthDistanceFactor in the RTCIntersectContext when tracing a ray. this factor controls the target radius size of a curve or point at some distance away from the ray origin. it's giving "how fat should this thing look from over here" 🫢

so, for each control point p with radius r of a curve or point primitive, the primitive intersectors first calculate a target radius r' as:

r' = length(p-ray_org) * minWidthDistanceFactor

typically the minWidthDistanceFactor is set by the application such that the target radius projects to the width of half a pixel (thus primitive diameter is pixel sized). half a pixel. the drama. the precision. obsessed ⭐

the target radius r' is then clamped against the minimal bound r and the maximal bound maxRadiusScale*r to obtain the final radius r'':

r'' = max(r, min(r', maxRadiusScale*r))

so: curves or points close to the camera get rendered with normal radii r, and curves or points far from the camera are not enlarged too much β€” because that would be very expensive to render πŸ’€ your GPU does not deserve that.

and when the rtcSetGeometryMaxRadiusScale function is not invoked for a curve or point geometry (or if the maximal scaling factor is set to 1.0), then the curve or point geometry renders normally, with radii not modified by the min-width feature. business as usual, no notes 🌈


πŸ’… EXIT STATUS πŸ’…

on failure an error code is set that can be queried using rtcGetDeviceError. so like, check it. please. for me πŸ₯Ί


πŸ‘‘ SEE ALSO πŸ‘‘

  • rtcInitIntersectContext

okay that's the whole page bestie, you ate that, go forth and scale those radii responsibly πŸ’–

rtcSetGeo...diusScale(3) β€” from the Embree Ray Tracing Kernels, version 3, manual section 3. mwah, ily, bye πŸŽ€βœ¨πŸ¦‹

πŸ“¦ where this page comes from