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

In dev #2

Merged
merged 21 commits into from
Mar 16, 2024
Merged
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Github: https://github.com/hotsu0p/beyond-vanilla
- Enjoy an immersive gaming experience with carefully crafted details.

### Compatibility:

- highly recomennd https://modrinth.com/resourcepack/embrace-pixels for better visuals
- Tested on iris and sodium 1.1.6.
- Optimized for mid to low-tier devices.
- Not tested on Optifine.
Expand Down
Binary file added assets/after-fix.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/before-fix.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
v2.1 - 3/11/24\
Minor bug fixes/features
- Fixed color when you cant see the light source \
        - [?] See `./assets/before-fix` And `./asset/after-fix`
- Improved perfomance a little bit
- Added small pulsing affect to warden



v2 - 3/10/24
- Improve the end portal
- Fix the puddels
Expand Down
52 changes: 51 additions & 1 deletion misc/size.js
Original file line number Diff line number Diff line change
@@ -1 +1,51 @@
// will code here soon
const getCodeStats = require('@hotsuop/codestats');
const chalk = require('chalk');
// Define the folder path to analyze
const folderPath = '../shaders';

// Define the configuration object
const config = {
languages: ['js', 'html', 'glsl'], // Add more languages if needed
exclude: ['node_modules'], // Add folders to exclude
fileTypes: ['xml', 'css'], // Add more file types if needed
depthLimit: 5,
};


// Call getCodeStats with the folder path and configuration
getCodeStats(folderPath, config)
.then(projectStats => {
// Display the calculated project stats
console.log('Project Statistics:');
console.log(`Total Files: ${projectStats.totalFiles}`);
console.log(`Total Lines: ${projectStats.totalLines}`);
console.log(`Total Characters: ${projectStats.totalCharacters}`);
console.log(`Total Functions: ${projectStats.totalFunctions}`);
console.log(`Total Classes: ${projectStats.totalClasses}`);
console.log(`Total Comments: ${projectStats.totalComments}`);

// Display detailed stats for each file
console.log('\nFile Statistics:');
projectStats.files.forEach(fileStats => {
console.log(`\nFile: ${fileStats.filePath}`);
console.log(`Lines: ${fileStats.lines}`);
console.log(`Characters: ${fileStats.characters}`);
console.log(`Functions: ${fileStats.functionsCount}`);
console.log(`Classes: ${fileStats.classesCount}`);
console.log(`Comments: ${fileStats.commentsCount}`);
});

// Display file types summary
console.log('\nFile Types Summary:');
console.log('Type\t| Files\t| Lines');
console.log('--------|-------|----------');
for (const fileType in projectStats.fileTypesStats) {
const fileTypeStats = projectStats.fileTypesStats[fileType];
console.log(`${fileType}\t| ${fileTypeStats.files}\t| ${fileTypeStats.lines} (${((fileTypeStats.lines / projectStats.totalLines) * 100).toFixed(2)}%)`);
}
console.log('--------|-------|----------');
console.log(`All\t| ${projectStats.totalFiles}\t| ${projectStats.totalLines}`);
})
.catch(error => {
console.error(chalk.red(`Error: ${error.message}`));
});
48 changes: 27 additions & 21 deletions shaders/block.properties
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,16 @@
#if MC_VERSION >= 11300

#1.13+ Mapping

block.10044=smithing_table
block.10045=cauldron
block.10046=hopper
block.10048=end_portal_frame
block.10052=powder_snow_cauldron
block.10056=lava_cauldron
block.10000= \ minecraft:spawner
block.10044=\ minecraft:bell
block.10045=\ lava_cauldron
block.10046=\ minecraft:anvil
block.10048=\ minecraft:chipped_anvil
block.10052=\ minecraft:damaged_anvil
block.10056=\ minecraft:powered_rail:powered=true
block.10057=\ minecraft:note_block:powered=true
block.10100= \
minecraft:grass minecraft:fern minecraft:seagrass \
minecraft:grass minecraft:fern minecraft:seagrass minecraft:dead_bush\
minecraft:crimson_roots minecraft:warped_roots minecraft:nether_sprouts
block.10101= \
minecraft:poppy minecraft:dandelion minecraft:blue_orchid minecraft:allium minecraft:azure_bluet minecraft:red_tulip minecraft:orange_tulip minecraft:white_tulip minecraft:pink_tulip minecraft:oxeye_daisy minecraft:cornflower minecraft:lily_of_the_valley minecraft:wither_rose minecraft:sweet_berry_bush minecraft:pink_petals \
Expand All @@ -59,35 +60,41 @@ minecraft:wheat minecraft:carrots minecraft:potatoes minecraft:beetroots minecra
block.10105= \
minecraft:oak_leaves minecraft:spruce_leaves minecraft:birch_leaves minecraft:jungle_leaves minecraft:acacia_leaves minecraft:dark_oak_leaves minecraft:azalea_leaves minecraft:flowering_azalea_leaves minecraft:mangrove_leaves minecraft:cherry_leaves
block.10106= \
minecraft:vine minecraft:weeping_vines_plant minecraft:weeping_vines minecraft:twisting_vines_plant minecraft:twisting_vines
minecraft:vine minecraft:weeping_vines_plant minecraft:weeping_vines minecraft:twisting_vines_plant minecraft:twisting_vines
block.10107= \
minecraft:kelp minecraft:kelp_plant \
minecraft:azalea minecraft:flowering_azalea minecraft:big_dripleaf minecraft:big_dripleaf_stem minecraft:small_dripleaf minecraft:spore_blossom \
minecraft:cave_vines_plant:berries=false minecraft:cave_vines:berries=false
block.10108= \
minecraft:lily_pad
block.10465= \ minecraft:brown_mushroom_block
block.10109= \
minecraft:oak_sapling minecraft:spruce_sapling minecraft:birch_sapling minecraft:jungle_sapling minecraft:acacia_sapling minecraft:dark_oak_sapling minecraft:mangrove_propagule minecraft:cherry_sapling \
minecraft:dead_bush minecraft:sugar_cane minecraft:red_mushroom minecraft:brown_mushroom minecraft:cobweb minecraft:nether_wart minecraft:crimson_fungus minecraft:warped_fungus \
minecraft:dead_bush minecraft:cactus minecraft:red_mushroom minecraft:brown_mushroom minecraft:cobweb minecraft:nether_wart minecraft:crimson_fungus minecraft:warped_fungus \
minecraft:pitcher_plant minecraft:pitcher_crop
block.10200= \
minecraft:redstone_wire:power=1 minecraft:redstone_wire:power=2 minecraft:redstone_wire:power=3 minecraft:redstone_wire:power=4 minecraft:redstone_wire:power=5 minecraft:redstone_wire:power=6 minecraft:redstone_wire:power=7 minecraft:redstone_wire:power=8 minecraft:redstone_wire:power=9 minecraft:redstone_wire:power=10 minecraft:redstone_wire:power=11 minecraft:redstone_wire:power=12 minecraft:redstone_wire:power=13 minecraft:redstone_wire:power=14 minecraft:redstone_wire:power=15 \
minecraft:repeater:powered=true minecraft:comparator:powered=true \
minecraft:redstone_torch:lit=true minecraft:redstone_wall_torch:lit=true \
minecraft:soul_torch minecraft:soul_wall_torch minecraft:soul_campfire:lit=true \
minecraft:torch minecraft:wall_torch minecraft:end_rod \
minecraft:torch minecraft:wall_torch minecraft:end_rod \
minecraft:jack_o_lantern minecraft:campfire:lit=true \
minecraft:sea_pickle minecraft:glow_lichen \
minecraft:small_amethyst_bud minecraft:medium_amethyst_bud minecraft:large_amethyst_bud minecraft:amethyst_cluster \
minecraft:ochre_froglight minecraft:verdant_froglight minecraft:pearlescent_froglight \
minecraft:sculk minecraft:sculk_vein minecraft:sculk_sensor minecraft:calibrated_sculk_sensor minecraft:sculk_catalyst minecraft:sculk_shrieker \
minecraft:respawn_anchor:charges=1 minecraft:respawn_anchor:charges=2 minecraft:respawn_anchor:charges=3 minecraft:respawn_anchor:charges=4
minecraft:respawn_anchor:charges=1 minecraft:respawn_anchor:charges=2 minecraft:respawn_anchor:charges=3 minecraft:respawn_anchor
block.10201= \
minecraft:glowstone minecraft:shroomlight minecraft:redstone_lamp:lit=true minecraft:sea_lantern minecraft:lantern:hanging=false \
minecraft:magma_block\
minecraft:soul_lantern:hanging=false
block.10202= \
minecraft:furnace:lit=true minecraft:blast_furnace:lit=true minecraft:smoker:lit=true
block.10210=\ minecraft:brewing_stand:has_bottle_0=true
block.10211= \ minecraft:brewing_stand:has_bottle_1=true
block.10212= \ minecraft:brewing_stand:has_bottle_2=true
block.10219=\ minecraft:redstone_ore minecraft:deepslate_redstone_ore
block.10220=\ minecraft:redstone_ore:lit=true minecraft:deepslate_redstone_ore:lit=true
block.10203= \
minecraft:lava minecraft:flowing_lava
block.10204= \
Expand Down Expand Up @@ -123,14 +130,14 @@ minecraft:sign minecraft:oak_sign minecraft:spruce_sign minecraft:birch_sign min
minecraft:wall_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:cherry_wall_sign minecraft:bamboo_wall_sign minecraft:crimson_wall_sign minecraft:warped_wall_sign \
minecraft:oak_hanging_sign minecraft:spruce_hanging_sign minecraft:birch_hanging_sign minecraft:jungle_hanging_sign minecraft:acacia_hanging_sign minecraft:dark_oak_hanging_sign minecraft:mangrove_hanging_sign minecraft:cherry_hanging_sign minecraft:bamboo_hanging_sign minecraft:crimson_hanging_sign minecraft:warped_hanging_sign
block.10401= \
minecraft:end_portal minecraft:end_gateway
minecraft:end_portal minecraft:end_gateway minecraft:command_block

#elif MC_VERSION >= 10800

#1.8-1.12 Mapping
block.10999=chain
block.10044=smithing_table
block.10045=cauldron
block.10044=\ minecraft:bell
block.10045=\ minecraft:cactus
block.10046=hopper
block.10048=water_cauldron
block.10052=powder_snow_cauldron
Expand All @@ -153,8 +160,7 @@ minecraft:vine
block.10108= \
minecraft:waterlily
block.10109= \
minecraft:sapling \
minecraft:deadbush minecraft:reeds minecraft:red_mushroom minecraft:brown_mushroom minecraft:cobweb minecraft:nether_wart
minecraft:sapling \ minecraft:reeds minecraft:red_mushroom minecraft:brown_mushroom minecraft:cobweb minecraft:nether_wart

block.10200= \
minecraft:redstone_wire minecraft:repeater:powered=true minecraft:comparator:powered=true \
Expand All @@ -173,7 +179,7 @@ block.10204= \
minecraft:fire
block.10205= \
minecraft:beacon

block.10465= \ minecraft:coal_ore
block.10300= \
minecraft:water minecraft:flowing_water nether_portal
block.10301= \
Expand All @@ -190,8 +196,8 @@ minecraft:end_portal minecraft:end_gateway
#else

#1.7 Mapping
block.10044=smithing_table
block.10045=cauldron
block.10044=\ minecraft:bell
block.10045=\ minecraft:cactus
block.10046=hopper
block.10048=water_cauldron
block.10052=powder_snow_cauldron
Expand Down Expand Up @@ -231,7 +237,7 @@ block.10204= \
minecraft:fire
block.10205= \
minecraft:beacon

block.10465= \ minecraft:coal_ore
block.10300= \
minecraft:water minecraft:flowing_water
block.10301= \
Expand Down
3 changes: 2 additions & 1 deletion shaders/entity.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@

#1.13+ Mapping

entity.10100=minecraft:item_frame minecraft:painting minecraft:glow_item_frame
entity.10100=minecraft:item_frame minecraft:painting minecraft:glow_item_frame
entity.10301=minecraft:warden
entity.10101=minecraft:lightning_bolt

#endif
5 changes: 3 additions & 2 deletions shaders/item.properties
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@

#1.13+ Mapping

item.89=minecraft:glowstone minecraft:beacon minecraft:sea_lantern minecraft:lantern minecraft:soul_lantern
item.89=minecraft:glowstone minecraft:beacon minecraft:sea_lantern minecraft:lantern minecraft:soul_lantern

item.50=minecraft:torch minecraft:end_rod minecraft:redstone_torch minecraft:jack_o_lantern minecraft:shroomlight minecraft:lava_bucket minecraft:glow_lichen minecraft:small_amethyst_bud minecraft:medium_amethyst_bud minecraft:large_amethyst_bud minecraft:amethyst_cluster minecraft:glow_berries minecraft:ochre_froglight minecraft:verdant_froglight minecraft:pearlescent_froglight
item.50=minecraft:torch minecraft:cake minecraft:red_mushroom minecraft:sculk_catalyst minecraft:end_rod minecraft:redstone_torch minecraft:jack_o_lantern minecraft:shroomlight minecraft:lava_bucket minecraft:glow_lichen minecraft:small_amethyst_bud minecraft:medium_amethyst_bud minecraft:large_amethyst_bud minecraft:amethyst_cluster minecraft:glow_berries minecraft:ochre_froglight minecraft:verdant_froglight minecraft:pearlescent_froglight

item.213=minecraft:magma_block

item.358=minecraft:filled_map

item.169=
#endif
2 changes: 1 addition & 1 deletion shaders/lang/en_US.lang
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ option.MCBL_LEGACY_COLOR=Legacy Color
option.MCBL_LEGACY_COLOR.comment=Use the old method of calculating blocklight color.

#Material
option.ADVANCED_MATERIALS=ADVANCED_MATERIALS
option.ADVANCED_MATERIALS=Advanced Materials
option.ADVANCED_MATERIALS.comment=Enables the use of specular and normal mapping which allows for more detail on various things. §e[*]§rThis option requires a resource pack which contains specular and/or normal maps, disable if none is currently used. §e[*]§rOptions which requires advanced materials are indicated by *, changing these options won't affect the visuals or performance while advanced materials is disabled.

option.MATERIAL_FORMAT=Material Format*
Expand Down
2 changes: 1 addition & 1 deletion shaders/lib/atmospherics/clouds.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -348,4 +348,4 @@ vec3 DrawAurora(vec3 viewPos, float dither, int samples) {
return aurora * visibility;
}
#endif
#endif
#endif
36 changes: 18 additions & 18 deletions shaders/lib/atmospherics/fog.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -106,27 +106,27 @@ void NormalFog(inout vec3 color, vec3 viewPos) {
#endif

#ifdef NETHER
float viewLength = length(viewPos);
float fog = 2.0 * pow(viewLength * FOG_DENSITY / 256.0, 1.5);
#if DISTANT_FADE == 2 || DISTANT_FADE == 3
fog += 6.0 * pow(fogFactor * 1.5 / far, 4.0);
#endif
fog = 1.0 - exp(-fog);
vec3 fogColor = netherCol.rgb * 0.0425;
float viewLength = length(viewPos);
float fog = 2.0 * pow(viewLength * FOG_DENSITY / 256.0, 1.5);
#if DISTANT_FADE == 2 || DISTANT_FADE == 3
fog += 6.0 * pow(fogFactor * 1.5 / far, 4.0);
#endif
fog = 1.0 - exp(-fog);
vec3 fogColor = netherCol.rgb * 0.0425;
#endif

#ifdef END
float fog = length(viewPos) * FOG_DENSITY / 128.0;
#if DISTANT_FADE == 2 || DISTANT_FADE == 3
fog += 6.0 * pow(fogFactor * 1 / far, 6.0);
#endif
fog = 1.0 - exp(-0.8 * fog * fog);
vec3 fogColor = endCol.rgb * 0.00625;
#ifndef LIGHT_SHAFT
fogColor *= 2.5;
#endif
// No fog effect
float fog = length(viewPos) * FOG_DENSITY / 12800.0; // Removed fog calculation
#if DISTANT_FADE == 2 || DISTANT_FADE == 3
fog += 6.0 * pow(fogFactor * 1 / far, 6.0);
#endif
fog = 1.0 - exp(-0.8 * fog * fog);
vec3 fogColor = endCol.rgb * 0.000625; // Reduced fogColor intensity to make fog less visible
#ifndef LIGHT_SHAFT
fogColor *= 1.0; // Reduced fogColor multiplier to make fog less intense
#endif
#endif

color = mix(color, fogColor, fog);
}

Expand Down
2 changes: 1 addition & 1 deletion shaders/lib/color/endColor.glsl
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
vec4 endColSqrt = vec4(vec3(END_R, END_G, END_B) / 145.0, 1.0) * END_I;
vec4 endColSqrt = vec4(vec3(END_R, END_G, END_B) / 150.0, 1.0) * END_I;
vec4 endCol = endColSqrt * endColSqrt;
56 changes: 29 additions & 27 deletions shaders/lib/lighting/coloredBlocklight.glsl
Original file line number Diff line number Diff line change
@@ -1,35 +1,37 @@
vec2 Reprojection(vec3 pos) {
pos = pos * 2.0 - 1.0;
pos = pos * 2.0 - 1.0;

vec4 viewPosPrev = gbufferProjectionInverse * vec4(pos, 1.0);
viewPosPrev /= viewPosPrev.w;
viewPosPrev = gbufferModelViewInverse * viewPosPrev;
vec4 viewPosPrev = gbufferProjectionInverse * vec4(pos, 1.0);
viewPosPrev /= viewPosPrev.w;
viewPosPrev = gbufferModelViewInverse * viewPosPrev;

vec3 cameraOffset = cameraPosition - previousCameraPosition;
cameraOffset *= float(pos.z > 0.56);
vec3 cameraOffset = cameraPosition - previousCameraPosition;
cameraOffset *= float(pos.z > 0.56);

vec4 previousPosition = viewPosPrev + vec4(cameraOffset, 0.0);
previousPosition = gbufferPreviousModelView * previousPosition;
previousPosition = gbufferPreviousProjection * previousPosition;
return previousPosition.xy / previousPosition.w * 0.5 + 0.5;
vec4 previousPosition = viewPosPrev + vec4(cameraOffset, 0.0);
previousPosition = gbufferPreviousModelView * previousPosition;
previousPosition = gbufferPreviousProjection * previousPosition;

return previousPosition.xy / previousPosition.w * 0.5 + 0.5;
}

vec3 ApplyMultiColoredBlocklight(vec3 blocklightCol, vec3 screenPos) {
if (screenPos.z > 0.56) {
screenPos.xy = Reprojection(screenPos);
}
vec3 coloredLight = texture2DLod(colortex9, screenPos.xy, 2).rgb;

#ifndef MCBL_LEGACY_COLOR
vec3 coloredLightNormalized = coloredLight + 0.000001;
coloredLightNormalized = normalize(coloredLightNormalized * coloredLightNormalized) * 0.875 + 0.125;
coloredLightNormalized *= GetLuminance(blocklightCol) * 1.7;
float coloredLightMix = min((coloredLight.r + coloredLight.g + coloredLight.b) * 2048.0, 1.0);
#else
vec3 coloredLightNormalized = normalize(coloredLight + 0.00001);
coloredLightNormalized *= GetLuminance(blocklightCol) / GetLuminance(coloredLightNormalized);
float coloredLightMix = min((coloredLight.r + coloredLight.g + coloredLight.b) * 256.0, 1.0);
#endif

return mix(blocklightCol, coloredLightNormalized, coloredLightMix);
if (screenPos.z > 0.56) {
screenPos.xy = Reprojection(screenPos);
}
vec3 coloredLight = texture2DLod(colortex9, screenPos.xy, 2).rgb;

vec3 coloredLightNormalized;
float coloredLightMix;

coloredLightNormalized = normalize(coloredLight + 1e-6);
coloredLightNormalized = mix(coloredLightNormalized * coloredLightNormalized, vec3(1.0), 0.1);
coloredLightNormalized *= GetLuminance(blocklightCol) * 1.2; // Adjust the multiplier here
coloredLightNormalized = mix(coloredLightNormalized, vec3(0.5, 0.6, 1.0), 0.5); // Introduce a colder tone
coloredLightMix = min(dot(coloredLightNormalized, vec3(1.0)), 1.0);

// Adjust the mix factor based on distance or other criteria if needed
float mixFactor = clamp(length(screenPos.xy - vec2(0.5)) * 2.0, 0.0, 1.0);

return mix(blocklightCol, coloredLightNormalized, coloredLightMix * mixFactor);
}
Loading
Loading