-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
17 changed files
with
225 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
backend/src/main/resources/ResourcePack/assets/minecraft/shaders/core/rendertype_text.fsh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...n/resources/ResourcePack/overlay_1_20_5/assets/minecraft/shaders/core/rendertype_text.fsh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 0 additions & 5 deletions
5
.../resources/ResourcePack/overlay_1_20_5/assets/minecraft/shaders/core/rendertype_text.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
...n/resources/ResourcePack/overlay_1_21_2/assets/minecraft/shaders/core/rendertype_text.fsh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#version 150 | ||
#moj_import <minecraft:fog.glsl> | ||
|
||
uniform sampler2D Sampler0; | ||
uniform vec4 ColorModulator; | ||
uniform float FogStart,FogEnd; | ||
uniform vec4 FogColor; | ||
uniform float GameTime; | ||
|
||
in float vertexDistance; | ||
in vec4 vertexColor; | ||
in vec2 texCoord0; | ||
in float depthLevel; | ||
%SHADER_0% | ||
out vec4 fragColor; | ||
|
||
void main() { | ||
vec4 texColor = texture(Sampler0, texCoord0); | ||
vec4 color = texColor * vertexColor * ColorModulator;%SHADER_1% | ||
if (color.a < 0.1) { | ||
discard; | ||
} | ||
if (depthLevel == 114514.0) { | ||
discard; | ||
} | ||
if (texColor.a == 254.0/255.0) { | ||
if (depthLevel == 1000.0 | ||
|| depthLevel == 2200 | ||
|| depthLevel == 50 | ||
|| depthLevel == 2650 | ||
|| depthLevel == 200 | ||
|| depthLevel == 400 | ||
|| depthLevel == 2800 | ||
|| depthLevel == 2400 | ||
) { | ||
discard; | ||
} else { | ||
color = vec4(texColor.rgb, 1.0) * vertexColor * ColorModulator; | ||
} | ||
} | ||
fragColor = linear_fog(color, vertexDistance, FogStart, FogEnd, FogColor); | ||
} |
23 changes: 23 additions & 0 deletions
23
.../resources/ResourcePack/overlay_1_21_2/assets/minecraft/shaders/core/rendertype_text.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"vertex": "minecraft:core/rendertype_text", | ||
"fragment": "minecraft:core/rendertype_text", | ||
"attributes": [ | ||
"Position", | ||
"Color", | ||
"UV0", | ||
"UV2" | ||
], | ||
"samplers": [ | ||
{ "name": "Sampler0" }, | ||
{ "name": "Sampler2" } | ||
], | ||
"uniforms": [ | ||
{ "name": "ModelViewMat", "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": "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 ] }, | ||
{ "name": "FogStart", "type": "float", "count": 1, "values": [ 0.0 ] }, | ||
{ "name": "FogEnd", "type": "float", "count": 1, "values": [ 1.0 ] }, | ||
{ "name": "GameTime", "type": "float", "count": 1, "values": [ 1.0 ] }, | ||
{ "name": "FogColor", "type": "float", "count": 4, "values": [ 0.0, 0.0, 0.0, 0.0 ] } | ||
] | ||
} |
27 changes: 27 additions & 0 deletions
27
...n/resources/ResourcePack/overlay_1_21_2/assets/minecraft/shaders/core/rendertype_text.vsh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#version 150 | ||
#moj_import <minecraft:fog.glsl> | ||
|
||
in vec3 Position; | ||
in vec4 Color; | ||
in vec2 UV0; | ||
in ivec2 UV2; | ||
|
||
uniform sampler2D Sampler2; | ||
uniform mat4 ModelViewMat; | ||
uniform mat4 ProjMat; | ||
uniform float GameTime; | ||
uniform int FogShape; | ||
uniform vec2 ScreenSize; | ||
|
||
out float vertexDistance; | ||
out vec4 vertexColor; | ||
out vec2 texCoord0; | ||
out float depthLevel; | ||
%SHADER_0% | ||
void main() { | ||
vec4 vertex = vec4(Position, 1.0); | ||
vertexDistance = fog_distance(Position, FogShape); | ||
depthLevel = Position.z; | ||
texCoord0 = UV0; | ||
%SHADER_1%%SHADER_2%%SHADER_3% | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,28 @@ | ||
{ | ||
"pack":{ | ||
"pack_format": 8, | ||
"description":"CustomNameplates", | ||
"supported_formats": { | ||
"min_inclusive": 8, | ||
"max_inclusive": 34 | ||
"pack": { | ||
"pack_format": 13, | ||
"description": "CustomNameplates", | ||
"supported_formats": { | ||
"min_inclusive": 13, | ||
"max_inclusive": 43 | ||
} | ||
}, | ||
"overlays": { | ||
"entries": [ | ||
{ | ||
"formats": { | ||
"min_inclusive": 32, | ||
"max_inclusive": 34 | ||
}, | ||
"directory": "overlay_1_20_5" | ||
}, | ||
{ | ||
"formats": { | ||
"min_inclusive": 42, | ||
"max_inclusive": 43 | ||
}, | ||
"directory": "overlay_1_21_2" | ||
} | ||
] | ||
} | ||
}, | ||
"overlays": { | ||
"entries": [ | ||
{ | ||
"formats": { | ||
"min_inclusive": 32, | ||
"max_inclusive": 34 | ||
}, | ||
"directory": "overlay_1_20_5" | ||
} | ||
] | ||
} | ||
} |
32 changes: 25 additions & 7 deletions
32
backend/src/main/resources/ResourcePack/pack_1_20_5.mcmeta
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,28 @@ | ||
{ | ||
"pack":{ | ||
"pack_format": 32, | ||
"description":"CustomNameplates", | ||
"supported_formats": { | ||
"min_inclusive": 32, | ||
"max_inclusive": 34 | ||
"pack": { | ||
"pack_format": 32, | ||
"description": "CustomNameplates", | ||
"supported_formats": { | ||
"min_inclusive": 32, | ||
"max_inclusive": 42 | ||
} | ||
}, | ||
"overlays": { | ||
"entries": [ | ||
{ | ||
"formats": { | ||
"min_inclusive": 32, | ||
"max_inclusive": 34 | ||
}, | ||
"directory": "overlay_1_20_5" | ||
}, | ||
{ | ||
"formats": { | ||
"min_inclusive": 42, | ||
"max_inclusive": 43 | ||
}, | ||
"directory": "overlay_1_21_2" | ||
} | ||
] | ||
} | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
backend/src/main/resources/ResourcePack/pack_1_21_2.mcmeta
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"pack": { | ||
"pack_format": 42, | ||
"description": "CustomNameplates", | ||
"supported_formats": { | ||
"min_inclusive": 42, | ||
"max_inclusive": 43 | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
common/src/main/java/net/momirealms/customnameplates/common/util/ThrowableFunction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package net.momirealms.customnameplates.common.util; | ||
|
||
import java.util.function.Function; | ||
|
||
@FunctionalInterface | ||
public interface ThrowableFunction<T, R> extends Function<T, R> { | ||
|
||
@Override | ||
default R apply(T t) { | ||
try { | ||
return applyWithException(t); | ||
} catch (Exception e) { | ||
throw new RuntimeException(e); | ||
} | ||
} | ||
|
||
R applyWithException(T t) throws Exception; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters