Update screenshot transparency for Unity 2022
This commit is contained in:
@@ -77,7 +77,7 @@ public class Screenshot : MonoBehaviour
|
|||||||
UmaViewerUI.Instance.GifSlider.value = (float)frame / clipFrameCount;
|
UmaViewerUI.Instance.GifSlider.value = (float)frame / clipFrameCount;
|
||||||
UmaViewerUI.Instance.AnimationProgressChange((float)frame / clipFrameCount);
|
UmaViewerUI.Instance.AnimationProgressChange((float)frame / clipFrameCount);
|
||||||
yield return new WaitForEndOfFrame();
|
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));
|
CaptureToGIFCustom.Instance.Frames.Add(new Image(tex));
|
||||||
Destroy(tex);
|
Destroy(tex);
|
||||||
frame++;
|
frame++;
|
||||||
@@ -92,7 +92,7 @@ public class Screenshot : MonoBehaviour
|
|||||||
UmaViewerUI.Instance.GifSlider.value = 1;
|
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);
|
var dimensions = GetResolution(width, height);
|
||||||
width = dimensions.x;
|
width = dimensions.x;
|
||||||
@@ -103,15 +103,11 @@ public class Screenshot : MonoBehaviour
|
|||||||
Color oldBG = cam.backgroundColor;
|
Color oldBG = cam.backgroundColor;
|
||||||
|
|
||||||
cam.cullingMask = ~LayerMask.GetMask("UI");
|
cam.cullingMask = ~LayerMask.GetMask("UI");
|
||||||
if (gifBackground)
|
if (transparent)
|
||||||
{
|
{
|
||||||
cam.clearFlags = CameraClearFlags.SolidColor;
|
cam.clearFlags = CameraClearFlags.SolidColor;
|
||||||
cam.backgroundColor = new Color32(0, 0, 0, 0);
|
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);
|
var tex_color = new Texture2D(width, height, TextureFormat.ARGB32, false);
|
||||||
int aaLevel = QualitySettings.antiAliasing == 0? 1 : QualitySettings.antiAliasing; //RT uses '1' for no antialiasing
|
int aaLevel = QualitySettings.antiAliasing == 0? 1 : QualitySettings.antiAliasing; //RT uses '1' for no antialiasing
|
||||||
|
|||||||
@@ -140,7 +140,7 @@ PlayerSettings:
|
|||||||
loadStoreDebugModeEnabled: 0
|
loadStoreDebugModeEnabled: 0
|
||||||
visionOSBundleVersion: 1.0
|
visionOSBundleVersion: 1.0
|
||||||
tvOSBundleVersion: 1.0
|
tvOSBundleVersion: 1.0
|
||||||
bundleVersion: 2.1.22
|
bundleVersion: 2.1.23
|
||||||
preloadedAssets: []
|
preloadedAssets: []
|
||||||
metroInputSource: 0
|
metroInputSource: 0
|
||||||
wsaTransparentSwapchain: 0
|
wsaTransparentSwapchain: 0
|
||||||
@@ -755,7 +755,7 @@ PlayerSettings:
|
|||||||
PS5: UNITY_POST_PROCESSING_STACK_V2
|
PS5: UNITY_POST_PROCESSING_STACK_V2
|
||||||
QNX: UNITY_POST_PROCESSING_STACK_V2
|
QNX: UNITY_POST_PROCESSING_STACK_V2
|
||||||
Stadia: 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
|
VisionOS: UNITY_POST_PROCESSING_STACK_V2
|
||||||
WebGL: UNITY_POST_PROCESSING_STACK_V2
|
WebGL: UNITY_POST_PROCESSING_STACK_V2
|
||||||
XboxOne: UNITY_POST_PROCESSING_STACK_V2
|
XboxOne: UNITY_POST_PROCESSING_STACK_V2
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -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
|
||||||
|
}
|
||||||
@@ -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
|
||||||
Reference in New Issue
Block a user