Details: Unity render is horizontally swapped so we need to mirror swap on X:
That part was rewritten so it's simplified and optimized. Old code was doing the byte wizardry and then using another marshall.Copy which were combined in this PR and thus saving operations and memory.
Also if autorotate previous code was doing byte wizardry but that's not
necessary and slow. In this new version we manipulate the camera so it's always
upright before the rendering. So then there is no need to fix and correct anything except for the above mentioned unity X swap. Enjoy.
Also I added a new event (2nd commit) that allows more modding possibilities: For ex I have a WIP mod that allows to spawn the camera photos in VR directly.
This PR optimize the bytes and autorotation of screenshot after rendering. Some real numbers:
Details: Unity render is horizontally swapped so we need to mirror swap on X: That part was rewritten so it's simplified and optimized. Old code was doing the byte wizardry and then using another marshall.Copy which were combined in this PR and thus saving operations and memory.
Also if autorotate previous code was doing byte wizardry but that's not necessary and slow. In this new version we manipulate the camera so it's always upright before the rendering. So then there is no need to fix and correct anything except for the above mentioned unity X swap. Enjoy.
Also I added a new event (2nd commit) that allows more modding possibilities: For ex I have a WIP mod that allows to spawn the camera photos in VR directly.