GithubHelp home page GithubHelp logo

irisshaders / iris Goto Github PK

View Code? Open in Web Editor NEW
3.1K 51.0 584.0 54.56 MB

A modern shaders mod for Minecraft compatible with existing OptiFine shader packs

Home Page: https://irisshaders.dev

License: GNU Lesser General Public License v3.0

Java 99.63% GLSL 0.12% Shell 0.25%
hacktoberfest minecraft opengl shaders

iris's Introduction

Iris: An open-source shaders mod compatible with OptiFine shaderpacks

Iris

Links

  • Visit our website for downloads and pretty screenshots!
  • Visit our Discord server to chat about the mod and get support! It's also a great place to get development updates right as they're happening.
  • Visit the developer documentation for information on developing, building, and contributing to Iris!

FAQ

  • Find answers to frequently asked questions on our FAQ page.
  • Iris supports almost all shaderpacks, but a list of unsupported shaderpacks is available here.
  • A list of unfixable limitations in Iris is available here.

Why did you make Iris?

Iris was created to fill a void that I saw in the Minecraft customization and graphical enhancement community: the lack of an open-source shaders mod that would let me load my favorite shader packs on modern versions of the game, while retaining performance and compatibility with modpacks. OptiFine, the current dominant mod for loading shader packs, has restrictive licensing that firmly stands in the way of any sort of tinkering, and is fairly notorious for having compatibility issues with the mods that I like. It's also mutually incompatible with Sodium, the best rendering optimization mod in existence by a large margin. ShadersMod was never updated past 1.12, and it lacks support for many of the many modern popular shaderpacks. So I created Iris, to try and solve these issues, and also address many other longstanding issues with shader packs.

I first and foremost develop Iris to meet my own needs of a performance-oriented shaders mod with good compatibility and potential for tinkering. Iris when paired with Sodium delivers great performance on my machine, finally making it fully possible for me to actually play with shaders instead of just periodically switching them on to take pretty screenshots, then switching them off once I get tired of frame drops. Of course, as it turns out, I'm far from the only person who benefits from the development of Iris, which is why I've decided to release it to the public as an open-source mod.

Canvas is another shaders mod that has already gained some traction. Its big downside for me, however, is the fact that it doesn't support the existing popular OptiFine shaderpacks that I want to use. This is because it uses a new format for shader packs that isn't compatible with the existing format, in order to achieve many of its goals for better mod integration with shaders. And while Canvas now has a few nice shaders like Lumi Lights, I still want to have the option of using existing shader packs that were designed for OptiFine. Shader packs just aren't interchangeable, just like how you cannot hand a copy of The Last Supper to someone who wants a copy of the Mona Lisa. They're both great pieces of art, but you absolutely cannot just swap one out for the other. That being said, if you're a fan of the shader packs available for Canvas, then great! Canvas and Iris are both perfectly fine ways to enjoy shaders with Minecraft.

Goals

These are the goals of Iris. Iris hasn't fully achieved all these goals, however we are getting close.

  • Performance. Iris should fully utilize your graphics card when paired with optimization mods like Sodium.
  • Correctness. Iris should try to be as issueless as possible in its implementation.
  • Mod compatibility. Iris should make a best effort to be compatible with modded environments.
  • Backwards compatibility. All existing ShadersMod / OptiFine shader packs should just work on Iris, without any modifications required.
  • Features for shader pack developers. Once Iris has full support for existing features of the shader pipeline and is reasonably bug free, I wish to expand the horizons of what's possible to do with Minecraft shader packs through the addition of new features to the shader pipeline. Unlimited color buffers, direct voxel data access, and fancy debug HUDs are some examples of features that I'd like to add in the future.
  • A well-organized codebase. I'd like for working with Iris code to be a pleasant experience overall.

What's the current state of development?

Iris has public releases for 1.18.2, 1.19.2, 1.19.3, and 1.19.4 that work with the official releases of Sodium. Iris is generally usable on most shader packs, and most shader packs are being designed with Iris support in mind.

However, Iris is still not complete software. Performance can be improved, and more features are being added for shader developers. There are also some minor missing features from OptiFine that make the implementation incomplete.

How can I help?

  • The Iris Discord server is looking for people willing to provide support and moderate the server! Go to #applications on our server if you'd like to apply.
  • 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 of 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.

Some users have already ported Iris to Forge, however these ports generally come with mod compatibility issues and outdated updates. 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
  • Mumfrey, for creating the Mixin bytecode patching system used by Iris and Sodium internally
  • The Fabric and Quilt projects, for enabling the existence of mods like Iris that make many patches to the game
  • JellySquid, for creating Sodium, the best rendering optimization mod for Minecraft that currently exists, and for making it open-source
  • All past, present, and future contributors to Iris, for helping the project move along
  • Dr. Rubisco, for maintaining the website
  • The Iris support and moderation team, for handling user support requests and allowing me to focus on developing Iris
  • daxnitro, karyonix, and sp614x, for creating and maintaining the current shaders mods

License

All code in this (Iris) repository is completely free and open source, and you are free to read, distribute, and modify the code as long as you abide by the (fairly reasonable) terms of the GNU LGPLv3 license.

Dependencies may not be under an applicable license: See the Incompatible Dependencies page for more information.

You are not allowed to redistribute Iris commerically or behind a paywall, unless you get a commercial license for GLSL Transformer. See above for more information.

Though it's not legally required, I'd appreciate it if you could ask before hosting your own public downloads for compiled versions of Iris. Though if you want to add the mod to a site like MCBBS, that's fine, no need to ask me.

iris's People

Contributors

altegar avatar altrisi avatar backryun avatar basciotoja avatar coderbot16 avatar coldice1605 avatar craftingmod avatar crsuh2er0 avatar dexman545 avatar disguys avatar douira avatar felix14-v2 avatar foundationgames avatar godgun968 avatar hj-zhtw avatar ims212 avatar isuewo avatar justsnoopy30 avatar klkq avatar kroppeb avatar lolothepro avatar madis0 avatar maximumpower55 avatar nocomment1105 avatar overlordsiii avatar pajicadvance avatar parzivail avatar peppercode1 avatar qouteall avatar thedocruby avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

iris's Issues

How to build?

Hi! I'm looking to build this project, but I don't quite get it.

When I run gradlew build, I get this error :

FAILURE: Build failed with an exception.

  • What went wrong:
    Could not initialize class org.codehaus.groovy.runtime.InvokerHelper

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 809ms

Parse `const`-style directives from shader source files properly

OptiFine/ShadersMod both allow shaderpacks to supply directives and configuration by declaring constants in the shader files. Here is an example: https://github.com/sp614x/optifine/blob/master/OptiFineDoc/doc/shaders.txt#L388

const float shadowDistance = 160.0f;

ShadersMod uses the following logic to locate that directive on each line:

  1. Match any number of space/tab characters (including zero)
  2. A const literal
  3. Match any number of space/tab characters (including zero)
  4. A float literal
    • Naturally this will differ for directives of different types - it could be bool, int, vec4, etc.
  5. Match any number of space/tab characters (including zero)
  6. A literal containing the name of the directive, in this case shadowDistance
    • Again, this will differ for each directive
  7. Match any number of space/tab characters (including zero)
  8. A literal = character
  9. Match any number of space/tab characters (including zero)
  10. Optionally match a negative sign (-), since these values can be negative
  11. Any digit or . character. There must be at least one digit for the directive to be valid.
    • Technically ShadersMod will match const float shadowDistance = .; as well but obviously that isn't valid. It's okay for Iris to ignore that case.
  12. Optionally match a float type suffix (f), for example the f in 160.0f
    • Naturally this will differ for directives of different types.
  13. A literal ; character
  14. Any character (ShadersMod doesn't care about anything that comes after the semicolon)

Of course, the above logic is tailored to float values. Boolean, integer, vec4, and other types directives will need slightly different logic.

The above logic could be implemented as a regular expression, however it is also possible to implement it without regex. It's possible that an implementation that doesn't use regex could be more readable and understandable.

Add a donation link

You could create a discord server and a link to donate to support the project
this would be great
I know this isn't really an issue but I didn't know where to post it

[Slidur's] World goes black when looking straight up

When I face directly upwards, all blocks become black. The sky is not affected.
It happens with all the Slidur's packs except Enhanced Default. It does not happen with (internal)
shaders.

Examples:
image image

image image

image
When my vertical angle is between -89.0 and -89.9, the world flickers when I look around.
It is completely black when I am facing directly upwards at -90.0.

Item rendering | Folder structure | Crash

Hey, there,
I just discovered this project via this gist, and I have to say, I am very happy, that somebody is working on an alternative to Optifine.
Firstly, I just started up my client, and my first question is: How and do I have to put the shaders in a folder? Just extract the shader zip or copy the "shaders" folder out?
Next: Items/Player(s) aren't rendered correctly. The Player's hand is invisible, the Player iself and many items are kinda seethrough.

Screenshot_20210106_214247
Screenshot_20210106_214304
Screenshot_20210106_214621

The red screenshot is from the Limbo (to demonstrate the translucency), don't ask me why.
The few seconds, it actually worked, I tried to use the Complementary shaders. - More or less as a joke.
After this I always get this fancy crash here: log.txt so I couldn't test any other shaders...

Thanks for this project!

With "Iris" mod i can't see the mob hurt red color

In a regular game, if i hit the mob it will turn red for a second, but with Iris (im running ./gradlew runclient) they don't turn red! This isn't a big issue, but still feels uncomfortable. This issue is happening with any shaderpack, even with (internal).
Can't record a video, but here is a screenshot =))))
2021-01-04_21 47 02

Shadow map rendering

Most shaderpacks require shadow mapping, but Iris doesn't support it. This should be implemented at some point.

Add a GPU-side profiler

The vanilla CPU profiler doesn't tell the whole story. Especially in GPU-bound situations, it can be hard to tell how much time the GPU is spending on everything.

This is possible on OpenGL 2 and above using Query Objects.

Sildur's TAA is completely broken on Iris

TAA disabled:

TAA disabled

TAA enabled:

TAA enabled

Disabling TAA within composite2.fsh alone (and leaving it enabled for all other shaders) fixes the issue, so the problem likely lies somewhere in there.

Iris disables the vanilla water overlay

From #42:

BTW, talking about fluids, Iris internal currently removes the vanilla effect of being submerged in fluids, not sure if that's known (although according to the debugger, that applyFog function is still called).

Correctly handle entries in block.properties involving blockstates

OptiFine supports block states (instead of just blocks) in block.properties, we should too. This causes a lot of logspam with Sildur's and similar packs otherwise.

It's not 100% clear how to make this work seamlessly, consider the following examples:

block.0 = minecraft:stone_slab[half=top]
block.1 = minecraft:stone_slab[half=bottom]
block.0 = minecraft:stone_slab

We'll need to support both cases, because sometimes shaderpacks choose to differentiate based on state and sometimes they do not depending on the given block.

Possibly add tests

We've already have had multiple bugs pop up. Maybe its a good idea to have tests.

Shadow mapping is not supported

Many shaderpacks require this to work properly. They'll run without it, but things won't look right.

  • Ability to orient the camera to point at the player from the current shadow light position
  • Configuring the projection matrix as required by the shaderpack
    • Orthographic projections (SHADOWHPL), used by most shaderpacks
    • Perspective projections (SHADOWFOV), legacy
  • Rendering the world (or parts of it) twice per frame: once for shadows, once normally
    • Ensure that this is implemented in a way that doesn't trip up other mods
    • Open question: should the events in WorldRenderEvents be fired for both the shadowmap rendering and standard world rendering, or only standard world rendering?
      • Canvas does not fire special world events when rendering shadows. This seems like sane behavior to replicate.
    • An initial implementation could focus only on rendering terrain and perhaps the player entity, since those are the most important things for shadows.
  • Render to special shadow render targets and then make the render target content available to other shaders
  • Decent shadow culling
    • I discussed shadow culling with Grondag a while back. Essentially, the only chunks that should be considered for shadow rendering are chunks that are (a) directly visible to the player or (b) potentially occluding (ie, casting shadows on) chunks directly visible to the player from the perspective of the sun / moon
    • Based on the absolutely abysmal performance of shadow rendering with most shaderpacks on OptiFine (some shaderpacks spend 50% of the CPU time on shadow rendering, and probably a bit of GPU time too!), I'm going to guess that it just flat out does not cull anything during shadow rendering. This is likely to solve the "why is the mountain behind me not casting a shadow" problem, but it results in very poor performance.

Compatibility issue with Voxelmap

Waypoint indicators render as a regular square when using Sodium and Iris together. I need to see if this can be reproduced without Sodium. I'm guessing that since we revert back to gbuffers_basic for unknown content, that is what is causing the issue.

New and "Easy" Uniforms

uniform float viewWidth; viewWidth
uniform float viewHeight; viewHeight
uniform float near; near viewing plane distance
uniform float far; far viewing plane distance
These uniforms should be easy to add and many basic shaders use them for DOF and other effects.

blockEntityId and entityId uniforms are almost certainly broken

Minecraft renders block entities and regular entities substantially differently in 1.15+ compared to previous versions. As such, it's much harder to track exactly what entity is currently being rendered, since entities are often drawn to the screen whenever a different entity starts being rendered.

The reason for this is how VertexConsumerProvider.Immediate works: with the exception of a few special render layers, whenever entity render layers are switched the content of the previous layer is immediately drawn to the screen.

It's unclear whether uniforms even work here anymore. Maybe attributes will need to be used? That would require some pretty hacky code changes to shaders however.

Tracking issue for sodium compatibility

Known issues:

  • Can't reload terrain / water shaders (it says successful, but the terrain shaders in use aren't changed)
  • Fog culling should be disabled for now because many shaders don't use fog, or use custom behavior
  • Translucent blocks render incorrectly (all bunched up) with AMD on Windows with some shader packs
    • This appears to be an issue with the Sildur's gbuffers_water in particular - if you delete gbuffers_water the water no longer gets bunched up but obviously it looks wrong in different ways because it's the wrong program
  • ftransform() is not properly replaced

Bugs with internal shaders

  • Clouds are black
  • No block outline
  • Entities don't turn red when you punch them
  • The sun / moon show up behind the skybox

Various issues with vanilla vertex normal calculations

Minecraft already calculates vertex normals for most geometry, but the vertex normals it calculates have some issues:

  • Diagonal block models (such as tall grass) don't have properly rotated vertex normals
  • Fluids (water and lava) have incorrect vertex normals, they always point up even for side and bottom faces
  • Entity and BlockEntity vertex normals change as the camera rotates - camera rotation should not be considered in vertex normal calculation

For finding these issues, the following shader files are useful:

gbuffers_textured.vsh:

#version 120

varying vec4 color;

void main() {
    gl_Position = gl_ProjectionMatrix * gl_ModelViewMatrix * gl_Vertex;

    color = (vec4(gl_Normal, 1.0) + vec4(1.0, 1.0, 1.0, 1.0)) / 2.0;
}

gbuffers_textured.fsh:

#version 120

varying vec4 color;

void main() {
    gl_FragColor = color;
}

Spider eyes don't render quite right on Sildur's Vibrant Shaders

On trunk they don't use the right render layer, and on my local testing branch making spider eyes render properly causes the rest of the spider to turn black.

This appears to result from the fact that the spider eyes renderer actually renders the whole spider model, but normally only the eyes part should show up.

This might be related to issues with transparency in general that I've noticed with faraway leaves as well.

Iris+sodium on AMD = that...

2021-01-08_20 42 11
I understand that mod doesn't support sodium now, but i've seen ppl using it with sodium and having almost 0 problems =)

Lack Of Shadow Mapping Support

When using any shader pack, lighting will refuse to work correctly and will only show as vanilla lighting. I've tried all of sildurs shader packs yet none of them will work right.

I have yet to find out why, but I think it might be because of my NVIDIA card...? As looking at other issues I see people using AMD cards/apus with no problems.

Java 15
Using Minecraft 1.16.4
Fabric Loader 0.11.1
There are no other mods installed other than Iris

Also the multimc logs show a lot of errors: https://pastebin.com/RzQat5BN

I got deceived by a screenshot taken at sunset which made it look the lighting was working perfectly fine for someone else. Man im a little stupid sometimes. The real reason was because of the lack of shadow mapping support.

Screenshots of lite and high:
2021-01-18_22 20 03
2021-01-18_22 34 29

EXCEPTION_ACCESS_VIOLATION (0xc0000005) Crash

I know this isn't fully about Iris, but I hope you guys could tell me I should do in this situation. I pasted the issue I posted on the MultiMC Github here:

System Information

MultiMC version:
0.6.11-1430 on win 32 - MultiMC 5

Operating System:
Windows 10

Summary of the issue or suggestion:
MC Launches, Loads, and then right before the title screen fully shows it crashes

What should happen:
Obviously MC shouldn't crash

Steps to reproduce the issue (Add more if needed):

  1. Launch Minecraft

Suspected cause:
Iris or Sodium, but IDK (I know that it's not now, this is just the copied issue)

Logs/Screenshots:
Log
[Screeenshot](img.justpaste.me/i/20210107/kxV1z/Screenshot 2021-01-07 080827.jpg)

Now I know it's about AMD and atio6axx.dll or whatever, I just want to know what to do right now. Please help me if you can.

Possible integration with my mod, proper implementation for mc_Entity attribute?

Hello there, first off, thanks for that great project, this might be exactly what I'm looking for!

I'd like to base my own WIP project, LightOverhaul, on your shader implementation, since I need shaders as well. In a nutshell, I'm working on colored lighting (that, unlike Albedo and others doesn't bleed through walls). One part is the lighting engine reworks which is part of my mod, the other part is a shaderpack that takes advantage of that color information.
Currently I'm working on a hacked version of Optifine, but for various reasons I'm not too happy with that...

For my mod to work, I need to add two attributes for each block - skylightRGB and blocklightRGB. Since I don't know too much about the shader pipeline, it would be very useful for me to see how mc_Entity is implemented. Then I could (hopefully) work in the two custom attributes for my mod as well.

First Question, would be willing to implement mc_Entity so I could base my work on that? That would be very much appreciated!
And second question, would you be willing to accept a pull request for those two custom attributes once I got my mod and API finished?

Make a progress tracking issue

It would probably be helpful for developers trying to contribute to have a "checklist" issue with a list of things that are needed to be implemented and the ones that already are. That would allow them to know what to work on without having to look through the entire source to find those spots, or to see things needed in case they don't know what actually needs to be implemented.

Another option would be making an issue for each feature and then adding those to a Project, which could even be organized in categories like To do, In progress or Done. Projects can also take regular texts ("cards") that aren't linked to any issue, but having each as an issue (or PR) allows for a description, discussion, someone saying "working on it", or assigning them to users. Projects can also be automated, so things like closing those issues or merging the PRs can automatically move them to Done.

Maybe a mix of both (tracking issue with a list and then project with linked issues for started/considered "important" at the moment), in case you like Projects but don't want to have the issues tab filled (although that's what it is for, isn't it?).
Another way could also be cards for those that "don't need discussion (yet)", and asking to replace them with an issue/draft PR in case someone wants to work on them or discuss them.

Disclaimer: I don't know anything about shader code, and probably won't be able to contribute, but I may if I'm bored enough.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.