diff --git a/shaders/dimensions/all_particles.vsh b/shaders/dimensions/all_particles.vsh index a04de5b..2a0e170 100644 --- a/shaders/dimensions/all_particles.vsh +++ b/shaders/dimensions/all_particles.vsh @@ -1,5 +1,6 @@ #include "/lib/settings.glsl" #include "/lib/res_params.glsl" +#include "/lib/items.glsl" /* !! DO NOT REMOVE !! @@ -69,7 +70,7 @@ void main() { HELD_ITEM_BRIGHTNESS = 0.0; #ifdef Hand_Held_lights - if(heldItemId == 100 || heldItemId2 == 100) HELD_ITEM_BRIGHTNESS = 0.9; + if(heldItemId == ITEM_LIGHT_SOURCES || heldItemId2 == ITEM_LIGHT_SOURCES) HELD_ITEM_BRIGHTNESS = 0.9; #endif diff --git a/shaders/dimensions/all_solid.vsh b/shaders/dimensions/all_solid.vsh index 6ff5b26..09b4d79 100644 --- a/shaders/dimensions/all_solid.vsh +++ b/shaders/dimensions/all_solid.vsh @@ -3,6 +3,8 @@ #include "/lib/res_params.glsl" #include "/lib/bokeh.glsl" #include "/lib/blocks.glsl" +#include "/lib/entities.glsl" +#include "/lib/items.glsl" /* !! DO NOT REMOVE !! @@ -248,7 +250,7 @@ void main() { #ifdef ENTITIES // disallow POM to work on item frames. - if(entityId == 2300) SIGN = 1; + if(entityId == ENTITY_ITEM_FRAME) SIGN = 1; // try and single out nametag text and then discard nametag background @@ -256,7 +258,7 @@ void main() { // if(gl_Color.a < 1.0) NameTags = 1; // if(gl_Color.a >= 0.24 && gl_Color.a <= 0.25 ) gl_Position = vec4(10,10,10,1); - if(entityId == 1100 || entityId == 1200 || entityId == 2468) normalMat.a = 0.45; + if(entityId == ENTITY_SSS_MEDIUM || entityId == ENTITY_SSS_WEAK || entityId == ENTITY_PLAYER || entityId == 2468) normalMat.a = 0.45; #endif @@ -272,7 +274,7 @@ void main() { // special cases light lightning and beacon beams... #ifdef ENTITIES - if(entityId == 12345){ + if(entityId == ENTITY_LIGHTNING){ LIGHTNING = 1; normalMat.a = 0.50; } @@ -284,7 +286,7 @@ void main() { HELD_ITEM_BRIGHTNESS = 0.0; #ifdef Hand_Held_lights - if(heldItemId == 100 || heldItemId2 == 100) HELD_ITEM_BRIGHTNESS = 0.9; + if(heldItemId == ITEM_LIGHT_SOURCES || heldItemId2 == ITEM_LIGHT_SOURCES) HELD_ITEM_BRIGHTNESS = 0.9; #endif @@ -319,12 +321,12 @@ void main() { #ifdef MOB_SSS /////// ----- SSS ON MOBS----- /////// // strong - if(entityId == 1100) SSSAMOUNT = 0.75; + if(entityId == ENTITY_SSS_MEDIUM) SSSAMOUNT = 0.75; // medium // low - if(entityId == 1200) SSSAMOUNT = 0.3; + if(entityId == ENTITY_SSS_WEAK || entityId == ENTITY_PLAYER) SSSAMOUNT = 0.3; #endif #endif diff --git a/shaders/dimensions/all_translucent.vsh b/shaders/dimensions/all_translucent.vsh index 5955399..4fe26f0 100644 --- a/shaders/dimensions/all_translucent.vsh +++ b/shaders/dimensions/all_translucent.vsh @@ -1,6 +1,7 @@ #include "/lib/settings.glsl" #include "/lib/res_params.glsl" #include "/lib/bokeh.glsl" +#include "/lib/items.glsl" uniform float frameTimeCounter; #include "/lib/Shadow_Params.glsl" @@ -93,7 +94,7 @@ void main() { HELD_ITEM_BRIGHTNESS = 0.0; #ifdef Hand_Held_lights - if(heldItemId == 100 || heldItemId2 == 100) HELD_ITEM_BRIGHTNESS = 0.9; + if(heldItemId == ITEM_LIGHT_SOURCES || heldItemId2 == ITEM_LIGHT_SOURCES) HELD_ITEM_BRIGHTNESS = 0.9; #endif float mat = 0.0; diff --git a/shaders/entity.properties b/shaders/entity.properties index f29f666..70fe074 100644 --- a/shaders/entity.properties +++ b/shaders/entity.properties @@ -1,20 +1,20 @@ -#if MC_VERSION >= 11300 +entity.1201= player + +entity.1202 = minecraft:lightning_bolt weather2:lightning_bolt + +## misc stuff +entity.1203 = ender_dragon wither + +entity.1301= item_frame item_display +entity.1302= spectral_arrow bigglobe:torch_arrow +entity.1303= tnt firework_rocket ###### ###### all the different strengths of subsurface scattering and what entities to put them on. ###### ## medium sss (same as strong sss for blocks) -entity.1100 = slime giant ghast elder_guardian +entity.1401 = slime giant ghast elder_guardian ## weak sss (same as weak sss for blocks) -entity.1200 = player sheep frog chicken 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 blaze creeper drowned endermite evoker guardian hoglin husk magma_cube phantom piglin_brute pillager ravager silverfish stray vex vindicator witch zoglin zombie zombie_villager trader_llama - -## misc stuff -entity.1300 = ender_dragon wither - -entity.12345 = minecraft:lightning_bolt \ -weather2:lightning_bolt - -# all of these get excluded from POM -entity.2300 = minecraft:item_frame minecraft:item_display \ No newline at end of file +entity.1402 = sheep frog chicken 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 blaze creeper drowned endermite evoker guardian hoglin husk magma_cube phantom piglin_brute pillager ravager silverfish stray vex vindicator witch zoglin zombie zombie_villager trader_llama diff --git a/shaders/item.properties b/shaders/item.properties index f374576..34987bb 100644 --- a/shaders/item.properties +++ b/shaders/item.properties @@ -1,3 +1,3 @@ -item.100 = glow_berries soul_lantern soul_torch conduit beacon sea_pickle sea_lantern glowstone torch redstone_torch jack_o_lantern magma_block lantern shroomlight end_rod lava_bucket \ -\ -conquest:white_paper_lantern conquest:yellow_paper_lantern conquest:small_red_paper_lantern conquest:chinese_palace_lantern conquest:campfire conquest:brazier conquest:hanging_brazier conquest:chandelier conquest:candelabra conquest:cross_chandelier conquest:conquest:iron_candelabrum_1 conquest:conquest:golden_candelabrum_1 conquest:candle conquest:hanging_candle_holder conquest:candle_in_a_lantern conquest:candles conquest:hand_candle conquest:torch_with_grille conquest:elven_hand_light conquest:ship_lantern conquest:victorian_lantern conquest:small_lantern conquest:big_lantern conquest:hanging_oil_lamp conquest:oil_lamp conquest:terracotta_oil_lamp conquest:invisible_light_low conquest:invisible_light_medium conquest:invisible_light \ No newline at end of file +item.1000= glow_berries soul_lantern soul_torch conduit beacon sea_pickle sea_lantern glowstone torch redstone_torch jack_o_lantern magma_block lantern shroomlight end_rod lava_bucket \ + \ + conquest:white_paper_lantern conquest:yellow_paper_lantern conquest:small_red_paper_lantern conquest:chinese_palace_lantern conquest:campfire conquest:brazier conquest:hanging_brazier conquest:chandelier conquest:candelabra conquest:cross_chandelier conquest:conquest:iron_candelabrum_1 conquest:conquest:golden_candelabrum_1 conquest:candle conquest:hanging_candle_holder conquest:candle_in_a_lantern conquest:candles conquest:hand_candle conquest:torch_with_grille conquest:elven_hand_light conquest:ship_lantern conquest:victorian_lantern conquest:small_lantern conquest:big_lantern conquest:hanging_oil_lamp conquest:oil_lamp conquest:terracotta_oil_lamp conquest:invisible_light_low conquest:invisible_light_medium conquest:invisible_light diff --git a/shaders/lib/entities.glsl b/shaders/lib/entities.glsl new file mode 100644 index 0000000..1bcc19e --- /dev/null +++ b/shaders/lib/entities.glsl @@ -0,0 +1,10 @@ +#define ENTITY_PLAYER 1201 +#define ENTITY_LIGHTNING 1202 +//#define ENTITY_DRAGON_WITH 1203 + +#define ENTITY_ITEM_FRAME 1301 +#define ENTITY_SPECTRAL_ARROW 1302 +#define ENTITY_TNT 1303 + +#define ENTITY_SSS_MEDIUM 1401 +#define ENTITY_SSS_WEAK 1402 diff --git a/shaders/lib/items.glsl b/shaders/lib/items.glsl new file mode 100644 index 0000000..a9ef32b --- /dev/null +++ b/shaders/lib/items.glsl @@ -0,0 +1 @@ +#define ITEM_LIGHT_SOURCES 1000 diff --git a/shaders/world0/shadow.vsh b/shaders/world0/shadow.vsh index 57982db..92ff301 100644 --- a/shaders/world0/shadow.vsh +++ b/shaders/world0/shadow.vsh @@ -49,6 +49,7 @@ uniform int entityId; #include "/lib/Shadow_Params.glsl" #include "/lib/bokeh.glsl" #include "/lib/blocks.glsl" +#include "/lib/entities.glsl" #ifdef IS_LPV_ENABLED attribute vec3 at_midBlock; @@ -209,7 +210,10 @@ void main() { ) { uint voxelId = uint(BLOCK_EMPTY); - if (currentRenderedItemId > 0) voxelId = uint(currentRenderedItemId); + if (currentRenderedItemId > 0) { + if (entityId != ENTITY_ITEM_FRAME) + voxelId = uint(currentRenderedItemId); + } else { // TODO: set from entityId } @@ -258,7 +262,7 @@ void main() { /// this is to ease the shadow acne on big fat entities like ghasts. float bias = 6.0; - if(entityId == 1100){ + if(entityId == ENTITY_SSS_MEDIUM){ // increase bias on parts facing the sun vec3 FlatNormals = normalize(gl_NormalMatrix * gl_Normal); vec3 WsunVec = (float(sunElevation > 1e-5)*2-1.)*normalize(mat3(shadowModelViewInverse) * sunPosition);