diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2023-03-14 19:16:57 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2023-03-14 19:18:30 +0000 |
commit | 3fea21a2d8f2aa67fd212837fe7e09e4f29ad515 (patch) | |
tree | 2c7a212745ddda5d55caf0cfd3c85b2cb39c15b5 /assetFactory/factoryMesh.cpp | |
parent | Add postLoad support to persistence (diff) | |
download | ilt-3fea21a2d8f2aa67fd212837fe7e09e4f29ad515.tar.bz2 ilt-3fea21a2d8f2aa67fd212837fe7e09e4f29ad515.tar.xz ilt-3fea21a2d8f2aa67fd212837fe7e09e4f29ad515.zip |
Support creating a super texture from fragments
Currently makes wild assumptions about vertices and doesn't actually populate the texture, it's just grey
Diffstat (limited to 'assetFactory/factoryMesh.cpp')
-rw-r--r-- | assetFactory/factoryMesh.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/assetFactory/factoryMesh.cpp b/assetFactory/factoryMesh.cpp index 1665b90..c47e80e 100644 --- a/assetFactory/factoryMesh.cpp +++ b/assetFactory/factoryMesh.cpp @@ -2,13 +2,10 @@ #include "collections.hpp" #include "gfx/models/vertex.hpp" #include "modelFactoryMesh.h" -#include <glm/ext/matrix_transform.hpp> Mesh::Ptr FactoryMesh::createMesh() const { - constexpr glm::vec2 NullUV {}; - ModelFactoryMesh mesh; for (const auto & use : uses) { use->createMesh(mesh, 1); @@ -23,7 +20,8 @@ FactoryMesh::createMesh() const const auto smooth = mesh.property(mesh.smoothFaceProperty, face); const auto colour = mesh.color(face); for (const auto & vertex : mesh.fv_range(face)) { - vertices.emplace_back(mesh.point(vertex), NullUV, + const auto textureUV = mesh.texcoord2D(vertex); + vertices.emplace_back(mesh.point(vertex), textureUV, smooth ? mesh.property(mesh.vertex_normals_pph(), vertex) : mesh.property(mesh.face_normals_pph(), face), colour); |