Skip to content

Commit c8db75f

Browse files
committed
Add Benchmark assets from URP 3D Sample
1 parent ae45788 commit c8db75f

Some content is hidden

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

44 files changed

+5610
-0
lines changed

Assets/SharedAssets.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/SharedAssets/Benchmark.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: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
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: 19101, guid: 0000000000000000e000000000000000, type: 0}
13+
m_Name: BenchmarkPanelSettings
14+
m_EditorClassIdentifier:
15+
themeUss: {fileID: -4733365628477956816, guid: 6d95650cc66853a48b4ff8f614921f1e, type: 3}
16+
m_DisableNoThemeWarning: 0
17+
m_TargetTexture: {fileID: 0}
18+
m_RenderMode: 0
19+
m_WorldSpaceLayer: 0
20+
m_ScaleMode: 2
21+
m_ReferenceSpritePixelsPerUnit: 100
22+
m_PixelsPerUnit: 100
23+
m_Scale: 1
24+
m_ReferenceDpi: 96
25+
m_FallbackDpi: 96
26+
m_ReferenceResolution: {x: 1280, y: 720}
27+
m_ScreenMatchMode: 0
28+
m_Match: 0
29+
m_SortingOrder: 0
30+
m_TargetDisplay: 0
31+
m_BindingLogLevel: 0
32+
m_ClearDepthStencil: 1
33+
m_ClearColor: 0
34+
m_ColorClearValue: {r: 0, g: 0, b: 0, a: 0}
35+
m_VertexBudget: 0
36+
m_DynamicAtlasSettings:
37+
m_MinAtlasSize: 64
38+
m_MaxAtlasSize: 4096
39+
m_MaxSubTextureSize: 64
40+
m_ActiveFilters: -1
41+
m_AtlasBlitShader: {fileID: 9101, guid: 0000000000000000f000000000000000, type: 0}
42+
m_RuntimeShader: {fileID: 9100, guid: 0000000000000000f000000000000000, type: 0}
43+
m_RuntimeWorldShader: {fileID: 9102, guid: 0000000000000000f000000000000000, type: 0}
44+
m_ICUDataAsset: {fileID: 0}
45+
forceGammaRendering: 0
46+
textSettings: {fileID: 0}

Assets/SharedAssets/Benchmark/BenchmarkPanelSettings.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: 190 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,190 @@
1+
%YAML 1.1
2+
%TAG !u! tag:unity3d.com,2011:
3+
--- !u!29 &1
4+
OcclusionCullingSettings:
5+
m_ObjectHideFlags: 0
6+
serializedVersion: 2
7+
m_OcclusionBakeSettings:
8+
smallestOccluder: 5
9+
smallestHole: 0.25
10+
backfaceThreshold: 100
11+
m_SceneGUID: 00000000000000000000000000000000
12+
m_OcclusionCullingData: {fileID: 0}
13+
--- !u!104 &2
14+
RenderSettings:
15+
m_ObjectHideFlags: 0
16+
serializedVersion: 10
17+
m_Fog: 0
18+
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
19+
m_FogMode: 3
20+
m_FogDensity: 0.01
21+
m_LinearFogStart: 0
22+
m_LinearFogEnd: 300
23+
m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
24+
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
25+
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
26+
m_AmbientIntensity: 1
27+
m_AmbientMode: 0
28+
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
29+
m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0}
30+
m_HaloStrength: 0.5
31+
m_FlareStrength: 1
32+
m_FlareFadeSpeed: 3
33+
m_HaloTexture: {fileID: 0}
34+
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
35+
m_DefaultReflectionMode: 0
36+
m_DefaultReflectionResolution: 128
37+
m_ReflectionBounces: 1
38+
m_ReflectionIntensity: 1
39+
m_CustomReflection: {fileID: 0}
40+
m_Sun: {fileID: 0}
41+
m_UseRadianceAmbientProbe: 0
42+
--- !u!157 &3
43+
LightmapSettings:
44+
m_ObjectHideFlags: 0
45+
serializedVersion: 12
46+
m_GISettings:
47+
serializedVersion: 2
48+
m_BounceScale: 1
49+
m_IndirectOutputScale: 1
50+
m_AlbedoBoost: 1
51+
m_EnvironmentLightingMode: 0
52+
m_EnableBakedLightmaps: 1
53+
m_EnableRealtimeLightmaps: 0
54+
m_LightmapEditorSettings:
55+
serializedVersion: 12
56+
m_Resolution: 2
57+
m_BakeResolution: 40
58+
m_AtlasSize: 1024
59+
m_AO: 0
60+
m_AOMaxDistance: 1
61+
m_CompAOExponent: 1
62+
m_CompAOExponentDirect: 0
63+
m_ExtractAmbientOcclusion: 0
64+
m_Padding: 2
65+
m_LightmapParameters: {fileID: 0}
66+
m_LightmapsBakeMode: 1
67+
m_TextureCompression: 1
68+
m_ReflectionCompression: 2
69+
m_MixedBakeMode: 2
70+
m_BakeBackend: 1
71+
m_PVRSampling: 1
72+
m_PVRDirectSampleCount: 32
73+
m_PVRSampleCount: 512
74+
m_PVRBounces: 2
75+
m_PVREnvironmentSampleCount: 256
76+
m_PVREnvironmentReferencePointCount: 2048
77+
m_PVRFilteringMode: 1
78+
m_PVRDenoiserTypeDirect: 1
79+
m_PVRDenoiserTypeIndirect: 1
80+
m_PVRDenoiserTypeAO: 1
81+
m_PVRFilterTypeDirect: 0
82+
m_PVRFilterTypeIndirect: 0
83+
m_PVRFilterTypeAO: 0
84+
m_PVREnvironmentMIS: 1
85+
m_PVRCulling: 1
86+
m_PVRFilteringGaussRadiusDirect: 1
87+
m_PVRFilteringGaussRadiusIndirect: 5
88+
m_PVRFilteringGaussRadiusAO: 2
89+
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
90+
m_PVRFilteringAtrousPositionSigmaIndirect: 2
91+
m_PVRFilteringAtrousPositionSigmaAO: 1
92+
m_ExportTrainingData: 0
93+
m_TrainingDataDestination: TrainingData
94+
m_LightProbeSampleCountMultiplier: 4
95+
m_LightingDataAsset: {fileID: 0}
96+
m_LightingSettings: {fileID: 0}
97+
--- !u!196 &4
98+
NavMeshSettings:
99+
serializedVersion: 2
100+
m_ObjectHideFlags: 0
101+
m_BuildSettings:
102+
serializedVersion: 3
103+
agentTypeID: 0
104+
agentRadius: 0.5
105+
agentHeight: 2
106+
agentSlope: 45
107+
agentClimb: 0.4
108+
ledgeDropHeight: 0
109+
maxJumpAcrossDistance: 0
110+
minRegionArea: 2
111+
manualCellSize: 0
112+
cellSize: 0.16666667
113+
manualTileSize: 0
114+
tileSize: 256
115+
buildHeightMesh: 0
116+
maxJobWorkers: 0
117+
preserveTilesOutsideBounds: 0
118+
debug:
119+
m_Flags: 0
120+
m_NavMeshData: {fileID: 0}
121+
--- !u!1001 &251696777
122+
PrefabInstance:
123+
m_ObjectHideFlags: 0
124+
serializedVersion: 2
125+
m_Modification:
126+
serializedVersion: 3
127+
m_TransformParent: {fileID: 0}
128+
m_Modifications:
129+
- target: {fileID: 1194520623583548762, guid: ef27707b7f6ec0343b7a177d22a225ca, type: 3}
130+
propertyPath: m_Name
131+
value: Benchmark
132+
objectReference: {fileID: 0}
133+
- target: {fileID: 3871017663001273271, guid: ef27707b7f6ec0343b7a177d22a225ca, type: 3}
134+
propertyPath: _stages.Array.data[1].sceneName
135+
value: GardenScene
136+
objectReference: {fileID: 0}
137+
- target: {fileID: 3871017663001273271, guid: ef27707b7f6ec0343b7a177d22a225ca, type: 3}
138+
propertyPath: _stages.Array.data[3].sceneName
139+
value: CockpitScene
140+
objectReference: {fileID: 0}
141+
- target: {fileID: 8132712973314222637, guid: ef27707b7f6ec0343b7a177d22a225ca, type: 3}
142+
propertyPath: m_LocalPosition.x
143+
value: 0
144+
objectReference: {fileID: 0}
145+
- target: {fileID: 8132712973314222637, guid: ef27707b7f6ec0343b7a177d22a225ca, type: 3}
146+
propertyPath: m_LocalPosition.y
147+
value: 0
148+
objectReference: {fileID: 0}
149+
- target: {fileID: 8132712973314222637, guid: ef27707b7f6ec0343b7a177d22a225ca, type: 3}
150+
propertyPath: m_LocalPosition.z
151+
value: 0
152+
objectReference: {fileID: 0}
153+
- target: {fileID: 8132712973314222637, guid: ef27707b7f6ec0343b7a177d22a225ca, type: 3}
154+
propertyPath: m_LocalRotation.w
155+
value: 1
156+
objectReference: {fileID: 0}
157+
- target: {fileID: 8132712973314222637, guid: ef27707b7f6ec0343b7a177d22a225ca, type: 3}
158+
propertyPath: m_LocalRotation.x
159+
value: 0
160+
objectReference: {fileID: 0}
161+
- target: {fileID: 8132712973314222637, guid: ef27707b7f6ec0343b7a177d22a225ca, type: 3}
162+
propertyPath: m_LocalRotation.y
163+
value: 0
164+
objectReference: {fileID: 0}
165+
- target: {fileID: 8132712973314222637, guid: ef27707b7f6ec0343b7a177d22a225ca, type: 3}
166+
propertyPath: m_LocalRotation.z
167+
value: 0
168+
objectReference: {fileID: 0}
169+
- target: {fileID: 8132712973314222637, guid: ef27707b7f6ec0343b7a177d22a225ca, type: 3}
170+
propertyPath: m_LocalEulerAnglesHint.x
171+
value: 0
172+
objectReference: {fileID: 0}
173+
- target: {fileID: 8132712973314222637, guid: ef27707b7f6ec0343b7a177d22a225ca, type: 3}
174+
propertyPath: m_LocalEulerAnglesHint.y
175+
value: 0
176+
objectReference: {fileID: 0}
177+
- target: {fileID: 8132712973314222637, guid: ef27707b7f6ec0343b7a177d22a225ca, type: 3}
178+
propertyPath: m_LocalEulerAnglesHint.z
179+
value: 0
180+
objectReference: {fileID: 0}
181+
m_RemovedComponents: []
182+
m_RemovedGameObjects: []
183+
m_AddedGameObjects: []
184+
m_AddedComponents: []
185+
m_SourcePrefab: {fileID: 100100000, guid: ef27707b7f6ec0343b7a177d22a225ca, type: 3}
186+
--- !u!1660057539 &9223372036854775807
187+
SceneRoots:
188+
m_ObjectHideFlags: 0
189+
m_Roots:
190+
- {fileID: 251696777}

Assets/SharedAssets/Benchmark/BenchmarkScene.unity.meta

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
using System.Collections;
2+
using UnityEngine;
3+
using UnityEngine.InputSystem;
4+
using UnityEngine.SceneManagement;
5+
6+
namespace Benchmarking
7+
{
8+
public class BenchmarkShortcutManager : MonoBehaviour
9+
{
10+
private static BenchmarkShortcutManager s_instance;
11+
public static BenchmarkShortcutManager instance
12+
{
13+
get
14+
{
15+
if (s_instance == null)
16+
GetOrCreate();
17+
18+
return s_instance;
19+
}
20+
}
21+
22+
[RuntimeInitializeOnLoadMethod]
23+
private static void GetOrCreate()
24+
{
25+
s_instance = FindFirstObjectByType<BenchmarkShortcutManager>();
26+
if (s_instance == null)
27+
{
28+
var go = new GameObject("Benchmark Shortcut Manager");
29+
s_instance = go.AddComponent<BenchmarkShortcutManager>();
30+
}
31+
32+
DontDestroyOnLoad(s_instance.gameObject);
33+
}
34+
35+
private void Awake()
36+
{
37+
if (s_instance != null)
38+
{
39+
Destroy(gameObject);
40+
return;
41+
}
42+
43+
s_instance = this;
44+
DontDestroyOnLoad(s_instance.gameObject);
45+
46+
#if ENABLE_INPUT_SYSTEM
47+
var action = new InputAction();
48+
action.AddCompositeBinding("ButtonWithOneModifier")
49+
.With("Button", "<Keyboard>/B")
50+
.With("Modifier", "<Keyboard>/leftShift")
51+
.With("Modifier", "<Keyboard>/rightShift");
52+
action.performed += ctx => StartBenchmark();
53+
action.Enable();
54+
55+
UnityEngine.InputSystem.EnhancedTouch.EnhancedTouchSupport.Enable();
56+
#endif
57+
}
58+
59+
60+
#if ENABLE_INPUT_SYSTEM
61+
// TODO: make this an action ?
62+
public void Update()
63+
{
64+
if (SystemInfo.deviceType != DeviceType.Handheld)
65+
return;
66+
67+
if (UnityEngine.InputSystem.EnhancedTouch.Touch.activeFingers.Count > 3)
68+
StartBenchmark();
69+
}
70+
#endif
71+
72+
#if !ENABLE_INPUT_SYSTEM
73+
void Update()
74+
{
75+
if (SystemInfo.deviceType == DeviceType.Handheld)
76+
{
77+
if (Input.touchCount > 3 )
78+
StartBenchmark();
79+
}
80+
else
81+
{
82+
if (Input.GetKey(KeyCode.LeftShift) || Input.GetKey(KeyCode.RightShift))
83+
if (Input.GetKeyDown(KeyCode.B) && !PerformanceTest.RunningBenchmark)
84+
StartBenchmark();
85+
}
86+
}
87+
#endif
88+
89+
private bool availableToStart = true;
90+
void StartBenchmark()
91+
{
92+
if (!PerformanceTest.RunningBenchmark && availableToStart)
93+
{
94+
StartCoroutine(WaitingTime());
95+
SceneManager.LoadScene("BenchmarkScene");
96+
}
97+
}
98+
99+
IEnumerator WaitingTime()
100+
{
101+
availableToStart = false;
102+
yield return new WaitForSeconds(5);
103+
availableToStart = true;
104+
}
105+
}
106+
}

Assets/SharedAssets/Benchmark/BenchmarkShortcutManager.cs.meta

Lines changed: 11 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)