浏览代码

Merge branch 'HDRP/staging' of https://github.com/Unity-Technologies/ScriptableRenderPipeline into HDRP/fix-sun-baking

/main
Julien Ignace 7 年前
当前提交
13c603cb
共有 63 个文件被更改,包括 613 次插入372 次删除
  1. 18
      TestProjects/HDRP_Tests/Assets/GraphicTests/Common/RP_Assets/HDRP_Test_Def.asset
  2. 18
      TestProjects/HDRP_Tests/Assets/GraphicTests/Common/RP_Assets/HDRP_Test_Def_DepthPrepass.asset
  3. 18
      TestProjects/HDRP_Tests/Assets/GraphicTests/Common/RP_Assets/HDRP_Test_Def_DepthPrepass_AlphaOnly.asset
  4. 18
      TestProjects/HDRP_Tests/Assets/GraphicTests/Common/RP_Assets/HDRP_Test_Fwd.asset
  5. 17
      TestProjects/HDRP_Tests/Assets/GraphicTests/Common/RP_Assets/HDRenderPipelineAsset.asset
  6. 16
      TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9001_Decals/Decal_All.mat
  7. 16
      TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9001_Decals/Decal_Color.mat
  8. 15
      TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9001_Decals/Decal_Mask.mat
  9. 6
      com.unity.render-pipelines.high-definition/CHANGELOG.md
  10. 2
      com.unity.render-pipelines.high-definition/HDRP/Camera/HDAdditionalCameraData.cs
  11. 22
      com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/HDLightEditor.cs
  12. 84
      com.unity.render-pipelines.high-definition/HDRP/Editor/Material/Decal/DecalUI.cs
  13. 2
      com.unity.render-pipelines.high-definition/HDRP/Editor/RenderPipeline/Settings/GlobalDecalSettingsUI.cs
  14. 6
      com.unity.render-pipelines.high-definition/HDRP/Editor/Upgraders/HDRPVersion.cs
  15. 35
      com.unity.render-pipelines.high-definition/HDRP/Editor/Upgraders/UpgradeMenuItem.cs
  16. 63
      com.unity.render-pipelines.high-definition/HDRP/Lighting/LightLoop/LightLoopDef.hlsl
  17. 5
      com.unity.render-pipelines.high-definition/HDRP/Material/Decal/Decal.hlsl
  18. 2
      com.unity.render-pipelines.high-definition/HDRP/Material/Lit/Lit.shader
  19. 2
      com.unity.render-pipelines.high-definition/HDRP/Material/Lit/LitTessellation.shader
  20. 2
      com.unity.render-pipelines.high-definition/HDRP/Material/Material.hlsl
  21. 2
      com.unity.render-pipelines.high-definition/HDRP/Material/StackLit/StackLit.shader
  22. 20
      com.unity.render-pipelines.high-definition/HDRP/Material/SubsurfaceScattering/SubsurfaceScattering.hlsl
  23. 29
      com.unity.render-pipelines.high-definition/HDRP/RenderPipeline/HDRenderPipeline.cs
  24. 14
      com.unity.render-pipelines.high-definition/HDRP/RenderPipeline/HDRenderPipelineAsset.cs
  25. 81
      com.unity.render-pipelines.high-definition/HDRP/RenderPipelineResources/HDRenderPipelineResources.asset
  26. 80
      com.unity.render-pipelines.high-definition/HDRP/ShaderVariables.hlsl
  27. 10
      com.unity.render-pipelines.high-definition/HDRP/ShaderVariablesFunctions.hlsl
  28. 6
      com.unity.render-pipelines.high-definition/HDRP/Lighting/AtmosphericScattering/OpaqueAtmosphericScattering.shader
  29. 2
      com.unity.render-pipelines.high-definition/HDRP/Lighting/AtmosphericScattering/AtmosphericScattering.cs.meta
  30. 8
      com.unity.render-pipelines.high-definition/HDRP/Lighting/AtmosphericScattering.meta
  31. 68
      com.unity.render-pipelines.high-definition/HDRP/Lighting/LightLoop/ShaderVariablesLightLoop.hlsl
  32. 9
      com.unity.render-pipelines.high-definition/HDRP/Lighting/LightLoop/ShaderVariablesLightLoop.hlsl.meta
  33. 8
      com.unity.render-pipelines.high-definition/HDRP/Lighting/ScreenSpaceLighting.meta
  34. 5
      com.unity.render-pipelines.high-definition/HDRP/Material/Decal/ShaderVariablesDecal.hlsl
  35. 9
      com.unity.render-pipelines.high-definition/HDRP/Material/Decal/ShaderVariablesDecal.hlsl.meta
  36. 18
      com.unity.render-pipelines.high-definition/HDRP/Material/SubsurfaceScattering/ShaderVariablesSubsurfaceScattering.hlsl
  37. 9
      com.unity.render-pipelines.high-definition/HDRP/Material/SubsurfaceScattering/ShaderVariablesSubsurfaceScattering.hlsl.meta
  38. 9
      com.unity.render-pipelines.high-definition/HDRP/Lighting/AtmosphericScattering/AtmosphericScattering.cs.hlsl.meta
  39. 82
      com.unity.render-pipelines.high-definition/HDRP/Lighting/AtmosphericScattering/AtmosphericScattering.hlsl
  40. 9
      com.unity.render-pipelines.high-definition/HDRP/Lighting/AtmosphericScattering/AtmosphericScattering.hlsl.meta
  41. 9
      com.unity.render-pipelines.high-definition/HDRP/Lighting/AtmosphericScattering/OpaqueAtmosphericScattering.shader.meta
  42. 33
      com.unity.render-pipelines.high-definition/HDRP/Lighting/AtmosphericScattering/ShaderVariablesAtmosphericScattering.hlsl
  43. 9
      com.unity.render-pipelines.high-definition/HDRP/Lighting/AtmosphericScattering/ShaderVariablesAtmosphericScattering.hlsl.meta
  44. 9
      com.unity.render-pipelines.high-definition/HDRP/Lighting/ScreenSpaceLighting/ShaderVariablesScreenSpaceLighting.hlsl.meta
  45. 29
      com.unity.render-pipelines.high-definition/HDRP/Lighting/ScreenSpaceLighting/ShaderVariablesScreenSpaceLighting.hlsl
  46. 1
      TestProjects/HDRP_Tests/ProjectSettings/ProjectVersion.txt
  47. 10
      com.unity.render-pipelines.high-definition/HDRP/Sky/AtmosphericScattering.meta
  48. 10
      com.unity.render-pipelines.high-definition/HDRP/Sky/OpaqueAtmosphericScattering.shader.meta
  49. 10
      com.unity.render-pipelines.high-definition/HDRP/Sky/SkyVariables.hlsl.meta
  50. 20
      com.unity.render-pipelines.high-definition/HDRP/Sky/SkyVariables.hlsl
  51. 0
      /com.unity.render-pipelines.high-definition/HDRP/Lighting/AtmosphericScattering/OpaqueAtmosphericScattering.shader
  52. 0
      /com.unity.render-pipelines.high-definition/HDRP/Lighting/AtmosphericScattering/AtmosphericScattering.cs.meta
  53. 0
      /com.unity.render-pipelines.high-definition/HDRP/Lighting/AtmosphericScattering/ExponentialFog.cs.meta
  54. 0
      /com.unity.render-pipelines.high-definition/HDRP/Lighting/AtmosphericScattering/LinearFog.cs.meta
  55. 0
      /com.unity.render-pipelines.high-definition/HDRP/Lighting/AtmosphericScattering/AtmosphericScattering.cs.hlsl
  56. 0
      /com.unity.render-pipelines.high-definition/HDRP/Lighting/AtmosphericScattering/VolumetricFog.cs.meta
  57. 0
      /com.unity.render-pipelines.high-definition/HDRP/Lighting/AtmosphericScattering/AtmosphericScattering.cs
  58. 0
      /com.unity.render-pipelines.high-definition/HDRP/Lighting/AtmosphericScattering/ExponentialFog.cs
  59. 0
      /com.unity.render-pipelines.high-definition/HDRP/Lighting/AtmosphericScattering/LinearFog.cs
  60. 0
      /com.unity.render-pipelines.high-definition/HDRP/Lighting/AtmosphericScattering/VolumetricFog.cs

18
TestProjects/HDRP_Tests/Assets/GraphicTests/Common/RP_Assets/HDRP_Test_Def.asset


m_Name: HDRP_Test_Def
m_EditorClassIdentifier:
version: 1
m_RenderPipelineResources: {fileID: 11400000, guid: 3ce144cff5783da45aa5d4fdc2da14b7,
type: 2}
m_RenderPipelineResources: {fileID: 11400000, guid: 3ce144cff5783da45aa5d4fdc2da14b7, type: 2}
m_FrameSettings:
enableShadow: 1
enableContactShadows: 1

enableTransmission: 1
enableAtmosphericScattering: 1
enableVolumetric: 1
enableVolumetrics: 1
diffuseGlobalDimmer: 1
specularGlobalDimmer: 1
enableForwardRenderingOnly: 0

supportSSAO: 1
supportSubsurfaceScattering: 1
supportOnlyForward: 0
enableUltraQualitySSS: 0
supportVolumetric: 1
increaseSssSampleCount: 0
supportVolumetrics: 1
increaseResolutionOfVolumetrics: 0
supportDitheringCrossFade: 1
supportDBuffer: 1
supportMSAA: 0
msaaSampleCount: 1

shadowInitParams:
shadowAtlasWidth: 4096
shadowAtlasHeight: 4096
maxPointLightShadows: 6
maxSpotLightShadows: 12
maxDirectionalLightShadows: 1
perChannelMask: 1
diffusionProfileSettings: {fileID: 11400000, guid: 802c802428a2d9640a87e821dfcdd9e8,
type: 2}
diffusionProfileSettings: {fileID: 11400000, guid: 802c802428a2d9640a87e821dfcdd9e8, type: 2}

18
TestProjects/HDRP_Tests/Assets/GraphicTests/Common/RP_Assets/HDRP_Test_Def_DepthPrepass.asset


m_Name: HDRP_Test_Def_DepthPrepass
m_EditorClassIdentifier:
version: 1
m_RenderPipelineResources: {fileID: 11400000, guid: 3ce144cff5783da45aa5d4fdc2da14b7,
type: 2}
m_RenderPipelineResources: {fileID: 11400000, guid: 3ce144cff5783da45aa5d4fdc2da14b7, type: 2}
m_FrameSettings:
enableShadow: 1
enableContactShadows: 1

enableTransmission: 1
enableAtmosphericScattering: 1
enableVolumetric: 1
enableVolumetrics: 1
diffuseGlobalDimmer: 1
specularGlobalDimmer: 1
enableForwardRenderingOnly: 0

supportSSAO: 1
supportSubsurfaceScattering: 1
supportOnlyForward: 0
enableUltraQualitySSS: 0
supportVolumetric: 1
increaseSssSampleCount: 0
supportVolumetrics: 1
increaseResolutionOfVolumetrics: 0
supportDitheringCrossFade: 1
supportDBuffer: 1
supportMSAA: 0
msaaSampleCount: 1

shadowInitParams:
shadowAtlasWidth: 4096
shadowAtlasHeight: 4096
maxPointLightShadows: 6
maxSpotLightShadows: 12
maxDirectionalLightShadows: 1
perChannelMask: 1
diffusionProfileSettings: {fileID: 11400000, guid: 802c802428a2d9640a87e821dfcdd9e8,
type: 2}
diffusionProfileSettings: {fileID: 11400000, guid: 802c802428a2d9640a87e821dfcdd9e8, type: 2}

18
TestProjects/HDRP_Tests/Assets/GraphicTests/Common/RP_Assets/HDRP_Test_Def_DepthPrepass_AlphaOnly.asset


m_Name: HDRP_Test_Def_DepthPrepass_AlphaOnly
m_EditorClassIdentifier:
version: 1
m_RenderPipelineResources: {fileID: 11400000, guid: 3ce144cff5783da45aa5d4fdc2da14b7,
type: 2}
m_RenderPipelineResources: {fileID: 11400000, guid: 3ce144cff5783da45aa5d4fdc2da14b7, type: 2}
m_FrameSettings:
enableShadow: 1
enableContactShadows: 1

enableTransmission: 1
enableAtmosphericScattering: 1
enableVolumetric: 1
enableVolumetrics: 1
diffuseGlobalDimmer: 1
specularGlobalDimmer: 1
enableForwardRenderingOnly: 0

supportSSAO: 1
supportSubsurfaceScattering: 1
supportOnlyForward: 0
enableUltraQualitySSS: 0
supportVolumetric: 1
increaseSssSampleCount: 0
supportVolumetrics: 1
increaseResolutionOfVolumetrics: 0
supportDitheringCrossFade: 1
supportDBuffer: 1
supportMSAA: 0
msaaSampleCount: 1

shadowInitParams:
shadowAtlasWidth: 4096
shadowAtlasHeight: 4096
maxPointLightShadows: 6
maxSpotLightShadows: 12
maxDirectionalLightShadows: 1
perChannelMask: 1
diffusionProfileSettings: {fileID: 11400000, guid: 802c802428a2d9640a87e821dfcdd9e8,
type: 2}
diffusionProfileSettings: {fileID: 11400000, guid: 802c802428a2d9640a87e821dfcdd9e8, type: 2}

18
TestProjects/HDRP_Tests/Assets/GraphicTests/Common/RP_Assets/HDRP_Test_Fwd.asset


m_Name: HDRP_Test_Fwd
m_EditorClassIdentifier:
version: 1
m_RenderPipelineResources: {fileID: 11400000, guid: 3ce144cff5783da45aa5d4fdc2da14b7,
type: 2}
m_RenderPipelineResources: {fileID: 11400000, guid: 3ce144cff5783da45aa5d4fdc2da14b7, type: 2}
m_FrameSettings:
enableShadow: 1
enableContactShadows: 1

enableTransmission: 1
enableAtmosphericScattering: 1
enableVolumetric: 1
enableVolumetrics: 1
diffuseGlobalDimmer: 1
specularGlobalDimmer: 1
enableForwardRenderingOnly: 1

supportSSAO: 1
supportSubsurfaceScattering: 1
supportOnlyForward: 0
enableUltraQualitySSS: 0
supportVolumetric: 1
increaseSssSampleCount: 0
supportVolumetrics: 1
increaseResolutionOfVolumetrics: 0
supportDitheringCrossFade: 1
supportDBuffer: 1
supportMSAA: 0
msaaSampleCount: 1

shadowInitParams:
shadowAtlasWidth: 4096
shadowAtlasHeight: 4096
maxPointLightShadows: 6
maxSpotLightShadows: 12
maxDirectionalLightShadows: 1
perChannelMask: 1
diffusionProfileSettings: {fileID: 11400000, guid: 802c802428a2d9640a87e821dfcdd9e8,
type: 2}
diffusionProfileSettings: {fileID: 11400000, guid: 802c802428a2d9640a87e821dfcdd9e8, type: 2}

17
TestProjects/HDRP_Tests/Assets/GraphicTests/Common/RP_Assets/HDRenderPipelineAsset.asset


m_Script: {fileID: 11500000, guid: 0cf1dab834d4ec34195b920ea7bbf9ec, type: 3}
m_Name: HDRenderPipelineAsset
m_EditorClassIdentifier:
m_RenderPipelineResources: {fileID: 11400000, guid: 3ce144cff5783da45aa5d4fdc2da14b7,
type: 2}
version: 1
m_RenderPipelineResources: {fileID: 11400000, guid: 3ce144cff5783da45aa5d4fdc2da14b7, type: 2}
m_FrameSettings:
enableShadow: 1
enableContactShadows: 1

enableTransmission: 1
enableAtmosphericScattering: 1
enableVolumetric: 1
enableVolumetrics: 1
diffuseGlobalDimmer: 1
specularGlobalDimmer: 1
enableForwardRenderingOnly: 0

supportSSAO: 1
supportSubsurfaceScattering: 1
supportOnlyForward: 0
enableUltraQualitySSS: 0
supportVolumetric: 1
increaseSssSampleCount: 0
supportVolumetrics: 1
increaseResolutionOfVolumetrics: 0
supportRuntimeDebugDisplay: 1
supportDitheringCrossFade: 1
supportDBuffer: 0
supportMSAA: 0
msaaSampleCount: 1

shadowInitParams:
shadowAtlasWidth: 4096
shadowAtlasHeight: 4096
maxPointLightShadows: 6
maxSpotLightShadows: 12
maxDirectionalLightShadows: 1
perChannelMask: 1
allowShaderVariantStripping: 1
diffusionProfileSettings: {fileID: 0}

16
TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9001_Decals/Decal_All.mat


m_PrefabInternal: {fileID: 0}
m_Name: Decal_All
m_Shader: {fileID: 4800000, guid: 1d64af84bdc970c4fae0c1e06dd95b73, type: 3}
m_ShaderKeywords: _ALBEDOCONTRIBUTION _COLORMAP _MASKMAP _NORMALMAP
m_ShaderKeywords: _ALBEDOCONTRIBUTION _COLORMAP _MASKMAP _MASK_BLEND_SRC_B _NORMALMAP
disabledShaderPasses: []
disabledShaderPasses:
- DBufferMesh_M
- DBufferMesh_AO
- DBufferMesh_MAO
- DBufferMesh_AOS
- DBufferMesh_MS
- DBufferMesh_S
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:

- _InitialBend: 1
- _InvTilingScale: 1
- _LinkDetailsWithBase: 1
- _MaskBlendMode: 7
- _MaskBlendSrc: 1
- _MaskmapAO: 1
- _MaskmapMetal: 1
- _MaskmapSmoothness: 1
- _NormalBlendSrc: 0
- _NormalMapSpace: 0
- _NormalScale: 1
- _PPDLodThreshold: 5

16
TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9001_Decals/Decal_Color.mat


m_PrefabInternal: {fileID: 0}
m_Name: Decal_Color
m_Shader: {fileID: 4800000, guid: 1d64af84bdc970c4fae0c1e06dd95b73, type: 3}
m_ShaderKeywords: _ALBEDOCONTRIBUTION _COLORMAP
m_ShaderKeywords: _ALBEDOCONTRIBUTION _COLORMAP _MASK_BLEND_SRC_B
disabledShaderPasses: []
disabledShaderPasses:
- DBufferMesh_M
- DBufferMesh_AO
- DBufferMesh_MAO
- DBufferMesh_MAOS
- DBufferMesh_MS
- DBufferMesh_AOS
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:

- _InitialBend: 1
- _InvTilingScale: 1
- _LinkDetailsWithBase: 1
- _MaskBlendMode: 4
- _MaskBlendSrc: 1
- _MaskmapAO: 0
- _MaskmapMetal: 0
- _MaskmapSmoothness: 1
- _NormalBlendSrc: 0
- _NormalMapSpace: 0
- _NormalScale: 1
- _PPDLodThreshold: 5

15
TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9001_Decals/Decal_Mask.mat


m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
disabledShaderPasses:
- DBufferMesh_M
- DBufferMesh_AO
- DBufferMesh_MAO
- DBufferMesh_MS
- DBufferMesh_S
- DBufferMesh_AOS
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:

- _AORemapMin: 0
- _ATDistance: 1
- _AlbedoAffectEmissive: 0
- _AlbedoMode: 0
- _AlphaCutoff: 0.5
- _AlphaCutoffEnable: 0
- _AlphaCutoffPostpass: 0.5

- _InitialBend: 1
- _InvTilingScale: 1
- _LinkDetailsWithBase: 1
- _MaskBlendMode: 7
- _MaskBlendSrc: 0
- _MaskmapAO: 1
- _MaskmapMetal: 1
- _MaskmapSmoothness: 1
- _NormalBlendSrc: 0
- _NormalMapSpace: 0
- _NormalScale: 1
- _PPDLodThreshold: 5

6
com.unity.render-pipelines.high-definition/CHANGELOG.md


## [3.0.1-preview]
### Added
- Decal now support per channel selection mask. There is now two mode. One with BaseColor, Normal and Smoothness and another one more expensive with BaseColor, Normal, Smoothness, Metal and AO. Control is on HDRP Asset. This may require to launch an update script for old scene: 'Edit/Render Pipeline/Single step upgrade script/Upgrade all DecalMaterial MaskBlendMode'.
- Refactored Constant Buffers to avoid hitting the maximum number of bound CBs in some cases.
- Fixed the light range affecting the transform scale when changed.
### Changed
- Movde Render Pipeline Debug "Windows from Windows->General-> Render Pipeline debug windows" to "Windows from Windows->Analysis-> Render Pipeline debug windows"

- Exposed shadow budget parameters in HDRP asset
- Add an option to generate an emissive mesh for area lights (currently rectangle light only). The mesh fits the size, intensity and color of the light.
- Add an option to the HDRP asset to increase the resolution of volumetric lighting.
- Add an decal mask map channel selection mode.
- Add additional ligth unit support for punctual light (Lumens, Candela) and area lights (Lumens, Luminance)
- Add dedicated Gizmo for the box Influence volume of HDReflectionProbe / PlanarReflectionProbe

2
com.unity.render-pipelines.high-definition/HDRP/Camera/HDAdditionalCameraData.cs


// Tag as dirty so frameSettings are correctly initialize at next HDRenderPipeline.Render() call
m_frameSettingsIsDirty = true;
if(m_Version != currentVersion)
if (m_Version != currentVersion)
{
// Add here data migration code
m_Version = currentVersion;

22
com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/HDLightEditor.cs


if (EditorGUI.EndChangeCheck())
{
UpdateLightScale();
m_UpdateAreaLightEmissiveMeshComponents = true;
((Light)target).SetLightDirty(); // Should be apply only to parameter that's affect GI, but make the code cleaner
}

m_AdditionalLightData.lightUnit.enumValueIndex = (int)DirectionalLightUnit.Lux;
else
m_AdditionalLightData.lightUnit.enumValueIndex = (int)LightUnit.Lumen;
}
// Refect light size changes on transform local scale
void UpdateLightScale()
{
foreach (var hdLightData in m_AdditionalLightDatas)
{
switch (m_LightShape)
{
case LightShape.Line:
hdLightData.transform.localScale = new Vector3(m_AdditionalLightData.shapeWidth.floatValue, 0, 0);
break;
case LightShape.Rectangle:
hdLightData.transform.localScale = new Vector3(m_AdditionalLightData.shapeWidth.floatValue, m_AdditionalLightData.shapeHeight.floatValue, 0);
break;
case LightShape.Point:
case LightShape.Spot:
hdLightData.transform.localScale = Vector3.one * settings.range.floatValue;
break;
}
}
}
LightUnit LightIntensityUnitPopup(LightShape shape)

84
com.unity.render-pipelines.high-definition/HDRP/Editor/Material/Decal/DecalUI.cs


{
public static string InputsText = "Inputs";
public static GUIContent baseColorText = new GUIContent("Albedo (RGB) and Blend Factor (A)", "Albedo (RGB) and Blend Factor (A)");
public static GUIContent baseColorText2 = new GUIContent("Blend Factor (A)", "Blend Factor (A)");
public static GUIContent baseColorText = new GUIContent("BaseColor (RGB) and Opacity (A)", "BaseColor (RGB) and Opacity (A)");
public static GUIContent baseColorText2 = new GUIContent("Opacity(A)", "Opacity (A)");
public static GUIContent maskMapText = new GUIContent("Mask Map - M(R), AO(G), D(B), S(A)", "Mask map");
public static GUIContent decalBlendText = new GUIContent("Decal Blend", "Whole decal blend");
public static GUIContent BlendText = new GUIContent("Decal Blend", "Whole decal blend");
public static GUIContent AlbedoModeText = new GUIContent("Albedo contribution", "Base color + Blend, Blend only");
public static GUIContent decalBlendText = new GUIContent("Global Opacity", "Whole decal Opacity");
public static GUIContent AlbedoModeText = new GUIContent("Affect BaseColor", "Base color + Opacity, Opacity only");
public static GUIContent[] maskMapText =
{
new GUIContent("Error", "Mask map"), // Not possible
new GUIContent("Mask Map - M(R), Opacity(B)", "Mask map - Metal(R), Opacity(B)"), // Decal.MaskBlendFlags.Metal:
new GUIContent("Mask Map - AO(G), Opacity(B)", "Mask map - Ambient Occlusion(G), Opacity(B)"), // Decal.MaskBlendFlags.AO:
new GUIContent("Mask Map - M(R), AO(G), Opacity(B)", "Mask map - Metal(R), Ambient Occlusion(G), Opacity(B)"), // Decal.MaskBlendFlags.Metal | Decal.MaskBlendFlags.AO:
new GUIContent("Mask Map - Opacity(B), S(A)", "Mask map - Opacity(B), Smoothness(A)"), // Decal.MaskBlendFlags.Smoothness:
new GUIContent("Mask Map - M(R), Opacity(B), S(A)", "Mask map - Metal(R), Opacity(B), Smoothness(A)"), // Decal.MaskBlendFlags.Metal | Decal.MaskBlendFlags.Smoothness:
new GUIContent("Mask Map - AO(G), Opacity(B), S(A)", "Mask map - Ambient Occlusion(G), Opacity(B), Smoothness(A)"), // Decal.MaskBlendFlags.AO | Decal.MaskBlendFlags.Smoothness:
new GUIContent("Mask Map - M(R), AO(G), Opacity(B), S(A)", "Mask map - Metal(R), Ambient Occlusion(G), Opacity(B), Smoothness(A)") // Decal.MaskBlendFlags.Metal | Decal.MaskBlendFlags.AO | Decal.MaskBlendFlags.Smoothness:
};
AlbedoMapAlpha,
BaseColorMapAlpha,
MaskMapBlue
}
protected string[] blendSourceNames = Enum.GetNames(typeof(BlendSource));

EditorGUILayout.LabelField(Styles.InputsText, EditorStyles.boldLabel);
EditorGUI.indentLevel++;
m_MaterialEditor.TexturePropertySingleLine((material.GetFloat(kAlbedoMode) == 1.0f) ? Styles.baseColorText : Styles.baseColorText2, baseColorMap, baseColor);
// Currently always display Albedo contribution as we have an albedo tint that apply
EditorGUI.indentLevel++;
if (material.GetFloat(kAlbedoMode) == 1.0f)
{
m_MaterialEditor.TexturePropertySingleLine(Styles.baseColorText, baseColorMap, baseColor);
}
else
{
m_MaterialEditor.TexturePropertySingleLine(Styles.baseColorText2, baseColorMap, baseColor);
}
EditorGUI.indentLevel--;
normalBlendSrcValue = EditorGUILayout.Popup( "Normal blend source", (int)normalBlendSrcValue, blendSourceNames);
EditorGUI.indentLevel++;
normalBlendSrcValue = EditorGUILayout.Popup("Normal Opacity channel", (int)normalBlendSrcValue, blendSourceNames);
EditorGUI.indentLevel--;
m_MaterialEditor.TexturePropertySingleLine(Styles.maskMapText, maskMap);
m_MaterialEditor.TexturePropertySingleLine(Styles.maskMapText[(int)maskBlendFlags], maskMap);
maskBlendSrcValue = EditorGUILayout.Popup("Mask blend source", (int) maskBlendSrcValue, blendSourceNames);
if (perChannelMask)
{
EditorGUILayout.HelpBox(
"Disabling all mask map channels defaults to smoothness only.\n" +
"To disable all channels remove the mask map from the shader.\n" +
"Mask map channel selection mode can be disabled in pipeline asset, when disabled only smoothness is active.\n" +
"Disabling mask map channel selection mode will improve performance.",
MessageType.Info);
}
else
{
EditorGUILayout.HelpBox(
"For better control of mask map channels enable mask map channel selection mode in pipeline asset.\nEnabling this feature incurs a performance cost.",
MessageType.Info);
}
EditorGUI.indentLevel++;
maskBlendSrcValue = EditorGUILayout.Popup("Mask Opacity channel", (int) maskBlendSrcValue, blendSourceNames);
m_MaterialEditor.ShaderProperty(maskmapMetal, "Metal");
m_MaterialEditor.ShaderProperty(maskmapAO, "AO");
m_MaterialEditor.ShaderProperty(maskmapSmoothness, "Smoothness");
if ((maskmapMetal.floatValue == 0.0f) && (maskmapAO.floatValue == 0.0f) &&
(maskmapSmoothness.floatValue == 0.0f))
{
// Following condition force users to always have at least one attribute enabled
m_MaterialEditor.ShaderProperty(maskmapMetal, "Affect Metal");
if ((maskmapMetal.floatValue == 0.0f) && (maskmapAO.floatValue == 0.0f) && (maskmapSmoothness.floatValue == 0.0f))
maskmapMetal.floatValue = 1.0f;
m_MaterialEditor.ShaderProperty(maskmapAO, "Affect AO");
if ((maskmapMetal.floatValue == 0.0f) && (maskmapAO.floatValue == 0.0f) && (maskmapSmoothness.floatValue == 0.0f))
maskmapAO.floatValue = 1.0f;
m_MaterialEditor.ShaderProperty(maskmapSmoothness, "Affect Smoothness");
if ((maskmapMetal.floatValue == 0.0f) && (maskmapAO.floatValue == 0.0f) && (maskmapSmoothness.floatValue == 0.0f))
}
if (maskmapMetal.floatValue == 1.0f)
maskBlendFlags |= Decal.MaskBlendFlags.Metal;

maskBlendFlags |= Decal.MaskBlendFlags.Smoothness;
}
EditorGUI.indentLevel--;
EditorGUILayout.HelpBox(
"Control of AO and Metal is based on option 'Enable Metal and AO properties' in HDRP Asset.\nThere is a performance cost of enabling this option.",
MessageType.Info);
}
if (EditorGUI.EndChangeCheck())

2
com.unity.render-pipelines.high-definition/HDRP/Editor/RenderPipeline/Settings/GlobalDecalSettingsUI.cs


EditorGUILayout.PropertyField(d.drawDistance, _.GetContent("Draw Distance"));
EditorGUILayout.PropertyField(d.atlasWidth, _.GetContent("Atlas Width"));
EditorGUILayout.PropertyField(d.atlasHeight, _.GetContent("Atlas Height"));
EditorGUILayout.PropertyField(d.perChannelMask, _.GetContent("Mask map channel selection"));
EditorGUILayout.PropertyField(d.perChannelMask, _.GetContent("Enable Metal and AO properties"));
--EditorGUI.indentLevel;
}
}

6
com.unity.render-pipelines.high-definition/HDRP/Editor/Upgraders/HDRPVersion.cs


[InitializeOnLoad]
public class HDRPVersion
{
static public int hdrpVersion = 1;
// 1 changed emissive color
// 2 add decal mode in decal material
static public int hdrpVersion = 2;
static public int GetCurrentHDRPProjectVersion()
{

static HDRPVersion()
{
// Compare project version with current version - Trigger an upgrade if user ask for it
if (GetCurrentHDRPProjectVersion() < hdrpVersion)
if (false) //GetCurrentHDRPProjectVersion() < hdrpVersion) // TODO: Disable for now as it doesn't work correctly
{
if (EditorUtility.DisplayDialog("A newer version of HDRP has been detected",
"Do you want to upgrade your materials to newer version?\n You can also upgrade manually materials in 'Edit -> Render Pipeline' submenu", "Yes", "No"))

35
com.unity.render-pipelines.high-definition/HDRP/Editor/Upgraders/UpgradeMenuItem.cs


return;
}
// Update decal material after we added AO and metal selection. It was default to 0 and need to default to 4 now.
static bool UpdateMaterial_DecalBlendMode(string path, Material mat)
{
if (mat.shader.name == "HDRenderPipeline/Decal")
{
float maskBlendMode = mat.GetFloat("_MaskBlendMode");
if (maskBlendMode == 0.0f)
{
mat.SetFloat("_MaskBlendMode", (float)Decal.MaskBlendFlags.Smoothness);
return true;
}
}
return false;
}
delegate bool UpdateMaterial(string path, Material mat);
delegate void UpdateMaterialFile(string path);

mat.shader.name == "HDRenderPipeline/LayeredLit" ||
mat.shader.name == "HDRenderPipeline/LayeredLitTessellation" ||
mat.shader.name == "HDRenderPipeline/StackLit" ||
mat.shader.name == "HDRenderPipeline/Unlit"
mat.shader.name == "HDRenderPipeline/Unlit" ||
mat.shader.name == "HDRenderPipeline/Decal"
)
{
// Need to be processed in order - All function here should be re-entrant (i.e after upgrade it can be recall)

UpdateMaterialToNewerVersion("(EmissiveColor)", UpdateMaterial_EmissiveColor, UpdateMaterialFile_EmissiveColor);
}
[MenuItem("Edit/Render Pipeline/Single step upgrade script/Upgrade all DecalMaterial MaskBlendMode", priority = CoreUtils.editMenuPriority3)]
static public void UpdateMaterialToNewerVersionDecalMaterialMaskBlendMode()
{
UpdateMaterialToNewerVersion("(DecalMaterial)", UpdateMaterial_DecalBlendMode);
}
[MenuItem("Edit/Render Pipeline/Upgrade all Materials to latest version", priority = CoreUtils.editMenuPriority3)]
static public void UpdateMaterialToNewerVersion()
{

float currentVersion = HDRPVersion.GetCurrentHDRPProjectVersion();
if (currentVersion < 1.0)
int currentVersion = HDRPVersion.GetCurrentHDRPProjectVersion();
if (currentVersion < 1)
}
if (currentVersion < 2)
{
// Appear in hdrp version 2.0
UpdateMaterialToNewerVersion("(DecalMaterial)", UpdateMaterial_DecalBlendMode);
}
}
}

63
com.unity.render-pipelines.high-definition/HDRP/Lighting/LightLoop/LightLoopDef.hlsl


#include "LightLoop.cs.hlsl"
#include "../../Sky/SkyVariables.hlsl"
StructuredBuffer<uint> g_vLightListGlobal; // don't support Buffer yet in unity
#define MAX_ENV2D_LIGHT 32
CBUFFER_START(UnityTilePass)
uint _NumTileFtplX;
uint _NumTileFtplY;
// these uniforms are only needed for when OPAQUES_ONLY is NOT defined
// but there's a problem with our front-end compilation of compute shaders with multiple kernels causing it to error
//#ifdef USE_CLUSTERED_LIGHTLIST
float4x4 g_mInvScrProjection; // TODO: remove, unused in HDRP
float g_fClustScale;
float g_fClustBase;
float g_fNearPlane;
float g_fFarPlane;
int g_iLog2NumClusters; // We need to always define these to keep constant buffer layouts compatible
uint g_isLogBaseBufferEnabled;
//#endif
//#ifdef USE_CLUSTERED_LIGHTLIST
uint _NumTileClusteredX;
uint _NumTileClusteredY;
CBUFFER_END
StructuredBuffer<uint> g_vLayeredOffsetsBuffer; // don't support Buffer yet in unity
StructuredBuffer<float> g_logBaseBuffer; // don't support Buffer yet in unity
//#endif
#ifdef USE_INDIRECT
StructuredBuffer<uint> g_TileFeatureFlags;
#endif
StructuredBuffer<DirectionalLightData> _DirectionalLightDatas;
StructuredBuffer<LightData> _LightDatas;
StructuredBuffer<EnvLightData> _EnvLightDatas;
StructuredBuffer<ShadowData> _ShadowDatas;
// Used by directional and spot lights
TEXTURE2D_ARRAY(_CookieTextures);
// Used by point lights
TEXTURECUBE_ARRAY_ABSTRACT(_CookieCubeTextures);
// Use texture array for reflection (or LatLong 2D array for mobile)
TEXTURECUBE_ARRAY_ABSTRACT(_EnvCubemapTextures);
TEXTURE2D_ARRAY(_Env2DTextures);
float4x4 _Env2DCaptureVP[MAX_ENV2D_LIGHT];
// XRTODO: Need to stereo-ize access
TEXTURE2D(_DeferredShadowTexture);
CBUFFER_START(UnityPerLightLoop)
uint _DirectionalLightCount;
uint _PunctualLightCount;
uint _AreaLightCount;
uint _EnvLightCount;
uint _EnvProxyCount;
int _EnvLightSkyEnabled; // TODO: make it a bool
CBUFFER_END
// LightLoopContext is not visible from Material (user should not use these properties in Material file)
// It allow the lightloop to have transmit sampling information (do we use atlas, or texture array etc...)

5
com.unity.render-pipelines.high-definition/HDRP/Material/Decal/Decal.hlsl


#endif
CBUFFER_START(UnityDecalParameters)
uint _EnableDBuffer;
float2 _DecalAtlasResolution;
CBUFFER_END
UNITY_INSTANCING_BUFFER_START(Decal)
UNITY_DEFINE_INSTANCED_PROP(float4x4, _NormalToWorld)
UNITY_INSTANCING_BUFFER_END(matrix)

2
com.unity.render-pipelines.high-definition/HDRP/Material/Lit/Lit.shader


_NormalMap("NormalMap", 2D) = "bump" {} // Tangent space normal map
_NormalMapOS("NormalMapOS", 2D) = "white" {} // Object space normal map - no good default value
_NormalScale("_NormalScale", Range(0.0, 2.0)) = 1
_NormalScale("_NormalScale", Range(0.0, 8.0)) = 1
_BentNormalMap("_BentNormalMap", 2D) = "bump" {}
_BentNormalMapOS("_BentNormalMapOS", 2D) = "white" {}

2
com.unity.render-pipelines.high-definition/HDRP/Material/Lit/LitTessellation.shader


_NormalMap("NormalMap", 2D) = "bump" {} // Tangent space normal map
_NormalMapOS("NormalMapOS", 2D) = "white" {} // Object space normal map - no good default value
_NormalScale("_NormalScale", Range(0.0, 2.0)) = 1
_NormalScale("_NormalScale", Range(0.0, 8.0)) = 1
_BentNormalMap("_BentNormalMap", 2D) = "bump" {}
_BentNormalMapOS("_BentNormalMapOS", 2D) = "white" {}

2
com.unity.render-pipelines.high-definition/HDRP/Material/Material.hlsl


#include "CoreRP/ShaderLibrary/CommonMaterial.hlsl"
#include "CoreRP/ShaderLibrary/EntityLighting.hlsl"
#include "CoreRP/ShaderLibrary/ImageBasedLighting.hlsl"
#include "../Sky/AtmosphericScattering/AtmosphericScattering.hlsl"
#include "HDRP/Lighting/AtmosphericScattering/AtmosphericScattering.hlsl"
// Guidelines for Material Keyword.
// There is a set of Material Keyword that a HD shaders must define (or not define). We call them system KeyWord.

2
com.unity.render-pipelines.high-definition/HDRP/Material/StackLit/StackLit.shader


_NormalMapUV("NormalMapUV", Float) = 0.0
_NormalMapUVLocal("NormalMapUV Local", Float) = 0.0
_NormalMapObjSpace("NormalMapObjSpace", Float) = 0.0
_NormalScale("Normal Scale", Range(0.0, 2.0)) = 1
_NormalScale("Normal Scale", Range(0.0, 8.0)) = 1
[HideInInspector] _AmbientOcclusionMapShow("AmbientOcclusion Map Show", Float) = 0
_AmbientOcclusion("AmbientOcclusion", Range(0.0, 1.0)) = 1

20
com.unity.render-pipelines.high-definition/HDRP/Material/SubsurfaceScattering/SubsurfaceScattering.hlsl


#include "../DiffusionProfile/DiffusionProfile.hlsl"
// ----------------------------------------------------------------------------
// constant buffer declaration
// ----------------------------------------------------------------------------
CBUFFER_START(UnitySSSAndTransmissionParameters)
// Warning: Unity is not able to losslessly transfer integers larger than 2^24 to the shader system.
// Therefore, we bitcast uint to float in C#, and bitcast back to uint in the shader.
uint _EnableSubsurfaceScattering; // Globally toggles subsurface and transmission scattering on/off
float _TexturingModeFlags; // 1 bit/profile; 0 = PreAndPostScatter, 1 = PostScatter
float _TransmissionFlags; // 1 bit/profile; 0 = regular, 1 = thin
// Old SSS Model >>>
float4 _HalfRcpVariancesAndWeights[DIFFUSION_PROFILE_COUNT][2]; // 2x Gaussians in RGB, A is interpolation weights
// <<< Old SSS Model
// Use float4 to avoid any packing issue between compute and pixel shaders
float4 _ThicknessRemaps[DIFFUSION_PROFILE_COUNT]; // R: start, G = end - start, BA unused
float4 _ShapeParams[DIFFUSION_PROFILE_COUNT]; // RGB = S = 1 / D, A = filter radius
float4 _TransmissionTintsAndFresnel0[DIFFUSION_PROFILE_COUNT]; // RGB = 1/4 * color, A = fresnel0
float4 _WorldScales[DIFFUSION_PROFILE_COUNT]; // X = meters per world unit; Y = world units per meter
CBUFFER_END
// ----------------------------------------------------------------------------
// helper functions
// ----------------------------------------------------------------------------

29
com.unity.render-pipelines.high-definition/HDRP/RenderPipeline/HDRenderPipeline.cs


RenderSky(hdCamera, cmd);
RenderTransparentDepthPrepass(m_CullResults, hdCamera, renderContext, cmd);
// Render pre refraction objects
RenderForward(m_CullResults, hdCamera, renderContext, cmd, ForwardPass.PreRefraction);

RenderForwardError(m_CullResults, hdCamera, renderContext, cmd);
// Fill depth buffer to reduce artifact for transparent object during postprocess
RenderTransparentDepthPostpass(m_CullResults, hdCamera, renderContext, cmd, ForwardPass.Transparent);
RenderTransparentDepthPostpass(m_CullResults, hdCamera, renderContext, cmd);
RenderColorPyramid(hdCamera, cmd, renderContext, false);

RenderOpaqueRenderList(cull, hdCamera, renderContext, cmd, m_DepthForwardOnlyPassNames, 0, HDRenderQueue.k_RenderQueue_AllOpaque);
}
}
if (hdCamera.frameSettings.enableTransparentPrepass)
{
// Render transparent depth prepass after opaque one
using (new ProfilingSample(cmd, "Transparent Depth Prepass", CustomSamplerId.TransparentDepthPrepass.GetSampler()))
{
RenderTransparentRenderList(cull, hdCamera, renderContext, cmd, m_TransparentDepthPrepassNames);
}
}
}
// RenderGBuffer do the gbuffer pass. This is solely call with deferred. If we use a depth prepass, then the depth prepass will perform the alpha testing for opaque apha tested and we don't need to do it anymore

{
drawSettings.SetShaderPassName(0, HDShaderPassNames.s_MeshDecals3RTName);
}
FilterRenderersSettings filterRenderersSettings = new FilterRenderersSettings(true)
{
renderQueueRange = HDRenderQueue.k_RenderQueue_AllOpaque

}
}
void RenderTransparentDepthPostpass(CullResults cullResults, HDCamera hdCamera, ScriptableRenderContext renderContext, CommandBuffer cmd, ForwardPass pass)
void RenderTransparentDepthPrepass(CullResults cull, HDCamera hdCamera, ScriptableRenderContext renderContext, CommandBuffer cmd)
{
if (hdCamera.frameSettings.enableTransparentPrepass)
{
// Render transparent depth prepass after opaque one
using (new ProfilingSample(cmd, "Transparent Depth Prepass", CustomSamplerId.TransparentDepthPrepass.GetSampler()))
{
RenderTransparentRenderList(cull, hdCamera, renderContext, cmd, m_TransparentDepthPrepassNames);
}
}
}
void RenderTransparentDepthPostpass(CullResults cullResults, HDCamera hdCamera, ScriptableRenderContext renderContext, CommandBuffer cmd)
{
if (!hdCamera.frameSettings.enableTransparentPostpass)
return;

14
com.unity.render-pipelines.high-definition/HDRP/RenderPipeline/HDRenderPipelineAsset.cs


public class HDRenderPipelineAsset : RenderPipelineAsset, ISerializationCallbackReceiver
{
[HideInInspector]
public float version = 1.0f;
const int currentVersion = 1;
// Currently m_Version is not used and produce a warning, remove these pragmas at the next version incrementation
#pragma warning disable 414
[SerializeField]
int m_Version = currentVersion;
#pragma warning restore 414
HDRenderPipelineAsset()
{

// When FrameSettings are manipulated we reset them to reflect the change, discarding all the Debug Windows change.
// Tag as dirty so frameSettings are correctly initialize at next HDRenderPipeline.Render() call
m_frameSettingsIsDirty = true;
if (m_Version != currentVersion)
{
// Add here data migration code
m_Version = currentVersion;
}
}
}
}

81
com.unity.render-pipelines.high-definition/HDRP/RenderPipelineResources/HDRenderPipelineResources.asset


m_Name: HDRenderPipelineResources
m_EditorClassIdentifier:
version: 1
defaultDiffuseMaterial: {fileID: 2100000, guid: 73c176f402d2c2f4d929aa5da7585d17,
type: 2}
defaultMirrorMaterial: {fileID: 2100000, guid: 6b17274157b33bc45b6a40e7d4ff51fe,
type: 2}
defaultDecalMaterial: {fileID: 2100000, guid: 500e733574922d04ea961553b1b26a63,
type: 2}
defaultDiffuseMaterial: {fileID: 2100000, guid: 73c176f402d2c2f4d929aa5da7585d17, type: 2}
defaultMirrorMaterial: {fileID: 2100000, guid: 6b17274157b33bc45b6a40e7d4ff51fe, type: 2}
defaultDecalMaterial: {fileID: 2100000, guid: 500e733574922d04ea961553b1b26a63, type: 2}
debugDisplayLatlongShader: {fileID: 4800000, guid: c1d1d149a043a5349ba367da6c2051ba,
type: 3}
debugViewMaterialGBufferShader: {fileID: 4800000, guid: 439949ea1bfa91b4ba0d04269fcde33d,
type: 3}
debugViewTilesShader: {fileID: 4800000, guid: c7c2bd17b06ceb4468e14081aaf1b96f,
type: 3}
debugFullScreenShader: {fileID: 4800000, guid: e874aca2df8300a488258738c31f85cf,
type: 3}
debugColorPickerShader: {fileID: 4800000, guid: 8137b807709e178498f22ed710864bb0,
type: 3}
debugDisplayLatlongShader: {fileID: 4800000, guid: c1d1d149a043a5349ba367da6c2051ba, type: 3}
debugViewMaterialGBufferShader: {fileID: 4800000, guid: 439949ea1bfa91b4ba0d04269fcde33d, type: 3}
debugViewTilesShader: {fileID: 4800000, guid: c7c2bd17b06ceb4468e14081aaf1b96f, type: 3}
debugFullScreenShader: {fileID: 4800000, guid: e874aca2df8300a488258738c31f85cf, type: 3}
debugColorPickerShader: {fileID: 4800000, guid: 8137b807709e178498f22ed710864bb0, type: 3}
deferredShader: {fileID: 4800000, guid: 00dd221e34a6ab349a1196b0f2fab693, type: 3}
colorPyramidCS: {fileID: 7200000, guid: 4e3267a1135742441a14298d8dcac04a, type: 3}
depthPyramidCS: {fileID: 7200000, guid: 64a553bb564274041906f78ffba955e4, type: 3}

clearDispatchIndirectShader: {fileID: 7200000, guid: fc1f553acb80a6446a32d33e403d0656,
type: 3}
buildDispatchIndirectShader: {fileID: 7200000, guid: 4eb1b418be7044c40bb5200496c50f14,
type: 3}
buildScreenAABBShader: {fileID: 7200000, guid: 728dce960f8a9c44bbc3abb3b851d8f6,
type: 3}
buildPerTileLightListShader: {fileID: 7200000, guid: 65af3444cbf4b3747a4dead7ee00cfee,
type: 3}
buildPerBigTileLightListShader: {fileID: 7200000, guid: 5ee1f9d6e09abe045b2f5e0b784b9072,
type: 3}
buildPerVoxelLightListShader: {fileID: 7200000, guid: 0bb1b7e0ddcd5c44baf3ddc7456eb196,
type: 3}
buildMaterialFlagsShader: {fileID: 7200000, guid: fb3eda953cd6e634e877fb777be2cd08,
type: 3}
deferredComputeShader: {fileID: 7200000, guid: 0b64f79746d2daf4198eaf6eab9af259,
type: 3}
screenSpaceShadowComputeShader: {fileID: 7200000, guid: 3e6900e06dc185a4380af4dacb4db0a4,
type: 3}
volumeVoxelizationCS: {fileID: 7200000, guid: c20b371db720da244b73830ec74a343a,
type: 3}
volumetricLightingCS: {fileID: 7200000, guid: b4901a10df2d1e24282725e9fbc77c97,
type: 3}
subsurfaceScatteringCS: {fileID: 7200000, guid: b06a7993621def248addd55d0fe931b1,
type: 3}
subsurfaceScattering: {fileID: 4800000, guid: 867b36db983aa0548889a66f8d685ff6,
type: 3}
clearDispatchIndirectShader: {fileID: 7200000, guid: fc1f553acb80a6446a32d33e403d0656, type: 3}
buildDispatchIndirectShader: {fileID: 7200000, guid: 4eb1b418be7044c40bb5200496c50f14, type: 3}
buildScreenAABBShader: {fileID: 7200000, guid: 728dce960f8a9c44bbc3abb3b851d8f6, type: 3}
buildPerTileLightListShader: {fileID: 7200000, guid: 65af3444cbf4b3747a4dead7ee00cfee, type: 3}
buildPerBigTileLightListShader: {fileID: 7200000, guid: 5ee1f9d6e09abe045b2f5e0b784b9072, type: 3}
buildPerVoxelLightListShader: {fileID: 7200000, guid: 0bb1b7e0ddcd5c44baf3ddc7456eb196, type: 3}
buildMaterialFlagsShader: {fileID: 7200000, guid: fb3eda953cd6e634e877fb777be2cd08, type: 3}
deferredComputeShader: {fileID: 7200000, guid: 0b64f79746d2daf4198eaf6eab9af259, type: 3}
screenSpaceShadowComputeShader: {fileID: 7200000, guid: 3e6900e06dc185a4380af4dacb4db0a4, type: 3}
volumeVoxelizationCS: {fileID: 7200000, guid: c20b371db720da244b73830ec74a343a, type: 3}
volumetricLightingCS: {fileID: 7200000, guid: b4901a10df2d1e24282725e9fbc77c97, type: 3}
subsurfaceScatteringCS: {fileID: 7200000, guid: b06a7993621def248addd55d0fe931b1, type: 3}
subsurfaceScattering: {fileID: 4800000, guid: 867b36db983aa0548889a66f8d685ff6, type: 3}
combineLighting: {fileID: 4800000, guid: 2e37131331fbdca449b1a2bc47a639ca, type: 3}
cameraMotionVectors: {fileID: 4800000, guid: 035941b63024d1943af48811c1db20d9, type: 3}
copyStencilBuffer: {fileID: 4800000, guid: 3d1574f1cdfa0ce4995f9bc79ed7f8ec, type: 3}

buildProbabilityTables: {fileID: 7200000, guid: b9f26cf340afe9145a699753531b2a4c,
type: 3}
computeGgxIblSampleData: {fileID: 7200000, guid: 764a24bb47ef5ba4781d9ae82ca07445,
type: 3}
buildProbabilityTables: {fileID: 7200000, guid: b9f26cf340afe9145a699753531b2a4c, type: 3}
computeGgxIblSampleData: {fileID: 7200000, guid: 764a24bb47ef5ba4781d9ae82ca07445, type: 3}
opaqueAtmosphericScattering: {fileID: 4800000, guid: 326059e48e5735e46a98047eff4f0295,
type: 3}
opaqueAtmosphericScattering: {fileID: 4800000, guid: 32f724728cf19904291226f239ec16f0, type: 3}
preIntegratedFGD_GGXDisneyDiffuse: {fileID: 4800000, guid: 123f13d52852ef547b2962de4bd9eaad,
type: 3}
preIntegratedFGD_CharlieClothLambert: {fileID: 4800000, guid: 3b3bf235775cf8b4baae7f3306787ab0,
type: 3}
preIntegratedFGD_GGXDisneyDiffuse: {fileID: 4800000, guid: 123f13d52852ef547b2962de4bd9eaad, type: 3}
preIntegratedFGD_CharlieClothLambert: {fileID: 4800000, guid: 3b3bf235775cf8b4baae7f3306787ab0, type: 3}
debugShadowMapShader: {fileID: 4800000, guid: ee25e539f5594f44085e0a9000c15d9b,
type: 3}
debugShadowMapShader: {fileID: 4800000, guid: ee25e539f5594f44085e0a9000c15d9b, type: 3}

80
com.unity.render-pipelines.high-definition/HDRP/ShaderVariables.hlsl


// ----------------------------------------------------------------------------
CBUFFER_START(UnityPerFrame)
float4 glstate_lightmodel_ambient;
float4 unity_AmbientSky;
float4 unity_AmbientEquator;
float4 unity_AmbientGround;
float4 unity_IndirectSpecColor;
#if !defined(USING_STEREO_MATRICES)
float4x4 glstate_matrix_projection;
float4x4 unity_MatrixV;
float4x4 unity_MatrixInvV;
float4x4 unity_MatrixVP;
float4 unity_StereoScaleOffset;
int unity_StereoEyeIndex;
#endif
float4 unity_ShadowColor;
CBUFFER_END
// ----------------------------------------------------------------------------
// These are the samplers available in the HDRenderPipeline.
// Avoid declaring extra samplers as they are 4x SGPR each on GCN.
SAMPLER(s_point_clamp_sampler);

// ----------------------------------------------------------------------------
// Define that before including all the sub systems ShaderVariablesXXX.hlsl files in order to include constant buffer properties.
#define SHADER_VARIABLES_INCLUDE_CB
CBUFFER_START(UnityPerView)
CBUFFER_START(UnityGlobal)
// ================================
// PER FRAME CONSTANTS
// ================================
#if !defined(USING_STEREO_MATRICES)
float4x4 glstate_matrix_projection;
float4x4 unity_MatrixV;
float4x4 unity_MatrixInvV;
float4x4 unity_MatrixVP;
float4 unity_StereoScaleOffset;
int unity_StereoEyeIndex;
#endif
// ================================
// PER VIEW CONSTANTS
// ================================
// TODO: all affine matrices should be 3x4.
float4x4 _ViewMatrix;
float4x4 _InvViewMatrix;

float4 _VBufferPrevUvScaleAndLimit;
float4 _VBufferPrevDepthEncodingParams;
float4 _VBufferPrevDepthDecodingParams;
CBUFFER_END
CBUFFER_START(UnityLightingParameters)
// Buffer pyramid
float4 _ColorPyramidSize; // (x,y) = Actual Pixel Size, (z,w) = 1 / Actual Pixel Size
float4 _DepthPyramidSize; // (x,y) = Actual Pixel Size, (z,w) = 1 / Actual Pixel Size
float4 _CameraMotionVectorsSize; // (x,y) = Actual Pixel Size, (z,w) = 1 / Actual Pixel Size
float4 _ColorPyramidScale; // (x,y) = Screen Scale, z = lod count, w = unused
float4 _DepthPyramidScale; // (x,y) = Screen Scale, z = lod count, w = unused
float4 _CameraMotionVectorsScale; // (x,y) = Screen Scale, z = lod count, w = unused
#include "Lighting/LightLoop/ShaderVariablesLightLoop.hlsl"
#include "Lighting/ScreenSpaceLighting/ShaderVariablesScreenSpaceLighting.hlsl"
#include "Lighting/AtmosphericScattering/ShaderVariablesAtmosphericScattering.hlsl"
#include "Material/SubsurfaceScattering/ShaderVariablesSubsurfaceScattering.hlsl"
#include "Material/Decal/ShaderVariablesDecal.hlsl"
// Screen space lighting
float _SSRefractionInvScreenWeightDistance; // Distance for screen space smoothstep with fallback
float _SSReflectionInvScreenWeightDistance; // Distance for screen space smoothstep with fallback
int _SSReflectionEnabled;
int _SSReflectionProjectionModel;
int _SSReflectionHiZRayMarchBehindObject;
int _SSRefractionHiZRayMarchBehindObject;
// Ambiant occlusion
float4 _AmbientOcclusionParam; // xyz occlusion color, w directLightStrenght
// Rough refraction texture
// Color pyramid (width, height, lodcount, Unused)
TEXTURE2D(_ColorPyramidTexture);
// Depth pyramid (width, height, lodcount, Unused)
TEXTURE2D(_DepthPyramidTexture);
// Ambient occlusion texture
TEXTURE2D(_AmbientOcclusionTexture);
TEXTURE2D(_CameraMotionVectorsTexture);
// Undef in order to include all textures and buffers declarations
#undef SHADER_VARIABLES_INCLUDE_CB
#include "Lighting/LightLoop/ShaderVariablesLightLoop.hlsl"
#include "Lighting/AtmosphericScattering/ShaderVariablesAtmosphericScattering.hlsl"
#include "Lighting/ScreenSpaceLighting/ShaderVariablesScreenSpaceLighting.hlsl"
#include "Material/Decal/ShaderVariablesDecal.hlsl"
#include "Material/SubsurfaceScattering/ShaderVariablesSubsurfaceScattering.hlsl"
// Custom generated by HDRP, not from Unity Engine (passed in via HDCamera)
#if defined(USING_STEREO_MATRICES)

10
com.unity.render-pipelines.high-definition/HDRP/ShaderVariablesFunctions.hlsl


return _ScreenToTargetScale.zw;
}
float4 SampleSkyTexture(float3 texCoord)
{
return SAMPLE_TEXTURECUBE(_SkyTexture, s_trilinear_clamp_sampler, texCoord);
}
float4 SampleSkyTexture(float3 texCoord, float lod)
{
return SAMPLE_TEXTURECUBE_LOD(_SkyTexture, s_trilinear_clamp_sampler, texCoord, lod);
}
#endif // UNITY_SHADER_VARIABLES_FUNCTIONS_INCLUDED

6
com.unity.render-pipelines.high-definition/HDRP/Lighting/AtmosphericScattering/OpaqueAtmosphericScattering.shader


#pragma vertex Vert
#pragma fragment Frag
#pragma multi_compile _ DEBUG_DISPLAY
// #pragma enable_d3d11_debug_symbols

#include "../ShaderVariables.hlsl"
#include "AtmosphericScattering/AtmosphericScattering.hlsl"
#include "HDRP/ShaderVariables.hlsl"
#include "HDRP/Lighting/AtmosphericScattering/AtmosphericScattering.hlsl"
struct Attributes
{

2
com.unity.render-pipelines.high-definition/HDRP/Lighting/AtmosphericScattering/AtmosphericScattering.cs.meta


fileFormatVersion: 2
guid: 953beb541740ddc499d005ee80c9ff29
timeCreated: 1507718592
licenseType: Pro
MonoImporter:
externalObjects: {}
serializedVersion: 2

8
com.unity.render-pipelines.high-definition/HDRP/Lighting/AtmosphericScattering.meta


fileFormatVersion: 2
guid: 41811d2641d454a48819f6e50a816af9
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

68
com.unity.render-pipelines.high-definition/HDRP/Lighting/LightLoop/ShaderVariablesLightLoop.hlsl


#ifdef SHADER_VARIABLES_INCLUDE_CB
#define MAX_ENV2D_LIGHT 32
uint _DirectionalLightCount;
uint _PunctualLightCount;
uint _AreaLightCount;
uint _EnvLightCount;
uint _EnvProxyCount;
int _EnvLightSkyEnabled; // TODO: make it a bool
uint _NumTileFtplX;
uint _NumTileFtplY;
// these uniforms are only needed for when OPAQUES_ONLY is NOT defined
// but there's a problem with our front-end compilation of compute shaders with multiple kernels causing it to error
//#ifdef USE_CLUSTERED_LIGHTLIST
float4x4 g_mInvScrProjection; // TODO: remove, unused in HDRP
float g_fClustScale;
float g_fClustBase;
float g_fNearPlane;
float g_fFarPlane;
int g_iLog2NumClusters; // We need to always define these to keep constant buffer layouts compatible
uint g_isLogBaseBufferEnabled;
//#endif
//#ifdef USE_CLUSTERED_LIGHTLIST
uint _NumTileClusteredX;
uint _NumTileClusteredY;
float4x4 _Env2DCaptureVP[MAX_ENV2D_LIGHT];
#else
#include "HDRP/Lighting/LightDefinition.cs.hlsl"
#include "CoreRP/Shadow/ShadowBase.cs.hlsl"
StructuredBuffer<uint> g_vLightListGlobal; // don't support Buffer yet in unity
StructuredBuffer<uint> g_vLayeredOffsetsBuffer; // don't support Buffer yet in unity
StructuredBuffer<float> g_logBaseBuffer; // don't support Buffer yet in unity
//#endif
#ifdef USE_INDIRECT
StructuredBuffer<uint> g_TileFeatureFlags;
#endif
StructuredBuffer<DirectionalLightData> _DirectionalLightDatas;
StructuredBuffer<LightData> _LightDatas;
StructuredBuffer<EnvLightData> _EnvLightDatas;
StructuredBuffer<ShadowData> _ShadowDatas;
// Used by directional and spot lights
TEXTURE2D_ARRAY(_CookieTextures);
// Used by point lights
TEXTURECUBE_ARRAY_ABSTRACT(_CookieCubeTextures);
// Use texture array for reflection (or LatLong 2D array for mobile)
TEXTURECUBE_ARRAY_ABSTRACT(_EnvCubemapTextures);
TEXTURE2D_ARRAY(_Env2DTextures);
// XRTODO: Need to stereo-ize access
TEXTURE2D(_DeferredShadowTexture);
#endif

9
com.unity.render-pipelines.high-definition/HDRP/Lighting/LightLoop/ShaderVariablesLightLoop.hlsl.meta


fileFormatVersion: 2
guid: 63d561c067f228044bff7c3922047bf2
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:

8
com.unity.render-pipelines.high-definition/HDRP/Lighting/ScreenSpaceLighting.meta


fileFormatVersion: 2
guid: 8201940de2426934dbd592ff5cf182c9
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

5
com.unity.render-pipelines.high-definition/HDRP/Material/Decal/ShaderVariablesDecal.hlsl


#ifdef SHADER_VARIABLES_INCLUDE_CB
uint _EnableDBuffer;
float2 _DecalAtlasResolution;
#else
#endif

9
com.unity.render-pipelines.high-definition/HDRP/Material/Decal/ShaderVariablesDecal.hlsl.meta


fileFormatVersion: 2
guid: 9f6cea0783427804084f429e8502ad33
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:

18
com.unity.render-pipelines.high-definition/HDRP/Material/SubsurfaceScattering/ShaderVariablesSubsurfaceScattering.hlsl


#ifdef SHADER_VARIABLES_INCLUDE_CB
#include "HDRP/Material/DiffusionProfile/DiffusionProfileSettings.cs.hlsl"
// Warning: Unity is not able to losslessly transfer integers larger than 2^24 to the shader system.
// Therefore, we bitcast uint to float in C#, and bitcast back to uint in the shader.
uint _EnableSubsurfaceScattering; // Globally toggles subsurface and transmission scattering on/off
float _TexturingModeFlags; // 1 bit/profile; 0 = PreAndPostScatter, 1 = PostScatter
float _TransmissionFlags; // 1 bit/profile; 0 = regular, 1 = thin
// Old SSS Model >>>
float4 _HalfRcpVariancesAndWeights[DIFFUSION_PROFILE_COUNT][2]; // 2x Gaussians in RGB, A is interpolation weights
// <<< Old SSS Model
// Use float4 to avoid any packing issue between compute and pixel shaders
float4 _ThicknessRemaps[DIFFUSION_PROFILE_COUNT]; // R: start, G = end - start, BA unused
float4 _ShapeParams[DIFFUSION_PROFILE_COUNT]; // RGB = S = 1 / D, A = filter radius
float4 _TransmissionTintsAndFresnel0[DIFFUSION_PROFILE_COUNT]; // RGB = 1/4 * color, A = fresnel0
float4 _WorldScales[DIFFUSION_PROFILE_COUNT]; // X = meters per world unit; Y = world units per meter
#else
#endif

9
com.unity.render-pipelines.high-definition/HDRP/Material/SubsurfaceScattering/ShaderVariablesSubsurfaceScattering.hlsl.meta


fileFormatVersion: 2
guid: 63af6347132378d43b75aa5e4efeb029
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:

9
com.unity.render-pipelines.high-definition/HDRP/Lighting/AtmosphericScattering/AtmosphericScattering.cs.hlsl.meta


fileFormatVersion: 2
guid: 22ede5ad2c67e3148bf5bd9fa48b2734
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:

82
com.unity.render-pipelines.high-definition/HDRP/Lighting/AtmosphericScattering/AtmosphericScattering.hlsl


#ifndef UNITY_ATMOSPHERIC_SCATTERING_INCLUDED
#define UNITY_ATMOSPHERIC_SCATTERING_INCLUDED
#include "CoreRP/ShaderLibrary/VolumeRendering.hlsl"
#include "CoreRP/ShaderLibrary/Filtering.hlsl"
#include "AtmosphericScattering.cs.hlsl"
#include "HDRP/ShaderVariables.hlsl"
#include "HDRP/Lighting/Volumetrics/VBuffer.hlsl"
#ifdef DEBUG_DISPLAY
#include "HDRP/Debug/DebugDisplay.hlsl"
#endif
float3 GetFogColor(PositionInputs posInput)
{
if (_FogColorMode == FOGCOLORMODE_CONSTANT_COLOR)
{
return _FogColor.rgb;
}
else if (_FogColorMode == FOGCOLORMODE_SKY_COLOR)
{
// Based on Uncharted 4 "Mip Sky Fog" trick: http://advances.realtimerendering.com/other/2016/naughty_dog/NaughtyDog_TechArt_Final.pdf
float mipLevel = (1.0 - _MipFogMaxMip * saturate((posInput.linearDepth - _MipFogNear) / (_MipFogFar - _MipFogNear))) * _SkyTextureMipCount;
float3 dir = -GetWorldSpaceNormalizeViewDir(posInput.positionWS);
return SampleSkyTexture(dir, mipLevel).rgb;
}
else // Should not be possible.
return float3(0.0, 0.0, 0.0);
}
// Returns fog color in rgb and fog factor in alpha.
float4 EvaluateAtmosphericScattering(PositionInputs posInput)
{
float3 fogColor = 0;
float fogFactor = 0;
#ifdef DEBUG_DISPLAY
// Don't sample atmospheric scattering when lighting debug more are enabled so fog is not visible
if (_DebugLightingMode == DEBUGLIGHTINGMODE_DIFFUSE_LIGHTING || _DebugLightingMode == DEBUGLIGHTINGMODE_SPECULAR_LIGHTING || _DebugLightingMode == DEBUGLIGHTINGMODE_LUX_METER)
return float4(0, 0, 0, 0);
#endif
switch (_AtmosphericScatteringType)
{
case FOGTYPE_LINEAR:
{
fogColor = GetFogColor(posInput);
fogFactor = _FogDensity * saturate((posInput.linearDepth - _LinearFogStart) * _LinearFogOneOverRange) * saturate((_LinearFogHeightEnd - GetAbsolutePositionWS(posInput.positionWS).y) * _LinearFogHeightOneOverRange);
break;
}
case FOGTYPE_EXPONENTIAL:
{
fogColor = GetFogColor(posInput);
float distance = length(GetWorldSpaceViewDir(posInput.positionWS));
float fogHeight = max(0.0, GetAbsolutePositionWS(posInput.positionWS).y - _ExpFogBaseHeight);
fogFactor = _FogDensity * TransmittanceHomogeneousMedium(_ExpFogHeightAttenuation, fogHeight) * (1.0f - TransmittanceHomogeneousMedium(1.0f / _ExpFogDistance, distance));
break;
}
case FOGTYPE_VOLUMETRIC:
{
float4 volFog = SampleVolumetricLighting(TEXTURE3D_PARAM(_VBufferLighting, s_linear_clamp_sampler),
posInput.positionNDC,
posInput.linearDepth,
_VBufferResolution,
_VBufferSliceCount.xy,
_VBufferUvScaleAndLimit.xy,
_VBufferUvScaleAndLimit.zw,
_VBufferDepthEncodingParams,
_VBufferDepthDecodingParams,
true, true);
fogFactor = 1 - volFog.a; // Opacity from transmittance
fogColor = volFog.rgb * min(rcp(fogFactor), FLT_MAX); // Un-premultiply, clamp to avoid (0 * INF = NaN)
break;
}
}
return float4(fogColor, fogFactor);
}
#endif

9
com.unity.render-pipelines.high-definition/HDRP/Lighting/AtmosphericScattering/AtmosphericScattering.hlsl.meta


fileFormatVersion: 2
guid: 14cc5dd8542c537438a7b0282cbc2a6f
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:

9
com.unity.render-pipelines.high-definition/HDRP/Lighting/AtmosphericScattering/OpaqueAtmosphericScattering.shader.meta


fileFormatVersion: 2
guid: 32f724728cf19904291226f239ec16f0
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:

33
com.unity.render-pipelines.high-definition/HDRP/Lighting/AtmosphericScattering/ShaderVariablesAtmosphericScattering.hlsl


#ifdef SHADER_VARIABLES_INCLUDE_CB
int _AtmosphericScatteringType;
// Common
float _FogColorMode;
float4 _FogColorDensity; // color in rgb, density in alpha
float4 _MipFogParameters;
// Linear fog
float4 _LinearFogParameters;
// Exp fog
float4 _ExpFogParameters;
float _SkyTextureMipCount;
#else
TEXTURE3D(_VBufferLighting);
TEXTURECUBE(_SkyTexture);
#define _MipFogNear _MipFogParameters.x
#define _MipFogFar _MipFogParameters.y
#define _MipFogMaxMip _MipFogParameters.z
#define _FogDensity _FogColorDensity.w
#define _FogColor _FogColorDensity
#define _LinearFogStart _LinearFogParameters.x
#define _LinearFogOneOverRange _LinearFogParameters.y
#define _LinearFogHeightEnd _LinearFogParameters.z
#define _LinearFogHeightOneOverRange _LinearFogParameters.w
#define _ExpFogDistance _ExpFogParameters.x
#define _ExpFogBaseHeight _ExpFogParameters.y
#define _ExpFogHeightAttenuation _ExpFogParameters.z
#endif

9
com.unity.render-pipelines.high-definition/HDRP/Lighting/AtmosphericScattering/ShaderVariablesAtmosphericScattering.hlsl.meta


fileFormatVersion: 2
guid: 08e9d756e08b10445b237c82ec588e47
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:

9
com.unity.render-pipelines.high-definition/HDRP/Lighting/ScreenSpaceLighting/ShaderVariablesScreenSpaceLighting.hlsl.meta


fileFormatVersion: 2
guid: c78e4b79bf403f44f87fc4f81662898e
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:

29
com.unity.render-pipelines.high-definition/HDRP/Lighting/ScreenSpaceLighting/ShaderVariablesScreenSpaceLighting.hlsl


#ifdef SHADER_VARIABLES_INCLUDE_CB
// Buffer pyramid
float4 _ColorPyramidSize; // (x,y) = Actual Pixel Size, (z,w) = 1 / Actual Pixel Size
float4 _DepthPyramidSize; // (x,y) = Actual Pixel Size, (z,w) = 1 / Actual Pixel Size
float4 _CameraMotionVectorsSize; // (x,y) = Actual Pixel Size, (z,w) = 1 / Actual Pixel Size
float4 _ColorPyramidScale; // (x,y) = Screen Scale, z = lod count, w = unused
float4 _DepthPyramidScale; // (x,y) = Screen Scale, z = lod count, w = unused
float4 _CameraMotionVectorsScale; // (x,y) = Screen Scale, z = lod count, w = unused
// Screen space lighting
float _SSRefractionInvScreenWeightDistance; // Distance for screen space smoothstep with fallback
float _SSReflectionInvScreenWeightDistance; // Distance for screen space smoothstep with fallback
int _SSReflectionEnabled;
int _SSReflectionProjectionModel;
int _SSReflectionHiZRayMarchBehindObject;
int _SSRefractionHiZRayMarchBehindObject;
// Ambiant occlusion
float4 _AmbientOcclusionParam; // xyz occlusion color, w directLightStrenght
#else
// Rough refraction texture
// Color pyramid (width, height, lodcount, Unused)
TEXTURE2D(_ColorPyramidTexture);
// Depth pyramid (width, height, lodcount, Unused)
TEXTURE2D(_DepthPyramidTexture);
// Ambient occlusion texture
TEXTURE2D(_AmbientOcclusionTexture);
TEXTURE2D(_CameraMotionVectorsTexture);
#endif

1
TestProjects/HDRP_Tests/ProjectSettings/ProjectVersion.txt


m_EditorVersion: 2018.2.0f1

10
com.unity.render-pipelines.high-definition/HDRP/Sky/AtmosphericScattering.meta


fileFormatVersion: 2
guid: d522828bc0314e14cb6faa4291bb64da
folderAsset: yes
timeCreated: 1507718579
licenseType: Pro
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

10
com.unity.render-pipelines.high-definition/HDRP/Sky/OpaqueAtmosphericScattering.shader.meta


fileFormatVersion: 2
guid: 326059e48e5735e46a98047eff4f0295
timeCreated: 1507736585
licenseType: Pro
ShaderImporter:
externalObjects: {}
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:

10
com.unity.render-pipelines.high-definition/HDRP/Sky/SkyVariables.hlsl.meta


fileFormatVersion: 2
guid: 7ed7d57e43fdd874ab5d047358e9fbe1
timeCreated: 1508156067
licenseType: Pro
ShaderImporter:
externalObjects: {}
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:

20
com.unity.render-pipelines.high-definition/HDRP/Sky/SkyVariables.hlsl


#ifndef UNITY_SKY_VARIABLES_INCLUDED
#define UNITY_SKY_VARIABLES_INCLUDED
TEXTURECUBE(_SkyTexture);
CBUFFER_START(SkyParameters)
float _SkyTextureMipCount;
CBUFFER_END
float4 SampleSkyTexture(float3 texCoord)
{
return SAMPLE_TEXTURECUBE(_SkyTexture, s_trilinear_clamp_sampler, texCoord);
}
float4 SampleSkyTexture(float3 texCoord, float lod)
{
return SAMPLE_TEXTURECUBE_LOD(_SkyTexture, s_trilinear_clamp_sampler, texCoord, lod);
}
#endif

/com.unity.render-pipelines.high-definition/HDRP/Sky/OpaqueAtmosphericScattering.shader → /com.unity.render-pipelines.high-definition/HDRP/Lighting/AtmosphericScattering/OpaqueAtmosphericScattering.shader

/com.unity.render-pipelines.high-definition/HDRP/Sky/AtmosphericScattering/AtmosphericScattering.cs.meta → /com.unity.render-pipelines.high-definition/HDRP/Lighting/AtmosphericScattering/AtmosphericScattering.cs.meta

/com.unity.render-pipelines.high-definition/HDRP/Sky/AtmosphericScattering/ExponentialFog.cs.meta → /com.unity.render-pipelines.high-definition/HDRP/Lighting/AtmosphericScattering/ExponentialFog.cs.meta

/com.unity.render-pipelines.high-definition/HDRP/Sky/AtmosphericScattering/LinearFog.cs.meta → /com.unity.render-pipelines.high-definition/HDRP/Lighting/AtmosphericScattering/LinearFog.cs.meta

/com.unity.render-pipelines.high-definition/HDRP/Sky/AtmosphericScattering/AtmosphericScattering.cs.hlsl → /com.unity.render-pipelines.high-definition/HDRP/Lighting/AtmosphericScattering/AtmosphericScattering.cs.hlsl

/com.unity.render-pipelines.high-definition/HDRP/Sky/AtmosphericScattering/VolumetricFog.cs.meta → /com.unity.render-pipelines.high-definition/HDRP/Lighting/AtmosphericScattering/VolumetricFog.cs.meta

/com.unity.render-pipelines.high-definition/HDRP/Sky/AtmosphericScattering/AtmosphericScattering.cs → /com.unity.render-pipelines.high-definition/HDRP/Lighting/AtmosphericScattering/AtmosphericScattering.cs

/com.unity.render-pipelines.high-definition/HDRP/Sky/AtmosphericScattering/ExponentialFog.cs → /com.unity.render-pipelines.high-definition/HDRP/Lighting/AtmosphericScattering/ExponentialFog.cs

/com.unity.render-pipelines.high-definition/HDRP/Sky/AtmosphericScattering/LinearFog.cs → /com.unity.render-pipelines.high-definition/HDRP/Lighting/AtmosphericScattering/LinearFog.cs

/com.unity.render-pipelines.high-definition/HDRP/Sky/AtmosphericScattering/VolumetricFog.cs → /com.unity.render-pipelines.high-definition/HDRP/Lighting/AtmosphericScattering/VolumetricFog.cs

正在加载...
取消
保存