srp
software rendering pipeline
Loading...
Searching...
No Matches
triangle.c File Reference
#include <math.h>
#include <stdint.h>
#include <stdio.h>
#include "triangle.h"
#include "context.h"
#include "vertex.h"
#include "framebuffer_p.h"
#include "message_callback_p.h"
#include "shaders.h"
#include "color.h"
#include "utils.h"
#include "math_utils.h"
#include "vec.h"
Include dependency graph for triangle.c:

Functions

void drawTriangle (const SRPFramebuffer *fb, const SRPvsOutput vertices[3], const SRPShaderProgram *restrict sp, size_t primitiveID)
 
static double signedAreaParallelogram (const vec3d *restrict a, const vec3d *restrict b)
 
static void calculateBarycentricCoordinatesForPointAndBarycentricDeltas (const vec3d *restrict SSPositions, const vec3d *restrict edgeVectors, vec2d point, double *restrict barycentricCoordinates, double *restrict barycentricDeltaX, double *restrict barycentricDeltaY)
 
static bool triangleIsEdgeFlatTopOrLeft (const vec3d *restrict edgeVector)
 
static void triangleInterpolatePositionAndVertexVariables (const SRPvsOutput vertices[3], const double barycentricCoordinates[3], const SRPShaderProgram *restrict sp, SRPInterpolated *pInterpolatedBuffer, vec4d *interpolatedPosition)
 

Detailed Description

Triangle rasteization & data interpolation