Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FloodFill Fixes #217

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions shaders/block.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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 ----- #######
Expand All @@ -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 \
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
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
2 changes: 1 addition & 1 deletion shaders/dimensions/all_solid.fsh
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
45 changes: 23 additions & 22 deletions shaders/dimensions/all_solid.vsh
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -229,18 +229,19 @@ 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;
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;
Expand All @@ -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;
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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

Expand All @@ -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
){
Expand All @@ -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;
}
Expand All @@ -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
Expand Down
13 changes: 9 additions & 4 deletions shaders/dimensions/all_translucent.fsh
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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

#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;
}
#endif

#if EMISSIVE_TYPE == 2 || EMISSIVE_TYPE == 3
Emission(gl_FragData[0].rgb, Albedo, SpecularTex.b, exposure);
#endif
Expand Down
19 changes: 14 additions & 5 deletions shaders/dimensions/all_translucent.vsh
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -153,19 +162,19 @@ 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;
}

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

Expand Down
Loading