You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

superchunkmesh.h 751B

123456789101112131415161718192021222324252627282930313233
  1. // A chunk mesh for batching together other chunk meshes to reduce drawcalls
  2. // chunks OR the supermesh but not both.
  3. // To be used to group together chunks (i.e. 8^3 blocks of chunks)
  4. // If rebuild is started when it's already rebuilding in another thread,it will
  5. // restart rebuilding in the original thread.
  6. #pragma once
  7. #include <vector>
  8. #include <glm/glm.hpp>
  9. namespace vtk {
  10. class ChunkMesh;
  11. class SuperChunkMesh {
  12. public:
  13. SuperChunkMesh();
  14. bool addMesh(ChunkMesh* mesh);
  15. void rebuild();
  16. protected:
  17. typedef struct {
  18. unsigned count;
  19. unsigned instanceCount;
  20. unsigned first;
  21. unsigned baseInstance;
  22. } DrawArraysIndirectCommand;
  23. std::vector<ChunkMesh*> mChunkMeshes;
  24. std::vector<glm::mat4> mModelMats;
  25. };
  26. }