srp
software rendering pipeline
Loading...
Searching...
No Matches
interpolation.h File Reference
#include "srp/shaders.h"
#include "srp/vec.h"
Include dependency graph for interpolation.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void interpolateDepthAndWTriangle (SRPVertexShaderOut *vertices, const float *weights, const float *invW, const SRPShaderProgram *sp, float *depth, float *reciprocalInterpolatedInvW)
 
void interpolateDepthAndWLine (SRPVertexShaderOut *vertices, const float *weights, const float *invW, const SRPShaderProgram *sp, float *depth, float *reciprocalInterpolatedInvW)
 
void interpolateAttributes (SRPVertexShaderOut *vertices, size_t nVertices, const float *weights, const float *invW, float reciprocalInterpolatedInvW, const SRPShaderProgram *sp, SRPInterpolated *pOutput)
 

Detailed Description

Interpolation-related functions

Function Documentation

◆ interpolateAttributes()

void interpolateAttributes ( SRPVertexShaderOut vertices,
size_t  nVertices,
const float *  weights,
const float *  invW,
float  reciprocalInterpolatedInvW,
const SRPShaderProgram sp,
SRPInterpolated pOutput 
)

Interpolate the attributes inside the primitive

Parameters
[in]verticesArray of vertices
[in]nVerticesAmount of passed vertices
[in]weightsArray of barycentric coordinates
[in]invWArray of inverseW values for each corresponding vertex
[in]reciprocalInterpolatedInvWThe reciprocal of interpolated inverse W_clip
[in]spThe SRPShaderProgram being used
[out]pOutputInterpolated vertex attributes

◆ interpolateDepthAndWLine()

void interpolateDepthAndWLine ( SRPVertexShaderOut vertices,
const float *  weights,
const float *  invW,
const SRPShaderProgram sp,
float *  depth,
float *  reciprocalInterpolatedInvW 
)

Interpolate the depth and inverse W values inside the line

Parameters
[in]verticesArray of vertices
[in]weightsArray of barycentric coordinates
[in]invWArray of inverseW values for each corresponding vertex
[in]spThe SRPShaderProgram being used
[out]depthWhere interpolated depth will be stored
[out]reciprocalInterpolatedInvWWhere the reciprocal of interpolated inverse W_clip will be stored