aboutsummaryrefslogtreecommitdiff
path: root/src/main/resources
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/resources')
-rw-r--r--src/main/resources/assets/minecraft/shaders/post/fade_in_blur.json67
-rw-r--r--src/main/resources/assets/minecraft/shaders/program/fade_in_blur.fsh33
-rw-r--r--src/main/resources/assets/minecraft/shaders/program/fade_in_blur.json21
-rw-r--r--src/main/resources/licenses/BlurMC-License.txt24
-rw-r--r--src/main/resources/oneconfig_at.cfg2
-rw-r--r--src/main/resources/post/fade_in_blur.json67
-rw-r--r--src/main/resources/program/fade_in_blur.fsh33
-rw-r--r--src/main/resources/program/fade_in_blur.json21
8 files changed, 268 insertions, 0 deletions
diff --git a/src/main/resources/assets/minecraft/shaders/post/fade_in_blur.json b/src/main/resources/assets/minecraft/shaders/post/fade_in_blur.json
new file mode 100644
index 0000000..3214a10
--- /dev/null
+++ b/src/main/resources/assets/minecraft/shaders/post/fade_in_blur.json
@@ -0,0 +1,67 @@
+{
+ "targets": [
+ "swap"
+ ],
+ "passes": [
+ {
+ "name": "fade_in_blur",
+ "intarget": "minecraft:main",
+ "outtarget": "swap",
+ "uniforms": [
+ {
+ "name": "BlurDir",
+ "values": [ 1.0, 0.0 ]
+ },
+ {
+ "name": "Radius",
+ "values": [ 2.0 ]
+ }
+ ]
+ },
+ {
+ "name": "fade_in_blur",
+ "intarget": "swap",
+ "outtarget": "minecraft:main",
+ "uniforms": [
+ {
+ "name": "BlurDir",
+ "values": [ 0.0, 1.0 ]
+ },
+ {
+ "name": "Radius",
+ "values": [ 2.0 ]
+ }
+ ]
+ },
+ {
+ "name": "fade_in_blur",
+ "intarget": "minecraft:main",
+ "outtarget": "swap",
+ "uniforms": [
+ {
+ "name": "BlurDir",
+ "values": [ 1.0, 0.0 ]
+ },
+ {
+ "name": "Radius",
+ "values": [ 2.0 ]
+ }
+ ]
+ },
+ {
+ "name": "fade_in_blur",
+ "intarget": "swap",
+ "outtarget": "minecraft:main",
+ "uniforms": [
+ {
+ "name": "BlurDir",
+ "values": [ 0.0, 1.0 ]
+ },
+ {
+ "name": "Radius",
+ "values": [ 2.0 ]
+ }
+ ]
+ }
+ ]
+}
diff --git a/src/main/resources/assets/minecraft/shaders/program/fade_in_blur.fsh b/src/main/resources/assets/minecraft/shaders/program/fade_in_blur.fsh
new file mode 100644
index 0000000..5539f39
--- /dev/null
+++ b/src/main/resources/assets/minecraft/shaders/program/fade_in_blur.fsh
@@ -0,0 +1,33 @@
+#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 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 / progRadius);
+ totalStrength = totalStrength + strength;
+ blurred = blurred + sample;
+ }
+ gl_FragColor = vec4(blurred.rgb / (progRadius * 2.0 + 1.0), totalAlpha);
+}
diff --git a/src/main/resources/assets/minecraft/shaders/program/fade_in_blur.json b/src/main/resources/assets/minecraft/shaders/program/fade_in_blur.json
new file mode 100644
index 0000000..3d09d02
--- /dev/null
+++ b/src/main/resources/assets/minecraft/shaders/program/fade_in_blur.json
@@ -0,0 +1,21 @@
+{
+ "blend": {
+ "func": "add",
+ "srcrgb": "one",
+ "dstrgb": "zero"
+ },
+ "vertex": "sobel",
+ "fragment": "fade_in_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 ] }
+ ]
+}
diff --git a/src/main/resources/licenses/BlurMC-License.txt b/src/main/resources/licenses/BlurMC-License.txt
new file mode 100644
index 0000000..cfbfd83
--- /dev/null
+++ b/src/main/resources/licenses/BlurMC-License.txt
@@ -0,0 +1,24 @@
+Copyright (c) 2019 tterrag1098
+
+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:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+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.
+
+----------------
+
+The proof of permission is listed in this
+folder, feel free to view it if you wish \ No newline at end of file
diff --git a/src/main/resources/oneconfig_at.cfg b/src/main/resources/oneconfig_at.cfg
new file mode 100644
index 0000000..a3826b2
--- /dev/null
+++ b/src/main/resources/oneconfig_at.cfg
@@ -0,0 +1,2 @@
+public net.minecraft.client.shader.ShaderGroup field_148031_d # listShaders
+public net.minecraft.client.renderer.EntityRenderer func_175069_a(Lnet/minecraft/util/ResourceLocation;)V # loadShader \ No newline at end of file
diff --git a/src/main/resources/post/fade_in_blur.json b/src/main/resources/post/fade_in_blur.json
new file mode 100644
index 0000000..c2cab8f
--- /dev/null
+++ b/src/main/resources/post/fade_in_blur.json
@@ -0,0 +1,67 @@
+{
+ "targets": [
+ "swap"
+ ],
+ "passes": [
+ {
+ "name": "fade_in_blur",
+ "intarget": "minecraft:main",
+ "outtarget": "swap",
+ "uniforms": [
+ {
+ "name": "BlurDir",
+ "values": [ 1.0, 0.0 ]
+ },
+ {
+ "name": "Radius",
+ "values": [ "@radius@.0" ]
+ }
+ ]
+ },
+ {
+ "name": "fade_in_blur",
+ "intarget": "swap",
+ "outtarget": "minecraft:main",
+ "uniforms": [
+ {
+ "name": "BlurDir",
+ "values": [ 0.0, 1.0 ]
+ },
+ {
+ "name": "Radius",
+ "values": [ "@radius@.0" ]
+ }
+ ]
+ },
+ {
+ "name": "fade_in_blur",
+ "intarget": "minecraft:main",
+ "outtarget": "swap",
+ "uniforms": [
+ {
+ "name": "BlurDir",
+ "values": [ 1.0, 0.0 ]
+ },
+ {
+ "name": "Radius",
+ "values": [ "@radius@.0" ]
+ }
+ ]
+ },
+ {
+ "name": "fade_in_blur",
+ "intarget": "swap",
+ "outtarget": "minecraft:main",
+ "uniforms": [
+ {
+ "name": "BlurDir",
+ "values": [ 0.0, 1.0 ]
+ },
+ {
+ "name": "Radius",
+ "values": [ "@radius@.0" ]
+ }
+ ]
+ }
+ ]
+}
diff --git a/src/main/resources/program/fade_in_blur.fsh b/src/main/resources/program/fade_in_blur.fsh
new file mode 100644
index 0000000..5539f39
--- /dev/null
+++ b/src/main/resources/program/fade_in_blur.fsh
@@ -0,0 +1,33 @@
+#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 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 / progRadius);
+ totalStrength = totalStrength + strength;
+ blurred = blurred + sample;
+ }
+ gl_FragColor = vec4(blurred.rgb / (progRadius * 2.0 + 1.0), totalAlpha);
+}
diff --git a/src/main/resources/program/fade_in_blur.json b/src/main/resources/program/fade_in_blur.json
new file mode 100644
index 0000000..3d09d02
--- /dev/null
+++ b/src/main/resources/program/fade_in_blur.json
@@ -0,0 +1,21 @@
+{
+ "blend": {
+ "func": "add",
+ "srcrgb": "one",
+ "dstrgb": "zero"
+ },
+ "vertex": "sobel",
+ "fragment": "fade_in_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 ] }
+ ]
+}