aboutsummaryrefslogtreecommitdiff
path: root/src/main/resources/assets/goodgenerator/shaders
diff options
context:
space:
mode:
authorBucketBrigade <138534411+CookieBrigade@users.noreply.github.com>2024-09-13 18:00:19 -0500
committerGitHub <noreply@github.com>2024-09-14 01:00:19 +0200
commite7a32141309838050e533e8fd422f7773e0d465c (patch)
treec3b302130d85d34f3e311ff798d05ecbebdeb598 /src/main/resources/assets/goodgenerator/shaders
parent82793acd17f82173fbd06f663d6a01a7e9e306d2 (diff)
downloadGT5-Unofficial-e7a32141309838050e533e8fd422f7773e0d465c.tar.gz
GT5-Unofficial-e7a32141309838050e533e8fd422f7773e0d465c.tar.bz2
GT5-Unofficial-e7a32141309838050e533e8fd422f7773e0d465c.zip
Antimatter Finishing touches (#3181)
Diffstat (limited to 'src/main/resources/assets/goodgenerator/shaders')
-rw-r--r--src/main/resources/assets/goodgenerator/shaders/antimatter.vert.glsl44
-rw-r--r--src/main/resources/assets/goodgenerator/shaders/glow.frag.glsl6
-rw-r--r--src/main/resources/assets/goodgenerator/shaders/glow.vert.glsl5
3 files changed, 19 insertions, 36 deletions
diff --git a/src/main/resources/assets/goodgenerator/shaders/antimatter.vert.glsl b/src/main/resources/assets/goodgenerator/shaders/antimatter.vert.glsl
index 8286a26a4f..066225eddb 100644
--- a/src/main/resources/assets/goodgenerator/shaders/antimatter.vert.glsl
+++ b/src/main/resources/assets/goodgenerator/shaders/antimatter.vert.glsl
@@ -1,7 +1,6 @@
#version 120
-uniform float u_SpikeMult;
uniform float u_Scale;
uniform float u_ScaleSnapshot;
uniform vec3 u_ColorCore;
@@ -24,23 +23,6 @@ float lazyHash(vec3 input){
return fract(v.y + v.x*(v.z+1));
}
-
-float wave ( vec3 input){
- float val = lazyHash(input);
- float pulse = cos(val*2*PI + u_Time)*cos(u_Time*(1+val)); // Slow save
- return pulse;
-}
-
-float trim (float val){
- return clamp(val - .1,0,1)/.9;
-}
-
-float amp(float x){
- float b = smoothstep(0.,1.,x);
- float c = pow(b,.3);
- return c;
-}
-
float triangle(float x){
return 1.0 - abs(2.0 * (x - 0.5));
}
@@ -48,32 +30,22 @@ float triangle(float x){
void main() {
//grab local position
vec3 pos = gl_Vertex.xyz;
-
//Grabs how far the vertex is for center
//Antimatter.model has spikes that are 2 unit away, and the 'core' is 1 unit away
float len = length(pos);
- //Grabs distance that remains as spike
- float spike = len-1;
-
- //Spike
- float extension = wave(pos);
- extension = abs(extension);
- float spikeSize = extension * u_SpikeMult;
-
- //Scale
- float timelerp = clamp(1,0,(u_Time-u_TimeSnapshot)/2.5);
- float scale = mix(u_ScaleSnapshot,u_Scale,timelerp)*(1 + 0.5*spike*(spikeSize - 1));
-
vec3 currentCoreColor = mix(u_ColorCore,u_ColorSpike,triangle(mod((u_Time/4.0 + lazyHash(pos)/2),1.0)));
vec3 currentSpikeColor = mix(u_ColorCore,u_ColorSpike,triangle(mod((u_Time/2.0 + lazyHash(pos)),1.0)));
//v_Color = mix(u_ColorCore,u_ColorSpike,extension*spike);
- v_Color = mix(currentCoreColor,currentSpikeColor,extension*spike);
+ //v_Color = mix(currentCoreColor,currentSpikeColor,extension*spike);
+ v_Color = currentCoreColor;
+ float timelerp = clamp(1,0,(u_Time-u_TimeSnapshot)/2.5);
+ float scale = mix(u_ScaleSnapshot,u_Scale,timelerp);
mat4 mScale = mat4(
- scale,0,0,0,
- 0,scale,0,0,
- 0,0,scale,0,
- 0,0,0,1);
+ scale,0,0,0,
+ 0,scale,0,0,
+ 0,0,scale,0,
+ 0,0,0,1);
gl_Position = gl_ModelViewProjectionMatrix * mScale * gl_Vertex;
diff --git a/src/main/resources/assets/goodgenerator/shaders/glow.frag.glsl b/src/main/resources/assets/goodgenerator/shaders/glow.frag.glsl
new file mode 100644
index 0000000000..cd409f759a
--- /dev/null
+++ b/src/main/resources/assets/goodgenerator/shaders/glow.frag.glsl
@@ -0,0 +1,6 @@
+#version 120
+uniform vec3 u_Color;
+
+void main() {
+ gl_FragColor = vec4(u_Color,1);
+}
diff --git a/src/main/resources/assets/goodgenerator/shaders/glow.vert.glsl b/src/main/resources/assets/goodgenerator/shaders/glow.vert.glsl
new file mode 100644
index 0000000000..a243a19e0a
--- /dev/null
+++ b/src/main/resources/assets/goodgenerator/shaders/glow.vert.glsl
@@ -0,0 +1,5 @@
+#version 120
+
+void main() {
+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+}