Skip to content

Commit 424face

Browse files
sandrade-dclgonpombo8fzavaliapbosiodavidejensen
authored
Release 2023-08-16 (#5593)
* bump scene-runtime. Fix sdk sourcemaps (#5554) * feat: Integrate single sign on (#5548) * feat: Integrate single sign on * fix: Update client * fix: Update client * fix: Update single sign on client * fix: Update client * feat: Update sso client * feat: Update sso client * feat: Sso url by query param * fix: Update package * fix: add `sourceType` property to `getActiveVideoStreams` response (#5571) * fix: Update sso client (#5570) * fix: removed link escaping when sending to kernel (#5568) * Reduce the transaction amount again (#5578) * Feat: camera reel polishing (#5544) ## What does this PR change? This PR polishes CameraReel and Screencapture features (for the InWorld Camera initiative). It includes major refactoring of both components. On screencapture side - Cinemachine was introduced in Camera movement logic - Screenshot capturing HDR fixed, but with heavy texture upsacle, crop and resize operations - Name tags added also to Avatar On Camera Reel (Gallery) there were a lot of refactoring and polishing, adding transition and missing logic - Metrics were also added ## How to test the changes? You can follow this page to check all requirements https://www.notion.so/decentraland/In-World-Camera-736683ff6b2d4532ad71c873f7de522d - ScreenCapture 1. Launch the explorer 2. Open screencapture camera by button below minimap or via keyboard C 3. Position camera by moving it (see shortcuts in the bottom-left). Check that you cannot pass through colliders and that you cannot go super far away (it should be bounded by sphere around of the player ~16 meters) 4. Check that all buttons in this view are functional - you can take close it, show/hide shortcut panel, take screenshot (animation should be there with SFX), and open CameraRell - CameraReel Gallery 1. Open Gallery via shortcut K or in the ExploreMenu 2. Check sorting of the images and that new pictures added as first (at the top-left). 3. Check that you can delete/copy link/share twitter from the 3 dots on each picture 4. Check that downloaded resolution of pictures is 1920x1080 no matter what resolutions was your screen - CameraReel Screenshot Viewer 1. Open one screenshot from the Gallery by clicking on it 2. Verify that you can see persons and wearables info on the ride panel 3. Verify that you can jump to a place by clicking on the Scene button in the right panel 4. Veriy that you can open Marketplace by clicking on the Wearables from the list * chore: bumping schema versions and fixing test (#5581) Co-authored-by: Agustina Aldasoro <agusaldasoro@users.noreply.github.com> * style: info card thumbnail position (#5576) * style: channels modals and menus (#5575) * feat: implemented portable experience white list (#5587) * style: fix social panels horizontal position (#5590) * feat: portable experiences ui improvements (#5507) * style: copy toast (#5564) * Update DebugView.prefab * Add missing meta files * feat: discover tab redesign (#5521) * Feat: rework of explore panel * Minor changes to places panel UI * Added visit count and user rating, removed additional highlights * Minor UI fix * Minor fix to retrieve favorites * Removed highlights tab and added upvote/downvote logic * Added upvote and downvote states * Show more button fixes * Minor UI adaptations to new places card * Added filter and sorting options * Fixed place modal and test * Implement "SortBy" dropdown * Fix favorite button in place cards * Add SORT BY title & fix anchors * Update like icon in the place card * Update like icon in the place card (II) * Full redesign of place card modal * Add “like percentage” tooltip in the place card modal * Fix tests * Full width for the events container * Add and load filter controls (UI) * Minor fixes in Places section * Make Events section load upcoming by default * Make Events section load upcoming by default (II) * New filters: "Featured", "Trending" and "Want to go" * Fix names in the category dropdown filter * New filters: "Frequency" and "Category" * Fix tests * Fix tests * Create RangeSlider extension class * Fix tests * Update TexturesUI.spriteatlas * Update frequency filter's query * Test * Revert "Test" This reverts commit 65acd87. * Fix build * Create new RangeSlider UI Components * Add Time dropdown filter UI control in Events section * New filter: "Time" * Fix tests * UI re-design of the event's card (part 1) * Minor fixes * Minor fixes * Add number of users in event card * Fix POI filters in Places section * Always we filter by POI/FEATURED, we will change the sorting to HIGH RATED * Minor fixes in the Events section * Re-design event modal * Revert "Re-design event modal" This reverts commit c1f41b5. * Re-design event modal (I) * Re-design event modal (II) * Use new endpoint to get all POIs * Fix tests * Apply visual feedback (I) * Fix weird line in the hover of the cards * Update POI's endpoint * Fix weird line in the hover of the cards (II) * Add hover states to the filter buttons * Manage guest mode * Add hover states to the place card buttons * Make the whole cards clickable * Load only event's categories in use * Update EventCard_Long.prefab * Code cleaning * Apply visual feedback (II) * Some polishments * Update PlaceCardComponentView.cs * Update ExploreV2Menu.prefab * Add secondary jumpin button in event card modal * Set a length limit to the event's title * Apply code review's feedback * Fix tests * Add metrics for like/dislike places * Manage guests for fav/like/dislike * Manage guests for fav/like/dislike (II) * Fix dragger helper in places sub-section * Reset scroll position for place/event modal * Fix tests * Featured events carousel polishments * Some polishments * More polishments --------- Co-authored-by: Santi Andrade <sandrade@decentraland.org> * fix: fix leave icon in channel menu (#5597) Fix leave icon * fix: 'file' named textures not loading (#5596) * Hotfix: black screenshots on WebGL (#5595) ## What does this PR change? Replaced waitForEndOfFrame and unity built screenshot feature by Rendering into RenderTexture that solves black screenshots issue. It is not optimized and optimization will continue on [this branch](#5594), by replacing Creation/Destruction logic with RenderTexture.Get/ReleaseTemporary calls and caching ## How to test the changes? 1. Launch the explorer 2. Open screenshot camera (C) 3. Spam shot screenshots like crazy 🤪 4. Verify no black screenshots are taken 5. Verify no missing transition animations when taking screenshots 6. Verify screenshot image is the same as frame view and has 1920x1080 resolution and looks same (or better) as in-game view (has Bloom, Ambient occlusion, etc.) ## Our Code Review Standards https://github.com/decentraland/unity-renderer/blob/master/docs/code-review-standards.md ## Copilot summary <!-- copilot:summary --> ### <samp>🤖 Generated by Copilot at aea1e5d</samp> This pull request enhances the screenshot feature by using the Universal Render Pipeline to render and crop the camera output, and by refactoring the SkyboxCamera and ScreenRecorder classes to improve the code quality and the skybox rendering. It also updates the assembly definitions to include the necessary references. --------- Co-authored-by: Gon Pombo <gonzalo@decentraland.org> Co-authored-by: Fernando Zavalia <24811313+fzavalia@users.noreply.github.com> Co-authored-by: pbosio <pato@decentraland.org> Co-authored-by: davidejensen <davidejensen@live.it> Co-authored-by: Ashley Canning <ashley.canning@decentraland.org> Co-authored-by: Vitaly Popuzin <35366872+popuz@users.noreply.github.com> Co-authored-by: Miguel Oliva <moliva@users.noreply.github.com> Co-authored-by: Agustina Aldasoro <agusaldasoro@users.noreply.github.com> Co-authored-by: RominaMarchetti <51088292+RominaMarchetti@users.noreply.github.com> Co-authored-by: Nicolas Lorusso <56365551+lorux0@users.noreply.github.com> Co-authored-by: Patricio Guerra <kinerius@decentraland.org>
1 parent ba7bf26 commit 424face

File tree

150 files changed

+34041
-21365
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

150 files changed

+34041
-21365
lines changed

unity-renderer/Assets/AddressableAssetsData/AddressableAssetSettings.asset

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ MonoBehaviour:
5858
- {fileID: 11400000, guid: f4354ea28d1af7a4aabaac70fcb83933, type: 2}
5959
- {fileID: 11400000, guid: d004c5b62f4364cddbf08486300adc75, type: 2}
6060
- {fileID: 11400000, guid: ca9e28a3bdf76514a971ee4dab74607c, type: 2}
61+
- {fileID: 11400000, guid: 90968b9c92a084c9c8a44c744ce97b08, type: 2}
6162
m_BuildSettings:
6263
m_CompileScriptsInVirtualMode: 0
6364
m_CleanupStreamingAssetsAfterBuilds: 1

unity-renderer/Assets/AddressableAssetsData/AssetGroups/Duplicate Asset Isolation1.asset

Lines changed: 710 additions & 0 deletions
Large diffs are not rendered by default.

unity-renderer/Assets/AddressableAssetsData/AssetGroups/Duplicate Asset Isolation1.asset.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
%YAML 1.1
2+
%TAG !u! tag:unity3d.com,2011:
3+
--- !u!114 &11400000
4+
MonoBehaviour:
5+
m_ObjectHideFlags: 0
6+
m_CorrespondingSourceObject: {fileID: 0}
7+
m_PrefabInstance: {fileID: 0}
8+
m_PrefabAsset: {fileID: 0}
9+
m_GameObject: {fileID: 0}
10+
m_Enabled: 1
11+
m_EditorHideFlags: 0
12+
m_Script: {fileID: 11500000, guid: e5d17a21594effb4e9591490b009e7aa, type: 3}
13+
m_Name: Duplicate Asset Isolation1_BundledAssetGroupSchema
14+
m_EditorClassIdentifier:
15+
m_Group: {fileID: 11400000, guid: 90968b9c92a084c9c8a44c744ce97b08, type: 2}
16+
m_InternalBundleIdMode: 1
17+
m_Compression: 1
18+
m_IncludeAddressInCatalog: 1
19+
m_IncludeGUIDInCatalog: 1
20+
m_IncludeLabelsInCatalog: 1
21+
m_InternalIdNamingMode: 0
22+
m_CacheClearBehavior: 0
23+
m_IncludeInBuild: 1
24+
m_BundledAssetProviderType:
25+
m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
26+
m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.BundledAssetProvider
27+
m_ForceUniqueProvider: 0
28+
m_UseAssetBundleCache: 1
29+
m_UseAssetBundleCrc: 1
30+
m_UseAssetBundleCrcForCachedBundles: 1
31+
m_UseUWRForLocalBundles: 0
32+
m_Timeout: 0
33+
m_ChunkedTransfer: 0
34+
m_RedirectLimit: -1
35+
m_RetryCount: 0
36+
m_BuildPath:
37+
m_Id: 0f0c8053dfdfc8948bf4fe3581dcae4b
38+
m_LoadPath:
39+
m_Id: 1d7a2f926c51ab64086dffd3ec97813b
40+
m_BundleMode: 0
41+
m_AssetBundleProviderType:
42+
m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
43+
m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.AssetBundleProvider
44+
m_BundleNaming: 0
45+
m_AssetLoadMode: 0

unity-renderer/Assets/AddressableAssetsData/AssetGroups/Schemas/Duplicate Asset Isolation1_BundledAssetGroupSchema.asset.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
%YAML 1.1
2+
%TAG !u! tag:unity3d.com,2011:
3+
--- !u!114 &11400000
4+
MonoBehaviour:
5+
m_ObjectHideFlags: 0
6+
m_CorrespondingSourceObject: {fileID: 0}
7+
m_PrefabInstance: {fileID: 0}
8+
m_PrefabAsset: {fileID: 0}
9+
m_GameObject: {fileID: 0}
10+
m_Enabled: 1
11+
m_EditorHideFlags: 0
12+
m_Script: {fileID: 11500000, guid: 5834b5087d578d24c926ce20cd31e6d6, type: 3}
13+
m_Name: Duplicate Asset Isolation1_ContentUpdateGroupSchema
14+
m_EditorClassIdentifier:
15+
m_Group: {fileID: 11400000, guid: 90968b9c92a084c9c8a44c744ce97b08, type: 2}
16+
m_StaticContent: 1

unity-renderer/Assets/AddressableAssetsData/AssetGroups/Schemas/Duplicate Asset Isolation1_ContentUpdateGroupSchema.asset.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

unity-renderer/Assets/DCLFeatures/ScreencaptureCamera/CameraObject/Scripts/ScreenRecorder.cs

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
using System;
2+
using System.Collections.Generic;
23
using UnityEngine;
4+
using UnityEngine.Experimental.Rendering;
5+
using UnityEngine.Rendering.Universal;
6+
using Object = UnityEngine.Object;
37

48
namespace DCLFeatures.ScreencaptureCamera.CameraObject
59
{
@@ -20,6 +24,65 @@ public ScreenRecorder(RectTransform canvasRectTransform)
2024
this.canvasRectTransform = canvasRectTransform;
2125
}
2226

27+
public Texture2D CaptureScreenshotWithRenderTexture(Camera baseCamera)
28+
{
29+
ScreenFrameData currentScreenFrame = CalculateCurrentScreenFrame();
30+
(ScreenFrameData targetScreenFrame, _) = CalculateTargetScreenFrame(currentScreenFrame);
31+
32+
RenderTexture initialRenderTexture = new RenderTexture(targetScreenFrame.ScreenWidthInt, targetScreenFrame.ScreenHeightInt, 0, DefaultFormat.HDR);
33+
34+
UniversalAdditionalCameraData baseCameraData = baseCamera.GetUniversalAdditionalCameraData();
35+
36+
// Set the base camera's target texture
37+
RenderTexture originalTargetTexture = baseCamera.targetTexture;
38+
baseCamera.targetTexture = initialRenderTexture;
39+
40+
// Iterate through all overlay cameras and set their target textures
41+
var overlayCameras = baseCameraData.cameraStack;
42+
var originalOverlayTargetTextures = new List<RenderTexture>();
43+
44+
if (overlayCameras != null)
45+
{
46+
foreach (Camera overlayCamera in overlayCameras)
47+
{
48+
originalOverlayTargetTextures.Add(overlayCamera.targetTexture);
49+
overlayCamera.targetTexture = initialRenderTexture;
50+
}
51+
}
52+
53+
// Render the cameras to the RenderTexture
54+
baseCamera.Render();
55+
56+
baseCamera.targetTexture = originalTargetTexture;
57+
58+
if (overlayCameras != null)
59+
{
60+
// Revert the target textures of the base and overlay cameras
61+
for (var i = 0; i < overlayCameras.Count; i++)
62+
overlayCameras[i].targetTexture = originalOverlayTargetTextures[i];
63+
}
64+
65+
// Create an intermediate RenderTexture with the size of the cropped area
66+
RenderTexture finalRenderTexture = new RenderTexture(initialRenderTexture.width, initialRenderTexture.height, 0);
67+
Graphics.Blit(initialRenderTexture, finalRenderTexture);
68+
69+
// Read the pixels from the RenderTexture
70+
RenderTexture.active = finalRenderTexture;
71+
72+
var corners = targetScreenFrame.CalculateFrameCorners();
73+
Texture2D screenshot = new Texture2D(TARGET_FRAME_WIDTH, TARGET_FRAME_HEIGHT, TextureFormat.RGB24, false);
74+
screenshot.ReadPixels(new Rect(corners.x, corners.y, TARGET_FRAME_WIDTH, TARGET_FRAME_HEIGHT), 0, 0);
75+
screenshot.Apply();
76+
RenderTexture.active = null;
77+
78+
// Clean up
79+
Object.Destroy(initialRenderTexture);
80+
Object.Destroy(finalRenderTexture);
81+
82+
return screenshot;
83+
}
84+
85+
2386
public virtual Texture2D CaptureScreenshot()
2487
{
2588
ScreenFrameData currentScreenFrame = CalculateCurrentScreenFrame();

unity-renderer/Assets/DCLFeatures/ScreencaptureCamera/CameraObject/Scripts/ScreencaptureCameraBehaviour.cs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -191,20 +191,18 @@ internal void SetExternalDependencies(BooleanVariable allUIHidden, BooleanVariab
191191

192192
public void CaptureScreenshot(string source)
193193
{
194-
StopAllCoroutines();
195-
StartCoroutine(CaptureScreenshotAtTheFrameEnd(source));
194+
CaptureScreenshotAtTheFrameEnd(source);
196195
}
197196

198-
private IEnumerator CaptureScreenshotAtTheFrameEnd(string source)
197+
private void CaptureScreenshotAtTheFrameEnd(string source)
199198
{
200-
if (!isScreencaptureCameraActive.Get() || isGuest || isOnCooldown || !storageStatus.HasFreeSpace) yield break;
199+
if (!isScreencaptureCameraActive.Get() || isGuest || isOnCooldown || !storageStatus.HasFreeSpace) return;
201200

202201
lastScreenshotTime = Time.realtimeSinceStartup;
203202

204203
screencaptureCameraHUDController.SetVisibility(false, storageStatus.HasFreeSpace);
205-
yield return waitEndOfFrameYield;
206204

207-
Texture2D screenshot = screenRecorderLazy.CaptureScreenshot();
205+
Texture2D screenshot = screenRecorderLazy.CaptureScreenshotWithRenderTexture(SkyboxController.i.SkyboxCamera.BaseCamera);
208206

209207
screencaptureCameraHUDController.SetVisibility(true, storageStatus.HasFreeSpace);
210208
screencaptureCameraHUDController.PlayScreenshotFX(screenshot, SPLASH_FX_DURATION, MIDDLE_PAUSE_FX_DURATION, IMAGE_TRANSITION_FX_DURATION);

unity-renderer/Assets/DCLFeatures/ScreencaptureCamera/ScreenshotCamera.asmdef

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@
3535
"GUID:fc6576239b03d8445ba1a26d4b7b7b5d",
3636
"GUID:49176a91bbf7f8a4aaf35f6df0643d1a",
3737
"GUID:6426fc92c49cbb342916620a1009be8d",
38-
"GUID:4307f53044263cf4b835bd812fc161a4"
38+
"GUID:4307f53044263cf4b835bd812fc161a4",
39+
"GUID:15fc0a57446b3144c949da3e2b9737a9"
3940
],
4041
"includePlatforms": [],
4142
"excludePlatforms": [],

0 commit comments

Comments
 (0)