1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Use vertices with tangents only when its needed.

This commit is contained in:
RealBadAngel 2016-02-12 12:25:20 +01:00 committed by paramat
parent 3a74b84007
commit 7ea40e45b1
4 changed files with 131 additions and 67 deletions

View file

@ -46,8 +46,10 @@ struct MeshMakeData
IGameDef *m_gamedef;
bool m_use_shaders;
bool m_use_tangent_vertices;
MeshMakeData(IGameDef *gamedef, bool use_shaders);
MeshMakeData(IGameDef *gamedef, bool use_shaders,
bool use_tangent_vertices = false);
/*
Copy central data directly from block, and other data from
@ -130,6 +132,7 @@ private:
IShaderSource *m_shdrsrc;
bool m_enable_shaders;
bool m_use_tangent_vertices;
// Must animate() be called before rendering?
bool m_has_animation;
@ -167,11 +170,19 @@ struct PreMeshBuffer
TileSpec tile;
std::vector<u16> indices;
std::vector<video::S3DVertex> vertices;
std::vector<video::S3DVertexTangents> tangent_vertices;
};
struct MeshCollector
{
std::vector<PreMeshBuffer> prebuffers;
bool m_use_tangent_vertices;
MeshCollector(bool use_tangent_vertices):
m_use_tangent_vertices(use_tangent_vertices)
{
}
void append(const TileSpec &material,
const video::S3DVertex *vertices, u32 numVertices,
const u16 *indices, u32 numIndices);