IrisShaders / Iris

A modern shaders mod for Minecraft compatible with existing OptiFine shader packs
https://irisshaders.dev
GNU Lesser General Public License v3.0
3.37k stars 640 forks source link

Breaking animation is pure black on vanillAA #951

Open GamzeeRakoon opened 3 years ago

GamzeeRakoon commented 3 years ago

What happened?

when you have vanillAA enabled on iris and you try breaking a block, the breaking texture will be pure black instead of having greys in it

i have tested it on both optifine and iris and it seems that only iris has this issue

https://github.com/leo60228/VanillAA-Shaders

Screenshots

The breaking texture on Optifine: Optifine

The breaking texture on Iris Iris

Relevant log output

[19:58:32] [main/INFO]: Loading for game Minecraft 1.17.1
[19:58:32] [main/WARN]: Warnings were found! 
 - Conflicting versions found for fabric-resource-loader-v0: used 0.4.7+b7ab61213d, also found 0.4.7+b7ab612113
 - Mod 'Fabric Rendering Fluids (v1)' (fabric-rendering-fluids-v1) recommends any version of mod fabric-textures-v0, which is missing!
     - You must install any version of fabric-textures-v0.
 - Conflicting versions found for fabric-api-base: used 0.3.0+a02b446313, also found 0.3.0+a02b44633d
[19:58:32] [main/INFO]: [FabricLoader] Loading 11 mods:
    - fabric-api-base@0.3.0+a02b446313
    - fabric-key-binding-api-v1@1.0.4+a02b44633d
    - fabric-lifecycle-events-v1@1.4.4+a02b44633d
    - fabric-rendering-data-attachment-v1@0.1.5+a02b446313
    - fabric-rendering-fluids-v1@0.1.13+a02b446313
    - fabric-resource-loader-v0@0.4.7+b7ab61213d
    - fabricloader@0.11.7
    - iris@1.1.2+build.9
    - java@17
    - minecraft@1.17.1
    - sodium@0.3.2+IRIS2-build.9
[19:58:32] [main/INFO]: SpongePowered MIXIN Subsystem Version=0.8.2 Source=file:/home/lith/.local/share/multimc/libraries/net/fabricmc/sponge-mixin/0.9.4+mixin.0.8.2/sponge-mixin-0.9.4+mixin.0.8.2.jar Service=Knot/Fabric Env=CLIENT
[19:58:32] [main/INFO]: Compatibility level set to JAVA_16
[19:58:32] [main/INFO]: Loaded configuration file for Sodium: 28 options available, 0 override(s) found
[19:58:36] [Render thread/WARN]: Method overwrite conflict for method_22920 in mixins.iris.vertexformat.json:block_rendering.MixinBufferBuilder_SeparateAo, previously written by me.jellysquid.mods.sodium.mixin.features.buffer_builder.intrinsics.MixinBufferBuilder. Skipping method.
[19:58:37] [Render thread/INFO]: Environment: authHost='https://authserver.mojang.com', accountsHost='https://api.mojang.com', sessionHost='https://sessionserver.mojang.com', servicesHost='https://api.minecraftservices.com', name='PROD'
[19:58:38] [Render thread/INFO]: Setting user: blue_manta05
[19:58:38] [Render thread/WARN]: @Inject(@At("INVOKE")) Shift.BY=3 on fabric-lifecycle-events-v1.mixins.json:client.WorldChunkMixin::handler$zdc000$onLoadBlockEntity exceeds the maximum allowed value: 0. Increase the value of maxShiftBy to suppress this warning.
[19:58:38] [Render thread/INFO]: Using shaderpack: VanillAA.zip
[19:58:38] [Render thread/INFO]: Backend library: LWJGL version 3.2.2 build 10
[19:58:40] [Render thread/INFO]: Hardware information:
[19:58:40] [Render thread/INFO]: CPU: 4x AMD Ryzen 3 2200G with Radeon Vega Graphics
[19:58:40] [Render thread/INFO]: GPU: NVIDIA GeForce GTX 1050 Ti/PCIe/SSE2 (Supports OpenGL 3.2.0 NVIDIA 470.74)
[19:58:40] [Render thread/INFO]: OS: Linux
[19:58:41] [Render thread/WARN]: Method overwrite conflict for getNativeMemoryUsage in mixins.iris.json:MixinDebugHud, previously written by me.jellysquid.mods.sodium.mixin.features.debug.MixinDebugHud. Skipping method.
[19:58:41] [Render thread/WARN]: ERROR : Couldn't load Narrator library : Unable to load library 'fliteWrapper':
libflite.so.1: cannot open shared object file: No such file or directory
libflite.so.1: cannot open shared object file: No such file or directory
Native library (linux-x86-64/libfliteWrapper.so) not found in resource path (/home/lith/.local/share/multimc/bin/jars/NewLaunch.jar:/home/lith/.local/share/multimc/libraries/org/lwjgl/lwjgl-glfw/3.2.2/lwjgl-glfw-3.2.2.jar:/home/lith/.local/share/multimc/libraries/org/lwjgl/lwjgl-jemalloc/3.2.2/lwjgl-jemalloc-3.2.2.jar:/home/lith/.local/share/multimc/libraries/org/lwjgl/lwjgl-openal/3.2.2/lwjgl-openal-3.2.2.jar:/home/lith/.local/share/multimc/libraries/org/lwjgl/lwjgl-opengl/3.2.2/lwjgl-opengl-3.2.2.jar:/home/lith/.local/share/multimc/libraries/org/lwjgl/lwjgl-stb/3.2.2/lwjgl-stb-3.2.2.jar:/home/lith/.local/share/multimc/libraries/org/lwjgl/lwjgl-tinyfd/3.2.2/lwjgl-tinyfd-3.2.2.jar:/home/lith/.local/share/multimc/libraries/org/lwjgl/lwjgl/3.2.2/lwjgl-3.2.2.jar:/home/lith/.local/share/multimc/libraries/com/mojang/blocklist/1.0.5/blocklist-1.0.5.jar:/home/lith/.local/share/multimc/libraries/com/mojang/patchy/2.1.6/patchy-2.1.6.jar:/home/lith/.local/share/multimc/libraries/com/github/oshi/oshi-core/5.7.5/oshi-core-5.7.5.jar:/home/lith/.local/share/multimc/libraries/net/java/dev/jna/jna/5.8.0/jna-5.8.0.jar:/home/lith/.local/share/multimc/libraries/net/java/dev/jna/jna-platform/5.8.0/jna-platform-5.8.0.jar:/home/lith/.local/share/multimc/libraries/org/slf4j/slf4j-api/1.8.0-beta4/slf4j-api-1.8.0-beta4.jar:/home/lith/.local/share/multimc/libraries/org/apache/logging/log4j/log4j-slf4j18-impl/2.14.1/log4j-slf4j18-impl-2.14.1.jar:/home/lith/.local/share/multimc/libraries/com/ibm/icu/icu4j/66.1/icu4j-66.1.jar:/home/lith/.local/share/multimc/libraries/com/mojang/javabridge/1.1.23/javabridge-1.1.23.jar:/home/lith/.local/share/multimc/libraries/net/sf/jopt-simple/jopt-simple/5.0.3/jopt-simple-5.0.3.jar:/home/lith/.local/share/multimc/libraries/io/netty/netty-all/4.1.25.Final/netty-all-4.1.25.Final.jar:/home/lith/.local/share/multimc/libraries/com/google/guava/guava/21.0/guava-21.0.jar:/home/lith/.local/share/multimc/libraries/org/apache/commons/commons-lang3/3.5/commons-lang3-3.5.jar:/home/lith/.local/share/multimc/libraries/commons-io/commons-io/2.5/commons-io-2.5.jar:/home/lith/.local/share/multimc/libraries/commons-codec/commons-codec/1.10/commons-codec-1.10.jar:/home/lith/.local/share/multimc/libraries/com/mojang/brigadier/1.0.18/brigadier-1.0.18.jar:/home/lith/.local/share/multimc/libraries/com/mojang/datafixerupper/4.0.26/datafixerupper-4.0.26.jar:/home/lith/.local/share/multimc/libraries/com/google/code/gson/gson/2.8.0/gson-2.8.0.jar:/home/lith/.local/share/multimc/libraries/com/mojang/authlib/2.3.31/authlib-2.3.31.jar:/home/lith/.local/share/multimc/libraries/org/apache/commons/commons-compress/1.8.1/commons-compress-1.8.1.jar:/home/lith/.local/share/multimc/libraries/org/apache/httpcomponents/httpclient/4.3.3/httpclient-4.3.3.jar:/home/lith/.local/share/multimc/libraries/commons-logging/commons-logging/1.1.3/commons-logging-1.1.3.jar:/home/lith/.local/share/multimc/libraries/org/apache/httpcomponents/httpcore/4.3.2/httpcore-4.3.2.jar:/home/lith/.local/share/multimc/libraries/it/unimi/dsi/fastutil/8.2.1/fastutil-8.2.1.jar:/home/lith/.local/share/multimc/libraries/org/apache/logging/log4j/log4j-api/2.14.1/log4j-api-2.14.1.jar:/home/lith/.local/share/multimc/libraries/org/apache/logging/log4j/log4j-core/2.14.1/log4j-core-2.14.1.jar:/home/lith/.local/share/multimc/libraries/com/mojang/text2speech/1.11.3/text2speech-1.11.3.jar:/home/lith/.local/share/multimc/libraries/net/fabricmc/intermediary/1.17.1/intermediary-1.17.1.jar:/home/lith/.local/share/multimc/libraries/net/fabricmc/tiny-mappings-parser/0.2.2.14/tiny-mappings-parser-0.2.2.14.jar:/home/lith/.local/share/multimc/libraries/net/fabricmc/sponge-mixin/0.9.4+mixin.0.8.2/sponge-mixin-0.9.4+mixin.0.8.2.jar:/home/lith/.local/share/multimc/libraries/net/fabricmc/tiny-remapper/0.6.0/tiny-remapper-0.6.0.jar:/home/lith/.local/share/multimc/libraries/net/fabricmc/access-widener/1.0.0/access-widener-1.0.0.jar:/home/lith/.local/share/multimc/libraries/net/fabricmc/fabric-loader-sat4j/2.3.5.4/fabric-loader-sat4j-2.3.5.4.jar:/home/lith/.local/share/multimc/libraries/com/google/jimfs/jimfs/1.2-fabric/jimfs-1.2-fabric.jar:/home/lith/.local/share/multimc/libraries/org/ow2/asm/asm/9.1/asm-9.1.jar:/home/lith/.local/share/multimc/libraries/org/ow2/asm/asm-analysis/9.1/asm-analysis-9.1.jar:/home/lith/.local/share/multimc/libraries/org/ow2/asm/asm-commons/9.1/asm-commons-9.1.jar:/home/lith/.local/share/multimc/libraries/org/ow2/asm/asm-tree/9.1/asm-tree-9.1.jar:/home/lith/.local/share/multimc/libraries/org/ow2/asm/asm-util/9.1/asm-util-9.1.jar:/home/lith/.local/share/multimc/libraries/net/fabricmc/fabric-loader/0.11.7/fabric-loader-0.11.7.jar:/home/lith/.local/share/multimc/libraries/com/mojang/minecraft/1.17.1/minecraft-1.17.1-client.jar)
[19:58:41] [Render thread/INFO]: Reloading ResourceManager: Default, Fabric Mods (Fabric Rendering Data Attachment (v1), Fabric Lifecycle Events (v1), Sodium, Fabric Resource Loader (v0), Iris, Fabric Loader, Fabric Rendering Fluids (v1), Fabric API Base, Fabric Key Binding API (v1))
[19:58:47] [Render thread/INFO]: OpenAL initialized.
[19:58:47] [Render thread/INFO]: Sound engine started
[19:58:47] [Render thread/INFO]: Created: 1024x1024x4 minecraft:textures/atlas/blocks.png-atlas
[19:58:47] [Render thread/INFO]: Created: 256x128x4 minecraft:textures/atlas/signs.png-atlas
[19:58:47] [Render thread/INFO]: Created: 1024x512x4 minecraft:textures/atlas/banner_patterns.png-atlas
[19:58:47] [Render thread/INFO]: Created: 1024x512x4 minecraft:textures/atlas/shield_patterns.png-atlas
[19:58:47] [Render thread/INFO]: Created: 256x256x4 minecraft:textures/atlas/chest.png-atlas
[19:58:47] [Render thread/INFO]: Created: 512x256x4 minecraft:textures/atlas/beds.png-atlas
[19:58:47] [Render thread/INFO]: Created: 512x256x4 minecraft:textures/atlas/shulker_boxes.png-atlas
[19:58:48] [Render thread/INFO]: Created: 256x256x0 minecraft:textures/atlas/particles.png-atlas
[19:58:48] [Render thread/INFO]: Created: 256x256x0 minecraft:textures/atlas/paintings.png-atlas
[19:58:48] [Render thread/INFO]: Created: 256x128x0 minecraft:textures/atlas/mob_effects.png-atlas
[19:59:03] [Render thread/WARN]: Ambiguity between arguments [teleport, location] and [teleport, destination] with inputs: [0.1 -0.5 .9, 0 0 0]
[19:59:03] [Render thread/WARN]: Ambiguity between arguments [teleport, location] and [teleport, targets] with inputs: [0.1 -0.5 .9, 0 0 0]
[19:59:03] [Render thread/WARN]: Ambiguity between arguments [teleport, destination] and [teleport, targets] with inputs: [Player, 0123, @e, dd12be42-52a9-4a91-a8a1-11c01849e498]
[19:59:03] [Render thread/WARN]: Ambiguity between arguments [teleport, targets] and [teleport, destination] with inputs: [Player, 0123, dd12be42-52a9-4a91-a8a1-11c01849e498]
[19:59:03] [Render thread/WARN]: Ambiguity between arguments [teleport, targets, location] and [teleport, targets, destination] with inputs: [0.1 -0.5 .9, 0 0 0]
[19:59:03] [Render thread/INFO]: Reloading ResourceManager: Default
[19:59:04] [Render thread/INFO]: Loaded 7 recipes
[19:59:05] [Render thread/INFO]: Loaded 1137 advancements
[19:59:06] [Render thread/INFO]: Environment: authHost='https://authserver.mojang.com', accountsHost='https://api.mojang.com', sessionHost='https://sessionserver.mojang.com', servicesHost='https://api.minecraftservices.com', name='PROD'
[19:59:06] [Server thread/INFO]: Starting integrated minecraft server version 1.17.1
[19:59:06] [Server thread/INFO]: Generating keypair
[19:59:07] [Server thread/INFO]: Preparing start region for dimension minecraft:overworld
[19:59:07] [Render thread/INFO]: Preparing spawn area: 0%
[19:59:11] [Render thread/INFO]: Preparing spawn area: 0%
[19:59:11] [Render thread/INFO]: Preparing spawn area: 0%
[19:59:11] [Render thread/INFO]: Preparing spawn area: 0%
[19:59:11] [Render thread/INFO]: Preparing spawn area: 0%
[19:59:11] [Render thread/INFO]: Preparing spawn area: 0%
[19:59:11] [Render thread/INFO]: Preparing spawn area: 0%
[19:59:11] [Render thread/INFO]: Preparing spawn area: 0%
[19:59:11] [Render thread/INFO]: Preparing spawn area: 0%
[19:59:11] [Render thread/INFO]: Preparing spawn area: 10%
[19:59:12] [Render thread/INFO]: Preparing spawn area: 34%
[19:59:12] [Render thread/INFO]: Preparing spawn area: 68%
[19:59:13] [Render thread/INFO]: Preparing spawn area: 75%
[19:59:13] [Render thread/INFO]: Preparing spawn area: 83%
[19:59:14] [Render thread/INFO]: Preparing spawn area: 84%
[19:59:14] [Render thread/INFO]: Preparing spawn area: 88%
[19:59:15] [Render thread/INFO]: Preparing spawn area: 92%
[19:59:15] [Render thread/INFO]: Preparing spawn area: 96%
[19:59:15] [Render thread/INFO]: Time elapsed: 8750 ms
[19:59:15] [Server thread/INFO]: Changing view distance to 11, from 10
[19:59:16] [Server thread/INFO]: blue_manta05[local:E:f44cf92d] logged in with entity id 186 at (88.28993927428286, 64.0, 28.203041875042295)
[19:59:16] [Server thread/INFO]: blue_manta05 joined the game
[19:59:17] [Render thread/INFO]: Started 4 worker threads
[19:59:17] [Server thread/INFO]: Saving and pausing game...
[19:59:17] [Server thread/INFO]: Saving chunks for level 'ServerLevel[New World]'/minecraft:overworld
[19:59:18] [Render thread/INFO]: Loaded 0 advancements
[19:59:18] [Render thread/INFO]: Creating pipeline OVERWORLD
[19:59:18] [Render thread/INFO]: Stopping worker threads
[19:59:18] [Render thread/INFO]: Started 4 worker threads
[19:59:19] [Server thread/INFO]: Saving chunks for level 'ServerLevel[New World]'/minecraft:the_nether
[19:59:19] [Server thread/INFO]: Saving chunks for level 'ServerLevel[New World]'/minecraft:the_end
[19:59:19] [Server thread/WARN]: Can't keep up! Is the server overloaded? Running 3433ms or 68 ticks behind
[20:00:01] [Render thread/INFO]: [CHAT] Saved screenshot as 2021-10-30_20.00.01.png
[20:00:03] [Server thread/INFO]: Saving and pausing game...
[20:00:03] [Server thread/INFO]: Saving chunks for level 'ServerLevel[New World]'/minecraft:overworld
[20:00:03] [Server thread/INFO]: Saving chunks for level 'ServerLevel[New World]'/minecraft:the_nether
[20:00:03] [Server thread/INFO]: Saving chunks for level 'ServerLevel[New World]'/minecraft:the_end
[20:01:25] [Render thread/INFO]: Loaded 4 advancements
[20:01:26] [Server thread/INFO]: Saving and pausing game...
[20:01:26] [Server thread/INFO]: Saving chunks for level 'ServerLevel[New World]'/minecraft:overworld
[20:01:26] [Server thread/INFO]: Saving chunks for level 'ServerLevel[New World]'/minecraft:the_nether
[20:01:26] [Server thread/INFO]: Saving chunks for level 'ServerLevel[New World]'/minecraft:the_end
[20:01:28] [Server thread/INFO]: blue_manta05 lost connection: Disconnected
[20:01:28] [Server thread/INFO]: blue_manta05 left the game
[20:01:28] [Server thread/INFO]: Stopping singleplayer server as player logged out
[20:01:28] [Server thread/INFO]: Stopping server
[20:01:28] [Server thread/INFO]: Saving players
[20:01:28] [Server thread/INFO]: Saving worlds
[20:01:28] [Server thread/INFO]: Saving chunks for level 'ServerLevel[New World]'/minecraft:overworld
[20:01:28] [Server thread/INFO]: Saving chunks for level 'ServerLevel[New World]'/minecraft:the_nether
[20:01:28] [Server thread/INFO]: Saving chunks for level 'ServerLevel[New World]'/minecraft:the_end
[20:01:28] [Server thread/INFO]: ThreadedAnvilChunkStorage (New World): All chunks are saved
[20:01:28] [Server thread/INFO]: ThreadedAnvilChunkStorage (DIM-1): All chunks are saved
[20:01:28] [Server thread/INFO]: ThreadedAnvilChunkStorage (DIM1): All chunks are saved
[20:01:28] [Server thread/INFO]: ThreadedAnvilChunkStorage: All dimensions are saved
[20:01:28] [Render thread/INFO]: Stopping worker threads
[20:01:28] [Render thread/INFO]: Destroying pipeline OVERWORLD
[20:01:30] [Render thread/INFO]: Stopping!

Iris and Minecraft Version

iris-and-sodium-mc1.17-1.1.2+build.9.jar

Are you running Sodium along with Iris?

Yes

Operating System

Arch Linux

What is your GPU?

Nvidia GTX 1050TI

Java Version

17

Additional context

No response

GamzeeRakoon commented 3 years ago

update: User has reported the same issue with a diffrent shader MC: 1.17.1 Iris+sodium: v1.1.2 Shader used in demo: Tea shaders v1.5.5

Video of the issue: https://imgur.com/a/E017t7z

HumanGamer commented 2 years ago

I also have this issue. I have a 1660 Super, and I was using Silder's Enhanced Default on 1.18

Tedium16 commented 2 years ago

I continue to have this issue on 1.18.1 running sodium on Arch Linux with a GTX 1070, however it doesn't happen with complementary shaders so far I've only seen it on sidlurs vibrant and enhanced along with tea shaders

xaqbr commented 2 years ago

I managed to resolve this issue with Sildur's Enhanced Default on 1.18 by adding a few files to the shader pack.

In the shaders sub-folder, create both gbuffers_damagedblock.fsh and gbuffers_damagedblock.vsh and add the following code:

gbuffers_damagedblock.fsh

#version 120
/* DRAWBUFFERS:02 */ //0=gcolor, 2=gnormal for normals

//Varyings//
varying vec2 texCoord;

//Uniforms//
uniform sampler2D texture;

//Program//
void main() {
    //Texture
    vec4 albedo = texture2D(texture, texCoord);

    #if ALPHA_BLEND == 1
    albedo.rgb = pow(albedo.rgb,vec3(2.2)) * 2.25;
    #endif

    #ifdef WHITE_WORLD
    albedo.a = 0.0;
    #endif

    /* DRAWBUFFERS:0 */
    gl_FragData[0] = albedo;
}

gbuffers_damagedblock.vsh

#version 120

//Varyings//
varying vec2 texCoord;

//Uniforms//
#if AA > 0
uniform int frameCounter;
uniform float viewWidth,viewHeight;
#endif

uniform float frameTimeCounter;
uniform mat4 gbufferModelView;
uniform mat4 gbufferModelViewInverse;

//Includes//
// #if AA > 0
// #include "/lib/util/jitter.glsl"
// #endif

//Program//
void main(){
    texCoord=(gl_TextureMatrix[0]*gl_MultiTexCoord0).xy;

    gl_Position=ftransform();

    #if AA > 0
    gl_Position.xy=TAAJitter(gl_Position.xy,gl_Position.w);
    #endif
}

Could probably be optimized, but I was just adopting similar code from other packs. Hopefully this works for other people.

coderbot16 commented 2 years ago

This does not affect 1.16.5. So there's something different about how 1.17.1+ is doing things that is causing these issues.

ginqus commented 1 year ago

I managed to resolve this issue with Sildur's Enhanced Default on 1.18 by adding a few files to the shader pack.

In the shaders sub-folder, create both gbuffers_damagedblock.fsh and gbuffers_damagedblock.vsh and add the following code:

gbuffers_damagedblock.fsh

#version 120
/* DRAWBUFFERS:02 */ //0=gcolor, 2=gnormal for normals

//Varyings//
varying vec2 texCoord;

//Uniforms//
uniform sampler2D texture;

//Program//
void main() {
  //Texture
  vec4 albedo = texture2D(texture, texCoord);

  #if ALPHA_BLEND == 1
  albedo.rgb = pow(albedo.rgb,vec3(2.2)) * 2.25;
  #endif

  #ifdef WHITE_WORLD
  albedo.a = 0.0;
  #endif

    /* DRAWBUFFERS:0 */
  gl_FragData[0] = albedo;
}

gbuffers_damagedblock.vsh

#version 120

//Varyings//
varying vec2 texCoord;

//Uniforms//
#if AA > 0
uniform int frameCounter;
uniform float viewWidth,viewHeight;
#endif

uniform float frameTimeCounter;
uniform mat4 gbufferModelView;
uniform mat4 gbufferModelViewInverse;

//Includes//
// #if AA > 0
// #include "/lib/util/jitter.glsl"
// #endif

//Program//
void main(){
  texCoord=(gl_TextureMatrix[0]*gl_MultiTexCoord0).xy;

  gl_Position=ftransform();

  #if AA > 0
  gl_Position.xy=TAAJitter(gl_Position.xy,gl_Position.w);
  #endif
}

Could probably be optimized, but I was just adopting similar code from other packs. Hopefully this works for other people.

THANK YOU SO MUCH! IT WORKS!

leo60228 commented 1 year ago

I fixed this in 1.1 by adding a gbuffers_damagedblock shader that skips lighting, and the result seems to match vanilla. This isn't really the behavior I'd expect, though, and it seems odd that it would relate to the game version like this.

coderbot16 commented 1 year ago

@IMS212 Would you be able to give this a look? I wonder if gl_Normal / gl_NormalMatrix are invalid somehow in block breaking.