From a05ca58044806bbded3cd6a0f20838783efb1a6d Mon Sep 17 00:00:00 2001 From: NULL511 Date: Mon, 17 Jun 2024 16:10:33 -0400 Subject: [PATCH] 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