From ef56151860ef4fec2ad9177557d7f81977905e2d Mon Sep 17 00:00:00 2001 From: 3gg <3gg@shellblade.net> Date: Fri, 13 Feb 2026 14:22:07 -0800 Subject: Pass in normals --- src/main.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index cf6bd26..e38eeaa 100644 --- a/src/main.c +++ b/src/main.c @@ -236,7 +236,8 @@ static void RenderIndexedModel(swgfx* gfx, const IndexedModel* model, const Mode const sgTriIdx* tris = (const sgTriIdx*)(model->data + model->offsetTris) + object->offset; const sgVec3* positions = (const sgVec3*) (model->data + model->offsetPositions); const sgVec2* texcoords = (const sgVec2*) (model->data + model->offsetTexcoords); - sgTrianglesIndexedNonUniform(gfx, object->count, tris, positions, texcoords); + const sgVec3* normals = (const sgVec3*) (model->data + model->offsetNormals); + sgTrianglesIndexedNonUniform(gfx, object->count, tris, positions, texcoords, normals); } static void RenderModel(swgfx* gfx, const sgImage* textures, const Model* model) { @@ -332,6 +333,10 @@ static bool Render(State* state) { sgTrianglesIndexed(state->gfx, 3, indices, positions, texcoords);*/ sgLighting(state->gfx); sgAmbient(state->gfx, (sgVec3){1,1,1}); + // Debugging <-- + //sgDepth(state->gfx); + //sgNormals(state->gfx); + // --> sgGammaInv(state->gfx, sgColourBuffer(state->gfx), BufferWidth, BufferHeight); sgPresent(state->gfx, WindowDims, window_surface->pixels); -- cgit v1.2.3