From b25dd6161a4667a1e882dde8fb455adce99c3d29 Mon Sep 17 00:00:00 2001 From: Sen Date: Fri, 29 Aug 2025 23:48:34 +0200 Subject: [PATCH] improve visuals --- client/src/main/java/client/Client.java | 2 + .../java/client/gui/options/GuiGraphics.java | 8 ++-- .../src/main/java/client/renderer/Shader.java | 1 + client/src/main/resources/shaders/world.fsh | 3 +- client/src/main/resources/shaders/world.vsh | 5 +- .../{sandstone_bottom.png => sandstone.png} | Bin .../textures/blocks/sandstone_carved.png | Bin 596 -> 0 bytes .../textures/blocks/sandstone_normal.png | Bin 777 -> 0 bytes .../textures/blocks/sandstone_smooth.png | Bin 544 -> 0 bytes ...sandstone_all.png => smooth_sandstone.png} | Bin .../common/block/artificial/BlockSlab.java | 22 +++------ .../common/block/artificial/BlockStairs.java | 15 +++--- .../common/block/artificial/BlockWall.java | 6 +++ .../common/block/natural/BlockObsidian.java | 31 +++--------- .../common/block/natural/BlockSandStone.java | 15 +----- .../main/java/common/init/BlockRegistry.java | 45 +++++++++++------- common/src/main/java/common/init/Blocks.java | 9 +++- common/src/main/java/common/init/Items.java | 9 +++- .../src/main/java/server/world/Converter.java | 4 +- .../structure/StructureScattered.java | 24 +++++----- 20 files changed, 100 insertions(+), 99 deletions(-) rename client/src/main/resources/textures/blocks/{sandstone_bottom.png => sandstone.png} (100%) delete mode 100755 client/src/main/resources/textures/blocks/sandstone_carved.png delete mode 100755 client/src/main/resources/textures/blocks/sandstone_normal.png delete mode 100755 client/src/main/resources/textures/blocks/sandstone_smooth.png rename client/src/main/resources/textures/blocks/{sandstone_all.png => smooth_sandstone.png} (100%) diff --git a/client/src/main/java/client/Client.java b/client/src/main/java/client/Client.java index 7b1f7c95..fa6a3022 100755 --- a/client/src/main/java/client/Client.java +++ b/client/src/main/java/client/Client.java @@ -724,6 +724,8 @@ public class Client implements IThreadListener { private boolean textureFiltering = true; @Variable(name = "gl_specular", category = CVarCategory.RENDER, display = "Beleuchtungseffekte") public boolean specularColors = true; + @Variable(name = "gl_flat_shading", category = CVarCategory.RENDER, display = "Flaches Shading") + public boolean flatShading = false; public static final Client CLIENT = new Client(); diff --git a/client/src/main/java/client/gui/options/GuiGraphics.java b/client/src/main/java/client/gui/options/GuiGraphics.java index 1d230bb0..addfcd65 100644 --- a/client/src/main/java/client/gui/options/GuiGraphics.java +++ b/client/src/main/java/client/gui/options/GuiGraphics.java @@ -30,10 +30,12 @@ public class GuiGraphics extends GuiOptions { this.addSelector("gl_light_blend", 0, 220, 240, 0); this.addSelector("gl_specular", 242, 220, 240, 0); - this.addSelector("gl_tex_filter", 0, 240, 240, 0); - this.addSelector("gl_tex_mipmaps", 242, 240, 240, 0); + this.addSelector("gl_flat_shading", 0, 240, 240, 0); + + this.addSelector("gl_tex_filter", 0, 260, 240, 0); + this.addSelector("gl_tex_mipmaps", 242, 260, 240, 0); - this.addSelector("gl_tex_anisotropic", 0, 260, 240, 0); + this.addSelector("gl_tex_anisotropic", 0, 280, 240, 0); super.init(width, height); } diff --git a/client/src/main/java/client/renderer/Shader.java b/client/src/main/java/client/renderer/Shader.java index f2e2a80b..8fed4599 100644 --- a/client/src/main/java/client/renderer/Shader.java +++ b/client/src/main/java/client/renderer/Shader.java @@ -57,6 +57,7 @@ public enum Shader { context.integer("n_lights", 0); context.color3("specular", Client.CLIENT.specularColors && !Client.CLIENT.setGamma && !Client.CLIENT.xrayActive ? 0xffffff : 0x000000); + context.bool("shade", Client.CLIENT.flatShading); GlState.setActiveTexture(GL46.GL_TEXTURE0); // glBindBufferBase(GL_UNIFORM_BUFFER, 0, world->light_buf); diff --git a/client/src/main/resources/shaders/world.fsh b/client/src/main/resources/shaders/world.fsh index 72350ca7..1e2ab997 100644 --- a/client/src/main/resources/shaders/world.fsh +++ b/client/src/main/resources/shaders/world.fsh @@ -17,6 +17,7 @@ in vec3 normal; in vec2 tex_coord; in vec4 light_color; in float shine; +in float shading; uniform vec3 cam_pos; uniform sampler2D tex; @@ -112,7 +113,7 @@ void main() { vec3 dir = normalize(cam_pos - vertex); vec4 texel = texture(tex, tex_coord); float sky = sky_light ? vertex.y < 0.0 ? 0.0 : (vertex.y < 64.0 ? vertex.y / 64.0 : 1.0) : 1.0; - vec3 rgb = texel.rgb; + vec3 rgb = texel.rgb * shading; vec3 direct = rgb * sky * (1.0 - light_color.a * light_factor); vec3 result = rgb * light_color.rgb + calc_dir_light(norm, dir, direct, sun_direction, sun_ambient); if(moon_light) diff --git a/client/src/main/resources/shaders/world.vsh b/client/src/main/resources/shaders/world.vsh index 47a4a8d8..13219afe 100644 --- a/client/src/main/resources/shaders/world.vsh +++ b/client/src/main/resources/shaders/world.vsh @@ -8,6 +8,7 @@ out vec3 normal; out vec2 tex_coord; out vec4 light_color; out float shine; +out float shading; uniform mat4 model; uniform mat4 view; @@ -16,11 +17,13 @@ uniform vec3 offset; uniform int chunk_x; uniform int chunk_y; uniform int chunk_z; +uniform bool shade; void main() { vec3 nvertex = vec3(model * vec4(pos, 1.0)); vertex = vec3(float(chunk_x) + pos.x, float(chunk_y) + pos.y, float(chunk_z) + pos.z); - normal = mat3(transpose(inverse(model))) * norm.rgb; + shading = shade ? (norm.x != 0.0 ? 0.6 : (norm.z != 0.0 ? 0.8 : (norm.y < 0.0 ? 0.5 : 1.0))) : 1.0; + normal = mat3(transpose(inverse(model))) * norm.xyz; shine = norm.a * 32.0; tex_coord = coord; light_color = light; diff --git a/client/src/main/resources/textures/blocks/sandstone_bottom.png b/client/src/main/resources/textures/blocks/sandstone.png similarity index 100% rename from client/src/main/resources/textures/blocks/sandstone_bottom.png rename to client/src/main/resources/textures/blocks/sandstone.png diff --git a/client/src/main/resources/textures/blocks/sandstone_carved.png b/client/src/main/resources/textures/blocks/sandstone_carved.png deleted file mode 100755 index 9bd7fa1422fc6a057bc8c00cb72b6a4b2cf83463..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 596 zcmV-a0;~OrP)mGxmS&o*J$%R=gR z-lM&}h=b-LI@TMOEprK0Ero64Irevwu+1c#-87%?HIfLtRRmx2IO?uIGL!^t5oFb$ zVYBoQ)p87*>Lb*Q$Iwf07)l%!WeR2aE;RWD%*r&(>MXS43{-g%()pZ@!iX^uE@7X1dg>N=KF-!&MQV$iD64r^_^unqC0)#9%@=boF&n< z7ZA82wvqZnKuJWfxO+d*Mbb6Hi zKLNE-(;uMp`8u~ml28|GBuQt*+_lI@ARkF4pmqHm6fPlLV`$Ub{^pNH2wUfw8*@Ao z-2vgin&WnDa~4%K&M}qJ6wdm^%LEim$?BI0@hV^N?B(@45s^}uz~SCICZqGdcwiBM zQn+<-DfgobqJ5i{rz2e?R@H>q$ZNJWaaW#LClk<9rOM-=OB%O{;A%`5C((y~6q4aa iLX7*vErm8!C*N diff --git a/client/src/main/resources/textures/blocks/sandstone_normal.png b/client/src/main/resources/textures/blocks/sandstone_normal.png deleted file mode 100755 index 1b79145ff09417564fca4b205abe6ca015153fb0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 777 zcmV+k1NQuhP) z zG8<5GW`37a7UUAENJc)Rcxgl-WrUPn=ly)z2u-y^t9#I{?n8)(vnbF{xr^-8v86+YL2%k}p$?_6&IFCh9&K7lG$+*ZCc^%4BG`kJS%sWkL#<#X zqFspI7ZBv!52VkR7>UR{6I{^zs^mhe>cr`xfeE6dRa4nVP1->zvyNKnoNS0k zb33TyR?t$mkx4Ax`|n01Ff}A7((DbH1gi`oli%T!G4xd@szuwd?XnHU^cuvY5fax9 zRo+I(_Y!p)hejA9w#i2n)5}OkXZTbdow}3W%TP*Y#6vTr!2zOyafW#K48rg35gyQ# zcX3W3I&nWm#Q&V37l(Wkj6wUD3tRFQZaaR4&~G{@7{^?kj4t51?PRhC@$|x*ZkPp@ z^EMK99$i{@C}53>9YU8{)Cr2I6&|6KHk04hq2DySPEgKnQBIcmAMt3E?tz1BCULVC z2&vc?%Kj`g5=+m&lDFWB0#ujm2pmp8KOi2`)45Hp+t^B<^9coP0|C!d>VR6gZXePm zq41PVhy_0|g5#-|zD1?DfNE(0N2Pfj=uc7BAHz6$1LJrJ<-JAh>(8Lw-IPHDVi&i5 z$lq~=p)s$#pV7#K-z(s^n`ghIKM4i;c3Pfq2ko}={{m7;SgTyrHB)Q}VTGcu{RNk9jzuW$G(SR^X(^Pw7vO~EGI#Ur^{~*%W7yk? zCKz T get(String id) { T block = (T)BlockRegistry.byNameExact(id); diff --git a/common/src/main/java/common/init/Items.java b/common/src/main/java/common/init/Items.java index f298171e..d12fa4a9 100755 --- a/common/src/main/java/common/init/Items.java +++ b/common/src/main/java/common/init/Items.java @@ -211,7 +211,6 @@ public abstract class Items { public static final ItemCamera camera = get("camera"); public static final ItemSeedFood carrot = get("carrot"); public static final ItemWhip whip = get("whip"); - public static final Item carved_sandstone = get("carved_sandstone"); public static final Item carved_stonebrick = get("carved_stonebrick"); public static final Item cauldron = get("cauldron"); public static final Item cell_rock = get("cell_rock"); @@ -1709,6 +1708,14 @@ public abstract class Items { public static final Item snowy_podzol = get("snowy_podzol"); public static final Item snowy_swamp = get("snowy_swamp"); public static final Item snowy_tian_soil = get("snowy_tian_soil"); + public static final Item blackened_soil_stairs = get("blackened_soil_stairs"); + public static final Item cyber_slab = get("cyber_slab"); + public static final Item cyber_stairs = get("cyber_stairs"); + public static final Item grass_stairs = get("grass_stairs"); + public static final Item mycelium_stairs = get("mycelium_stairs"); + public static final Item podzol_stairs = get("podzol_stairs"); + public static final Item swamp_stairs = get("swamp_stairs"); + public static final Item tian_soil_stairs = get("tian_soil_stairs"); private static T get(String id) { T item = (T)ItemRegistry.byName(id); diff --git a/server/src/main/java/server/world/Converter.java b/server/src/main/java/server/world/Converter.java index 32863396..704981c5 100644 --- a/server/src/main/java/server/world/Converter.java +++ b/server/src/main/java/server/world/Converter.java @@ -380,7 +380,7 @@ public abstract class Converter { mapBlock(Blocks.lapis_block, 22); mapBlock(Blocks.smooth_rock, 23); mapBlock(Blocks.sandstone, 24); - mapBlock(Blocks.carved_sandstone, 24, 1); + mapBlock(Blocks.smooth_sandstone, 24, 1); mapBlock(Blocks.smooth_sandstone, 24, 2); mapBlock(Blocks.spruce_planks, 25); mapBlock(Blocks.red_bed.getState().withProperty(BlockBed.FACING, Facing.SOUTH).withProperty(BlockBed.PART, EnumPartType.FOOT), 26, 0, 4); @@ -1141,7 +1141,7 @@ public abstract class Converter { mapBlock(Blocks.rose_bush, 175, 4); mapBlock(Blocks.paeonia, 175, 5); mapBlock(Blocks.sandstone, 179); - mapBlock(Blocks.carved_sandstone, 179, 1); + mapBlock(Blocks.smooth_sandstone, 179, 1); mapBlock(Blocks.smooth_sandstone, 179, 2); mapBlock(Blocks.sandstone_stairs.getState().withProperty(BlockStairs.FACING, Facing.EAST).withProperty(BlockStairs.HALF, EnumHalf.BOTTOM), 180, 0, 8); mapBlock(Blocks.sandstone_stairs.getState().withProperty(BlockStairs.FACING, Facing.WEST).withProperty(BlockStairs.HALF, EnumHalf.BOTTOM), 180, 1, 9); diff --git a/server/src/main/java/server/worldgen/structure/StructureScattered.java b/server/src/main/java/server/worldgen/structure/StructureScattered.java index 7d9b8c4f..695bf0ea 100755 --- a/server/src/main/java/server/worldgen/structure/StructureScattered.java +++ b/server/src/main/java/server/worldgen/structure/StructureScattered.java @@ -143,9 +143,9 @@ public class StructureScattered for (int k1 = 5; k1 <= 17; k1 += 2) { this.setBlockState(worldIn, Blocks.smooth_sandstone.getState(), 4, 1, k1, structureBoundingBoxIn); - this.setBlockState(worldIn, Blocks.carved_sandstone.getState(), 4, 2, k1, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.smooth_sandstone.getState(), 4, 2, k1, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.smooth_sandstone.getState(), this.scatteredFeatureSizeX - 5, 1, k1, structureBoundingBoxIn); - this.setBlockState(worldIn, Blocks.carved_sandstone.getState(), this.scatteredFeatureSizeX - 5, 2, k1, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.smooth_sandstone.getState(), this.scatteredFeatureSizeX - 5, 2, k1, structureBoundingBoxIn); } this.setBlockState(worldIn, Blocks.orange_clay.getState(), 10, 0, 7, structureBoundingBoxIn); @@ -171,13 +171,13 @@ public class StructureScattered this.setBlockState(worldIn, Blocks.orange_clay.getState(), j3, 3, 2, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.smooth_sandstone.getState(), j3, 3, 3, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.orange_clay.getState(), j3, 4, 1, structureBoundingBoxIn); - this.setBlockState(worldIn, Blocks.carved_sandstone.getState(), j3, 4, 2, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.smooth_sandstone.getState(), j3, 4, 2, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.orange_clay.getState(), j3, 4, 3, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.smooth_sandstone.getState(), j3, 5, 1, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.orange_clay.getState(), j3, 5, 2, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.smooth_sandstone.getState(), j3, 5, 3, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.orange_clay.getState(), j3, 6, 1, structureBoundingBoxIn); - this.setBlockState(worldIn, Blocks.carved_sandstone.getState(), j3, 6, 2, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.smooth_sandstone.getState(), j3, 6, 2, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.orange_clay.getState(), j3, 6, 3, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.orange_clay.getState(), j3, 7, 1, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.orange_clay.getState(), j3, 7, 2, structureBoundingBoxIn); @@ -196,13 +196,13 @@ public class StructureScattered this.setBlockState(worldIn, Blocks.orange_clay.getState(), k3, 3, 0, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.smooth_sandstone.getState(), k3 + 1, 3, 0, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.orange_clay.getState(), k3 - 1, 4, 0, structureBoundingBoxIn); - this.setBlockState(worldIn, Blocks.carved_sandstone.getState(), k3, 4, 0, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.smooth_sandstone.getState(), k3, 4, 0, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.orange_clay.getState(), k3 + 1, 4, 0, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.smooth_sandstone.getState(), k3 - 1, 5, 0, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.orange_clay.getState(), k3, 5, 0, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.smooth_sandstone.getState(), k3 + 1, 5, 0, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.orange_clay.getState(), k3 - 1, 6, 0, structureBoundingBoxIn); - this.setBlockState(worldIn, Blocks.carved_sandstone.getState(), k3, 6, 0, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.smooth_sandstone.getState(), k3, 6, 0, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.orange_clay.getState(), k3 + 1, 6, 0, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.orange_clay.getState(), k3 - 1, 7, 0, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.orange_clay.getState(), k3, 7, 0, structureBoundingBoxIn); @@ -216,10 +216,10 @@ public class StructureScattered this.setBlockState(worldIn, Blocks.air.getState(), 8, 6, 0, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.air.getState(), 12, 6, 0, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.orange_clay.getState(), 9, 5, 0, structureBoundingBoxIn); - this.setBlockState(worldIn, Blocks.carved_sandstone.getState(), 10, 5, 0, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.smooth_sandstone.getState(), 10, 5, 0, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.orange_clay.getState(), 11, 5, 0, structureBoundingBoxIn); this.fillWithBlocks(worldIn, structureBoundingBoxIn, 8, -14, 8, 12, -11, 12, Blocks.smooth_sandstone.getState(), Blocks.smooth_sandstone.getState(), false); - this.fillWithBlocks(worldIn, structureBoundingBoxIn, 8, -10, 8, 12, -10, 12, Blocks.carved_sandstone.getState(), Blocks.carved_sandstone.getState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 8, -10, 8, 12, -10, 12, Blocks.smooth_sandstone.getState(), Blocks.smooth_sandstone.getState(), false); this.fillWithBlocks(worldIn, structureBoundingBoxIn, 8, -9, 8, 12, -9, 12, Blocks.smooth_sandstone.getState(), Blocks.smooth_sandstone.getState(), false); this.fillWithBlocks(worldIn, structureBoundingBoxIn, 8, -8, 8, 12, -1, 12, Blocks.sandstone.getState(), Blocks.sandstone.getState(), false); this.fillWithBlocks(worldIn, structureBoundingBoxIn, 9, -11, 9, 11, -1, 11, Blocks.air.getState(), Blocks.air.getState(), false); @@ -227,19 +227,19 @@ public class StructureScattered this.fillWithBlocks(worldIn, structureBoundingBoxIn, 9, -13, 9, 11, -13, 11, Blocks.tnt.getState(), Blocks.air.getState(), false); this.setBlockState(worldIn, Blocks.air.getState(), 8, -11, 10, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.air.getState(), 8, -10, 10, structureBoundingBoxIn); - this.setBlockState(worldIn, Blocks.carved_sandstone.getState(), 7, -10, 10, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.smooth_sandstone.getState(), 7, -10, 10, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.smooth_sandstone.getState(), 7, -11, 10, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.air.getState(), 12, -11, 10, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.air.getState(), 12, -10, 10, structureBoundingBoxIn); - this.setBlockState(worldIn, Blocks.carved_sandstone.getState(), 13, -10, 10, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.smooth_sandstone.getState(), 13, -10, 10, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.smooth_sandstone.getState(), 13, -11, 10, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.air.getState(), 10, -11, 8, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.air.getState(), 10, -10, 8, structureBoundingBoxIn); - this.setBlockState(worldIn, Blocks.carved_sandstone.getState(), 10, -10, 7, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.smooth_sandstone.getState(), 10, -10, 7, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.smooth_sandstone.getState(), 10, -11, 7, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.air.getState(), 10, -11, 12, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.air.getState(), 10, -10, 12, structureBoundingBoxIn); - this.setBlockState(worldIn, Blocks.carved_sandstone.getState(), 10, -10, 13, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.smooth_sandstone.getState(), 10, -10, 13, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.smooth_sandstone.getState(), 10, -11, 13, structureBoundingBoxIn); for (Facing enumfacing : Facing.Plane.HORIZONTAL)