rtcSetGeo...diusScale(3)
β¨ 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
- 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