Skip to content

Commit

Permalink
Merge branch 'trunk' into shader-config-ui
Browse files Browse the repository at this point in the history
  • Loading branch information
coderbot16 committed Jan 6, 2022
2 parents 874f371 + 8f0cb0e commit 8c2b701
Show file tree
Hide file tree
Showing 14 changed files with 155 additions and 81 deletions.
92 changes: 64 additions & 28 deletions docs/changelogs/1.1.4/full.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,52 +2,88 @@

WIP, up-to-date as of:

- 1.16.x: https://github.com/IrisShaders/Iris/commit/64359ef7fb1f367a29c9ca0a85885404cde80de7
- 1.17.x: https://github.com/IrisShaders/Iris/commit/315f3d8de32c970e2298a1c863192c67e5d80ce2
- 1.18.x: https://github.com/IrisShaders/Iris/commit/36be55d6cde8fdf1578c56ca146ed005e80bbd5b
- 1.16.x: https://github.com/IrisShaders/Iris/commit/099883f70c5136646f98cd075caf0960e475692c
- 1.17.x: https://github.com/IrisShaders/Iris/commit/42503308b214093cecae364dcaf5a7c6ed7e76c5
- 1.18.x: https://github.com/IrisShaders/Iris/commit/b59d8c182d8edf2a8d68127c1835629d0843653f

---

This release includes multiple bug fixes, as well as some internal features needed for existing packs to work better.
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!

## Major features/bug fixes on all versions
- Iris now binds to the correct buffer for render targets, fixing TAA on many packs/drivers.
- Iris now correctly shifts the cameraPosition and previousCameraPosition variables.
Shader configuration is also in the final testing & bug fixing phases, meaning that very soon official Iris releases will support modifying shaders through a GUI without the need for any 3rd-party forks or workarounds. Stay tuned for more updates on that!

## Major fixes

- Iris has much more robust handling of incompatible Sodium versions, ensuring that an intuitive error dialog is shown in all cases (coderbot, IMS).
- Previously, the mixins into Sodium classes were not disabled when an incompatible Sodium version was present
- In addition, some incompatible versions of Sodium passed the version check (notably, the 1.18+ dev builds), leading to confusing crashes.
- Iris no longer uses the extended vertex when shaders are disabled, avoiding performance loss with shaders disabled compared to base Sodium (IMS).
- Fixed TAA issues on many packs / drivers caused by internal confusion between GL_READ_BUFFER and GL_READ_FRAMEBUFFER (coderbot).
- Sildur's Vibrant Shaders now works great on Mesa drivers with Iris as a result, and Oceano now works on Iris without terrible vibrating as well.

## Other issue fixes on all versions

- Iris now correctly shifts the cameraPosition and previousCameraPosition variables to avoid precision issues.
- Previously, this was not the case, which caused issues at extreme distances from spawn on many packs.
- Iris now supports the rain.depth, vignette, and underwaterOverlay properties (credit to maximumpower55).
- `shaders.properties`: Iris now supports the `rain.depth`, `vignette`, and `underwaterOverlay` properties (credit to maximum#8760) as well as the `shadow.culling` and `particles.before.deferred` properties (IMS).
- Previously, Iris would ignore requests for these to be toggled.
- Iris now correctly disables blending in the shadow pass by default.
- Iris now correctly disables blending in the shadow pass by default (coderbot, IMS)
- Previously, this was not the case, causing weird issues with colored glass in the shadow pass on some packs.
- Iris now correctly supports the `RENDERTARGETS` directive.
- Iris now correctly supports the `RENDERTARGETS` directive used by more modern shader packs (credit to Justsnoopy30)
- Previously, Iris would ignore it, causing some packs to be broken/incorrect.
- Fixed a failure during shader pack loading if a custom texture mcmeta file didn't contain both `blur` and `clamp`, needed by packs like Spectrum (credit to Justsnoopy30)
- Iris now uses the correct pixel format on render targets, fixing a crash with packs like Wisdom Shaders. (Wisdom Shaders still does not work on Iris)
- Added initial support for image load/store for colorimg0 through colorimg15 (compared to only colorimg0 through colorimg5 on OptiFine) and shadowcolorimg0/1, [though memory barriers are currently unimplemented](https://github.com/IrisShaders/Iris/issues/1089) which could lead to inconsistent behavior (credit to BruceKnowsHow)
- Bumped the number of potential composite/deferred programs up to 99
- Added support for the `blendMode` uniform (IMS)
- Fixed some log spam during the preprocessing of .properties files (credit to Justsnoopy30)
- Fixed entity shadows not appearing on packs without shadowmap shadows (IMS)
- Fixed Max Shadow Distance resetting after each boot (NoComment1105)
- Work around a vanilla crash due to OptiFine setting maxFps to 0 in options.txt in some cases.

### Minor bug fixes

- Iris now uses the correct pixel format on render targets, fixing a crash with Wisdom Shaders. (Wisdom is still not officially supported)
- Iris no longer assumes a pipeline is non-null in many cases. (Fixes a crash trying to access HD Skins from the main menu)

## 1.18-specific fixes
## 1.16-specific fixes

- Iris now uses the correct getter method for render distance, fixing issues with fog/white blocks in the sky on multiplayer.
- Iris makes sure shaders.properties alpha test overrides are not themselves overridden on 1.16 (credit to maximum#8760).

## 1.17.1+ specific fixes
- Iris now can recreate vanilla shaders when a shader pack does not provide one to override.

- Fixed various world elements not rendering with packs like Enhanced Default, Waving Plants v3.5, Stereo's Default+, etc that do not override all shader programs (coderbot).
- Previously, Iris would skip the program, leading to issues with packs like Sildur's Enhanced Default not having block outlines due to a lack of gbuffers_basic.
- Iris now uses the correct vertex normals underwater.
- Iris now can recreate vanilla shaders when a shader pack does not provide one to override. It overrides shaders from vanilla / the resource pack to support things like exponential fog & avoid loading modified core shaders.
- Fixed broken underwater reflections on many packs (coderbot).
- Previously, Iris would use incorrect normals, causing weird symmetry in underwater reflections.
- Iris now supports fogDensity simulation on 1.17.
- Iris now supports exponential water fog on 1.17+ for shader packs, fixing some potential issues with vanilla+ shader packs (coderbot)
- Previously, fogDensity would always be 0, causing fog issues underwater on some packs.
- Iris no longer creates a `patched_shaders` folder in non-development environments.
- Iris no longer creates a `patched_shaders` folder in non-development environments (coderbot).
- Previously, this would take up unnecessary space, as well as causing errors if the folder was read only.
- Updated fog far plane code to match OptiFine (IMS)
- Iris now inserts Sodium imports in front of extension directives on 1.17 and higher, avoiding shader compile errors / crashes (IMS)

## 1.18-specific fixes

- Iris now uses the correct getter method for render distance, fixing issues with fog/white blocks in the sky on multiplayer (IMS).

## Mod Compatibility fixes

- Added a more robust initialization sequence to avoid weird crashes happening when Not Enough Crashes catches a crash by a different mod during initialization (coderbot)
- Fixed compatibility with Origins' night vision buff as well as similar night vision features in other mods (credit to Mourdraug).
- Fixed a crash trying to access HD Skins from the main menu that was caused by Iris assuming that entities could only be rendered while in a world (coderbot)
- Added an initial stable Iris API so that other mods can query some Iris state & open the Iris config GUI without making unsupported calls into internal Iris code (coderbot)
- Iris now uses RenderSystem/GlStateManager where possible in addition to putting other direct GL calls in IrisRenderSystem, hopefully helping with mods like Blaze4D that try to replace Minecraft's graphics library (IMS)

## Internals
## Notable internal changes / refactors

- Iris now silences JCPP preprocessing errors.
- Iris now has a more robust initialization, preventing some errors caused by mods interfering with loading.
- Iris now inserts Sodium imports in front of extension directives on 1.17 and higher.
- Iris now has a single patcher file, instead of multiple for composite and Sodium patching.
- Iris makes sure alpha test overrides are not themselves overriden.
- Iris now has a single patcher file, instead of multiple for composite and Sodium patching (IMS)
- Check for duplicated uniforms to prevent confusing internal errors (credit to maximum#8760).
- Made progress towards fixing the shaderpack test suite breaking due to direct / indirect MC references (coderbot)
- Fix syntax error in build.gradle (credit to douira)
- Added an automated release system (credit NoComment1105)

## Translations

- TODO
- Added Classical Chinese (lzh) translation (credit Hulkenius)
- Added Czech translation (credit Fjuro)
- Updated Chinese translation (credit klkq)
- Updated Taiwanese translation (credit HJ-zhtw)
- Updated Polish translation (credit SSajda)
- Fixed Korean translations using the wrong file (credit craftingmod)
21 changes: 13 additions & 8 deletions docs/changelogs/1.1.4/summary.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,27 @@

Iris version 1.1.4 for Minecraft 1.16.5, Minecraft 1.17.1, and Minecraft 1.18.1 has been released!

This release was jointly developed by coderbot and IMS, and also contains contributions from maximum#8760. It also contains many other smaller (but still important) contributions from many other people!
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!

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.

In other news, shader configuration is also in the final testing & bug fixing phases, meaning that very soon, official Iris releases will support modifying shaders through a GUI without the need for any 3rd-party forks or workarounds. Stay tuned for more updates on that!

**⬇ Download the release here: https://irisshaders.net/download.html**

Here's what's changed since 1.1.3:

- 📝 Iris can recreate vanilla shaders if a shader pack does not provide one on 1.17+
- 🖥️ Temporal Anti-aliasing (TAA) is now fixed on many shader packs/drivers
- 📝 1.17+: Fixed block outlines not rendering with Enhanced Default, the sky not rendering with Stereo's Default+, and many other related issues
- 📈 Fixed a performance drop with shaders disabled compared to base Sodium - Iris with shaders off should no longer measurably decrease performance
- 🖥️ Temporal Anti-aliasing (TAA) is now fixed on many shader packs / drivers - you can now use Sildur's Vibrant Shaders on Mesa drivers!
- 📷 Camera position values are properly shifted, fixing issues at extreme distances
- 🌊 Underwater reflections are fixed on many shader packs
- 📺 Vignette, rain depth, and the underwater overlay are now controlled by shader packs
- 🗣 A number of translations have been updated and tweaked
- 🩹 Patched a number of other minor bugs, crashes, and issues
- 📺 Vignette and the underwater overlay are able to be disabled by shader packs
- 🗣 A few translations have been updated and tweaked
- 🩹 Patched a huge number of other bugs, crashes, and issues

Known potential issues since 1.1.3:
Known potential issues:

❌ SEUS PTGI HRR Test 3 is currently incompatible.
- ❌ SEUS PTGI HRR Test 3 is currently incompatible (SEUS PTGI HRR 2.1 is still compatible).

A more detailed changelog is available for those interested: <https://github.com/IrisShaders/Iris/blob/trunk/docs/changelogs/1.1.4/full.md>
45 changes: 26 additions & 19 deletions docs/faq.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,47 @@
# FAQ

> Q. Why doesn't the Iris Installer work?
## Table of Contents

A. You need java, please get it from: [Adoptium.net](https://adoptium.net/?variant=openjdk17&jvmVariant=hotspot)
- Why doesn't the Iris Installer work?
- How can I configure my shaders?
- Why is (insert shader) not working?
- How do I disable my shaders?
- I added Iris, why is my game crashing?
- What shaders have been tested and are working with Iris?
- Will (insert feature) part of OptiFine be added to iris?

> Q. How can I configure my shaders?
## Why doesn't the Iris Installer work?

A. [#663](https://github.com/IrisShaders/Iris/issues/663)
You need java, please get it from: [Adoptium.net](https://adoptium.net/?variant=openjdk17&jvmVariant=hotspot)

> Q. Why is (insert shader) not working?
## How can I configure my shaders?

A. That shader likely isn't supported currently, but should be in the future. See the list of supported shaders [here](./supportedshaders.md)
[#663](https://github.com/IrisShaders/Iris/issues/663)

> Q. How do I disable my shaders?
## Why is (insert shader) not working?

A. Press K to disable shaders without using the GUI.
That shader likely isn't supported currently, but should be in the future. See the list of supported shaders [here](./supportedshaders.md)

> Q. I added Iris, why is my game crashing?
## How do I disable my shaders?

A. There are a few possible reasons:
Press K to disable shaders without using the GUI.

• You're using an outdated version of Indium, Sodium Extras or Better Sodium Menu.
## I added Iris, why is my game crashing?

• You're using an unsupported shader pack.
There are a few possible reasons:

• You're using macOS, which has limited support.
- You're using an outdated version of Indium, Sodium Extras or Better Sodium Menu.
- You're using an unsupported shader pack.
- You're using macOS, which has limited support.
- You may have an incompatible mod installed.

• You may have an incompatible mod installed.
## What shaders have been tested and are working with Iris?

> Q. What shaders have been tested and are working with Iris?
See [this](./supportedshaders.md) document for the list

A. See [this](./supportedshaders.md) document for the list
## Will (insert feature) part of OptiFine be added to iris?

> Q. Will (insert feature) part of OptiFine be added to iris?
A. Iris is specifically a shaders mod. Other features are not planned for Iris. However, many other wonderful mods have been made by the fabric modding community which cover many of the features of OptiFine.
Iris is specifically a shaders mod. Other features are not planned for Iris. However, many other wonderful mods have been made by the fabric modding community which cover many of the features of OptiFine.

The following is a short list, more alternatives can be found through further research, the list is alphabetical.

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ sodium_version=mc1.16.5-0.2.0
maven_group=net.coderbot.iris_mc1_16_5
archives_base_name=iris-mc1.16.5

mod_version=1.1.4-pre
mod_version=1.2.0-pre
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ public static boolean isShadowDistanceSliderEnabled() {
.orElse(true);
}

// TODO: Add a Sodium video settings button too.
public static final ProgressOption RENDER_DISTANCE = new ShadowDistanceOption("options.iris.shadowDistance", 0.0D, 32.0D, 1.0F, (gameOptions) -> {
return (double) getOverriddenShadowDistance(shadowDistance);
}, (gameOptions, viewDistance) -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,6 @@ public String toString() {
return "iris_wrapped:" + this.wrapped.toString();
}

public RenderStateShard getExtra() {
return extra;
}

private static boolean shouldSortOnUpload(RenderType type) {
return ((RenderTypeAccessor) type).shouldSortOnUpload();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet;
import net.coderbot.iris.Iris;
import net.coderbot.iris.layer.EntityColorRenderStateShard;
import net.coderbot.iris.layer.InnerWrappedRenderType;
import net.coderbot.iris.layer.IrisRenderTypeWrapper;
import net.coderbot.iris.mixin.rendertype.RenderStateShardAccessor;
Expand All @@ -14,26 +13,13 @@
import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.ModifyVariable;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

@Mixin(MultiBufferSource.BufferSource.class)
public class MixinBufferSource_WrapperChecking {
@Unique
private final Set<String> unwrapped = new ObjectOpenHashSet<>();

@ModifyVariable(method = "getBuffer", at = @At("HEAD"))
private RenderType unwrapBufferIfNeeded(RenderType renderType) {
// Ensure that entity color wrapped render layers do not take effect when entity batching is inoperable.
if (renderType instanceof InnerWrappedRenderType) {
if (((InnerWrappedRenderType) renderType).getExtra() instanceof EntityColorRenderStateShard) {
return ((InnerWrappedRenderType) renderType).unwrap();
}
}

return renderType;
}

@Inject(method = "endBatch(Lnet/minecraft/client/renderer/RenderType;)V", at = @At("HEAD"))
private void iris$beginDraw(RenderType renderType, CallbackInfo ci) {
if (!(renderType instanceof IrisRenderTypeWrapper) && !(renderType instanceof InnerWrappedRenderType)) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package net.coderbot.iris.mixin;

import com.mojang.blaze3d.vertex.PoseStack;
import net.coderbot.batchedentityrendering.impl.Groupable;
import net.coderbot.iris.Iris;
import net.coderbot.iris.layer.EntityColorRenderStateShard;
import net.coderbot.iris.layer.EntityColorMultiBufferSource;
Expand All @@ -21,6 +22,11 @@ public abstract class MixinLivingEntityRenderer {
private MultiBufferSource iris$wrapProvider(MultiBufferSource bufferSource, LivingEntity entity, float yaw,
float tickDelta, PoseStack pose, MultiBufferSource bufferSourceArg,
int light) {
if (!(bufferSource instanceof Groupable)) {
// Entity color is not supported in this context, no buffering available.
return bufferSource;
}

boolean hurt;
if (Iris.isPhysicsModInstalled()) {
hurt = entity.hurtTime > 0 && !entity.isDeadOrDying();
Expand Down
33 changes: 33 additions & 0 deletions src/main/java/net/coderbot/iris/mixin/MixinMaxFpsCrashFix.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package net.coderbot.iris.mixin;

import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
import org.spongepowered.asm.mixin.injection.Slice;

import net.minecraft.client.Options;

/**
* A workaround for when OptiFine has set the maxFps to zero in options.txt
*
* Fun.
*/
@Mixin(Options.class)
public abstract class MixinMaxFpsCrashFix {
@Redirect(
method = "load",
at = @At(value = "INVOKE", target = "Ljava/lang/Integer;parseInt(Ljava/lang/String;)I"),
slice = @Slice(from = @At(value = "CONSTANT", args = "stringValue=maxFps"), to = @At(value = "CONSTANT", args = "stringValue=difficulty")),
allow = 1
)
private int iris$resetFramerateLimit(String string) {
int original = Integer.parseInt(string);

if (original == 0) {
// Return the default value of framerateLimit
return 120;
}

return original;
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package net.coderbot.iris.mixin;

import com.mojang.blaze3d.vertex.PoseStack;
import net.coderbot.batchedentityrendering.impl.Groupable;
import net.coderbot.iris.layer.EntityColorRenderStateShard;
import net.coderbot.iris.layer.EntityColorMultiBufferSource;
import net.minecraft.client.renderer.MultiBufferSource;
Expand All @@ -16,6 +17,11 @@ public abstract class MixinTntMinecartRenderer {
private static MultiBufferSource iris$wrapProvider(MultiBufferSource bufferSource, BlockState blockState,
PoseStack poseStack, MultiBufferSource bufferSourceArg, int light,
boolean drawFlash) {
if (!(bufferSource instanceof Groupable)) {
// Entity color is not supported in this context, no buffering available.
return bufferSource;
}

if (drawFlash) {
EntityColorRenderStateShard phase = new EntityColorRenderStateShard(false, 1.0F);
return new EntityColorMultiBufferSource(bufferSource, phase);
Expand Down
Loading

0 comments on commit 8c2b701

Please sign in to comment.