Skip to content

Commit

Permalink
Added new Samples / Updated Project to 4.9.0-preview
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas ICHÉ committed Feb 7, 2019
1 parent c62dfb0 commit 2a96ba6
Show file tree
Hide file tree
Showing 145 changed files with 152,008 additions and 2,972 deletions.
8 changes: 8 additions & 0 deletions Assets/Gizmos.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Assets/Gizmos/Cinemachine.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added Assets/Gizmos/Cinemachine/cm_logo_lg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
88 changes: 88 additions & 0 deletions Assets/Gizmos/Cinemachine/cm_logo_lg.png.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 25 additions & 7 deletions Assets/HDRP/HDRenderPipelineAsset.asset
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,16 @@ MonoBehaviour:
enableTransparentPostpass: 1
enableDistortion: 1
enablePostprocess: 1
enableAsyncCompute: 1
enableOpaqueObjects: 1
enableTransparentObjects: 1
enableRealtimePlanarReflection: 1
enableMSAA: 0
enableAsyncCompute: 1
runLightListAsync: 1
runSSRAsync: 1
runSSAOAsync: 1
runContactShadowsAsync: 1
runVolumeVoxelizationAsync: 1
lightLoopSettings:
overrides: 0
enableTileAndCluster: 1
Expand Down Expand Up @@ -79,11 +84,16 @@ MonoBehaviour:
enableTransparentPostpass: 1
enableDistortion: 1
enablePostprocess: 1
enableAsyncCompute: 1
enableOpaqueObjects: 1
enableTransparentObjects: 1
enableRealtimePlanarReflection: 1
enableMSAA: 0
enableAsyncCompute: 1
runLightListAsync: 1
runSSRAsync: 1
runSSAOAsync: 1
runContactShadowsAsync: 1
runVolumeVoxelizationAsync: 1
lightLoopSettings:
overrides: 0
enableTileAndCluster: 1
Expand Down Expand Up @@ -118,11 +128,16 @@ MonoBehaviour:
enableTransparentPostpass: 1
enableDistortion: 0
enablePostprocess: 0
enableAsyncCompute: 1
enableOpaqueObjects: 1
enableTransparentObjects: 1
enableRealtimePlanarReflection: 1
enableMSAA: 0
enableAsyncCompute: 1
runLightListAsync: 1
runSSRAsync: 1
runSSAOAsync: 1
runContactShadowsAsync: 1
runVolumeVoxelizationAsync: 1
lightLoopSettings:
overrides: 0
enableTileAndCluster: 1
Expand All @@ -141,12 +156,15 @@ MonoBehaviour:
supportVolumetrics: 1
increaseResolutionOfVolumetrics: 0
supportLightLayers: 0
supportDistortion: 1
supportTransparentBackface: 1
supportTransparentDepthPrepass: 1
supportTransparentDepthPostpass: 1
supportedLitShaderMode: 3
supportDecals: 0
supportMSAA: 0
msaaSampleCount: 1
supportMotionVectors: 1
supportRuntimeDebugDisplay: 1
supportRuntimeDebugDisplay: 0
supportDitheringCrossFade: 1
supportRayTracing: 0
lightLoopSettings:
Expand Down Expand Up @@ -175,14 +193,14 @@ MonoBehaviour:
maxShadowRequests: 128
shadowMapsDepthBits: 32
useDynamicViewportRescale: 1
punctualShadowQuality: 0
directionalShadowQuality: 0
shadowQuality: 0
decalSettings:
drawDistance: 1000
atlasWidth: 4096
atlasHeight: 4096
perChannelMask: 0
allowShaderVariantStripping: 1
enableSRPBatcher: 0
enableVariantStrippingLog: 0
diffusionProfileSettings: {fileID: 11400000, guid: cbe1ee9036c47b84ba1b8b3dbcde2aff,
type: 2}
61 changes: 44 additions & 17 deletions Assets/SampleLoader/SampleLoader.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
using System.Text;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Experimental.VFX;
using UnityEngine.UI;
using UnityEngine.SceneManagement;

public class SampleLoader : MonoBehaviour
{
[Header("Loading")]
public string[] Playlist;
public Image FullScreenBlack;
public Text SceneNameText;
public string ChangeButtonName = "Submit";
Expand All @@ -18,35 +16,61 @@ public class SampleLoader : MonoBehaviour
public float fadeDuration = 2.0f;

[Header("Debug")]
public GameObject DebugRoot;
public Text FramerateText;

int index = 0;
int next = 0;
bool fading;
bool loading;
float fadeTTL;
// Start is called before the first frame update
void Start()
{
if (Playlist.Length > 0)
StartCoroutine(LoadScene(Playlist[0]));
if (SceneManager.sceneCountInBuildSettings > 1)
StartCoroutine(LoadScene(0));
}

void UpdateDebug()
{
if (FramerateText == null)
return;

FramerateText.text = (1.0f / Time.smoothDeltaTime).ToString("F1");
FramerateText.text = (1.0f / GetSmoothDeltaTime()).ToString("F1");
}

Queue<float> deltaTimeSamples = new Queue<float>();
const float smoothDeltaTimePeriod = 0.5f;

float GetSmoothDeltaTime()
{
float time = Time.unscaledTime;
deltaTimeSamples.Enqueue(time);

if(deltaTimeSamples.Count > 1)
{
float startTime = deltaTimeSamples.Peek();
float delta = time - startTime;

float smoothDelta = delta / deltaTimeSamples.Count;

if (delta > smoothDeltaTimePeriod)
deltaTimeSamples.Dequeue();

return smoothDelta;
}
else
return Time.unscaledDeltaTime;
}


// Update is called once per frame
void Update()
{
if (Input.GetKeyDown(KeyCode.Escape))
Application.Quit();

if (Input.GetKeyDown(KeyCode.F12) && DebugRoot != null)
DebugRoot.SetActive(!DebugRoot.activeSelf);

UpdateDebug();

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

if (!loading && (Input.GetButton(ChangeButtonName) || Input.touchCount != 0 || (fadeTTL < 0.0f)))
{
int current = index;
index = (index + 1) % Playlist.Length;
StartCoroutine(LoadScene(Playlist[current], Playlist[index]));
int current = next;
next = (next + 1) % (SceneManager.sceneCountInBuildSettings - 1);
StartCoroutine(LoadScene(current, next));
}
}

IEnumerator LoadScene(params string[] scene)
IEnumerator LoadScene(params int[] scene)
{
loading = true;

string sceneToUnload = "", sceneToLoad;
int sceneToUnload = -1, sceneToLoad;

if(scene.Length == 1)
{
sceneToLoad = scene[0];
Expand All @@ -77,24 +102,26 @@ IEnumerator LoadScene(params string[] scene)
sceneToLoad = scene[1];
}

if(scene.Length == 2)
if(scene.Length == 2) // Need to unload
{
StartCoroutine(FadeInCoroutine());
while (fading)
yield return new WaitForEndOfFrame();

AsyncOperation unload = SceneManager.UnloadSceneAsync(sceneToUnload);
AsyncOperation unload = SceneManager.UnloadSceneAsync(sceneToUnload+1);
while (!unload.isDone)
yield return new WaitForEndOfFrame();

}

SceneNameText.text = sceneToLoad;
SceneNameText.text = "";

AsyncOperation load = SceneManager.LoadSceneAsync(sceneToLoad, LoadSceneMode.Additive);
AsyncOperation load = SceneManager.LoadSceneAsync(sceneToLoad+1, LoadSceneMode.Additive);
while (!load.isDone)
yield return new WaitForEndOfFrame();

SceneNameText.text = SceneManager.GetSceneAt(1).name;

StartCoroutine(FadeOutCoroutine());
while (fading)
yield return new WaitForEndOfFrame();
Expand Down
8 changes: 8 additions & 0 deletions Assets/Samples/ARRadar.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 2a96ba6

Please sign in to comment.