This repository was archived by the owner on May 15, 2023. It is now read-only.
LFS: Faster autorotate and bytes operations + LfsApi: Add ScreenshotTextureEvent#226
Open
dakyneko wants to merge 2 commits intoknah:masterfrom
Open
LFS: Faster autorotate and bytes operations + LfsApi: Add ScreenshotTextureEvent#226dakyneko wants to merge 2 commits intoknah:masterfrom
dakyneko wants to merge 2 commits intoknah:masterfrom
Conversation
added 2 commits
June 20, 2022 16:35
Unity render is horizontally swapped so we need to mirror swap on X: that part was rewritten so it's simplified and optimized. Also if autorotate previous code was doing byte wizzardry but that's not necessary and slow. In this new version we put the camera so it's always upright then renders, so it's already good.
…exture Also fix a typo
Author
|
@knah what do you need to review and merge this? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.