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

File diff suppressed because one or more lines are too long

View File

@ -419,7 +419,7 @@ void main() {
float gray = dot(Albedo.rgb, vec3(0.2, 1.0, 0.07));
if (
blockID == BLOCK_AMETHYST_BUD_MEDIUM || blockID == BLOCK_AMETHYST_BUD_LARGE || blockID == BLOCK_AMETHYST_CLUSTER
|| blockID == BLOCK_SSS_STRONG || blockID == BLOCK_SSS_WEAK
|| blockID == BLOCK_SSS_STRONG || blockID == BLOCK_SSS_WEAK || blockID == BLOCK_SNOW_LAYERS
|| blockID >= 10 && blockID < 80
) {
// IR Reflective (Pink-red)

View File

@ -297,7 +297,7 @@ void main() {
// medium
if (
mc_Entity.x == BLOCK_SSS_WEAK || mc_Entity.x == BLOCK_SSS_WEAK_2 ||
mc_Entity.x == BLOCK_SSS_WEAK || mc_Entity.x == BLOCK_SSS_WEAK_2 || mc_Entity.x == BLOCK_SNOW_LAYERS ||
mc_Entity.x == BLOCK_AMETHYST_BUD_MEDIUM || mc_Entity.x == BLOCK_AMETHYST_BUD_LARGE || mc_Entity.x == BLOCK_AMETHYST_CLUSTER ||
mc_Entity.x == BLOCK_BAMBOO || mc_Entity.x == BLOCK_SAPLING || mc_Entity.x == BLOCK_VINE
) {

View File

@ -957,6 +957,7 @@ void main() {
mixWeight = 0.5;
break;
case BLOCK_SLAB_BOTTOM:
case BLOCK_SNOW_LAYERS:
mixMask = BuildLpvMask(1u, 1u, 1u, 1u, 1u, 0u);
mixWeight = 0.5;
break;

View File

@ -212,70 +212,71 @@
#define BLOCK_PRESSURE_PLATE 411
#define BLOCK_SLAB_TOP 412
#define BLOCK_SLAB_BOTTOM 413
#define BLOCK_TRAPDOOR_BOTTOM 414
#define BLOCK_TRAPDOOR_TOP 415
#define BLOCK_TRAPDOOR_N 416
#define BLOCK_TRAPDOOR_E 417
#define BLOCK_TRAPDOOR_S 418
#define BLOCK_TRAPDOOR_W 419
#define BLOCK_WALL_POST 420
#define BLOCK_WALL_MIN 420
#define BLOCK_WALL_POST_LOW_N 421
#define BLOCK_WALL_POST_LOW_E 422
#define BLOCK_WALL_POST_LOW_S 423
#define BLOCK_WALL_POST_LOW_W 424
#define BLOCK_WALL_POST_LOW_N_S 425
#define BLOCK_WALL_POST_LOW_W_E 426
#define BLOCK_WALL_POST_LOW_N_W 427
#define BLOCK_WALL_POST_LOW_N_E 428
#define BLOCK_WALL_POST_LOW_S_W 429
#define BLOCK_WALL_POST_LOW_S_E 430
#define BLOCK_WALL_POST_LOW_N_W_S 431
#define BLOCK_WALL_POST_LOW_N_E_S 432
#define BLOCK_WALL_POST_LOW_W_N_E 433
#define BLOCK_WALL_POST_LOW_W_S_E 434
#define BLOCK_WALL_POST_LOW_ALL 435
#define BLOCK_WALL_POST_TALL_N 436
#define BLOCK_WALL_POST_TALL_E 437
#define BLOCK_WALL_POST_TALL_S 438
#define BLOCK_WALL_POST_TALL_W 439
#define BLOCK_WALL_POST_TALL_N_S 440
#define BLOCK_WALL_POST_TALL_W_E 441
#define BLOCK_WALL_POST_TALL_N_W 442
#define BLOCK_WALL_POST_TALL_N_E 443
#define BLOCK_WALL_POST_TALL_S_W 444
#define BLOCK_WALL_POST_TALL_S_E 445
#define BLOCK_WALL_POST_TALL_N_W_S 446
#define BLOCK_WALL_POST_TALL_N_E_S 447
#define BLOCK_WALL_POST_TALL_W_N_E 448
#define BLOCK_WALL_POST_TALL_W_S_E 449
#define BLOCK_WALL_POST_TALL_ALL 450
#define BLOCK_WALL_POST_TALL_N_LOW_S 451
#define BLOCK_WALL_POST_TALL_E_LOW_W 452
#define BLOCK_WALL_POST_TALL_S_LOW_N 453
#define BLOCK_WALL_POST_TALL_W_LOW_E 454
#define BLOCK_WALL_POST_TALL_N_S_LOW_W_E 455
#define BLOCK_WALL_POST_TALL_W_E_LOW_N_S 456
#define BLOCK_WALL_POST_TALL_N_W_LOW_S_E 457
#define BLOCK_WALL_POST_TALL_N_E_LOW_S_W 458
#define BLOCK_WALL_POST_TALL_S_W_LOW_N_E 459
#define BLOCK_WALL_POST_TALL_S_E_LOW_N_W 460
#define BLOCK_WALL_LOW_N_S 461
#define BLOCK_WALL_LOW_W_E 462
#define BLOCK_WALL_LOW_N_W 463
#define BLOCK_WALL_LOW_N_E 464
#define BLOCK_WALL_LOW_S_W 465
#define BLOCK_WALL_LOW_S_E 466
#define BLOCK_WALL_LOW_ALL 467
#define BLOCK_WALL_TALL_N_S 468
#define BLOCK_WALL_TALL_W_E 469
#define BLOCK_WALL_TALL_N_W 470
#define BLOCK_WALL_TALL_N_E 471
#define BLOCK_WALL_TALL_S_W 472
#define BLOCK_WALL_TALL_S_E 473
#define BLOCK_WALL_TALL_ALL 474
#define BLOCK_WALL_TALL_N_S_LOW_W_E 475
#define BLOCK_WALL_TALL_W_E_LOW_N_S 476
#define BLOCK_WALL_MAX 476
#define BLOCK_SNOW_LAYERS 414
#define BLOCK_TRAPDOOR_BOTTOM 415
#define BLOCK_TRAPDOOR_TOP 416
#define BLOCK_TRAPDOOR_N 417
#define BLOCK_TRAPDOOR_E 418
#define BLOCK_TRAPDOOR_S 419
#define BLOCK_TRAPDOOR_W 420
#define BLOCK_WALL_POST 421
#define BLOCK_WALL_MIN 421
#define BLOCK_WALL_POST_LOW_N 422
#define BLOCK_WALL_POST_LOW_E 423
#define BLOCK_WALL_POST_LOW_S 424
#define BLOCK_WALL_POST_LOW_W 425
#define BLOCK_WALL_POST_LOW_N_S 426
#define BLOCK_WALL_POST_LOW_W_E 427
#define BLOCK_WALL_POST_LOW_N_W 428
#define BLOCK_WALL_POST_LOW_N_E 429
#define BLOCK_WALL_POST_LOW_S_W 430
#define BLOCK_WALL_POST_LOW_S_E 431
#define BLOCK_WALL_POST_LOW_N_W_S 432
#define BLOCK_WALL_POST_LOW_N_E_S 433
#define BLOCK_WALL_POST_LOW_W_N_E 434
#define BLOCK_WALL_POST_LOW_W_S_E 435
#define BLOCK_WALL_POST_LOW_ALL 436
#define BLOCK_WALL_POST_TALL_N 437
#define BLOCK_WALL_POST_TALL_E 438
#define BLOCK_WALL_POST_TALL_S 439
#define BLOCK_WALL_POST_TALL_W 440
#define BLOCK_WALL_POST_TALL_N_S 441
#define BLOCK_WALL_POST_TALL_W_E 442
#define BLOCK_WALL_POST_TALL_N_W 443
#define BLOCK_WALL_POST_TALL_N_E 444
#define BLOCK_WALL_POST_TALL_S_W 445
#define BLOCK_WALL_POST_TALL_S_E 446
#define BLOCK_WALL_POST_TALL_N_W_S 447
#define BLOCK_WALL_POST_TALL_N_E_S 448
#define BLOCK_WALL_POST_TALL_W_N_E 449
#define BLOCK_WALL_POST_TALL_W_S_E 450
#define BLOCK_WALL_POST_TALL_ALL 451
#define BLOCK_WALL_POST_TALL_N_LOW_S 452
#define BLOCK_WALL_POST_TALL_E_LOW_W 453
#define BLOCK_WALL_POST_TALL_S_LOW_N 454
#define BLOCK_WALL_POST_TALL_W_LOW_E 455
#define BLOCK_WALL_POST_TALL_N_S_LOW_W_E 456
#define BLOCK_WALL_POST_TALL_W_E_LOW_N_S 457
#define BLOCK_WALL_POST_TALL_N_W_LOW_S_E 458
#define BLOCK_WALL_POST_TALL_N_E_LOW_S_W 459
#define BLOCK_WALL_POST_TALL_S_W_LOW_N_E 460
#define BLOCK_WALL_POST_TALL_S_E_LOW_N_W 461
#define BLOCK_WALL_LOW_N_S 462
#define BLOCK_WALL_LOW_W_E 463
#define BLOCK_WALL_LOW_N_W 464
#define BLOCK_WALL_LOW_N_E 465
#define BLOCK_WALL_LOW_S_W 466
#define BLOCK_WALL_LOW_S_E 467
#define BLOCK_WALL_LOW_ALL 468
#define BLOCK_WALL_TALL_N_S 469
#define BLOCK_WALL_TALL_W_E 470
#define BLOCK_WALL_TALL_N_W 471
#define BLOCK_WALL_TALL_N_E 472
#define BLOCK_WALL_TALL_S_W 473
#define BLOCK_WALL_TALL_S_E 474
#define BLOCK_WALL_TALL_ALL 475
#define BLOCK_WALL_TALL_N_S_LOW_W_E 476
#define BLOCK_WALL_TALL_W_E_LOW_N_S 477
#define BLOCK_WALL_MAX 477
#define BLOCK_END_PORTAL 500
#define BLOCK_SIGN 501

View File

@ -9,3 +9,52 @@ void SetVoxelBlock(const in vec3 playerPos, const in uint blockId) {
imageStore(imgVoxelMask, voxelPos, uvec4(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;
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
) {
#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;
}
#ifdef LPV_ENTITY_LIGHTS
if (
((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)
voxelId = uint(blockEntityId);
}
else if (currentRenderedItemId > 0 && currentRenderedItemId < 1000) {
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;
}
}
}
#endif
if (voxelId > 0u)
SetVoxelBlock(originPos, voxelId);
}

View File

@ -56,7 +56,8 @@ block.*= minecraft:hanging_roots minecraft:weeping_vines minecraft:cave_vines:be
## weak sss
#= BLOCK_SSS_WEAK
block.*= minecraft:amethyst_block minecraft:budding_amethyst minecraft:small_amethyst_bud minecraft:pitcher_plant minecraft:grass_block:snowy=true minecraft:snow_block minecraft:snow powder_snow cobweb red_mushroom_block brown_mushroom_block weeping_vines weeping_vines_plant twisting_vines twisting_vines_plant tube_coral tube_coral_block tube_coral_fan tube_coral_wall_fan horn_coral horn_coral_block horn_coral_fan horn_coral_wall_fan fire_coral fire_coral_block fire_coral_fan fire_coral_wall_fan dead_brain_coral dead_brain_coral_block dead_brain_coral_fan dead_brain_coral_wall_fan dead_bubble_coral dead_bubble_coral_block dead_bubble_coral_fan dead_bubble_coral_wall_fan dead_bush dead_fire_coral dead_fire_coral_block dead_fire_coral_fan dead_fire_coral_wall_fan dead_horn_coral dead_horn_coral_block dead_horn_coral_fan dead_horn_coral_wall_fan dead_tube_coral dead_tube_coral_block dead_tube_coral_fan dead_tube_coral_wall_fan bubble_coral bubble_coral_block bubble_coral_fan bubble_coral_wall_fan brain_coral brain_coral_block brain_coral_fan brain_coral_wall_fan minecraft:spore_blossom minecraft:cave_vines_plant:berries=false minecraft:glow_lichen minecraft:melon minecraft:pumpkin minecraft:big_dripleaf minecraft:big_dripleaf_stem minecraft:cactus minecraft:hay_block minecraft:brown_mushroom minecraft:mushroom_stem minecraft:sugar_cane minecraft:crimson_fungus minecraft:warped_fungus minecraft:sea_pickle:waterlogged=false minecraft:honeycomb_block
block.*= minecraft:amethyst_block minecraft:budding_amethyst minecraft:small_amethyst_bud minecraft:pitcher_plant minecraft:grass_block:snowy=true snow:layers=5 snow:layers=6 snow:layers=7 snow:layers=8 minecraft:snow_block powder_snow cobweb red_mushroom_block brown_mushroom_block weeping_vines weeping_vines_plant twisting_vines twisting_vines_plant tube_coral tube_coral_block tube_coral_fan tube_coral_wall_fan horn_coral horn_coral_block horn_coral_fan horn_coral_wall_fan fire_coral fire_coral_block fire_coral_fan fire_coral_wall_fan dead_brain_coral dead_brain_coral_block dead_brain_coral_fan dead_brain_coral_wall_fan dead_bubble_coral dead_bubble_coral_block dead_bubble_coral_fan dead_bubble_coral_wall_fan dead_bush dead_fire_coral dead_fire_coral_block dead_fire_coral_fan dead_fire_coral_wall_fan dead_horn_coral dead_horn_coral_block dead_horn_coral_fan dead_horn_coral_wall_fan dead_tube_coral dead_tube_coral_block dead_tube_coral_fan dead_tube_coral_wall_fan bubble_coral bubble_coral_block bubble_coral_fan bubble_coral_wall_fan brain_coral brain_coral_block brain_coral_fan brain_coral_wall_fan minecraft:spore_blossom minecraft:cave_vines_plant:berries=false minecraft:glow_lichen minecraft:melon minecraft:pumpkin minecraft:big_dripleaf minecraft:big_dripleaf_stem minecraft:cactus minecraft:hay_block minecraft:brown_mushroom minecraft:mushroom_stem minecraft:sugar_cane minecraft:crimson_fungus minecraft:warped_fungus minecraft:sea_pickle:waterlogged=false minecraft:honeycomb_block
#removed: minecraft:snow[1-4]
## weak sss
#= BLOCK_SSS_WEAK_2
@ -94,225 +95,298 @@ block.*= minecraft:hanging_roots minecraft:weeping_vines minecraft:cave_vines:be
#= BLOCK_BREWING_STAND
block.*= brewing_stand
group.candle= candle black_candle blue_candle brown_candle cyan_candle gray_candle green_candle light_blue_candle light_gray_candle lime_candle magenta_candle orange_candle pink_candle purple_candle red_candle white_candle yellow_candle \
supplementaries:candle_holder supplementaries:candle_holder_black supplementaries:candle_holder_blue supplementaries:candle_holder_brown supplementaries:candle_holder_cyan supplementaries:candle_holder_gray supplementaries:candle_holder_green supplementaries:candle_holder_light_blue supplementaries:candle_holder_light_gray supplementaries:candle_holder_lime supplementaries:candle_holder_magenta supplementaries:candle_holder_orange supplementaries:candle_holder_pink supplementaries:candle_holder_purple supplementaries:candle_holder_red supplementaries:candle_holder_white supplementaries:candle_holder_yellow
group.candle= candle black_candle blue_candle brown_candle cyan_candle gray_candle green_candle light_blue_candle light_gray_candle lime_candle magenta_candle orange_candle pink_candle purple_candle red_candle white_candle yellow_candle
group.supplementaries_candle= supplementaries:candle_holder supplementaries:candle_holder_black supplementaries:candle_holder_blue supplementaries:candle_holder_brown supplementaries:candle_holder_cyan supplementaries:candle_holder_gray supplementaries:candle_holder_green supplementaries:candle_holder_light_blue supplementaries:candle_holder_light_gray supplementaries:candle_holder_lime supplementaries:candle_holder_magenta supplementaries:candle_holder_orange supplementaries:candle_holder_pink supplementaries:candle_holder_purple supplementaries:candle_holder_red supplementaries:candle_holder_white supplementaries:candle_holder_yellow
#ifdef LPV_COLORED_CANDLES
#= BLOCK_CANDLES_PLAIN_LIT_1
block.*= candle:candles=1:lit=true supplementaries:candle_holder:candles=1:lit=true
block.*= candle:candles=1:lit=true \
supplementaries:candle_holder:candles=1:lit=true
#= BLOCK_CANDLES_PLAIN_LIT_2
block.*= candle:candles=2:lit=true supplementaries:candle_holder:candles=2:lit=true
block.*= candle:candles=2:lit=true \
supplementaries:candle_holder:candles=2:lit=true
#= BLOCK_CANDLES_PLAIN_LIT_3
block.*= candle:candles=3:lit=true supplementaries:candle_holder:candles=3:lit=true
block.*= candle:candles=3:lit=true \
supplementaries:candle_holder:candles=3:lit=true
#= BLOCK_CANDLES_PLAIN_LIT_4
block.*= candle:candles=4:lit=true supplementaries:candle_holder:candles=4:lit=true
block.*= candle:candles=4:lit=true \
supplementaries:candle_holder:candles=4:lit=true
#= BLOCK_CANDLES_BLACK_LIT_1
block.*= black_candle:candles=1:lit=true supplementaries:candle_holder_black:candles=1:lit=true
block.*= black_candle:candles=1:lit=true \
supplementaries:candle_holder_black:candles=1:lit=true
#= BLOCK_CANDLES_BLACK_LIT_2
block.*= black_candle:candles=2:lit=true supplementaries:candle_holder_black:candles=2:lit=true
block.*= black_candle:candles=2:lit=true \
supplementaries:candle_holder_black:candles=2:lit=true
#= BLOCK_CANDLES_BLACK_LIT_3
block.*= black_candle:candles=3:lit=true supplementaries:candle_holder_black:candles=3:lit=true
block.*= black_candle:candles=3:lit=true \
supplementaries:candle_holder_black:candles=3:lit=true
#= BLOCK_CANDLES_BLACK_LIT_4
block.*= black_candle:candles=4:lit=true supplementaries:candle_holder_black:candles=4:lit=true
block.*= black_candle:candles=4:lit=true \
supplementaries:candle_holder_black:candles=4:lit=true
#= BLOCK_CANDLES_BLUE_LIT_1
block.*= blue_candle:candles=1:lit=true supplementaries:candle_holder_blue:candles=1:lit=true
block.*= blue_candle:candles=1:lit=true \
supplementaries:candle_holder_blue:candles=1:lit=true
#= BLOCK_CANDLES_BLUE_LIT_2
block.*= blue_candle:candles=2:lit=true supplementaries:candle_holder_blue:candles=2:lit=true
block.*= blue_candle:candles=2:lit=true \
supplementaries:candle_holder_blue:candles=2:lit=true
#= BLOCK_CANDLES_BLUE_LIT_3
block.*= blue_candle:candles=3:lit=true supplementaries:candle_holder_blue:candles=3:lit=true
block.*= blue_candle:candles=3:lit=true \
supplementaries:candle_holder_blue:candles=3:lit=true
#= BLOCK_CANDLES_BLUE_LIT_4
block.*= blue_candle:candles=4:lit=true supplementaries:candle_holder_blue:candles=4:lit=true
block.*= blue_candle:candles=4:lit=true \
supplementaries:candle_holder_blue:candles=4:lit=true
#= BLOCK_CANDLES_BROWN_LIT_1
block.*= brown_candle:candles=1:lit=true supplementaries:candle_holder_brown:candles=1:lit=true
block.*= brown_candle:candles=1:lit=true \
supplementaries:candle_holder_brown:candles=1:lit=true
#= BLOCK_CANDLES_BROWN_LIT_2
block.*= brown_candle:candles=2:lit=true supplementaries:candle_holder_brown:candles=2:lit=true
block.*= brown_candle:candles=2:lit=true \
supplementaries:candle_holder_brown:candles=2:lit=true
#= BLOCK_CANDLES_BROWN_LIT_3
block.*= brown_candle:candles=3:lit=true supplementaries:candle_holder_brown:candles=3:lit=true
block.*= brown_candle:candles=3:lit=true \
supplementaries:candle_holder_brown:candles=3:lit=true
#= BLOCK_CANDLES_BROWN_LIT_4
block.*= brown_candle:candles=4:lit=true supplementaries:candle_holder_brown:candles=4:lit=true
block.*= brown_candle:candles=4:lit=true \
supplementaries:candle_holder_brown:candles=4:lit=true
#= BLOCK_CANDLES_CYAN_LIT_1
block.*= cyan_candle:candles=1:lit=true supplementaries:candle_holder_cyan:candles=1:lit=true
block.*= cyan_candle:candles=1:lit=true \
supplementaries:candle_holder_cyan:candles=1:lit=true
#= BLOCK_CANDLES_CYAN_LIT_2
block.*= cyan_candle:candles=2:lit=true supplementaries:candle_holder_cyan:candles=2:lit=true
block.*= cyan_candle:candles=2:lit=true \
supplementaries:candle_holder_cyan:candles=2:lit=true
#= BLOCK_CANDLES_CYAN_LIT_3
block.*= cyan_candle:candles=3:lit=true supplementaries:candle_holder_cyan:candles=3:lit=true
block.*= cyan_candle:candles=3:lit=true \
supplementaries:candle_holder_cyan:candles=3:lit=true
#= BLOCK_CANDLES_CYAN_LIT_4
block.*= cyan_candle:candles=4:lit=true supplementaries:candle_holder_cyan:candles=4:lit=true
block.*= cyan_candle:candles=4:lit=true \
supplementaries:candle_holder_cyan:candles=4:lit=true
#= BLOCK_CANDLES_GRAY_LIT_1
block.*= gray_candle:candles=1:lit=true supplementaries:candle_holder_gray:candles=1:lit=true
block.*= gray_candle:candles=1:lit=true \
supplementaries:candle_holder_gray:candles=1:lit=true
#= BLOCK_CANDLES_GRAY_LIT_2
block.*= gray_candle:candles=2:lit=true supplementaries:candle_holder_gray:candles=2:lit=true
block.*= gray_candle:candles=2:lit=true \
supplementaries:candle_holder_gray:candles=2:lit=true
#= BLOCK_CANDLES_GRAY_LIT_3
block.*= gray_candle:candles=2:lit=true supplementaries:candle_holder_gray:candles=3:lit=true
block.*= gray_candle:candles=2:lit=true \
supplementaries:candle_holder_gray:candles=3:lit=true
#= BLOCK_CANDLES_GRAY_LIT_4
block.*= gray_candle:candles=4:lit=true supplementaries:candle_holder_gray:candles=4:lit=true
block.*= gray_candle:candles=4:lit=true \
supplementaries:candle_holder_gray:candles=4:lit=true
#= BLOCK_CANDLES_GREEN_LIT_1
block.*= green_candle:candles=1:lit=true supplementaries:candle_holder_green:candles=1:lit=true
block.*= green_candle:candles=1:lit=true \
supplementaries:candle_holder_green:candles=1:lit=true
#= BLOCK_CANDLES_GREEN_LIT_2
block.*= green_candle:candles=2:lit=true supplementaries:candle_holder_green:candles=2:lit=true
block.*= green_candle:candles=2:lit=true \
supplementaries:candle_holder_green:candles=2:lit=true
#= BLOCK_CANDLES_GREEN_LIT_3
block.*= green_candle:candles=3:lit=true supplementaries:candle_holder_green:candles=3:lit=true
block.*= green_candle:candles=3:lit=true \
supplementaries:candle_holder_green:candles=3:lit=true
#= BLOCK_CANDLES_GREEN_LIT_4
block.*= green_candle:candles=4:lit=true supplementaries:candle_holder_green:candles=4:lit=true
block.*= green_candle:candles=4:lit=true \
supplementaries:candle_holder_green:candles=4:lit=true
#= BLOCK_CANDLES_LIGHT_BLUE_LIT_1
block.*= light_blue_candle:candles=1:lit=true supplementaries:candle_holder_light_blue:candles=1:lit=true
block.*= light_blue_candle:candles=1:lit=true \
supplementaries:candle_holder_light_blue:candles=1:lit=true
#= BLOCK_CANDLES_LIGHT_BLUE_LIT_2
block.*= light_blue_candle:candles=2:lit=true supplementaries:candle_holder_light_blue:candles=2:lit=true
block.*= light_blue_candle:candles=2:lit=true \
supplementaries:candle_holder_light_blue:candles=2:lit=true
#= BLOCK_CANDLES_LIGHT_BLUE_LIT_3
block.*= light_blue_candle:candles=3:lit=true supplementaries:candle_holder_light_blue:candles=3:lit=true
block.*= light_blue_candle:candles=3:lit=true \
supplementaries:candle_holder_light_blue:candles=3:lit=true
#= BLOCK_CANDLES_LIGHT_BLUE_LIT_4
block.*= light_blue_candle:candles=4:lit=true supplementaries:candle_holder_light_blue:candles=4:lit=true
block.*= light_blue_candle:candles=4:lit=true \
supplementaries:candle_holder_light_blue:candles=4:lit=true
#= BLOCK_CANDLES_LIGHT_GRAY_LIT_1
block.*= light_gray_candle:candles=1:lit=true supplementaries:candle_holder_light_gray:candles=1:lit=true
block.*= light_gray_candle:candles=1:lit=true \
supplementaries:candle_holder_light_gray:candles=1:lit=true
#= BLOCK_CANDLES_LIGHT_GRAY_LIT_2
block.*= light_gray_candle:candles=2:lit=true supplementaries:candle_holder_light_gray:candles=2:lit=true
block.*= light_gray_candle:candles=2:lit=true \
supplementaries:candle_holder_light_gray:candles=2:lit=true
#= BLOCK_CANDLES_LIGHT_GRAY_LIT_3
block.*= light_gray_candle:candles=3:lit=true supplementaries:candle_holder_light_gray:candles=3:lit=true
block.*= light_gray_candle:candles=3:lit=true \
supplementaries:candle_holder_light_gray:candles=3:lit=true
#= BLOCK_CANDLES_LIGHT_GRAY_LIT_4
block.*= light_gray_candle:candles=4:lit=true supplementaries:candle_holder_light_gray:candles=4:lit=true
block.*= light_gray_candle:candles=4:lit=true \
supplementaries:candle_holder_light_gray:candles=4:lit=true
#= BLOCK_CANDLES_LIME_LIT_1
block.*= lime_candle:candles=1:lit=true supplementaries:candle_holder_lime:candles=1:lit=true
block.*= lime_candle:candles=1:lit=true \
supplementaries:candle_holder_lime:candles=1:lit=true
#= BLOCK_CANDLES_LIME_LIT_2
block.*= lime_candle:candles=2:lit=true supplementaries:candle_holder_lime:candles=2:lit=true
block.*= lime_candle:candles=2:lit=true \
supplementaries:candle_holder_lime:candles=2:lit=true
#= BLOCK_CANDLES_LIME_LIT_3
block.*= lime_candle:candles=3:lit=true supplementaries:candle_holder_lime:candles=3:lit=true
block.*= lime_candle:candles=3:lit=true \
supplementaries:candle_holder_lime:candles=3:lit=true
#= BLOCK_CANDLES_LIME_LIT_4
block.*= lime_candle:candles=4:lit=true supplementaries:candle_holder_lime:candles=4:lit=true
block.*= lime_candle:candles=4:lit=true \
supplementaries:candle_holder_lime:candles=4:lit=true
#= BLOCK_CANDLES_MAGENTA_LIT_1
block.*= magenta_candle:candles=1:lit=true supplementaries:candle_holder_magenta:candles=1:lit=true
block.*= magenta_candle:candles=1:lit=true \
supplementaries:candle_holder_magenta:candles=1:lit=true
#= BLOCK_CANDLES_MAGENTA_LIT_2
block.*= magenta_candle:candles=2:lit=true supplementaries:candle_holder_magenta:candles=2:lit=true
block.*= magenta_candle:candles=2:lit=true \
supplementaries:candle_holder_magenta:candles=2:lit=true
#= BLOCK_CANDLES_MAGENTA_LIT_3
block.*= magenta_candle:candles=3:lit=true supplementaries:candle_holder_magenta:candles=3:lit=true
block.*= magenta_candle:candles=3:lit=true \
supplementaries:candle_holder_magenta:candles=3:lit=true
#= BLOCK_CANDLES_MAGENTA_LIT_4
block.*= magenta_candle:candles=4:lit=true supplementaries:candle_holder_magenta:candles=4:lit=true
block.*= magenta_candle:candles=4:lit=true \
supplementaries:candle_holder_magenta:candles=4:lit=true
#= BLOCK_CANDLES_ORANGE_LIT_1
block.*= orange_candle:candles=1:lit=true supplementaries:candle_holder_orange:candles=1:lit=true
block.*= orange_candle:candles=1:lit=true \
supplementaries:candle_holder_orange:candles=1:lit=true
#= BLOCK_CANDLES_ORANGE_LIT_2
block.*= orange_candle:candles=2:lit=true supplementaries:candle_holder_orange:candles=2:lit=true
block.*= orange_candle:candles=2:lit=true \
supplementaries:candle_holder_orange:candles=2:lit=true
#= BLOCK_CANDLES_ORANGE_LIT_3
block.*= orange_candle:candles=3:lit=true supplementaries:candle_holder_orange:candles=3:lit=true
block.*= orange_candle:candles=3:lit=true \
supplementaries:candle_holder_orange:candles=3:lit=true
#= BLOCK_CANDLES_ORANGE_LIT_4
block.*= orange_candle:candles=4:lit=true supplementaries:candle_holder_orange:candles=4:lit=true
block.*= orange_candle:candles=4:lit=true \
supplementaries:candle_holder_orange:candles=4:lit=true
#= BLOCK_CANDLES_PINK_LIT_1
block.*= pink_candle:candles=1:lit=true supplementaries:candle_holder_pink:candles=1:lit=true
block.*= pink_candle:candles=1:lit=true \
supplementaries:candle_holder_pink:candles=1:lit=true
#= BLOCK_CANDLES_PINK_LIT_2
block.*= pink_candle:candles=2:lit=true supplementaries:candle_holder_pink:candles=2:lit=true
block.*= pink_candle:candles=2:lit=true \
supplementaries:candle_holder_pink:candles=2:lit=true
#= BLOCK_CANDLES_PINK_LIT_3
block.*= pink_candle:candles=3:lit=true supplementaries:candle_holder_pink:candles=3:lit=true
block.*= pink_candle:candles=3:lit=true \
supplementaries:candle_holder_pink:candles=3:lit=true
#= BLOCK_CANDLES_PINK_LIT_4
block.*= pink_candle:candles=4:lit=true supplementaries:candle_holder_pink:candles=4:lit=true
block.*= pink_candle:candles=4:lit=true \
supplementaries:candle_holder_pink:candles=4:lit=true
#= BLOCK_CANDLES_PURPLE_LIT_1
block.*= purple_candle:candles=1:lit=true supplementaries:candle_holder_purple:candles=1:lit=true
block.*= purple_candle:candles=1:lit=true \
supplementaries:candle_holder_purple:candles=1:lit=true
#= BLOCK_CANDLES_PURPLE_LIT_2
block.*= purple_candle:candles=2:lit=true supplementaries:candle_holder_purple:candles=2:lit=true
block.*= purple_candle:candles=2:lit=true \
supplementaries:candle_holder_purple:candles=2:lit=true
#= BLOCK_CANDLES_PURPLE_LIT_3
block.*= purple_candle:candles=3:lit=true supplementaries:candle_holder_purple:candles=3:lit=true
block.*= purple_candle:candles=3:lit=true \
supplementaries:candle_holder_purple:candles=3:lit=true
#= BLOCK_CANDLES_PURPLE_LIT_4
block.*= purple_candle:candles=4:lit=true supplementaries:candle_holder_purple:candles=4:lit=true
block.*= purple_candle:candles=4:lit=true \
supplementaries:candle_holder_purple:candles=4:lit=true
#= BLOCK_CANDLES_RED_LIT_1
block.*= red_candle:candles=1:lit=true supplementaries:candle_holder_red:candles=1:lit=true
block.*= red_candle:candles=1:lit=true \
supplementaries:candle_holder_red:candles=1:lit=true
#= BLOCK_CANDLES_RED_LIT_2
block.*= red_candle:candles=2:lit=true supplementaries:candle_holder_red:candles=2:lit=true
block.*= red_candle:candles=2:lit=true \
supplementaries:candle_holder_red:candles=2:lit=true
#= BLOCK_CANDLES_RED_LIT_3
block.*= red_candle:candles=3:lit=true supplementaries:candle_holder_red:candles=3:lit=true
block.*= red_candle:candles=3:lit=true \
supplementaries:candle_holder_red:candles=3:lit=true
#= BLOCK_CANDLES_RED_LIT_4
block.*= red_candle:candles=4:lit=true supplementaries:candle_holder_red:candles=4:lit=true
block.*= red_candle:candles=4:lit=true \
supplementaries:candle_holder_red:candles=4:lit=true
#= BLOCK_CANDLES_WHITE_LIT_1
block.*= white_candle:candles=1:lit=true supplementaries:candle_holder_white:candles=1:lit=true
block.*= white_candle:candles=1:lit=true \
supplementaries:candle_holder_white:candles=1:lit=true
#= BLOCK_CANDLES_WHITE_LIT_2
block.*= white_candle:candles=2:lit=true supplementaries:candle_holder_white:candles=2:lit=true
block.*= white_candle:candles=2:lit=true \
supplementaries:candle_holder_white:candles=2:lit=true
#= BLOCK_CANDLES_WHITE_LIT_3
block.*= white_candle:candles=3:lit=true supplementaries:candle_holder_white:candles=3:lit=true
block.*= white_candle:candles=3:lit=true \
supplementaries:candle_holder_white:candles=3:lit=true
#= BLOCK_CANDLES_WHITE_LIT_4
block.*= white_candle:candles=4:lit=true supplementaries:candle_holder_white:candles=4:lit=true
block.*= white_candle:candles=4:lit=true \
supplementaries:candle_holder_white:candles=4:lit=true
#= BLOCK_CANDLES_YELLOW_LIT_1
block.*= yellow_candle:candles=1:lit=true supplementaries:candle_holder_yellow:candles=1:lit=true
block.*= yellow_candle:candles=1:lit=true \
supplementaries:candle_holder_yellow:candles=1:lit=true
#= BLOCK_CANDLES_YELLOW_LIT_2
block.*= yellow_candle:candles=2:lit=true supplementaries:candle_holder_yellow:candles=2:lit=true
block.*= yellow_candle:candles=2:lit=true \
supplementaries:candle_holder_yellow:candles=2:lit=true
#= BLOCK_CANDLES_YELLOW_LIT_3
block.*= yellow_candle:candles=3:lit=true supplementaries:candle_holder_yellow:candles=3:lit=true
block.*= yellow_candle:candles=3:lit=true \
supplementaries:candle_holder_yellow:candles=3:lit=true
#= BLOCK_CANDLES_YELLOW_LIT_4
block.*= yellow_candle:candles=4:lit=true supplementaries:candle_holder_yellow:candles=4:lit=true
block.*= yellow_candle:candles=4:lit=true \
supplementaries:candle_holder_yellow:candles=4:lit=true
#else
#= BLOCK_CANDLES_LIT_1
block.*= [candle]:candles=1:lit=true
block.*= [candle]:candles=1:lit=true \
[supplementaries_candle]:candles=1:lit=true
#= BLOCK_CANDLES_LIT_2
block.*= [candle]:candles=2:lit=true
block.*= [candle]:candles=2:lit=true \
[supplementaries_candle]:candles=2:lit=true
#= BLOCK_CANDLES_LIT_3
block.*= [candle]:candles=3:lit=true
block.*= [candle]:candles=3:lit=true \
[supplementaries_candle]:candles=3:lit=true
#= BLOCK_CANDLES_LIT_4
block.*= [candle]:candles=4:lit=true
block.*= [candle]:candles=4:lit=true \
[supplementaries_candle]:candles=4:lit=true
#endif
#= BLOCK_CAVE_VINE_BERRIES
@ -661,7 +735,7 @@ block.*= minecraft:hanging_roots minecraft:weeping_vines minecraft:cave_vines:be
####### ----- LPV shapes ----- #######
#= BLOCK_LPV_IGNORE
block.401= chain ladder lever tripwire tripwire_hook snow:layers=1 [candle]:lit=false acacia_button bamboo_button birch_button cherry_button crimson_button dark_oak_button jungle_button mangrove_button oak_button polished_blackstone_button spruce_button stone_button warped_button
block.401= chain ladder lever tripwire tripwire_hook [candle]:lit=false acacia_button bamboo_button birch_button cherry_button crimson_button dark_oak_button jungle_button mangrove_button oak_button polished_blackstone_button spruce_button stone_button warped_button
#= BLOCK_CARPET
block.*=wool_carpets black_carpet blue_carpet brown_carpet cyan_carpet gray_carpet green_carpet light_blue_carpet light_gray_carpet lime_carpet magenta_carpet moss_carpet orange_carpet pink_carpet purple_carpet red_carpet white_carpet yellow_carpet
@ -719,6 +793,9 @@ block.*= minecraft:hanging_roots minecraft:weeping_vines minecraft:cave_vines:be
#= BLOCK_SLAB_BOTTOM
block.*= [slab]:type=bottom daylight_detector
#= BLOCK_SNOW_LAYERS
block.*= snow:layers=1 snow:layers=2 snow:layers=3 snow:layers=4
group.trapdoor= acacia_trapdoor bamboo_trapdoor birch_trapdoor cherry_trapdoor crimson_trapdoor dark_oak_trapdoor iron_trapdoor jungle_trapdoor mangrove_trapdoor oak_trapdoor spruce_trapdoor warped_trapdoor copper_trapdoor exposed_copper_trapdoor weathered_copper_trapdoor oxidized_copper_trapdoor waxed_copper_trapdoor waxed_exposed_copper_trapdoor waxed_weathered_copper_trapdoor waxed_oxidized_copper_trapdoor
#= BLOCK_TRAPDOOR_BOTTOM

View File

@ -1,2 +1,15 @@
## Editing Property Templates
# Editing Property Templates
The block, item, and entity property files are generated with a template builder. To modify these templates, you will need [PoTater](https://github.com/Null-MC/PoTater) to regenerate the final property files. Download the latest [release](https://github.com/Null-MC/PoTater/releases) binary for your system, and place it in this `~/template` folder. Then run `~/update.sh` as needed to generate the new property files.
# Editing Colored Lighting
There are two ways to edit colored lighting (explained below). Either method will require editing the block.properties mappings.
### The Simple/Easy Way
New block IDs can be easily added to existing block/light mappings.
TODO: expand and example
### The Advanced Way
Completely new block/light mappings can also be added, but it will require working with some GLSL code.
TODO: expand and example

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);

View File

@ -196,59 +196,12 @@ void main() {
// }
// #endif
int blockId = int(mc_Entity.x + 0.5);
#if defined IS_LPV_ENABLED || defined WAVY_PLANTS
vec3 playerpos = mat3(shadowModelViewInverse) * position + shadowModelViewInverse[3].xyz;
#endif
#if defined IS_LPV_ENABLED && defined MC_GL_EXT_shader_image_load_store
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
) {
uint voxelId = uint(blockId);
#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;
vec3 originPos = playerpos + at_midBlock.xyz/64.0;
SetVoxelBlock(originPos, voxelId);
}
#ifdef LPV_ENTITY_LIGHTS
if (
((renderStage == MC_RENDER_STAGE_ENTITIES && (currentRenderedItemId > 0 || entityId > 0)) || renderStage == MC_RENDER_STAGE_BLOCK_ENTITIES)
) {
uint voxelId = 0u;
if (renderStage == MC_RENDER_STAGE_BLOCK_ENTITIES) {
voxelId = uint(blockEntityId);
}
else if (currentRenderedItemId > 0 && currentRenderedItemId < 1000) {
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
// #ifdef WAVY_PLANTS
@ -270,6 +223,8 @@ void main() {
// }
// #endif
int blockId = int(mc_Entity.x + 0.5);
#ifdef WAVY_PLANTS
// also use normal, so up/down facing geometry does not get detatched from its model parts.
bool InterpolateFromBase = gl_MultiTexCoord0.t < max(mc_midTexCoord.t, abs(viewToWorld(normalize(gl_NormalMatrix * gl_Normal)).y));

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);