tangled
alpha
login
or
join now
codexarchonic.nekoweb.org
/
ProjectInfinity
0
fork
atom
Inspired by 2020's April Fools' 20w14infinite Snapshot, this mod brings endless randomly generated dimensions into Minecraft.
0
fork
atom
overview
issues
6
pulls
pipelines
shader upgrade :D
Lera Riemann
1 year ago
0d129700
d419cf66
+58
-6
4 changed files
expand all
collapse all
unified
split
common
src
main
java
net
lerariemann
infinity
mixin
iridescence
PostEffectProcessorMixin.java
resources
assets
infinity
shaders
program
color_wheel.fsh
color_wheel.json
sobel_with_colors.vsh
+3
-3
common/src/main/java/net/lerariemann/infinity/mixin/iridescence/PostEffectProcessorMixin.java
reviewed
···
29
29
if (name.contains("infinity")) {
30
30
time += tickDelta;
31
31
32
32
-
while (time > 200.0F) {
33
33
-
time -= 200.0F;
32
32
+
while (time > 2000.0F) {
33
33
+
time -= 2000.0F;
34
34
}
35
35
36
36
int i = 9728;
···
42
42
i = j;
43
43
}
44
44
45
45
-
postEffectPass.render(this.time / 200.0F);
45
45
+
postEffectPass.render(this.time / 2000.0F);
46
46
}
47
47
48
48
this.setTexFilter(9728);
+34
-2
common/src/main/resources/assets/infinity/shaders/program/color_wheel.fsh
reviewed
···
5
5
6
6
in vec2 texCoord;
7
7
in vec2 oneTexel;
8
8
+
in vec2 screenCoords;
8
9
9
10
out vec4 fragColor;
10
11
12
12
+
float random (in vec3 st) {
13
13
+
return fract(sin(dot(st,
14
14
+
vec3(12.9898,78.233,4.1414)))*
15
15
+
43758.5453123);
16
16
+
}
17
17
+
float noise (in vec3 st) {
18
18
+
vec3 i = floor(st);
19
19
+
vec3 f = fract(st);
20
20
+
21
21
+
float a = random(i);
22
22
+
float b = random(i + vec3(1.0, 0.0, 0.0));
23
23
+
float c = random(i + vec3(0.0, 1.0, 0.0));
24
24
+
float d = random(i + vec3(1.0, 1.0, 0.0));
25
25
+
float a1 = random(i + vec3(0.0, 0.0, 1.0));
26
26
+
float b1 = random(i + vec3(1.0, 0.0, 1.0));
27
27
+
float c1 = random(i + vec3(0.0, 1.0, 1.0));
28
28
+
float d1 = random(i + vec3(1.0, 1.0, 1.0));
29
29
+
30
30
+
vec3 u = f * f * (3.0 - 2.0 * f);
31
31
+
return mix(
32
32
+
mix(
33
33
+
mix(a, b, u.x),
34
34
+
mix(c, d, u.x),
35
35
+
u.y),
36
36
+
mix(
37
37
+
mix(a1, b1, u.x),
38
38
+
mix(c1, d1, u.x),
39
39
+
u.y),
40
40
+
u.z);
41
41
+
}
42
42
+
11
43
void main() {
12
44
vec4 InTexel = texture(DiffuseSampler, texCoord);
13
13
-
14
14
-
float iTime = Time * 2 * 3.1415f;
45
45
+
float time = 2*Time*3.1415f;
46
46
+
float iTime = 10*time + 1.5*noise(vec3(1.5*screenCoords, 3*(time > 0.5 ? 1 - time : time)));
15
47
float a = (1.0f - cos(iTime))/3.0f + cos(iTime);
16
48
float b = (1.0f - cos(iTime))/3.0f - sin(iTime) / sqrt(3);
17
49
float c = (1.0f - cos(iTime))/3.0f + sin(iTime) / sqrt(3);
+1
-1
common/src/main/resources/assets/infinity/shaders/program/color_wheel.json
reviewed
···
4
4
"srcrgb": "one",
5
5
"dstrgb": "zero"
6
6
},
7
7
-
"vertex": "sobel",
7
7
+
"vertex": "infinity:sobel_with_colors",
8
8
"fragment": "infinity:color_wheel",
9
9
"attributes": [ "Position" ],
10
10
"samplers": [
+20
common/src/main/resources/assets/infinity/shaders/program/sobel_with_colors.vsh
reviewed
···
1
1
+
#version 150
2
2
+
3
3
+
in vec4 Position;
4
4
+
5
5
+
uniform mat4 ProjMat;
6
6
+
uniform vec2 InSize;
7
7
+
uniform vec2 OutSize;
8
8
+
9
9
+
out vec2 texCoord;
10
10
+
out vec2 oneTexel;
11
11
+
out vec2 screenCoords;
12
12
+
13
13
+
void main(){
14
14
+
vec4 outPos = vec4(Position.xy, 0.0, 1.0) * ProjMat - vec4(1.0, 1.0, 0.0, 0.0);
15
15
+
gl_Position = vec4(outPos.xy, 0.2, 1.0);
16
16
+
17
17
+
oneTexel = 1.0 / InSize;
18
18
+
texCoord = Position.xy / OutSize;
19
19
+
screenCoords = outPos.xy;
20
20
+
}