From 7e5459b1e66a9b0887a2c6b6fcaae3b83d1f5ec4 Mon Sep 17 00:00:00 2001 From: Hotsuop <130086894+hotsu0p@users.noreply.github.com> Date: Sun, 10 Mar 2024 18:40:25 -0500 Subject: [PATCH 1/5] Create static.yml --- .github/workflows/static.yml | 43 ++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/static.yml diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml new file mode 100644 index 0000000..9e9d349 --- /dev/null +++ b/.github/workflows/static.yml @@ -0,0 +1,43 @@ +# Simple workflow for deploying static content to GitHub Pages +name: Deploy static content to Pages + +on: + # Runs on pushes targeting the default branch + push: + branches: ["master"] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + # Single deploy job since we're just deploying + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup Pages + uses: actions/configure-pages@v4 + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + # Upload entire repository + path: '.' + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 From 27bd419cf4f95553aa7f036dc9583a3d3a5f323f Mon Sep 17 00:00:00 2001 From: Hotsuop <130086894+hotsu0p@users.noreply.github.com> Date: Mon, 11 Mar 2024 07:08:01 -0500 Subject: [PATCH 2/5] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index be33073..d14281d 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ ### Installation Guide: ## Links -Modrinth: https://modrinth.com/shader/beyond-vanilla\ +Modrinth: https://modrinth.com/shader/beyond-vanilla \ forge: (Soon)\ Github: https://github.com/hotsu0p/beyond-vanilla From 9dc82f9e239b622b2639a4af159eab291c371f09 Mon Sep 17 00:00:00 2001 From: Hotsuop <130086894+hotsu0p@users.noreply.github.com> Date: Thu, 14 Mar 2024 17:00:26 -0500 Subject: [PATCH 3/5] Create SECURITY.md --- SECURITY.md | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 SECURITY.md diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..6d09fcd --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,7 @@ +# Security Policy + +## Reporting a Vulnerability + +Use this section to tell people how to report a vulnerability. + +Please open an issue From f483ce5191361b099933d40d6b70fe432ae4f900 Mon Sep 17 00:00:00 2001 From: Mona Lisa Date: Sat, 23 Mar 2024 12:00:47 -0500 Subject: [PATCH 4/5] fixed water --- shaders/program/gbuffers_water.glsl | 31 ++++-- shaders/program/shadow.glsl | 161 ++++++++++++++-------------- 2 files changed, 107 insertions(+), 85 deletions(-) diff --git a/shaders/program/gbuffers_water.glsl b/shaders/program/gbuffers_water.glsl index 3c58c18..331e0ad 100644 --- a/shaders/program/gbuffers_water.glsl +++ b/shaders/program/gbuffers_water.glsl @@ -677,13 +677,30 @@ float frametime = frameTimeCounter * ANIMATION_SPEED; //Common Functions// float WavingWater(vec3 worldPos) { - float fractY = fract(worldPos.y + cameraPosition.y + 0.005); - - float wave = sin(6.28 * (frametime * 0.7 + worldPos.x * 0.14 + worldPos.z * 0.07)) + - sin(6.28 * (frametime * 0.5 + worldPos.x * 0.10 + worldPos.z * 0.20)); - if (fractY > 0.01) return wave * 0.0125; - - return 0.0; + float fractY = fract(worldPos.y + cameraPosition.y + 0.005); + + float distance = distance(worldPos, cameraPosition); + float waveFrequency = mix(0.7, 0.5, distance / 10.0); + float waveAmplitude = mix(0.035, 0.02, distance / 10.0); + + // Adjust the wave frequency and amplitude based on distance to avoid glitches at far distances + waveFrequency *= 1.0 - smoothstep(0.0, 100.0, distance); + waveAmplitude *= 1.0 - smoothstep(0.0, 100.0, distance); + + float wave = sin(6.28 * (frametime * waveFrequency + worldPos.x * 0.14 + worldPos.z * 0.07)) + + sin(6.28 * (frametime * waveFrequency + worldPos.x * 0.10 + worldPos.z * 0.20)); + + // Clamp the wave amplitude to prevent extreme values + waveAmplitude = clamp(waveAmplitude, 0.0, 0.02); + + // Apply a smoothstep function to the wave to reduce the appearance of black lines + wave = smoothstep(-1.0, 1.0, wave); + + if (fractY > 0.01) { + return wave * waveAmplitude; + } + + return 0.0; } uniform sampler2D raindropTexture; diff --git a/shaders/program/shadow.glsl b/shaders/program/shadow.glsl index d20adf5..e67ac72 100644 --- a/shaders/program/shadow.glsl +++ b/shaders/program/shadow.glsl @@ -19,15 +19,12 @@ varying vec4 color; //Uniforms// uniform int blockEntityId; - uniform sampler2D tex; - #ifdef WATER_CAUSTICS uniform int worldTime; - uniform float frameTimeCounter; - uniform sampler2D noisetex; +uniform vec3 cameraPosition; // Add this line #endif //Common Variables// @@ -68,92 +65,100 @@ float GetWaterHeightMap(vec3 worldPos, vec2 offset) { #include "/lib/color/waterColor.glsl" #endif +//Program// +//Program// +//Program// //Program// void main() { #if MC_VERSION >= 11300 - if (blockEntityId == 10205) discard; - #endif + if (blockEntityId == 10205) discard; + #endif vec4 albedo = texture2D(tex, texCoord.xy); - albedo.rgb *= color.rgb; + albedo.rgb *= color.rgb; float premult = float(mat > 0.98 && mat < 1.02); - float water = float(mat > 1.98 && mat < 2.02); - float disable = float(mat > 2.98 && mat < 3.02); - if (albedo.a < 0.01 || disable > 0.5) discard; - - if (water > 0.5) { - #if !defined WATER_SHADOW_COLOR && !defined WATER_CAUSTICS - discard; - #else - #ifdef WATER_SHADOW_COLOR - #if WATER_MODE == 0 - albedo.rgb = pow(waterColor.rgb / waterColor.a, vec3(0.25)); - #elif WATER_MODE == 1 - albedo.rgb = sqrt(albedo.rgb); - #elif WATER_MODE == 2 - float waterLuma = length(albedo.rgb * albedo.rgb / pow(color.rgb, vec3(2.2))) * 2.0; - albedo.rgb = sqrt(waterLuma * sqrt(waterColor.rgb / waterColor.a)); - #elif WATER_MODE == 3 - albedo.rgb = sqrt(color.rgb * 0.59); - #endif - - #if WATER_ALPHA_MODE == 0 - albedo.a = waterAlpha; - #endif - #else - albedo.rgb = vec3(1.0); - #endif - - #ifdef WATER_CAUSTICS - float normalOffset = WATER_SHARPNESS + 0.2; - - float normalStrength = 0.35; - - float h0 = GetWaterHeightMap(worldPos, vec2(0.0)); - float h1 = GetWaterHeightMap(worldPos, vec2( normalOffset, 0.0)); - float h2 = GetWaterHeightMap(worldPos, vec2(-normalOffset, 0.0)); - float h3 = GetWaterHeightMap(worldPos, vec2(0.0, normalOffset)); - float h4 = GetWaterHeightMap(worldPos, vec2(0.0, -normalOffset)); - - float xDeltaA = (h1 - h0) / normalOffset; - float xDeltaB = (h2 - h0) / normalOffset; - float yDeltaA = (h3 - h0) / normalOffset; - float yDeltaB = (h4 - h0) / normalOffset; - - float height = max((xDeltaA * -xDeltaB + yDeltaA * -yDeltaB), 0.0); - - #if WATER_NORMALS == 1 - height *= 48.0; - #elif WATER_NORMALS == 2 - height *= 24.0; - #endif - - #ifdef WATER_SHADOW_COLOR - height /= length(albedo.rgb); - #endif - - height /= sqrt(height * height / 9.0 + 1.0); - - albedo.rgb *= 1.0 + height; - #endif - #endif - } + float water = float(mat > 1.98 && mat < 2.02); + float disable = float(mat > 2.98 && mat < 3.02); + if (albedo.a < 0.01 || disable > 0.5) discard; + + if (water > 0.5) { + #if !defined WATER_SHADOW_COLOR && !defined WATER_CAUSTICS + discard; + #else + #ifdef WATER_SHADOW_COLOR + #if WATER_MODE == 0 + albedo.rgb = pow(waterColor.rgb / waterColor.a, vec3(0.25)); + #elif WATER_MODE == 1 + albedo.rgb = sqrt(albedo.rgb); + #elif WATER_MODE == 2 + float waterLuma = length(albedo.rgb * albedo.rgb / pow(color.rgb, vec3(2.2))) * 2.0; + albedo.rgb = sqrt(waterLuma * sqrt(waterColor.rgb / waterColor.a)); + #elif WATER_MODE == 3 + albedo.rgb = sqrt(color.rgb * 0.59); + #endif + + #if WATER_ALPHA_MODE == 0 + albedo.a = waterAlpha; + #endif + #else + albedo.rgb = vec3(1.0); + #endif + + #ifdef WATER_CAUSTICS + // Smooth the caustics effect to prevent flashing + float normalOffset = WATER_SHARPNESS + 0.2; + float normalStrength = 0.35; + + float h0 = GetWaterHeightMap(worldPos, vec2(0.0)); + float h1 = GetWaterHeightMap(worldPos, vec2( normalOffset, 0.0)); + float h2 = GetWaterHeightMap(worldPos, vec2(-normalOffset, 0.0)); + float h3 = GetWaterHeightMap(worldPos, vec2(0.0, normalOffset)); + float h4 = GetWaterHeightMap(worldPos, vec2(0.0, -normalOffset)); + + float xDeltaA = (h1 - h0) / normalOffset; + float xDeltaB = (h2 - h0) / normalOffset; + float yDeltaA = (h3 - h0) / normalOffset; + float yDeltaB = (h4 - h0) / normalOffset; + + float height = max((xDeltaA * -xDeltaB + yDeltaA * -yDeltaB), 0.0); + + #if WATER_NORMALS == 1 + height *= 48.0; + #elif WATER_NORMALS == 2 + height *= 24.0; + #endif + + #ifdef WATER_SHADOW_COLOR + height /= length(albedo.rgb); + #endif + + height /= sqrt(height * height / 9.0 + 1.0); + + // Apply a smoothing function to the height to prevent flashing + height = smoothstep(0.0, 1.0, height); + + albedo.rgb *= 1.0 + height; + #endif + #endif + } #ifdef SHADOW_COLOR - albedo.rgb = mix(vec3(1.0), albedo.rgb, 1.0 - pow(1.0 - albedo.a, 1.5)); - albedo.rgb *= 1.0 - pow(albedo.a, 96.0); - #else - if ((premult > 0.5 && albedo.a < 0.98)) albedo.a = 0.0; - #endif + albedo.rgb = mix(vec3(1.0), albedo.rgb, 1.0 - pow(1.0 - albedo.a, 1.5)); + albedo.rgb *= 1.0 - pow(albedo.a, 96.0); + #else + if ((premult > 0.5 && albedo.a < 0.98)) albedo.a = 0.0; + #endif - #ifdef WATER_CAUSTICS - albedo.rgb *= 0.25; - #endif + #ifdef WATER_CAUSTICS + albedo.rgb *= 0.25; + #endif - gl_FragData[0] = albedo; -} + // Ensure that the albedo is not too dark during the day + albedo.rgb = max(albedo.rgb, vec3(0.1)); + gl_FragData[0] = albedo; +} #endif //Vertex Shader///////////////////////////////////////////////////////////////////////////////////// From a784197ccd81431b3c73b6d0b4e17a19764e73fb Mon Sep 17 00:00:00 2001 From: Mona Lisa Date: Sat, 23 Mar 2024 12:10:03 -0500 Subject: [PATCH 5/5] fixed leaves --- shaders/block.properties | 16 +++++----------- shaders/lib/vertex/waving.glsl | 10 +++++++--- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/shaders/block.properties b/shaders/block.properties index c1df473..1395323 100644 --- a/shaders/block.properties +++ b/shaders/block.properties @@ -48,17 +48,11 @@ block.10057=\ minecraft:note_block:powered=true minecraft:jukebox:has_record=tru block.10100= \ 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 \ -minecraft:tube_coral minecraft:brain_coral minecraft:bubble_coral minecraft:fire_coral minecraft:horn_coral minecraft:dead_tube_coral minecraft:dead_brain_coral minecraft:dead_bubble_coral minecraft:dead_fire_coral minecraft:dead_horn_coral minecraft:tube_coral_fan minecraft:brain_coral_fan minecraft:bubble_coral_fan minecraft:fire_coral_fan minecraft:horn_coral_fan minecraft:dead_tube_coral_fan minecraft:dead_brain_coral_fan minecraft:dead_bubble_coral_fan minecraft:dead_fire_coral_fan minecraft:dead_horn_coral_fan -block.10102= \ -minecraft:sunflower:half=lower minecraft:lilac:half=lower minecraft:tall_grass:half=lower minecraft:large_fern:half=lower minecraft:rose_bush:half=lower minecraft:peony:half=lower minecraft:tall_seagrass:half=lower -block.10103= \ -minecraft:sunflower:half=upper minecraft:lilac:half=upper minecraft:tall_grass:half=upper minecraft:large_fern:half=upper minecraft:rose_bush:half=upper minecraft:peony:half=upper minecraft:tall_seagrass:half=upper -block.10104= \ -minecraft:wheat minecraft:carrots minecraft:potatoes minecraft:beetroots minecraft:pumpkin_stem minecraft:attached_pumpkin_stem minecraft:melon_stem minecraft:attached_melon_stem minecraft:torchflower -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.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 minecraft:tube_coral minecraft:brain_coral minecraft:bubble_coral minecraft:fire_coral minecraft:horn_coral minecraft:dead_tube_coral minecraft:dead_brain_coral minecraft:dead_bubble_coral minecraft:dead_fire_coral minecraft:dead_horn_coral minecraft:tube_coral_fan minecraft:brain_coral_fan minecraft:bubble_coral_fan minecraft:fire_coral_fan minecraft:horn_coral_fan minecraft:dead_tube_coral_fan minecraft:dead_brain_coral_fan minecraft:dead_bubble_coral_fan minecraft:dead_fire_coral_fan minecraft:dead_horn_coral_fan +block.10102= \ minecraft:sunflower:half=lower minecraft:lilac:half=lower minecraft:tall_grass:half=lower minecraft:large_fern:half=lower minecraft:rose_bush:half=lower minecraft:peony:half=lower minecraft:tall_seagrass:half=lower +block.10103= \ minecraft:sunflower:half=upper minecraft:lilac:half=upper minecraft:tall_grass:half=upper minecraft:large_fern:half=upper minecraft:rose_bush:half=upper minecraft:peony:half=upper minecraft:tall_seagrass:half=upper +block.10104= \ minecraft:wheat minecraft:carrots minecraft:potatoes minecraft:beetroots minecraft:pumpkin_stem minecraft:attached_pumpkin_stem minecraft:melon_stem minecraft:attached_melon_stem minecraft:torchflower +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 block.10107= \ diff --git a/shaders/lib/vertex/waving.glsl b/shaders/lib/vertex/waving.glsl index 5ea4e10..5c09669 100644 --- a/shaders/lib/vertex/waving.glsl +++ b/shaders/lib/vertex/waving.glsl @@ -106,9 +106,13 @@ vec3 WavingBlocks(vec3 position, float istopv) { #endif #ifdef WAVING_LEAF - if (mc_Entity.x == 10105) - wave += CalcMove(worldpos, 0.25, .80, vec2(0.04, 0.04)); - + if (mc_Entity.x == 10105 && istopv > 0.9) { + float swingSpeed = 0.05; + float swingAmplitude = 0.01; + float swingDirection = 1.0; + wave.x += sin(worldpos.y * swingSpeed + frametime) * swingAmplitude * swingDirection; + wave.z += cos(worldpos.y * swingSpeed + frametime) * swingAmplitude * swingDirection; + } #endif #ifdef WAVING_VINE