1rtcInterpolate(3) Embree Ray Tracing Kernels 3 rtcInterpolate(3)
2
3
4
5 NAME
6 rtcInterpolate - interpolates vertex attributes
7
8 SYNOPSIS
9 #include <embree3/rtcore.h>
10
11 struct RTCInterpolateArguments
12 {
13 RTCGeometry geometry;
14 unsigned int primID;
15 float u, v;
16 enum RTCBufferType bufferType;
17 unsigned int bufferSlot;
18 float* P;
19 float* dPdu;
20 float* dPdv;
21 float* ddPdudu;
22 float* ddPdvdv;
23 float* ddPdudv;
24 unsigned int valueCount;
25 };
26
27 void rtcInterpolate(
28 const struct RTCInterpolateArguments* args
29 );
30
31 DESCRIPTION
32 The rtcInterpolate function smoothly interpolates per-vertex data over
33 the geometry. This interpolation is supported for triangle meshes,
34 quad meshes, curve geometries, and subdivision geometries. Apart from
35 interpolating the vertex attribute itself, it is also possible to get
36 the first and second order derivatives of that value. This interpola‐
37 tion ignores displacements of subdivision surfaces and always interpo‐
38 lates the underlying base surface.
39
40 The rtcInterpolate call gets passed a number of arguments inside a
41 structure of type RTCInterpolateArguments. For some geometry (geometry
42 parameter) this function smoothly interpolates the per-vertex data
43 stored inside the specified geometry buffer (bufferType and bufferSlot
44 parameters) to the u/v location (u and v parameters) of the primitive
45 (primID parameter). The number of floating point values to interpolate
46 and store to the destination arrays can be specified using the value‐
47 Count parameter. As interpolation buffer, one can specify vertex buf‐
48 fers (RTC_BUFFER_TYPE_VERTEX) and vertex attribute buffers (RTC_BUF‐
49 FER_TYPE_VERTEX_ATTRIBUTE) as well.
50
51 The rtcInterpolate call stores valueCount number of interpolated float‐
52 ing point values to the memory location pointed to by P. One can avoid
53 storing the interpolated value by setting P to NULL.
54
55 The first order derivative of the interpolation by u and v are stored
56 at the dPdu and dPdv memory locations. One can avoid storing first
57 order derivatives by setting both dPdu and dPdv to NULL.
58
59 The second order derivatives are stored at the ddPdudu, ddPdvdv, and
60 ddPdudv memory locations. One can avoid storing second order deriva‐
61 tives by setting these three pointers to NULL.
62
63 To use rtcInterpolate for a geometry, all changes to that geometry must
64 be properly committed using rtcCommitGeometry.
65
66 All input buffers and output arrays must be padded to 16 bytes, as the
67 implementation uses 16-byte SSE instructions to read and write into
68 these buffers.
69
70 See tutorial [Interpolation] for an example of using the rtcInterpolate
71 function.
72
73 EXIT STATUS
74 For performance reasons this function does not do any error checks,
75 thus will not set any error flags on failure.
76
77 SEE ALSO
78 [rtcInterpolateN]
79
80
81
82 rtcInterpolate(3)