From 089bac89c5435eb7e5cf80e7602da953a65f5b1a Mon Sep 17 00:00:00 2001 From: Moulberry Date: Mon, 23 Nov 2020 03:34:12 +1100 Subject: 1.7 --- .../notenoughupdates/shaders/biscuit_cape.frag | 36 ++++++++++++++++++++++ .../notenoughupdates/shaders/biscuit_cape.vert | 12 ++++++++ .../notenoughupdates/shaders/shiny_cape.frag | 26 ++++++++++++++++ .../notenoughupdates/shaders/shiny_cape.vert | 12 ++++++++ 4 files changed, 86 insertions(+) create mode 100644 src/main/resources/assets/notenoughupdates/shaders/biscuit_cape.frag create mode 100644 src/main/resources/assets/notenoughupdates/shaders/biscuit_cape.vert create mode 100644 src/main/resources/assets/notenoughupdates/shaders/shiny_cape.frag create mode 100644 src/main/resources/assets/notenoughupdates/shaders/shiny_cape.vert (limited to 'src/main/resources/assets/notenoughupdates/shaders') diff --git a/src/main/resources/assets/notenoughupdates/shaders/biscuit_cape.frag b/src/main/resources/assets/notenoughupdates/shaders/biscuit_cape.frag new file mode 100644 index 00000000..e3f7feba --- /dev/null +++ b/src/main/resources/assets/notenoughupdates/shaders/biscuit_cape.frag @@ -0,0 +1,36 @@ +#version 120 + +varying vec4 passColour; +varying vec3 passNormal; +uniform sampler2D textureIn; + +uniform int millis; +uniform int eventMillis; + +void main() { + vec4 texture = texture2D(textureIn, gl_TexCoord[0].st); + + float t = gl_TexCoord[0].t; + t = clamp(t, 10.0f/1024.0f, 410.0f/1024.0f); + + float index = mod(millis/30.0f-t*1024.0f, 1024.0f); + float xIndex = mod(index, 1024.0f); + float yIndex = mod(gl_TexCoord[0].s*1024.0f+millis/500.0f, 421.0f)+421.0f; + vec3 lava = texture2D(textureIn, vec2(xIndex/1024.0f, yIndex/1024.0f)).xyz; + + if(eventMillis < 350) { + float scroll = (gl_TexCoord[0].s*1024.0f+gl_TexCoord[0].t*1024.0f); + float factor = (10 - abs(scroll - eventMillis*2))/20.0f; + if(factor > 0) { + lava += vec3(factor, factor, factor); + } + } + + gl_FragColor = vec4(texture.rgb*texture.a + lava*(1.0f-texture.a), 1.0f) * passColour; + + vec3 fakeSunNormal = normalize(vec3(0.2f,1.0f,-0.2f)); + vec3 normNormal = normalize(passNormal); + float shading = max(0.6f, dot(fakeSunNormal, normNormal)); + + gl_FragColor = vec4(gl_FragColor.rgb*shading, gl_FragColor.a); +} diff --git a/src/main/resources/assets/notenoughupdates/shaders/biscuit_cape.vert b/src/main/resources/assets/notenoughupdates/shaders/biscuit_cape.vert new file mode 100644 index 00000000..2b5c48f8 --- /dev/null +++ b/src/main/resources/assets/notenoughupdates/shaders/biscuit_cape.vert @@ -0,0 +1,12 @@ +#version 120 + +varying vec4 passColour; +varying vec3 passNormal; + +void main() { + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + gl_TexCoord[0] = gl_MultiTexCoord0; + + passColour = gl_Color; + passNormal = normalize(gl_Normal); +} \ No newline at end of file diff --git a/src/main/resources/assets/notenoughupdates/shaders/shiny_cape.frag b/src/main/resources/assets/notenoughupdates/shaders/shiny_cape.frag new file mode 100644 index 00000000..77e2c5eb --- /dev/null +++ b/src/main/resources/assets/notenoughupdates/shaders/shiny_cape.frag @@ -0,0 +1,26 @@ +#version 120 + +varying vec4 passColour; +varying vec3 passNormal; +uniform sampler2D textureIn; + +uniform int millis; +uniform int eventMillis; + +void main() { + gl_FragColor = texture2D(textureIn, gl_TexCoord[0].st) * passColour; + + if(eventMillis < 350 && gl_TexCoord[0].s < 512 && gl_TexCoord[0].t < 512) { + float scroll = (gl_TexCoord[0].s*1024.0f+gl_TexCoord[0].t*1024.0f); + float factor = (10 - abs(scroll - eventMillis*2))/40.0f; + if(factor > 0) { + gl_FragColor.rgb += vec3(factor+0.25f, factor+0.25f, factor+0.25f); + } + } + + vec3 fakeSunNormal = normalize(vec3(0.2f,1.0f,-0.2f)); + vec3 normNormal = normalize(passNormal); + float shading = max(0.6f, dot(fakeSunNormal, normNormal)); + + gl_FragColor = vec4(gl_FragColor.rgb*shading, gl_FragColor.a); +} \ No newline at end of file diff --git a/src/main/resources/assets/notenoughupdates/shaders/shiny_cape.vert b/src/main/resources/assets/notenoughupdates/shaders/shiny_cape.vert new file mode 100644 index 00000000..2b5c48f8 --- /dev/null +++ b/src/main/resources/assets/notenoughupdates/shaders/shiny_cape.vert @@ -0,0 +1,12 @@ +#version 120 + +varying vec4 passColour; +varying vec3 passNormal; + +void main() { + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + gl_TexCoord[0] = gl_MultiTexCoord0; + + passColour = gl_Color; + passNormal = normalize(gl_Normal); +} \ No newline at end of file -- cgit