Update screenshot transparency for Unity 2022

This commit is contained in:
katboi01
2025-01-31 10:30:46 +01:00
parent 8eadd54906
commit 45a17176be
5 changed files with 1454 additions and 10 deletions
+3 -7
View File
@@ -77,7 +77,7 @@ public class Screenshot : MonoBehaviour
UmaViewerUI.Instance.GifSlider.value = (float)frame / clipFrameCount;
UmaViewerUI.Instance.AnimationProgressChange((float)frame / clipFrameCount);
yield return new WaitForEndOfFrame();
var tex = GrabFrame(camera, width, height, transparent, transparent);
var tex = GrabFrame(camera, width, height, transparent);
CaptureToGIFCustom.Instance.Frames.Add(new Image(tex));
Destroy(tex);
frame++;
@@ -92,7 +92,7 @@ public class Screenshot : MonoBehaviour
UmaViewerUI.Instance.GifSlider.value = 1;
}
public static Texture2D GrabFrame(Camera cam, int width, int height, bool transparent = true, bool gifBackground = false)
public static Texture2D GrabFrame(Camera cam, int width, int height, bool transparent = true)
{
var dimensions = GetResolution(width, height);
width = dimensions.x;
@@ -103,15 +103,11 @@ public class Screenshot : MonoBehaviour
Color oldBG = cam.backgroundColor;
cam.cullingMask = ~LayerMask.GetMask("UI");
if (gifBackground)
if (transparent)
{
cam.clearFlags = CameraClearFlags.SolidColor;
cam.backgroundColor = new Color32(0, 0, 0, 0);
}
else if (transparent)
{
cam.clearFlags = CameraClearFlags.Depth;
}
var tex_color = new Texture2D(width, height, TextureFormat.ARGB32, false);
int aaLevel = QualitySettings.antiAliasing == 0? 1 : QualitySettings.antiAliasing; //RT uses '1' for no antialiasing
+2 -2
View File
@@ -140,7 +140,7 @@ PlayerSettings:
loadStoreDebugModeEnabled: 0
visionOSBundleVersion: 1.0
tvOSBundleVersion: 1.0
bundleVersion: 2.1.22
bundleVersion: 2.1.23
preloadedAssets: []
metroInputSource: 0
wsaTransparentSwapchain: 0
@@ -755,7 +755,7 @@ PlayerSettings:
PS5: UNITY_POST_PROCESSING_STACK_V2
QNX: UNITY_POST_PROCESSING_STACK_V2
Stadia: UNITY_POST_PROCESSING_STACK_V2
Standalone: UNITY_POST_PROCESSING_STACK_V2
Standalone: UNITY_POST_PROCESSING_STACK_V2;AMPLIFY_SHADER_EDITOR
VisionOS: UNITY_POST_PROCESSING_STACK_V2
WebGL: UNITY_POST_PROCESSING_STACK_V2
XboxOne: UNITY_POST_PROCESSING_STACK_V2
File diff suppressed because it is too large Load Diff
+13
View File
@@ -0,0 +1,13 @@
{
"name": "Assets",
"roots": ["Assets"],
"includes": [],
"excludes": ["Assets/Temp/", "Assets/External/"],
"options": {
"types": true,
"properties": true,
"extended": false,
"dependencies": false
},
"baseScore": 999
}
+76 -1
View File
@@ -1 +1,76 @@
{}
trackSelection = true
refreshSearchWindowsInPlayMode = false
pickerAdvancedUI = false
fetchPreview = true
defaultFlags = 0
keepOpen = true
queryFolder = "Assets"
onBoardingDoNotAskAgain = true
showPackageIndexes = false
showStatusBar = false
scopes = {
}
providers = {
asset = {
active = true
priority = 25
defaultAction = null
}
scene = {
active = true
priority = 50
defaultAction = null
}
adb = {
active = false
priority = 2500
defaultAction = null
}
find = {
active = true
priority = 25
defaultAction = null
}
packages = {
active = false
priority = 90
defaultAction = null
}
store = {
active = false
priority = 100
defaultAction = null
}
performance = {
active = false
priority = 100
defaultAction = null
}
profilermarkers = {
active = false
priority = 100
defaultAction = null
}
log = {
active = false
priority = 210
defaultAction = null
}
}
objectSelectors = {
}
recentSearches = [
]
searchItemFavorites = [
]
savedSearchesSortOrder = 0
showSavedSearchPanel = false
hideTabs = false
expandedQueries = [
]
queryBuilder = true
ignoredProperties = "id;name;classname;imagecontentshash"
helperWidgetCurrentArea = "all"
disabledIndexers = ""
minIndexVariations = 2
findProviderIndexHelper = true