Skip to content

Commit b0723cb

Browse files
author
IMS212
committed
Merge branch '1.17' into 1.18
# Conflicts: # src/main/java/net/coderbot/iris/Iris.java # src/main/java/net/coderbot/iris/compat/sodium/SodiumVersionCheck.java
2 parents f0e95b2 + 812348d commit b0723cb

32 files changed

+901
-230
lines changed

docs/changelogs/1.1.3/full.md

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,4 @@
1-
# Iris 1.1.3 Preliminary Changelog (Full)
2-
3-
WIP, up-to-date as of:
4-
5-
- 1.16.x: https://github.com/IrisShaders/Iris/commit/91ac46ab59e67d8e77e416cc16429473c19f0a36
6-
- 1.17.x: https://github.com/IrisShaders/Iris/commit/65fc9ce3fd122bcf28400f1811b525240a4ca27d
7-
8-
---
1+
# Iris 1.1.3 Changelog (Full)
92

103
This release includes significant changes to the project organization of Iris, as well as fixes for some rendering bugs in the shader packs supported by Iris, especially when using manually-edited shader configuration.
114

docs/changelogs/1.1.3/summary.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
**note: Iris 1.1.3 is unreleased, this is just an in-progress summary / changelog**
2-
3-
---
4-
51
Iris version 1.1.3 for Minecraft 1.16.5 and Minecraft 1.17.1 has been released!
62

73
This release was jointly developed by coderbot, IMS, and Justsnoopy30, and also contains major contributions from Kroppeb and maximum#8760. It also contains many other smaller (but still important) contributions from many other people!

docs/changelogs/1.1.4/full.md

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,4 @@
1-
# Iris 1.1.4 Preliminary Changelog (Full)
2-
3-
WIP, up-to-date as of:
4-
5-
- 1.16.x: https://github.com/IrisShaders/Iris/commit/099883f70c5136646f98cd075caf0960e475692c
6-
- 1.17.x: https://github.com/IrisShaders/Iris/commit/42503308b214093cecae364dcaf5a7c6ed7e76c5
7-
- 1.18.x: https://github.com/IrisShaders/Iris/commit/b59d8c182d8edf2a8d68127c1835629d0843653f
8-
9-
---
1+
# Iris 1.1.4 Changelog (Full)
102

113
This release mainly focuses on bug fixes, and closes over 50 GitHub issues! It resolves a huge number of bugs, and the Iris experience with supported packs should be substantially improved as a result. Thanks to the many contributors that made this release possible!
124

docs/changelogs/1.1.4/summary.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
**note: Iris 1.1.4 is unreleased, this is just an in-progress summary / changelog**
2-
3-
---
4-
51
Iris version 1.1.4 for Minecraft 1.16.5, Minecraft 1.17.1, and Minecraft 1.18.1 has been released!
62

73
This release was jointly developed by coderbot and IMS, and also contains a number of contributions from maximum#8760 and Justsnoopy30. It also contains many other smaller (but still important) contributions from many other people!

docs/changelogs/1.1.5/summary.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
This is a small bug fix release to support Sodium 0.3.4 on 1.17 and Sodium 0.4.0 alpha 6 on 1.18, while we work on the 1.2.0 update to add shader settings, currently in public beta on our Discord!
2+
3+
⬇️ Download the release here: https://irisshaders.net/download.html

docs/changelogs/1.2.0/full.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Iris 1.2.0 Preliminary Changelog
2+
3+
**note: Iris 1.2.0 is unreleased, this is just an in-progress summary / changelog**
4+
5+
Iris 1.2.0 is here for Minecraft 1.16.5 / 1.17.1 / 1.18.1, bringing the long awaited Shader Configuration GUI!
6+
7+
The shader configuration system and GUI was a massive undertaking, with development of this iteration beginning in June 2021 with development of the previous iteration (as seen in Starline) having started in February 2021.
8+
9+
While shader config might seem like a simple enough request, the reality is that applying option changes while accounting for all the complexity and edge cases but also keeping shader pack loading extremely fast took a ton of work. An intuitive and functional GUI on top of that was also a ton of work. All in all, the following people directly contributed code to shader config:
10+
11+
- coderbot: Shader config backend (loading / applying config files)
12+
- FoundationGames: Shader configuration GUI (viewing / editing config files) + profile handling
13+
- IMS: Fixes and tweaks to both the backend and GUI as well as overseeing QA / testing
14+
- Justsnoopy30: Guidance based on experience with Starline, small fixes
15+
16+
## Other fixes
17+
18+
- Added support for the `prepare` pass (maximum#8760)
19+
- Use the correct encoding when loading `.properties` files (IMS)
20+
- Added some more hardcoded uniforms for Complementary while custom uniforms are still in development (IMS)
21+
- Added support for `shadowTerrain`, `shadowTranslucent`, `shadowEntities`, `shadowBlockEntities` in shaders.properties (IMS)
22+
- Added support for the `renderStage` uniform, allows SEUS PTGI HRR 3 to load (IMS)
23+
- HRR 3 is still not supported and has severe bugs on Iris.
24+
- Added support for the `blendFunc` uniform (IMS)
25+
- 1.18.1: Fix log spam related to `u_RegionOffset` (Justsnoopy30)
26+
27+
## Translations
28+
29+
- Updated pt_br.json by @ppblitto in #1202
30+
- Updated zh_tw.json by @HJ-zhtw in #1173
31+
- Updated zh_cn translations by @klkq in #1197
32+
- Updated it_it.json (13 January 2022) by @devpelux in #1191
33+
- Updated German translation by @Levelowel in #1179
34+
- Updated zh_tw.json by @HJ-zhtw in #1208

docs/changelogs/1.2.0/summary.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
**note: Iris 1.2.0 is unreleased, this is just an in-progress summary / changelog**
2+
3+
---
4+
5+
Iris 1.2.0 is here for Minecraft 1.16.5 / 1.17.1 / 1.18.1, bringing the long awaited Shader Configuration GUI! This release was jointly developed by coderbot, IMS, and FoundationGames, but also contains code contributions from Justsnoopy30 and maximum#8760.
6+
7+
The shader configuration system and GUI was a massive undertaking, with development of this iteration beginning in June 2021 with development of the previous iteration (as seen in Starline) having started in February 2021. Applying option changes while accounting for all the complexity and edge cases but also keeping shader pack loading extremely fast took a ton of work. An intuitive and functional GUI on top of that was also a ton of work.
8+
9+
But finally, it is ready for release! We've included some smaller issue fixes as well.
10+
11+
**⬇ Download the release here: https://irisshaders.net/download.html**
12+
13+
A more detailed changelog is available for those interested: <https://github.com/IrisShaders/Iris/blob/trunk/docs/changelogs/1.2.0/full.md>
14+

src/main/java/net/coderbot/iris/Iris.java

Lines changed: 69 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package net.coderbot.iris;
22

33
import java.io.IOException;
4+
import java.io.OutputStream;
45
import java.nio.file.FileSystem;
56
import java.nio.file.FileSystemNotFoundException;
67
import java.nio.file.FileSystems;
@@ -22,10 +23,14 @@
2223
import net.coderbot.iris.pipeline.*;
2324
import net.coderbot.iris.pipeline.newshader.NewWorldRenderingPipeline;
2425
import net.coderbot.iris.shaderpack.DimensionId;
26+
import net.coderbot.iris.shaderpack.OptionalBoolean;
2527
import net.coderbot.iris.shaderpack.ProgramSet;
2628
import net.coderbot.iris.shaderpack.ShaderPack;
29+
import net.coderbot.iris.shaderpack.option.OptionSet;
2730
import net.coderbot.iris.shaderpack.option.Profile;
2831
import net.coderbot.iris.shaderpack.discovery.ShaderpackDirectoryManager;
32+
import net.coderbot.iris.shaderpack.option.values.MutableOptionValues;
33+
import net.coderbot.iris.shaderpack.option.values.OptionValues;
2934
import net.fabricmc.loader.api.ModContainer;
3035
import net.irisshaders.iris.api.v0.IrisApi;
3136
import net.minecraft.ChatFormatting;
@@ -49,7 +54,6 @@
4954
public class Iris implements ClientModInitializer {
5055
public static final String MODID = "iris";
5156
public static final Logger logger = LogManager.getLogger(MODID);
52-
public static final String SODIUM_DOWNLOAD_LINK = "https://www.curseforge.com/minecraft/mc-mods/sodium/files/3542074";
5357

5458
private static Path shaderpacksDirectory;
5559
private static ShaderpackDirectoryManager shaderpacksDirectoryManager;
@@ -70,6 +74,9 @@ public class Iris implements ClientModInitializer {
7074
private static KeyMapping shaderpackScreenKeybind;
7175

7276
private static final Map<String, String> shaderPackOptionQueue = new HashMap<>();
77+
// Flag variable used when reloading
78+
// Used in favor of queueDefaultShaderPackOptionValues() for resetting as the
79+
// behavior is more concrete and therefore is more likely to repair a user's issues
7380
private static boolean resetShaderPackOptions = false;
7481

7582
private static String IRIS_VERSION;
@@ -278,7 +285,7 @@ private static boolean loadExternalShaderpack(String name) {
278285
return false;
279286
}
280287

281-
Map<String, String> changedConfigs = loadConfigProperties(shaderPackConfigTxt)
288+
Map<String, String> changedConfigs = tryReadConfigProperties(shaderPackConfigTxt)
282289
.map(properties -> (Map<String, String>) (Map) properties)
283290
.orElse(new HashMap<>());
284291

@@ -290,12 +297,17 @@ private static boolean loadExternalShaderpack(String name) {
290297
}
291298
resetShaderPackOptions = false;
292299

293-
Properties configsToSave = new Properties();
294-
configsToSave.putAll(changedConfigs);
295-
saveConfigProperties(shaderPackConfigTxt, configsToSave);
296-
297300
try {
298301
currentPack = new ShaderPack(shaderPackPath, changedConfigs);
302+
303+
MutableOptionValues changedConfigsValues = currentPack.getShaderPackOptions().getOptionValues().mutableCopy();
304+
305+
// Store changed values from those currently in use by the shader pack
306+
Properties configsToSave = new Properties();
307+
changedConfigsValues.getBooleanValues().forEach((k, v) -> configsToSave.setProperty(k, Boolean.toString(v)));
308+
changedConfigsValues.getStringValues().forEach(configsToSave::setProperty);
309+
310+
tryUpdateConfigPropertiesFile(shaderPackConfigTxt, configsToSave);
299311
} catch (Exception e) {
300312
logger.error("Failed to load the shaderpack \"{}\"!", name);
301313
logger.catching(e);
@@ -360,24 +372,37 @@ private static void setShadersDisabled() {
360372
logger.info("Shaders are disabled");
361373
}
362374

363-
private static Optional<Properties> loadConfigProperties(Path path) {
375+
private static Optional<Properties> tryReadConfigProperties(Path path) {
364376
Properties properties = new Properties();
365377

366-
try {
367-
// NB: config properties are specified to be encoded with ISO-8859-1 by OptiFine,
368-
// so we don't need to do the UTF-8 workaround here.
369-
properties.load(Files.newInputStream(path));
370-
} catch (IOException e) {
371-
// TODO: Better error handling
372-
return Optional.empty();
378+
if (Files.exists(path)) {
379+
try {
380+
// NB: config properties are specified to be encoded with ISO-8859-1 by OptiFine,
381+
// so we don't need to do the UTF-8 workaround here.
382+
properties.load(Files.newInputStream(path));
383+
} catch (IOException e) {
384+
// TODO: Better error handling
385+
return Optional.empty();
386+
}
373387
}
374388

375389
return Optional.of(properties);
376390
}
377391

378-
private static void saveConfigProperties(Path path, Properties properties) {
392+
private static void tryUpdateConfigPropertiesFile(Path path, Properties properties) {
379393
try {
380-
properties.store(Files.newOutputStream(path), null);
394+
if (properties.isEmpty()) {
395+
// Delete the file or don't create it if there are no changed configs
396+
if (Files.exists(path)) {
397+
Files.delete(path);
398+
}
399+
400+
return;
401+
}
402+
403+
try (OutputStream out = Files.newOutputStream(path)) {
404+
properties.store(out, null);
405+
}
381406
} catch (IOException e) {
382407
// TODO: Better error handling
383408
}
@@ -427,6 +452,34 @@ public static void queueShaderPackOptionsFromProfile(Profile profile) {
427452
getShaderPackOptionQueue().putAll(profile.optionValues);
428453
}
429454

455+
public static void queueShaderPackOptionsFromProperties(Properties properties) {
456+
queueDefaultShaderPackOptionValues();
457+
458+
properties.stringPropertyNames().forEach(key ->
459+
getShaderPackOptionQueue().put(key, properties.getProperty(key)));
460+
}
461+
462+
// Used in favor of resetShaderPackOptions as the aforementioned requires the pack to be reloaded
463+
public static void queueDefaultShaderPackOptionValues() {
464+
clearShaderPackOptionQueue();
465+
466+
getCurrentPack().ifPresent(pack -> {
467+
OptionSet options = pack.getShaderPackOptions().getOptionSet();
468+
OptionValues values = pack.getShaderPackOptions().getOptionValues();
469+
470+
options.getStringOptions().forEach((key, mOpt) -> {
471+
if (values.getStringValue(key).isPresent()) {
472+
getShaderPackOptionQueue().put(key, mOpt.getOption().getDefaultValue());
473+
}
474+
});
475+
options.getBooleanOptions().forEach((key, mOpt) -> {
476+
if (values.getBooleanValue(key) != OptionalBoolean.DEFAULT) {
477+
getShaderPackOptionQueue().put(key, Boolean.toString(mOpt.getOption().getDefaultValue()));
478+
}
479+
});
480+
});
481+
}
482+
430483
public static void clearShaderPackOptionQueue() {
431484
getShaderPackOptionQueue().clear();
432485
}

src/main/java/net/coderbot/iris/compat/sodium/AllowedSodiumVersion.java

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,24 @@
11
package net.coderbot.iris.compat.sodium;
22

3+
import java.util.Optional;
4+
35
public class AllowedSodiumVersion {
46
private final String version;
7+
private final String downloadLink;
58
private final boolean prefixMatch;
69

7-
public AllowedSodiumVersion(String version, boolean prefixMatch) {
10+
public AllowedSodiumVersion(String version, String downloadLink, boolean prefixMatch) {
811
this.version = version;
12+
this.downloadLink = downloadLink;
913
this.prefixMatch = prefixMatch;
1014
}
1115

1216
public static AllowedSodiumVersion prefix(String prefix) {
13-
return new AllowedSodiumVersion(prefix, true);
17+
return new AllowedSodiumVersion(prefix, null, true);
1418
}
1519

16-
public static AllowedSodiumVersion exact(String version) {
17-
return new AllowedSodiumVersion(version, false);
20+
public static AllowedSodiumVersion exact(String version, String downloadLink) {
21+
return new AllowedSodiumVersion(version, downloadLink, false);
1822
}
1923

2024
public boolean matches(String candidate) {
@@ -32,4 +36,8 @@ public String getVersion() {
3236
public boolean isPrefixMatch() {
3337
return prefixMatch;
3438
}
39+
40+
public Optional<String> getDownloadLink() {
41+
return Optional.ofNullable(downloadLink);
42+
}
3543
}

src/main/java/net/coderbot/iris/compat/sodium/SodiumVersionCheck.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,28 @@
22

33
import com.google.common.collect.ImmutableList;
44

5+
import java.util.Optional;
6+
57
public class SodiumVersionCheck {
68
// The allowed versions of Sodium for use with Iris
9+
//
10+
// Make sure to update the comments / download links when editing this!!!
11+
// If you forget to edit the download links you'll cause the support team a bunch
12+
// of pain. So don't forget!
713
private static final ImmutableList<AllowedSodiumVersion> ALLOWED_SODIUM_VERSIONS = ImmutableList.of(
814
// Official 0.3.4
9-
AllowedSodiumVersion.exact("0.4.0-alpha6+build.14"),
15+
AllowedSodiumVersion.exact("0.4.0-alpha6+build.14",
16+
"https://www.curseforge.com/minecraft/mc-mods/sodium/files/3605309"),
1017

1118
// For use by ReplayMod
1219
AllowedSodiumVersion.prefix("0.4.0-alpha6+replaymod")
1320
);
1421

22+
public static String getDownloadLink() {
23+
return ALLOWED_SODIUM_VERSIONS.stream().map(AllowedSodiumVersion::getDownloadLink)
24+
.filter(Optional::isPresent).findFirst().get().get();
25+
}
26+
1527
public static boolean isAllowedVersion(String sodiumVersion) {
1628
for (AllowedSodiumVersion allowed : ALLOWED_SODIUM_VERSIONS) {
1729
if (allowed.matches(sodiumVersion)) {

0 commit comments

Comments
 (0)