Log Realism: Added authentic multi-texture Oak Logs - v2.1.7

This commit is contained in:
Michael Howard 2026-04-24 15:25:32 -05:00
parent 2114e50a9f
commit b2a36a249b
13 changed files with 34 additions and 7 deletions

View File

@ -13,11 +13,11 @@ MorriCraft is a high-performance voxel engine built with C++ and Raylib. It feat
## Version History
### v2.1.6 - Inventory Insight (Latest)
* **Item Tooltips**: Added mouse-over names for all inventory and hotbar items.
* **UI Polish**: Dynamic tooltip positioning to ensure labels stay on-screen.
### v2.1.7 - Log Realism (Latest)
* **Authentic Oak Logs**: Replaced plank-fallback textures with dedicated bark (side) and ring (top) textures.
* **Multi-Texture Rendering**: Implemented specialized draw calls for logs to support independent side/top textures.
### v2.1.5 - Windows Portability
### v2.1.6 - Inventory Insight
### v2.1.0 - Personalization & Stability
* **Integrated Skin Editor**: Personalize your shirt and pants colors directly from the Options menu.

BIN
assets/oak_log_side.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 450 KiB

BIN
assets/oak_log_top.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 752 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 450 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 752 KiB

View File

@ -1 +1 @@
v2.1.6
v2.1.7

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 450 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 752 KiB

View File

@ -1 +1 @@
v2.1.6
v2.1.7

View File

@ -722,6 +722,24 @@ void DrawCraftingTable(Vector3 position, unsigned int sideTexId, unsigned int to
rlEnd();
}
void DrawLog(Vector3 position, unsigned int sideTexId, unsigned int topTexId, Color tint) {
float x = position.x; float y = position.y; float z = position.z;
rlSetTexture(sideTexId);
rlBegin(RL_QUADS);
rlColor4ub(tint.r, tint.g, tint.b, 255);
rlTexCoord2f(0.0f, 1.0f); rlVertex3f(x - 0.5f, y - 0.5f, z + 0.5f); rlTexCoord2f(1.0f, 1.0f); rlVertex3f(x + 0.5f, y - 0.5f, z + 0.5f); rlTexCoord2f(1.0f, 0.0f); rlVertex3f(x + 0.5f, y + 0.5f, z + 0.5f); rlTexCoord2f(0.0f, 0.0f); rlVertex3f(x - 0.5f, y + 0.5f, z + 0.5f);
rlTexCoord2f(1.0f, 1.0f); rlVertex3f(x - 0.5f, y - 0.5f, z - 0.5f); rlTexCoord2f(1.0f, 0.0f); rlVertex3f(x - 0.5f, y + 0.5f, z - 0.5f); rlTexCoord2f(0.0f, 0.0f); rlVertex3f(x + 0.5f, y + 0.5f, z - 0.5f); rlTexCoord2f(0.0f, 1.0f); rlVertex3f(x + 0.5f, y - 0.5f, z - 0.5f);
rlTexCoord2f(1.0f, 1.0f); rlVertex3f(x + 0.5f, y - 0.5f, z - 0.5f); rlTexCoord2f(1.0f, 0.0f); rlVertex3f(x + 0.5f, y + 0.5f, z - 0.5f); rlTexCoord2f(0.0f, 0.0f); rlVertex3f(x + 0.5f, y + 0.5f, z + 0.5f); rlTexCoord2f(0.0f, 1.0f); rlVertex3f(x + 0.5f, y - 0.5f, z + 0.5f);
rlTexCoord2f(0.0f, 1.0f); rlVertex3f(x - 0.5f, y - 0.5f, z - 0.5f); rlTexCoord2f(1.0f, 1.0f); rlVertex3f(x - 0.5f, y - 0.5f, z + 0.5f); rlTexCoord2f(1.0f, 0.0f); rlVertex3f(x - 0.5f, y + 0.5f, z + 0.5f); rlTexCoord2f(0.0f, 0.0f); rlVertex3f(x - 0.5f, y + 0.5f, z - 0.5f);
rlEnd();
rlSetTexture(topTexId);
rlBegin(RL_QUADS);
rlColor4ub(tint.r, tint.g, tint.b, 255);
rlTexCoord2f(0.0f, 1.0f); rlVertex3f(x - 0.5f, y + 0.5f, z - 0.5f); rlTexCoord2f(0.0f, 0.0f); rlVertex3f(x - 0.5f, y + 0.5f, z + 0.5f); rlTexCoord2f(1.0f, 0.0f); rlVertex3f(x + 0.5f, y + 0.5f, z + 0.5f); rlTexCoord2f(1.0f, 1.0f); rlVertex3f(x + 0.5f, y + 0.5f, z - 0.5f);
rlTexCoord2f(1.0f, 1.0f); rlVertex3f(x - 0.5f, y - 0.5f, z - 0.5f); rlTexCoord2f(0.0f, 1.0f); rlVertex3f(x + 0.5f, y - 0.5f, z - 0.5f); rlTexCoord2f(0.0f, 0.0f); rlVertex3f(x + 0.5f, y - 0.5f, z + 0.5f); rlTexCoord2f(1.0f, 0.0f); rlVertex3f(x - 0.5f, y - 0.5f, z + 0.5f);
rlEnd();
}
// Optimized check to see if a block has any exposed faces.
bool IsExposedOptimized(int lx, int ly, int lz, Chunk* chunk, Chunk* nxM, Chunk* nxP, Chunk* nzM, Chunk* nzP) {
if (ly > 0) { if (chunk->blocks[lx][ly-1][lz] == AIR) return true; } else return true;
@ -940,10 +958,16 @@ int main(void)
Texture2D grassTopTexture = LoadTexture("assets/grass_top.png");
Texture2D craftingSideTexture = LoadTexture("assets/crafting_table_side.png");
Texture2D craftingTopTexture = LoadTexture("assets/crafting_table_top.png");
Texture2D logSideTexture = LoadTexture("assets/oak_log_side.png");
Texture2D logTopTexture = LoadTexture("assets/oak_log_top.png");
// Safety Fallback: Use Planks if custom textures failed to load (prevents crash)
if (craftingSideTexture.id == 0) craftingSideTexture = blockTextures[PLANK];
if (craftingTopTexture.id == 0) craftingTopTexture = blockTextures[PLANK];
if (logSideTexture.id == 0) logSideTexture = blockTextures[PLANK];
if (logTopTexture.id == 0) logTopTexture = blockTextures[PLANK];
blockTextures[LOG] = logSideTexture; // For inventory preview
blockTextures[CRAFTING_TABLE] = craftingSideTexture; // Preview for inventory
blockTextures[STICK] = LoadTexture("assets/stick.png");
@ -2590,6 +2614,9 @@ int main(void)
for (auto& pos : chunk->renderLists[CRAFTING_TABLE]) {
DrawCraftingTable(pos, craftingSideTexture.id, craftingTopTexture.id, blockTextures[DIRT].id, blockTint);
}
for (auto& pos : chunk->renderLists[LOG]) {
DrawLog(pos, logSideTexture.id, logTopTexture.id, blockTint);
}
}
} else {
rlSetTexture(blockTextures[renderType].id);

View File

@ -1 +1 @@
v2.1.6
v2.1.7