X-Git-Url: http://git.localhorst.tv/?p=blobs.git;a=blobdiff_plain;f=src%2Fworld%2Fworld.cpp;h=dd7d28d3d06d34c92095df1a4c126ba8a44e2bd5;hp=eee12833b39ca80d467d0f8fc19868284f796419;hb=2ab70a92ae39cebc6166ef15545ebcbd31a31c38;hpb=e22daa10d55c26f15a170ab76645e656e956901c diff --git a/src/world/world.cpp b/src/world/world.cpp index eee1283..dd7d28d 100644 --- a/src/world/world.cpp +++ b/src/world/world.cpp @@ -347,34 +347,34 @@ void Planet::BuildVAO(const Set &ts) { for (int y = 0; y < sidelength; ++y) { for (int x = 0; x < sidelength; ++x, ++index) { float tex = ts[TileAt(surface, x, y).type].texture; - const float tex_u_begin = surface < 3 ? 1.0f : 0.0f; - const float tex_u_end = surface < 3 ? 0.0f : 1.0f; + const float tex_v_begin = surface < 3 ? 1.0f : 0.0f; + const float tex_v_end = surface < 3 ? 0.0f : 1.0f; attrib[4 * index + 0].position[(surface + 0) % 3] = x + 0 - offset; attrib[4 * index + 0].position[(surface + 1) % 3] = y + 0 - offset; attrib[4 * index + 0].position[(surface + 2) % 3] = surface < 3 ? offset : -offset; - attrib[4 * index + 0].tex_coord[0] = tex_u_begin; - attrib[4 * index + 0].tex_coord[1] = 1.0f; + attrib[4 * index + 0].tex_coord[0] = 0.0f; + attrib[4 * index + 0].tex_coord[1] = tex_v_begin; attrib[4 * index + 0].tex_coord[2] = tex; attrib[4 * index + 1].position[(surface + 0) % 3] = x + 0 - offset; attrib[4 * index + 1].position[(surface + 1) % 3] = y + 1 - offset; attrib[4 * index + 1].position[(surface + 2) % 3] = surface < 3 ? offset : -offset; - attrib[4 * index + 1].tex_coord[0] = tex_u_end; - attrib[4 * index + 1].tex_coord[1] = 1.0f; + attrib[4 * index + 1].tex_coord[0] = 0.0f; + attrib[4 * index + 1].tex_coord[1] = tex_v_end; attrib[4 * index + 1].tex_coord[2] = tex; attrib[4 * index + 2].position[(surface + 0) % 3] = x + 1 - offset; attrib[4 * index + 2].position[(surface + 1) % 3] = y + 0 - offset; attrib[4 * index + 2].position[(surface + 2) % 3] = surface < 3 ? offset : -offset; - attrib[4 * index + 2].tex_coord[0] = tex_u_begin; - attrib[4 * index + 2].tex_coord[1] = 0.0f; + attrib[4 * index + 2].tex_coord[0] = 1.0f; + attrib[4 * index + 2].tex_coord[1] = tex_v_begin; attrib[4 * index + 2].tex_coord[2] = tex; attrib[4 * index + 3].position[(surface + 0) % 3] = x + 1 - offset; attrib[4 * index + 3].position[(surface + 1) % 3] = y + 1 - offset; attrib[4 * index + 3].position[(surface + 2) % 3] = surface < 3 ? offset : -offset; - attrib[4 * index + 3].tex_coord[0] = tex_u_end; - attrib[4 * index + 3].tex_coord[1] = 0.0f; + attrib[4 * index + 3].tex_coord[0] = 1.0f; + attrib[4 * index + 3].tex_coord[1] = tex_v_end; attrib[4 * index + 3].tex_coord[2] = tex; } }