From 3d0260e488949e366418d8b4282407241a60d048 Mon Sep 17 00:00:00 2001 From: NULL511 Date: Sat, 22 Jun 2024 15:35:14 -0400 Subject: [PATCH 1/3] fix glowing sign text; more mod blocks --- shaders/block.properties | 13 +++++--- shaders/dimensions/all_solid.vsh | 43 +++++++++++++------------- shaders/dimensions/all_translucent.fsh | 13 +++++--- shaders/dimensions/all_translucent.vsh | 19 +++++++++--- shaders/dimensions/composite2.fsh | 25 ++++++--------- shaders/dimensions/shadowcomp.csh | 4 +++ shaders/lib/end_fog.glsl | 2 +- shaders/lib/lpv_render.glsl | 2 ++ shaders/lib/nether_fog.glsl | 2 +- shaders/lib/overworld_fog.glsl | 4 +-- shaders/template/block.properties | 3 +- 11 files changed, 76 insertions(+), 54 deletions(-) diff --git a/shaders/block.properties b/shaders/block.properties index 24c9b3af..64c4dca8 100644 --- a/shaders/block.properties +++ b/shaders/block.properties @@ -16,7 +16,7 @@ block.15=minecraft:oak_sapling minecraft:spruce_sapling minecraft:birch_sapling block.16=vine -block.17=minecraft:hanging_roots minecraft:weeping_vines +block.17=minecraft:hanging_roots minecraft:weeping_vines minecraft:cave_vines:berries=false ####### ----- waving blocks with SSS ----- ####### @@ -43,7 +43,7 @@ block.80=minecraft:kelp_plant minecraft:peony minecraft:rose_bush minecraft:lila westerosblocks:blackberry_bush westerosblocks:blueberry_bush westerosblocks:raspberry_bush westerosblocks:juniper_bush westerosblocks:red_rose_bush westerosblocks:pink_rose_bush westerosblocks:white_rose_bush westerosblocks:yellow_rose_bush westerosblocks:yellow_wildflowers westerosblocks:green_spiny_herb westerosblocks:green_leafy_herb westerosblocks:orange_marigolds westerosblocks:orange_trollius westerosblocks:blue_forgetmenots westerosblocks:pink_wildflowers westerosblocks:yellow_tansy westerosblocks:blue_flax westerosblocks:white_daisies westerosblocks:yellow_daisies westerosblocks:green_scrub_grass westerosblocks:dead_scrub_grass westerosblocks:yellow_bedstraw westerosblocks:orange_bells westerosblocks:blue_bells westerosblocks:blue_swamp_bells westerosblocks:yellow_buttercups westerosblocks:orange_bog_asphodel westerosblocks:yellow_lupine westerosblocks:blue_hyacinth westerosblocks:pink_thistle westerosblocks:yellow_dandelions westerosblocks:yellow_daffodils westerosblocks:yellow_roses westerosblocks:strawberry_bush westerosblocks:white_lilyofthevalley westerosblocks:yellow_bells westerosblocks:yellow_sunflower westerosblocks:white_roses westerosblocks:red_dark_roses westerosblocks:yellow_hellebore westerosblocks:meadow_fescue westerosblocks:red_poppies westerosblocks:red_roses westerosblocks:purple_pansies westerosblocks:purple_roses westerosblocks:orange_sun_star westerosblocks:pink_primrose westerosblocks:red_aster westerosblocks:blue_chicory westerosblocks:red_flowering_spiny_herb westerosblocks:purple_foxglove westerosblocks:pink_allium westerosblocks:purple_violets westerosblocks:white_chamomile westerosblocks:red_tulips westerosblocks:white_peony westerosblocks:purple_alpine_sowthistle westerosblocks:red_carnations westerosblocks:magenta_roses westerosblocks:red_chrysanthemum westerosblocks:blue_orchid westerosblocks:yellow_rudbeckia westerosblocks:pink_tulips westerosblocks:cranberry_bush westerosblocks:purple_lavender westerosblocks:red_sourleaf_bush westerosblocks:pink_sweet_peas westerosblocks:red_sorrel westerosblocks:pink_roses westerosblocks:unshaded_grass westerosblocks:cow_parsely westerosblocks:bracken westerosblocks:lady_fern westerosblocks:nettle westerosblocks:dead_bracken westerosblocks:fireweed westerosblocks:heather westerosblocks:red_fern westerosblocks:dock_leaf westerosblocks:jasmine_vines westerosblocks:dappled_moss westerosblocks:cushion_moss_wall westerosblocks:hemp_short westerosblocks:hemp_tall westerosblocks:hemp_dense westerosblocks:crop_carrots westerosblocks:crop_wheat westerosblocks:crop_turnips westerosblocks:crop_peas westerosblocks:cattails westerosblocks:jungle_tall_fern westerosblocks:jungle_tall_grass westerosblocks:savanna_tall_grass ## weak sss -block.81=minecraft:cave_vines:berries=falseminecraft: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: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.81=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: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 ## weak sss block.82=minecraft:white_wool minecraft:orange_wool minecraft:magenta_wool minecraft:light_blue_wool minecraft:yellow_wool minecraft:lime_wool minecraft:pink_wool minecraft:gray_wool minecraft:light_gray_wool minecraft:cyan_wool minecraft:purple_wool minecraft:blue_wool minecraft:brown_wool minecraft:green_wool minecraft:red_wool minecraft:black_wool minecraft:orange_carpet minecraft:magenta_carpet minecraft:light_blue_carpet minecraft:yellow_carpet minecraft:lime_carpet minecraft:pink_carpet minecraft:gray_carpet minecraft:light_gray_carpet minecraft:cyan_carpet minecraft:purple_carpet minecraft:blue_carpet minecraft:brown_carpet minecraft:green_carpet minecraft:red_carpet minecraft:black_carpet \ @@ -530,7 +530,8 @@ block.321=slime_block ####### ----- LPV shapes ----- ####### -block.401=chain ladder lever tripwire tripwire_hook 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 supplementaries:candle_holder:lit=false supplementaries:candle_holder_black:lit=false supplementaries:candle_holder_blue:lit=false supplementaries:candle_holder_brown:lit=false supplementaries:candle_holder_cyan:lit=false supplementaries:candle_holder_gray:lit=false supplementaries:candle_holder_green:lit=false supplementaries:candle_holder_light_blue:lit=false supplementaries:candle_holder_light_gray:lit=false supplementaries:candle_holder_lime:lit=false supplementaries:candle_holder_magenta:lit=false supplementaries:candle_holder_orange:lit=false supplementaries:candle_holder_pink:lit=false supplementaries:candle_holder_purple:lit=false supplementaries:candle_holder_red:lit=false supplementaries:candle_holder_white:lit=false supplementaries:candle_holder_yellow: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 scaffolding +block.401=chain ladder lever tripwire tripwire_hook 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 supplementaries:candle_holder:lit=false supplementaries:candle_holder_black:lit=false supplementaries:candle_holder_blue:lit=false supplementaries:candle_holder_brown:lit=false supplementaries:candle_holder_cyan:lit=false supplementaries:candle_holder_gray:lit=false supplementaries:candle_holder_green:lit=false supplementaries:candle_holder_light_blue:lit=false supplementaries:candle_holder_light_gray:lit=false supplementaries:candle_holder_lime:lit=false supplementaries:candle_holder_magenta:lit=false supplementaries:candle_holder_orange:lit=false supplementaries:candle_holder_pink:lit=false supplementaries:candle_holder_purple:lit=false supplementaries:candle_holder_red:lit=false supplementaries:candle_holder_white:lit=false supplementaries:candle_holder_yellow: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 scaffolding \ + create:andesite_ladder create:belt create:brass_ladder create:copper_ladder create:shaft block.402=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 @@ -703,4 +704,8 @@ block.477=cobblestone_wall:north=low:east=tall:south=low:west=tall:up=false ande block.500=minecraft:end_portal ## all blocks here get exluded from POM. -block.501=minecraft:oak_sign minecraft:spruce_sign minecraft:birch_sign minecraft:jungle_sign minecraft:acacia_sign minecraft:dark_oak_sign minecraft:mangrove_sign minecraft:crimson_sign minecraft:warped_sign minecraft:oak_wall_sign minecraft:spruce_wall_sign minecraft:birch_wall_sign minecraft:jungle_wall_sign minecraft:acacia_wall_sign minecraft:dark_oak_wall_sign minecraft:mangrove_wall_sign minecraft:crimson_wall_sign minecraft:warped_wall_sign \ No newline at end of file +block.501=minecraft:oak_sign minecraft:spruce_sign minecraft:birch_sign minecraft:jungle_sign minecraft:acacia_sign minecraft:dark_oak_sign minecraft:mangrove_sign minecraft:crimson_sign minecraft:warped_sign minecraft:oak_wall_sign minecraft:spruce_wall_sign minecraft:birch_wall_sign minecraft:jungle_wall_sign minecraft:acacia_wall_sign minecraft:dark_oak_wall_sign minecraft:mangrove_wall_sign minecraft:crimson_wall_sign minecraft:warped_wall_sign + + ## workaround mixed render stages + ##= BLOCK_REDSTONE_WIRE + ##block.*= minecraft:redstone_wire diff --git a/shaders/dimensions/all_solid.vsh b/shaders/dimensions/all_solid.vsh index a0bf8fd0..a95fc4a9 100644 --- a/shaders/dimensions/all_solid.vsh +++ b/shaders/dimensions/all_solid.vsh @@ -229,18 +229,19 @@ void main() { normalMat = vec4(normalize(gl_NormalMatrix * gl_Normal), 1.0); FlatNormals = normalMat.xyz; - blockID = mc_Entity.x ; + blockID = mc_Entity.x; - if(blockID == BLOCK_GROUND_WAVING_VERTICAL || blockID == BLOCK_GRASS_SHORT || blockID == BLOCK_GRASS_TALL_LOWER || blockID == BLOCK_GRASS_TALL_UPPER ) normalMat.a = 0.60; + if (blockID == BLOCK_GROUND_WAVING_VERTICAL || blockID == BLOCK_GRASS_SHORT || blockID == BLOCK_GRASS_TALL_LOWER || blockID == BLOCK_GRASS_TALL_UPPER ) normalMat.a = 0.60; PORTAL = 0; SIGN = 0; - #ifdef WORLD - if(blockEntityId == BLOCK_SIGN) SIGN = 1; + #if defined WORLD && defined BLOCKENTITIES + blockID = blockEntityId; - if(blockEntityId == BLOCK_END_PORTAL) PORTAL = 1; + if (blockID == BLOCK_SIGN) SIGN = 1; + if (blockID == BLOCK_END_PORTAL) PORTAL = 1; #endif NameTags = 0; @@ -258,7 +259,7 @@ void main() { #endif - if(mc_Entity.x == BLOCK_AIR_WAVING) normalMat.a = 0.55; + if(blockID == BLOCK_AIR_WAVING) normalMat.a = 0.55; /////// ----- EMISSIVE STUFF ----- /////// EMISSIVE = 0.0; @@ -271,7 +272,7 @@ void main() { #endif // normal block lightsources - if(mc_Entity.x >= 100 && mc_Entity.x < 300) EMISSIVE = 0.5; + if(blockID >= 100 && blockID < 300) EMISSIVE = 0.5; // special cases light lightning and beacon beams... #ifdef ENTITIES @@ -288,25 +289,25 @@ void main() { /////// ----- SSS ON BLOCKS ----- /////// // strong if ( - mc_Entity.x == BLOCK_GROUND_WAVING || mc_Entity.x == BLOCK_GROUND_WAVING_VERTICAL || mc_Entity.x == BLOCK_AIR_WAVING || - mc_Entity.x == BLOCK_GRASS_SHORT || mc_Entity.x == BLOCK_GRASS_TALL_UPPER || mc_Entity.x == BLOCK_GRASS_TALL_LOWER || - mc_Entity.x == BLOCK_SSS_STRONG || mc_Entity.x == BLOCK_SAPLING + blockID == BLOCK_GROUND_WAVING || blockID == BLOCK_GROUND_WAVING_VERTICAL || blockID == BLOCK_AIR_WAVING || + blockID == BLOCK_GRASS_SHORT || blockID == BLOCK_GRASS_TALL_UPPER || blockID == BLOCK_GRASS_TALL_LOWER || + blockID == BLOCK_SSS_STRONG || blockID == BLOCK_SAPLING ) { SSSAMOUNT = 1.0; } // medium if ( - mc_Entity.x == BLOCK_SSS_WEAK || mc_Entity.x == BLOCK_SSS_WEAK_2 || - mc_Entity.x == BLOCK_GLOW_LICHEN || 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 + blockID == BLOCK_SSS_WEAK || blockID == BLOCK_SSS_WEAK_2 || + blockID == BLOCK_GLOW_LICHEN || blockID == BLOCK_SNOW_LAYERS || + blockID == BLOCK_AMETHYST_BUD_MEDIUM || blockID == BLOCK_AMETHYST_BUD_LARGE || blockID == BLOCK_AMETHYST_CLUSTER || + blockID == BLOCK_BAMBOO || blockID == BLOCK_SAPLING || blockID == BLOCK_VINE ) { SSSAMOUNT = 0.75; } // low #ifdef MISC_BLOCK_SSS - if(mc_Entity.x == BLOCK_SSS_WEIRD || mc_Entity.x == BLOCK_GRASS) SSSAMOUNT = 0.5; // weird SSS on blocks like grass and stuff + if(blockID == BLOCK_SSS_WEIRD || blockID == BLOCK_GRASS) SSSAMOUNT = 0.5; // weird SSS on blocks like grass and stuff #endif #ifdef ENTITIES @@ -327,7 +328,7 @@ void main() { // strong // medium - if(blockEntityId == BLOCK_SSS_WEAK_3) SSSAMOUNT = 0.4; + if(blockID == BLOCK_SSS_WEAK_3) SSSAMOUNT = 0.4; // low @@ -341,13 +342,13 @@ void main() { if( ( // these wave off of the ground. the area connected to the ground does not wave. - (InterpolateFromBase && (mc_Entity.x == BLOCK_GRASS_TALL_LOWER || mc_Entity.x == BLOCK_GROUND_WAVING || mc_Entity.x == BLOCK_GRASS_SHORT || mc_Entity.x == BLOCK_SAPLING || mc_Entity.x == BLOCK_GROUND_WAVING_VERTICAL)) + (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 && (mc_Entity.x == 17)) + || (!InterpolateFromBase && (blockID == BLOCK_VINE_OTHER)) // these wave off of the air. they wave uniformly - || (mc_Entity.x == BLOCK_GRASS_TALL_UPPER || mc_Entity.x == BLOCK_AIR_WAVING) + || (blockID == BLOCK_GRASS_TALL_UPPER || blockID == BLOCK_AIR_WAVING) ) && abs(position.z) < 64.0 ){ @@ -358,7 +359,7 @@ void main() { worldpos += calcMovePlants(worldpos + cameraPosition) * max(lmtexcoord.w,0.5); // apply displacement for waving leaf blocks specifically, overwriting the other waving mode. these wave off of the air. they wave uniformly - if(mc_Entity.x == BLOCK_AIR_WAVING) worldpos = UnalteredWorldpos + calcMoveLeaves(worldpos + cameraPosition, 0.0040, 0.0064, 0.0043, 0.0035, 0.0037, 0.0041, vec3(1.0,0.2,1.0), vec3(0.5,0.1,0.5))*lmtexcoord.w; + if(blockID == BLOCK_AIR_WAVING) worldpos = UnalteredWorldpos + calcMoveLeaves(worldpos + cameraPosition, 0.0040, 0.0064, 0.0043, 0.0035, 0.0037, 0.0041, vec3(1.0,0.2,1.0), vec3(0.5,0.1,0.5))*lmtexcoord.w; position = mat3(gbufferModelView) * worldpos + gbufferModelView[3].xyz; } @@ -368,7 +369,7 @@ void main() { #endif #if defined Seasons && defined WORLD && !defined ENTITIES && !defined BLOCKENTITIES && !defined HAND - YearCycleColor(color.rgb, gl_Color.rgb, mc_Entity.x == BLOCK_AIR_WAVING, true); + YearCycleColor(color.rgb, gl_Color.rgb, blockID == BLOCK_AIR_WAVING, true); #endif #ifdef TAA_UPSCALING diff --git a/shaders/dimensions/all_translucent.fsh b/shaders/dimensions/all_translucent.fsh index e5ff0963..9e4f6976 100644 --- a/shaders/dimensions/all_translucent.fsh +++ b/shaders/dimensions/all_translucent.fsh @@ -1,19 +1,17 @@ #include "/lib/settings.glsl" -// #if defined END_SHADER || defined NETHER_SHADER -// #undef IS_LPV_ENABLED -// #endif - #ifdef IS_LPV_ENABLED #extension GL_EXT_shader_image_load_store: enable #extension GL_ARB_shading_language_packing: enable #endif #include "/lib/res_params.glsl" +#include "/lib/blocks.glsl" varying vec4 lmtexcoord; varying vec4 color; uniform vec4 entityColor; +flat varying int blockID; #ifdef OVERWORLD_SHADER const bool shadowHardwareFiltering = true; @@ -815,6 +813,13 @@ if (gl_FragCoord.x * texelSize.x < 1.0 && gl_FragCoord.y * texelSize.y < 1.0 ) gl_FragData[0].rgb = FinalColor*0.1; #endif + #ifdef BLOCKENTITIES + if (blockID == BLOCK_SIGN && lmtexcoord.z >= (14.5/15.0)) { + // glowing sign text emission + SpecularTex.b = 0.6; + } + #endif + #if EMISSIVE_TYPE == 2 || EMISSIVE_TYPE == 3 Emission(gl_FragData[0].rgb, Albedo, SpecularTex.b, exposure); #endif diff --git a/shaders/dimensions/all_translucent.vsh b/shaders/dimensions/all_translucent.vsh index d328cdab..f011df09 100644 --- a/shaders/dimensions/all_translucent.vsh +++ b/shaders/dimensions/all_translucent.vsh @@ -1,6 +1,8 @@ #include "/lib/settings.glsl" #include "/lib/res_params.glsl" #include "/lib/bokeh.glsl" +#include "/lib/blocks.glsl" +#include "/lib/entities.glsl" #include "/lib/items.glsl" uniform float frameTimeCounter; @@ -15,6 +17,7 @@ Read the terms of modification and sharing before changing something below pleas varying vec4 lmtexcoord; varying vec4 color; +flat varying int blockID; uniform sampler2D colortex4; uniform sampler2D noisetex; @@ -44,7 +47,7 @@ uniform mat4 gbufferModelViewInverse; uniform mat4 gbufferModelView; varying vec3 viewVector; -flat varying int glass; +// flat varying int glass; attribute vec4 at_tangent; attribute vec4 mc_Entity; @@ -124,8 +127,14 @@ void main() { vec3 position = mat3(gl_ModelViewMatrix) * vec3(gl_Vertex) + gl_ModelViewMatrix[3].xyz; + blockID = int(mc_Entity.x + 0.5); + + #ifdef BLOCKENTITIES + blockID = blockEntityId; + #endif + #ifdef LARGE_WAVE_DISPLACEMENT - if(mc_Entity.x == 8.0) { + if (blockID == BLOCK_WATER) { vec3 displacedPos = mat3(gbufferModelViewInverse) * position + gbufferModelViewInverse[3].xyz + cameraPosition; #ifdef DISTANT_HORIZONS float range = min(1.0 + pow(length(displacedPos - cameraPosition) / min(far,256.0),2.0), 256.0); @@ -153,7 +162,7 @@ void main() { float mat = 0.0; // water mask - if(mc_Entity.x == 8.0) { + if (blockID == BLOCK_WATER) { mat = 1.0; gl_Position.z -= 1e-4; } @@ -161,11 +170,11 @@ void main() { // translucent entities #if defined ENTITIES || defined BLOCKENTITIES mat = 0.9; - if (entityId == 1803) mat = 0.8; + if (entityId == ENTITY_SLIME) mat = 0.8; #endif // translucent blocks - if (mc_Entity.x >= 301 && mc_Entity.x <= 321) mat = 0.7; + if (blockID >= BLOCK_GLASS && blockID <= BLOCK_SLIME) mat = 0.7; tangent = vec4(normalize(gl_NormalMatrix *at_tangent.rgb),at_tangent.w); diff --git a/shaders/dimensions/composite2.fsh b/shaders/dimensions/composite2.fsh index fd3b3d10..c6ba7746 100644 --- a/shaders/dimensions/composite2.fsh +++ b/shaders/dimensions/composite2.fsh @@ -74,27 +74,22 @@ float linearizeDepthFast(const in float depth, const in float near, const in flo flat varying float exposure; - #ifdef IS_LPV_ENABLED - #extension GL_ARB_shader_image_load_store: enable - #extension GL_ARB_shading_language_packing: enable - #endif + # WARN: thought extensions needed to be at beginning? + #extension GL_ARB_shader_image_load_store: enable + #extension GL_ARB_shading_language_packing: enable - #ifdef IS_LPV_ENABLED - uniform usampler1D texBlockData; - uniform sampler3D texLpv1; - uniform sampler3D texLpv2; - #endif + uniform usampler1D texBlockData; + uniform sampler3D texLpv1; + uniform sampler3D texLpv2; // #ifdef IS_LPV_ENABLED // uniform int heldItemId; // uniform int heldItemId2; // #endif - #ifdef IS_LPV_ENABLED - #include "/lib/hsv.glsl" - #include "/lib/lpv_common.glsl" - #include "/lib/lpv_render.glsl" - #endif + #include "/lib/hsv.glsl" + #include "/lib/lpv_common.glsl" + #include "/lib/lpv_render.glsl" vec3 LPV_FOG_ILLUMINATION(in vec3 playerPos, float dd, float dL){ @@ -311,7 +306,7 @@ void waterVolumetrics(inout vec3 inColor, vec3 rayStart, vec3 rayEnd, float estE vL += (light - light * exp(-waterCoefs * dd * rayLength)) / waterCoefs * absorbance; absorbance *= exp(-waterCoefs * dd * rayLength); - #if defined LPV_VL_FOG_ILLUMINATION && defined EXCLUDE_WRITE_TO_LUT + #if defined IS_LPV_ENABLED && defined LPV_VL_FOG_ILLUMINATION && defined EXCLUDE_WRITE_TO_LUT vL += LPV_FOG_ILLUMINATION(progressW-cameraPosition, dd, 1.0); #endif diff --git a/shaders/dimensions/shadowcomp.csh b/shaders/dimensions/shadowcomp.csh index 730c7eb7..8daaa5d1 100644 --- a/shaders/dimensions/shadowcomp.csh +++ b/shaders/dimensions/shadowcomp.csh @@ -42,6 +42,8 @@ layout (local_size_x = 8, local_size_y = 8, local_size_z = 8) in; ? imageLoad(imgLpv2, texCoord) : imageLoad(imgLpv1, texCoord); + // lpvSample.rgb = pow(lpvSample.rgb, vec3(2.2)); + vec4 hsv_sky = vec4(RgbToHsv(lpvSample.rgb), lpvSample.a); hsv_sky.zw = exp2(hsv_sky.zw * LpvBlockSkyRange) - 1.0; lpvSample = vec4(HsvToRgb(hsv_sky.xyz), hsv_sky.w); @@ -156,6 +158,8 @@ void main() { hsv_sky.zw = log2(hsv_sky.zw + 1.0) / LpvBlockSkyRange; lightValue = vec4(HsvToRgb(hsv_sky.xyz), hsv_sky.w); + // lightValue.rgb = pow(lightValue.rgb, vec3(1.0/2.2)); + // Store final value if (frameCounter % 2 == 0) imageStore(imgLpv1, imgCoord, lightValue); diff --git a/shaders/lib/end_fog.glsl b/shaders/lib/end_fog.glsl index 79918d26..9a4b8810 100644 --- a/shaders/lib/end_fog.glsl +++ b/shaders/lib/end_fog.glsl @@ -325,7 +325,7 @@ vec4 GetVolumetricFog( // absorbance *= exp(-max(density,hazeDensity)*dd*dL); //------ LPV FOG EFFECT - #if defined LPV_VL_FOG_ILLUMINATION && defined EXCLUDE_WRITE_TO_LUT + #if defined IS_LPV_ENABLED && defined LPV_VL_FOG_ILLUMINATION && defined EXCLUDE_WRITE_TO_LUT color += LPV_FOG_ILLUMINATION(progressW-cameraPosition, dd, dL) * TorchBrightness_autoAdjust * absorbance; #endif } diff --git a/shaders/lib/lpv_render.glsl b/shaders/lib/lpv_render.glsl index 608fd3ba..9aa9c5d3 100644 --- a/shaders/lib/lpv_render.glsl +++ b/shaders/lib/lpv_render.glsl @@ -13,6 +13,8 @@ vec4 SampleLpvLinear(const in vec3 lpvPos) { ? textureLod(texLpv1, texcoord, 0) : textureLod(texLpv2, texcoord, 0); + // lpvSample.rgb = pow(lpvSample.rgb, vec3(2.2)); + vec3 hsv = RgbToHsv(lpvSample.rgb); hsv.z = lpvCurve(hsv.b) * LpvBlockSkyRange.x; lpvSample.rgb = HsvToRgb(hsv); diff --git a/shaders/lib/nether_fog.glsl b/shaders/lib/nether_fog.glsl index aa3f0a1e..dbc7b48c 100644 --- a/shaders/lib/nether_fog.glsl +++ b/shaders/lib/nether_fog.glsl @@ -104,7 +104,7 @@ vec4 GetVolumetricFog( absorbance *= ceilingSmokeVolumeCoeff; //------ LPV FOG EFFECT - #if defined LPV_VL_FOG_ILLUMINATION && defined EXCLUDE_WRITE_TO_LUT + #if defined IS_LPV_ENABLED && defined LPV_VL_FOG_ILLUMINATION && defined EXCLUDE_WRITE_TO_LUT color += LPV_FOG_ILLUMINATION(progressW-cameraPosition, dd, dL) * TorchBrightness_autoAdjust * absorbance; #endif diff --git a/shaders/lib/overworld_fog.glsl b/shaders/lib/overworld_fog.glsl index e9285054..a4519d45 100644 --- a/shaders/lib/overworld_fog.glsl +++ b/shaders/lib/overworld_fog.glsl @@ -167,7 +167,7 @@ vec4 GetVolumetricFog( vec3 directMultiScattering = LightSourceColor * mieDayMulti * 3.14 * 2.0; #endif - #if defined LPV_VL_FOG_ILLUMINATION && defined EXCLUDE_WRITE_TO_LUT + #if defined IS_LPV_ENABLED && defined LPV_VL_FOG_ILLUMINATION && defined EXCLUDE_WRITE_TO_LUT float TorchBrightness_autoAdjust = mix(1.0, 30.0, clamp(exp(-10.0*exposure),0.0,1.0)) / 5.0; #endif @@ -247,7 +247,7 @@ vec4 GetVolumetricFog( color += (Atmosphere - Atmosphere*exp(-(rL+m)*dd*dL_alternate)) / (rL+m+1e-6) * absorbance; //------ LPV FOG EFFECT - #if defined LPV_VL_FOG_ILLUMINATION && defined EXCLUDE_WRITE_TO_LUT + #if defined IS_LPV_ENABLED && defined LPV_VL_FOG_ILLUMINATION && defined EXCLUDE_WRITE_TO_LUT color += LPV_FOG_ILLUMINATION(progressW-cameraPosition, dd, dL) * TorchBrightness_autoAdjust * absorbance; #endif diff --git a/shaders/template/block.properties b/shaders/template/block.properties index fa7d19f4..a60ea39c 100644 --- a/shaders/template/block.properties +++ b/shaders/template/block.properties @@ -734,7 +734,8 @@ block.*= minecraft:hanging_roots minecraft:weeping_vines minecraft:cave_vines:be ####### ----- LPV shapes ----- ####### #= BLOCK_LPV_IGNORE - block.401= chain ladder lever tripwire tripwire_hook [candle]:lit=false [supplementaries_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 scaffolding + block.401= chain ladder lever tripwire tripwire_hook [candle]:lit=false [supplementaries_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 scaffolding \ + create:andesite_ladder create:belt create:brass_ladder create:copper_ladder create:shaft #= 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 From a039b31cf9d6e6286809c79b27396de2038de4dc Mon Sep 17 00:00:00 2001 From: NULL511 Date: Sat, 22 Jun 2024 17:10:05 -0400 Subject: [PATCH 2/3] only apply glow text emission with floodfill --- shaders/dimensions/all_translucent.fsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shaders/dimensions/all_translucent.fsh b/shaders/dimensions/all_translucent.fsh index 9e4f6976..7a2f733d 100644 --- a/shaders/dimensions/all_translucent.fsh +++ b/shaders/dimensions/all_translucent.fsh @@ -813,7 +813,7 @@ if (gl_FragCoord.x * texelSize.x < 1.0 && gl_FragCoord.y * texelSize.y < 1.0 ) gl_FragData[0].rgb = FinalColor*0.1; #endif - #ifdef BLOCKENTITIES + #if defined BLOCKENTITIES && defined IS_LPV_ENABLED if (blockID == BLOCK_SIGN && lmtexcoord.z >= (14.5/15.0)) { // glowing sign text emission SpecularTex.b = 0.6; From 3557469fdcc0145552b4a33d1ba6fab0a781a36e Mon Sep 17 00:00:00 2001 From: NULL511 Date: Sat, 22 Jun 2024 18:27:18 -0400 Subject: [PATCH 3/3] cleanup --- shaders/dimensions/all_solid.fsh | 2 +- shaders/dimensions/all_solid.vsh | 4 ++-- shaders/dimensions/composite2.fsh | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/shaders/dimensions/all_solid.fsh b/shaders/dimensions/all_solid.fsh index a86d1473..fe2bccf9 100644 --- a/shaders/dimensions/all_solid.fsh +++ b/shaders/dimensions/all_solid.fsh @@ -83,7 +83,7 @@ uniform vec4 entityColor; // in vec3 velocity; -flat varying float blockID; +flat varying int blockID; flat varying float SSSAMOUNT; flat varying float EMISSIVE; diff --git a/shaders/dimensions/all_solid.vsh b/shaders/dimensions/all_solid.vsh index a95fc4a9..7ecfb5d5 100644 --- a/shaders/dimensions/all_solid.vsh +++ b/shaders/dimensions/all_solid.vsh @@ -55,7 +55,7 @@ attribute vec4 mc_midTexCoord; uniform int blockEntityId; uniform int entityId; -flat varying float blockID; +flat varying int blockID; uniform int heldItemId; uniform int heldItemId2; @@ -229,7 +229,7 @@ void main() { normalMat = vec4(normalize(gl_NormalMatrix * gl_Normal), 1.0); FlatNormals = normalMat.xyz; - blockID = mc_Entity.x; + blockID = int(mc_Entity.x + 0.5); if (blockID == BLOCK_GROUND_WAVING_VERTICAL || blockID == BLOCK_GRASS_SHORT || blockID == BLOCK_GRASS_TALL_LOWER || blockID == BLOCK_GRASS_TALL_UPPER ) normalMat.a = 0.60; diff --git a/shaders/dimensions/composite2.fsh b/shaders/dimensions/composite2.fsh index c6ba7746..ff8c8897 100644 --- a/shaders/dimensions/composite2.fsh +++ b/shaders/dimensions/composite2.fsh @@ -74,7 +74,7 @@ float linearizeDepthFast(const in float depth, const in float near, const in flo flat varying float exposure; - # WARN: thought extensions needed to be at beginning? + // WARN: thought extensions needed to be at beginning? #extension GL_ARB_shader_image_load_store: enable #extension GL_ARB_shading_language_packing: enable