diff --git a/res/content/base/blocks/blue_lamp.json b/res/content/base/blocks/blue_lamp.json index 18f48ae3..cfded63b 100644 --- a/res/content/base/blocks/blue_lamp.json +++ b/res/content/base/blocks/blue_lamp.json @@ -1,5 +1,6 @@ { "texture": "blue_lamp", "emission": [0, 0, 15], + "shadeless": true, "material": "base:glass" } diff --git a/res/content/base/blocks/green_lamp.json b/res/content/base/blocks/green_lamp.json index 4f7e2cfa..55264976 100644 --- a/res/content/base/blocks/green_lamp.json +++ b/res/content/base/blocks/green_lamp.json @@ -1,5 +1,6 @@ { "texture": "green_lamp", "emission": [0, 15, 0], + "shadeless": true, "material": "base:glass" } diff --git a/res/content/base/blocks/lamp.json b/res/content/base/blocks/lamp.json index 1af83c3b..7d79c1a1 100644 --- a/res/content/base/blocks/lamp.json +++ b/res/content/base/blocks/lamp.json @@ -1,4 +1,5 @@ { "texture": "lamp", - "emission": [15, 14, 13] -} \ No newline at end of file + "emission": [15, 14, 13], + "shadeless": true +} diff --git a/res/content/base/blocks/lightbulb.json b/res/content/base/blocks/lightbulb.json index a22cfaf3..7a1ca235 100644 --- a/res/content/base/blocks/lightbulb.json +++ b/res/content/base/blocks/lightbulb.json @@ -7,5 +7,6 @@ "rotation": "pipe", "light-passing": true, "sky-light-passing": true, + "shadeless": true, "material": "base:glass" } diff --git a/res/content/base/blocks/red_lamp.json b/res/content/base/blocks/red_lamp.json index fe7e8cb1..06617a21 100644 --- a/res/content/base/blocks/red_lamp.json +++ b/res/content/base/blocks/red_lamp.json @@ -1,5 +1,6 @@ { "texture": "red_lamp", "emission": [15, 0, 0], + "shadeless": true, "material": "base:glass" } diff --git a/res/content/base/blocks/torch.json b/res/content/base/blocks/torch.json index b5b76e4f..2a914a94 100644 --- a/res/content/base/blocks/torch.json +++ b/res/content/base/blocks/torch.json @@ -11,6 +11,7 @@ "model": "aabb", "hitbox": [0.4375, 0.0, 0.4375, 0.125, 0.5, 0.125], "light-passing": true, + "shadeless": true, "obstacle": false, "rotation": "pipe" } diff --git a/src/content/ContentLoader.cpp b/src/content/ContentLoader.cpp index 68cb44d7..73d8b3a3 100644 --- a/src/content/ContentLoader.cpp +++ b/src/content/ContentLoader.cpp @@ -208,11 +208,12 @@ void ContentLoader::loadBlock(Block& def, const std::string& name, const fs::pat root->flag("obstacle", def.obstacle); root->flag("replaceable", def.replaceable); root->flag("light-passing", def.lightPassing); + root->flag("sky-light-passing", def.skyLightPassing); + root->flag("shadeless", def.shadeless); root->flag("breakable", def.breakable); root->flag("selectable", def.selectable); root->flag("grounded", def.grounded); root->flag("hidden", def.hidden); - root->flag("sky-light-passing", def.skyLightPassing); root->num("draw-group", def.drawGroup); root->str("picking-item", def.pickingItem); root->str("script-name", def.scriptName); diff --git a/src/graphics/render/BlocksRenderer.cpp b/src/graphics/render/BlocksRenderer.cpp index 378dc4e7..e143f271 100644 --- a/src/graphics/render/BlocksRenderer.cpp +++ b/src/graphics/render/BlocksRenderer.cpp @@ -440,7 +440,7 @@ void BlocksRenderer::render(const voxel* voxels) { int z = (i / CHUNK_D) % CHUNK_W; switch (def.model) { case BlockModel::block: - blockCube(x, y, z, texfaces, &def, vox.state, !def.rt.emissive); + blockCube(x, y, z, texfaces, &def, vox.state, !def.shadeless); break; case BlockModel::xsprite: { blockXSprite(x, y, z, vec3(1.0f), @@ -448,11 +448,11 @@ void BlocksRenderer::render(const voxel* voxels) { break; } case BlockModel::aabb: { - blockAABB(ivec3(x,y,z), texfaces, &def, vox.state.rotation, !def.rt.emissive); + blockAABB(ivec3(x,y,z), texfaces, &def, vox.state.rotation, !def.shadeless); break; } case BlockModel::custom: { - blockCustomModel(ivec3(x, y, z), &def, vox.state.rotation, !def.rt.emissive); + blockCustomModel(ivec3(x, y, z), &def, vox.state.rotation, !def.shadeless); break; } default: diff --git a/src/voxels/Block.hpp b/src/voxels/Block.hpp index d3d95d7c..90ae2f6a 100644 --- a/src/voxels/Block.hpp +++ b/src/voxels/Block.hpp @@ -126,6 +126,9 @@ public: /// @brief Does the block passing top-down sky lights into itself bool skyLightPassing = false; + + /// @brief Does block model have shading + bool shadeless = false; /// @brief Is the block a physical obstacle bool obstacle = true;