diff --git a/CHANGELOG.md b/CHANGELOG.md index ec2cf27..cd4c889 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,2 +1,7 @@ +# 1.2.0 +- Add contrast, brightness and hue sliders +- Fix a black or frozen screen on drivers that mishandle texture-to-texture copies (Intel Windows) +- Free the mod's render target when it is switched off (Fixes Leak) + # 1.1.1 - Optimize shader \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts index ebe01ff..37b0e16 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -120,7 +120,10 @@ tasks.processResources { { "sampler_name": "DiffuseSampler", "target": "minecraft:main" } ], "uniforms": [ - { "name": "Saturation", "values": [ 1.0 ] } + { "name": "Saturation", "values": [ 1.0 ] }, + { "name": "Contrast", "values": [ 1.0 ] }, + { "name": "Brightness", "values": [ 1.0 ] }, + { "name": "Hue", "values": [ 0.0 ] } ], "output": "swap" }, @@ -147,7 +150,10 @@ tasks.processResources { { "sampler_name": "DiffuseSampler", "target": "minecraft:main" } ], "uniforms": [ - { "name": "Saturation", "type": "float", "values": [ 1.0 ] } + { "name": "Saturation", "type": "float", "values": [ 1.0 ] }, + { "name": "Contrast", "type": "float", "values": [ 1.0 ] }, + { "name": "Brightness", "type": "float", "values": [ 1.0 ] }, + { "name": "Hue", "type": "float", "values": [ 0.0 ] } ], "output": "swap" }, @@ -183,6 +189,21 @@ tasks.processResources { "name": "Saturation", "type": "float", "value": 1.0 + }, + { + "name": "Contrast", + "type": "float", + "value": 1.0 + }, + { + "name": "Brightness", + "type": "float", + "value": 1.0 + }, + { + "name": "Hue", + "type": "float", + "value": 0.0 } ] }, @@ -217,6 +238,21 @@ tasks.processResources { "name": "Saturation", "type": "float", "value": 1.0 + }, + { + "name": "Contrast", + "type": "float", + "value": 1.0 + }, + { + "name": "Brightness", + "type": "float", + "value": 1.0 + }, + { + "name": "Hue", + "type": "float", + "value": 0.0 } ] }, diff --git a/gradle.properties b/gradle.properties index 2f1a724..e244e9c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -9,7 +9,7 @@ loom.ignoreDependencyLoomVersionValidation=true # Mod information mod.name=ColorSaturation mod.id=colorsaturation -mod.version=1.1.1 +mod.version=1.2.0 mod.group=org.polyfrost # Loom settings, [VERSIONED] means to be overridden in each version's gradle.properties diff --git a/src/main/java/org/polyfrost/colorsaturation/mixin/client/Mixin_ApplySaturation.java b/src/main/java/org/polyfrost/colorsaturation/mixin/client/Mixin_ApplySaturation.java index 7d029ba..2cef935 100644 --- a/src/main/java/org/polyfrost/colorsaturation/mixin/client/Mixin_ApplySaturation.java +++ b/src/main/java/org/polyfrost/colorsaturation/mixin/client/Mixin_ApplySaturation.java @@ -36,6 +36,7 @@ public class Mixin_ApplySaturation { ) private void colorsaturation$applySaturation(DeltaTracker deltaTracker, boolean renderLevel, CallbackInfo ci) { if (!ColorSaturationConfig.isEnabled || !this.minecraft.isGameLoadFinished() || this.minecraft.level == null) { + SaturationHandler.free(); return; } diff --git a/src/main/kotlin/org/polyfrost/colorsaturation/client/ColorSaturationConfig.kt b/src/main/kotlin/org/polyfrost/colorsaturation/client/ColorSaturationConfig.kt index d3a43b4..fe95b26 100644 --- a/src/main/kotlin/org/polyfrost/colorsaturation/client/ColorSaturationConfig.kt +++ b/src/main/kotlin/org/polyfrost/colorsaturation/client/ColorSaturationConfig.kt @@ -20,13 +20,30 @@ object ColorSaturationConfig : Config( @Slider(title = "Saturation Strength", min = -1f, max = 5f, step = 0.05f) var strength = 1f + @JvmField + @Slider(title = "Contrast", min = 0f, max = 2f, step = 0.05f) + var contrast = 1f + + @JvmField + @Slider(title = "Brightness", min = 0f, max = 2f, step = 0.05f) + var brightness = 1f + + @JvmField + @Slider(title = "Hue Shift", min = -180f, max = 180f, step = 1f) + var hue = 0f + @JvmStatic - val isIdentityStrength: Boolean - get() = abs(strength - 1f) < 1e-4f + val isIdentity: Boolean + get() = abs(strength - 1f) < 1e-4f && + abs(contrast - 1f) < 1e-4f && + abs(brightness - 1f) < 1e-4f && + abs(hue) < 1e-4f init { - addCallback("strength") { - SaturationHandler.updateShaderUniforms() + for (key in arrayOf("strength", "contrast", "brightness", "hue")) { + addCallback(key) { + SaturationHandler.updateShaderUniforms() + } } save() } diff --git a/src/main/kotlin/org/polyfrost/colorsaturation/client/ResourceLocations.kt b/src/main/kotlin/org/polyfrost/colorsaturation/client/ResourceLocations.kt index 8b25d71..4c9fce3 100644 --- a/src/main/kotlin/org/polyfrost/colorsaturation/client/ResourceLocations.kt +++ b/src/main/kotlin/org/polyfrost/colorsaturation/client/ResourceLocations.kt @@ -1,15 +1,7 @@ package org.polyfrost.colorsaturation.client -//? if <1.21.11 { +//~ if >=1.21.11 'ResourceLocation' -> 'Identifier' { import net.minecraft.resources.ResourceLocation -fun location(namespace: String, path: String): ResourceLocation = - ResourceLocation.fromNamespaceAndPath(namespace, path) -//?} - -//? if >=1.21.11 { -/*import net.minecraft.resources.Identifier - -fun location(namespace: String, path: String): Identifier = - Identifier.fromNamespaceAndPath(namespace, path) -*///?} +fun location(namespace: String, path: String) = ResourceLocation.fromNamespaceAndPath(namespace, path) +//~} \ No newline at end of file diff --git a/src/main/kotlin/org/polyfrost/colorsaturation/client/SaturationHandler.kt b/src/main/kotlin/org/polyfrost/colorsaturation/client/SaturationHandler.kt index e6332ec..8200406 100644 --- a/src/main/kotlin/org/polyfrost/colorsaturation/client/SaturationHandler.kt +++ b/src/main/kotlin/org/polyfrost/colorsaturation/client/SaturationHandler.kt @@ -18,11 +18,23 @@ object SaturationHandler { @JvmStatic val isActive: Boolean - get() = ColorSaturationConfig.isEnabled && !ColorSaturationConfig.isIdentityStrength + get() = ColorSaturationConfig.isEnabled && !ColorSaturationConfig.isIdentity @JvmStatic fun updateShaderUniforms() { - postChain?.setUniform("Saturation", ColorSaturationConfig.strength) + val chain = postChain ?: return + chain.setUniform("Saturation", ColorSaturationConfig.strength) + chain.setUniform("Contrast", ColorSaturationConfig.contrast) + chain.setUniform("Brightness", ColorSaturationConfig.brightness) + chain.setUniform("Hue", ColorSaturationConfig.hue) + } + + @JvmStatic + fun free() { + postChain?.close() + postChain = null + prevWidth = -1 + prevHeight = -1 } @JvmStatic @@ -92,12 +104,16 @@ import org.polyfrost.colorsaturation.ColorSaturationConstants @JvmStatic val isActive: Boolean - get() = ColorSaturationConfig.isEnabled && !ColorSaturationConfig.isIdentityStrength + get() = ColorSaturationConfig.isEnabled && !ColorSaturationConfig.isIdentity @JvmStatic fun updateShaderUniforms() { } + @JvmStatic + fun free() { + } + @JvmStatic fun render(renderTarget: RenderTarget, resourcePool: CrossFrameResourcePool) { if (!isActive) { @@ -125,10 +141,16 @@ import org.polyfrost.colorsaturation.ColorSaturationConstants targetBundle, Consumer { renderPass: com.mojang.blaze3d.systems.RenderPass -> renderPass.setUniform("Saturation", ColorSaturationConfig.strength) + renderPass.setUniform("Contrast", ColorSaturationConfig.contrast) + renderPass.setUniform("Brightness", ColorSaturationConfig.brightness) + renderPass.setUniform("Hue", ColorSaturationConfig.hue) } ) //?} else { /*shader?.setUniform("Saturation", ColorSaturationConfig.strength) + shader?.setUniform("Contrast", ColorSaturationConfig.contrast) + shader?.setUniform("Brightness", ColorSaturationConfig.brightness) + shader?.setUniform("Hue", ColorSaturationConfig.hue) shader?.addToFrame( builder, renderTarget.viewWidth, @@ -171,50 +193,67 @@ import org.polyfrost.colorsaturation.ColorSaturationConstants import java.util.OptionalInt object SaturationHandler { - private val pipeline by lazy { - RenderPipeline.builder() - .withLocation(location(ColorSaturationConstants.ID, "saturation_pipeline")) + private val saturationPipeline by lazy { + createPipeline("saturation_pipeline", "post/color_saturation", true) + } + + private val blitPipeline by lazy { + createPipeline("blit_pipeline", "post/blit", false) + } + + private fun createPipeline(name: String, fragmentShader: String, hasUniforms: Boolean): RenderPipeline { + val builder = RenderPipeline.builder() + .withLocation(location(ColorSaturationConstants.ID, name)) .withVertexShader(location(ColorSaturationConstants.ID, "core/fullscreen_triangle")) - .withFragmentShader(location(ColorSaturationConstants.ID, "post/color_saturation")) - //? if >=26.2 { - /*.withVertexBinding(0, DefaultVertexFormat.POSITION) + .withFragmentShader(location(ColorSaturationConstants.ID, fragmentShader)) + + //? if >=26.2 { + /*builder.withVertexBinding(0, DefaultVertexFormat.POSITION) .withPrimitiveTopology(PrimitiveTopology.TRIANGLES) .withDepthStencilState(Optional.empty()) .withColorTargetState(ColorTargetState.DEFAULT) - .withBindGroupLayout( - BindGroupLayout.builder() - .withSampler("DiffuseSampler") - .withUniform("SaturationConfig", UniformType.UNIFORM_BUFFER) - .build() - ) - *///?} - //? if <26.2 { - .withVertexFormat(DefaultVertexFormat.POSITION, VertexFormat.Mode.TRIANGLES) - //?} - //? if >=26.1 && <26.2 { - /*.withDepthStencilState(Optional.empty()) + + val bindGroupLayout = BindGroupLayout.builder().withSampler("DiffuseSampler") + if (hasUniforms) { + bindGroupLayout.withUniform("SaturationConfig", UniformType.UNIFORM_BUFFER) + } + builder.withBindGroupLayout(bindGroupLayout.build()) + *///?} + //? if <26.2 { + builder.withVertexFormat(DefaultVertexFormat.POSITION, VertexFormat.Mode.TRIANGLES) + //?} + //? if >=26.1 && <26.2 { + /*builder.withDepthStencilState(Optional.empty()) .withColorTargetState(ColorTargetState.DEFAULT) - *///?} - //? if <26.1 { - .withDepthWrite(false) + *///?} + //? if <26.1 { + builder.withDepthWrite(false) .withDepthTestFunction(DepthTestFunction.NO_DEPTH_TEST) .withColorWrite(true, true) - //?} - //? if <26.2 { - .withUniform("SaturationConfig", UniformType.UNIFORM_BUFFER) - .withSampler("DiffuseSampler") - //?} - .build() + //?} + //? if <26.2 { + if (hasUniforms) { + builder.withUniform("SaturationConfig", UniformType.UNIFORM_BUFFER) + } + builder.withSampler("DiffuseSampler") + //?} + + return builder.build() } @JvmStatic val isActive: Boolean - get() = ColorSaturationConfig.isEnabled && !ColorSaturationConfig.isIdentityStrength + get() = ColorSaturationConfig.isEnabled && !ColorSaturationConfig.isIdentity @JvmStatic fun updateShaderUniforms() { } + @JvmStatic + fun free() { + InternalTargetTracker.free() + } + @JvmStatic fun render(renderTarget: RenderTarget, resourcePool: CrossFrameResourcePool) { if (!isActive) { @@ -223,22 +262,31 @@ object SaturationHandler { } InternalTargetTracker.updateSize(renderTarget) - SaturationUniforms.upload(ColorSaturationConfig.strength) + SaturationUniforms.upload( + ColorSaturationConfig.strength, + ColorSaturationConfig.contrast, + ColorSaturationConfig.brightness, + ColorSaturationConfig.hue, + ) val tempTarget = InternalTargetTracker.target ?: return - val commandEncoder = RenderSystem.getDevice().createCommandEncoder() - - commandEncoder.copyTextureToTexture( - renderTarget.getColorTexture()!!, - tempTarget.getColorTexture()!!, - 0, 0, 0, 0, 0, renderTarget.width, renderTarget.height, - ) + drawPass("ColorSaturation/Saturation", tempTarget, renderTarget, saturationPipeline, true) + drawPass("ColorSaturation/Blit", renderTarget, tempTarget, blitPipeline, false) + } + private fun drawPass( + label: String, + output: RenderTarget, + input: RenderTarget, + pipeline: RenderPipeline, + hasUniforms: Boolean, + ) { + val commandEncoder = RenderSystem.getDevice().createCommandEncoder() val vertexBuffer = FullscreenTriangle.vertexBuffer commandEncoder.createRenderPass( - { "ColorSaturation/Saturation" }, - renderTarget.getColorTextureView()!!, + { label }, + output.getColorTextureView()!!, //? if >=26.2 { /*Optional.empty()*/ //?} @@ -256,14 +304,16 @@ object SaturationHandler { //? if >=1.21.11 { /*renderPass.bindTexture( "DiffuseSampler", - tempTarget.getColorTextureView()!!, + input.getColorTextureView()!!, RenderSystem.getSamplerCache().getClampToEdge(FilterMode.NEAREST) )*/ //?} //? if <1.21.11 { - renderPass.bindSampler("DiffuseSampler", tempTarget.getColorTextureView()!!) + renderPass.bindSampler("DiffuseSampler", input.getColorTextureView()!!) //?} - renderPass.setUniform("SaturationConfig", SaturationUniforms.buffer) + if (hasUniforms) { + renderPass.setUniform("SaturationConfig", SaturationUniforms.buffer) + } //? if >=26.2 { /*renderPass.draw(FullscreenTriangle.VERTEX_COUNT, 1, 0, 0)*/ //?} diff --git a/src/main/kotlin/org/polyfrost/colorsaturation/client/SaturationUniforms.kt b/src/main/kotlin/org/polyfrost/colorsaturation/client/SaturationUniforms.kt index 7758aaf..b4a3270 100644 --- a/src/main/kotlin/org/polyfrost/colorsaturation/client/SaturationUniforms.kt +++ b/src/main/kotlin/org/polyfrost/colorsaturation/client/SaturationUniforms.kt @@ -6,10 +6,18 @@ import com.mojang.blaze3d.buffers.Std140SizeCalculator import com.mojang.blaze3d.systems.RenderSystem object SaturationUniforms { - private val blockSize = Std140SizeCalculator().putFloat().get() + private val blockSize = Std140SizeCalculator() + .putFloat() + .putFloat() + .putFloat() + .putFloat() + .get() private val device get() = RenderSystem.getDevice() - private var uploaded = Float.NaN + private var uploadedSaturation = Float.NaN + private var uploadedContrast = Float.NaN + private var uploadedBrightness = Float.NaN + private var uploadedHue = Float.NaN val buffer: GpuBuffer by lazy { device.createBuffer( @@ -22,22 +30,37 @@ object SaturationUniforms { ) } - fun upload(strength: Float) { - if (strength == uploaded) { + fun upload(strength: Float, contrast: Float, brightness: Float, hue: Float) { + if (strength == uploadedSaturation && + contrast == uploadedContrast && + brightness == uploadedBrightness && + hue == uploadedHue + ) { return } //? if >=26.2 { /*buffer.map(false, true).use { mapped -> - mapped.data().putFloat(strength) + mapped.data() + .putFloat(strength) + .putFloat(contrast) + .putFloat(brightness) + .putFloat(hue) } *///?} else { device.createCommandEncoder().mapBuffer(buffer, false, true).use { mapped -> - mapped.data().putFloat(strength) + mapped.data() + .putFloat(strength) + .putFloat(contrast) + .putFloat(brightness) + .putFloat(hue) } //?} - uploaded = strength + uploadedSaturation = strength + uploadedContrast = contrast + uploadedBrightness = brightness + uploadedHue = hue } } //?} diff --git a/src/main/resources/assets/colorsaturation/post_effect/color_saturation.json b/src/main/resources/assets/colorsaturation/post_effect/color_saturation.json index b66a723..88ce2b6 100644 --- a/src/main/resources/assets/colorsaturation/post_effect/color_saturation.json +++ b/src/main/resources/assets/colorsaturation/post_effect/color_saturation.json @@ -19,6 +19,21 @@ "name": "Saturation", "type": "float", "value": 1.0 + }, + { + "name": "Contrast", + "type": "float", + "value": 1.0 + }, + { + "name": "Brightness", + "type": "float", + "value": 1.0 + }, + { + "name": "Hue", + "type": "float", + "value": 0.0 } ] } diff --git a/src/main/resources/assets/colorsaturation/shaders/post/blit.fsh b/src/main/resources/assets/colorsaturation/shaders/post/blit.fsh new file mode 100644 index 0000000..00a06be --- /dev/null +++ b/src/main/resources/assets/colorsaturation/shaders/post/blit.fsh @@ -0,0 +1,11 @@ +#version 330 + +uniform sampler2D DiffuseSampler; + +in vec2 texCoord; + +out vec4 fragColor; + +void main() { + fragColor = texture(DiffuseSampler, texCoord); +} diff --git a/src/main/resources/assets/colorsaturation/shaders/post/color_saturation.fsh b/src/main/resources/assets/colorsaturation/shaders/post/color_saturation.fsh index 4ffc1b5..5f9cae9 100644 --- a/src/main/resources/assets/colorsaturation/shaders/post/color_saturation.fsh +++ b/src/main/resources/assets/colorsaturation/shaders/post/color_saturation.fsh @@ -8,13 +8,29 @@ out vec4 fragColor; layout(std140) uniform SaturationConfig { float Saturation; + float Contrast; + float Brightness; + float Hue; }; +vec3 rotateHue(vec3 color, float degrees) { + float angle = radians(degrees); + float cosAngle = cos(angle); + float sinAngle = sin(angle); + const vec3 axis = vec3(1.0 / sqrt(3.0)); + return color * cosAngle + cross(axis, color) * sinAngle + axis * dot(axis, color) * (1.0 - cosAngle); +} + void main() { vec4 inTexel = texture(DiffuseSampler, texCoord); - vec3 luma = vec3(dot(inTexel.rgb, vec3(0.3, 0.59, 0.11))); - vec3 outColor = mix(luma, inTexel.rgb, Saturation); + vec3 outColor = inTexel.rgb * Brightness; + outColor = ((outColor - 0.5) * Contrast) + 0.5; + + vec3 luma = vec3(dot(outColor, vec3(0.3, 0.59, 0.11))); + outColor = mix(luma, outColor, Saturation); + + outColor = rotateHue(outColor, Hue); fragColor = vec4(outColor, inTexel.a); } diff --git a/src/main/resources/assets/colorsaturation/shaders/post/color_saturation_legacy.fsh b/src/main/resources/assets/colorsaturation/shaders/post/color_saturation_legacy.fsh index 98fa9cf..4cdf246 100644 --- a/src/main/resources/assets/colorsaturation/shaders/post/color_saturation_legacy.fsh +++ b/src/main/resources/assets/colorsaturation/shaders/post/color_saturation_legacy.fsh @@ -12,6 +12,17 @@ uniform vec3 BlueMatrix = vec3(0.0, 0.0, 1.0); uniform vec3 Offset = vec3(0.0, 0.0, 0.0); uniform vec3 ColorScale = vec3(1.0, 1.0, 1.0); uniform float Saturation = 1.0; +uniform float Contrast = 1.0; +uniform float Brightness = 1.0; +uniform float Hue = 0.0; + +vec3 rotateHue(vec3 color, float degrees) { + float angle = radians(degrees); + float cosAngle = cos(angle); + float sinAngle = sin(angle); + const vec3 axis = vec3(1.0 / sqrt(3.0)); + return color * cosAngle + cross(axis, color) * sinAngle + axis * dot(axis, color) * (1.0 - cosAngle); +} void main() { vec4 inTexel = texture(DiffuseSampler, texCoord); @@ -23,9 +34,14 @@ void main() { outColor = (outColor * ColorScale) + Offset; + outColor = outColor * Brightness; + outColor = ((outColor - 0.5) * Contrast) + 0.5; + float luma = dot(outColor, Gray); vec3 chroma = outColor - luma; outColor = (chroma * Saturation) + luma; + outColor = rotateHue(outColor, Hue); + fragColor = vec4(outColor, inTexel.a); } diff --git a/src/main/resources/assets/colorsaturation/shaders/post/color_saturation_legacy.json b/src/main/resources/assets/colorsaturation/shaders/post/color_saturation_legacy.json index c277dc0..9768f13 100644 --- a/src/main/resources/assets/colorsaturation/shaders/post/color_saturation_legacy.json +++ b/src/main/resources/assets/colorsaturation/shaders/post/color_saturation_legacy.json @@ -20,6 +20,9 @@ { "name": "BlueMatrix", "type": "float", "count": 3, "values": [ 0.0, 0.0, 1.0 ] }, { "name": "Offset", "type": "float", "count": 3, "values": [ 0.0, 0.0, 0.0 ] }, { "name": "ColorScale", "type": "float", "count": 3, "values": [ 1.0, 1.0, 1.0 ] }, - { "name": "Saturation", "type": "float", "count": 1, "values": [ 1.0 ] } + { "name": "Saturation", "type": "float", "count": 1, "values": [ 1.0 ] }, + { "name": "Contrast", "type": "float", "count": 1, "values": [ 1.0 ] }, + { "name": "Brightness", "type": "float", "count": 1, "values": [ 1.0 ] }, + { "name": "Hue", "type": "float", "count": 1, "values": [ 0.0 ] } ] } diff --git a/src/main/resources/assets/minecraft/shaders/post/color_saturation.json b/src/main/resources/assets/minecraft/shaders/post/color_saturation.json index a55426f..23a9d69 100644 --- a/src/main/resources/assets/minecraft/shaders/post/color_saturation.json +++ b/src/main/resources/assets/minecraft/shaders/post/color_saturation.json @@ -8,7 +8,10 @@ "intarget": "minecraft:main", "outtarget": "swap", "uniforms": [ - { "name": "Saturation", "values": [ 1.0 ] } + { "name": "Saturation", "values": [ 1.0 ] }, + { "name": "Contrast", "values": [ 1.0 ] }, + { "name": "Brightness", "values": [ 1.0 ] }, + { "name": "Hue", "values": [ 0.0 ] } ] }, { diff --git a/src/main/resources/assets/minecraft/shaders/program/color_saturation.fsh b/src/main/resources/assets/minecraft/shaders/program/color_saturation.fsh index 2c54b95..de46c10 100644 --- a/src/main/resources/assets/minecraft/shaders/program/color_saturation.fsh +++ b/src/main/resources/assets/minecraft/shaders/program/color_saturation.fsh @@ -7,12 +7,28 @@ in vec2 texCoord; out vec4 fragColor; uniform float Saturation = 1.0; +uniform float Contrast = 1.0; +uniform float Brightness = 1.0; +uniform float Hue = 0.0; + +vec3 rotateHue(vec3 color, float degrees) { + float angle = radians(degrees); + float cosAngle = cos(angle); + float sinAngle = sin(angle); + const vec3 axis = vec3(1.0 / sqrt(3.0)); + return color * cosAngle + cross(axis, color) * sinAngle + axis * dot(axis, color) * (1.0 - cosAngle); +} void main() { vec4 inTexel = texture(DiffuseSampler, texCoord); - vec3 luma = vec3(dot(inTexel.rgb, vec3(0.3, 0.59, 0.11))); - vec3 outColor = mix(luma, inTexel.rgb, Saturation); + vec3 outColor = inTexel.rgb * Brightness; + outColor = ((outColor - 0.5) * Contrast) + 0.5; + + vec3 luma = vec3(dot(outColor, vec3(0.3, 0.59, 0.11))); + outColor = mix(luma, outColor, Saturation); + + outColor = rotateHue(outColor, Hue); fragColor = vec4(outColor, inTexel.a); } diff --git a/src/main/resources/assets/minecraft/shaders/program/color_saturation.json b/src/main/resources/assets/minecraft/shaders/program/color_saturation.json index dffddaa..54a773e 100644 --- a/src/main/resources/assets/minecraft/shaders/program/color_saturation.json +++ b/src/main/resources/assets/minecraft/shaders/program/color_saturation.json @@ -14,6 +14,9 @@ { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, - { "name": "Saturation", "type": "float", "count": 1, "values": [ 1.0 ] } + { "name": "Saturation", "type": "float", "count": 1, "values": [ 1.0 ] }, + { "name": "Contrast", "type": "float", "count": 1, "values": [ 1.0 ] }, + { "name": "Brightness", "type": "float", "count": 1, "values": [ 1.0 ] }, + { "name": "Hue", "type": "float", "count": 1, "values": [ 0.0 ] } ] }