.\" Automatically generated by Pandoc 2.5
.\"
.TH "rtcSetGeometryMaxRadiusScale" "3" "" "" "Embree Ray Tracing Kernels 3"
.hy
.SS NAME
.IP
.nf
\f[C]
rtcSetGeometryMaxRadiusScale \- assigns a maximal curve radius scale factor for min\-width feature
\f[R]
.fi
.SS SYNOPSIS
.IP
.nf
\f[C]
#include <embree3/rtcore.h>

void rtcSetGeometryMaxRadiusScale(RTCGeometry geometry, float maxRadiusScale);
\f[R]
.fi
.SS DESCRIPTION
.PP
The \f[C]rtcSetMaxGeometryScale\f[R] function specifies a maximal
scaling factor for curve radii used by the min\-width feature.
.PP
The min\-width feature can increase the radius of curves and points, in
order to reduce aliasing and improve render times.
The feature is disabled by default and has to get enabled using the
EMBREE_MIN_WIDTH cmake option.
.PP
To use the feature, one has to specify a maximal curve radius scaling
factor using the [rtcSetGeometryMaxRadiusScale] function.
This factor should be a small number (e.g.\ 4) as the constructed BVH
bounds get increased in order to bound the curve in the worst case of
maximal radii.
.PP
One also has 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 of the ray origin.
.PP
For each control point p with radius r of a curve or point primitive,
the primitive intersectors first calculate a target radius r\[cq] as:
.IP
.nf
\f[C]
r\[aq] = length(p\-ray_org) * minWidthDistanceFactor
\f[R]
.fi
.PP
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).
.PP
The target radius r\[cq] is then clamped against the minimal bound r and
maximal bound maxRadiusScale*r to obtain the final radius r\[cq]\[cq]:
.IP
.nf
\f[C]
r\[aq]\[aq] = max(r, min(r\[aq], maxRadiusScale*r))
\f[R]
.fi
.PP
Thus curves or points close to the camera are rendered with a normal
radii r, and curves or points far from the camera are not enlarged too
much, as this would be very expensive to render.
.PP
When \f[C]rtcSetGeometryMaxRadiusScale\f[R] 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.
.SS EXIT STATUS
.PP
On failure an error code is set that can be queried using
\f[C]rtcGetDeviceError\f[R].
.SS SEE ALSO
.PP
[rtcInitIntersectContext]
