From c694dfff8230e9565ab4ada67ea780283c80115a Mon Sep 17 00:00:00 2001 From: veclavtalica Date: Mon, 13 Jan 2025 09:18:51 +0300 Subject: [PATCH] use flatshading for space and skip setting irrelevant vertex color --- src/rendering/twn_billboards.c | 6 +++--- src/rendering/twn_gl_15_rendering.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/rendering/twn_billboards.c b/src/rendering/twn_billboards.c index 3d4fa06..95b01c3 100644 --- a/src/rendering/twn_billboards.c +++ b/src/rendering/twn_billboards.c @@ -108,11 +108,11 @@ void finally_draw_billboard_batch(struct MeshBatch const *batch, } struct ElementIndexedBillboard const payload = { - /* TODO: use the flat shading to not set two of the colors */ + /* flat shading is assumed, so we can skip setting the duplicates */ .c0 = billboard.color, - .c1 = billboard.color, + // .c1 = billboard.color, .c2 = billboard.color, - .c3 = billboard.color, + // .c3 = billboard.color, .uv0 = uv0, .uv1 = uv1, diff --git a/src/rendering/twn_gl_15_rendering.c b/src/rendering/twn_gl_15_rendering.c index 9be0304..2e9207f 100644 --- a/src/rendering/twn_gl_15_rendering.c +++ b/src/rendering/twn_gl_15_rendering.c @@ -48,7 +48,7 @@ void finally_use_space_pipeline(void) { glNewList(list, GL_COMPILE); { glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); - glShadeModel(GL_SMOOTH); + glShadeModel(GL_FLAT); if (GLAD_GL_ARB_depth_clamp) glDisable(GL_DEPTH_CLAMP);