Uniform Additions and fixes (#1102)

This commit is contained in:
Jason Mitchell authored and GitHub committed 2025-11-07 14:39:10 -08:00
1 parent e6e230e270
commit 72ca675c93
22 files changed
+846 -156

No files matched your search

@@ -18,13 +18,17 @@ import net.coderbot.iris.gl.blending.BlendModeFunction;
import net.coderbot.iris.gl.blending.BlendModeOverride;
import net.coderbot.iris.gl.blending.BufferBlendInformation;
import net.coderbot.iris.gl.texture.TextureScaleOverride;
import net.coderbot.iris.pipeline.PatchedShaderPrinter;
import net.coderbot.iris.shaderpack.option.ShaderPackOptions;
import net.coderbot.iris.shaderpack.preprocessor.PropertiesPreprocessor;
import net.coderbot.iris.shaderpack.texture.TextureStage;
import net.coderbot.iris.uniforms.custom.CustomUniforms;
import net.minecraft.client.Minecraft;
import java.io.IOException;
import java.io.StringReader;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.EnumMap;
@@ -98,6 +102,15 @@ public class ShaderProperties {
public ShaderProperties(String contents, ShaderPackOptions shaderPackOptions, Iterable<StringPair> environmentDefines) {
final String preprocessedContents = PropertiesPreprocessor.preprocessSource(contents, shaderPackOptions, environmentDefines);
if (PatchedShaderPrinter.prettyPrintShaders) {
try {
Files.write(Minecraft.getMinecraft().mcDataDir.toPath().resolve("preprocessed.properties"), preprocessedContents.getBytes(StandardCharsets.UTF_8));
Files.write(Minecraft.getMinecraft().mcDataDir.toPath().resolve("original.properties"), contents.getBytes(StandardCharsets.UTF_8));
} catch (IOException e) {
throw new RuntimeException(e);
}
}
final Properties preprocessed = new OrderBackedProperties();
final Properties original = new OrderBackedProperties();
try {
@@ -181,7 +194,7 @@ public class ShaderProperties {
});
handlePassDirective("alphaTest.", key, value, pass -> {
if ("off".equals(value)) {
if ("off".equals(value) || "false".equals(value)) {
alphaTestOverrides.put(pass, AlphaTestOverride.OFF);
return;
}