refactor: update log and leaf materials

This commit is contained in:
2026-04-18 11:56:33 +08:00
parent 955c4ddec7
commit 099b1cbdd7
14 changed files with 29 additions and 3 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 99 B

After

Width:  |  Height:  |  Size: 398 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 99 B

After

Width:  |  Height:  |  Size: 398 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 99 B

After

Width:  |  Height:  |  Size: 398 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 99 B

After

Width:  |  Height:  |  Size: 398 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 99 B

After

Width:  |  Height:  |  Size: 398 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 99 B

After

Width:  |  Height:  |  Size: 398 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 99 B

After

Width:  |  Height:  |  Size: 259 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 99 B

After

Width:  |  Height:  |  Size: 215 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 99 B

After

Width:  |  Height:  |  Size: 259 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 99 B

After

Width:  |  Height:  |  Size: 259 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 99 B

After

Width:  |  Height:  |  Size: 259 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 99 B

After

Width:  |  Height:  |  Size: 215 B

View File

@@ -1,11 +1,12 @@
#pragma once #pragma once
#include <glad/glad.h> #include <glad/glad.h>
#include <glm/glm.hpp> #include <glm/glm.hpp>
#include <array>
#include <string> #include <string>
#include <vector> #include <vector>
#include <Cubed/config.hpp>
#include <Cubed/tools/cubed_assert.hpp>
struct BlockTexture { struct BlockTexture {
std::string name; std::string name;
unsigned id; unsigned id;
@@ -39,3 +40,28 @@ struct LookBlock {
glm::ivec3 pos; glm::ivec3 pos;
glm::ivec3 normal; glm::ivec3 normal;
}; };
constexpr std::array<std::string_view, MAX_BLOCK_NUM> BLOCK_REISTER{
"air",
"grass_block",
"dirt",
"stone",
"sand",
"log",
"leaf"
};
const std::array<bool, MAX_BLOCK_NUM> TRANSPARENT_MAP {
true,
false,
false,
false,
false,
false,
true
};
inline bool is_in_transparent_map(unsigned id) {
CUBED_ASSERT_MSG(id < MAX_BLOCK_NUM, "ID is invaild");
return TRANSPARENT_MAP[id];
};

View File

@@ -49,7 +49,7 @@ public:
static int get_index(int x, int y, int z); static int get_index(int x, int y, int z);
static int get_index(const glm::vec3& pos); static int get_index(const glm::vec3& pos);
void init_chunk(); void init_chunk();
void gen_vertex_data(); //void gen_vertex_data();
// 0 : (1, 0) // 0 : (1, 0)
// 1 : (-1, 0) // 1 : (-1, 0)
// 2 : (0, 1) // 2 : (0, 1)