X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fchunk.cpp;fp=src%2Fchunk.cpp;h=74ca1bcf96933274f9560cbb151e8629177eeb0c;hb=15ff5ed48855c6bd09bc8f5152f46065484c1e94;hp=2a764f31c1c637435feb7738161a42f576f997b9;hpb=4485397da18a25dfd1a51e864814887b66ba0f2e;p=blank.git diff --git a/src/chunk.cpp b/src/chunk.cpp index 2a764f3..74ca1bc 100644 --- a/src/chunk.cpp +++ b/src/chunk.cpp @@ -322,7 +322,7 @@ int Chunk::GetLight(int index) const { return light[index]; } -float Chunk::GetVertexLight(int index, const BlockModel::Position &vtx, const BlockModel::Normal &norm) const { +float Chunk::GetVertexLight(int index, const BlockModel::Position &vtx, const Model::Normal &norm) const { float light = GetLight(index); Chunk::Pos pos(ToPos(index)); @@ -452,7 +452,11 @@ void Chunk::Update() { vtx_counter += type.shape->VertexCount(); for (size_t vtx = vtx_begin; vtx < vtx_counter; ++vtx) { - buf.lights.emplace_back(GetVertexLight(i, buf.vertices[vtx], buf.normals[vtx])); + buf.lights.emplace_back(GetVertexLight( + i, + buf.vertices[vtx], + type.shape->VertexNormal(vtx - vtx_begin, blocks[i].Transform()) + )); } }