From b0544549c551dfa0b52e7c685580f954861240ba Mon Sep 17 00:00:00 2001 From: 3gg <3gg@shellblade.net> Date: Fri, 13 Feb 2026 14:21:37 -0800 Subject: Emit normals --- include/swgfx.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/swgfx.h b/include/swgfx.h index b3f9150..452847c 100644 --- a/include/swgfx.h +++ b/include/swgfx.h @@ -37,8 +37,8 @@ typedef sgVec3 sgNormal; typedef struct sgVert2i { sgVec2i pos; sgVec2 uv; } sgVert2i; typedef struct sgVert2 { sgVec2 pos; sgVec2 uv; } sgVert2; -typedef struct sgVert3 { sgVec3 pos; sgVec2 uv; } sgVert3; -typedef struct sgVert4 { sgVec4 pos; sgVec2 uv; } sgVert4; +typedef struct sgVert3 { sgVec3 pos; sgVec2 uv; sgVec3 normal; } sgVert3; +typedef struct sgVert4 { sgVec4 pos; sgVec2 uv; sgVec3 normal; } sgVert4; typedef struct sgQuadi { sgVert2i p0, p1; } sgQuadi; typedef struct sgQuad { sgVert2 p0, p1; } sgQuad; @@ -108,11 +108,15 @@ void sgTriangles2 (swgfx*, size_t count, const sgTri2*); void sgTriangleStrip2(swgfx*, size_t count, const sgVec2*); void sgTriangles (swgfx*, size_t count, const sgTri3*, const sgNormal*); void sgTriangleStrip (swgfx*, size_t count, const sgVec3*, const sgNormal*); -void sgTrianglesIndexed(swgfx*, size_t numIndices, const sgIdx* indices, const sgVec3* positions, const sgVec2* texcoords); -void sgTrianglesIndexedNonUniform(swgfx*, size_t numTris, const sgTriIdx* tris, const sgVec3* positions, const sgVec2* texcoords); +void sgTrianglesIndexed(swgfx*, size_t numIndices, const sgIdx* indices, const sgVec3* positions, const sgVec2* texcoords, const sgVec3* normals); +void sgTrianglesIndexedNonUniform(swgfx*, size_t numTris, const sgTriIdx* tris, const sgVec3* positions, const sgVec2* texcoords, const sgVec3* normals); void sgLighting(swgfx*); void sgAmbient(swgfx*, sgVec3 ambient); +// TODO: Implement directional lights. + +void sgDepth(swgfx*); +void sgNormals(swgfx*); void sgGamma (swgfx*, sgPixel*, int width, int height); void sgGammaInv(swgfx*, sgPixel*, int width, int height); -- cgit v1.2.3