mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 11:01:49 +00:00
fix enable per-variant custom model caching
This commit is contained in:
parent
c815419e7c
commit
c7259d4e19
4 changed files with 11 additions and 7 deletions
|
|
@ -67,7 +67,7 @@ std::unique_ptr<ImageData> BlocksPreview::draw(
|
|||
glm::vec3 poff = glm::vec3(0.0f, 0.0f, 1.0f);
|
||||
offset.y += (1.0f - hitbox).y * 0.5f;
|
||||
shader.uniformMatrix("u_apply", glm::translate(glm::mat4(1.0f), offset));
|
||||
const auto& model = cache.getModel(def.rt.id);
|
||||
const auto& model = cache.getModel(def.rt.id, 0);
|
||||
|
||||
for (const auto& mesh : model.meshes) {
|
||||
for (const auto& vertex : mesh.vertices) {
|
||||
|
|
|
|||
|
|
@ -308,7 +308,7 @@ void BlocksRenderer::blockCustomModel(
|
|||
Z = orient.axes[2];
|
||||
}
|
||||
|
||||
const auto& model = cache.getModel(block.rt.id);
|
||||
const auto& model = cache.getModel(block.rt.id, block.getVariantIndex(states.userbits));
|
||||
for (const auto& mesh : model.meshes) {
|
||||
if (vertexCount + mesh.vertices.size() >= capacity) {
|
||||
overflow = true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue