MekaSuit Disabling Night Enhancement removes night vision from drank potion
Aronnaxx opened this issue ยท 6 comments
Issue description:
Mekanism MekaSuit Enhanced Night vision is incompatible with most major shaders, or does not function in the same way as regular Night Vision potions. While normal night vision potions work fine in the shaders, the Mekanism night vision seems to be non-functional. Toggling suit will also remove all night vision effects from potion use.
Steps to reproduce:
- Equip MekaSuit helmet with Night Enhancement mode
- Enable shaders through Optifine (Sildur's Shaders was chosen for this test)
- Night Vision module has no impact, however, night vision potions work as expected
Version (make sure you are on the latest version before reporting):
Forge: 36.0.43
Mekanism: 10.0.21.448
Other relevant version: Minecraft 1.16.5
Report this to optifine as the issue is almost certainly on their end, and given they are closed source it would be a massive pain to try and debug to see if we can even work around them doing things... We don't do anything super fancy for our night vision module. If memory serves all it is is: Night vision potion + using forge's fog event to change the color + density of how things render.
In regards to your other thing do you mean that if you have a night vision potion, then turning mek's night vision on and off gets rid of the potion?
Ah dang - I'll have to check in with them then, thanks for the input! Is there a way to change the Mekanism file for Night Vision to just be 'infinite' vanilla night vision potion until toggled? As for the suit, that's correct; if I currently have a Night Vision effect equipped, and then toggle the MekaSuit's night vision on and off, it removes the original night vision potion effect. Steps to reproduce below
- Equip MekaSuit helmet with night enhancement mode
- Drink / throw Night Vision potion (any duration)
- Toggle night enhancement mode on and off
I will look into that issue with the night vision potion. In regards to just making mek's helmet have infinite like most other mods do, no there is no way to do so as it was intentionally designed to be different and not as bland/lazy as most other mods do.
A quick update for the original Night Vision issue that I thought may be helpful: does Mekanism utilize the vanilla lightmap for the night vision potion? A comment I received while troubleshooting the issue:
"There's 2 ways shaders can react to night vision. one is through the lightmap, which is a lookup texture which tells shaders what color multiplier to apply for any given light level. the other way is through the nightVision uniform, which is provided by optifine, and tells shaders how strongly night vision should be applied, on a scale of 0 to 1. many shaders choose to ignore lightmap because vanilla's color multipliers are... well, ugly. I don't know if sildur in particular does this or not.
if mekanism is applying the vanilla night vision potion effect, then optifine should detect it and update nightVision accordingly. however, if mekanism directly modifies the lightmap without using the vanilla potion effect, then any shader which ignores the lightmap will not know that night vision should be applied"
We just apply it using vanilla's potion. https://github.com/mekanism/Mekanism/blob/1.16.x/src/main/java/mekanism/client/ClientTickHandler.java#L243-L250 and forge's fog events https://github.com/mekanism/Mekanism/blob/1.16.x/src/main/java/mekanism/client/ClientTickHandler.java#L322-L341
I wonder if it may not be an issue with how Night Vision is applied, but with how the fog is applied? I checked using Sildur's other pack, called Enhanced Default and it works as expected; however, that pack allows fog while the Vibrant version (and other shaders like it) does not allow / implements their own form of fog separate from Forge?