Skip to content

Commit

Permalink
update for 1.21.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Godlander committed Oct 28, 2024
1 parent 5b22077 commit 001f717
Show file tree
Hide file tree
Showing 12 changed files with 16 additions and 73 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.zip
5 changes: 1 addition & 4 deletions assets/minecraft/shaders/core/render/armor.fsh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#version 150

#moj_import <fog.glsl>
#moj_import <minecraft:fog.glsl>

uniform sampler2D Sampler0;

Expand All @@ -13,17 +13,14 @@ in float vertexDistance;
in vec4 vertexColor;
in vec4 tintColor;
in vec4 lightColor;
in vec4 overlayColor;
in vec2 uv;
in vec4 normal;

out vec4 fragColor;

void main() {
vec4 color = texture(Sampler0, uv);
if (color.a < 0.1) discard;
color *= tintColor * ColorModulator;
color.rgb = mix(overlayColor.rgb, color.rgb, overlayColor.a);
color *= vertexColor * lightColor; //shading
fragColor = linear_fog(color, vertexDistance, FogStart, FogEnd, FogColor);
}
11 changes: 4 additions & 7 deletions assets/minecraft/shaders/core/render/armor.vsh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#version 150

#moj_import <light.glsl>
#moj_import <fog.glsl>
#moj_import <minecraft:light.glsl>
#moj_import <minecraft:fog.glsl>

in vec3 Position;
in vec4 Color;
Expand All @@ -11,11 +11,11 @@ in ivec2 UV2;
in vec3 Normal;

uniform sampler2D Sampler0;
uniform sampler2D Sampler1;
uniform sampler2D Sampler2;

uniform mat4 ModelViewMat;
uniform mat4 ProjMat;
uniform mat4 TextureMat;
uniform int FogShape;

uniform vec3 Light0_Direction;
Expand All @@ -27,7 +27,6 @@ out vec4 tintColor;
out vec4 lightColor;
out vec4 overlayColor;
out vec2 uv;
out vec4 normal;

int toint(vec3 c) {
ivec3 v = ivec3(c*255);
Expand All @@ -40,10 +39,8 @@ void main() {
vertexDistance = fog_distance(Position, FogShape);
tintColor = Color;
vertexColor = minecraft_mix_light(Light0_Direction, Light1_Direction, Normal, vec4(1));
lightColor = minecraft_sample_lightmap(Sampler2, UV2);
overlayColor = texelFetch(Sampler1, UV1, 0);
lightColor = texelFetch(Sampler2, UV2 / 16, 0);
uv = UV0;
normal = ProjMat * ModelViewMat * vec4(Normal, 0.0);

//number of armors from texture size
vec2 size = textureSize(Sampler0, 0);
Expand Down
2 changes: 1 addition & 1 deletion assets/minecraft/shaders/core/render/glowing.vsh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ void main() {
//cannot pass tint color here so it's the only option
vec2 size = textureSize(Sampler0, 0);
if (size.y >= 2*size.x && size.x < 256) {
uv.y /= 2.*size.y/size.x;
uv.y /= 2*size.y/size.x;
}
}
18 changes: 2 additions & 16 deletions assets/minecraft/shaders/core/rendertype_armor_cutout_no_cull.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,8 @@
{
"blend": {
"func": "add",
"srcrgb": "srcalpha",
"dstrgb": "1-srcalpha"
},
"vertex": "render/armor",
"fragment": "render/armor",
"attributes": [
"Position",
"Color",
"UV0",
"UV1",
"UV2",
"Normal"
],
"vertex": "minecraft:core/render/armor",
"fragment": "minecraft:core/render/armor",
"samplers": [
{ "name": "Sampler0" },
{ "name": "Sampler1" },
{ "name": "Sampler2" }
],
"uniforms": [
Expand Down
16 changes: 3 additions & 13 deletions assets/minecraft/shaders/core/rendertype_outline.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
{
"blend": {
"func": "add",
"srcrgb": "srcalpha",
"dstrgb": "1-srcalpha"
},
"vertex": "render/glowing",
"fragment": "render/glowing",
"attributes": [
"Position",
"Color",
"UV0"
],
"vertex": "minecraft:core/render/glowing",
"fragment": "minecraft:core/render/glowing",
"samplers": [
{ "name": "Sampler0" }
],
Expand All @@ -19,4 +9,4 @@
{ "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] },
{ "name": "ColorModulator", "type": "float", "count": 4, "values": [ 1.0, 1.0, 1.0, 1.0 ] }
]
}
}
28 changes: 0 additions & 28 deletions assets/minecraft/shaders/include/fog.glsl

This file was deleted.

8 changes: 4 additions & 4 deletions pack.mcmeta
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"pack": {
"pack_format": 32,
"description": "but less fancy"
}
"pack": {
"pack_format": 42,
"description": "but less fancy"
}
}

0 comments on commit 001f717

Please sign in to comment.