Arnaud Carre
7 年前
当前提交
35f03480
共有 15 个文件被更改,包括 2033 次插入 和 2 次删除
-
6ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipeline.cs
-
10SampleScenes/HDTest/CullingTest.meta
-
10SampleScenes/HDTest/CullingTest1.meta
-
1001SampleScenes/HDTest/CullingTest1.unity
-
9SampleScenes/HDTest/CullingTest1.unity.meta
-
149SampleScenes/HDTest/CullingTest/Material1.mat
-
10SampleScenes/HDTest/CullingTest/Material1.mat.meta
-
149SampleScenes/HDTest/CullingTest/Material2.mat
-
10SampleScenes/HDTest/CullingTest/Material2.mat.meta
-
127SampleScenes/HDTest/CullingTest/MiniProfilerCulling.cs
-
13SampleScenes/HDTest/CullingTest/MiniProfilerCulling.cs.meta
-
531SampleScenes/HDTest/CullingTest1/OcclusionCullingData.asset
-
10SampleScenes/HDTest/CullingTest1/OcclusionCullingData.asset.meta
|
|||
fileFormatVersion: 2 |
|||
guid: a09305bf1b0fe28438342cebb4aa5ec3 |
|||
folderAsset: yes |
|||
timeCreated: 1505130456 |
|||
licenseType: Pro |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: 1bd7230ed29c50d469ae2f8be901beed |
|||
folderAsset: yes |
|||
timeCreated: 1505131582 |
|||
licenseType: Pro |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
1001
SampleScenes/HDTest/CullingTest1.unity
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
|
|||
fileFormatVersion: 2 |
|||
guid: d00bd42c90ac9e2449e2ddf6b2feb7d0 |
|||
timeCreated: 1505130445 |
|||
licenseType: Pro |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
%YAML 1.1 |
|||
%TAG !u! tag:unity3d.com,2011: |
|||
--- !u!21 &2100000 |
|||
Material: |
|||
serializedVersion: 6 |
|||
m_ObjectHideFlags: 0 |
|||
m_PrefabParentObject: {fileID: 0} |
|||
m_PrefabInternal: {fileID: 0} |
|||
m_Name: Material1 |
|||
m_Shader: {fileID: 4800000, guid: 6e4ae4064600d784cac1e41a9e6f2e59, type: 3} |
|||
m_ShaderKeywords: _ALBEDOAFFECTEMISSIVE_OFF _ALPHACUTOFFENABLE_OFF _DEPTHOFFSETENABLE_OFF |
|||
_DISTORTIONDEPTHTEST_OFF _DISTORTIONENABLE_OFF _DISTORTIONONLY_OFF _DOUBLESIDEDENABLE_OFF |
|||
_ENABLEPERPIXELDISPLACEMENT_OFF _ENABLESPECULAROCCLUSION_OFF _ENABLEWIND_OFF _NORMALMAP_TANGENT_SPACE |
|||
m_LightmapFlags: 4 |
|||
m_EnableInstancingVariants: 0 |
|||
m_DoubleSidedGI: 0 |
|||
m_CustomRenderQueue: -1 |
|||
stringTagMap: {} |
|||
disabledShaderPasses: |
|||
- DistortionVectors |
|||
m_SavedProperties: |
|||
serializedVersion: 3 |
|||
m_TexEnvs: |
|||
- _AnisotropyMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _BaseColorMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _BentNormalMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _BentNormalMapOS: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _DetailMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _DistortionVectorMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _EmissiveColorMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _HeightMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _MaskMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _NormalMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _NormalMapOS: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _SpecularColorMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _SubsurfaceRadiusMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _TangentMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _TangentMapOS: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _ThicknessMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
m_Floats: |
|||
- _AlbedoAffectEmissive: 0 |
|||
- _AlphaCutoff: 0.5 |
|||
- _AlphaCutoffEnable: 0 |
|||
- _Anisotropy: 0 |
|||
- _BlendMode: 0 |
|||
- _CoatCoverage: 1 |
|||
- _CoatIOR: 0.5 |
|||
- _CullMode: 2 |
|||
- _DepthOffsetEnable: 0 |
|||
- _DetailAlbedoScale: 1 |
|||
- _DetailNormalScale: 1 |
|||
- _DetailSmoothnessScale: 1 |
|||
- _DistortionDepthTest: 0 |
|||
- _DistortionEnable: 0 |
|||
- _DistortionOnly: 0 |
|||
- _DoubleSidedEnable: 0 |
|||
- _DoubleSidedNormalMode: 1 |
|||
- _Drag: 1 |
|||
- _DstBlend: 0 |
|||
- _EmissiveColorMode: 1 |
|||
- _EmissiveIntensity: 0 |
|||
- _EnablePerPixelDisplacement: 0 |
|||
- _EnableSpecularOcclusion: 0 |
|||
- _EnableWind: 0 |
|||
- _HeightAmplitude: 0.01 |
|||
- _HeightCenter: 0.5 |
|||
- _HeightMax: 1 |
|||
- _HeightMin: -1 |
|||
- _InitialBend: 1 |
|||
- _MaterialID: 1 |
|||
- _Metallic: 0.308 |
|||
- _NormalMapSpace: 0 |
|||
- _NormalScale: 1 |
|||
- _PPDLodThreshold: 5 |
|||
- _PPDMaxSamples: 15 |
|||
- _PPDMinSamples: 5 |
|||
- _ShiverDirectionality: 0.5 |
|||
- _ShiverDrag: 0.2 |
|||
- _Smoothness: 0.758 |
|||
- _SmoothnessRemapMax: 1 |
|||
- _SmoothnessRemapMin: 0 |
|||
- _SrcBlend: 1 |
|||
- _StencilRef: 2 |
|||
- _Stiffness: 1 |
|||
- _SubsurfaceProfile: 0 |
|||
- _SubsurfaceRadius: 1 |
|||
- _SurfaceType: 0 |
|||
- _TexWorldScale: 1 |
|||
- _Thickness: 1 |
|||
- _UVBase: 0 |
|||
- _UVDetail: 0 |
|||
- _ZTestMode: 8 |
|||
- _ZWrite: 1 |
|||
m_Colors: |
|||
- _BaseColor: {r: 0.6660359, g: 0.9338235, b: 0.8895001, a: 1} |
|||
- _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0} |
|||
- _EmissionColor: {r: 1, g: 1, b: 1, a: 1} |
|||
- _EmissiveColor: {r: 0, g: 0, b: 0, a: 1} |
|||
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1} |
|||
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0} |
|||
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0} |
|
|||
fileFormatVersion: 2 |
|||
guid: 99794ec7b2eb577418323a28cf000fe9 |
|||
timeCreated: 1505130484 |
|||
licenseType: Pro |
|||
NativeFormatImporter: |
|||
externalObjects: {} |
|||
mainObjectFileID: 2100000 |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
%YAML 1.1 |
|||
%TAG !u! tag:unity3d.com,2011: |
|||
--- !u!21 &2100000 |
|||
Material: |
|||
serializedVersion: 6 |
|||
m_ObjectHideFlags: 0 |
|||
m_PrefabParentObject: {fileID: 0} |
|||
m_PrefabInternal: {fileID: 0} |
|||
m_Name: Material2 |
|||
m_Shader: {fileID: 4800000, guid: 6e4ae4064600d784cac1e41a9e6f2e59, type: 3} |
|||
m_ShaderKeywords: _ALBEDOAFFECTEMISSIVE_OFF _ALPHACUTOFFENABLE_OFF _DEPTHOFFSETENABLE_OFF |
|||
_DISTORTIONDEPTHTEST_OFF _DISTORTIONENABLE_OFF _DISTORTIONONLY_OFF _DOUBLESIDEDENABLE_OFF |
|||
_ENABLEPERPIXELDISPLACEMENT_OFF _ENABLESPECULAROCCLUSION_OFF _ENABLEWIND_OFF _NORMALMAP_TANGENT_SPACE |
|||
m_LightmapFlags: 4 |
|||
m_EnableInstancingVariants: 0 |
|||
m_DoubleSidedGI: 0 |
|||
m_CustomRenderQueue: -1 |
|||
stringTagMap: {} |
|||
disabledShaderPasses: |
|||
- DistortionVectors |
|||
m_SavedProperties: |
|||
serializedVersion: 3 |
|||
m_TexEnvs: |
|||
- _AnisotropyMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _BaseColorMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _BentNormalMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _BentNormalMapOS: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _DetailMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _DistortionVectorMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _EmissiveColorMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _HeightMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _MaskMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _NormalMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _NormalMapOS: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _SpecularColorMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _SubsurfaceRadiusMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _TangentMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _TangentMapOS: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _ThicknessMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
m_Floats: |
|||
- _AlbedoAffectEmissive: 0 |
|||
- _AlphaCutoff: 0.5 |
|||
- _AlphaCutoffEnable: 0 |
|||
- _Anisotropy: 0 |
|||
- _BlendMode: 0 |
|||
- _CoatCoverage: 1 |
|||
- _CoatIOR: 0.5 |
|||
- _CullMode: 2 |
|||
- _DepthOffsetEnable: 0 |
|||
- _DetailAlbedoScale: 1 |
|||
- _DetailNormalScale: 1 |
|||
- _DetailSmoothnessScale: 1 |
|||
- _DistortionDepthTest: 0 |
|||
- _DistortionEnable: 0 |
|||
- _DistortionOnly: 0 |
|||
- _DoubleSidedEnable: 0 |
|||
- _DoubleSidedNormalMode: 1 |
|||
- _Drag: 1 |
|||
- _DstBlend: 0 |
|||
- _EmissiveColorMode: 1 |
|||
- _EmissiveIntensity: 0 |
|||
- _EnablePerPixelDisplacement: 0 |
|||
- _EnableSpecularOcclusion: 0 |
|||
- _EnableWind: 0 |
|||
- _HeightAmplitude: 0.01 |
|||
- _HeightCenter: 0.5 |
|||
- _HeightMax: 1 |
|||
- _HeightMin: -1 |
|||
- _InitialBend: 1 |
|||
- _MaterialID: 1 |
|||
- _Metallic: 0.308 |
|||
- _NormalMapSpace: 0 |
|||
- _NormalScale: 1 |
|||
- _PPDLodThreshold: 5 |
|||
- _PPDMaxSamples: 15 |
|||
- _PPDMinSamples: 5 |
|||
- _ShiverDirectionality: 0.5 |
|||
- _ShiverDrag: 0.2 |
|||
- _Smoothness: 0.758 |
|||
- _SmoothnessRemapMax: 1 |
|||
- _SmoothnessRemapMin: 0 |
|||
- _SrcBlend: 1 |
|||
- _StencilRef: 2 |
|||
- _Stiffness: 1 |
|||
- _SubsurfaceProfile: 0 |
|||
- _SubsurfaceRadius: 1 |
|||
- _SurfaceType: 0 |
|||
- _TexWorldScale: 1 |
|||
- _Thickness: 1 |
|||
- _UVBase: 0 |
|||
- _UVDetail: 0 |
|||
- _ZTestMode: 8 |
|||
- _ZWrite: 1 |
|||
m_Colors: |
|||
- _BaseColor: {r: 0.8897059, g: 0.454508, b: 0.294388, a: 1} |
|||
- _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0} |
|||
- _EmissionColor: {r: 1, g: 1, b: 1, a: 1} |
|||
- _EmissiveColor: {r: 0.8897059, g: 0.13083912, b: 0.13083912, a: 1} |
|||
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1} |
|||
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0} |
|||
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0} |
|
|||
fileFormatVersion: 2 |
|||
guid: 8c12dd363a14f0e459e697ce48fb2d4d |
|||
timeCreated: 1505130484 |
|||
licenseType: Pro |
|||
NativeFormatImporter: |
|||
externalObjects: {} |
|||
mainObjectFileID: 2100000 |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
using System.Collections; |
|||
using System.Collections.Generic; |
|||
using UnityEngine; |
|||
|
|||
using UnityEngine.Profiling; |
|||
|
|||
public class MiniProfilerCulling : MonoBehaviour { |
|||
|
|||
public bool m_Enable = true; |
|||
|
|||
private int frameCount = 0; |
|||
private const int kAverageFrameCount = 64; |
|||
private float m_AccDeltaTime; |
|||
private float m_AvgDeltaTime; |
|||
|
|||
|
|||
// private bool m_UseNewBatcher = false;
|
|||
|
|||
internal class RecorderEntry |
|||
{ |
|||
public string name; |
|||
public float time; |
|||
public int count; |
|||
public float avgTime; |
|||
public float avgCount; |
|||
public float accTime; |
|||
public int accCount; |
|||
public Recorder recorder; |
|||
}; |
|||
|
|||
RecorderEntry[] recordersList = |
|||
{ |
|||
new RecorderEntry() { name="RenderLoop.Draw" }, |
|||
new RecorderEntry() { name="Shadows.Draw" }, |
|||
new RecorderEntry() { name="SceneCulling" }, |
|||
new RecorderEntry() { name="CullSceneObjects" }, |
|||
new RecorderEntry() { name="CullScriptable" }, |
|||
new RecorderEntry() { name="CullDynamicObjectsWithUmbra" }, |
|||
new RecorderEntry() { name="CullObjectsWithoutUmbra" }, |
|||
new RecorderEntry() { name="CullSceneDynamicObjects" }, |
|||
new RecorderEntry() { name="ProcessIsNodeVisibleStep1" }, |
|||
new RecorderEntry() { name="ProcessIsNodeVisibleStep2" }, |
|||
new RecorderEntry() { name="CullQueryPortalVisibilityUmbra" }, |
|||
}; |
|||
|
|||
void Awake() |
|||
{ |
|||
for (int i=0;i<recordersList.Length;i++) |
|||
{ |
|||
var sampler = Sampler.Get(recordersList[i].name); |
|||
if ( sampler != null ) |
|||
{ |
|||
recordersList[i].recorder = sampler.GetRecorder(); |
|||
} |
|||
} |
|||
} |
|||
|
|||
|
|||
void Update() |
|||
{ |
|||
|
|||
if (m_Enable) |
|||
{ |
|||
|
|||
// get timing & update average accumulators
|
|||
for (int i = 0; i < recordersList.Length; i++) |
|||
{ |
|||
recordersList[i].time = recordersList[i].recorder.elapsedNanoseconds / 1000000.0f; |
|||
recordersList[i].count = recordersList[i].recorder.sampleBlockCount; |
|||
recordersList[i].accTime += recordersList[i].time; |
|||
recordersList[i].accCount += recordersList[i].count; |
|||
} |
|||
|
|||
m_AccDeltaTime += Time.deltaTime; |
|||
|
|||
frameCount++; |
|||
// time to time, update average values & reset accumulators
|
|||
if (frameCount >= kAverageFrameCount) |
|||
{ |
|||
for (int i = 0; i < recordersList.Length; i++) |
|||
{ |
|||
recordersList[i].avgTime = recordersList[i].accTime * (1.0f / kAverageFrameCount); |
|||
recordersList[i].avgCount = recordersList[i].accCount * (1.0f / kAverageFrameCount); |
|||
recordersList[i].accTime = 0.0f; |
|||
recordersList[i].accCount = 0; |
|||
|
|||
} |
|||
|
|||
m_AvgDeltaTime = m_AccDeltaTime / kAverageFrameCount; |
|||
m_AccDeltaTime = 0.0f; |
|||
frameCount = 0; |
|||
} |
|||
} |
|||
|
|||
} |
|||
|
|||
void OnGUI() |
|||
{ |
|||
|
|||
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); |
|||
} |
|||
} |
|||
*/ |
|||
GUI.color = new Color(1, 1, 1, .75f); |
|||
float w = 500, h = 24 + (recordersList.Length+1) * 16 + 8; |
|||
|
|||
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++) |
|||
{ |
|||
sLabel += string.Format("{0:F2}ms (*{1:F2})\t({2:F2}ms *{3:F2})\t<b>{4}</b>\n", recordersList[i].avgTime, recordersList[i].avgCount, recordersList[i].time, recordersList[i].count, recordersList[i].name); |
|||
} |
|||
GUILayout.Label(sLabel); |
|||
GUILayout.EndArea(); |
|||
} |
|||
} |
|||
|
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: ebaacc408be3a92479064404e81730d8 |
|||
timeCreated: 1505131075 |
|||
licenseType: Pro |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
531
SampleScenes/HDTest/CullingTest1/OcclusionCullingData.asset
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
|
|||
fileFormatVersion: 2 |
|||
guid: 43f078054bbc96441928a6cf28b73ec2 |
|||
timeCreated: 1505133455 |
|||
licenseType: Pro |
|||
NativeFormatImporter: |
|||
externalObjects: {} |
|||
mainObjectFileID: 36300000 |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
撰写
预览
正在加载...
取消
保存
Reference in new issue