This commit is contained in:
Leo Codes
2025-03-09 18:32:49 +01:00
commit fd46963e72
749 changed files with 8194 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
{
"passes": [
{
"program": "minecraft:v1_21_2/program/chroma_core",
"output": "minecraft:main",
"inputs": [
{
"sampler_name": "In",
"target": "minecraft:main"
}
]
}
]
}
@@ -0,0 +1,27 @@
{
"targets": {
"swap": {}
},
"passes": [
{
"program": "minecraft:v1_21_2/program/lunar_colorsaturation_core",
"inputs": [
{
"sampler_name": "Diffuse",
"target": "minecraft:main"
}
],
"output": "swap"
},
{
"program": "minecraft:post/blit",
"inputs": [
{
"sampler_name": "In",
"target": "swap"
}
],
"output": "minecraft:main"
}
]
}
@@ -0,0 +1,42 @@
{
"targets": {
"swap": {}
},
"passes": [
{
"program": "minecraft:v1_21_2/program/lunar_motionblur_core",
"inputs": [
{
"sampler_name": "Diffuse",
"target": "minecraft:main",
"bilinear": true
},
{
"sampler_name": "Prev",
"target": "minecraft:previous"
}
],
"output": "swap"
},
{
"program": "minecraft:post/blit",
"inputs": [
{
"sampler_name": "In",
"target": "swap"
}
],
"output": "minecraft:previous"
},
{
"program": "minecraft:post/blit",
"inputs": [
{
"sampler_name": "In",
"target": "swap"
}
],
"output": "minecraft:main"
}
]
}
+77
View File
@@ -0,0 +1,77 @@
{
"targets": {
"swap": {}
},
"passes": [
{
"program": "minecraft:v1_21_2/program/menu_blur_core",
"inputs": [
{
"sampler_name": "In",
"target": "minecraft:main",
"bilinear": true
}
],
"output": "swap",
"uniforms": [
{
"name": "BlurDir",
"values": [ 1.0, 0.0 ],
"Radius": 12.0
}
]
},
{
"program": "minecraft:v1_21_2/program/menu_blur_core",
"inputs": [
{
"sampler_name": "In",
"target": "swap",
"bilinear": true
}
],
"output": "minecraft:main",
"uniforms": [
{
"name": "BlurDir",
"values": [ 0.0, 1.0 ],
"Radius": 12.0
}
]
},
{
"program": "minecraft:v1_21_2/program/menu_blur_core",
"inputs": [
{
"sampler_name": "In",
"target": "minecraft:main",
"bilinear": true
}
],
"output": "swap",
"uniforms": [
{
"name": "BlurDir",
"values": [ 1.0, 0.0 ],
"Radius": 12.0
}
]
},
{
"program": "minecraft:post/blit",
"inputs": [
{
"sampler_name": "In",
"target": "swap"
}
],
"output": "minecraft:main",
"uniforms": [
{
"name": "ColorModulate",
"values": [ 1.0, 1.0, 1.0, 1.0 ]
}
]
}
]
}
@@ -0,0 +1,21 @@
#version 150
#moj_import <fog.glsl>
uniform sampler2D Sampler0;
uniform vec4 ColorModulator;
uniform float FogStart;
uniform float FogEnd;
uniform vec4 FogColor;
out vec2 texCoord0;
out float vertexDistance;
out vec4 vertexColor;
out vec4 normal;
void main() {
vec4 color = texture(Sampler0, texCoord0) * vertexColor * ColorModulator;
vertexColor = linear_fog(color, vertexDistance, FogStart, FogEnd, FogColor);
}
@@ -0,0 +1,29 @@
{
"blend": {
"func": "add",
"srcrgb": "srcalpha",
"dstrgb": "1-srcalpha"
},
"vertex": "position_normal_tex_lightmap",
"fragment": "position_normal_tex_lightmap",
"attributes": [
"Position",
"Normal",
"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": "Light0_Direction", "type": "float", "count": 3, "values": [0.0, 0.0, 0.0] },
{ "name": "Light1_Direction", "type": "float", "count": 3, "values": [0.0, 0.0, 0.0] },
{ "name": "FogStart", "type": "float", "count": 1, "values": [ 0.0 ] },
{ "name": "FogEnd", "type": "float", "count": 1, "values": [ 1.0 ] },
{ "name": "FogColor", "type": "float", "count": 4, "values": [ 0.0, 0.0, 0.0, 0.0 ] }
]
}
@@ -0,0 +1,35 @@
#version 150
#moj_import <light.glsl>
in vec3 Position;
in vec3 Normal;
in vec2 UV0;
in ivec2 UV2;
uniform mat4 ModelViewMat;
uniform mat4 ProjMat;
// These are the lights used for
uniform vec3 Light0_Direction;
uniform vec3 Light1_Direction;
//
uniform sampler2D Sampler0;
// Sampler2 is the lightmap texture unit
uniform sampler2D Sampler2;
out vec2 texCoord0;
out float vertexDistance;
out vec4 vertexColor;
out vec4 normal;
void main() {
gl_Position = ProjMat * ModelViewMat * vec4(Position, 1.0);
texCoord0 = UV0;
vertexDistance = length((ModelViewMat * vec4(Position, 1.0)).xyz);
vertexColor = minecraft_mix_light(Light0_Direction, Light1_Direction, Normal, vec4(1.)) * texelFetch(Sampler2, UV2 / 16, 0);
normal = ProjMat * ModelViewMat * vec4(Normal, 0.0);
}
@@ -0,0 +1,17 @@
{
"targets": [
"swap"
],
"passes": [
{
"name": "lunar_colorsaturation",
"intarget": "minecraft:main",
"outtarget": "swap"
},
{
"name": "blit",
"intarget": "swap",
"outtarget": "minecraft:main"
}
]
}
@@ -0,0 +1,17 @@
{
"targets": [
"swap"
],
"passes": [
{
"name": "lunar_colorsaturation_core",
"intarget": "minecraft:main",
"outtarget": "swap"
},
{
"name": "blit",
"intarget": "swap",
"outtarget": "minecraft:main"
}
]
}
@@ -0,0 +1,48 @@
{
"targets": [
"swap",
"final"
],
"passes": [
{
"name": "lunar_entity_outline_1_7",
"intarget": "final",
"outtarget": "swap"
},
{
"name": "lunar_blur",
"intarget": "swap",
"outtarget": "final",
"uniforms": [
{
"name": "BlurDir",
"values": [ 1.0, 0.0 ]
},
{
"name": "Radius",
"values": [ 2.0 ]
}
]
},
{
"name": "lunar_blur",
"intarget": "final",
"outtarget": "swap",
"uniforms": [
{
"name": "BlurDir",
"values": [ 0.0, 1.0 ]
},
{
"name": "Radius",
"values": [ 2.0 ]
}
]
},
{
"name": "blit",
"intarget": "swap",
"outtarget": "final"
}
]
}
@@ -0,0 +1,35 @@
{
"targets": [
"swap",
"previous"
],
"passes": [
{
"name": "lunar_motionblur",
"intarget": "minecraft:main",
"outtarget": "swap",
"auxtargets": [
{
"name": "PrevSampler",
"id": "previous"
}
],
"uniforms": [
{
"name": "Phosphor",
"values": [ 0.95, 0.95, 0.95 ]
}
]
},
{
"name": "blit",
"intarget": "swap",
"outtarget": "previous"
},
{
"name": "blit",
"intarget": "swap",
"outtarget": "minecraft:main"
}
]
}
@@ -0,0 +1,36 @@
{
"targets": [
"swap",
"previous"
],
"passes": [
{
"name": "lunar_motionblur_core",
"intarget": "minecraft:main",
"outtarget": "swap",
"use_linear_filter": true,
"auxtargets": [
{
"name": "PrevSampler",
"id": "previous"
}
],
"uniforms": [
{
"name": "Phosphor",
"values": [ 0.95, 0.95, 0.95 ]
}
]
},
{
"name": "blit",
"intarget": "swap",
"outtarget": "previous"
},
{
"name": "blit",
"intarget": "swap",
"outtarget": "minecraft:main"
}
]
}
+67
View File
@@ -0,0 +1,67 @@
{
"targets": [
"swap"
],
"passes": [
{
"name": "menu_blur",
"intarget": "minecraft:main",
"outtarget": "swap",
"uniforms": [
{
"name": "BlurDir",
"values": [ 1.0, 0.0 ]
},
{
"name": "Radius",
"values": [ 12.0 ]
}
]
},
{
"name": "menu_blur",
"intarget": "swap",
"outtarget": "minecraft:main",
"uniforms": [
{
"name": "BlurDir",
"values": [ 0.0, 1.0 ]
},
{
"name": "Radius",
"values": [ 12.0 ]
}
]
},
{
"name": "menu_blur",
"intarget": "minecraft:main",
"outtarget": "swap",
"uniforms": [
{
"name": "BlurDir",
"values": [ 1.0, 0.0 ]
},
{
"name": "Radius",
"values": [ 12.0 ]
}
]
},
{
"name": "menu_blur",
"intarget": "swap",
"outtarget": "minecraft:main",
"uniforms": [
{
"name": "BlurDir",
"values": [ 0.0, 1.0 ]
},
{
"name": "Radius",
"values": [ 12.0 ]
}
]
}
]
}
@@ -0,0 +1,66 @@
{
"targets": [
"swap"
],
"passes": [
{
"name": "menu_blur_core",
"intarget": "minecraft:main",
"outtarget": "swap",
"use_linear_filter": true,
"uniforms": [
{
"name": "BlurDir",
"values": [ 1.0, 0.0 ]
},
{
"name": "Radius",
"values": [ 12.0 ]
}
]
},
{
"name": "menu_blur_core",
"intarget": "swap",
"outtarget": "minecraft:main",
"use_linear_filter": true,
"uniforms": [
{
"name": "BlurDir",
"values": [ 0.0, 1.0 ]
},
{
"name": "Radius",
"values": [ 12.0 ]
}
]
},
{
"name": "menu_blur_core",
"intarget": "minecraft:main",
"outtarget": "swap",
"use_linear_filter": true,
"uniforms": [
{
"name": "BlurDir",
"values": [ 1.0, 0.0 ]
},
{
"name": "Radius",
"values": [ 12.0 ]
}
]
},
{
"name": "blit",
"intarget": "swap",
"outtarget": "minecraft:main",
"uniforms": [
{
"name": "ColorModulate",
"values": [ 1.0, 1.0, 1.0, 1.0 ]
}
]
}
]
}
+34
View File
@@ -0,0 +1,34 @@
#version 120
varying vec2 uv;
uniform float TimeSeconds;
// https://github.com/hughsk/glsl-hsv2rgb/blob/master/index.glsl
vec3 hsv2rgb(vec3 c) {
vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);
return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);
}
float remapX(float x) {
return clamp(10.0/9.5 - 0.1 * abs(x - 11.5), 0.0, 1.0);
}
vec3 _sample(vec2 xy) {
float hue = mod(cos(TimeSeconds * 0.25) * 0.5 + xy.x + 0.1 * cos(TimeSeconds * 0.25 * 20.0 + xy.y * 20.0), 1.0);
return hsv2rgb(vec3(hue, 1.0, 1.0));
}
void main() {
float y = max(uv.y, 1.0/16.0);
float x = remapX(uv.x * 22.0);
if (uv.x > 0.5 && uv.y < 1/17.0) {
x = remapX((uv.x - 0.45) * 22.0);
y = 1.0;
}
gl_FragColor = vec4(_sample(vec2(x, y)), 1.0);
}
+15
View File
@@ -0,0 +1,15 @@
{
"blend": {
"func": "add",
"srcrgb": "one",
"dstrgb": "zero"
},
"vertex": "chroma",
"fragment": "chroma",
"attributes": [ "Position" ],
"uniforms": [
{ "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": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] },
{ "name": "TimeSeconds", "type": "float", "count": 1, "values": [ 0.0 ] }
]
}
+16
View File
@@ -0,0 +1,16 @@
#version 120
attribute vec4 Position;
uniform mat4 ProjMat;
uniform vec2 OutSize;
varying vec2 uv;
void main(){
vec4 outPos = ProjMat * vec4(Position.xy, 0.0, 1.0);
gl_Position = vec4(outPos.xy, 0.2, 1.0);
uv = Position.xy / OutSize;
uv.y = 1.0 - uv.y;
}
+36
View File
@@ -0,0 +1,36 @@
#version 150
in vec2 uv;
uniform float TimeSeconds;
out vec4 fragColor;
// https://github.com/hughsk/glsl-hsv2rgb/blob/master/index.glsl
vec3 hsv2rgb(vec3 c) {
vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);
return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);
}
float remapX(float x) {
return clamp(10.0/9.5 - 0.1 * abs(x - 11.5), 0.0, 1.0);
}
vec3 _sample(vec2 xy) {
float hue = mod(cos(TimeSeconds * 0.25) * 0.5 + xy.x + 0.1 * cos(TimeSeconds * 0.25 * 20.0 + xy.y * 20.0), 1.0);
return hsv2rgb(vec3(hue, 1.0, 1.0));
}
void main() {
float y = max(uv.y, 1.0/16.0);
float x = remapX(uv.x * 22.0);
if (uv.x > 0.5 && uv.y < 1/17.0) {
x = remapX((uv.x - 0.45) * 22.0);
y = 1.0;
}
fragColor = vec4(_sample(vec2(x, y)), 1.0);
}
@@ -0,0 +1,15 @@
{
"blend": {
"func": "add",
"srcrgb": "one",
"dstrgb": "zero"
},
"vertex": "chroma_core",
"fragment": "chroma_core",
"attributes": [ "Position" ],
"uniforms": [
{ "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": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] },
{ "name": "TimeSeconds", "type": "float", "count": 1, "values": [ 0.0 ] }
]
}
+16
View File
@@ -0,0 +1,16 @@
#version 150
in vec4 Position;
uniform mat4 ProjMat;
uniform vec2 OutSize;
out vec2 uv;
void main(){
vec4 outPos = ProjMat * vec4(Position.xy, 0.0, 1.0);
gl_Position = vec4(outPos.xy, 0.2, 1.0);
uv = Position.xy / OutSize;
uv.y = 1.0 - uv.y;
}
+31
View File
@@ -0,0 +1,31 @@
#version 120
uniform sampler2D DiffuseSampler;
varying vec2 texCoord;
varying vec2 oneTexel;
uniform vec2 InSize;
uniform vec2 BlurDir;
uniform float Radius;
void main() {
vec4 blurred = vec4(0.0);
float totalStrength = 0.0;
float totalAlpha = 0.0;
float totalSamples = 0.0;
for(float r = -Radius; r <= Radius; r += 1.0) {
vec4 sample = texture2D(DiffuseSampler, texCoord + oneTexel * r * BlurDir);
// Accumulate average alpha
totalAlpha = totalAlpha + sample.a;
totalSamples = totalSamples + 1.0;
// Accumulate smoothed blur
float strength = 1.0 - abs(r / Radius);
totalStrength = totalStrength + strength;
blurred = blurred + sample;
}
gl_FragColor = vec4(blurred.rgb / (Radius * 2.0 + 1.0), totalAlpha);
}
+20
View File
@@ -0,0 +1,20 @@
{
"blend": {
"func": "add",
"srcrgb": "one",
"dstrgb": "zero"
},
"vertex": "sobel",
"fragment": "lunar_blur",
"attributes": [ "Position" ],
"samplers": [
{ "name": "DiffuseSampler" }
],
"uniforms": [
{ "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": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] },
{ "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] },
{ "name": "BlurDir", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] },
{ "name": "Radius", "type": "float", "count": 1, "values": [ 5.0 ] }
]
}
@@ -0,0 +1,56 @@
#version 120
uniform sampler2D DiffuseSampler;
varying vec2 texCoord;
varying vec2 oneTexel;
uniform vec2 InSize;
uniform float hue = 0.0;
uniform float Brightness = 0.5;
uniform float Contrast = 0.8;
uniform float Saturation = 0.8;
// See https://forum.unity.com/threads/hue-saturation-brightness-contrast-shader.260649/ for inspiration.
void applyHue(inout vec4 color, float hue) {
float angle = radians(hue);
vec3 k = vec3(0.57735, 0.57735, 0.57735);
float cosAngle = cos(angle);
//Rodrigues' rotation formula
color.rgb = color.rgb * cosAngle + cross(k, color.rgb) * sin(angle) + k * dot(k, color.rgb) * (1.0 - cosAngle);
}
void applySaturation(inout vec4 color, float saturation) {
// I couldn't get dotproduct and lerp to work, so I manually added it :(
float dot = sqrt(color.r * color.r * 0.299 + color.g * color.g * 0.587 + color.b * color.b * 0.114);
color.r = dot + (color.r - dot) * saturation;
color.g = dot + (color.g - dot) * saturation;
color.b = dot + (color.b - dot) * saturation;
}
vec4 applyHSBCEffect(vec4 startColor, vec4 hsbc) {
float _Hue = 360 * hsbc.r;
float _Brightness = hsbc.b * 2 - 1;
float _Contrast = hsbc.a * 2;
float _Saturation = hsbc.g * 2;
vec4 outputColor = startColor;
applyHue(outputColor, _Hue);
// Contrast
outputColor.rgb = (outputColor.rgb - 0.5) * _Contrast + 0.5;
// Brightness
outputColor.rgb = outputColor.rgb + vec3(_Brightness, _Brightness, _Brightness);
// Saturation
applySaturation(outputColor, _Saturation);
outputColor = vec4(outputColor.rgb, 1.0);
return outputColor;
}
void main() {
gl_FragColor = applyHSBCEffect(texture2D(DiffuseSampler, texCoord), vec4(hue, Saturation, Brightness, Contrast));
}
@@ -0,0 +1,22 @@
{
"blend": {
"func": "add",
"srcrgb": "one",
"dstrgb": "zero"
},
"vertex": "sobel",
"fragment": "lunar_colorsaturation",
"attributes": [ "Position" ],
"samplers": [
{ "name": "DiffuseSampler" }
],
"uniforms": [
{ "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": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] },
{ "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] },
{ "name": "Saturation", "type": "float", "count": 1, "values": [ 0.9 ] },
{ "name": "hue", "type": "float", "count": 1, "values": [ 0.0 ] },
{ "name": "Brightness", "type": "float", "count": 1, "values": [ 0.5 ] },
{ "name": "Contrast", "type": "float", "count": 1, "values": [ 0.5 ] }
]
}
@@ -0,0 +1,58 @@
#version 150
uniform sampler2D DiffuseSampler;
in vec2 texCoord;
in vec2 oneTexel;
uniform vec2 InSize;
uniform float hue = 0.0;
uniform float Brightness = 0.5;
uniform float Contrast = 0.8;
uniform float Saturation = 0.8;
out vec4 fragColor;
// See https://forum.unity.com/threads/hue-saturation-brightness-contrast-shader.260649/ for inspiration.
void applyHue(inout vec4 color, float hue) {
float angle = radians(hue);
vec3 k = vec3(0.57735, 0.57735, 0.57735);
float cosAngle = cos(angle);
//Rodrigues' rotation formula
color.rgb = color.rgb * cosAngle + cross(k, color.rgb) * sin(angle) + k * dot(k, color.rgb) * (1.0 - cosAngle);
}
void applySaturation(inout vec4 color, float saturation) {
// I couldn't get dotproduct and lerp to work, so I manually added it :(
float dot = sqrt(color.r * color.r * 0.299 + color.g * color.g * 0.587 + color.b * color.b * 0.114);
color.r = dot + (color.r - dot) * saturation;
color.g = dot + (color.g - dot) * saturation;
color.b = dot + (color.b - dot) * saturation;
}
vec4 applyHSBCEffect(vec4 startColor, vec4 hsbc) {
float _Hue = 360 * hsbc.r;
float _Brightness = hsbc.b * 2 - 1;
float _Contrast = hsbc.a * 2;
float _Saturation = hsbc.g * 2;
vec4 outputColor = startColor;
applyHue(outputColor, _Hue);
// Contrast
outputColor.rgb = (outputColor.rgb - 0.5) * _Contrast + 0.5;
// Brightness
outputColor.rgb = outputColor.rgb + vec3(_Brightness, _Brightness, _Brightness);
// Saturation
applySaturation(outputColor, _Saturation);
outputColor = vec4(outputColor.rgb, 1.0);
return outputColor;
}
void main() {
fragColor = applyHSBCEffect(texture(DiffuseSampler, texCoord), vec4(hue, Saturation, Brightness, Contrast));
}
@@ -0,0 +1,22 @@
{
"blend": {
"func": "add",
"srcrgb": "one",
"dstrgb": "zero"
},
"vertex": "sobel",
"fragment": "lunar_colorsaturation_core",
"attributes": [ "Position" ],
"samplers": [
{ "name": "DiffuseSampler" }
],
"uniforms": [
{ "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": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] },
{ "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] },
{ "name": "Saturation", "type": "float", "count": 1, "values": [ 0.9 ] },
{ "name": "hue", "type": "float", "count": 1, "values": [ 0.0 ] },
{ "name": "Brightness", "type": "float", "count": 1, "values": [ 0.5 ] },
{ "name": "Contrast", "type": "float", "count": 1, "values": [ 0.5 ] }
]
}
@@ -0,0 +1,18 @@
{
"blend": {
"func": "add",
"srcrgb": "one",
"dstrgb": "zero"
},
"vertex": "sobel",
"fragment": "lunar_entity_sobel_1_7",
"attributes": [ "Position" ],
"samplers": [
{ "name": "DiffuseSampler" }
],
"uniforms": [
{ "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": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] },
{ "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }
]
}
@@ -0,0 +1,21 @@
#version 120
uniform sampler2D DiffuseSampler;
varying vec2 texCoord;
varying vec2 oneTexel;
void main(){
vec4 center = texture2D(DiffuseSampler, texCoord);
vec4 left = texture2D(DiffuseSampler, texCoord - vec2(oneTexel.x, 0.0));
vec4 right = texture2D(DiffuseSampler, texCoord + vec2(oneTexel.x, 0.0));
vec4 up = texture2D(DiffuseSampler, texCoord - vec2(0.0, oneTexel.y));
vec4 down = texture2D(DiffuseSampler, texCoord + vec2(0.0, oneTexel.y));
float leftDiff = abs(center.a - left.a);
float rightDiff = abs(center.a - right.a);
float upDiff = abs(center.a - up.a);
float downDiff = abs(center.a - down.a);
float total = clamp(leftDiff + rightDiff + upDiff + downDiff, 0.0, 1.0);
vec3 outColor = center.rgb * center.a + left.rgb * left.a + right.rgb * right.a + up.rgb * up.a + down.rgb * down.a;
gl_FragColor = vec4(outColor * 0.2, total);
}
@@ -0,0 +1,24 @@
#version 120
uniform sampler2D DiffuseSampler;
uniform sampler2D PrevSampler;
varying vec2 texCoord;
varying vec2 oneTexel;
uniform vec2 InSize;
uniform vec3 Phosphor = vec3(0.7, 0.0, 0.0);
uniform float LerpFactor = 1.0;
void main() {
vec4 CurrTexel = texture2D(DiffuseSampler, texCoord);
vec4 PrevTexel = texture2D(PrevSampler, texCoord);
float factor = Phosphor.r;
if (Phosphor.g == 1) {
gl_FragColor = vec4(max(PrevTexel.rgb * vec3(factor), CurrTexel.rgb), 1.0);
} else {
gl_FragColor = vec4(mix(PrevTexel.rgb, CurrTexel.rgb, factor), 1.0);
}
}
@@ -0,0 +1,20 @@
{
"blend": {
"func": "add",
"srcrgb": "one",
"dstrgb": "zero"
},
"vertex": "sobel",
"fragment": "lunar_motionblur",
"attributes": [ "Position" ],
"samplers": [
{ "name": "DiffuseSampler" },
{ "name": "PrevSampler" }
],
"uniforms": [
{ "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": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] },
{ "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] },
{ "name": "Phosphor", "type": "float", "count": 3, "values": [ 0.3, 0.3, 0.3 ] }
]
}
@@ -0,0 +1,26 @@
#version 150
uniform sampler2D DiffuseSampler;
uniform sampler2D PrevSampler;
in vec2 texCoord;
in vec2 oneTexel;
uniform vec2 InSize;
uniform vec3 Phosphor = vec3(0.7, 0.0, 0.0);
uniform float LerpFactor = 1.0;
out vec4 fragColor;
void main() {
vec4 CurrTexel = texture(DiffuseSampler, texCoord);
vec4 PrevTexel = texture(PrevSampler, texCoord);
float factor = Phosphor.r;
if (Phosphor.g == 1) {
fragColor = vec4(max(PrevTexel.rgb * vec3(factor), CurrTexel.rgb), 1.0);
} else {
fragColor = vec4(mix(PrevTexel.rgb, CurrTexel.rgb, factor), 1.0);
}
}
@@ -0,0 +1,20 @@
{
"blend": {
"func": "add",
"srcrgb": "one",
"dstrgb": "zero"
},
"vertex": "sobel",
"fragment": "lunar_motionblur_core",
"attributes": [ "Position" ],
"samplers": [
{ "name": "DiffuseSampler" },
{ "name": "PrevSampler" }
],
"uniforms": [
{ "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": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] },
{ "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] },
{ "name": "Phosphor", "type": "float", "count": 3, "values": [ 0.3, 0.3, 0.3 ] }
]
}
+29
View File
@@ -0,0 +1,29 @@
#version 120
uniform sampler2D DiffuseSampler;
varying vec2 texCoord;
varying vec2 oneTexel;
uniform vec2 InSize;
uniform vec2 BlurDir;
uniform float Radius;
uniform float Progress;
void main() {
vec4 blurred = vec4(0.0);
float totalStrength = 0.0;
float totalAlpha = 0.0;
float totalSamples = 0.0;
float progRadius = floor(Radius * Progress);
for (float r = -progRadius; r <= progRadius; r += 1.0) {
vec4 texel = texture2D(DiffuseSampler, texCoord + oneTexel * r * BlurDir);
totalAlpha = totalAlpha + texel.a;
totalSamples = totalSamples + 1.0;
float strength = 1.0 - abs(r / progRadius);
totalStrength = totalStrength + strength;
blurred = blurred + texel;
}
gl_FragColor = vec4(blurred.rgb / (progRadius * 2.0 + 1.0), totalAlpha);
}
+21
View File
@@ -0,0 +1,21 @@
{
"blend": {
"func": "add",
"srcrgb": "one",
"dstrgb": "zero"
},
"vertex": "sobel",
"fragment": "menu_blur",
"attributes": [ "Position" ],
"samplers": [
{ "name": "DiffuseSampler" }
],
"uniforms": [
{ "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": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] },
{ "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] },
{ "name": "BlurDir", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] },
{ "name": "Radius", "type": "float", "count": 1, "values": [ 5.0 ] },
{ "name": "Progress", "type": "float", "count": 1, "values": [ 0.0 ] }
]
}
@@ -0,0 +1,24 @@
#version 150 core
uniform sampler2D DiffuseSampler;
in vec2 texCoord;
in vec2 oneTexel;
uniform vec2 InSize;
uniform vec2 BlurDir;
uniform float Radius;
uniform float Progress;
out vec4 outColor;
void main() {
vec4 blurred = vec4(0.0);
float progRadius = floor(Radius * Progress);
for (float r = -progRadius; r <= progRadius; r += 1.0) {
blurred += texture(DiffuseSampler, texCoord + oneTexel * r * BlurDir);
}
// force alpha to be 1.0 since otherwise areas with zero alpha turn black?
outColor = vec4(blurred.rgb / (progRadius * 2.0 + 1.0), 1.0);
}
@@ -0,0 +1,21 @@
{
"blend": {
"func": "add",
"srcrgb": "one",
"dstrgb": "zero"
},
"vertex": "sobel",
"fragment": "menu_blur_core",
"attributes": [ "Position" ],
"samplers": [
{ "name": "DiffuseSampler" }
],
"uniforms": [
{ "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": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] },
{ "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] },
{ "name": "BlurDir", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] },
{ "name": "Radius", "type": "float", "count": 1, "values": [ 5.0 ] },
{ "name": "Progress", "type": "float", "count": 1, "values": [ 0.0 ] }
]
}
@@ -0,0 +1,36 @@
#version 150
in vec2 uv;
uniform float TimeSeconds;
out vec4 fragColor;
// https://github.com/hughsk/glsl-hsv2rgb/blob/master/index.glsl
vec3 hsv2rgb(vec3 c) {
vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);
return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);
}
float remapX(float x) {
return clamp(10.0/9.5 - 0.1 * abs(x - 11.5), 0.0, 1.0);
}
vec3 _sample(vec2 xy) {
float hue = mod(cos(TimeSeconds * 0.25) * 0.5 + xy.x + 0.1 * cos(TimeSeconds * 0.25 * 20.0 + xy.y * 20.0), 1.0);
return hsv2rgb(vec3(hue, 1.0, 1.0));
}
void main() {
float y = max(uv.y, 1.0/16.0);
float x = remapX(uv.x * 22.0);
if (uv.x > 0.5 && uv.y < 1/17.0) {
x = remapX((uv.x - 0.45) * 22.0);
y = 1.0;
}
fragColor = vec4(_sample(vec2(x, y)), 1.0);
}
@@ -0,0 +1,15 @@
{
"blend": {
"func": "add",
"srcrgb": "one",
"dstrgb": "zero"
},
"vertex": "minecraft:v1_21_2/program/chroma_core",
"fragment": "minecraft:v1_21_2/program/chroma_core",
"attributes": [ "Position" ],
"uniforms": [
{ "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": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] },
{ "name": "TimeSeconds", "type": "float", "count": 1, "values": [ 0.0 ] }
]
}
@@ -0,0 +1,16 @@
#version 150
in vec4 Position;
uniform mat4 ProjMat;
uniform vec2 OutSize;
out vec2 uv;
void main(){
vec4 outPos = ProjMat * vec4(Position.xy, 0.0, 1.0);
gl_Position = vec4(outPos.xy, 0.2, 1.0);
uv = Position.xy / OutSize;
uv.y = 1.0 - uv.y;
}
@@ -0,0 +1,58 @@
#version 150
uniform sampler2D DiffuseSampler;
in vec2 texCoord;
in vec2 oneTexel;
uniform vec2 InSize;
uniform float hue = 0.0;
uniform float Brightness = 0.5;
uniform float Contrast = 0.8;
uniform float Saturation = 0.8;
out vec4 fragColor;
// See https://forum.unity.com/threads/hue-saturation-brightness-contrast-shader.260649/ for inspiration.
void applyHue(inout vec4 color, float hue) {
float angle = radians(hue);
vec3 k = vec3(0.57735, 0.57735, 0.57735);
float cosAngle = cos(angle);
//Rodrigues' rotation formula
color.rgb = color.rgb * cosAngle + cross(k, color.rgb) * sin(angle) + k * dot(k, color.rgb) * (1.0 - cosAngle);
}
void applySaturation(inout vec4 color, float saturation) {
// I couldn't get dotproduct and lerp to work, so I manually added it :(
float dot = sqrt(color.r * color.r * 0.299 + color.g * color.g * 0.587 + color.b * color.b * 0.114);
color.r = dot + (color.r - dot) * saturation;
color.g = dot + (color.g - dot) * saturation;
color.b = dot + (color.b - dot) * saturation;
}
vec4 applyHSBCEffect(vec4 startColor, vec4 hsbc) {
float _Hue = 360 * hsbc.r;
float _Brightness = hsbc.b * 2 - 1;
float _Contrast = hsbc.a * 2;
float _Saturation = hsbc.g * 2;
vec4 outputColor = startColor;
applyHue(outputColor, _Hue);
// Contrast
outputColor.rgb = (outputColor.rgb - 0.5) * _Contrast + 0.5;
// Brightness
outputColor.rgb = outputColor.rgb + vec3(_Brightness, _Brightness, _Brightness);
// Saturation
applySaturation(outputColor, _Saturation);
outputColor = vec4(outputColor.rgb, 1.0);
return outputColor;
}
void main() {
fragColor = applyHSBCEffect(texture(DiffuseSampler, texCoord), vec4(hue, Saturation, Brightness, Contrast));
}
@@ -0,0 +1,22 @@
{
"blend": {
"func": "add",
"srcrgb": "one",
"dstrgb": "zero"
},
"vertex": "minecraft:post/sobel",
"fragment": "minecraft:v1_21_2/program/lunar_colorsaturation_core",
"attributes": [ "Position" ],
"samplers": [
{ "name": "DiffuseSampler" }
],
"uniforms": [
{ "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": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] },
{ "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] },
{ "name": "Saturation", "type": "float", "count": 1, "values": [ 0.9 ] },
{ "name": "hue", "type": "float", "count": 1, "values": [ 0.0 ] },
{ "name": "Brightness", "type": "float", "count": 1, "values": [ 0.5 ] },
{ "name": "Contrast", "type": "float", "count": 1, "values": [ 0.5 ] }
]
}
@@ -0,0 +1,26 @@
#version 150
uniform sampler2D DiffuseSampler;
uniform sampler2D PrevSampler;
in vec2 texCoord;
in vec2 oneTexel;
uniform vec2 InSize;
uniform vec3 Phosphor = vec3(0.7, 0.0, 0.0);
uniform float LerpFactor = 1.0;
out vec4 fragColor;
void main() {
vec4 CurrTexel = texture(DiffuseSampler, texCoord);
vec4 PrevTexel = texture(PrevSampler, texCoord);
float factor = Phosphor.r;
if (Phosphor.g == 1) {
fragColor = vec4(max(PrevTexel.rgb * vec3(factor), CurrTexel.rgb), 1.0);
} else {
fragColor = vec4(mix(PrevTexel.rgb, CurrTexel.rgb, factor), 1.0);
}
}
@@ -0,0 +1,20 @@
{
"blend": {
"func": "add",
"srcrgb": "one",
"dstrgb": "zero"
},
"vertex": "minecraft:post/sobel",
"fragment": "minecraft:v1_21_2/program/lunar_motionblur_core",
"attributes": [ "Position" ],
"samplers": [
{ "name": "DiffuseSampler" },
{ "name": "PrevSampler" }
],
"uniforms": [
{ "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": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] },
{ "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] },
{ "name": "Phosphor", "type": "float", "count": 3, "values": [ 0.3, 0.3, 0.3 ] }
]
}
@@ -0,0 +1,25 @@
#version 150
uniform sampler2D InSampler;
in vec2 texCoord;
in vec2 oneTexel;
uniform vec2 InSize;
uniform vec2 BlurDir;
uniform float Radius;
uniform float Progress;
out vec4 fragColor;
void main() {
vec4 blurred = vec4(0.0);
float progRadius = floor(Radius * Progress);
for (float r = -progRadius; r <= progRadius; r += 1.0) {
blurred += texture(InSampler, texCoord + oneTexel * BlurDir * r);
}
// force alpha to be 1.0 since otherwise areas with zero alpha turn black?
// this causes issues with the sky if we use totalAlpha.
fragColor = blurred / (progRadius * 2.0 + 1.0);
}
@@ -0,0 +1,15 @@
{
"vertex": "minecraft:post/sobel",
"fragment": "minecraft:v1_21_2/program/menu_blur_core",
"samplers": [
{ "name": "InSampler" }
],
"uniforms": [
{ "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": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] },
{ "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] },
{ "name": "BlurDir", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] },
{ "name": "Radius", "type": "float", "count": 1, "values": [ 5.0 ] },
{ "name": "Progress", "type": "float", "count": 1, "values": [ 0.0 ] }
]
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 167 KiB

@@ -0,0 +1,38 @@
{
"animation": {
"frames": [
16,
17,
18,
19,
20,
21,
22,
23,
24,
25,
26,
27,
28,
29,
30,
31,
0,
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15
]
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 171 KiB

@@ -0,0 +1,3 @@
{
"animation": {}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 204 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB