This repository has been archived by the owner on May 15, 2023. It is now read-only.
LFS: Faster autorotate and bytes operations + LfsApi: Add ScreenshotTextureEvent #226
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.