From 825c1b7f1c03eaf2eb2a297d6b0a32e8f43b0fd2 Mon Sep 17 00:00:00 2001 From: NULL511 Date: Mon, 17 Jun 2024 15:25:10 -0400 Subject: [PATCH 1/3] fix false voxels with block entity --- shaders/lib/voxel_write.glsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shaders/lib/voxel_write.glsl b/shaders/lib/voxel_write.glsl index 6b08eb5..70f2bd7 100644 --- a/shaders/lib/voxel_write.glsl +++ b/shaders/lib/voxel_write.glsl @@ -32,7 +32,7 @@ void PopulateShadowVoxel(const in vec3 playerPos) { ((renderStage == MC_RENDER_STAGE_ENTITIES && (currentRenderedItemId > 0 || entityId > 0)) || renderStage == MC_RENDER_STAGE_BLOCK_ENTITIES) ) { if (renderStage == MC_RENDER_STAGE_BLOCK_ENTITIES) { - if (blockEntityId > 0) + if (blockEntityId > 0 && blockEntityId < 1000) voxelId = uint(blockEntityId); } else if (currentRenderedItemId > 0 && currentRenderedItemId < 1000) { From d9e82f688a0bff82e1b692b656ca7ef8ebae36c5 Mon Sep 17 00:00:00 2001 From: NULL511 Date: Mon, 17 Jun 2024 15:32:30 -0400 Subject: [PATCH 2/3] fix glass mapping --- shaders/block.properties | 40 +++++++++++++++---------------- shaders/dimensions/setup.csh | 28 ++++++++++++---------- shaders/lib/blocks.glsl | 40 +++++++++++++++---------------- shaders/template/block.properties | 24 +++++++++---------- 4 files changed, 68 insertions(+), 64 deletions(-) diff --git a/shaders/block.properties b/shaders/block.properties index ca41ccf..33e50f8 100644 --- a/shaders/block.properties +++ b/shaders/block.properties @@ -487,45 +487,45 @@ block.265=mcwlights:yellow_lamp:lit=true mcwlights:yellow_paper_lamp:lit=true mc block.301=glass glass_pane -block.302=honey_block +block.302=black_stained_glass black_stained_glass_pane -block.303=ice frosted_ice +block.303=blue_stained_glass blue_stained_glass_pane -block.304=nether_portal +block.304=brown_stained_glass brown_stained_glass_pane -block.305=slime_block +block.305=cyan_stained_glass cyan_stained_glass_pane -block.306=black_stained_glass black_stained_glass_pane +block.306=gray_stained_glass gray_stained_glass_pane -block.307=blue_stained_glass blue_stained_glass_pane +block.307=green_stained_glass green_stained_glass_pane -block.308=brown_stained_glass brown_stained_glass_pane +block.308=light_blue_stained_glass light_blue_stained_glass_pane -block.309=cyan_stained_glass cyan_stained_glass_pane +block.309=light_gray_stained_glass light_gray_stained_glass_pane -block.310=gray_stained_glass gray_stained_glass_pane +block.310=lime_stained_glass lime_stained_glass_pane -block.311=green_stained_glass green_stained_glass_pane +block.311=magenta_stained_glass magenta_stained_glass_pane -block.312=light_blue_stained_glass light_blue_stained_glass_pane +block.312=orange_stained_glass orange_stained_glass_pane -block.313=light_gray_stained_glass light_gray_stained_glass_pane +block.313=pink_stained_glass pink_stained_glass_pane -block.314=lime_stained_glass lime_stained_glass_pane +block.314=purple_stained_glass purple_stained_glass_pane -block.315=magenta_stained_glass magenta_stained_glass_pane +block.315=red_stained_glass red_stained_glass_pane -block.316=orange_stained_glass orange_stained_glass_pane +block.316=white_stained_glass white_stained_glass_pane -block.317=pink_stained_glass pink_stained_glass_pane +block.317=yellow_stained_glass yellow_stained_glass_pane -block.318=purple_stained_glass purple_stained_glass_pane +block.318=honey_block -block.319=red_stained_glass red_stained_glass_pane +block.319=ice frosted_ice -block.320=white_stained_glass white_stained_glass_pane +block.320=nether_portal -block.321=yellow_stained_glass yellow_stained_glass_pane +block.321=slime_block ####### ----- LPV shapes ----- ####### diff --git a/shaders/dimensions/setup.csh b/shaders/dimensions/setup.csh index 30f7371..43c599e 100644 --- a/shaders/dimensions/setup.csh +++ b/shaders/dimensions/setup.csh @@ -830,18 +830,8 @@ void main() { // reflective translucents / glass switch (blockId) { - case BLOCK_HONEY: - tintColor = vec3(0.984, 0.733, 0.251); - mixWeight = 1.0; - break; - case BLOCK_NETHER_PORTAL: - lightColor = vec3(0.502, 0.165, 0.831); - tintColor = vec3(0.502, 0.165, 0.831); - lightRange = 11.0; - mixWeight = 1.0; - break; - case BLOCK_SLIME: - tintColor = vec3(0.408, 0.725, 0.329); + case BLOCK_GLASS: + tintColor = vec3(1.0); mixWeight = 1.0; break; case BLOCK_GLASS_BLACK: @@ -908,6 +898,20 @@ void main() { tintColor = vec3(0.965, 0.965, 0.123); mixWeight = 1.0; break; + case BLOCK_HONEY: + tintColor = vec3(0.984, 0.733, 0.251); + mixWeight = 1.0; + break; + case BLOCK_NETHER_PORTAL: + lightColor = vec3(0.502, 0.165, 0.831); + tintColor = vec3(0.502, 0.165, 0.831); + lightRange = 11.0; + mixWeight = 1.0; + break; + case BLOCK_SLIME: + tintColor = vec3(0.408, 0.725, 0.329); + mixWeight = 1.0; + break; // LPV shapes diff --git a/shaders/lib/blocks.glsl b/shaders/lib/blocks.glsl index 9cf37ce..ed6ea06 100644 --- a/shaders/lib/blocks.glsl +++ b/shaders/lib/blocks.glsl @@ -179,26 +179,26 @@ #define BLOCK_LAMP_LIT_WHITE 264 #define BLOCK_LAMP_LIT_YELLOW 265 #define BLOCK_GLASS 301 -#define BLOCK_HONEY 302 -#define BLOCK_ICE 303 -#define BLOCK_NETHER_PORTAL 304 -#define BLOCK_SLIME 305 -#define BLOCK_GLASS_BLACK 306 -#define BLOCK_GLASS_BLUE 307 -#define BLOCK_GLASS_BROWN 308 -#define BLOCK_GLASS_CYAN 309 -#define BLOCK_GLASS_GRAY 310 -#define BLOCK_GLASS_GREEN 311 -#define BLOCK_GLASS_LIGHT_BLUE 312 -#define BLOCK_GLASS_LIGHT_GRAY 313 -#define BLOCK_GLASS_LIME 314 -#define BLOCK_GLASS_MAGENTA 315 -#define BLOCK_GLASS_ORANGE 316 -#define BLOCK_GLASS_PINK 317 -#define BLOCK_GLASS_PURPLE 318 -#define BLOCK_GLASS_RED 319 -#define BLOCK_GLASS_WHITE 320 -#define BLOCK_GLASS_YELLOW 321 +#define BLOCK_GLASS_BLACK 302 +#define BLOCK_GLASS_BLUE 303 +#define BLOCK_GLASS_BROWN 304 +#define BLOCK_GLASS_CYAN 305 +#define BLOCK_GLASS_GRAY 306 +#define BLOCK_GLASS_GREEN 307 +#define BLOCK_GLASS_LIGHT_BLUE 308 +#define BLOCK_GLASS_LIGHT_GRAY 309 +#define BLOCK_GLASS_LIME 310 +#define BLOCK_GLASS_MAGENTA 311 +#define BLOCK_GLASS_ORANGE 312 +#define BLOCK_GLASS_PINK 313 +#define BLOCK_GLASS_PURPLE 314 +#define BLOCK_GLASS_RED 315 +#define BLOCK_GLASS_WHITE 316 +#define BLOCK_GLASS_YELLOW 317 +#define BLOCK_HONEY 318 +#define BLOCK_ICE 319 +#define BLOCK_NETHER_PORTAL 320 +#define BLOCK_SLIME 321 #define BLOCK_LPV_IGNORE 401 #define BLOCK_CARPET 402 #define BLOCK_DOOR_N 403 diff --git a/shaders/template/block.properties b/shaders/template/block.properties index 483d5dd..1126845 100644 --- a/shaders/template/block.properties +++ b/shaders/template/block.properties @@ -670,18 +670,6 @@ block.*= minecraft:hanging_roots minecraft:weeping_vines minecraft:cave_vines:be #= BLOCK_GLASS block.301= glass glass_pane - #= BLOCK_HONEY - block.*= honey_block - - #= BLOCK_ICE - block.*= ice frosted_ice - - #= BLOCK_NETHER_PORTAL - block.*= nether_portal - - #= BLOCK_SLIME - block.*= slime_block - #= BLOCK_GLASS_BLACK block.*= black_stained_glass black_stained_glass_pane @@ -730,6 +718,18 @@ block.*= minecraft:hanging_roots minecraft:weeping_vines minecraft:cave_vines:be #= BLOCK_GLASS_YELLOW block.*= yellow_stained_glass yellow_stained_glass_pane + #= BLOCK_HONEY + block.*= honey_block + + #= BLOCK_ICE + block.*= ice frosted_ice + + #= BLOCK_NETHER_PORTAL + block.*= nether_portal + + #= BLOCK_SLIME + block.*= slime_block + ####### ----- LPV shapes ----- ####### From a05ca58044806bbded3cd6a0f20838783efb1a6d Mon Sep 17 00:00:00 2001 From: NULL511 Date: Mon, 17 Jun 2024 16:10:33 -0400 Subject: [PATCH 3/3] more fixed block entity mappings --- shaders/lib/voxel_write.glsl | 4 ++-- shaders/world0/shadow.vsh | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/shaders/lib/voxel_write.glsl b/shaders/lib/voxel_write.glsl index 70f2bd7..2c5be0a 100644 --- a/shaders/lib/voxel_write.glsl +++ b/shaders/lib/voxel_write.glsl @@ -11,7 +11,6 @@ void SetVoxelBlock(const in vec3 playerPos, const in uint blockId) { } void PopulateShadowVoxel(const in vec3 playerPos) { - //int blockId = int(mc_Entity.x + 0.5); uint voxelId = uint(mc_Entity.x + 0.5); vec3 originPos = playerPos; @@ -22,6 +21,7 @@ void PopulateShadowVoxel(const in vec3 playerPos) { #ifdef IRIS_FEATURE_BLOCK_EMISSION_ATTRIBUTE if (voxelId == 0u && at_midBlock.w > 0) voxelId = uint(BLOCK_LIGHT_1 + at_midBlock.w - 1); #endif + if (voxelId == 0u) voxelId = 1u; originPos += at_midBlock.xyz/64.0; @@ -32,7 +32,7 @@ void PopulateShadowVoxel(const in vec3 playerPos) { ((renderStage == MC_RENDER_STAGE_ENTITIES && (currentRenderedItemId > 0 || entityId > 0)) || renderStage == MC_RENDER_STAGE_BLOCK_ENTITIES) ) { if (renderStage == MC_RENDER_STAGE_BLOCK_ENTITIES) { - if (blockEntityId > 0 && blockEntityId < 1000) + if (blockEntityId > 0 && blockEntityId < 500) voxelId = uint(blockEntityId); } else if (currentRenderedItemId > 0 && currentRenderedItemId < 1000) { diff --git a/shaders/world0/shadow.vsh b/shaders/world0/shadow.vsh index 134feb7..9fdcbdc 100644 --- a/shaders/world0/shadow.vsh +++ b/shaders/world0/shadow.vsh @@ -235,7 +235,7 @@ void main() { (InterpolateFromBase && (blockId == BLOCK_GRASS_TALL_LOWER || blockId == BLOCK_GROUND_WAVING || blockId == BLOCK_GRASS_SHORT || blockId == BLOCK_SAPLING || blockId == BLOCK_GROUND_WAVING_VERTICAL)) // these wave off of the ceiling. the area connected to the ceiling does not wave. - || (!InterpolateFromBase && (blockId == 17)) + || (!InterpolateFromBase && (blockId == BLOCK_VINE_OTHER)) // these wave off of the air. they wave uniformly || (blockId == BLOCK_GRASS_TALL_UPPER || blockId == BLOCK_AIR_WAVING) @@ -256,7 +256,8 @@ void main() { #ifdef DISTORT_SHADOWMAP - if(entityId == 1100) position.xyz = position.xyz - normalize(gl_NormalMatrix * gl_Normal) * 0.25; + if (entityId == ENTITY_SSS_MEDIUM || entityId == ENTITY_SLIME) + position.xyz = position.xyz - normalize(gl_NormalMatrix * gl_Normal) * 0.25; gl_Position = BiasShadowProjection(toClipSpace3(position)); #else