From 051668fe9ac8d02fd9546e588d4255ee5e120f40 Mon Sep 17 00:00:00 2001 From: Linnea Gräf Date: Mon, 23 Jun 2025 13:34:02 +0200 Subject: feat: Add dev capes --- .../assets/firmament/shaders/cape/parallax.fsh | 53 +++++++++++++++++++++ .../assets/firmament/textures/cape/REUSE.toml | 16 +++++++ .../assets/firmament/textures/cape/firm_static.png | Bin 0 -> 42249 bytes .../firmament/textures/cape/firmament_star.png | Bin 0 -> 1141 bytes .../textures/cape/parallax_background.png | Bin 0 -> 2053 bytes .../firmament/textures/cape/parallax_template.png | Bin 0 -> 516 bytes 6 files changed, 69 insertions(+) create mode 100644 src/main/resources/assets/firmament/shaders/cape/parallax.fsh create mode 100644 src/main/resources/assets/firmament/textures/cape/REUSE.toml create mode 100644 src/main/resources/assets/firmament/textures/cape/firm_static.png create mode 100644 src/main/resources/assets/firmament/textures/cape/firmament_star.png create mode 100644 src/main/resources/assets/firmament/textures/cape/parallax_background.png create mode 100644 src/main/resources/assets/firmament/textures/cape/parallax_template.png (limited to 'src/main/resources') diff --git a/src/main/resources/assets/firmament/shaders/cape/parallax.fsh b/src/main/resources/assets/firmament/shaders/cape/parallax.fsh new file mode 100644 index 0000000..bc9a440 --- /dev/null +++ b/src/main/resources/assets/firmament/shaders/cape/parallax.fsh @@ -0,0 +1,53 @@ +#version 150 + +#moj_import +#define M_PI 3.1415926535897932384626433832795 +#define M_TAU (2.0 * M_PI) +uniform sampler2D Sampler0; +uniform sampler2D Sampler1; +uniform sampler2D Sampler3; + +uniform vec4 ColorModulator; +uniform float FogStart; +uniform float FogEnd; +uniform vec4 FogColor; +uniform float Animation; + +in float vertexDistance; +in vec4 vertexColor; +in vec4 lightMapColor; +in vec4 overlayColor; +in vec2 texCoord0; + +out vec4 fragColor; + +float highlightDistance(vec2 coord, vec2 direction, float time) { + vec2 dir = normalize(direction); + float projection = dot(coord, dir); + float animationTime = sin(projection + time * 13 * M_TAU); + if (animationTime < 0.997) { + return 0.0; + } + return animationTime; +} + +void main() { + vec4 color = texture(Sampler0, texCoord0); + if (color.g > 0.99) { + // TODO: maybe this speed in each direction should be a uniform + color = texture(Sampler1, texCoord0 + Animation * vec2(3.0, -2.0)); + } + + vec4 highlightColor = texture(Sampler3, texCoord0); + if (highlightColor.a > 0.5) { + color = highlightColor; + float animationHighlight = highlightDistance(texCoord0, vec2(-12.0, 2.0), Animation); + color.rgb += (animationHighlight); + } + #ifdef ALPHA_CUTOUT + if (color.a < ALPHA_CUTOUT) { + discard; + } + #endif + fragColor = linear_fog(color, vertexDistance, FogStart, FogEnd, FogColor); +} diff --git a/src/main/resources/assets/firmament/textures/cape/REUSE.toml b/src/main/resources/assets/firmament/textures/cape/REUSE.toml new file mode 100644 index 0000000..7cb21f2 --- /dev/null +++ b/src/main/resources/assets/firmament/textures/cape/REUSE.toml @@ -0,0 +1,16 @@ +#SPDX-FileCopyrightText: 2025 Linnea Gräf +# +#SPDX-License-Identifier: CC0-1.0 +version = 1 + +[[annotations]] +path = ["firmament_star.png", "parallax_background.png", "parallax_template.png"] +SPDX-License-Identifier = "CC-BY-4.0" +SPDX-FileCopyrightText = ["ic22487", "Linnea Gräf"] + +[[annotations]] +path = ["firm_static.png"] +SPDX-License-Identifier = "CC-BY-4.0" +SPDX-FileCopyrightText = ["ic22487", "kathund"] + + diff --git a/src/main/resources/assets/firmament/textures/cape/firm_static.png b/src/main/resources/assets/firmament/textures/cape/firm_static.png new file mode 100644 index 0000000..b01511c Binary files /dev/null and b/src/main/resources/assets/firmament/textures/cape/firm_static.png differ diff --git a/src/main/resources/assets/firmament/textures/cape/firmament_star.png b/src/main/resources/assets/firmament/textures/cape/firmament_star.png new file mode 100644 index 0000000..520d309 Binary files /dev/null and b/src/main/resources/assets/firmament/textures/cape/firmament_star.png differ diff --git a/src/main/resources/assets/firmament/textures/cape/parallax_background.png b/src/main/resources/assets/firmament/textures/cape/parallax_background.png new file mode 100644 index 0000000..05ef0fa Binary files /dev/null and b/src/main/resources/assets/firmament/textures/cape/parallax_background.png differ diff --git a/src/main/resources/assets/firmament/textures/cape/parallax_template.png b/src/main/resources/assets/firmament/textures/cape/parallax_template.png new file mode 100644 index 0000000..ada76eb Binary files /dev/null and b/src/main/resources/assets/firmament/textures/cape/parallax_template.png differ -- cgit