浏览代码

Merge remote-tracking branch 'refs/remotes/origin/master' into Update-shadow

/Branch_Batching2
sebastienlagarde 8 年前
当前提交
0e9f5de7
共有 14 个文件被更改,包括 110 次插入21 次删除
  1. 32
      Assets/TestScenes/Common/Scripts/MiniProfiler.cs
  2. 4
      Assets/TestScenes/HDTest/NewBatcherTest.meta
  3. 4
      Assets/TestScenes/HDTest/NewBatcherTest/Prefabs/Capsule.prefab
  4. 4
      Assets/TestScenes/HDTest/NewBatcherTest/Prefabs/Cube.prefab
  5. 4
      Assets/TestScenes/HDTest/NewBatcherTest/Prefabs/Cylinder.prefab
  6. 4
      Assets/TestScenes/HDTest/NewBatcherTest/Prefabs/Sphere.prefab
  7. 6
      Assets/TestScenes/HDTest/NewBatcherTest/matbench_2.mat
  8. 7
      ProjectSettings/EditorBuildSettings.asset
  9. 5
      ProjectSettings/ProjectSettings.asset
  10. 8
      Assets/TestScenes/HDTest/NewBatcherBench2.unity.meta
  11. 41
      Assets/TestScenes/HDTest/NewBatcherTest/Mover.cs
  12. 12
      Assets/TestScenes/HDTest/NewBatcherTest/Mover.cs.meta

32
Assets/TestScenes/Common/Scripts/MiniProfiler.cs


public class MiniProfiler : MonoBehaviour {
public bool m_Enable = false;
public bool m_Enable = true;
private bool m_UseNewBatcher = false;
internal class RecorderEntry
{

new RecorderEntry() { name="RenderLoop.Draw" },
// new RecorderEntry() { name="BatchRenderer.Flush" },
new RecorderEntry() { name="Shadows.Draw" },
new RecorderEntry() { name="BatchRenderer.ApplyShaderPass" },
// new RecorderEntry() { name="BatchRenderer.ApplyShaderPass" },
// new RecorderEntry() { name="Batch.DrawStatic" },
// new RecorderEntry() { name="DrawBuffersBatchMode" },
/*
new RecorderEntry() { name="NewBatch.Instances" },
new RecorderEntry() { name="NewBatch.Elements" },
new RecorderEntry() { name="NewBatch.DrawRanges" },
new RecorderEntry() { name="NewBatch.S-Instances" },
new RecorderEntry() { name="NewBatch.S-Elements" },
new RecorderEntry() { name="NewBatch.S-DrawRanges" },
*/
/*
new RecorderEntry() { name="gBatchGBufferObj" },

/*
new RecorderEntry() { name="Camera.Render" },
new RecorderEntry() { name="GUI.Repaint" },
new RecorderEntry() { name="PrepareValues" },
new RecorderEntry() { name="ApplyGpuProgram" },

if (m_Enable)
{
/*
GUI.changed = false;
if ( !Application.isEditor )
{
m_UseNewBatcher = GUI.Toggle(new Rect(10, 30, 200, 20), m_UseNewBatcher, "Use new render batch");
if (GUI.changed)
{
UnityEngine.Experimental.Rendering.ScriptableRenderContext.UseNewBatchRenderer(m_UseNewBatcher);
}
}
*/
float w = 500, h = 204;
float w = 500, h = 24 + (recordersList.Length+1) * 16 + 8;
GUILayout.BeginArea(new Rect(10, 150, w, h), "Mini Profiler", GUI.skin.window);
GUILayout.BeginArea(new Rect(10, 50, w, h), "Mini Profiler", GUI.skin.window);
string sLabel = System.String.Format("<b>{0:F2} FPS ({1:F2}ms)</b>\n", 1.0f / m_AvgDeltaTime, Time.deltaTime * 1000.0f);
for (int i = 0; i < recordersList.Length; i++)
{

4
Assets/TestScenes/HDTest/NewBatcherTest.meta


fileFormatVersion: 2
guid: 01a0eae0646089f489a0047dc8afb564
guid: 0ce05dc93eb4c90438b867f03422566b
timeCreated: 1493224766
timeCreated: 1493135841
licenseType: Pro
DefaultImporter:
userData:

4
Assets/TestScenes/HDTest/NewBatcherTest/Prefabs/Capsule.prefab


m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1121459876145138}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_CastShadows: 1
m_ReceiveShadows: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1

4
Assets/TestScenes/HDTest/NewBatcherTest/Prefabs/Cube.prefab


m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1998597619220778}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_CastShadows: 1
m_ReceiveShadows: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1

4
Assets/TestScenes/HDTest/NewBatcherTest/Prefabs/Cylinder.prefab


m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1152223544549600}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_CastShadows: 1
m_ReceiveShadows: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1

4
Assets/TestScenes/HDTest/NewBatcherTest/Prefabs/Sphere.prefab


m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1452448021178366}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_CastShadows: 1
m_ReceiveShadows: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1

6
Assets/TestScenes/HDTest/NewBatcherTest/matbench_2.mat


m_Shader: {fileID: 4800000, guid: 6e4ae4064600d784cac1e41a9e6f2e59, type: 3}
m_ShaderKeywords: _ALPHACUTOFFENABLE_OFF _DEPTHOFFSETENABLE_OFF _DISTORTIONDEPTHTEST_OFF
_DISTORTIONENABLE_OFF _DISTORTIONONLY_OFF _DOUBLESIDEDENABLE_OFF _ENABLEPERPIXELDISPLACEMENT_OFF
_ENABLEWIND_OFF _NORMALMAP_TANGENT_SPACE
_ENABLEWIND_OFF _NORMALMAP _NORMALMAP_TANGENT_SPACE
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_CustomRenderQueue: -1

m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _NormalMap:
m_Texture: {fileID: 0}
m_Texture: {fileID: 2800000, guid: 3f3b8bdf3ccd30c4fb97b62bd26ef1f6, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:

- _Metallic: 0
- _Mode: 0
- _NormalMapSpace: 0
- _NormalScale: 1
- _NormalScale: 0.703
- _OcclusionStrength: 1
- _PPDLodThreshold: 5
- _PPDMaxSamples: 15

7
ProjectSettings/EditorBuildSettings.asset


m_ObjectHideFlags: 0
serializedVersion: 2
m_Scenes:
- enabled: 1
- enabled: 0
- enabled: 0
- enabled: 1
- enabled: 0
path: Assets/TestScenes/HDTest/NewBatcherBench2.unity
guid: 1816611d7c1a9bc41bbe1ae56076f699

5
ProjectSettings/ProjectSettings.asset


useMacAppStoreValidation: 0
macAppStoreCategory: public.app-category.games
gpuSkinning: 0
graphicsJobs: 1
graphicsJobs: 0
xboxPIXTextureCapture: 0
xboxEnableAvatar: 0
xboxEnableKinect: 0

iOSMetalForceHardShadows: 0
metalEditorSupport: 1
metalAPIValidation: 1
iOSRenderExtraFrameOnPause: 1
appleDeveloperTeamID:
iOSManualSigningProvisioningProfileID:
tvOSManualSigningProvisioningProfileID:

switchSocketMemoryPoolSize: 6144
switchSocketAllocatorPoolSize: 128
switchSocketConcurrencyLimit: 14
switchScreenResolutionBehavior: 2
switchUseCPUProfiler: 0
switchApplicationID: 0x0005000C10000001
switchNSODependencies:

switchParentalControl: 0
switchAllowsScreenshot: 1
switchDataLossConfirmation: 0
switchSupportedNpadStyles: 3
ps4NPAgeRating: 12
ps4NPTitleSecret:
ps4NPTrophyPackPath:

8
Assets/TestScenes/HDTest/NewBatcherBench2.unity.meta


fileFormatVersion: 2
guid: 1816611d7c1a9bc41bbe1ae56076f699
timeCreated: 1493136714
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

41
Assets/TestScenes/HDTest/NewBatcherTest/Mover.cs


using System.Collections;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using Object = UnityEngine.Object;
public class Mover : MonoBehaviour {
Transform[] m_Transforms;
float m_Phase0;
private bool m_Pause = false;
// Use this for initialization
void Start ()
{
m_Transforms = (Object.FindObjectsOfType(typeof(GameObject)) as GameObject[]).Where(o => o.name.Contains("Cube") || o.name.Contains("Capsule") || o.name.Contains("Cylinder") || o.name.Contains("Sphere")).Select(g=>g.transform).ToArray();
}
// Update is called once per frame
void Update ()
{
if ( !m_Pause )
{
float innerPhase = m_Phase0;
foreach (Transform t in m_Transforms)
{
float yd = 2.0f * Mathf.Sin(innerPhase);
t.localPosition = new Vector3(t.localPosition.x, Mathf.Abs(yd), t.localPosition.z);
innerPhase += 0.01f;
}
m_Phase0 += Time.deltaTime * 2.0f;
}
}
void OnGUI()
{
m_Pause = GUI.Toggle(new Rect(10, 10, 200, 20), m_Pause, "Pause");
}
}

12
Assets/TestScenes/HDTest/NewBatcherTest/Mover.cs.meta


fileFormatVersion: 2
guid: 107ec621874e21b40905bbc627cccb7d
timeCreated: 1493207732
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

部分文件因为文件数量过多而无法显示

正在加载...
取消
保存