Skip to content

Commit 2a96ba6

Browse files
author
Thomas ICHÉ
committed
Added new Samples / Updated Project to 4.9.0-preview
1 parent c62dfb0 commit 2a96ba6

145 files changed

Lines changed: 152008 additions & 2972 deletions

File tree

Some content is hidden

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

Assets/Gizmos.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.

Assets/Gizmos/Cinemachine.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.
64.6 KB
Loading

Assets/Gizmos/Cinemachine/cm_logo_lg.png.meta

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

Assets/HDRP/HDRenderPipelineAsset.asset

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,16 @@ MonoBehaviour:
4040
enableTransparentPostpass: 1
4141
enableDistortion: 1
4242
enablePostprocess: 1
43-
enableAsyncCompute: 1
4443
enableOpaqueObjects: 1
4544
enableTransparentObjects: 1
4645
enableRealtimePlanarReflection: 1
4746
enableMSAA: 0
47+
enableAsyncCompute: 1
48+
runLightListAsync: 1
49+
runSSRAsync: 1
50+
runSSAOAsync: 1
51+
runContactShadowsAsync: 1
52+
runVolumeVoxelizationAsync: 1
4853
lightLoopSettings:
4954
overrides: 0
5055
enableTileAndCluster: 1
@@ -79,11 +84,16 @@ MonoBehaviour:
7984
enableTransparentPostpass: 1
8085
enableDistortion: 1
8186
enablePostprocess: 1
82-
enableAsyncCompute: 1
8387
enableOpaqueObjects: 1
8488
enableTransparentObjects: 1
8589
enableRealtimePlanarReflection: 1
8690
enableMSAA: 0
91+
enableAsyncCompute: 1
92+
runLightListAsync: 1
93+
runSSRAsync: 1
94+
runSSAOAsync: 1
95+
runContactShadowsAsync: 1
96+
runVolumeVoxelizationAsync: 1
8797
lightLoopSettings:
8898
overrides: 0
8999
enableTileAndCluster: 1
@@ -118,11 +128,16 @@ MonoBehaviour:
118128
enableTransparentPostpass: 1
119129
enableDistortion: 0
120130
enablePostprocess: 0
121-
enableAsyncCompute: 1
122131
enableOpaqueObjects: 1
123132
enableTransparentObjects: 1
124133
enableRealtimePlanarReflection: 1
125134
enableMSAA: 0
135+
enableAsyncCompute: 1
136+
runLightListAsync: 1
137+
runSSRAsync: 1
138+
runSSAOAsync: 1
139+
runContactShadowsAsync: 1
140+
runVolumeVoxelizationAsync: 1
126141
lightLoopSettings:
127142
overrides: 0
128143
enableTileAndCluster: 1
@@ -141,12 +156,15 @@ MonoBehaviour:
141156
supportVolumetrics: 1
142157
increaseResolutionOfVolumetrics: 0
143158
supportLightLayers: 0
159+
supportDistortion: 1
160+
supportTransparentBackface: 1
161+
supportTransparentDepthPrepass: 1
162+
supportTransparentDepthPostpass: 1
144163
supportedLitShaderMode: 3
145164
supportDecals: 0
146-
supportMSAA: 0
147165
msaaSampleCount: 1
148166
supportMotionVectors: 1
149-
supportRuntimeDebugDisplay: 1
167+
supportRuntimeDebugDisplay: 0
150168
supportDitheringCrossFade: 1
151169
supportRayTracing: 0
152170
lightLoopSettings:
@@ -175,14 +193,14 @@ MonoBehaviour:
175193
maxShadowRequests: 128
176194
shadowMapsDepthBits: 32
177195
useDynamicViewportRescale: 1
178-
punctualShadowQuality: 0
179-
directionalShadowQuality: 0
196+
shadowQuality: 0
180197
decalSettings:
181198
drawDistance: 1000
182199
atlasWidth: 4096
183200
atlasHeight: 4096
184201
perChannelMask: 0
185202
allowShaderVariantStripping: 1
186203
enableSRPBatcher: 0
204+
enableVariantStrippingLog: 0
187205
diffusionProfileSettings: {fileID: 11400000, guid: cbe1ee9036c47b84ba1b8b3dbcde2aff,
188206
type: 2}

Assets/SampleLoader/SampleLoader.cs

Lines changed: 44 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
1-
using System.Text;
21
using System.Collections;
2+
using System.Collections.Generic;
33
using UnityEngine;
4-
using UnityEngine.Experimental.VFX;
54
using UnityEngine.UI;
65
using UnityEngine.SceneManagement;
76

87
public class SampleLoader : MonoBehaviour
98
{
109
[Header("Loading")]
11-
public string[] Playlist;
1210
public Image FullScreenBlack;
1311
public Text SceneNameText;
1412
public string ChangeButtonName = "Submit";
@@ -18,35 +16,61 @@ public class SampleLoader : MonoBehaviour
1816
public float fadeDuration = 2.0f;
1917

2018
[Header("Debug")]
19+
public GameObject DebugRoot;
2120
public Text FramerateText;
2221

23-
int index = 0;
22+
int next = 0;
2423
bool fading;
2524
bool loading;
2625
float fadeTTL;
2726
// Start is called before the first frame update
2827
void Start()
2928
{
30-
if (Playlist.Length > 0)
31-
StartCoroutine(LoadScene(Playlist[0]));
29+
if (SceneManager.sceneCountInBuildSettings > 1)
30+
StartCoroutine(LoadScene(0));
3231
}
3332

3433
void UpdateDebug()
3534
{
3635
if (FramerateText == null)
3736
return;
3837

39-
FramerateText.text = (1.0f / Time.smoothDeltaTime).ToString("F1");
38+
FramerateText.text = (1.0f / GetSmoothDeltaTime()).ToString("F1");
39+
}
40+
41+
Queue<float> deltaTimeSamples = new Queue<float>();
42+
const float smoothDeltaTimePeriod = 0.5f;
43+
44+
float GetSmoothDeltaTime()
45+
{
46+
float time = Time.unscaledTime;
47+
deltaTimeSamples.Enqueue(time);
48+
49+
if(deltaTimeSamples.Count > 1)
50+
{
51+
float startTime = deltaTimeSamples.Peek();
52+
float delta = time - startTime;
53+
54+
float smoothDelta = delta / deltaTimeSamples.Count;
4055

56+
if (delta > smoothDeltaTimePeriod)
57+
deltaTimeSamples.Dequeue();
58+
59+
return smoothDelta;
60+
}
61+
else
62+
return Time.unscaledDeltaTime;
4163
}
4264

4365

44-
// Update is called once per frame
4566
void Update()
4667
{
4768
if (Input.GetKeyDown(KeyCode.Escape))
4869
Application.Quit();
4970

71+
if (Input.GetKeyDown(KeyCode.F12) && DebugRoot != null)
72+
DebugRoot.SetActive(!DebugRoot.activeSelf);
73+
5074
UpdateDebug();
5175

5276
fadeTTL -= Time.unscaledDeltaTime;
@@ -56,17 +80,18 @@ void Update()
5680

5781
if (!loading && (Input.GetButton(ChangeButtonName) || Input.touchCount != 0 || (fadeTTL < 0.0f)))
5882
{
59-
int current = index;
60-
index = (index + 1) % Playlist.Length;
61-
StartCoroutine(LoadScene(Playlist[current], Playlist[index]));
83+
int current = next;
84+
next = (next + 1) % (SceneManager.sceneCountInBuildSettings - 1);
85+
StartCoroutine(LoadScene(current, next));
6286
}
6387
}
6488

65-
IEnumerator LoadScene(params string[] scene)
89+
IEnumerator LoadScene(params int[] scene)
6690
{
6791
loading = true;
6892

69-
string sceneToUnload = "", sceneToLoad;
93+
int sceneToUnload = -1, sceneToLoad;
94+
7095
if(scene.Length == 1)
7196
{
7297
sceneToLoad = scene[0];
@@ -77,24 +102,26 @@ IEnumerator LoadScene(params string[] scene)
77102
sceneToLoad = scene[1];
78103
}
79104

80-
if(scene.Length == 2)
105+
if(scene.Length == 2) // Need to unload
81106
{
82107
StartCoroutine(FadeInCoroutine());
83108
while (fading)
84109
yield return new WaitForEndOfFrame();
85110

86-
AsyncOperation unload = SceneManager.UnloadSceneAsync(sceneToUnload);
111+
AsyncOperation unload = SceneManager.UnloadSceneAsync(sceneToUnload+1);
87112
while (!unload.isDone)
88113
yield return new WaitForEndOfFrame();
89114

90115
}
91116

92-
SceneNameText.text = sceneToLoad;
117+
SceneNameText.text = "";
93118

94-
AsyncOperation load = SceneManager.LoadSceneAsync(sceneToLoad, LoadSceneMode.Additive);
119+
AsyncOperation load = SceneManager.LoadSceneAsync(sceneToLoad+1, LoadSceneMode.Additive);
95120
while (!load.isDone)
96121
yield return new WaitForEndOfFrame();
97122

123+
SceneNameText.text = SceneManager.GetSceneAt(1).name;
124+
98125
StartCoroutine(FadeOutCoroutine());
99126
while (fading)
100127
yield return new WaitForEndOfFrame();

Assets/Samples/ARRadar.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.

0 commit comments

Comments
 (0)