rtcSetGeo...diusScale(3)
π rtcSetGeometryMaxRadiusScale π
okay bestie, welcome to the glow-up corner of the Embree Ray Tracing Kernels 4 manual, where we're talking about rtcSetGeo...diusScale(3) β yes that's the page name, the truncated vibe is intentional, iykyk π¦
β¨ NAME β¨
rtcSetGeometryMaxRadiusScale β assigns a maximal curve radius scale factor for min-width feature π
β¨ SYNOPSIS β¨
#include <embree4/rtcore.h>
void rtcSetGeometryMaxRadiusScale(RTCGeometry geometry, float maxRadiusScale);
β¨ DESCRIPTION β¨
so the rtcSetMaxGeometryScale function specifies a maximal scaling factor for curve radii that the min-width feature uses. no cap. πΈ
The min-width feature can literally increase the radius of curves and points, and the whole point of that is to reduce aliasing and improve render times. It is disabled by default tho π and you have to get it enabled using the EMBREE_MIN_WIDTH cmake option.
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 (like, e.g. 4) because the constructed BVH bounds get increased in order to bound the curve in the worst case of maximal radii. it's giving "cheap but safe" π
You also have to set the minWidthDistanceFactor in the RTCRayQueryContext when tracing a ray. This factor controls the target radius size of a curve or point at some distance away from the ray origin. periodt.
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 (so the primitive diameter is pixel sized). very main character energy of that pixel ngl β
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 the way that works out: curves or points close to the camera are 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. slay, we love a bounded budget π
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. iconic default behaviour fr fr π
β¨ EXIT STATUS β¨
On failure an error code is set that can be queried using rtcGetDeviceError. so if something goes sideways, that's where you go looking π₯
β¨ SEE ALSO β¨
[rtcInitRayQueryContext]
and that's the whole page bestie, go forth and scale those radii responsibly πβ¨
this was rtcSetGeo...diusScale(3) from the Embree Ray Tracing Kernels 4 manual β same title, same vibe upgrade, no details harmed in the making of this glow-up π«Άπ
π¦ where this page comes from
- ubuntu stonking: libembree-dev 4.4.1+dfsg-2ubuntu1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms