Initial commit

This commit is contained in:
2026-06-19 18:14:40 +06:00
commit ef3ec8d9f1
671 changed files with 5595 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
#version 150
uniform vec4 color1;
uniform vec4 color2;
uniform float radius;
uniform float thickness;
uniform float start;
uniform float end;
uniform vec2 size;
uniform vec2 location;
out vec4 fragColor;
#define PI 3.141592653589793
#define RAD 0.0174533
void main() {
float startAngle = start * RAD;
float endAngle = startAngle + min(end * RAD, PI * 2);
float smoothThresh = 6.0 * (1.0 / length(size));
vec2 centerPos = ((gl_FragCoord.xy - location) / size.xy) * 2.0 - 1.0;
float dist = length(centerPos);
float bandAlpha = smoothstep(radius, radius + smoothThresh, dist) * smoothstep(radius + thickness, (radius + thickness) - smoothThresh, dist);
float angle = (atan(centerPos.y, centerPos.x) + PI);
float angleAlpha = smoothstep(angle, angle - smoothThresh, startAngle - 0.1) * smoothstep(angle, angle + smoothThresh, endAngle + 0.1);
float angle2 = (angle / PI * 180.);
angle2 = angle2 - 360. * floor(angle2 / 360.);
if (angle2 >= 180.) {
angle2 = (360. - angle2) * 2.;
} else {
angle2 = angle2 * 2.;
}
fragColor = mix(color1, color2, angle2 / 360.) * bandAlpha * angleAlpha;
}

View File

@@ -0,0 +1,23 @@
{
"blend": {
"func": "add",
"srcrgb": "srcalpha",
"dstrgb": "1-srcalpha"
},
"vertex": "minecraft:core/arc",
"fragment": "minecraft:core/arc",
"attributes": [],
"samplers": [],
"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": "color1", "type": "float", "count": 4, "values": [ 1.0, 1.0, 1.0, 1.0 ] },
{ "name": "color2", "type": "float", "count": 4, "values": [ 1.0, 1.0, 1.0, 1.0 ] },
{ "name": "size", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] },
{ "name": "location", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] },
{ "name": "radius", "type": "float", "count": 1, "values": [ 1.0] },
{ "name": "thickness", "type": "float", "count": 1, "values": [ 1.0] },
{ "name": "start", "type": "float", "count": 1, "values": [ 1.0] },
{ "name": "end", "type": "float", "count": 1, "values": [ 1.0] }
]
}

View File

@@ -0,0 +1,19 @@
#version 150
#moj_import <minecraft:common.glsl>
in vec3 Position;
in vec4 Color;
uniform mat4 ModelViewMat;
uniform mat4 ProjMat;
out vec2 FragCoord;
out vec4 FragColor;
void main() {
FragCoord = rvertexcoord(gl_VertexID);
FragColor = Color;
gl_Position = ProjMat * ModelViewMat * vec4(Position, 1.0);
}

View File

@@ -0,0 +1,29 @@
#version 150
uniform float radius;
uniform float thickness;
uniform float start;
uniform float end;
uniform vec2 size;
uniform vec2 location;
out vec4 fragColor;
#define PI 3.141592653589793
#define RAD 0.0174533
void main() {
float startAngle = start * RAD;
float endAngle = startAngle + min(end * RAD, PI * 2);
float smoothThresh = 6.0 * (1.0 / length(size));
vec2 centerPos = ((gl_FragCoord.xy - location) / size.xy) * 2.0 - 1.0;
float dist = length(centerPos);
float bandAlpha = smoothstep(radius, radius + smoothThresh, dist) * smoothstep(radius + thickness, (radius + thickness) - smoothThresh, dist);
float angle = (atan(centerPos.y, centerPos.x) + PI);
float angleAlpha = smoothstep(angle, angle - smoothThresh, startAngle - 0.1) * smoothstep(angle, angle + smoothThresh, endAngle + 0.1);
// Белый цвет для инверсии
fragColor = vec4(1.0, 1.0, 1.0, bandAlpha * angleAlpha);
}

View File

@@ -0,0 +1,21 @@
{
"blend": {
"func": "add",
"srcrgb": "1-dstcolor",
"dstrgb": "1-srccolor"
},
"vertex": "minecraft:core/arc_inverted",
"fragment": "minecraft:core/arc_inverted",
"attributes": [],
"samplers": [],
"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": "size", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] },
{ "name": "location", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] },
{ "name": "radius", "type": "float", "count": 1, "values": [ 1.0] },
{ "name": "thickness", "type": "float", "count": 1, "values": [ 1.0] },
{ "name": "start", "type": "float", "count": 1, "values": [ 1.0] },
{ "name": "end", "type": "float", "count": 1, "values": [ 1.0] }
]
}

View File

@@ -0,0 +1,19 @@
#version 150
#moj_import <minecraft:common.glsl>
in vec3 Position;
in vec4 Color;
uniform mat4 ModelViewMat;
uniform mat4 ProjMat;
out vec2 FragCoord;
out vec4 FragColor;
void main() {
FragCoord = rvertexcoord(gl_VertexID);
FragColor = Color;
gl_Position = ProjMat * ModelViewMat * vec4(Position, 1.0);
}

View File

@@ -0,0 +1,68 @@
#version 150
uniform vec2 size;
uniform vec2 location;
uniform vec4 radius;
uniform float thickness;
uniform float softness;
uniform sampler2D InputSampler;
uniform vec2 InputResolution;
uniform float Quality;
uniform vec4 color1;
uniform vec4 color2;
uniform vec4 color3;
uniform vec4 color4;
uniform vec4 outlineColor;
in vec2 texCoord;
out vec4 fragColor;
float roundedBoxSDF(vec2 center, vec2 size, vec4 radius) {
radius.xy = (center.x > 0.0) ? radius.xy : radius.zw;
radius.x = (center.y > 0.0) ? radius.x : radius.y;
vec2 q = abs(center) - size + radius.x;
return min(max(q.x, q.y), 0.0) + length(max(q, 0.0)) - radius.x;
}
vec4 createGradient(vec2 coords, vec4 color1, vec4 color2, vec4 color3, vec4 color4){
vec4 color = mix(mix(color1, color2, coords.y), mix(color3, color4, coords.y), coords.x);
color += mix(0.0019607843, -0.0019607843, fract(sin(dot(coords.xy, vec2(12.9898, 78.233))) * 43758.5453));
return color;
}
vec4 blur() {
#define TAU 6.28318530718
vec4 rectColor = createGradient((gl_FragCoord.xy - location) / size, color1, color2, color3, color4);
vec2 Radius = Quality / InputResolution.xy;
vec2 uv = gl_FragCoord.xy / InputResolution.xy;
vec4 blur = texture(InputSampler, uv);
float step = TAU / 16;
for (float d = 0.0; d < TAU; d += step) {
for (float i = 0.2; i <= 1.0; i += 0.2) {
blur += texture(InputSampler, uv + vec2(cos(d), sin(d)) * Radius * i);
}
}
blur /= 60;
return vec4((blur * (1 - rectColor.a)).rgb, rectColor.a) + rectColor;
}
void main() {
float distance = roundedBoxSDF(gl_FragCoord.xy - location - (size / 2.0), size / 2.0, radius);
float smoothedAlpha = 1.0 - smoothstep(-1.0, thickness > 0. ? 1. : softness + 1., distance);
if(smoothedAlpha < 0.49 && thickness > 0.) {
float smoothedborderAlpha = (1.0 - smoothstep(-softness, softness, distance));
fragColor = vec4(outlineColor.rgb, smoothedborderAlpha * outlineColor.a);
} else {
float borderAlpha = 1.0 - smoothstep(thickness - 2.0, thickness, abs(distance));
vec4 blur = blur();
vec4 basicColor = vec4(blur.rgb, blur.a * smoothedAlpha);
fragColor = mix(vec4(blur.rgb, 0.), mix(basicColor, thickness > 0. ? outlineColor : basicColor, borderAlpha), smoothedAlpha);
}
}

View File

@@ -0,0 +1,29 @@
{
"blend": {
"func": "add",
"srcrgb": "srcalpha",
"dstrgb": "1-srcalpha"
},
"vertex": "minecraft:core/blur",
"fragment": "minecraft:core/blur",
"attributes": [],
"samplers": [
{ "name": "InputSampler" }
],
"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": "InputResolution", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] },
{ "name": "Quality", "type": "float", "count": 1, "values": [ 1.0] },
{ "name": "color1", "type": "float", "count": 4, "values": [ 1.0, 1.0, 1.0, 1.0 ] },
{ "name": "color2", "type": "float", "count": 4, "values": [ 1.0, 1.0, 1.0, 1.0 ] },
{ "name": "color3", "type": "float", "count": 4, "values": [ 1.0, 1.0, 1.0, 1.0 ] },
{ "name": "color4", "type": "float", "count": 4, "values": [ 1.0, 1.0, 1.0, 1.0 ] },
{ "name": "outlineColor", "type": "float", "count": 4, "values": [ 1.0, 1.0, 1.0, 1.0 ] },
{ "name": "size", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] },
{ "name": "location", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] },
{ "name": "radius", "type": "float", "count": 4, "values": [ 1.0, 1.0, 1.0, 1.0 ] },
{ "name": "thickness", "type": "float", "count": 1, "values": [ 1.0 ] },
{ "name": "softness", "type": "float", "count": 1, "values": [ 1.0 ] }
]
}

View File

@@ -0,0 +1,19 @@
#version 150
#moj_import <minecraft:common.glsl>
in vec3 Position;
in vec4 Color;
uniform mat4 ModelViewMat;
uniform mat4 ProjMat;
out vec2 FragCoord;
out vec4 FragColor;
void main() {
FragCoord = rvertexcoord(gl_VertexID);
FragColor = Color;
gl_Position = ProjMat * ModelViewMat * vec4(Position, 1.0);
}

View File

@@ -0,0 +1,48 @@
#version 150
uniform vec4 color1;
uniform vec4 color2;
uniform vec4 color3;
uniform vec4 color4;
uniform vec4 outlineColor;
uniform vec2 size;
uniform vec2 location;
uniform vec4 radius;
uniform float thickness;
uniform float softness;
out vec4 fragColor;
float roundedBoxSDF(vec2 center, vec2 size, vec4 radius) {
radius.xy = (center.x > 0.0) ? radius.xy : radius.zw;
radius.x = (center.y > 0.0) ? radius.x : radius.y;
vec2 q = abs(center) - size + radius.x;
return min(max(q.x, q.y), 0.0) + length(max(q, 0.0)) - radius.x;
}
vec4 createGradient(vec2 coords, vec4 color1, vec4 color2, vec4 color3, vec4 color4){
vec4 color = mix(mix(color1, color2, coords.y), mix(color3, color4, coords.y), coords.x);
color += mix(0.0019607843, -0.0019607843, fract(sin(dot(coords.xy, vec2(12.9898, 78.233))) * 43758.5453));
return color;
}
void main() {
float distance = roundedBoxSDF(gl_FragCoord.xy - location - (size / 2.0), size / 2.0, radius);
float smoothedAlpha = 1.0 - smoothstep(-1.0, thickness > 0. ? 1. : softness + 1., distance);
float smoothedborderAlpha = (1.0 - smoothstep(-softness, softness, distance));
float borderAlpha = 1.0 - smoothstep(thickness - 2.0, thickness, abs(distance));
if(smoothedAlpha < 0.49 && thickness > 0.) {
fragColor = vec4(outlineColor.rgb, smoothedborderAlpha);
} else {
vec4 gradient = createGradient((gl_FragCoord.xy - location) / size, color1, color2, color3, color4);
vec4 basicColor = vec4(gradient.rgb, gradient.a * smoothedAlpha);
fragColor = mix(vec4(gradient.rgb, 0.), mix(basicColor, thickness > 0. ? outlineColor : basicColor, borderAlpha), smoothedAlpha);
}
}

View File

@@ -0,0 +1,25 @@
{
"blend": {
"func": "add",
"srcrgb": "srcalpha",
"dstrgb": "1-srcalpha"
},
"vertex": "minecraft:core/round",
"fragment": "minecraft:core/round",
"attributes": [],
"samplers": [],
"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": "color1", "type": "float", "count": 4, "values": [ 1.0, 1.0, 1.0, 1.0 ] },
{ "name": "color2", "type": "float", "count": 4, "values": [ 1.0, 1.0, 1.0, 1.0 ] },
{ "name": "color3", "type": "float", "count": 4, "values": [ 1.0, 1.0, 1.0, 1.0 ] },
{ "name": "color4", "type": "float", "count": 4, "values": [ 1.0, 1.0, 1.0, 1.0 ] },
{ "name": "outlineColor", "type": "float", "count": 4, "values": [ 1.0, 1.0, 1.0, 1.0 ] },
{ "name": "size", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] },
{ "name": "location", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] },
{ "name": "radius", "type": "float", "count": 4, "values": [ 1.0, 1.0, 1.0, 1.0 ] },
{ "name": "thickness", "type": "float", "count": 1, "values": [ 1.0 ] },
{ "name": "softness", "type": "float", "count": 1, "values": [ 1.0 ] }
]
}

View File

@@ -0,0 +1,19 @@
#version 150
#moj_import <minecraft:common.glsl>
in vec3 Position;
in vec4 Color;
uniform mat4 ModelViewMat;
uniform mat4 ProjMat;
out vec2 FragCoord;
out vec4 FragColor;
void main() {
FragCoord = rvertexcoord(gl_VertexID);
FragColor = Color;
gl_Position = ProjMat * ModelViewMat * vec4(Position, 1.0);
}

View File

@@ -0,0 +1,26 @@
#version 150
uniform vec2 size;
uniform vec2 location;
uniform vec4 radius;
uniform float softness;
out vec4 fragColor;
float roundedBoxSDF(vec2 center, vec2 size, vec4 radius) {
radius.xy = (center.x > 0.0) ? radius.xy : radius.zw;
radius.x = (center.y > 0.0) ? radius.x : radius.y;
vec2 q = abs(center) - size + radius.x;
return min(max(q.x, q.y), 0.0) + length(max(q, 0.0)) - radius.x;
}
void main() {
float distance = roundedBoxSDF(gl_FragCoord.xy - location - (size / 2.0), size / 2.0, radius);
// Сглаживание краев с учетом softness
float smoothedAlpha = 1.0 - smoothstep(-1.0, softness + 1.0, distance);
// Белый цвет для инверсии
fragColor = vec4(1.0, 1.0, 1.0, smoothedAlpha);
}

View File

@@ -0,0 +1,19 @@
{
"blend": {
"func": "add",
"srcrgb": "1-dstcolor",
"dstrgb": "1-srccolor"
},
"vertex": "minecraft:core/round_inverted",
"fragment": "minecraft:core/round_inverted",
"attributes": [],
"samplers": [],
"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": "size", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] },
{ "name": "location", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] },
{ "name": "radius", "type": "float", "count": 4, "values": [ 1.0, 1.0, 1.0, 1.0 ] },
{ "name": "softness", "type": "float", "count": 1, "values": [ 1.0 ] }
]
}

View File

@@ -0,0 +1,19 @@
#version 150
#moj_import <minecraft:common.glsl>
in vec3 Position;
in vec4 Color;
uniform mat4 ModelViewMat;
uniform mat4 ProjMat;
out vec2 FragCoord;
out vec4 FragColor;
void main() {
FragCoord = rvertexcoord(gl_VertexID);
FragColor = Color;
gl_Position = ProjMat * ModelViewMat * vec4(Position, 1.0);
}

View File

@@ -0,0 +1,24 @@
float rdist(vec2 pos, vec2 size, vec4 radius) {
radius.xy = (pos.x > 0.0) ? radius.xy : radius.wz;
radius.x = (pos.y > 0.0) ? radius.x : radius.y;
vec2 v = abs(pos) - size + radius.x;
return min(max(v.x, v.y), 0.0) + length(max(v, 0.0)) - radius.x;
}
float ralpha(vec2 size, vec2 coord, vec4 radius, float smoothness) {
vec2 center = size * 0.5;
float dist = rdist(center - (coord * size), center - 1.0, radius);
return 1.0 - smoothstep(1.0 - smoothness, 1.0, dist);
}
const vec2[4] RECT_VERTICES_COORDS = vec2[] (
vec2(0.0, 0.0),
vec2(0.0, 1.0),
vec2(1.0, 1.0),
vec2(1.0, 0.0)
);
vec2 rvertexcoord(int id) {
return RECT_VERTICES_COORDS[id % 4];
}