.\" Automatically generated by Pandoc 2.5
.\"
.TH "rtcInterpolate" "3" "" "" "Embree Ray Tracing Kernels 3"
.hy
.SS NAME
.IP
.nf
\f[C]
rtcInterpolate \- interpolates vertex attributes
\f[R]
.fi
.SS SYNOPSIS
.IP
.nf
\f[C]
#include <embree3/rtcore.h>

struct RTCInterpolateArguments
{
  RTCGeometry geometry;
  unsigned int primID;
  float u;
  float v;
  enum RTCBufferType bufferType;
  unsigned int bufferSlot;
  float* P;
  float* dPdu;
  float* dPdv;
  float* ddPdudu;
  float* ddPdvdv;
  float* ddPdudv;
  unsigned int valueCount;
};

void rtcInterpolate(
  const struct RTCInterpolateArguments* args
);
\f[R]
.fi
.SS DESCRIPTION
.PP
The \f[C]rtcInterpolate\f[R] function smoothly interpolates per\-vertex
data over the geometry.
This interpolation is supported for triangle meshes, quad meshes, curve
geometries, and subdivision geometries.
Apart from interpolating the vertex attribute itself, it is also
possible to get the first and second order derivatives of that value.
This interpolation ignores displacements of subdivision surfaces and
always interpolates the underlying base surface.
.PP
The \f[C]rtcInterpolate\f[R] call gets passed a number of arguments
inside a structure of type \f[C]RTCInterpolateArguments\f[R].
For some geometry (\f[C]geometry\f[R] parameter) this function smoothly
interpolates the per\-vertex data stored inside the specified geometry
buffer (\f[C]bufferType\f[R] and \f[C]bufferSlot\f[R] parameters) to the
u/v location (\f[C]u\f[R] and \f[C]v\f[R] parameters) of the primitive
(\f[C]primID\f[R] parameter).
The number of floating point values to interpolate and store to the
destination arrays can be specified using the \f[C]valueCount\f[R]
parameter.
As interpolation buffer, one can specify vertex buffers
(\f[C]RTC_BUFFER_TYPE_VERTEX\f[R]) and vertex attribute buffers
(\f[C]RTC_BUFFER_TYPE_VERTEX_ATTRIBUTE\f[R]) as well.
.PP
The \f[C]rtcInterpolate\f[R] call stores \f[C]valueCount\f[R] number of
interpolated floating point values to the memory location pointed to by
\f[C]P\f[R].
One can avoid storing the interpolated value by setting \f[C]P\f[R] to
\f[C]NULL\f[R].
.PP
The first order derivative of the interpolation by u and v are stored at
the \f[C]dPdu\f[R] and \f[C]dPdv\f[R] memory locations.
One can avoid storing first order derivatives by setting both
\f[C]dPdu\f[R] and \f[C]dPdv\f[R] to \f[C]NULL\f[R].
.PP
The second order derivatives are stored at the \f[C]ddPdudu\f[R],
\f[C]ddPdvdv\f[R], and \f[C]ddPdudv\f[R] memory locations.
One can avoid storing second order derivatives by setting these three
pointers to \f[C]NULL\f[R].
.PP
To use \f[C]rtcInterpolate\f[R] for a geometry, all changes to that
geometry must be properly committed using \f[C]rtcCommitGeometry\f[R].
.PP
All input buffers and output arrays must be padded to 16 bytes, as the
implementation uses 16\-byte SSE instructions to read and write into
these buffers.
.PP
See tutorial [Interpolation] for an example of using the
\f[C]rtcInterpolate\f[R] function.
.SS EXIT STATUS
.PP
For performance reasons this function does not do any error checks, thus
will not set any error flags on failure.
.SS SEE ALSO
.PP
[rtcInterpolateN]
