Skip to content

Commit

Permalink
Merge branch 'trunk' into trunk-new-sodium-screen
Browse files Browse the repository at this point in the history
  • Loading branch information
IMS212 authored Aug 30, 2021
2 parents e3c4f33 + 5936784 commit f90401f
Show file tree
Hide file tree
Showing 38 changed files with 667 additions and 108 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Set up JDK 14
- name: Set up JDK 16
uses: actions/setup-java@v1
with:
java-version: 14
java-version: 16
- name: Cache Gradle packages
uses: actions/cache@v2
with:
Expand Down
41 changes: 22 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,42 +31,31 @@ These are the goals of Iris. Since Iris isn't yet complete, it hasn't fully achi
* **Agnostic of Minecraft versions.** This is more of a long-term goal, but if it is possible to make the majority of Iris version-independent, then porting to new versions should be straightforward and quick. This theoretically works in the other direction as well, though Iris for 1.8.9 (and similar old versions) isn't very practical currently since Sodium doesn't exist for these versions of the game.


## But where's the Forge version?

Iris doesn't support Forge. This is for a few reasons:

* Sodium, which Iris depends on to achieve its great performance, does not support Forge. It's a long story, but in short: the lead developers of Forge were incredibly hostile to JellySquid when she developed for Forge, and since then have made no credible attempts to repair relations or even admit wrongdoing.
* My time is limited, and properly supporting all of the mods available for Forge (as well as Forge itself) is a huge amount of work. I don't play with Forge on modern versions of the game, and Forge is a continually shrinking segment of the Minecraft community.
* The Forge toolchain isn't really designed to play nice with mods like Iris that need to make many patches to the game code. It's possible, but Fabric & Quilt are just *better* for mods like Iris. It's no coincidence that the emergence of Fabric and the initial emergence of OptiFine replacements happened at around the same time.


## What's the current state of development?

Iris has a public stable release for 1.16 that works with a custom version of Sodium, and a public beta release for 1.17 that currently does not work with Sodium (currently, there is no official version of Sodium for 1.17). Iris is still in heavy development and gets new improvements every week, and is progressing very rapidly!
Iris has public releases for 1.16 and 1.17 that work with custom versions of Sodium. Iris has made a lot of progress, but it is still not complete software. Though it is already usable for many people, and generally provides a big performance boost over alternatives, there is still much to be done before Iris can be a complete replacement for OptiFine's shaders features. As Iris continues its development, it will only become more and more complete with time.

Compatibility with Sodium is an ongoing project. I've been chatting with JellySquid over the course of many months regarding compatibility, and many refactors and improvements have been implemented into Sodium in order to better accomondate Iris. Though a [fork of Sodium](https://github.com/IrisShaders/sodium-fabric) is still required, it's my intent that it will be unnecessary in the future. Official downloads of Iris include this modified version of Sodium for performance.
Compatibility with Sodium is an ongoing project. I've been chatting with JellySquid over the course of many months regarding compatibility, and many refactors and improvements have been implemented into Sodium in order to better accommodate Iris. Though a [fork of Sodium](https://github.com/IrisShaders/sodium-fabric) is still required, it's my intent that it will be unnecessary in the future. Official downloads of Iris include this modified version of Sodium for performance.


## What shader packs can I use right now?

Iris has been progressing quite rapidly recently. The following shader packs mostly work, though with a few bugs of course:
The following shader packs mostly work, though with a few bugs of course:

* [XorDev's shaderpacks](https://github.com/XorDev/Minecraft-Shaderpacks)
* [Sildur's Vibrant Shaders](https://sildurs-shaders.github.io/)
* [Sildur's Enhanced Default](https://sildurs-shaders.github.io/)
* Enchantment glints are broken
* [Complementary Shaders](https://www.curseforge.com/minecraft/customization/complementary-shaders)
* [BSL Shaders](https://www.bitslablab.com/bslshaders/)
* [AstraLex Shaders](https://www.curseforge.com/minecraft/customization/astralex-shader-bsl-edit)
* Water looks weird in general, though reflections do work. Weather doesn't work, rain does not show up and the sky does not darken.
* [Sildur's Enhanced Default](https://sildurs-shaders.github.io/)
* Enchantment glints are broken
* [SEUS Renewed](https://sonicether.com/shaders/download/renewed-v1-0-1/)
* Note that SEUS Renewed does not work on some platforms and might fail to compile.
* [SEUS v11](https://sonicether.com/shaders/download/v11-0/) (from 2016, not to be confused with SEUS PTGI E11)
* General issues with weather
* Note that SEUS v11 does not work on some platforms and might fail to compile.
* [SEUS Renewed](https://sonicether.com/shaders/download/renewed-v1-0-1/)
* Note that SEUS Renewed does not work on some platforms and might fail to compile.
* [Skylec Shader](https://www.curseforge.com/minecraft/customization/skylec-shader) - a very lightweight shaderpack that pulls off some neat effects
* Underwater is broken
* Weather is broken
* [XorDev's shaderpacks](https://github.com/XorDev/Minecraft-Shaderpacks)

Other shaderpacks aren't officially supported currently.

Expand All @@ -77,6 +66,20 @@ Other shaderpacks aren't officially supported currently.
* Code review on open PRs is appreciated! This helps get important issues with PRs resolved before I give them a look.
* Code contributions through PRs are also welcome! If you're working on a large / significant feature it's usually a good idea to talk about your plans beforehand, to make sure that work isn't wasted.


## But where's the Forge version?

Iris doesn't support Forge. This is for a few reasons:

* My time is limited, and properly supporting all the mods available for Forge (as well as Forge itself) is a huge amount of work. When people ask for Forge support, they aren't asking just for Iris to run on Forge, they are also asking for it to be compatible out of the box with their kitchen sink modpack that contains over 300 mods. As a result, properly supporting Forge would require me to divert large amounts precious time into fixing tedious compatibility issues and bugs, time that could instead be spent making the Fabric version of Iris better.
* The Forge toolchain isn't really designed to play nice with mods like Iris that need to make many patches to the game code. It's possible, but Fabric & Quilt are just *better* for mods like Iris. It's no coincidence that the emergence of Fabric and the initial emergence of OptiFine replacements happened at around the same time.
* Sodium, which Iris depends on to achieve its great performance, has no official Forge version. It's a long story, but in short: the lead developers of Forge were incredibly hostile to JellySquid when she developed for Forge, and since then have made no credible attempts to repair relations or even admit wrongdoing.

The license of Iris does permit others to legally port Iris to Forge, and we are not strictly opposed to the existence of an Iris Forge port created by others. However, what we are opposed to is someone doing a bare-minimum port of Iris to Forge, releasing it to the public, and then abandoning it or poorly maintaining it while compatibility issues and bug reports accumulate. When that happens, not only does that hurt the reputation of Iris, but we also ultimately get flooded by users wanting support with a low-effort Forge port that we didn't even make.

So, if you want to distribute a Forge port of Iris, we'd prefer if you let us know. Please don't just name your port "Iris Forge," "Iris for Forge," or "Iris Forge Port" either. Be original, and don't just hijack our name, unless we've given you permission to use one of those kinds of names. If a well-qualified group of people willing to maintain a Forge port of Iris does appear, then a name like "Iris Forge" might be appropriate - otherwise, it probably isn't appropriate.


## Credits

* **TheOnlyThing and Vaerian**, for creating the excellent logo
Expand Down
26 changes: 26 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,36 @@ tasks.withType(JavaCompile).configureEach {
}

sourceSets {
// "header" API stubs for implementing APIs from other mods
// These are not compiled into the resulting JAR file or loaded at runtime,
// they are for compilation purposes only.
//
// Proper implementations of these classes *might* be available at runtime,
// but that is not guaranteed. Generally, we must detect whether they are
// available through mod loading checks (or if a corresponding entrypoint is
// called by Fabric Loader / Quilt Loader / etc).
headers {
java {
compileClasspath += main.compileClasspath
}
}

// "vendored" libraries copied and repackaged into the Iris source tree
// These are compiled into the resulting JAR file and are available
// at runtime.
vendored {
java {
compileClasspath += main.compileClasspath
}
}

// The main source code of Iris.
main {
java {
// headers / API stubs are only available at compilation time.
compileClasspath += headers.output

// Vendored sources are available at compilation time and runtime.
compileClasspath += vendored.output
runtimeClasspath += vendored.output
}
Expand All @@ -92,6 +114,10 @@ jar {
rename { "${it}_${project.archivesBaseName}"}
}

// NB: headers / API stubs are not included in the resulting JAR file.
// We don't have a "from sourceSets.headers.output" here as a result.

// Vendored sources are included in the resulting JAR file.
from sourceSets.vendored.output
}

Expand Down
20 changes: 20 additions & 0 deletions docs/ShaderpackBugs.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,23 @@ This file tracks some bugs in shader packs that might appear to be Iris issues,
from block entities, the block breaking animation is written to the terrain render target instead of being blended
with the block entity.
* Workaround: unknown.

## Chocapic v4

* Random flashing holes in the terrain
* Diagnosis: Some waving parameters are left uninitialized instead of being initialized to zero, causing some
non-waving blocks to get undefined vertex positions. This appears to be caused by a failed attempt to initialize
all parameters to zero using only a single assignment.
* Workaround: Apply the following diff:
```diff
- float parm0,parm1,parm2,parm3,parm4,parm5 = 0.0;
+ float parm0 = 0.0,parm1 = 0.0,parm2 = 0.0,parm3 = 0.0,parm4 = 0.0,parm5 = 0.0;
```
* Shadows don't work
* Diagnosis: Table 3.20 in section 3.9.2 of the OpenGL 3.3 Core Profile specification states clearly that when
the base internal format of a texture is RED / DEPTH_COMPONENT, which is true in the case of a shadow texture,
then the Y/G and Z/B components of the output of a sampler function are 0.0. However, Chocapic v4 accesses the
Z/B component to get the depth value. While this may have worked on older drivers, it no longer appears to work
on modern drivers.
* Workaround: Replace all occurrences of expressions along the lines of `texture2D(shadow, ...).z` with
`texture2D(shadow, ...).r`
Binary file modified docs/iris-logo-transparent.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* MIT License
*
* Copyright (c) 2018-2020 Prospector
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

package com.terraformersmc.modmenu.api;

import net.minecraft.client.gui.screen.Screen;

@FunctionalInterface
@SuppressWarnings("deprecation")
public interface ConfigScreenFactory<S extends Screen> extends io.github.prospector.modmenu.api.ConfigScreenFactory<S> {
S create(Screen parent);
}
81 changes: 81 additions & 0 deletions src/headers/java/com/terraformersmc/modmenu/api/ModMenuApi.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
/*
* MIT License
*
* Copyright (c) 2018-2020 Prospector
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

package com.terraformersmc.modmenu.api;

import com.terraformersmc.modmenu.util.ModMenuApiMarker;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.text.Text;

import java.util.Map;

public interface ModMenuApi extends ModMenuApiMarker {
/**
* Used for creating a {@link Screen} instance of the Mod Menu
* "Mods" screen
*
* @param previous The screen before opening
* @return A "Mods" Screen
*/
static Screen createModsScreen(Screen previous) {
throw new AssertionError("Attempt to call API header stub method");
}

/**
* Used for creating a {@link Text} just like what would appear
* on a Mod Menu Mods button
*
* @return The text that would be displayed on a Mods button
*/
static Text createModsButtonText() {
throw new AssertionError("Attempt to call API header stub method");
}

/**
* Used to construct a new config screen instance when your mod's
* configuration button is selected on the mod menu screen. The
* screen instance parameter is the active mod menu screen.
*
* @return A factory for constructing config screen instances.
*/
default ConfigScreenFactory<?> getModConfigScreenFactory() {
throw new AssertionError("Attempt to call API header stub method");
}

/**
* Used to provide config screen factories for other mods. This takes second
* priority to a mod's own config screen factory provider. For example, if
* mod `xyz` supplies a config screen factory, mod `abc` providing a config
* screen to `xyz` will be pointless, as the one provided by `xyz` will be
* used.
* <p>
* This method is NOT meant to be used to add a config screen factory to
* your own mod.
*
* @return a map of mod ids to screen factories.
*/
default Map<String, ConfigScreenFactory<?>> getProvidedConfigScreenFactories() {
throw new AssertionError("Attempt to call API header stub method");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* MIT License
*
* Copyright (c) 2018-2020 Prospector
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

package com.terraformersmc.modmenu.util;

public interface ModMenuApiMarker {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* MIT License
*
* Copyright (c) 2018-2020 Prospector
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

package io.github.prospector.modmenu.api;

import net.minecraft.client.gui.screen.Screen;

/**
* Deprecated interface, switch to {@link com.terraformersmc.modmenu.api.ModMenuApi} and {@link com.terraformersmc.modmenu.api.ConfigScreenFactory} instead
*
* Will be removed in 1.18 snapshots
*/
@Deprecated
@FunctionalInterface
public interface ConfigScreenFactory<S extends Screen> {
S create(Screen parent);
}
Loading

0 comments on commit f90401f

Please sign in to comment.