浏览代码

Merge pull request #274 from Unity-Technologies/Remove-Resources-folder

Move shader outside of resource folder
/RenderPassXR_Sandbox
GitHub 8 年前
当前提交
9ba974dc
共有 53 个文件被更改,包括 154 次插入116 次删除
  1. 3
      Assets/ScriptableRenderPipeline/Core/Debugging/DebugItemHandler.cs
  2. 10
      Assets/ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipeline.cs
  3. 2
      Assets/ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipelineAsset.asset.meta
  4. 21
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/TilePass.cs
  5. 2
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Lit.cs
  6. 20
      Assets/ScriptableRenderPipeline/HDRenderPipeline/RenderPipelineResources/HDRenderPipelineResources.asset
  7. 2
      Assets/ScriptableRenderPipeline/HDRenderPipeline/RenderPipelineResources/HDRenderPipelineResources.asset.meta
  8. 74
      Assets/ScriptableRenderPipeline/HDRenderPipeline/RenderPipelineResources/RenderPipelineResources.cs
  9. 13
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/RuntimeFilterIBL.cs
  10. 8
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/SkyManager.cs
  11. 9
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Utilities.cs
  12. 2
      ProjectSettings/ProjectVersion.txt
  13. 4
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Debug/DebugDisplayLatlong.shader
  14. 6
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Debug/DebugDisplayShadowMap.shader
  15. 12
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Debug/DebugViewMaterialGBuffer.shader
  16. 8
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Debug/DebugViewTiles.shader
  17. 10
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/Deferred.shader
  18. 6
      Assets/ScriptableRenderPipeline/HDRenderPipeline/SceneSettings/DrawGaussianProfile.shader
  19. 6
      Assets/ScriptableRenderPipeline/HDRenderPipeline/SceneSettings/DrawTransmittanceGraph.shader
  20. 4
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/BuildProbabilityTables.compute
  21. 4
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/ComputeGgxIblSampleData.compute
  22. 6
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/GGXConvolve.shader
  23. 2
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/BlitCubemap.shader
  24. 9
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Debug/Resources.meta
  25. 9
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/Resources.meta
  26. 9
      Assets/ScriptableRenderPipeline/HDRenderPipeline/SceneSettings/Resources.meta
  27. 9
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/Resources.meta
  28. 0
      /Assets/ScriptableRenderPipeline/HDRenderPipeline/Debug/DebugViewTiles.shader.meta
  29. 0
      /Assets/ScriptableRenderPipeline/HDRenderPipeline/Debug/DebugDisplayShadowMap.shader.meta
  30. 0
      /Assets/ScriptableRenderPipeline/HDRenderPipeline/Debug/DebugDisplayLatlong.shader
  31. 0
      /Assets/ScriptableRenderPipeline/HDRenderPipeline/Debug/DebugDisplayLatlong.shader.meta
  32. 0
      /Assets/ScriptableRenderPipeline/HDRenderPipeline/Debug/DebugDisplayShadowMap.shader
  33. 0
      /Assets/ScriptableRenderPipeline/HDRenderPipeline/Debug/DebugViewMaterialGBuffer.shader
  34. 0
      /Assets/ScriptableRenderPipeline/HDRenderPipeline/Debug/DebugViewMaterialGBuffer.shader.meta
  35. 0
      /Assets/ScriptableRenderPipeline/HDRenderPipeline/Debug/DebugViewTiles.shader
  36. 0
      /Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/Deferred.shader.meta
  37. 0
      /Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/Deferred.shader
  38. 0
      /Assets/ScriptableRenderPipeline/HDRenderPipeline/SceneSettings/DrawGaussianProfile.shader.meta
  39. 0
      /Assets/ScriptableRenderPipeline/HDRenderPipeline/SceneSettings/DrawTransmittanceGraph.shader.meta
  40. 0
      /Assets/ScriptableRenderPipeline/HDRenderPipeline/SceneSettings/DrawGaussianProfile.shader
  41. 0
      /Assets/ScriptableRenderPipeline/HDRenderPipeline/SceneSettings/DrawTransmittanceGraph.shader
  42. 0
      /Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/GGXConvolve.shader.meta
  43. 0
      /Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/BuildProbabilityTables.compute.meta
  44. 0
      /Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/ComputeGgxIblSampleData.compute.meta
  45. 0
      /Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/BuildProbabilityTables.compute
  46. 0
      /Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/ComputeGgxIblSampleData.compute
  47. 0
      /Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/GGXConvolve.shader
  48. 0
      /Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/BlitCubemap.shader.meta
  49. 0
      /Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/BlitCubemap.shader

3
Assets/ScriptableRenderPipeline/Core/Debugging/DebugItemHandler.cs


public virtual void ClampValues(Func<object> getter, Action<object> setter) {}
// Method that will create UI items for runtime debug menu.
public abstract DebugItemUI BuildGUI(GameObject parent);
#if UNITY_EDITOR
// Method users need to override for editor specific UI
public abstract bool OnEditorGUIImpl();
public void OnEditorGUI()

DebugMenuUI.changed = true;
}
}
#endif
// Method users need to override for specific serialization of custom types.
public abstract DebugItemState CreateDebugItemState();

10
Assets/ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipeline.cs


m_DistortionBuffer = Shader.PropertyToID("_DistortionTexture");
m_DistortionBufferRT = new RenderTargetIdentifier(m_DistortionBuffer);
m_LitRenderLoop.Build();
m_LitRenderLoop.Build(asset.renderPipelineResources);
m_SkyManager.Build();
m_SkyManager.Build(asset.renderPipelineResources);
m_SkyManager.skySettings = asset.skySettingsToUse;
m_PostProcessContext = new PostProcessRenderContext();

{
m_DebugViewMaterialGBuffer = Utilities.CreateEngineMaterial("Hidden/HDRenderPipeline/DebugViewMaterialGBuffer");
m_DebugDisplayLatlong = Utilities.CreateEngineMaterial("Hidden/HDRenderPipeline/DebugDisplayLatlong");
m_DebugViewMaterialGBuffer = Utilities.CreateEngineMaterial(m_Asset.renderPipelineResources.debugViewMaterialGBufferShader);
m_DebugDisplayLatlong = Utilities.CreateEngineMaterial(m_Asset.renderPipelineResources.debugDisplayLatlongShader);
m_LitRenderLoop.Build();
m_LitRenderLoop.Build(m_Asset.renderPipelineResources);
}
public override void Dispose()

2
Assets/ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipelineAsset.asset.meta


fileFormatVersion: 2
guid: 449281dd2b4fbee49b8397de0541ea3c
timeCreated: 1496147291
timeCreated: 1496162200
licenseType: Pro
NativeFormatImporter:
mainObjectFileID: 11400000

21
Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/TilePass.cs


string[] tileKeywords = {"LIGHTLOOP_TILE_DIRECT", "LIGHTLOOP_TILE_INDIRECT", "LIGHTLOOP_TILE_ALL"};
m_DeferredDirectMaterialSRT = Utilities.CreateEngineMaterial("Hidden/HDRenderPipeline/Deferred");
m_DeferredDirectMaterialSRT = Utilities.CreateEngineMaterial(m_Resources.deferredShader);
Utilities.SelectKeyword(m_DeferredDirectMaterialSRT, tileKeywords, 0);
m_DeferredDirectMaterialSRT.EnableKeyword("LIGHTLOOP_TILE_PASS");
m_DeferredDirectMaterialSRT.DisableKeyword("OUTPUT_SPLIT_LIGHTING");

m_DeferredDirectMaterialSRT.SetInt("_DstBlend", (int)BlendMode.Zero);
m_DeferredDirectMaterialMRT = Utilities.CreateEngineMaterial("Hidden/HDRenderPipeline/Deferred");
m_DeferredDirectMaterialMRT = Utilities.CreateEngineMaterial(m_Resources.deferredShader);
Utilities.SelectKeyword(m_DeferredDirectMaterialMRT, tileKeywords, 0);
m_DeferredDirectMaterialMRT.EnableKeyword("LIGHTLOOP_TILE_PASS");
m_DeferredDirectMaterialMRT.EnableKeyword("OUTPUT_SPLIT_LIGHTING");

m_DeferredDirectMaterialMRT.SetInt("_DstBlend", (int)BlendMode.Zero);
m_DeferredIndirectMaterialSRT = Utilities.CreateEngineMaterial("Hidden/HDRenderPipeline/Deferred");
m_DeferredIndirectMaterialSRT = Utilities.CreateEngineMaterial(m_Resources.deferredShader);
Utilities.SelectKeyword(m_DeferredIndirectMaterialSRT, tileKeywords, 1);
m_DeferredIndirectMaterialSRT.EnableKeyword("LIGHTLOOP_TILE_PASS");
m_DeferredIndirectMaterialSRT.DisableKeyword("OUTPUT_SPLIT_LIGHTING");

m_DeferredIndirectMaterialSRT.SetInt("_DstBlend", (int)BlendMode.One); // Additive color & alpha source
m_DeferredIndirectMaterialMRT = Utilities.CreateEngineMaterial("Hidden/HDRenderPipeline/Deferred");
m_DeferredIndirectMaterialMRT = Utilities.CreateEngineMaterial(m_Resources.deferredShader);
Utilities.SelectKeyword(m_DeferredIndirectMaterialMRT, tileKeywords, 1);
m_DeferredIndirectMaterialMRT.EnableKeyword("LIGHTLOOP_TILE_PASS");
m_DeferredIndirectMaterialMRT.EnableKeyword("OUTPUT_SPLIT_LIGHTING");

m_DeferredIndirectMaterialMRT.SetInt("_DstBlend", (int)BlendMode.One); // Additive color & alpha source
m_DeferredAllMaterialSRT = Utilities.CreateEngineMaterial("Hidden/HDRenderPipeline/Deferred");
m_DeferredAllMaterialSRT = Utilities.CreateEngineMaterial(m_Resources.deferredShader);
Utilities.SelectKeyword(m_DeferredAllMaterialSRT, tileKeywords, 2);
m_DeferredAllMaterialSRT.EnableKeyword("LIGHTLOOP_TILE_PASS");
m_DeferredAllMaterialSRT.DisableKeyword("OUTPUT_SPLIT_LIGHTING");

m_DeferredAllMaterialSRT.SetInt("_DstBlend", (int)BlendMode.Zero);
m_DeferredAllMaterialMRT = Utilities.CreateEngineMaterial("Hidden/HDRenderPipeline/Deferred");
m_DeferredAllMaterialMRT = Utilities.CreateEngineMaterial(m_Resources.deferredShader);
Utilities.SelectKeyword(m_DeferredAllMaterialMRT, tileKeywords, 2);
m_DeferredAllMaterialMRT.EnableKeyword("LIGHTLOOP_TILE_PASS");
m_DeferredAllMaterialMRT.EnableKeyword("OUTPUT_SPLIT_LIGHTING");

m_DeferredAllMaterialMRT.SetInt("_DstBlend", (int)BlendMode.Zero);
m_DebugViewTilesMaterial = Utilities.CreateEngineMaterial("Hidden/HDRenderPipeline/DebugViewTiles");
m_SingleDeferredMaterialSRT = Utilities.CreateEngineMaterial("Hidden/HDRenderPipeline/Deferred");
m_SingleDeferredMaterialSRT = Utilities.CreateEngineMaterial(m_Resources.deferredShader);
m_SingleDeferredMaterialSRT.EnableKeyword("LIGHTLOOP_SINGLE_PASS");
m_SingleDeferredMaterialSRT.DisableKeyword("OUTPUT_SPLIT_LIGHTING");
m_SingleDeferredMaterialSRT.SetInt("_StencilRef", (int)StencilBits.SSS);

m_SingleDeferredMaterialMRT = Utilities.CreateEngineMaterial("Hidden/HDRenderPipeline/Deferred");
m_SingleDeferredMaterialMRT = Utilities.CreateEngineMaterial(m_Resources.deferredShader);
m_SingleDeferredMaterialMRT.EnableKeyword("LIGHTLOOP_SINGLE_PASS");
m_SingleDeferredMaterialMRT.EnableKeyword("OUTPUT_SPLIT_LIGHTING");
m_SingleDeferredMaterialMRT.SetInt("_StencilRef", (int)StencilBits.SSS);

m_DebugDisplayShadowMap = Utilities.CreateEngineMaterial("Hidden/HDRenderPipeline/DebugDisplayShadowMap");
m_DebugViewTilesMaterial = Utilities.CreateEngineMaterial(m_Resources.debugViewTilesShader);
m_DebugDisplayShadowMap = Utilities.CreateEngineMaterial(m_Resources.debugDisplayShadowMapShader);
m_DefaultTexture2DArray = new Texture2DArray(1, 1, 1, TextureFormat.ARGB32, false);
m_DefaultTexture2DArray.SetPixels32(new Color32[1] { new Color32(128, 128, 128, 128) }, 0);

2
Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Lit.cs


tex.SetPixels(pixels, arrayElement);
}
public void Build()
public void Build(RenderPipelineResources renderPipelineResources)
{
m_InitPreFGD = Utilities.CreateEngineMaterial("Hidden/HDRenderPipeline/PreIntegratedFGD");

20
Assets/ScriptableRenderPipeline/HDRenderPipeline/RenderPipelineResources/HDRenderPipelineResources.asset


m_Script: {fileID: 11500000, guid: 8b6f86e1523e69a4282e92d393be89a4, type: 3}
m_Name: HDRenderPipelineResources
m_EditorClassIdentifier:
debugDisplayLatlongShader: {fileID: 4800000, guid: c1d1d149a043a5349ba367da6c2051ba,
type: 3}
debugDisplayShadowMapShader: {fileID: 4800000, guid: ee25e539f5594f44085e0a9000c15d9b,
type: 3}
debugViewMaterialGBufferShader: {fileID: 4800000, guid: 439949ea1bfa91b4ba0d04269fcde33d,
type: 3}
debugViewTilesShader: {fileID: 4800000, guid: c7c2bd17b06ceb4468e14081aaf1b96f,
type: 3}
deferredShader: {fileID: 4800000, guid: 00dd221e34a6ab349a1196b0f2fab693, type: 3}
clearDispatchIndirectShader: {fileID: 7200000, guid: fc1f553acb80a6446a32d33e403d0656,
type: 3}
buildScreenAABBShader: {fileID: 7200000, guid: 728dce960f8a9c44bbc3abb3b851d8f6,

buildPerVoxelLightListShader: {fileID: 7200000, guid: 0bb1b7e0ddcd5c44baf3ddc7456eb196,
type: 3}
shadeOpaqueShader: {fileID: 7200000, guid: 0b64f79746d2daf4198eaf6eab9af259, type: 3}
drawGaussianProfileShader: {fileID: 4800000, guid: 2e8a76823cb2af944b4b45169f2649f9,
type: 3}
drawTransmittanceGraphShader: {fileID: 4800000, guid: 4517edda0467bb14489d5eccc9973ba2,
type: 3}
blitCubemap: {fileID: 4800000, guid: d05913e251bed7a4992c921c62e1b647, type: 3}
buildProbabilityTables: {fileID: 7200000, guid: b9f26cf340afe9145a699753531b2a4c,
type: 3}
computeGgxIblSampleData: {fileID: 7200000, guid: 764a24bb47ef5ba4781d9ae82ca07445,
type: 3}
GGXConvolve: {fileID: 4800000, guid: 123ed592ad5c2494b8aed301fd609e7b, type: 3}
skyboxCubemap: {fileID: 103, guid: 0000000000000000f000000000000000, type: 0}

2
Assets/ScriptableRenderPipeline/HDRenderPipeline/RenderPipelineResources/HDRenderPipelineResources.asset.meta


fileFormatVersion: 2
guid: 42086e81f4f0c724f96f7f09cc995354
timeCreated: 1496134738
timeCreated: 1496162188
licenseType: Pro
NativeFormatImporter:
mainObjectFileID: 11400000

74
Assets/ScriptableRenderPipeline/HDRenderPipeline/RenderPipelineResources/RenderPipelineResources.cs


#if UNITY_EDITOR
public const string renderPipelineResourcesPath = "Assets/ScriptableRenderPipeline/HDRenderPipeline/RenderPipelineResources/HDRenderPipelineResources.asset";
public const string clearDispatchIndirectShaderPath = "Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/cleardispatchindirect.compute";
public const string buildScreenAABBShaderPath = "Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/scrbound.compute";
public const string buildPerTileLightListShaderPath = "Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/lightlistbuild.compute";
public const string buildPerBigTileLightListShaderPath = "Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/lightlistbuild-bigtile.compute";
public const string buildPerVoxelLightListShaderPath = "Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/lightlistbuild-clustered.compute";
public const string shadeOpaqueShaderPath = "Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/shadeopaque.compute";
// TODO skybox/cubemap
[UnityEditor.MenuItem("RenderPipeline/HDRenderPipeline/Create Resources Asset")]
static void CreateRenderPipelineResources()

instance.clearDispatchIndirectShader = UnityEditor.AssetDatabase.LoadAssetAtPath<ComputeShader>(clearDispatchIndirectShaderPath);
instance.buildScreenAABBShader = UnityEditor.AssetDatabase.LoadAssetAtPath<ComputeShader>(buildScreenAABBShaderPath);
instance.buildPerTileLightListShader = UnityEditor.AssetDatabase.LoadAssetAtPath<ComputeShader>(buildPerTileLightListShaderPath);
instance.buildPerBigTileLightListShader = UnityEditor.AssetDatabase.LoadAssetAtPath<ComputeShader>(buildPerBigTileLightListShaderPath);
instance.buildPerVoxelLightListShader = UnityEditor.AssetDatabase.LoadAssetAtPath<ComputeShader>(buildPerVoxelLightListShaderPath);
instance.shadeOpaqueShader = UnityEditor.AssetDatabase.LoadAssetAtPath<ComputeShader>(shadeOpaqueShaderPath);
instance.debugDisplayLatlongShader = UnityEditor.AssetDatabase.LoadAssetAtPath<Shader>("Assets/ScriptableRenderPipeline/HDRenderPipeline/Debug/DebugDisplayLatlong.Shader");
instance.debugDisplayShadowMapShader = UnityEditor.AssetDatabase.LoadAssetAtPath<Shader>("Assets/ScriptableRenderPipeline/HDRenderPipeline/Debug/DebugDisplayShadowMap.Shader");
instance.debugViewMaterialGBufferShader = UnityEditor.AssetDatabase.LoadAssetAtPath<Shader>("Assets/ScriptableRenderPipeline/HDRenderPipeline/Debug/DebugViewMaterialGBuffer.Shader");
instance.debugViewTilesShader = UnityEditor.AssetDatabase.LoadAssetAtPath<Shader>("Assets/ScriptableRenderPipeline/HDRenderPipeline/Debug/DebugViewTiles.Shader");
instance.deferredShader = UnityEditor.AssetDatabase.LoadAssetAtPath<Shader>("Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/Deferred.Shader");
instance.clearDispatchIndirectShader = UnityEditor.AssetDatabase.LoadAssetAtPath<ComputeShader>("Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/cleardispatchindirect.compute");
instance.buildScreenAABBShader = UnityEditor.AssetDatabase.LoadAssetAtPath<ComputeShader>("Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/scrbound.compute");
instance.buildPerTileLightListShader = UnityEditor.AssetDatabase.LoadAssetAtPath<ComputeShader>("Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/lightlistbuild.compute");
instance.buildPerBigTileLightListShader = UnityEditor.AssetDatabase.LoadAssetAtPath<ComputeShader>("Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/lightlistbuild-bigtile.compute");
instance.buildPerVoxelLightListShader = UnityEditor.AssetDatabase.LoadAssetAtPath<ComputeShader>("Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/lightlistbuild-clustered.compute");
instance.shadeOpaqueShader = UnityEditor.AssetDatabase.LoadAssetAtPath<ComputeShader>("Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/shadeopaque.compute");
// SceneSettings
instance.drawGaussianProfileShader = UnityEditor.AssetDatabase.LoadAssetAtPath<Shader>("Assets/ScriptableRenderPipeline/HDRenderPipeline/SceneSettings/DrawGaussianProfile.shader");
instance.drawTransmittanceGraphShader = UnityEditor.AssetDatabase.LoadAssetAtPath<Shader>("Assets/ScriptableRenderPipeline/HDRenderPipeline/SceneSettings/DrawTransmittanceGraph.shader");
// Sky
instance.blitCubemap = UnityEditor.AssetDatabase.LoadAssetAtPath<Shader>("Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/BlitCubemap.shader");
instance.buildProbabilityTables = UnityEditor.AssetDatabase.LoadAssetAtPath<ComputeShader>("Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/BuildProbabilityTables.compute");
instance.computeGgxIblSampleData = UnityEditor.AssetDatabase.LoadAssetAtPath<ComputeShader>("Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/ComputeGgxIblSampleData.compute");
instance.GGXConvolve = UnityEditor.AssetDatabase.LoadAssetAtPath<Shader>("Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/GGXConvolve.shader");
// Skybox/Cubemap is a builtin shader, must use Sahder.Find to access it. It is fine because we are in the editor
instance.skyboxCubemap = Shader.Find("Skybox/Cubemap");
UnityEditor.AssetDatabase.CreateAsset(instance, renderPipelineResourcesPath);
UnityEditor.AssetDatabase.SaveAssets();

// Tile pass resources
public ComputeShader clearDispatchIndirectShader = null;
public ComputeShader buildScreenAABBShader = null;
public ComputeShader buildPerTileLightListShader = null; // FPTL
public ComputeShader buildPerBigTileLightListShader = null;
public ComputeShader buildPerVoxelLightListShader = null; // clustered
public ComputeShader shadeOpaqueShader = null;
// Debug
public Shader debugDisplayLatlongShader;
public Shader debugDisplayShadowMapShader;
public Shader debugViewMaterialGBufferShader;
public Shader debugViewTilesShader;
// Lighting resources
public Shader deferredShader;
// Lighting tile pass resources
public ComputeShader clearDispatchIndirectShader;
public ComputeShader buildScreenAABBShader;
public ComputeShader buildPerTileLightListShader; // FPTL
public ComputeShader buildPerBigTileLightListShader;
public ComputeShader buildPerVoxelLightListShader; // clustered
public ComputeShader shadeOpaqueShader;
// SceneSettings
public Shader drawGaussianProfileShader;
public Shader drawTransmittanceGraphShader;
// Sky
public Shader blitCubemap;
public ComputeShader buildProbabilityTables;
public ComputeShader computeGgxIblSampleData;
public Shader GGXConvolve;
public Shader skyboxCubemap;
}
}

13
Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/RuntimeFilterIBL.cs


bool m_SupportMIS = !TextureCache.isMobileBuildTarget;
RenderPipelineResources m_RenderPipelinesResources;
public IBLFilterGGX(RenderPipelineResources renderPipelinesResources)
{
m_RenderPipelinesResources = renderPipelinesResources;
}
public bool IsInitialized()
{
return m_GgxIblSampleData != null;

{
if (!m_ComputeGgxIblSampleDataCS)
{
m_ComputeGgxIblSampleDataCS = Resources.Load<ComputeShader>("ComputeGgxIblSampleData");
m_ComputeGgxIblSampleDataCS = m_RenderPipelinesResources.computeGgxIblSampleData;
m_BuildProbabilityTablesCS = Resources.Load<ComputeShader>("BuildProbabilityTables");
m_BuildProbabilityTablesCS = m_RenderPipelinesResources.buildProbabilityTables;
m_ConditionalDensitiesKernel = m_BuildProbabilityTablesCS.FindKernel("ComputeConditionalDensities");
m_MarginalRowDensitiesKernel = m_BuildProbabilityTablesCS.FindKernel("ComputeMarginalRowDensities");
}

m_GgxConvolveMaterial = Utilities.CreateEngineMaterial("Hidden/HDRenderPipeline/GGXConvolve");
m_GgxConvolveMaterial = Utilities.CreateEngineMaterial(m_RenderPipelinesResources.GGXConvolve);
}
if (!m_GgxIblSampleData)

8
Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/SkyManager.cs


RebuildSkyMeshes(nearPlane, farPlane);
}
public void Build()
public void Build(RenderPipelineResources renderPipelinesResources)
m_iblFilterGgx = new IBLFilterGGX();
m_iblFilterGgx = new IBLFilterGGX(renderPipelinesResources);
m_StandardSkyboxMaterial = Utilities.CreateEngineMaterial("Skybox/Cubemap");
m_StandardSkyboxMaterial = Utilities.CreateEngineMaterial(renderPipelinesResources.skyboxCubemap);
m_BlitCubemapMaterial = Utilities.CreateEngineMaterial("Hidden/BlitCubemap");
m_BlitCubemapMaterial = Utilities.CreateEngineMaterial(renderPipelinesResources.blitCubemap);
m_CurrentUpdateTime = 0.0f;
}

9
Assets/ScriptableRenderPipeline/HDRenderPipeline/Utilities.cs


return mat;
}
public static Material CreateEngineMaterial(Shader shader)
{
var mat = new Material(shader)
{
hideFlags = HideFlags.HideAndDontSave
};
return mat;
}
public static void Destroy(UnityObject obj)
{
if (obj != null)

2
ProjectSettings/ProjectVersion.txt


m_EditorVersion: 2017.2.0a1
m_EditorVersion: 2017.2.0a2

4
Assets/ScriptableRenderPipeline/HDRenderPipeline/Debug/DebugDisplayLatlong.shader


#pragma vertex Vert
#pragma fragment Frag
#include "../../../ShaderLibrary/Common.hlsl"
#include "../../../ShaderLibrary/ImageBasedLighting.hlsl"
#include "../../ShaderLibrary/Common.hlsl"
#include "../../ShaderLibrary/ImageBasedLighting.hlsl"
TEXTURECUBE(_InputCubemap);
SAMPLERCUBE(sampler_InputCubemap);

6
Assets/ScriptableRenderPipeline/HDRenderPipeline/Debug/DebugDisplayShadowMap.shader


#pragma vertex Vert
#pragma fragment Frag
#include "../../../ShaderLibrary/Common.hlsl"
#include "../../ShaderLibrary/Common.hlsl"
#include "../../../ShaderLibrary/Shadow/Shadow.hlsl"
#include "../../ShaderLibrary/Shadow/Shadow.hlsl"
#undef SHADOW_TILEPASS
SamplerState ltc_linear_clamp_sampler;

{
ShadowContext shadowContext = InitShadowContext();
// Caution: ShadowContext is define in Shadowcontext.hlsl for current render pipeline. This shader must be in sync with its content else it doesn't work.
// Caution: ShadowContext is define in Shadowcontext.hlsl for current render pipeline. This shader must be in sync with its content else it doesn't work.
return SAMPLE_TEXTURE2D_ARRAY(_ShadowmapExp_PCF, ltc_linear_clamp_sampler, input.texcoord, 0).xxxx;
}

12
Assets/ScriptableRenderPipeline/HDRenderPipeline/Debug/DebugViewMaterialGBuffer.shader


#pragma vertex Vert
#pragma fragment Frag
#include "../../../ShaderLibrary/Common.hlsl"
#include "../../../ShaderLibrary/Color.hlsl"
#include "../../ShaderLibrary/Common.hlsl"
#include "../../ShaderLibrary/Color.hlsl"
#include "../../ShaderConfig.cs.hlsl"
#include "../../ShaderVariables.hlsl"
#include "../ShaderConfig.cs.hlsl"
#include "../ShaderVariables.hlsl"
#include "../../Debug/DebugDisplay.hlsl"
#include "../../Material/Material.hlsl"
#include "../Debug/DebugDisplay.hlsl"
#include "../Material/Material.hlsl"
DECLARE_GBUFFER_TEXTURE(_GBufferTexture);

8
Assets/ScriptableRenderPipeline/HDRenderPipeline/Debug/DebugViewTiles.shader


// Include
//-------------------------------------------------------------------------------------
#include "../../../ShaderLibrary/Common.hlsl"
#include "../../ShaderLibrary/Common.hlsl"
#include "../../ShaderConfig.cs.hlsl"
#include "../../ShaderVariables.hlsl"
#include "../../Lighting/Lighting.hlsl" // This include Material.hlsl
#include "../ShaderConfig.cs.hlsl"
#include "../ShaderVariables.hlsl"
#include "../Lighting/Lighting.hlsl" // This include Material.hlsl
//-------------------------------------------------------------------------------------
// variable declaration

10
Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/Deferred.shader


// Include
//-------------------------------------------------------------------------------------
#include "../../../ShaderLibrary/Common.hlsl"
#include "../../Debug/DebugDisplay.hlsl"
#include "../../ShaderLibrary/Common.hlsl"
#include "../Debug/DebugDisplay.hlsl"
#include "../../ShaderConfig.cs.hlsl"
#include "../../ShaderVariables.hlsl"
#include "../../Lighting/Lighting.hlsl" // This include Material.hlsl
#include "../ShaderConfig.cs.hlsl"
#include "../ShaderVariables.hlsl"
#include "../Lighting/Lighting.hlsl" // This include Material.hlsl
//-------------------------------------------------------------------------------------
// variable declaration

6
Assets/ScriptableRenderPipeline/HDRenderPipeline/SceneSettings/DrawGaussianProfile.shader


// Include
//-------------------------------------------------------------------------------------
#include "../../../ShaderLibrary/Common.hlsl"
#include "../../../ShaderLibrary/Color.hlsl"
#include "../../ShaderVariables.hlsl"
#include "../../ShaderLibrary/Common.hlsl"
#include "../../ShaderLibrary/Color.hlsl"
#include "../ShaderVariables.hlsl"
//-------------------------------------------------------------------------------------
// Inputs & outputs

6
Assets/ScriptableRenderPipeline/HDRenderPipeline/SceneSettings/DrawTransmittanceGraph.shader


// Include
//-------------------------------------------------------------------------------------
#include "../../../ShaderLibrary/Common.hlsl"
#include "../../../ShaderLibrary/Color.hlsl"
#include "../../ShaderVariables.hlsl"
#include "../../ShaderLibrary/Common.hlsl"
#include "../../ShaderLibrary/Color.hlsl"
#include "../ShaderVariables.hlsl"
//-------------------------------------------------------------------------------------
// Inputs & outputs

4
Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/BuildProbabilityTables.compute


// Ref: PBRT v3, 13.6.7 "Piecewise-Constant 2D Distributions".
// Note that we use the equiareal sphere-to-square mapping instead of the latitude-longitude one.
#include "../../../ShaderLibrary/Common.hlsl"
#include "../../../ShaderLibrary/ImageBasedLighting.hlsl"
#include "../../ShaderLibrary/Common.hlsl"
#include "../../ShaderLibrary/ImageBasedLighting.hlsl"
/* --- Input --- */

4
Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/ComputeGgxIblSampleData.compute


// Precomputes data for IntegrateLD(). See that function for a detailed description.
#include "../../../ShaderLibrary/Common.hlsl"
#include "../../../ShaderLibrary/ImageBasedLighting.hlsl"
#include "../../ShaderLibrary/Common.hlsl"
#include "../../ShaderLibrary/ImageBasedLighting.hlsl"
#ifdef SHADER_API_MOBILE
#define MAX_IBL_SAMPLE_CNT 34

6
Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/GGXConvolve.shader


#pragma vertex Vert
#pragma fragment Frag
#include "../../../ShaderLibrary/Common.hlsl"
#include "../../../ShaderLibrary/ImageBasedLighting.hlsl"
#include "../SkyManager.cs.hlsl"
#include "../../ShaderLibrary/Common.hlsl"
#include "../../ShaderLibrary/ImageBasedLighting.hlsl"
#include "SkyManager.cs.hlsl"
struct Attributes
{

2
Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/BlitCubemap.shader


#pragma fragment frag
#pragma target 4.5
#include "../../../ShaderLibrary/Common.hlsl"
#include "../../ShaderLibrary/Common.hlsl"
TEXTURECUBE(_MainTex);
SAMPLERCUBE(sampler_MainTex);

9
Assets/ScriptableRenderPipeline/HDRenderPipeline/Debug/Resources.meta


fileFormatVersion: 2
guid: f4b0b1230e64e254c9ab59a66dca1b26
folderAsset: yes
timeCreated: 1479129942
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

9
Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/Resources.meta


fileFormatVersion: 2
guid: 0823a45531ce4ee45ab39bcbe1ea52a6
folderAsset: yes
timeCreated: 1479129942
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

9
Assets/ScriptableRenderPipeline/HDRenderPipeline/SceneSettings/Resources.meta


fileFormatVersion: 2
guid: 12566b1a9c5807b4f8d3d0409255095a
folderAsset: yes
timeCreated: 1487178659
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

9
Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/Resources.meta


fileFormatVersion: 2
guid: 920208451db81a846ae1c2d55f7b50b4
folderAsset: yes
timeCreated: 1479239906
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

/Assets/ScriptableRenderPipeline/HDRenderPipeline/Debug/Resources/DebugViewTiles.shader.meta → /Assets/ScriptableRenderPipeline/HDRenderPipeline/Debug/DebugViewTiles.shader.meta

/Assets/ScriptableRenderPipeline/HDRenderPipeline/Debug/Resources/DebugDisplayShadowMap.shader.meta → /Assets/ScriptableRenderPipeline/HDRenderPipeline/Debug/DebugDisplayShadowMap.shader.meta

/Assets/ScriptableRenderPipeline/HDRenderPipeline/Debug/Resources/DebugDisplayLatlong.shader → /Assets/ScriptableRenderPipeline/HDRenderPipeline/Debug/DebugDisplayLatlong.shader

/Assets/ScriptableRenderPipeline/HDRenderPipeline/Debug/Resources/DebugDisplayLatlong.shader.meta → /Assets/ScriptableRenderPipeline/HDRenderPipeline/Debug/DebugDisplayLatlong.shader.meta

/Assets/ScriptableRenderPipeline/HDRenderPipeline/Debug/Resources/DebugDisplayShadowMap.shader → /Assets/ScriptableRenderPipeline/HDRenderPipeline/Debug/DebugDisplayShadowMap.shader

/Assets/ScriptableRenderPipeline/HDRenderPipeline/Debug/Resources/DebugViewMaterialGBuffer.shader → /Assets/ScriptableRenderPipeline/HDRenderPipeline/Debug/DebugViewMaterialGBuffer.shader

/Assets/ScriptableRenderPipeline/HDRenderPipeline/Debug/Resources/DebugViewMaterialGBuffer.shader.meta → /Assets/ScriptableRenderPipeline/HDRenderPipeline/Debug/DebugViewMaterialGBuffer.shader.meta

/Assets/ScriptableRenderPipeline/HDRenderPipeline/Debug/Resources/DebugViewTiles.shader → /Assets/ScriptableRenderPipeline/HDRenderPipeline/Debug/DebugViewTiles.shader

/Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/Resources/Deferred.shader.meta → /Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/Deferred.shader.meta

/Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/Resources/Deferred.shader → /Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/Deferred.shader

/Assets/ScriptableRenderPipeline/HDRenderPipeline/SceneSettings/Resources/DrawGaussianProfile.shader.meta → /Assets/ScriptableRenderPipeline/HDRenderPipeline/SceneSettings/DrawGaussianProfile.shader.meta

/Assets/ScriptableRenderPipeline/HDRenderPipeline/SceneSettings/Resources/DrawTransmittanceGraph.shader.meta → /Assets/ScriptableRenderPipeline/HDRenderPipeline/SceneSettings/DrawTransmittanceGraph.shader.meta

/Assets/ScriptableRenderPipeline/HDRenderPipeline/SceneSettings/Resources/DrawGaussianProfile.shader → /Assets/ScriptableRenderPipeline/HDRenderPipeline/SceneSettings/DrawGaussianProfile.shader

/Assets/ScriptableRenderPipeline/HDRenderPipeline/SceneSettings/Resources/DrawTransmittanceGraph.shader → /Assets/ScriptableRenderPipeline/HDRenderPipeline/SceneSettings/DrawTransmittanceGraph.shader

/Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/Resources/GGXConvolve.shader.meta → /Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/GGXConvolve.shader.meta

/Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/Resources/BuildProbabilityTables.compute.meta → /Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/BuildProbabilityTables.compute.meta

/Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/Resources/ComputeGgxIblSampleData.compute.meta → /Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/ComputeGgxIblSampleData.compute.meta

/Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/Resources/BuildProbabilityTables.compute → /Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/BuildProbabilityTables.compute

/Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/Resources/ComputeGgxIblSampleData.compute → /Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/ComputeGgxIblSampleData.compute

/Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/Resources/GGXConvolve.shader → /Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/GGXConvolve.shader

/Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/Resources/BlitCubemap.shader.meta → /Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/BlitCubemap.shader.meta

/Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/Resources/BlitCubemap.shader → /Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/BlitCubemap.shader

正在加载...
取消
保存