Skip to content

Commit d613f72

Browse files
first commit
0 parents  commit d613f72

File tree

98 files changed

+1893
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+1893
-0
lines changed

.gitattributes

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
*.glsl text linguist-language=glsl
2+
*.vsh text linguist-language=glsl
3+
*.gsh text linguist-language=glsl
4+
*.tcs text linguist-language=glsl
5+
*.tes text linguist-language=glsl
6+
*.fsh text linguist-language=glsl
7+
*.csh text linguist-language=glsl

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
notes.md
2+
doNotRUN/*

LICENSE

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
3+
Copyright 2025 scratchcoder27
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6+
7+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8+
9+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

readme.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
A fast shader, attempting to still look nice.
2+
Uses the Template pack made by Bálint

shaders/dimension.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
dimension.shadersEnd = minecraft:the_end
2+
dimension.shadersNether = minecraft:the_nether
3+
dimension.shadersOverworld = minecraft:overworld

shaders/lib/conversions.glsl

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
uniform mat4 gbufferProjection;
2+
3+
vec3 toLinear(vec3 sRGB){
4+
return sRGB * (sRGB * (sRGB * 0.305306011 + 0.682171111) + 0.012522878);
5+
}
6+
7+
vec3 toSRGB(vec3 linear) {
8+
// Approximate x^(1/2.2)
9+
vec3 sqrt1 = sqrt(linear); // x^0.5
10+
vec3 sqrt2 = sqrt(sqrt1); // x^0.25
11+
return 0.662002687 * sqrt1 + 0.337997313 * sqrt2;
12+
}
13+
14+
vec3 projectAndDivide(mat4 projectionMatrix, vec3 position){
15+
vec4 homPos = projectionMatrix * vec4(position, 1.0);
16+
return homPos.xyz / homPos.w;
17+
}
18+
19+
vec3 viewToScreenSpace(vec3 viewSpacePos) {
20+
vec4 clipPos = gbufferProjection * vec4(viewSpacePos, 1.0);
21+
vec3 ndcPos = clipPos.xyz / clipPos.w;
22+
vec3 screenPos = ndcPos * 0.5 + 0.5;
23+
return screenPos;
24+
}

shaders/lib/distort.glsl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
const bool shadowtex0Nearest = true;
2+
const bool shadowtex1Nearest = true;
3+
const bool shadowcolor0Nearest = true;
4+
5+
vec3 distortShadowClipPos(vec3 shadowClipPos){
6+
float distortionFactor = length(shadowClipPos.xy); // distance from the player in shadow clip space
7+
distortionFactor += 0.1; // very small distances can cause issues so we add this to slightly reduce the distortion
8+
9+
shadowClipPos.xy /= distortionFactor;
10+
shadowClipPos.z *= 0.5; // increases shadow distance on the Z axis, which helps when the sun is very low in the sky
11+
return shadowClipPos;
12+
}

shaders/shaders.properties

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
screen = [SHADOWS] [END] [FOG] [GODRAYS] *
3+
sliders = shadowMapResolution FOG_DENSITY GODRAY_NUM_SAMPLES GODRAYS_WEIGHT GODRAYS_DECAY GODRAYS_DENSITY GODRAYS_EXPOSURE SHADOW_BIAS
4+
screen.SHADOWS = shadowMapResolution disableColoredShadows enableShadows pixelSnapping SHADOW_BIAS
5+
screen.END = enableEndStars
6+
screen.FOG = enableOverworldFog FOG_DENSITY
7+
screen.GODRAYS = GODRAY_NUM_SAMPLES GODRAYS GODRAYS_WEIGHT GODRAYS_DECAY GODRAYS_DENSITY GODRAYS_EXPOSURE
8+
9+
uniform.float.blockLightLerp = smooth(1, if(in(biome, BIOME_WARPED_FOREST), 1.0, 0.0), 15, 15)
10+
uniform.float.nightLightLerp = smooth(1, if(between(worldTime, 12785, 23215), 1.0, 0.0), 30, 30)

shaders/shadersEnd/composite.fsh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#version 330 compatibility
2+
3+
uniform sampler2D colortex0;
4+
5+
in vec2 texcoord;
6+
7+
/* RENDERTARGETS: 0 */
8+
layout(location = 0) out vec4 color;
9+
10+
void main() {
11+
color = texture(colortex0, texcoord);
12+
}

shaders/shadersEnd/composite.vsh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#version 330 compatibility
2+
3+
out vec2 texcoord;
4+
5+
void main() {
6+
gl_Position = ftransform();
7+
texcoord = (gl_TextureMatrix[0] * gl_MultiTexCoord0).xy;
8+
}

0 commit comments

Comments
 (0)