From 0fd5b2d18c677c3317bac768ca7997d3e96fb809 Mon Sep 17 00:00:00 2001 From: gered Date: Sun, 1 Dec 2013 15:14:49 -0500 Subject: [PATCH] fix sub-model colors not being applied when using non-lit chunk vertex generation --- .../ca/blarg/gdx/tilemap3d/ChunkVertexGenerator.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/java/ca/blarg/gdx/tilemap3d/ChunkVertexGenerator.java b/src/main/java/ca/blarg/gdx/tilemap3d/ChunkVertexGenerator.java index 23c759f..2d678f6 100644 --- a/src/main/java/ca/blarg/gdx/tilemap3d/ChunkVertexGenerator.java +++ b/src/main/java/ca/blarg/gdx/tilemap3d/ChunkVertexGenerator.java @@ -178,7 +178,14 @@ public class ChunkVertexGenerator { // copy vertices for (int i = 0; i < numVertices; ++i) { sourceVertices.getVertex(vertex); - vertex.color.set(color); // TODO: the getVertex() call above sets this, we're just overriding here... kind of wasteful .. ? + + // TODO: need to play with vertex/mesh color combinations a bit more to see if this is really correct + vertex.color.set( + vertex.color.r * color.r, + vertex.color.g * color.g, + vertex.color.b * color.b, + vertex.color.a * color.a + ); // transform if applicable... (this will probably just be per-tile rotation) if (transform != null) {