
X-Ray doesn't work when using shaders.
Serorin-GH opened this issue ยท 7 comments
This is a Google translation, so I apologize if the words are incorrect.
Describe the bug
X-Ray doesn't work when using shaders in Iris.
To Reproduce
Steps to reproduce the behavior:
- When I turn on shaders in Iris, the corresponding blocks don't appear even when I turn on X-Ray.
(A message indicating that X-Ray is ON appears in the bottom right of the screen.) - When I turn off a shader in Iris, the corresponding block appears when I turn on X-Ray.
- When I turn off a shader in Iris with X-Ray ON, the corresponding block appears.
Minecraft Enviorment
-
Minecraft Version: 1.21.8
-
XRay Mod Version: advanced-xray-neoforge-21.8.3
-
Forge Version if applicable: neoforge-21.8.31
-
Sodium: sodium-neoforge-0.6.13+mc1.21.6
-
Iris: iris-neoforge-1.9.1+mc1.21.7
-
Shaders: ComplementaryUnbound_r5.5.1 , BSL_v10.0
Additional context
The above mod configuration worked fine in 1.21.4.
@MichaelHillcox - I started using WorldEditCUI today - a mod that helps visualize WorldEdit selections. it uses similar 'block highlighting' as shown in image below.
It works even when I have either of my shaders in use (BSL or Photon)
I'm not a developer, but perhaps you could review their code and see how they do it?
Git for WorldEditCUI = https://github.com/EngineHub/WorldEditCUI/tree/master
They have 3 render pipeline files, one for vanilla, one for optifine (which Iris supposedly emulates), and another.
https://github.com/EngineHub/WorldEditCUI/tree/master
My guess is the magic is in the Optifine file.

Very interesting! This I can use to look into things :D I'll do a deep dive tomorrow
See #140
I came here to report the same issue.
I do not have previous version experience to know if it worked before.
- MineCraft Version 1.21.8
- Fabric API: fabric-api-0.133.0+1.21.8
- XRay Mod Version: advanced-xray-fabric-21.6.3
- Sodium: sodium-fabric-0.6.13+mc1.21.6
- Iris: iris-fabric-1.9.1+mc1.21.7
- Shader - Photon_v1.2a (I've also tested with BSL_v10 - separately, only one or the other in the shaderpack folder and active.)
- ResourcePack: Patrix_1.21.8_32x_basic (but also occurs in Vanilla/no resource texture selected)
I also have other mods installed, but my testing has shown that the xray lines will appear with all of my others installed, so long as i disable the Shader pack.
With Photon shaderpack enabled

With shaderpack disabled (did not move/change view perspective - just went into Iris menu and disabled shader pack.

This isn't complete.
The referenced notice #140 seems to blame Optifine+shaders, and indicates the Xray author (you?) can't solve it due to Opti dev not answering your requests for assistance and it being closed source.
The two posts above have two separate shaders, neither of them being Optfine.
Serorin-GH is using BSLv10 shader + Iris for NeoForge
JamminR (myself) is using Photon v1.2a + Iris for Fabric
The two common denominators are a) we're using shaders and b) we're using Iris, an open source project.
If you believe this to be a shader loader issue, IrisShaders has a github repo and what seems to be an LGPL-v3 license.
IrisShaders Git = https://github.com/IrisShaders/Iris
Website = https://www.irisshaders.dev/
If you want to start with Shader pack authors,
-
BSLShaders doesn't seem to have a Git, but the author has a website and several social links/discord.
https://capttatsu.com/ -
Photon v1.2a
Git = https://github.com/sixthsurge/photon
(Though they use Modrinth for public releases, they do have a 'stable.zip' release available on Github)
Please let me know how else I can help.
I can enable any logging you provide me steps to enable, and steps to follow and attach logs and results here.
If you have any 'dev build' of the Xray mod you want me to try that provides additional detailed info for you, I'm willing to do that too.
Advanced Xray is an excellent mod. It will be even better if Minecraft users wouldn't have to disable shaders to use it.
Yeah, it's not so much optifine as it is shaders in general. I can see you took time to write this down so I thank you for this.
My actual issue isn't the shader provider specifically, it's just that I don't know what I need to do do make my mod work with shaders. I've seen some instances where you can see the render but it's in the wrong place, etc. I'm sure it's likely simple but I'm unlikely to be able to work it out myself as I don't really do much with shaders. Most of these mods do a bunch of mixins and not many of them give good information on how to integrate your mod with shaders
You're welcome. I really like the mod and wish to help in anyway i can.
10-15 years ago there was a mod that would both draw lines like Advanced Xray, and also allow clear view by stopping rendering all but ore / lava / dungeon blocks etc, no texture pack needed.
This is the closest working one to that. Get it working with shaders, and perhaps at same time figure out adding the stop rendering block/free view toggle if possible now, and it be the best (and only) xray mod out there for current MC.
(I've seen the see-through texture packs - but there's no quick view method like a mod toggle)
Good luck with fixing it. Perhaps the dev and or team at one of the above links (Iris / Photon / BSL) can assist.