From 8c8531701b5bb82a9c9cb2c1472ba2e279f188c4 Mon Sep 17 00:00:00 2001 From: NULL511 Date: Tue, 7 May 2024 10:53:28 -0400 Subject: [PATCH] item/entity light fixes --- shaders/block.properties | 2 +- shaders/dimensions/setup.csh | 34 +++++++++++++++++++++++++++--- shaders/entity.properties | 24 +++++++++++---------- shaders/lib/entities.glsl | 23 ++++++++++---------- shaders/lib/settings.glsl | 2 +- shaders/template/block.properties | 2 +- shaders/template/entity.properties | 7 ++++-- shaders/world-1/shadow.vsh | 2 +- shaders/world0/shadow.vsh | 2 +- shaders/world1/shadow.vsh | 2 +- 10 files changed, 67 insertions(+), 33 deletions(-) diff --git a/shaders/block.properties b/shaders/block.properties index 2641257..1079bd6 100644 --- a/shaders/block.properties +++ b/shaders/block.properties @@ -393,7 +393,7 @@ block.321=yellow_stained_glass yellow_stained_glass_pane ####### ----- LPV shapes ----- ####### -block.401=chain ladder lever tripwire_hook snow:layers=1 candle:lit=false black_candle:lit=false blue_candle:lit=false brown_candle:lit=false cyan_candle:lit=false gray_candle:lit=false green_candle:lit=false light_blue_candle:lit=false light_gray_candle:lit=false lime_candle:lit=false magenta_candle:lit=false orange_candle:lit=false pink_candle:lit=false purple_candle:lit=false red_candle:lit=false white_candle:lit=false yellow_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 snow:layers=1 candle:lit=false black_candle:lit=false blue_candle:lit=false brown_candle:lit=false cyan_candle:lit=false gray_candle:lit=false green_candle:lit=false light_blue_candle:lit=false light_gray_candle:lit=false lime_candle:lit=false magenta_candle:lit=false orange_candle:lit=false pink_candle:lit=false purple_candle:lit=false red_candle:lit=false white_candle:lit=false yellow_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.402=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 diff --git a/shaders/dimensions/setup.csh b/shaders/dimensions/setup.csh index 4595e25..cd85c89 100644 --- a/shaders/dimensions/setup.csh +++ b/shaders/dimensions/setup.csh @@ -3,9 +3,9 @@ layout (local_size_x = 8, local_size_y = 8, local_size_z = 1) in; const ivec3 workGroups = ivec3(6, 6, 1); #ifdef IS_LPV_ENABLED - #include "/lib/blocks.glsl" #include "/lib/items.glsl" - // #include "/lib/entities.glsl" + #include "/lib/blocks.glsl" + #include "/lib/entities.glsl" #include "/lib/lpv_blocks.glsl" const vec3 LightColor_Amethyst = vec3(0.464, 0.227, 0.788); @@ -42,7 +42,7 @@ const ivec3 workGroups = ivec3(6, 6, 1); void main() { #ifdef IS_LPV_ENABLED - int blockId = int(gl_GlobalInvocationID.x + gl_GlobalInvocationID.y * 32); + int blockId = int(gl_GlobalInvocationID.x + gl_GlobalInvocationID.y * 48); if (blockId >= 2048) return; vec3 lightColor = vec3(0.0); @@ -995,6 +995,34 @@ void main() { mixWeight = 0.9; } + // Entities + + if (blockId == ENTITY_BLAZE) { + lightColor = vec3(1.000, 0.592, 0.000); + lightRange = 8.0; + } + + if (blockId == ENTITY_END_CRYSTAL) { + lightColor = vec3(1.000, 0.000, 1.000); + lightRange = 8.0; + } + + if (blockId == ENTITY_MAGMA_CUBE) { + lightColor = vec3(0.747, 0.323, 0.110); + lightRange = 9.0; + } + + if (blockId == ENTITY_TNT) { + lightColor = vec3(1.0); + lightRange = 8.0; + } + + if (blockId == ENTITY_SPECTRAL_ARROW) { + lightColor = vec3(0.0, 1.0, 0.0); + lightRange = 8.0; + mixWeight = 1.0; + } + // hack to increase light (if set) if (lightRange > 0.0) lightRange += 1.0; diff --git a/shaders/entity.properties b/shaders/entity.properties index 8bb72e9..6587c74 100644 --- a/shaders/entity.properties +++ b/shaders/entity.properties @@ -1,34 +1,36 @@ -entity.1201=player +entity.1601=player -entity.1202=minecraft:lightning_bolt weather2:lightning_bolt +entity.1602=minecraft:lightning_bolt weather2:lightning_bolt ## misc stuff -entity.1203=blaze +entity.1603=blaze -entity.1204=ender_dragon wither +entity.1604=ender_dragon wither -entity.1205=item_frame item_display +entity.1605=end_crystal -entity.1206=magma_cube +entity.1606=item_frame item_display -entity.1207=tnt firework_rocket +entity.1607=magma_cube -entity.1208=spectral_arrow bigglobe:torch_arrow +entity.1608=tnt firework_rocket + +entity.1609=spectral_arrow bigglobe:torch_arrow ################################################ ###### SUB-SURFACE SCATTERING ################################################ ## medium sss (same as strong sss for blocks) -entity.1401=giant ghast elder_guardian +entity.1801=giant ghast elder_guardian ## weak sss (same as weak sss for blocks) -entity.1402=furnace_minecart sheep frog chicken iron_golem snow_golem polar_bear zombie_horse armor_stand arrow squid bat cat cod cow donkey fox horse mooshroom mule ocelot parrot pig piglin polar_bear pufferfish rabbit salmon strider tropical_fish turtle villager wandering_trader bee cave_spider dolphin enderman llama panda spider wolf zombified_piglin creeper drowned endermite evoker guardian hoglin husk phantom piglin_brute pillager ravager silverfish stray vex vindicator witch zoglin zombie zombie_villager trader_llama +entity.1802=furnace_minecart sheep frog chicken iron_golem snow_golem polar_bear zombie_horse armor_stand arrow squid bat cat cod cow donkey fox horse mooshroom mule ocelot parrot pig piglin polar_bear pufferfish rabbit salmon strider tropical_fish turtle villager wandering_trader bee cave_spider dolphin enderman llama panda spider wolf zombified_piglin creeper drowned endermite evoker guardian hoglin husk phantom piglin_brute pillager ravager silverfish stray vex vindicator witch zoglin zombie zombie_villager trader_llama #removed: player blaze magma_cube ################################################ ###### REFLECTIVE TRANSLUCENTS ################################################ -entity.1403=slime +entity.1803=slime diff --git a/shaders/lib/entities.glsl b/shaders/lib/entities.glsl index de0bc1b..0300ffb 100644 --- a/shaders/lib/entities.glsl +++ b/shaders/lib/entities.glsl @@ -1,11 +1,12 @@ -#define ENTITY_PLAYER 1201 -#define ENTITY_LIGHTNING 1202 -#define ENTITY_BLAZE 1203 -#define ENTITY_DRAGON_WITHER 1204 -#define ENTITY_ITEM_FRAME 1205 -#define ENTITY_MAGMA_CUBE 1206 -#define ENTITY_TNT 1207 -#define ENTITY_SPECTRAL_ARROW 1208 -#define ENTITY_SSS_MEDIUM 1401 -#define ENTITY_SSS_WEAK 1402 -#define ENTITY_SLIME 1403 +#define ENTITY_PLAYER 1601 +#define ENTITY_LIGHTNING 1602 +#define ENTITY_BLAZE 1603 +#define ENTITY_DRAGON_WITHER 1604 +#define ENTITY_END_CRYSTAL 1605 +#define ENTITY_ITEM_FRAME 1606 +#define ENTITY_MAGMA_CUBE 1607 +#define ENTITY_TNT 1608 +#define ENTITY_SPECTRAL_ARROW 1609 +#define ENTITY_SSS_MEDIUM 1801 +#define ENTITY_SSS_WEAK 1802 +#define ENTITY_SLIME 1803 diff --git a/shaders/lib/settings.glsl b/shaders/lib/settings.glsl index 575bf24..1922735 100644 --- a/shaders/lib/settings.glsl +++ b/shaders/lib/settings.glsl @@ -687,7 +687,7 @@ const vec3 aerochrome_color = mix(vec3(1.0, 0.0, 0.0), vec3(0.715, 0.303, 0.631) #define LPV_REDSTONE_LIGHTS //#define LPV_COLORED_CANDLES -#define LPV_NOSHADOW_HACK +// #define LPV_NOSHADOW_HACK #ifdef LPV_ENABLED #ifdef IRIS_FEATURE_CUSTOM_IMAGES diff --git a/shaders/template/block.properties b/shaders/template/block.properties index b50a3fa..3ca7bda 100644 --- a/shaders/template/block.properties +++ b/shaders/template/block.properties @@ -577,7 +577,7 @@ block.*= vine ####### ----- LPV shapes ----- ####### #= BLOCK_LPV_IGNORE - block.401= chain ladder lever tripwire_hook \ + 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 diff --git a/shaders/template/entity.properties b/shaders/template/entity.properties index 12a87f3..42c3f70 100644 --- a/shaders/template/entity.properties +++ b/shaders/template/entity.properties @@ -1,5 +1,5 @@ #= ENTITY_PLAYER -entity.1201= player +entity.1601= player #= ENTITY_LIGHTNING entity.*= minecraft:lightning_bolt weather2:lightning_bolt @@ -12,6 +12,9 @@ entity.*= blaze #= ENTITY_DRAGON_WITHER entity.*= ender_dragon wither +#= ENTITY_END_CRYSTAL +entity.*= end_crystal + #= ENTITY_ITEM_FRAME entity.*= item_frame item_display @@ -30,7 +33,7 @@ entity.*= spectral_arrow bigglobe:torch_arrow ## medium sss (same as strong sss for blocks) #= ENTITY_SSS_MEDIUM -entity.1401 = giant ghast elder_guardian +entity.1801 = giant ghast elder_guardian ## weak sss (same as weak sss for blocks) #= ENTITY_SSS_WEAK diff --git a/shaders/world-1/shadow.vsh b/shaders/world-1/shadow.vsh index 79049b3..b5ccc56 100644 --- a/shaders/world-1/shadow.vsh +++ b/shaders/world-1/shadow.vsh @@ -72,7 +72,7 @@ void main() { case ENTITY_BLAZE: case ENTITY_MAGMA_CUBE: case ENTITY_SPECTRAL_ARROW: - voxelId = uint(BLOCK_TORCH); + voxelId = uint(entityId); break; } } diff --git a/shaders/world0/shadow.vsh b/shaders/world0/shadow.vsh index 27d23af..94b6844 100644 --- a/shaders/world0/shadow.vsh +++ b/shaders/world0/shadow.vsh @@ -221,7 +221,7 @@ void main() { case ENTITY_BLAZE: case ENTITY_MAGMA_CUBE: case ENTITY_SPECTRAL_ARROW: - voxelId = uint(BLOCK_TORCH); + voxelId = uint(entityId); break; } } diff --git a/shaders/world1/shadow.vsh b/shaders/world1/shadow.vsh index 79049b3..b5ccc56 100644 --- a/shaders/world1/shadow.vsh +++ b/shaders/world1/shadow.vsh @@ -72,7 +72,7 @@ void main() { case ENTITY_BLAZE: case ENTITY_MAGMA_CUBE: case ENTITY_SPECTRAL_ARROW: - voxelId = uint(BLOCK_TORCH); + voxelId = uint(entityId); break; } }