I do not officially support OptiFine.
It breaks like every mod and since it's closed-source, it is extremely frustrating and time-consuming to fix bugs caused by it.
Instead you should use Oculus/Iris and Rubidium/Sodium.
It's so much more stable and doesn't break everything.
ON FORGE, USE:
ON FABRIC, USE: