aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLinnea Gräf <nea@nea.moe>2025-07-30 17:23:41 +0200
committerLinnea Gräf <nea@nea.moe>2025-07-30 17:25:04 +0200
commit6300ff493fe90fd06162d2f4ce91339c07a50d11 (patch)
tree5ee5bc676567ab2b025067d6bebd992f659144b9 /src
parenta30e0810604ee9122758879205434563ccc94738 (diff)
downloadFirmament-6300ff493fe90fd06162d2f4ce91339c07a50d11.tar.gz
Firmament-6300ff493fe90fd06162d2f4ce91339c07a50d11.tar.bz2
Firmament-6300ff493fe90fd06162d2f4ce91339c07a50d11.zip
feat(dev): unpleasant gradient cape
Diffstat (limited to 'src')
-rw-r--r--src/main/java/moe/nea/firmament/mixins/render/IncreaseStackLimitSizeInDrawContext.java20
-rw-r--r--src/main/kotlin/features/macros/MacroUI.kt12
-rw-r--r--src/main/kotlin/features/misc/CustomCapes.kt7
-rw-r--r--src/main/kotlin/util/mc/CustomRenderPassHelper.kt2
-rw-r--r--src/main/kotlin/util/render/CustomRenderLayers.kt2
-rw-r--r--src/main/kotlin/util/render/RenderCircleProgress.kt2
-rw-r--r--src/main/resources/assets/firmament/gui/config/macros/combos.xml2
-rw-r--r--src/main/resources/assets/firmament/gui/config/macros/wheel.xml2
-rw-r--r--src/main/resources/assets/firmament/shaders/circle_discard_color.fsh7
-rw-r--r--src/main/resources/assets/firmament/textures/cape/unpleasant_gradient.pngbin0 -> 176471 bytes
10 files changed, 44 insertions, 12 deletions
diff --git a/src/main/java/moe/nea/firmament/mixins/render/IncreaseStackLimitSizeInDrawContext.java b/src/main/java/moe/nea/firmament/mixins/render/IncreaseStackLimitSizeInDrawContext.java
new file mode 100644
index 0000000..61ad8a3
--- /dev/null
+++ b/src/main/java/moe/nea/firmament/mixins/render/IncreaseStackLimitSizeInDrawContext.java
@@ -0,0 +1,20 @@
+package moe.nea.firmament.mixins.render;
+
+import net.minecraft.client.gui.DrawContext;
+import org.spongepowered.asm.mixin.Mixin;
+import org.spongepowered.asm.mixin.injection.At;
+import org.spongepowered.asm.mixin.injection.ModifyArg;
+
+@Mixin(DrawContext.class)
+public class IncreaseStackLimitSizeInDrawContext {
+ // [22:00:57] [Render thread/ERROR] (Minecraft) Couldn't compile program for pipeline firmament:gui_textured_overlay_tris_circle:
+ // net.minecraft.client.gl.ShaderLoader$LoadException: Error encountered when linking program containing
+ // VS minecraft:core/position_tex_color and FS firmament:circle_discard_color.
+ // Log output: error: declarations for uniform `ColorModulator` are inside block `DynamicTransforms` and outside a block
+ @ModifyArg(
+ method = "<init>(Lnet/minecraft/client/MinecraftClient;Lnet/minecraft/client/gui/render/state/GuiRenderState;)V",
+ at = @At(value = "INVOKE", target = "Lorg/joml/Matrix3x2fStack;<init>(I)V"))
+ private static int increaseStackSize(int stackSize) {
+ return Math.max(stackSize, 48);
+ }
+}
diff --git a/src/main/kotlin/features/macros/MacroUI.kt b/src/main/kotlin/features/macros/MacroUI.kt
index 8c22c5c..5a7d406 100644
--- a/src/main/kotlin/features/macros/MacroUI.kt
+++ b/src/main/kotlin/features/macros/MacroUI.kt
@@ -1,7 +1,9 @@
package moe.nea.firmament.features.macros
+import io.github.notenoughupdates.moulconfig.common.text.StructuredText
import io.github.notenoughupdates.moulconfig.gui.CloseEventListener
import io.github.notenoughupdates.moulconfig.observer.ObservableList
+import io.github.notenoughupdates.moulconfig.platform.MoulConfigPlatform
import io.github.notenoughupdates.moulconfig.xml.Bind
import moe.nea.firmament.annotations.Subscribe
import moe.nea.firmament.commands.thenExecute
@@ -62,6 +64,9 @@ class MacroUI {
val parent: Wheel,
) {
@Bind
+ fun textR() = StructuredText.of(text)
+
+ @Bind
fun delete() {
parent.editableCommands.removeIf { it === this }
parent.editableCommands.update()
@@ -82,7 +87,7 @@ class MacroUI {
}
@Bind("keyCombo")
- fun text() = binding.format().string
+ fun text() = MoulConfigPlatform.wrap(binding.format())
@field:Bind("commands")
val commands = commands.mapTo(ObservableList(mutableListOf())) { Command(it.command, this) }
@@ -246,12 +251,15 @@ class MacroUI {
@field:Bind("command")
var command: String = (action.action as CommandAction).command
+ @Bind
+ fun commandR() = StructuredText.of(command)
+
@field:Bind("combo")
val combo = action.keys.map { KeyBindingEditor(it, this) }.toObservableList()
@Bind
fun formattedCombo() =
- combo.joinToString(" > ") { it.binding.toString() }
+ StructuredText.of(combo.joinToString(" > ") { it.binding.toString() }) // TODO: this can be joined without .toString()
@Bind
fun addStep() {
diff --git a/src/main/kotlin/features/misc/CustomCapes.kt b/src/main/kotlin/features/misc/CustomCapes.kt
index d353b38..77a5c2d 100644
--- a/src/main/kotlin/features/misc/CustomCapes.kt
+++ b/src/main/kotlin/features/misc/CustomCapes.kt
@@ -121,7 +121,10 @@ object CustomCapes : FirmamentFeature {
110.seconds
)
),
-
+ UNPLEASANT_GRADIENT(
+ "unpleasant_gradient",
+ TexturedCapeRenderer(Firmament.identifier("textures/cape/unpleasant_gradient.png"))
+ ),
FURFSKY_STATIC(
"FurfSky",
TexturedCapeRenderer(Firmament.identifier("textures/cape/fsr_static.png"))
@@ -140,7 +143,7 @@ object CustomCapes : FirmamentFeature {
val byUuid =
listOf(
listOf(
- Devs.nea to AllCapes.FIRMAMENT_ANIMATED,
+ Devs.nea to AllCapes.UNPLEASANT_GRADIENT,
Devs.kath to AllCapes.FIRMAMENT_STATIC,
Devs.jani to AllCapes.FIRMAMENT_ANIMATED,
),
diff --git a/src/main/kotlin/util/mc/CustomRenderPassHelper.kt b/src/main/kotlin/util/mc/CustomRenderPassHelper.kt
index 1bd1148..12f98e4 100644
--- a/src/main/kotlin/util/mc/CustomRenderPassHelper.kt
+++ b/src/main/kotlin/util/mc/CustomRenderPassHelper.kt
@@ -109,7 +109,7 @@ class CustomRenderPassHelper(
}
fun allocateByteBuf(size: Int, init: (Std140Builder) -> Unit): ByteBuffer {
- return Std140Builder.intoBuffer(
+ return Std140Builder.intoBuffer( // TODO: i really dont know about this 16 align? but it seems to be generally correct.
ByteBuffer
.allocateDirect(MathHelper.roundUpToMultiple(size, 16))
.order(ByteOrder.nativeOrder())
diff --git a/src/main/kotlin/util/render/CustomRenderLayers.kt b/src/main/kotlin/util/render/CustomRenderLayers.kt
index 912ffdf..13412ec 100644
--- a/src/main/kotlin/util/render/CustomRenderLayers.kt
+++ b/src/main/kotlin/util/render/CustomRenderLayers.kt
@@ -45,7 +45,7 @@ object CustomRenderPipelines {
RenderPipeline.builder(RenderPipelines.POSITION_TEX_COLOR_SNIPPET)
.withVertexFormat(VertexFormats.POSITION_TEXTURE_COLOR, DrawMode.TRIANGLES)
.withLocation(Firmament.identifier("gui_textured_overlay_tris_circle"))
- .withUniform("InnerCutoutRadius", UniformType.UNIFORM_BUFFER)
+ .withUniform("CutoutRadius", UniformType.UNIFORM_BUFFER)
.withFragmentShader(Firmament.identifier("circle_discard_color"))
.withBlend(BlendFunction.TRANSLUCENT)
.build()
diff --git a/src/main/kotlin/util/render/RenderCircleProgress.kt b/src/main/kotlin/util/render/RenderCircleProgress.kt
index bbc4ace..2c837d3 100644
--- a/src/main/kotlin/util/render/RenderCircleProgress.kt
+++ b/src/main/kotlin/util/render/RenderCircleProgress.kt
@@ -98,7 +98,7 @@ object RenderCircleProgress {
).use { renderPass ->
renderPass.uploadVertices(buffer)
renderPass.setPipeline(state.layer.pipeline)
- renderPass.setUniform("InnerCutoutRadius", 4) {
+ renderPass.setUniform("CutoutRadius", 4) {
it.putFloat(state.innerCutoutRadius)
}
renderPass.draw()
diff --git a/src/main/resources/assets/firmament/gui/config/macros/combos.xml b/src/main/resources/assets/firmament/gui/config/macros/combos.xml
index 5141125..91edae3 100644
--- a/src/main/resources/assets/firmament/gui/config/macros/combos.xml
+++ b/src/main/resources/assets/firmament/gui/config/macros/combos.xml
@@ -11,7 +11,7 @@
<Panel background="VANILLA" insets="6">
<Column>
<Row>
- <Text text="@command" width="280"/>
+ <Text text="@commandR" width="280"/>
</Row>
<Row>
<Text text="@formattedCombo" width="250"/>
diff --git a/src/main/resources/assets/firmament/gui/config/macros/wheel.xml b/src/main/resources/assets/firmament/gui/config/macros/wheel.xml
index 19922fe..80826c9 100644
--- a/src/main/resources/assets/firmament/gui/config/macros/wheel.xml
+++ b/src/main/resources/assets/firmament/gui/config/macros/wheel.xml
@@ -24,7 +24,7 @@
</Align>
</Row>
<Array data="@commands">
- <Text text="@text" width="280"/>
+ <Text text="@textR" width="280"/>
</Array>
</Column>
</Panel>
diff --git a/src/main/resources/assets/firmament/shaders/circle_discard_color.fsh b/src/main/resources/assets/firmament/shaders/circle_discard_color.fsh
index ae46059..8fcd99f 100644
--- a/src/main/resources/assets/firmament/shaders/circle_discard_color.fsh
+++ b/src/main/resources/assets/firmament/shaders/circle_discard_color.fsh
@@ -3,8 +3,9 @@
in vec4 vertexColor;
in vec2 texCoord0;
-uniform vec4 ColorModulator;
-uniform float InnerCutoutRadius;
+layout(std140) uniform CutoutRadius {
+ float InnerCutoutRadius;
+};
out vec4 fragColor;
@@ -18,5 +19,5 @@ void main() {
{
discard;
}
- fragColor = color * ColorModulator;
+ fragColor = color;
}
diff --git a/src/main/resources/assets/firmament/textures/cape/unpleasant_gradient.png b/src/main/resources/assets/firmament/textures/cape/unpleasant_gradient.png
new file mode 100644
index 0000000..da2eb85
--- /dev/null
+++ b/src/main/resources/assets/firmament/textures/cape/unpleasant_gradient.png
Binary files differ