fix snow layers mapping; fix block entity mappings; reduce shadow lpv code

This commit is contained in:
NULL511
2024-06-16 16:22:34 -04:00
parent 7443074a9d
commit bf20af2d12
11 changed files with 503 additions and 417 deletions

View File

@ -48,50 +48,7 @@ void main() {
vec3 playerpos = mat3(shadowModelViewInverse) * position + shadowModelViewInverse[3].xyz;
#endif
if (
renderStage == MC_RENDER_STAGE_TERRAIN_SOLID || renderStage == MC_RENDER_STAGE_TERRAIN_TRANSLUCENT ||
renderStage == MC_RENDER_STAGE_TERRAIN_CUTOUT || renderStage == MC_RENDER_STAGE_TERRAIN_CUTOUT_MIPPED
) {
vec3 originPos = playerpos + at_midBlock.xyz/64.0;
uint voxelId = uint(mc_Entity.x + 0.5);
#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;
SetVoxelBlock(originPos, voxelId);
}
#ifdef LPV_ENTITY_LIGHTS
if (
(currentRenderedItemId > 0 || entityId > 0) &&
(renderStage == MC_RENDER_STAGE_BLOCK_ENTITIES || renderStage == MC_RENDER_STAGE_ENTITIES)
) {
uint voxelId = 0u;
if (currentRenderedItemId > 0) {
if (entityId != ENTITY_ITEM_FRAME && entityId != ENTITY_PLAYER)
voxelId = uint(currentRenderedItemId);
}
else {
switch (entityId) {
case ENTITY_BLAZE:
case ENTITY_END_CRYSTAL:
// case ENTITY_FIREBALL_SMALL:
case ENTITY_GLOW_SQUID:
case ENTITY_MAGMA_CUBE:
case ENTITY_SPECTRAL_ARROW:
case ENTITY_TNT:
voxelId = uint(entityId);
break;
}
}
if (voxelId > 0u)
SetVoxelBlock(playerpos, voxelId);
}
#endif
PopulateShadowVoxel(playerpos);
#endif
gl_Position = vec4(-1.0);