浏览代码

Merge branch 'master' into tests/hdrp/distortion

/main
Remy 6 年前
当前提交
b3ff809b
共有 81 个文件被更改,包括 2999 次插入3577 次删除
  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. 137
      TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/1x_Materials/1211_Lit_Details.unity
  7. 7
      TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/1x_Materials/1211_Lit_Details/Lit_Detail.mat
  8. 16
      TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9001_Decals/Decal_All.mat
  9. 16
      TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9001_Decals/Decal_Color.mat
  10. 15
      TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9001_Decals/Decal_Mask.mat
  11. 998
      TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/1201_Lit_Features.png
  12. 998
      TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/1211_Lit_Details.png
  13. 998
      TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/1201_Lit_Features.png
  14. 998
      TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/1211_Lit_Details.png
  15. 12
      TestProjects/HDRP_Tests/ProjectSettings/EditorBuildSettings.asset
  16. 4
      com.unity.render-pipelines.high-definition/CHANGELOG.md
  17. 2
      com.unity.render-pipelines.high-definition/HDRP/Camera/HDAdditionalCameraData.cs
  18. 166
      com.unity.render-pipelines.high-definition/HDRP/Editor/AssetProcessors/NormalMapAverageLengthTexturePostprocessor.cs
  19. 53
      com.unity.render-pipelines.high-definition/HDRP/Editor/BuildProcessors/HDRPPreprocessBuild.cs
  20. 2
      com.unity.render-pipelines.high-definition/HDRP/Editor/BuildProcessors/HDRPreprocessShaders.cs
  21. 3
      com.unity.render-pipelines.high-definition/HDRP/Editor/Camera/HDAdditionalCameraEditor.cs
  22. 2
      com.unity.render-pipelines.high-definition/HDRP/Editor/Camera/HDCameraEditor.Handlers.cs
  23. 4
      com.unity.render-pipelines.high-definition/HDRP/Editor/Camera/HDCameraEditor.cs
  24. 2
      com.unity.render-pipelines.high-definition/HDRP/Editor/Camera/HDCameraUI.cs
  25. 2
      com.unity.render-pipelines.high-definition/HDRP/Editor/Camera/SerializedHDCamera.cs
  26. 280
      com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/HDCubemapInspector.cs
  27. 2
      com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/HDReflectionProbeEditor.Gizmos.cs
  28. 3
      com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/HDReflectionProbeEditor.Handles.cs
  29. 2
      com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/HDReflectionProbeEditor.Preview.cs
  30. 6
      com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/HDReflectionProbeEditor.ProbeUtility.cs
  31. 2
      com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/HDReflectionProbeEditor.Skin.cs
  32. 2
      com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/HDReflectionProbeEditor.cs
  33. 8
      com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/HDReflectionProbeEditorUtility.cs
  34. 3
      com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/HDReflectionProbeUI.Drawers.cs
  35. 2
      com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/HDReflectionProbeUI.cs
  36. 2
      com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/ScreenSpaceRefractionEditor.cs
  37. 2
      com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/SerializedHDReflectionProbe.cs
  38. 69
      com.unity.render-pipelines.high-definition/HDRP/Editor/Material/Decal/DecalProjectorComponentEditor.cs
  39. 16
      com.unity.render-pipelines.high-definition/HDRP/Editor/Material/Decal/DecalUI.cs
  40. 2
      com.unity.render-pipelines.high-definition/HDRP/Editor/RenderPipeline/BaseUI.cs
  41. 2
      com.unity.render-pipelines.high-definition/HDRP/Editor/RenderPipeline/HDRenderPipelineUI.cs
  42. 2
      com.unity.render-pipelines.high-definition/HDRP/Editor/RenderPipeline/Settings/FrameSettingsUI.cs
  43. 4
      com.unity.render-pipelines.high-definition/HDRP/Editor/RenderPipeline/Settings/GlobalDecalSettingsUI.cs
  44. 2
      com.unity.render-pipelines.high-definition/HDRP/Editor/RenderPipeline/Settings/GlobalLightLoopSettingsUI.cs
  45. 2
      com.unity.render-pipelines.high-definition/HDRP/Editor/RenderPipeline/Settings/LightLoopSettingsUI.cs
  46. 2
      com.unity.render-pipelines.high-definition/HDRP/Editor/RenderPipeline/Settings/RenderPipelineSettingsUI.cs
  47. 2
      com.unity.render-pipelines.high-definition/HDRP/Editor/RenderPipeline/Settings/SerializedFrameSettings.cs
  48. 2
      com.unity.render-pipelines.high-definition/HDRP/Editor/RenderPipeline/Settings/SerializedGlobalDecalSettings.cs
  49. 2
      com.unity.render-pipelines.high-definition/HDRP/Editor/RenderPipeline/Settings/SerializedGlobalLightLoopSettings.cs
  50. 2
      com.unity.render-pipelines.high-definition/HDRP/Editor/RenderPipeline/Settings/SerializedHDRenderPipelineAsset.cs
  51. 2
      com.unity.render-pipelines.high-definition/HDRP/Editor/RenderPipeline/Settings/SerializedLightLoopSettings.cs
  52. 2
      com.unity.render-pipelines.high-definition/HDRP/Editor/RenderPipeline/Settings/SerializedRenderPipelineSettings.cs
  53. 2
      com.unity.render-pipelines.high-definition/HDRP/Editor/RenderPipeline/Settings/SerializedShadowInitParameters.cs
  54. 5
      com.unity.render-pipelines.high-definition/HDRP/Editor/RenderPipeline/Settings/ShadowInitParametersUI.cs
  55. 11
      com.unity.render-pipelines.high-definition/HDRP/Editor/Shadows/ContactShadowsEditor.cs
  56. 2
      com.unity.render-pipelines.high-definition/HDRP/Editor/Shadows/HDShadowSettingsEditor.cs
  57. 2
      com.unity.render-pipelines.high-definition/HDRP/Editor/Sky/HDRISky/HDRISkyEditor.cs
  58. 2
      com.unity.render-pipelines.high-definition/HDRP/Editor/Upgraders/HDRPVersion.cs
  59. 2
      com.unity.render-pipelines.high-definition/HDRP/Editor/Upgraders/UpgradeMenuItem.cs
  60. 4
      com.unity.render-pipelines.high-definition/HDRP/Lighting/LightLoop/LightLoop.cs
  61. 16
      com.unity.render-pipelines.high-definition/HDRP/Lighting/ScreenSpaceShadow.compute
  62. 230
      com.unity.render-pipelines.high-definition/HDRP/Lighting/SphericalHarmonics.cs
  63. 2
      com.unity.render-pipelines.high-definition/HDRP/Material/Decal/Decal.hlsl
  64. 1
      com.unity.render-pipelines.high-definition/HDRP/Material/Decal/Decal.shader
  65. 31
      com.unity.render-pipelines.high-definition/HDRP/Material/Decal/DecalProjectorComponent.cs
  66. 1
      com.unity.render-pipelines.high-definition/HDRP/Material/Decal/DecalProperties.hlsl
  67. 22
      com.unity.render-pipelines.high-definition/HDRP/Material/Decal/DecalSystem.cs
  68. 2
      com.unity.render-pipelines.high-definition/HDRP/Material/Decal/DecalUtilities.hlsl
  69. 2
      com.unity.render-pipelines.high-definition/HDRP/Material/Lit/Lit.shader
  70. 23
      com.unity.render-pipelines.high-definition/HDRP/Material/Lit/LitDataIndividualLayer.hlsl
  71. 2
      com.unity.render-pipelines.high-definition/HDRP/Material/Lit/LitTessellation.shader
  72. 2
      com.unity.render-pipelines.high-definition/HDRP/Material/StackLit/StackLit.shader
  73. 29
      com.unity.render-pipelines.high-definition/HDRP/RenderPipeline/HDRenderPipeline.cs
  74. 14
      com.unity.render-pipelines.high-definition/HDRP/RenderPipeline/HDRenderPipelineAsset.cs
  75. 3
      com.unity.render-pipelines.high-definition/HDRP/RenderPipeline/HDStringConstants.cs
  76. 64
      com.unity.render-pipelines.high-definition/HDRP/RenderPipeline/SceneViewDrawMode.cs
  77. 3
      com.unity.render-pipelines.high-definition/HDRP/RenderPipeline/Texture2DAtlas.cs
  78. 14
      com.unity.render-pipelines.high-definition/HDRP/ShaderPass/ShaderPassDBuffer.hlsl
  79. 1
      com.unity.render-pipelines.high-definition/HDRP/Shadows/ContactShadows.cs
  80. 1001
      TestProjects/HDRP_Tests/Assets/GraphicTests/Common/Textures/Detail_Test_Gradient.png
  81. 132
      TestProjects/HDRP_Tests/Assets/GraphicTests/Common/Textures/Detail_Test_Gradient.png.meta

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}

137
TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/1x_Materials/1211_Lit_Details.unity


m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BaseColorMap:
m_Texture: {fileID: 2800000, guid: efd342845553c134fa4f1903a3f964f0, type: 3}
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BentNormalMap:

m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMap:
m_Texture: {fileID: 2800000, guid: 84bde77b5c4f21e47bf311357309c212, type: 3}
m_Texture: {fileID: 2800000, guid: 74fd1ac9c43580348bed6f76951d7628, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DistortionVectorMap:

m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 2800000, guid: efd342845553c134fa4f1903a3f964f0, type: 3}
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MaskMap:

- _IridescenceThickness: 1
- _LinkDetailsWithBase: 1
- _MaterialID: 1
- _Metallic: 0
- _Metallic: 1
- _NormalMapSpace: 0
- _NormalScale: 1
- _PPDLodThreshold: 5

- _SSSAndTransmissionType: 0
- _ShiverDirectionality: 0.5
- _ShiverDrag: 0.2
- _Smoothness: 0
- _Smoothness: 0.5
- _SmoothnessRemapMax: 1
- _SmoothnessRemapMin: 1
- _SpecularAAScreenSpaceVariance: 0.1

m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BaseColorMap:
m_Texture: {fileID: 2800000, guid: efd342845553c134fa4f1903a3f964f0, type: 3}
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BentNormalMap:

m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMap:
m_Texture: {fileID: 2800000, guid: 84bde77b5c4f21e47bf311357309c212, type: 3}
m_Texture: {fileID: 2800000, guid: 74fd1ac9c43580348bed6f76951d7628, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DistortionVectorMap:

m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 2800000, guid: efd342845553c134fa4f1903a3f964f0, type: 3}
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MaskMap:

- _IridescenceThickness: 1
- _LinkDetailsWithBase: 1
- _MaterialID: 1
- _Metallic: 0
- _Metallic: 1
- _NormalMapSpace: 0
- _NormalScale: 1
- _PPDLodThreshold: 5

- _SSSAndTransmissionType: 0
- _ShiverDirectionality: 0.5
- _ShiverDrag: 0.2
- _Smoothness: 0
- _Smoothness: 0.5
- _SmoothnessRemapMax: 1
- _SmoothnessRemapMin: 1
- _SpecularAAScreenSpaceVariance: 0.1

m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 4294967295
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 306d620c715872046bf76568b7f382d4, type: 3}
m_StaticBatchInfo:

m_Script: {fileID: 11500000, guid: 66d6c688291ac8b48adc878e4fc4d29d, type: 3}
m_Name:
m_EditorClassIdentifier:
prefabObject: {fileID: 23096287020260212, guid: e6be141ec19d3554489da286b19b90b2,
type: 2}
prefabObject: {fileID: 23096287020260212, guid: e6be141ec19d3554489da286b19b90b2, type: 2}
material: {fileID: 2100000, guid: c3971c9db7ef77f4b94d793c401f3ac5, type: 2}
commonParameters:
- parameter: _DetailAlbedoScale

m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 4294967295
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 306d620c715872046bf76568b7f382d4, type: 3}
m_StaticBatchInfo:

m_Script: {fileID: 11500000, guid: 66d6c688291ac8b48adc878e4fc4d29d, type: 3}
m_Name:
m_EditorClassIdentifier:
prefabObject: {fileID: 23096287020260212, guid: e6be141ec19d3554489da286b19b90b2,
type: 2}
prefabObject: {fileID: 23096287020260212, guid: e6be141ec19d3554489da286b19b90b2, type: 2}
material: {fileID: 2100000, guid: c3971c9db7ef77f4b94d793c401f3ac5, type: 2}
commonParameters:
- parameter: _DetailAlbedoScale

m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 4294967295
m_RendererPriority: 0
m_Materials:
- {fileID: 1506975570}
m_StaticBatchInfo:

m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 4294967295
m_RendererPriority: 0
m_Materials:
- {fileID: 640983785}
m_StaticBatchInfo:

m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 4294967295
m_RendererPriority: 0
m_Materials:
- {fileID: 385652661}
m_StaticBatchInfo:

m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BaseColorMap:
m_Texture: {fileID: 2800000, guid: efd342845553c134fa4f1903a3f964f0, type: 3}
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BentNormalMap:

m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMap:
m_Texture: {fileID: 2800000, guid: 84bde77b5c4f21e47bf311357309c212, type: 3}
m_Texture: {fileID: 2800000, guid: 74fd1ac9c43580348bed6f76951d7628, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DistortionVectorMap:

m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 2800000, guid: efd342845553c134fa4f1903a3f964f0, type: 3}
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MaskMap:

- _IridescenceThickness: 1
- _LinkDetailsWithBase: 1
- _MaterialID: 1
- _Metallic: 0
- _Metallic: 1
- _NormalMapSpace: 0
- _NormalScale: 1
- _PPDLodThreshold: 5

- _SSSAndTransmissionType: 0
- _ShiverDirectionality: 0.5
- _ShiverDrag: 0.2
- _Smoothness: 0
- _Smoothness: 0.5
- _SmoothnessRemapMax: 1
- _SmoothnessRemapMin: 1
- _SpecularAAScreenSpaceVariance: 0.1

m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 4294967295
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 306d620c715872046bf76568b7f382d4, type: 3}
m_StaticBatchInfo:

m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 4294967295
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: e504fc2b639838141816a581d66ec7e3, type: 2}
m_StaticBatchInfo:

m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BaseColorMap:
m_Texture: {fileID: 2800000, guid: efd342845553c134fa4f1903a3f964f0, type: 3}
m_Texture: {fileID: 2800000, guid: 4d367f129a854204583047a2bda92c65, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BentNormalMap:

m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMap:
m_Texture: {fileID: 2800000, guid: 84bde77b5c4f21e47bf311357309c212, type: 3}
m_Texture: {fileID: 2800000, guid: 74fd1ac9c43580348bed6f76951d7628, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DistortionVectorMap:

m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 2800000, guid: efd342845553c134fa4f1903a3f964f0, type: 3}
m_Texture: {fileID: 2800000, guid: 4d367f129a854204583047a2bda92c65, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MaskMap:

m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 4294967295
m_RendererPriority: 0
m_Materials:
- {fileID: 235045854}
m_StaticBatchInfo:

propertyPath: m_RootOrder
value: 0
objectReference: {fileID: 0}
- target: {fileID: 20109210616973140, guid: c07ace9ab142ca9469fa377877c2f1e7,
type: 2}
- target: {fileID: 20109210616973140, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 2}
- target: {fileID: 20109210616973140, guid: c07ace9ab142ca9469fa377877c2f1e7,
type: 2}
- target: {fileID: 20109210616973140, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 2}
- target: {fileID: 20109210616973140, guid: c07ace9ab142ca9469fa377877c2f1e7,
type: 2}
- target: {fileID: 20109210616973140, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 2}
- target: {fileID: 20109210616973140, guid: c07ace9ab142ca9469fa377877c2f1e7,
type: 2}
- target: {fileID: 20109210616973140, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 2}
- target: {fileID: 20109210616973140, guid: c07ace9ab142ca9469fa377877c2f1e7,
type: 2}
- target: {fileID: 20109210616973140, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 2}
- target: {fileID: 20109210616973140, guid: c07ace9ab142ca9469fa377877c2f1e7,
type: 2}
- target: {fileID: 20109210616973140, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 2}
propertyPath: field of view
value: 32
objectReference: {fileID: 0}

m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BaseColorMap:
m_Texture: {fileID: 2800000, guid: efd342845553c134fa4f1903a3f964f0, type: 3}
m_Texture: {fileID: 2800000, guid: 4d367f129a854204583047a2bda92c65, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BentNormalMap:

m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMap:
m_Texture: {fileID: 2800000, guid: 84bde77b5c4f21e47bf311357309c212, type: 3}
m_Texture: {fileID: 2800000, guid: 74fd1ac9c43580348bed6f76951d7628, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DistortionVectorMap:

m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 2800000, guid: efd342845553c134fa4f1903a3f964f0, type: 3}
m_Texture: {fileID: 2800000, guid: 4d367f129a854204583047a2bda92c65, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MaskMap:

m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BaseColorMap:
m_Texture: {fileID: 2800000, guid: efd342845553c134fa4f1903a3f964f0, type: 3}
m_Texture: {fileID: 2800000, guid: 4d367f129a854204583047a2bda92c65, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BentNormalMap:

m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMap:
m_Texture: {fileID: 2800000, guid: 84bde77b5c4f21e47bf311357309c212, type: 3}
m_Texture: {fileID: 2800000, guid: 74fd1ac9c43580348bed6f76951d7628, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DistortionVectorMap:

m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 2800000, guid: efd342845553c134fa4f1903a3f964f0, type: 3}
m_Texture: {fileID: 2800000, guid: 4d367f129a854204583047a2bda92c65, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MaskMap:

m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 4294967295
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: e504fc2b639838141816a581d66ec7e3, type: 2}
m_StaticBatchInfo:

m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 4294967295
m_RendererPriority: 0
m_Materials:
- {fileID: 2141145690}
m_StaticBatchInfo:

m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 4294967295
m_RendererPriority: 0
m_Materials:
- {fileID: 1502750941}
m_StaticBatchInfo:

m_Script: {fileID: 11500000, guid: 66d6c688291ac8b48adc878e4fc4d29d, type: 3}
m_Name:
m_EditorClassIdentifier:
prefabObject: {fileID: 23096287020260212, guid: e6be141ec19d3554489da286b19b90b2,
type: 2}
prefabObject: {fileID: 23096287020260212, guid: e6be141ec19d3554489da286b19b90b2, type: 2}
material: {fileID: 2100000, guid: 01b4dd17db930ca47a8f9efab5a2c691, type: 2}
commonParameters: []
is2D: 0

m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 4294967295
m_RendererPriority: 0
m_Materials:
- {fileID: 1261066706}
m_StaticBatchInfo:

m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 4294967295
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 306d620c715872046bf76568b7f382d4, type: 3}
m_StaticBatchInfo:

m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 4294967295
m_RendererPriority: 0
m_Materials:
- {fileID: 964098065}
m_StaticBatchInfo:

m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 4294967295
m_RendererPriority: 0
m_Materials:
- {fileID: 922826584}
m_StaticBatchInfo:

m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 4294967295
m_RendererPriority: 0
m_Materials:
- {fileID: 1628543525}
m_StaticBatchInfo:

m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 4294967295
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 306d620c715872046bf76568b7f382d4, type: 3}
m_StaticBatchInfo:

m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BaseColorMap:
m_Texture: {fileID: 2800000, guid: efd342845553c134fa4f1903a3f964f0, type: 3}
m_Texture: {fileID: 2800000, guid: 4d367f129a854204583047a2bda92c65, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BentNormalMap:

m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMap:
m_Texture: {fileID: 2800000, guid: 84bde77b5c4f21e47bf311357309c212, type: 3}
m_Texture: {fileID: 2800000, guid: 74fd1ac9c43580348bed6f76951d7628, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DistortionVectorMap:

m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 2800000, guid: efd342845553c134fa4f1903a3f964f0, type: 3}
m_Texture: {fileID: 2800000, guid: 4d367f129a854204583047a2bda92c65, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MaskMap:

m_Script: {fileID: 11500000, guid: 66d6c688291ac8b48adc878e4fc4d29d, type: 3}
m_Name:
m_EditorClassIdentifier:
prefabObject: {fileID: 23096287020260212, guid: e6be141ec19d3554489da286b19b90b2,
type: 2}
prefabObject: {fileID: 23096287020260212, guid: e6be141ec19d3554489da286b19b90b2, type: 2}
material: {fileID: 2100000, guid: c3971c9db7ef77f4b94d793c401f3ac5, type: 2}
commonParameters:
- parameter: _DetailNormalScale

m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 4294967295
m_RendererPriority: 0
m_Materials:
- {fileID: 645264928}
m_StaticBatchInfo:

m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BaseColorMap:
m_Texture: {fileID: 2800000, guid: efd342845553c134fa4f1903a3f964f0, type: 3}
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BentNormalMap:

m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMap:
m_Texture: {fileID: 2800000, guid: 84bde77b5c4f21e47bf311357309c212, type: 3}
m_Texture: {fileID: 2800000, guid: 74fd1ac9c43580348bed6f76951d7628, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DistortionVectorMap:

m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 2800000, guid: efd342845553c134fa4f1903a3f964f0, type: 3}
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MaskMap:

- _IridescenceThickness: 1
- _LinkDetailsWithBase: 1
- _MaterialID: 1
- _Metallic: 0
- _Metallic: 1
- _NormalMapSpace: 0
- _NormalScale: 1
- _PPDLodThreshold: 5

- _SSSAndTransmissionType: 0
- _ShiverDirectionality: 0.5
- _ShiverDrag: 0.2
- _Smoothness: 0
- _Smoothness: 0.5
- _SmoothnessRemapMax: 1
- _SmoothnessRemapMin: 1
- _SpecularAAScreenSpaceVariance: 0.1

m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 4294967295
m_RendererPriority: 0
m_Materials:
- {fileID: 1606824965}
m_StaticBatchInfo:

m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 4294967295
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 306d620c715872046bf76568b7f382d4, type: 3}
m_StaticBatchInfo:

m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 4294967295
m_RendererPriority: 0
m_Materials:
- {fileID: 235535369}
m_StaticBatchInfo:

m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 4294967295
m_RendererPriority: 0
m_Materials:
- {fileID: 1397593428}
m_StaticBatchInfo:

m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BaseColorMap:
m_Texture: {fileID: 2800000, guid: efd342845553c134fa4f1903a3f964f0, type: 3}
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BentNormalMap:

m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMap:
m_Texture: {fileID: 2800000, guid: 84bde77b5c4f21e47bf311357309c212, type: 3}
m_Texture: {fileID: 2800000, guid: 74fd1ac9c43580348bed6f76951d7628, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DistortionVectorMap:

m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 2800000, guid: efd342845553c134fa4f1903a3f964f0, type: 3}
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MaskMap:

- _IridescenceThickness: 1
- _LinkDetailsWithBase: 1
- _MaterialID: 1
- _Metallic: 0
- _Metallic: 1
- _NormalMapSpace: 0
- _NormalScale: 1
- _PPDLodThreshold: 5

- _SSSAndTransmissionType: 0
- _ShiverDirectionality: 0.5
- _ShiverDrag: 0.2
- _Smoothness: 0
- _Smoothness: 0.5
- _SmoothnessRemapMax: 1
- _SmoothnessRemapMin: 1
- _SpecularAAScreenSpaceVariance: 0.1

m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 4294967295
m_RendererPriority: 0
m_Materials:
- {fileID: 155146296}
m_StaticBatchInfo:

m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 4294967295
m_RendererPriority: 0
m_Materials:
- {fileID: 548299721}
m_StaticBatchInfo:

m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 4294967295
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 306d620c715872046bf76568b7f382d4, type: 3}
m_StaticBatchInfo:

m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 4294967295
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 306d620c715872046bf76568b7f382d4, type: 3}
m_StaticBatchInfo:

m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 4294967295
m_RendererPriority: 0
m_Materials:
- {fileID: 975729338}
m_StaticBatchInfo:

m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BaseColorMap:
m_Texture: {fileID: 2800000, guid: efd342845553c134fa4f1903a3f964f0, type: 3}
m_Texture: {fileID: 2800000, guid: 4d367f129a854204583047a2bda92c65, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BentNormalMap:

m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMap:
m_Texture: {fileID: 2800000, guid: 84bde77b5c4f21e47bf311357309c212, type: 3}
m_Texture: {fileID: 2800000, guid: 74fd1ac9c43580348bed6f76951d7628, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DistortionVectorMap:

m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 2800000, guid: efd342845553c134fa4f1903a3f964f0, type: 3}
m_Texture: {fileID: 2800000, guid: 4d367f129a854204583047a2bda92c65, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MaskMap:

7
TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/1x_Materials/1211_Lit_Details/Lit_Detail.mat


m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BaseColorMap:
m_Texture: {fileID: 2800000, guid: efd342845553c134fa4f1903a3f964f0, type: 3}
m_Texture: {fileID: 2800000, guid: 4d367f129a854204583047a2bda92c65, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BentNormalMap:

m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMap:
m_Texture: {fileID: 2800000, guid: 84bde77b5c4f21e47bf311357309c212, type: 3}
m_Texture: {fileID: 2800000, guid: 74fd1ac9c43580348bed6f76951d7628, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DistortionVectorMap:

m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 2800000, guid: efd342845553c134fa4f1903a3f964f0, type: 3}
m_Texture: {fileID: 2800000, guid: 4d367f129a854204583047a2bda92c65, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MaskMap:

- _EnableSpecularOcclusion: 0
- _EnableWind: 0
- _EnergyConservingSpecularColor: 1
- _HdrpVersion: 1
- _HeightAmplitude: 0.02
- _HeightCenter: 0.5
- _HeightMapParametrization: 1

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

998
TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/1201_Lit_Features.png
文件差异内容过多而无法显示
查看文件

998
TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/1211_Lit_Details.png
文件差异内容过多而无法显示
查看文件

998
TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/1201_Lit_Features.png
文件差异内容过多而无法显示
查看文件

998
TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/1211_Lit_Details.png
文件差异内容过多而无法显示
查看文件

12
TestProjects/HDRP_Tests/ProjectSettings/EditorBuildSettings.asset


path: Assets/GraphicTests/Scenes/2x_Lighting/2202_ReflectionProbes_Volume.unity
guid: 9b3132db666b3ae48aa17349ab100118
- enabled: 1
path: Assets/GraphicTests/Scenes/2x_Lighting/2203_PlanarProbes.unity
guid: b8fa5b1235e91884799163adaf34e5d6
- enabled: 1
path: Assets/GraphicTests/Scenes/2x_Lighting/2204_ReflectionProbes_Lights.unity
guid: 21d198bbbf9143d40b227ad2fe71706f
- enabled: 1
path: Assets/GraphicTests/Scenes/2x_Lighting/2205_ReflectionProbes_influence.unity
guid: 423802799a6e57644a5d581a894f4646
- enabled: 1
- enabled: 1
path: Assets/GraphicTests/Scenes/2x_Lighting/2401_Light_on_Tesselation.unity
guid: 3f6529c22f7d2ca46814b2e7afd04ef9
- enabled: 1
path: Assets/GraphicTests/Scenes/2x_Lighting/2501_Instancing_Lighting.unity
guid: d841ad64fdc2ae14ba996e30fe86b901

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


### 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'.
- Decal now supports depth bias for decal mesh, to prevent z-fighting
### Fixed
- Fixed an issue with PreIntegratedFGD texture being sometimes destroyed and not regenerated causing rendering to break

- 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.
- Snap to grid now works for Decal projector resizing.
- Update detail map formula for smoothness and albedo, goal it to bright and dark perceptually and scale factor is use to control gradient speed
- Add opacity control on contact shadow
## [3.0.0-preview]

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;

166
com.unity.render-pipelines.high-definition/HDRP/Editor/AssetProcessors/NormalMapAverageLengthTexturePostprocessor.cs


using System;
using UnityEditor;
public class NormalMapAverageLengthTexturePostprocessor : AssetPostprocessor
namespace UnityEditor.Experimental.Rendering.HDPipeline
// This class will process a normal map and add the value of average normal length to the blue or alpha channel
// The texture is save as BC7.
// Tangent space normal map: BC7 RGB (normal xy - average normal length)
// Object space normal map: BC7 RGBA (normal xyz - average normal length)
static string s_Suffix = "_NA";
//static string s_SuffixOS = "_OSNA"; // Suffix for object space case - TODO
public class NormalMapAverageLengthTexturePostprocessor : AssetPostprocessor
{
// This class will process a normal map and add the value of average normal length to the blue or alpha channel
// The texture is save as BC7.
// Tangent space normal map: BC7 RGB (normal xy - average normal length)
// Object space normal map: BC7 RGBA (normal xyz - average normal length)
static string s_Suffix = "_NA";
//static string s_SuffixOS = "_OSNA"; // Suffix for object space case - TODO
void OnPreprocessTexture()
{
// Any texture with _NA suffix will store average normal lenght in alpha
if (Path.GetFileNameWithoutExtension(assetPath).EndsWith(s_Suffix, StringComparison.InvariantCultureIgnoreCase))
void OnPreprocessTexture()
// Make sure we don't convert as a normal map.
TextureImporter textureImporter = (TextureImporter)assetImporter;
textureImporter.convertToNormalmap = false;
textureImporter.alphaSource = TextureImporterAlphaSource.None;
textureImporter.mipmapEnabled = true;
textureImporter.textureCompression = TextureImporterCompression.CompressedHQ; // This is BC7 for Mac/PC
// Any texture with _NA suffix will store average normal lenght in alpha
if (Path.GetFileNameWithoutExtension(assetPath).EndsWith(s_Suffix, StringComparison.InvariantCultureIgnoreCase))
{
// Make sure we don't convert as a normal map.
TextureImporter textureImporter = (TextureImporter)assetImporter;
textureImporter.convertToNormalmap = false;
textureImporter.alphaSource = TextureImporterAlphaSource.None;
textureImporter.mipmapEnabled = true;
textureImporter.textureCompression = TextureImporterCompression.CompressedHQ; // This is BC7 for Mac/PC
textureImporter.linearTexture = true; // Says deprecated but won't work without it.
textureImporter.linearTexture = true; // Says deprecated but won't work without it.
textureImporter.sRGBTexture = false; // But we're setting the new property just in case it changes later...
textureImporter.sRGBTexture = false; // But we're setting the new property just in case it changes later...
}
}
private static Color GetColor(Color[] source, int x, int y, int width, int height)
{
x = (x + width) % width;
y = (y + height) % height;
private static Color GetColor(Color[] source, int x, int y, int width, int height)
{
x = (x + width) % width;
y = (y + height) % height;
int index = y * width + x;
var c = source[index];
int index = y * width + x;
var c = source[index];
return c;
}
return c;
}
private static Vector3 GetNormal(Color[] source, int x, int y, int width, int height)
{
Vector3 n = (Vector4)GetColor(source, x, y, width, height);
n = 2.0f * n - Vector3.one;
n.Normalize();
private static Vector3 GetNormal(Color[] source, int x, int y, int width, int height)
{
Vector3 n = (Vector4)GetColor(source, x, y, width, height);
n = 2.0f * n - Vector3.one;
n.Normalize();
return n;
}
private static Vector3 GetAverageNormal(Color[] source, int x, int y, int width, int height, int texelFootprint)
{
Vector3 averageNormal = new Vector3(0, 0, 0);
return n;
}
// Calculate the average color over the texel footprint.
for (int i = 0; i < texelFootprint; ++i)
private static Vector3 GetAverageNormal(Color[] source, int x, int y, int width, int height, int texelFootprint)
for (int j = 0; j < texelFootprint; ++j)
Vector3 averageNormal = new Vector3(0, 0, 0);
// Calculate the average color over the texel footprint.
for (int i = 0; i < texelFootprint; ++i)
averageNormal += GetNormal(source, x + i, y + j, width, height);
for (int j = 0; j < texelFootprint; ++j)
{
averageNormal += GetNormal(source, x + i, y + j, width, height);
}
}
averageNormal /= (texelFootprint * texelFootprint);
averageNormal /= (texelFootprint * texelFootprint);
return averageNormal;
}
return averageNormal;
}
void OnPostprocessTexture(Texture2D texture)
{
if (Path.GetFileNameWithoutExtension(assetPath).EndsWith(s_Suffix, StringComparison.InvariantCultureIgnoreCase))
void OnPostprocessTexture(Texture2D texture)
// Based on The Order : 1886 SIGGRAPH course notes implementation. Sample all normal map
// texels from the base mip level that are within the footprint of the current mipmap texel.
Color[] source = texture.GetPixels(0);
for (int m = 1; m < texture.mipmapCount; m++)
if (Path.GetFileNameWithoutExtension(assetPath).EndsWith(s_Suffix, StringComparison.InvariantCultureIgnoreCase))
Color[] c = texture.GetPixels(m);
// Based on The Order : 1886 SIGGRAPH course notes implementation. Sample all normal map
// texels from the base mip level that are within the footprint of the current mipmap texel.
Color[] source = texture.GetPixels(0);
for (int m = 1; m < texture.mipmapCount; m++)
{
Color[] c = texture.GetPixels(m);
int mipWidth = Math.Max(1, texture.width >> m);
int mipHeight = Math.Max(1, texture.height >> m);
int mipWidth = Math.Max(1, texture.width >> m);
int mipHeight = Math.Max(1, texture.height >> m);
for (int x = 0; x < mipWidth; ++x)
{
for (int y = 0; y < mipHeight; ++y)
for (int x = 0; x < mipWidth; ++x)
int texelFootprint = 1 << m;
Vector3 averageNormal = GetAverageNormal(source, x * texelFootprint, y * texelFootprint,
texture.width, texture.height, texelFootprint);
for (int y = 0; y < mipHeight; ++y)
{
int texelFootprint = 1 << m;
Vector3 averageNormal = GetAverageNormal(source, x * texelFootprint, y * texelFootprint,
texture.width, texture.height, texelFootprint);
// Store the normal length for the average normal.
int outputPosition = y * mipWidth + x;
// Store the normal length for the average normal.
int outputPosition = y * mipWidth + x;
// Clamp to avoid any issue (TODO: Check this)
// Write into the blue channel
float averageNormalLength = Math.Max(0.0f, Math.Min(1.0f, averageNormal.magnitude));
// Clamp to avoid any issue (TODO: Check this)
// Write into the blue channel
float averageNormalLength = Math.Max(0.0f, Math.Min(1.0f, averageNormal.magnitude));
c[outputPosition].b = averageNormalLength;
c[outputPosition].a = 1.0f;
c[outputPosition].b = averageNormalLength;
c[outputPosition].a = 1.0f;
}
texture.SetPixels(c, m);
texture.SetPixels(c, m);
}
// Now overwrite the first mip average normal channel - order is important as above we read the mip0
// For mip 0, set the normal length to 1.
{
Color[] c = texture.GetPixels(0);
for (int i = 0; i < c.Length; i++)
// Now overwrite the first mip average normal channel - order is important as above we read the mip0
// For mip 0, set the normal length to 1.
c[i].b = 1.0f;
c[i].a = 1.0f;
Color[] c = texture.GetPixels(0);
for (int i = 0; i < c.Length; i++)
{
c[i].b = 1.0f;
c[i].a = 1.0f;
}
texture.SetPixels(c, 0);
texture.SetPixels(c, 0);
}
}
}

53
com.unity.render-pipelines.high-definition/HDRP/Editor/BuildProcessors/HDRPPreprocessBuild.cs


using UnityEditor;
using UnityEngine;
class HDRPPreprocessBuild : IPreprocessBuildWithReport
namespace UnityEditor.Experimental.Rendering.HDPipeline
public int callbackOrder { get { return 0; } }
class HDRPPreprocessBuild : IPreprocessBuildWithReport
{
public int callbackOrder { get { return 0; } }
public void OnPreprocessBuild(BuildReport report)
{
// Don't execute the preprocess if we are not HDRenderPipeline
HDRenderPipeline hdrp = RenderPipelineManager.currentPipeline as HDRenderPipeline;
if (hdrp == null)
return;
public void OnPreprocessBuild(BuildReport report)
{
// Don't execute the preprocess if we are not HDRenderPipeline
HDRenderPipeline hdrp = RenderPipelineManager.currentPipeline as HDRenderPipeline;
if (hdrp == null)
return;
// Note: If you add new platform in this function, think about adding support in IsSupportedPlatform() function in HDRenderPipeline.cs
// Note: If you add new platform in this function, think about adding support in IsSupportedPlatform() function in HDRenderPipeline.cs
// If platform is supported all good
if (report.summary.platform == BuildTarget.StandaloneWindows ||
report.summary.platform == BuildTarget.StandaloneWindows64 ||
report.summary.platform == BuildTarget.StandaloneLinux64 ||
report.summary.platform == BuildTarget.StandaloneLinuxUniversal ||
report.summary.platform == BuildTarget.StandaloneOSX ||
report.summary.platform == BuildTarget.XboxOne ||
report.summary.platform == BuildTarget.PS4 ||
report.summary.platform == BuildTarget.Switch)
{
return;
}
// If platform is supported all good
if (report.summary.platform == BuildTarget.StandaloneWindows ||
report.summary.platform == BuildTarget.StandaloneWindows64 ||
report.summary.platform == BuildTarget.StandaloneLinux64 ||
report.summary.platform == BuildTarget.StandaloneLinuxUniversal ||
report.summary.platform == BuildTarget.StandaloneOSX ||
report.summary.platform == BuildTarget.XboxOne ||
report.summary.platform == BuildTarget.PS4 ||
report.summary.platform == BuildTarget.Switch)
{
return;
}
string msg = "The platform " + report.summary.platform.ToString() + " is not supported with Hight Definition Render Pipeline";
string msg = "The platform " + report.summary.platform.ToString() + " is not supported with Hight Definition Render Pipeline";
// Throw an exception to stop the build
throw new BuildFailedException(msg);
// Throw an exception to stop the build
throw new BuildFailedException(msg);
}
}
}

2
com.unity.render-pipelines.high-definition/HDRP/Editor/BuildProcessors/HDRPreprocessShaders.cs


using System.Collections;
using UnityEngine.Rendering;
using UnityEngine.Experimental.Rendering;
using UnityEngine.Experimental.Rendering.HDPipeline;

3
com.unity.render-pipelines.high-definition/HDRP/Editor/Camera/HDAdditionalCameraEditor.cs


using UnityEngine;
namespace UnityEditor.Experimental.Rendering
namespace UnityEditor.Experimental.Rendering.HDPipeline
{
[CanEditMultipleObjects]
[CustomEditor(typeof(HDAdditionalCameraData))]

2
com.unity.render-pipelines.high-definition/HDRP/Editor/Camera/HDCameraEditor.Handlers.cs


using UnityEngine.Rendering.PostProcessing;
using Object = UnityEngine.Object;
namespace UnityEditor.Experimental.Rendering
namespace UnityEditor.Experimental.Rendering.HDPipeline
{
using _ = CoreEditorUtils;

4
com.unity.render-pipelines.high-definition/HDRP/Editor/Camera/HDCameraEditor.cs


using System;
using UnityEngine.Experimental.Rendering;
namespace UnityEditor.Experimental.Rendering
namespace UnityEditor.Experimental.Rendering.HDPipeline
{
[CustomEditorForRenderPipeline(typeof(Camera), typeof(HDRenderPipelineAsset))]
[CanEditMultipleObjects]

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


using UnityEngine.Experimental.Rendering.HDPipeline;
using UnityEngine.Rendering;
namespace UnityEditor.Experimental.Rendering
namespace UnityEditor.Experimental.Rendering.HDPipeline
{
using _ = CoreEditorUtils;
using CED = CoreEditorDrawer<HDCameraUI, SerializedHDCamera>;

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


using UnityEngine;
using UnityEngine.Experimental.Rendering.HDPipeline;
namespace UnityEditor.Experimental.Rendering
namespace UnityEditor.Experimental.Rendering.HDPipeline
{
class SerializedHDCamera
{

280
com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/HDCubemapInspector.cs


using UnityEngine;
using UnityEditor;
[CustomEditorForRenderPipeline(typeof(Cubemap), typeof(HDRenderPipelineAsset))]
class HDCubemapInspector : Editor
namespace UnityEditor.Experimental.Rendering.HDPipeline
private enum NavMode
[CustomEditorForRenderPipeline(typeof(Cubemap), typeof(HDRenderPipelineAsset))]
class HDCubemapInspector : Editor
None = 0,
Zooming = 1,
Rotating = 2
}
private enum NavMode
{
None = 0,
Zooming = 1,
Rotating = 2
}
static GUIContent s_MipMapLow, s_MipMapHigh, s_ExposureLow;
static GUIStyle s_PreLabel;
static Mesh s_SphereMesh;
static GUIContent s_MipMapLow, s_MipMapHigh, s_ExposureLow;
static GUIStyle s_PreLabel;
static Mesh s_SphereMesh;
static Mesh sphereMesh
{
get { return s_SphereMesh ?? (s_SphereMesh = Resources.GetBuiltinResource(typeof(Mesh), "New-Sphere.fbx") as Mesh); }
}
static Mesh sphereMesh
{
get { return s_SphereMesh ?? (s_SphereMesh = Resources.GetBuiltinResource(typeof(Mesh), "New-Sphere.fbx") as Mesh); }
}
Material m_ReflectiveMaterial;
PreviewRenderUtility m_PreviewUtility;
float m_CameraPhi = 0.75f;
float m_CameraTheta = 0.5f;
float m_CameraDistance = 2.0f;
NavMode m_NavMode = NavMode.None;
Vector2 m_PreviousMousePosition = Vector2.zero;
Material m_ReflectiveMaterial;
PreviewRenderUtility m_PreviewUtility;
float m_CameraPhi = 0.75f;
float m_CameraTheta = 0.5f;
float m_CameraDistance = 2.0f;
NavMode m_NavMode = NavMode.None;
Vector2 m_PreviousMousePosition = Vector2.zero;
public float previewExposure = 0f;
public float mipLevelPreview = 0f;
public float previewExposure = 0f;
public float mipLevelPreview = 0f;
void Awake()
{
m_ReflectiveMaterial = new Material(Shader.Find("Debug/ReflectionProbePreview"))
void Awake()
hideFlags = HideFlags.HideAndDontSave
};
}
m_ReflectiveMaterial = new Material(Shader.Find("Debug/ReflectionProbePreview"))
{
hideFlags = HideFlags.HideAndDontSave
};
}
void OnEnable()
{
if (m_PreviewUtility == null)
InitPreview();
m_ReflectiveMaterial.SetTexture("_Cubemap", target as Texture);
}
void OnEnable()
{
if (m_PreviewUtility == null)
InitPreview();
void OnDisable()
{
if (m_PreviewUtility != null)
m_PreviewUtility.Cleanup();
}
m_ReflectiveMaterial.SetTexture("_Cubemap", target as Texture);
}
public override bool HasPreviewGUI()
{
return true;
}
void OnDisable()
{
if (m_PreviewUtility != null)
m_PreviewUtility.Cleanup();
}
public override void OnPreviewGUI(Rect r, GUIStyle background)
{
if (m_ReflectiveMaterial != null)
public override bool HasPreviewGUI()
m_ReflectiveMaterial.SetFloat("_Exposure", previewExposure);
m_ReflectiveMaterial.SetFloat("_MipLevel", mipLevelPreview);
return true;
if (m_PreviewUtility == null)
InitPreview();
public override void OnPreviewGUI(Rect r, GUIStyle background)
{
if (m_ReflectiveMaterial != null)
{
m_ReflectiveMaterial.SetFloat("_Exposure", previewExposure);
m_ReflectiveMaterial.SetFloat("_MipLevel", mipLevelPreview);
}
UpdateCamera();
if (m_PreviewUtility == null)
InitPreview();
m_PreviewUtility.BeginPreview(r, GUIStyle.none);
m_PreviewUtility.DrawMesh(sphereMesh, Matrix4x4.identity, m_ReflectiveMaterial, 0);
m_PreviewUtility.camera.Render();
m_PreviewUtility.EndAndDrawPreview(r);
UpdateCamera();
if (Event.current.type != EventType.Repaint)
{
if (HandleMouse(r))
Repaint();
m_PreviewUtility.BeginPreview(r, GUIStyle.none);
m_PreviewUtility.DrawMesh(sphereMesh, Matrix4x4.identity, m_ReflectiveMaterial, 0);
m_PreviewUtility.camera.Render();
m_PreviewUtility.EndAndDrawPreview(r);
if (Event.current.type != EventType.Repaint)
{
if (HandleMouse(r))
Repaint();
}
}
public override void OnPreviewSettings()
{
if (s_MipMapLow == null)
InitIcons();
var mipmapCount = 0;
var cubemap = target as Cubemap;
var rt = target as RenderTexture;
if (cubemap != null)
mipmapCount = cubemap.mipmapCount;
if (rt != null)
mipmapCount = rt.useMipMap
? (int)(Mathf.Log(Mathf.Max(rt.width, rt.height)) / Mathf.Log(2))
: 1;
public override void OnPreviewSettings()
{
if (s_MipMapLow == null)
InitIcons();
GUI.enabled = true;
var mipmapCount = 0;
var cubemap = target as Cubemap;
var rt = target as RenderTexture;
if (cubemap != null)
mipmapCount = cubemap.mipmapCount;
if (rt != null)
mipmapCount = rt.useMipMap
? (int)(Mathf.Log(Mathf.Max(rt.width, rt.height)) / Mathf.Log(2))
: 1;
GUILayout.Box(s_ExposureLow, s_PreLabel, GUILayout.MaxWidth(20));
GUI.changed = false;
previewExposure = GUILayout.HorizontalSlider(previewExposure, -10f, 10f, GUILayout.MaxWidth(80));
GUILayout.Space(5);
GUILayout.Box(s_MipMapHigh, s_PreLabel, GUILayout.MaxWidth(20));
GUI.changed = false;
mipLevelPreview = GUILayout.HorizontalSlider(mipLevelPreview, 0, mipmapCount, GUILayout.MaxWidth(80));
GUILayout.Box(s_MipMapLow, s_PreLabel, GUILayout.MaxWidth(20));
}
GUI.enabled = true;
void InitPreview()
{
if (m_PreviewUtility != null)
m_PreviewUtility.Cleanup();
m_PreviewUtility = new PreviewRenderUtility(false, true);
m_PreviewUtility.cameraFieldOfView = 50.0f;
m_PreviewUtility.camera.nearClipPlane = 0.01f;
m_PreviewUtility.camera.farClipPlane = 20.0f;
m_PreviewUtility.camera.transform.position = new Vector3(0, 0, 2);
m_PreviewUtility.camera.transform.LookAt(Vector3.zero);
}
GUILayout.Box(s_ExposureLow, s_PreLabel, GUILayout.MaxWidth(20));
GUI.changed = false;
previewExposure = GUILayout.HorizontalSlider(previewExposure, -10f, 10f, GUILayout.MaxWidth(80));
GUILayout.Space(5);
GUILayout.Box(s_MipMapHigh, s_PreLabel, GUILayout.MaxWidth(20));
GUI.changed = false;
mipLevelPreview = GUILayout.HorizontalSlider(mipLevelPreview, 0, mipmapCount, GUILayout.MaxWidth(80));
GUILayout.Box(s_MipMapLow, s_PreLabel, GUILayout.MaxWidth(20));
}
bool HandleMouse(Rect Viewport)
{
var result = false;
void InitPreview()
{
if (m_PreviewUtility != null)
m_PreviewUtility.Cleanup();
m_PreviewUtility = new PreviewRenderUtility(false, true);
m_PreviewUtility.cameraFieldOfView = 50.0f;
m_PreviewUtility.camera.nearClipPlane = 0.01f;
m_PreviewUtility.camera.farClipPlane = 20.0f;
m_PreviewUtility.camera.transform.position = new Vector3(0, 0, 2);
m_PreviewUtility.camera.transform.LookAt(Vector3.zero);
}
if (Event.current.type == EventType.MouseDown)
bool HandleMouse(Rect Viewport)
if (Event.current.button == 0)
m_NavMode = NavMode.Rotating;
else if (Event.current.button == 1)
m_NavMode = NavMode.Zooming;
var result = false;
m_PreviousMousePosition = Event.current.mousePosition;
result = true;
}
if (Event.current.type == EventType.MouseDown)
{
if (Event.current.button == 0)
m_NavMode = NavMode.Rotating;
else if (Event.current.button == 1)
m_NavMode = NavMode.Zooming;
if (Event.current.type == EventType.MouseUp || Event.current.rawType == EventType.MouseUp)
m_NavMode = NavMode.None;
m_PreviousMousePosition = Event.current.mousePosition;
result = true;
}
if (m_NavMode != NavMode.None)
{
var mouseDelta = Event.current.mousePosition - m_PreviousMousePosition;
switch (m_NavMode)
if (Event.current.type == EventType.MouseUp || Event.current.rawType == EventType.MouseUp)
m_NavMode = NavMode.None;
if (m_NavMode != NavMode.None)
case NavMode.Rotating:
m_CameraTheta = (m_CameraTheta - mouseDelta.x * 0.003f) % (Mathf.PI * 2);
m_CameraPhi = Mathf.Clamp(m_CameraPhi - mouseDelta.y * 0.003f, 0.2f, Mathf.PI - 0.2f);
break;
case NavMode.Zooming:
m_CameraDistance = Mathf.Clamp(mouseDelta.y * 0.01f + m_CameraDistance, 1, 10);
break;
var mouseDelta = Event.current.mousePosition - m_PreviousMousePosition;
switch (m_NavMode)
{
case NavMode.Rotating:
m_CameraTheta = (m_CameraTheta - mouseDelta.x * 0.003f) % (Mathf.PI * 2);
m_CameraPhi = Mathf.Clamp(m_CameraPhi - mouseDelta.y * 0.003f, 0.2f, Mathf.PI - 0.2f);
break;
case NavMode.Zooming:
m_CameraDistance = Mathf.Clamp(mouseDelta.y * 0.01f + m_CameraDistance, 1, 10);
break;
}
result = true;
result = true;
m_PreviousMousePosition = Event.current.mousePosition;
return result;
m_PreviousMousePosition = Event.current.mousePosition;
return result;
}
void UpdateCamera()
{
var pos = new Vector3(Mathf.Sin(m_CameraPhi) * Mathf.Cos(m_CameraTheta), Mathf.Cos(m_CameraPhi), Mathf.Sin(m_CameraPhi) * Mathf.Sin(m_CameraTheta)) * m_CameraDistance;
m_PreviewUtility.camera.transform.position = pos;
m_PreviewUtility.camera.transform.LookAt(Vector3.zero);
}
void UpdateCamera()
{
var pos = new Vector3(Mathf.Sin(m_CameraPhi) * Mathf.Cos(m_CameraTheta), Mathf.Cos(m_CameraPhi), Mathf.Sin(m_CameraPhi) * Mathf.Sin(m_CameraTheta)) * m_CameraDistance;
m_PreviewUtility.camera.transform.position = pos;
m_PreviewUtility.camera.transform.LookAt(Vector3.zero);
}
static void InitIcons()
{
s_MipMapLow = EditorGUIUtility.IconContent("PreTextureMipMapLow");
s_MipMapHigh = EditorGUIUtility.IconContent("PreTextureMipMapHigh");
s_ExposureLow = EditorGUIUtility.IconContent("SceneViewLighting");
s_PreLabel = "preLabel";
static void InitIcons()
{
s_MipMapLow = EditorGUIUtility.IconContent("PreTextureMipMapLow");
s_MipMapHigh = EditorGUIUtility.IconContent("PreTextureMipMapHigh");
s_ExposureLow = EditorGUIUtility.IconContent("SceneViewLighting");
s_PreLabel = "preLabel";
}
}
}

2
com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/HDReflectionProbeEditor.Gizmos.cs


using UnityEngine.Experimental.Rendering;
using UnityEngine.Experimental.Rendering.HDPipeline;
namespace UnityEditor.Experimental.Rendering
namespace UnityEditor.Experimental.Rendering.HDPipeline
{
partial class HDReflectionProbeEditor
{

3
com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/HDReflectionProbeEditor.Handles.cs


using System;
using UnityEditor.IMGUI.Controls;
using UnityEditorInternal;
using UnityEngine;

namespace UnityEditor.Experimental.Rendering
namespace UnityEditor.Experimental.Rendering.HDPipeline
{
partial class HDReflectionProbeEditor
{

2
com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/HDReflectionProbeEditor.Preview.cs


using UnityEngine;
namespace UnityEditor.Experimental.Rendering
namespace UnityEditor.Experimental.Rendering.HDPipeline
{
partial class HDReflectionProbeEditor
{

6
com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/HDReflectionProbeEditor.ProbeUtility.cs


using UnityEngine;
using UnityEngine.Experimental.Rendering;
using Object = UnityEngine.Object;
namespace UnityEditor.Experimental.Rendering
namespace UnityEditor.Experimental.Rendering.HDPipeline
{
partial class HDReflectionProbeEditor
{

2
com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/HDReflectionProbeEditor.Skin.cs


using UnityEngine.Experimental.Rendering;
using UnityEngine.Experimental.Rendering.HDPipeline;
namespace UnityEditor.Experimental.Rendering
namespace UnityEditor.Experimental.Rendering.HDPipeline
{
partial class HDReflectionProbeEditor
{

2
com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/HDReflectionProbeEditor.cs


using UnityEngine.Experimental.Rendering.HDPipeline;
using UnityEngine.Rendering;
namespace UnityEditor.Experimental.Rendering
namespace UnityEditor.Experimental.Rendering.HDPipeline
{
[CustomEditorForRenderPipeline(typeof(ReflectionProbe), typeof(HDRenderPipelineAsset))]
[CanEditMultipleObjects]

8
com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/HDReflectionProbeEditorUtility.cs


using System;
using System.IO;
using System.Linq;
using System.Reflection;
using UnityEngine.SceneManagement;
using Object = UnityEngine.Object;
namespace UnityEditor.Experimental.Rendering
namespace UnityEditor.Experimental.Rendering.HDPipeline
{
public static class HDReflectionProbeEditorUtility
{

3
com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/HDReflectionProbeUI.Drawers.cs


using System;
using System.Reflection;
using UnityEditor.Experimental.Rendering.HDPipeline;
namespace UnityEditor.Experimental.Rendering
namespace UnityEditor.Experimental.Rendering.HDPipeline
{
using CED = CoreEditorDrawer<HDReflectionProbeUI, SerializedHDReflectionProbe>;
using _ = CoreEditorUtils;

2
com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/HDReflectionProbeUI.cs


using UnityEngine.Experimental.Rendering.HDPipeline;
using UnityEngine.Rendering;
namespace UnityEditor.Experimental.Rendering
namespace UnityEditor.Experimental.Rendering.HDPipeline
{
public partial class HDReflectionProbeUI : BaseUI<SerializedHDReflectionProbe>
{

2
com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/ScreenSpaceRefractionEditor.cs


using System.Collections;
using UnityEngine;
using UnityEngine.Experimental.Rendering.HDPipeline;
namespace UnityEditor.Experimental.Rendering.HDPipeline

2
com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/SerializedHDReflectionProbe.cs


using UnityEngine;
using UnityEngine.Experimental.Rendering;
namespace UnityEditor.Experimental.Rendering
namespace UnityEditor.Experimental.Rendering.HDPipeline
{
public class SerializedHDReflectionProbe
{

69
com.unity.render-pipelines.high-definition/HDRP/Editor/Material/Decal/DecalProjectorComponentEditor.cs


private SerializedProperty m_UVScaleProperty;
private SerializedProperty m_UVBiasProperty;
private SerializedProperty m_AffectsTransparencyProperty;
public class DecalBoundsHandle : BoxBoundsHandle
{
protected override Bounds OnHandleChanged(HandleDirection handle, Bounds boundsOnClick, Bounds newBounds)
{
// special case for Y axis because decal mesh is centered at 0, -0.5, 0
if (handle == HandleDirection.NegativeY)
{
m_Translation = Vector3.zero;
m_Scale = newBounds.size;
}
else if (handle == HandleDirection.PositiveY)
{
m_Translation = (newBounds.center + newBounds.extents - (m_Center + 0.5f * m_Size));
m_Scale = (m_Size + m_Translation);
}
else
{
m_Translation = newBounds.center - m_Center;
m_Scale = newBounds.size;
}
return newBounds;
}
public void SetSizeAndCenter(Vector3 inSize, Vector3 inCenter)
{
// boundsOnClick implies that it gets refreshed only if the handle is clicked on again, but we need actual center and scale which we set before handle is drawn every frame
m_Center = inCenter;
m_Size = inSize;
center = inCenter;
size = inSize;
}
private Vector3 m_Center;
private Vector3 m_Size;
public Vector3 m_Translation;
public Vector3 m_Scale;
}
private DecalBoundsHandle m_Handle = new DecalBoundsHandle();
private SerializedProperty m_Center;
private SerializedProperty m_Size;
private BoxBoundsHandle m_Handle = new BoxBoundsHandle();
private void OnEnable()
{

m_UVScaleProperty = serializedObject.FindProperty("m_UVScale");
m_UVBiasProperty = serializedObject.FindProperty("m_UVBias");
m_AffectsTransparencyProperty = serializedObject.FindProperty("m_AffectsTransparency");
m_Center = serializedObject.FindProperty("m_Offset");
m_Size = serializedObject.FindProperty("m_Size");
}
private void OnDisable()

}
void OnSceneGUI()
{
EditorGUI.BeginChangeCheck();
{
// decal mesh is centered at (0, -0.5, 0)
// zero out the local scale in the matrix so that handle code gives us back the actual scale
Handles.matrix = Matrix4x4.TRS(m_DecalProjectorComponent.transform.position, m_DecalProjectorComponent.transform.rotation, Vector3.one) * Matrix4x4.Translate(new Vector3(0.0f, -0.5f * m_DecalProjectorComponent.transform.localScale.y, 0.0f));
// pass in the scale
m_Handle.SetSizeAndCenter(m_DecalProjectorComponent.transform.localScale, Vector3.zero);
Handles.matrix = m_DecalProjectorComponent.transform.localToWorldMatrix;
m_Handle.center = m_DecalProjectorComponent.m_Offset;
m_Handle.size = m_DecalProjectorComponent.m_Size;
EditorGUI.BeginChangeCheck();
m_DecalProjectorComponent.transform.Translate(m_Handle.m_Translation);
m_DecalProjectorComponent.transform.localScale = m_Handle.m_Scale;
Repaint();
m_DecalProjectorComponent.m_Offset = m_Handle.center;
m_DecalProjectorComponent.m_Size = m_Handle.size;
EditorUtility.SetDirty(m_DecalProjectorComponent);
Handles.matrix = mat;
Handles.color = col;
}

EditorGUI.BeginChangeCheck();
EditorGUILayout.PropertyField(m_Center);
EditorGUILayout.PropertyField(m_Size);
EditorGUILayout.PropertyField(m_MaterialProperty);
EditorGUILayout.PropertyField(m_DrawDistanceProperty);
EditorGUILayout.Slider(m_FadeScaleProperty, 0.0f, 1.0f, new GUIContent("Fade scale"));

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


public static GUIContent normalMapText = new GUIContent("Normal Map", "Normal Map (BC7/BC5/DXT5(nm))");
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 MeshDecalDepthBiasText = new GUIContent("Mesh decal depth bias", "prevents z-fighting");
public static GUIContent[] maskMapText =
{

protected MaterialProperty maskmapSmoothness = new MaterialProperty();
protected const string kMaskmapSmoothness = "_MaskmapSmoothness";
protected MaterialProperty decalMeshDepthBias = new MaterialProperty();
protected const string kDecalMeshDepthBias = "_DecalMeshDepthBias";
protected MaterialEditor m_MaterialEditor;
// This is call by the inspector

maskmapMetal = FindProperty(kMaskmapMetal, props);
maskmapAO = FindProperty(kMaskmapAO, props);
maskmapSmoothness = FindProperty(kMaskmapSmoothness, props);
decalMeshDepthBias = FindProperty(kDecalMeshDepthBias, props);
// always instanced
SerializedProperty instancing = m_MaterialEditor.serializedObject.FindProperty("m_EnableInstancingVariants");

EditorGUI.indentLevel++;
m_MaterialEditor.TexturePropertySingleLine((material.GetFloat(kAlbedoMode) == 1.0f) ? Styles.baseColorText : Styles.baseColorText2, baseColorMap, baseColor);
if (material.GetTexture(kBaseColorMap))
{
EditorGUI.indentLevel++;
m_MaterialEditor.ShaderProperty(albedoMode, Styles.AlbedoModeText);
EditorGUI.indentLevel--;
}
// Currently always display Albedo contribution as we have an albedo tint that apply
EditorGUI.indentLevel++;
m_MaterialEditor.ShaderProperty(albedoMode, Styles.AlbedoModeText);
EditorGUI.indentLevel--;
m_MaterialEditor.TexturePropertySingleLine(Styles.normalMapText, normalMap);
if (material.GetTexture(kNormalMap))

EditorGUI.indentLevel--;
}
m_MaterialEditor.ShaderProperty(decalBlend, Styles.decalBlendText);
m_MaterialEditor.ShaderProperty(decalMeshDepthBias, Styles.MeshDecalDepthBiasText);
EditorGUI.indentLevel--;
EditorGUILayout.HelpBox(

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


using UnityEditor.AnimatedValues;
using UnityEngine.Events;
namespace UnityEditor.Experimental.Rendering
namespace UnityEditor.Experimental.Rendering.HDPipeline
{
public class BaseUI<TType>
{

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


using UnityEngine.Events;
namespace UnityEditor.Experimental.Rendering
namespace UnityEditor.Experimental.Rendering.HDPipeline
{
using _ = CoreEditorUtils;
using CED = CoreEditorDrawer<HDRenderPipelineUI, SerializedHDRenderPipelineAsset>;

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


using UnityEditor.AnimatedValues;
using UnityEngine.Events;
namespace UnityEditor.Experimental.Rendering
namespace UnityEditor.Experimental.Rendering.HDPipeline
{
using _ = CoreEditorUtils;
using CED = CoreEditorDrawer<FrameSettingsUI, SerializedFrameSettings>;

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


using UnityEngine;
namespace UnityEditor.Experimental.Rendering
namespace UnityEditor.Experimental.Rendering.HDPipeline
{
using _ = CoreEditorUtils;
using CED = CoreEditorDrawer<GlobalDecalSettingsUI, SerializedGlobalDecalSettings>;

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


using UnityEngine;
namespace UnityEditor.Experimental.Rendering
namespace UnityEditor.Experimental.Rendering.HDPipeline
{
using _ = CoreEditorUtils;
using CED = CoreEditorDrawer<GlobalLightLoopSettingsUI, SerializedGlobalLightLoopSettings>;

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


using UnityEditor.AnimatedValues;
using UnityEngine;
namespace UnityEditor.Experimental.Rendering
namespace UnityEditor.Experimental.Rendering.HDPipeline
{
using _ = CoreEditorUtils;
using CED = CoreEditorDrawer<LightLoopSettingsUI, SerializedLightLoopSettings>;

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


using UnityEngine.Events;
namespace UnityEditor.Experimental.Rendering
namespace UnityEditor.Experimental.Rendering.HDPipeline
{
using _ = CoreEditorUtils;
using CED = CoreEditorDrawer<RenderPipelineSettingsUI, SerializedRenderPipelineSettings>;

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


using UnityEngine.Experimental.Rendering.HDPipeline;
namespace UnityEditor.Experimental.Rendering
namespace UnityEditor.Experimental.Rendering.HDPipeline
{
public class SerializedFrameSettings
{

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


using UnityEngine.Experimental.Rendering.HDPipeline;
namespace UnityEditor.Experimental.Rendering
namespace UnityEditor.Experimental.Rendering.HDPipeline
{
class SerializedGlobalDecalSettings
{

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


using UnityEngine.Experimental.Rendering.HDPipeline;
namespace UnityEditor.Experimental.Rendering
namespace UnityEditor.Experimental.Rendering.HDPipeline
{
class SerializedGlobalLightLoopSettings
{

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


using UnityEngine.Experimental.Rendering.HDPipeline;
namespace UnityEditor.Experimental.Rendering
namespace UnityEditor.Experimental.Rendering.HDPipeline
{
class SerializedHDRenderPipelineAsset
{

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


using UnityEngine.Experimental.Rendering.HDPipeline;
namespace UnityEditor.Experimental.Rendering
namespace UnityEditor.Experimental.Rendering.HDPipeline
{
public class SerializedLightLoopSettings
{

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


using UnityEngine.Experimental.Rendering.HDPipeline;
namespace UnityEditor.Experimental.Rendering
namespace UnityEditor.Experimental.Rendering.HDPipeline
{
class SerializedRenderPipelineSettings
{

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


using UnityEngine.Experimental.Rendering;
namespace UnityEditor.Experimental.Rendering
namespace UnityEditor.Experimental.Rendering.HDPipeline
{
class SerializedShadowInitParameters
{

5
com.unity.render-pipelines.high-definition/HDRP/Editor/RenderPipeline/Settings/ShadowInitParametersUI.cs


using UnityEditor.AnimatedValues;
using UnityEngine.Events;
using UnityEngine.Experimental.Rendering.HDPipeline;
namespace UnityEditor.Experimental.Rendering
namespace UnityEditor.Experimental.Rendering.HDPipeline
{
using _ = CoreEditorUtils;
using CED = CoreEditorDrawer<ShadowInitParametersUI, SerializedShadowInitParameters>;

11
com.unity.render-pipelines.high-definition/HDRP/Editor/Shadows/ContactShadowsEditor.cs


[VolumeComponentEditor(typeof(ContactShadows))]
public class ContactShadowsEditor : VolumeComponentEditor
{
public readonly GUIContent contactShadow = new GUIContent("Contact Shadows");
public readonly GUIContent contactShadowLength = new GUIContent("Length", "Length of rays used to gather contact shadows in world units.\nZero will disable the feature.");
public readonly GUIContent contactShadowDistanceScaleFactor = new GUIContent("Distance Scale Factor", "Contact Shadows are scaled up with distance. Use this parameter to dampen this effect.");
public readonly GUIContent contactShadowMaxDistance = new GUIContent("Max Distance", "Distance from the camera in world units at which contact shadows are faded out to zero.");
public readonly GUIContent contactShadowFadeDistance = new GUIContent("Fade Distance", "Distance in world units over which the contact shadows are faded out (see Max Distance).");
public readonly GUIContent contactShadowSampleCount = new GUIContent("Sample Count", "Number of samples when ray casting.");
SerializedDataParameter m_Enable;
SerializedDataParameter m_Length;
SerializedDataParameter m_DistanceScaleFactor;

SerializedDataParameter m_Opacity;
public override void OnEnable()

m_MaxDistance = Unpack(o.Find(x => x.maxDistance));
m_FadeDistance = Unpack(o.Find(x => x.fadeDistance));
m_SampleCount = Unpack(o.Find(x => x.sampleCount));
m_Opacity = Unpack(o.Find(x => x.opacity));
}
public override void OnInspectorGUI()

PropertyField(m_MaxDistance, CoreEditorUtils.GetContent("Max Distance|Distance from the camera in world units at which contact shadows are faded out to zero."));
PropertyField(m_FadeDistance, CoreEditorUtils.GetContent("Fade Distance|Distance in world units over which the contact shadows fade out (see Max Distance)."));
PropertyField(m_SampleCount, CoreEditorUtils.GetContent("Sample Count|Number of samples when ray casting."));
PropertyField(m_Opacity, CoreEditorUtils.GetContent("Opacity|Opacity of the resulting contact shadow."));
}
}
}

2
com.unity.render-pipelines.high-definition/HDRP/Editor/Shadows/HDShadowSettingsEditor.cs


using System.Collections;
using UnityEngine;
using UnityEditor;
using UnityEditor.Experimental.Rendering;

2
com.unity.render-pipelines.high-definition/HDRP/Editor/Sky/HDRISky/HDRISkyEditor.cs


using UnityEngine;
using UnityEditor;
using UnityEngine.Experimental.Rendering.HDPipeline;
namespace UnityEditor.Experimental.Rendering.HDPipeline

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


static HDRPVersion()
{
/*
// Compare project version with current version - Trigger an upgrade if user ask for it
if (false) //GetCurrentHDRPProjectVersion() < hdrpVersion) // TODO: Disable for now as it doesn't work correctly
{

UpgradeMenuItems.UpdateMaterialToNewerVersion();
}
}
*/
}
}

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


if (maskBlendMode == 0.0f)
{
mat.SetFloat("_MaskBlendMode", 4.0f);
mat.SetFloat("_MaskBlendMode", (float)Decal.MaskBlendFlags.Smoothness);
return true;
}
}

4
com.unity.render-pipelines.high-definition/HDRP/Lighting/LightLoop/LightLoop.cs


float contactShadowFadeEnd = m_ContactShadows.maxDistance;
float contactShadowOneOverFadeRange = 1.0f / (contactShadowRange);
Vector4 contactShadowParams = new Vector4(m_ContactShadows.length, m_ContactShadows.distanceScaleFactor, contactShadowFadeEnd, contactShadowOneOverFadeRange);
cmd.SetComputeVectorParam(screenSpaceShadowComputeShader, HDShaderIDs._DirectionalContactShadowParams, contactShadowParams);
Vector4 contactShadowParams2 = new Vector4(m_ContactShadows.opacity, 0.0f, 0.0f, 0.0f);
cmd.SetComputeVectorParam(screenSpaceShadowComputeShader, HDShaderIDs._ContactShadowParamsParameters, contactShadowParams);
cmd.SetComputeVectorParam(screenSpaceShadowComputeShader, HDShaderIDs._ContactShadowParamsParameters2, contactShadowParams2);
cmd.SetComputeIntParam(screenSpaceShadowComputeShader, HDShaderIDs._DirectionalContactShadowSampleCount, m_ContactShadows.sampleCount);
}

16
com.unity.render-pipelines.high-definition/HDRP/Lighting/ScreenSpaceShadow.compute


uint _DirectionalShadowIndex;
float4 _DirectionalLightDirection;
float4 _PunctualLightPosition;
float4 _ScreenSpaceShadowsParameters;
float4 _ContactShadowParamsParameters;
float4 _ContactShadowParamsParameters2;
#define _ContactShadowLength _ScreenSpaceShadowsParameters.x
#define _ContactShadowDistanceScaleFactor _ScreenSpaceShadowsParameters.y
#define _ContactShadowFadeEnd _ScreenSpaceShadowsParameters.z
#define _ContactShadowFadeOneOverRange _ScreenSpaceShadowsParameters.w
#define _ContactShadowLength _ContactShadowParamsParameters.x
#define _ContactShadowDistanceScaleFactor _ContactShadowParamsParameters.y
#define _ContactShadowFadeEnd _ContactShadowParamsParameters.z
#define _ContactShadowFadeOneOverRange _ContactShadowParamsParameters.w
#define _ContactShadowOpacity _ContactShadowParamsParameters2.x
#define DEFERRED_SHADOW_TILE_SIZE 16

contactShadow = 1.0 - result.x * saturate((_ContactShadowFadeEnd - posInput.linearDepth) * _ContactShadowFadeOneOverRange);
}
return contactShadow;
return lerp(1.0, contactShadow, _ContactShadowOpacity);
}
[numthreads(DEFERRED_SHADOW_TILE_SIZE, DEFERRED_SHADOW_TILE_SIZE, 1)]

contactShadow = ComputeContactShadow(posInput, direction);
_DeferredShadowTextureUAV[pixelCoord] = float4(1.0, contactShadow, 1.0, 1.0);
}
}

230
com.unity.render-pipelines.high-definition/HDRP/Lighting/SphericalHarmonics.cs


using System;
using UnityEngine;
public struct ZonalHarmonicsL2
{
public float[] coeffs; // Must have the size of 3
public static ZonalHarmonicsL2 GetHenyeyGreensteinPhaseFunction(float anisotropy)
namespace UnityEngine.Experimental.Rendering.HDPipeline
{
public struct ZonalHarmonicsL2
float g = anisotropy;
public float[] coeffs; // Must have the size of 3
var zh = new ZonalHarmonicsL2();
zh.coeffs = new float[3];
public static ZonalHarmonicsL2 GetHenyeyGreensteinPhaseFunction(float anisotropy)
{
float g = anisotropy;
zh.coeffs[0] = 0.5f * Mathf.Sqrt(1.0f / Mathf.PI);
zh.coeffs[1] = 0.5f * Mathf.Sqrt(3.0f / Mathf.PI) * g;
zh.coeffs[2] = 0.5f * Mathf.Sqrt(5.0f / Mathf.PI) * g * g;
var zh = new ZonalHarmonicsL2();
zh.coeffs = new float[3];
return zh;
}
zh.coeffs[0] = 0.5f * Mathf.Sqrt(1.0f / Mathf.PI);
zh.coeffs[1] = 0.5f * Mathf.Sqrt(3.0f / Mathf.PI) * g;
zh.coeffs[2] = 0.5f * Mathf.Sqrt(5.0f / Mathf.PI) * g * g;
public static ZonalHarmonicsL2 GetCornetteShanksPhaseFunction(float anisotropy)
{
float g = anisotropy;
return zh;
}
var zh = new ZonalHarmonicsL2();
zh.coeffs = new float[3];
public static ZonalHarmonicsL2 GetCornetteShanksPhaseFunction(float anisotropy)
{
float g = anisotropy;
var zh = new ZonalHarmonicsL2();
zh.coeffs = new float[3];
zh.coeffs[0] = 0.282095f;
zh.coeffs[1] = 0.293162f * g * (4.0f + (g * g)) / (2.0f + (g * g));
zh.coeffs[2] = (0.126157f + 1.44179f * (g * g) + 0.324403f * (g * g) * (g * g)) / (2.0f + (g * g));
zh.coeffs[0] = 0.282095f;
zh.coeffs[1] = 0.293162f * g * (4.0f + (g * g)) / (2.0f + (g * g));
zh.coeffs[2] = (0.126157f + 1.44179f * (g * g) + 0.324403f * (g * g) * (g * g)) / (2.0f + (g * g));
return zh;
return zh;
}
}
public class SphericalHarmonicMath
{
// Ref: "Stupid Spherical Harmonics Tricks", p. 6.
public static SphericalHarmonicsL2 Convolve(SphericalHarmonicsL2 sh, ZonalHarmonicsL2 zh)
public class SphericalHarmonicMath
for (int l = 0; l <= 2; l++)
// Ref: "Stupid Spherical Harmonics Tricks", p. 6.
public static SphericalHarmonicsL2 Convolve(SphericalHarmonicsL2 sh, ZonalHarmonicsL2 zh)
float n = Mathf.Sqrt((4.0f * Mathf.PI) / (2 * l + 1));
float k = zh.coeffs[l];
float p = n * k;
for (int m = -l; m <= l; m++)
for (int l = 0; l <= 2; l++)
int i = l * (l + 1) + m;
float n = Mathf.Sqrt((4.0f * Mathf.PI) / (2 * l + 1));
float k = zh.coeffs[l];
float p = n * k;
for (int c = 0; c < 3; c++)
for (int m = -l; m <= l; m++)
sh[c, i] *= p;
int i = l * (l + 1) + m;
for (int c = 0; c < 3; c++)
{
sh[c, i] *= p;
}
return sh;
return sh;
}
// Undoes coefficient rescaling due to the convolution with the clamped cosine kernel
// to obtain the canonical values of SH.
public static SphericalHarmonicsL2 UndoCosineRescaling(SphericalHarmonicsL2 sh)
{
const float c0 = 0.28209479177387814347f; // 1/2 * sqrt(1/Pi)
const float c1 = 0.32573500793527994772f; // 1/3 * sqrt(3/Pi)
const float c2 = 0.27313710764801976764f; // 1/8 * sqrt(15/Pi)
const float c3 = 0.07884789131313000151f; // 1/16 * sqrt(5/Pi)
const float c4 = 0.13656855382400988382f; // 1/16 * sqrt(15/Pi)
// Undoes coefficient rescaling due to the convolution with the clamped cosine kernel
// to obtain the canonical values of SH.
public static SphericalHarmonicsL2 UndoCosineRescaling(SphericalHarmonicsL2 sh)
{
const float c0 = 0.28209479177387814347f; // 1/2 * sqrt(1/Pi)
const float c1 = 0.32573500793527994772f; // 1/3 * sqrt(3/Pi)
const float c2 = 0.27313710764801976764f; // 1/8 * sqrt(15/Pi)
const float c3 = 0.07884789131313000151f; // 1/16 * sqrt(5/Pi)
const float c4 = 0.13656855382400988382f; // 1/16 * sqrt(15/Pi)
// Compute the inverse of SphericalHarmonicsL2::kNormalizationConstants.
// See SetSHEMapConstants() in "Stupid Spherical Harmonics Tricks".
float[] invNormConsts = { 1 / c0, -1 / c1, 1 / c1, -1 / c1, 1 / c2, -1 / c2, 1 / c3, -1 / c2, 1 / c4 };
// Compute the inverse of SphericalHarmonicsL2::kNormalizationConstants.
// See SetSHEMapConstants() in "Stupid Spherical Harmonics Tricks".
float[] invNormConsts = { 1 / c0, -1 / c1, 1 / c1, -1 / c1, 1 / c2, -1 / c2, 1 / c3, -1 / c2, 1 / c4 };
for (int c = 0; c < 3; c++)
{
for (int i = 0; i < 9; i++)
for (int c = 0; c < 3; c++)
sh[c, i] *= invNormConsts[i];
for (int i = 0; i < 9; i++)
{
sh[c, i] *= invNormConsts[i];
}
}
return sh;
}
return sh;
}
// Premultiplies the SH with the polynomial coefficients of SH basis functions,
// which avoids using any constants during SH evaluation.
// The resulting evaluation takes the form:
// (c_0 - c_6) + c_1 y + c_2 z + c_3 x + c_4 x y + c_5 y z + c_6 (3 z^2) + c_7 x z + c_8 (x^2 - y^2)
public static SphericalHarmonicsL2 PremultiplyCoefficients(SphericalHarmonicsL2 sh)
{
const float k0 = 0.28209479177387814347f; // {0, 0} : 1/2 * sqrt(1/Pi)
const float k1 = 0.48860251190291992159f; // {1, 0} : 1/2 * sqrt(3/Pi)
const float k2 = 1.09254843059207907054f; // {2,-2} : 1/2 * sqrt(15/Pi)
const float k3 = 0.31539156525252000603f; // {2, 0} : 1/4 * sqrt(5/Pi)
const float k4 = 0.54627421529603953527f; // {2, 2} : 1/4 * sqrt(15/Pi)
// Premultiplies the SH with the polynomial coefficients of SH basis functions,
// which avoids using any constants during SH evaluation.
// The resulting evaluation takes the form:
// (c_0 - c_6) + c_1 y + c_2 z + c_3 x + c_4 x y + c_5 y z + c_6 (3 z^2) + c_7 x z + c_8 (x^2 - y^2)
public static SphericalHarmonicsL2 PremultiplyCoefficients(SphericalHarmonicsL2 sh)
{
const float k0 = 0.28209479177387814347f; // {0, 0} : 1/2 * sqrt(1/Pi)
const float k1 = 0.48860251190291992159f; // {1, 0} : 1/2 * sqrt(3/Pi)
const float k2 = 1.09254843059207907054f; // {2,-2} : 1/2 * sqrt(15/Pi)
const float k3 = 0.31539156525252000603f; // {2, 0} : 1/4 * sqrt(5/Pi)
const float k4 = 0.54627421529603953527f; // {2, 2} : 1/4 * sqrt(15/Pi)
float[] ks = { k0, -k1, k1, -k1, k2, -k2, k3, -k2, k4 };
float[] ks = { k0, -k1, k1, -k1, k2, -k2, k3, -k2, k4 };
for (int c = 0; c < 3; c++)
{
for (int i = 0; i < 9; i++)
for (int c = 0; c < 3; c++)
sh[c, i] *= ks[i];
for (int i = 0; i < 9; i++)
{
sh[c, i] *= ks[i];
}
return sh;
return sh;
}
public static SphericalHarmonicsL2 RescaleCoefficients(SphericalHarmonicsL2 sh, float scalar)
{
for (int c = 0; c < 3; c++)
public static SphericalHarmonicsL2 RescaleCoefficients(SphericalHarmonicsL2 sh, float scalar)
for (int i = 0; i < 9; i++)
for (int c = 0; c < 3; c++)
sh[c, i] *= scalar;
for (int i = 0; i < 9; i++)
{
sh[c, i] *= scalar;
}
return sh;
return sh;
}
// Packs coefficients so that we can use Peter-Pike Sloan's shader code.
// Does not perform premultiplication with coefficients of SH basis functions.
// See SetSHEMapConstants() in "Stupid Spherical Harmonics Tricks".
public static Vector4[] PackCoefficients(SphericalHarmonicsL2 sh)
{
Vector4[] coeffs = new Vector4[7];
// Constant + linear
for (int c = 0; c < 3; c++)
{
coeffs[c].x = sh[c, 3];
coeffs[c].y = sh[c, 1];
coeffs[c].z = sh[c, 2];
coeffs[c].w = sh[c, 0] - sh[c, 6];
}
// Packs coefficients so that we can use Peter-Pike Sloan's shader code.
// Does not perform premultiplication with coefficients of SH basis functions.
// See SetSHEMapConstants() in "Stupid Spherical Harmonics Tricks".
public static Vector4[] PackCoefficients(SphericalHarmonicsL2 sh)
{
Vector4[] coeffs = new Vector4[7];
// Quadratic (4/5)
for (int c = 0; c < 3; c++)
{
coeffs[3 + c].x = sh[c, 4];
coeffs[3 + c].y = sh[c, 5];
coeffs[3 + c].z = sh[c, 6] * 3.0f;
coeffs[3 + c].w = sh[c, 7];
}
// Constant + linear
for (int c = 0; c < 3; c++)
{
coeffs[c].x = sh[c, 3];
coeffs[c].y = sh[c, 1];
coeffs[c].z = sh[c, 2];
coeffs[c].w = sh[c, 0] - sh[c, 6];
}
// Quadratic (5)
coeffs[6].x = sh[0, 8];
coeffs[6].y = sh[1, 8];
coeffs[6].z = sh[2, 8];
coeffs[6].w = 1.0f;
// Quadratic (4/5)
for (int c = 0; c < 3; c++)
{
coeffs[3 + c].x = sh[c, 4];
coeffs[3 + c].y = sh[c, 5];
coeffs[3 + c].z = sh[c, 6] * 3.0f;
coeffs[3 + c].w = sh[c, 7];
return coeffs;
// Quadratic (5)
coeffs[6].x = sh[0, 8];
coeffs[6].y = sh[1, 8];
coeffs[6].z = sh[2, 8];
coeffs[6].w = 1.0f;
return coeffs;
}
}

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


DBufferType0 MERGE_NAME(NAME, 0) = LOAD_TEXTURE2D(MERGE_NAME(TEX, 0), unCoord2); \
DBufferType1 MERGE_NAME(NAME, 1) = LOAD_TEXTURE2D(MERGE_NAME(TEX, 1), unCoord2); \
DBufferType2 MERGE_NAME(NAME, 2) = LOAD_TEXTURE2D(MERGE_NAME(TEX, 2), unCoord2); \
DBufferType3 MERGE_NAME(NAME, 3) = LOAD_TEXTURE2D(MERGE_NAME(TEX, 3), unCoord2);
DBufferType3 MERGE_NAME(NAME, 3) = LOAD_TEXTURE2D(MERGE_NAME(TEX, 3), unCoord2).xy;
#define ENCODE_INTO_DBUFFER(DECAL_SURFACE_DATA, NAME) EncodeIntoDBuffer(DECAL_SURFACE_DATA, MERGE_NAME(NAME,0), MERGE_NAME(NAME,1), MERGE_NAME(NAME,2), MERGE_NAME(NAME,3))
#define DECODE_FROM_DBUFFER(NAME, DECAL_SURFACE_DATA) DecodeFromDBuffer(MERGE_NAME(NAME,0), MERGE_NAME(NAME,1), MERGE_NAME(NAME,2), MERGE_NAME(NAME,3), DECAL_SURFACE_DATA)

1
com.unity.render-pipelines.high-definition/HDRP/Material/Decal/Decal.shader


[ToggleUI] _MaskmapMetal("_MaskmapMetal", Range(0.0, 1.0)) = 0.0
[ToggleUI] _MaskmapAO("_MaskmapAO", Range(0.0, 1.0)) = 0.0
[ToggleUI] _MaskmapSmoothness("_MaskmapSmoothness", Range(0.0, 1.0)) = 1.0
[HideInInspector] _DecalMeshDepthBias("_DecalMeshDepthBias", Float) = 0.0
}
HLSLINCLUDE

31
com.unity.render-pipelines.high-definition/HDRP/Material/Decal/DecalProjectorComponent.cs


public Vector2 m_UVScale = new Vector2(1, 1);
public Vector2 m_UVBias = new Vector2(0, 0);
public bool m_AffectsTransparency = false;
public Vector3 m_Offset = new Vector3(0, -0.5f, 0);
public Vector3 m_Size = new Vector3(1, 1, 1);
private Material m_OldMaterial = null;
private DecalSystem.DecalHandle m_Handle = null;

}
Vector4 uvScaleBias = new Vector4(m_UVScale.x, m_UVScale.y, m_UVBias.x, m_UVBias.y);
m_Handle = DecalSystem.instance.AddDecal(transform, m_DrawDistance, m_FadeScale, uvScaleBias, m_AffectsTransparency, m_Material);
Matrix4x4 sizeOffset = Matrix4x4.Translate(m_Offset) * Matrix4x4.Scale(m_Size);
m_Handle = DecalSystem.instance.AddDecal(transform, sizeOffset, m_DrawDistance, m_FadeScale, uvScaleBias, m_AffectsTransparency, m_Material);
}
public void OnDisable()

if (m_Handle != null)
DecalSystem.instance.RemoveDecal(m_Handle);
Vector4 uvScaleBias = new Vector4(m_UVScale.x, m_UVScale.y, m_UVBias.x, m_UVBias.y);
m_Handle = DecalSystem.instance.AddDecal(transform, m_DrawDistance, m_FadeScale, uvScaleBias, m_AffectsTransparency, m_Material);
Matrix4x4 sizeOffset = Matrix4x4.Translate(m_Offset) * Matrix4x4.Scale(m_Size);
m_Handle = DecalSystem.instance.AddDecal(transform, sizeOffset, m_DrawDistance, m_FadeScale, uvScaleBias, m_AffectsTransparency, m_Material);
m_OldMaterial = m_Material;
// notify the editor that material has changed so it can update the shader foldout

if (transform.hasChanged == true)
{
Vector4 uvScaleBias = new Vector4(m_UVScale.x, m_UVScale.y, m_UVBias.x, m_UVBias.y);
DecalSystem.instance.UpdateCachedData(transform, m_DrawDistance, m_FadeScale, uvScaleBias, m_AffectsTransparency, m_Handle);
Matrix4x4 sizeOffset = Matrix4x4.Translate(m_Offset) * Matrix4x4.Scale(m_Size);
DecalSystem.instance.UpdateCachedData(transform, sizeOffset, m_DrawDistance, m_FadeScale, uvScaleBias, m_AffectsTransparency, m_Handle);
private void DrawGizmo(bool selected)
{
var col = new Color(0.0f, 0.7f, 1f, 1.0f);
Matrix4x4 offset = Matrix4x4.Translate(new Vector3(0.0f, -0.5f, 0.0f));
Gizmos.matrix = transform.localToWorldMatrix * offset;
col.a = selected ? 0.5f : 0.2f;
Gizmos.color = col;
Gizmos.DrawWireCube(Vector3.zero, Vector3.one);
}
DrawGizmo(true);
DecalSystem.instance.UpdateCachedData(transform, m_DrawDistance, m_FadeScale, uvScaleBias, m_AffectsTransparency, m_Handle);
Matrix4x4 sizeOffset = Matrix4x4.Translate(m_Offset) * Matrix4x4.Scale(m_Size);
DecalSystem.instance.UpdateCachedData(transform, sizeOffset, m_DrawDistance, m_FadeScale, uvScaleBias, m_AffectsTransparency, m_Handle);
DrawGizmo(false);
var col = new Color(0.0f, 0.7f, 1f, 0.5f);
Matrix4x4 offsetScale = Matrix4x4.Translate(m_Offset) * Matrix4x4.Scale(m_Size);
Gizmos.matrix = transform.localToWorldMatrix * offsetScale;
Gizmos.color = col;
Gizmos.DrawWireCube(Vector3.zero, Vector3.one);
}
public bool IsValid()

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


float _DecalBlend;
float4 _BaseColor;
float _DecalMeshDepthBias;
#endif

22
com.unity.render-pipelines.high-definition/HDRP/Material/Decal/DecalSystem.cs


private const int kDrawIndexedBatchSize = 250;
// cube mesh bounds for decal
static Vector4 kMin = new Vector4(-0.5f, -1.0f, -0.5f, 1.0f);
static Vector4 kMax = new Vector4(0.5f, 0.0f, 0.5f, 1.0f);
static Vector4 kMin = new Vector4(-0.5f, -0.5f, -0.5f, 1.0f);
static Vector4 kMax = new Vector4(0.5f, 0.5f, 0.5f, 1.0f);
static public Mesh m_DecalMesh = null;

return res;
}
public void UpdateCachedData(Transform transform, float drawDistance, float fadeScale, Vector4 uvScaleBias, bool affectsTransparency, DecalHandle handle)
public void UpdateCachedData(Transform transform, Matrix4x4 sizeOffset, float drawDistance, float fadeScale, Vector4 uvScaleBias, bool affectsTransparency, DecalHandle handle)
m_CachedDecalToWorld[index] = transform.localToWorldMatrix;
m_CachedDecalToWorld[index] = transform.localToWorldMatrix * sizeOffset;
Matrix4x4 decalRotation = Matrix4x4.Rotate(transform.rotation);
// z/y axis swap for normal to decal space, Unity is column major

m_BoundingSpheres[index] = GetDecalProjectBoundingSphere(m_CachedDecalToWorld[index]);
}
public DecalHandle AddDecal(Transform transform, float drawDistance, float fadeScale, Vector4 uvScaleBias, bool affectsTransparency, int materialID)
public DecalHandle AddDecal(Transform transform, Matrix4x4 sizeOffset, float drawDistance, float fadeScale, Vector4 uvScaleBias, bool affectsTransparency, int materialID)
{
// increase array size if no space left
if (m_DecalsCount == m_Handles.Length)

DecalHandle decalHandle = new DecalHandle(m_DecalsCount, materialID);
m_Handles[m_DecalsCount] = decalHandle;
UpdateCachedData(transform, drawDistance, fadeScale, uvScaleBias, affectsTransparency, decalHandle);
UpdateCachedData(transform, sizeOffset, drawDistance, fadeScale, uvScaleBias, affectsTransparency, decalHandle);
m_DecalsCount++;
return decalHandle;
}

var influenceX = decalToWorld.GetColumn(0) * 0.5f;
var influenceY = decalToWorld.GetColumn(1) * 0.5f;
var influenceZ = decalToWorld.GetColumn(2) * 0.5f;
var pos = decalToWorld.GetColumn(3) - influenceY; // decal cube mesh pivot is at 0,0,0, with bottom face at -1 on the y plane
var pos = decalToWorld.GetColumn(3);
Vector3 influenceExtents = new Vector3();
influenceExtents.x = influenceX.magnitude;

TextureScaleBias m_Mask = new TextureScaleBias();
}
public DecalHandle AddDecal(Transform transform, float drawDistance, float fadeScale, Vector4 uvScaleBias, bool affectsTransparency, Material material)
public DecalHandle AddDecal(Transform transform, Matrix4x4 sizeOffset, float drawDistance, float fadeScale, Vector4 uvScaleBias, bool affectsTransparency, Material material)
{
DecalSet decalSet = null;
int key = material != null ? material.GetInstanceID() : kNullMaterialIndex;

m_DecalSets.Add(key, decalSet);
}
return decalSet.AddDecal(transform, drawDistance, fadeScale, uvScaleBias, affectsTransparency, key);
return decalSet.AddDecal(transform, sizeOffset, drawDistance, fadeScale, uvScaleBias, affectsTransparency, key);
}
public void RemoveDecal(DecalHandle handle)

}
}
public void UpdateCachedData(Transform transform, float drawDistance, float fadeScale, Vector4 uvScaleBias, bool affectsTransparency, DecalHandle handle)
public void UpdateCachedData(Transform transform, Matrix4x4 sizeOffset, float drawDistance, float fadeScale, Vector4 uvScaleBias, bool affectsTransparency, DecalHandle handle)
{
if (!DecalHandle.IsValid(handle))
return;

if (m_DecalSets.TryGetValue(key, out decalSet))
{
decalSet.UpdateCachedData(transform, drawDistance, fadeScale, uvScaleBias, affectsTransparency, handle);
decalSet.UpdateCachedData(transform, sizeOffset, drawDistance, fadeScale, uvScaleBias, affectsTransparency, handle);
}
}

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


float4x4 worldToDecal = ApplyCameraTranslationToInverseMatrix(decalData.worldToDecal);
float3 positionDS = mul(worldToDecal, float4(positionRWS, 1.0)).xyz;
positionDS = positionDS * float3(1.0, -1.0, 1.0) + float3(0.5, 0.0f, 0.5); // decal clip space
positionDS = positionDS * float3(1.0, -1.0, 1.0) + float3(0.5, 0.5f, 0.5); // decal clip space
if ((all(positionDS.xyz > 0.0f) && all(1.0f - positionDS.xyz > 0.0f)))
{
float2 uvScale = float2(decalData.normalToWorld[3][0], decalData.normalToWorld[3][1]);

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" {}

23
com.unity.render-pipelines.high-definition/HDRP/Material/Lit/LitDataIndividualLayer.hlsl


detailMask = SAMPLE_UVMAPPING_TEXTURE2D(ADD_IDX(_MaskMap), SAMPLER_MASKMAP_IDX, ADD_IDX(layerTexCoord.base)).b;
#endif
float2 detailAlbedoAndSmoothness = SAMPLE_UVMAPPING_TEXTURE2D(ADD_IDX(_DetailMap), SAMPLER_DETAILMAP_IDX, ADD_IDX(layerTexCoord.details)).rb;
float detailAlbedo = detailAlbedoAndSmoothness.r;
float detailSmoothness = detailAlbedoAndSmoothness.g;
float detailAlbedo = detailAlbedoAndSmoothness.r * 2.0 - 1.0;
float detailSmoothness = detailAlbedoAndSmoothness.g * 2.0 - 1.0;
// Resample the detail map but this time for the normal map. This call should be optimize by the compiler
// We split both call due to trilinear mapping
detailNormalTS = SAMPLE_UVMAPPING_NORMALMAP_AG(ADD_IDX(_DetailMap), SAMPLER_DETAILMAP_IDX, ADD_IDX(layerTexCoord.details), ADD_IDX(_DetailNormalScale));

#ifdef _DETAIL_MAP_IDX
// Use overlay blend mode for detail abledo: (base < 0.5 ? (2.0 * base * blend) : (1.0 - 2.0 * (1.0 - base) * (1.0 - blend)))
float3 baseColorOverlay = (detailAlbedo < 0.5) ?
surfaceData.baseColor * PositivePow(2.0 * detailAlbedo, ADD_IDX(_DetailAlbedoScale)) :
1.0 - (1.0 - surfaceData.baseColor) * PositivePow(2.0 * (1.0 - detailAlbedo), ADD_IDX(_DetailAlbedoScale));
// Goal: we want the detail albedo map to be able to darken down to black and brighten up to white the surface albedo.
// The scale control the speed of the gradient. We simply remap detailAlbedo from [0..1] to [-1..1] then perform a lerp to black or white
// with a factor based on speed.
// For base color we interpolate in sRGB space (approximate here as square) as it get a nicer perceptual gradient
float albedoDetailSpeed = saturate(abs(detailAlbedo) * ADD_IDX(_DetailAlbedoScale));
float3 baseColorOverlay = lerp(sqrt(surfaceData.baseColor), (detailAlbedo < 0.0) ? float3(0.0, 0.0, 0.0) : float3(1.0, 1.0, 1.0), albedoDetailSpeed * albedoDetailSpeed);
baseColorOverlay *= baseColorOverlay;
// Lerp with details mask
surfaceData.baseColor = lerp(surfaceData.baseColor, saturate(baseColorOverlay), detailMask);
#endif

#endif
#ifdef _DETAIL_MAP_IDX
// Use overlay blend mode for detail abledo: (base < 0.5 ? (2.0 * base * blend) : (1.0 - 2.0 * (1.0 - base) * (1.0 - blend)))
float smoothnessOverlay = (detailSmoothness < 0.5) ?
surfaceData.perceptualSmoothness * PositivePow(2.0 * detailSmoothness, ADD_IDX(_DetailSmoothnessScale)) :
1.0 - (1.0 - surfaceData.perceptualSmoothness) * PositivePow(2.0 * (1.0 - detailSmoothness), ADD_IDX(_DetailSmoothnessScale));
// See comment for baseColorOverlay
float smoothnessDetailSpeed = saturate(abs(detailSmoothness) * ADD_IDX(_DetailSmoothnessScale));
float smoothnessOverlay = lerp(surfaceData.perceptualSmoothness, (detailSmoothness < 0.0) ? 0.0 : 1.0, smoothnessDetailSpeed);
// Lerp with details mask
surfaceData.perceptualSmoothness = lerp(surfaceData.perceptualSmoothness, saturate(smoothnessOverlay), detailMask);
#endif

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/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

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;
}
}
}
}

3
com.unity.render-pipelines.high-definition/HDRP/RenderPipeline/HDStringConstants.cs


public static readonly int _DeferredShadowTexture = Shader.PropertyToID("_DeferredShadowTexture");
public static readonly int _DeferredShadowTextureUAV = Shader.PropertyToID("_DeferredShadowTextureUAV");
public static readonly int _DirectionalShadowIndex = Shader.PropertyToID("_DirectionalShadowIndex");
public static readonly int _DirectionalContactShadowParams = Shader.PropertyToID("_ScreenSpaceShadowsParameters");
public static readonly int _ContactShadowParamsParameters = Shader.PropertyToID("_ContactShadowParamsParameters");
public static readonly int _ContactShadowParamsParameters2 = Shader.PropertyToID("_ContactShadowParamsParameters2");
public static readonly int _DirectionalContactShadowSampleCount = Shader.PropertyToID("_SampleCount");
public static readonly int _DirectionalLightDirection = Shader.PropertyToID("_DirectionalLightDirection");
public static readonly int _PunctualLightPosition = Shader.PropertyToID("_PunctualLightPosition");

64
com.unity.render-pipelines.high-definition/HDRP/RenderPipeline/SceneViewDrawMode.cs


#if UNITY_EDITOR
using System.Collections;
using UnityEditor;
using UnityEditor.Experimental.Rendering;
public class SceneViewDrawMode
namespace UnityEngine.Experimental.Rendering.HDPipeline
static private bool RejectDrawMode(SceneView.CameraMode cameraMode)
public class SceneViewDrawMode
if (cameraMode.drawMode == DrawCameraMode.TexturedWire ||
cameraMode.drawMode == DrawCameraMode.ShadowCascades ||
cameraMode.drawMode == DrawCameraMode.RenderPaths ||
cameraMode.drawMode == DrawCameraMode.AlphaChannel ||
cameraMode.drawMode == DrawCameraMode.Overdraw ||
cameraMode.drawMode == DrawCameraMode.Mipmaps ||
cameraMode.drawMode == DrawCameraMode.DeferredDiffuse ||
cameraMode.drawMode == DrawCameraMode.DeferredSpecular ||
cameraMode.drawMode == DrawCameraMode.DeferredSmoothness ||
cameraMode.drawMode == DrawCameraMode.DeferredNormal ||
cameraMode.drawMode == DrawCameraMode.ValidateAlbedo ||
cameraMode.drawMode == DrawCameraMode.ValidateMetalSpecular ||
cameraMode.drawMode == DrawCameraMode.LightOverlap
)
return false;
static private bool RejectDrawMode(SceneView.CameraMode cameraMode)
{
if (cameraMode.drawMode == DrawCameraMode.TexturedWire ||
cameraMode.drawMode == DrawCameraMode.ShadowCascades ||
cameraMode.drawMode == DrawCameraMode.RenderPaths ||
cameraMode.drawMode == DrawCameraMode.AlphaChannel ||
cameraMode.drawMode == DrawCameraMode.Overdraw ||
cameraMode.drawMode == DrawCameraMode.Mipmaps ||
cameraMode.drawMode == DrawCameraMode.DeferredDiffuse ||
cameraMode.drawMode == DrawCameraMode.DeferredSpecular ||
cameraMode.drawMode == DrawCameraMode.DeferredSmoothness ||
cameraMode.drawMode == DrawCameraMode.DeferredNormal ||
cameraMode.drawMode == DrawCameraMode.ValidateAlbedo ||
cameraMode.drawMode == DrawCameraMode.ValidateMetalSpecular ||
cameraMode.drawMode == DrawCameraMode.LightOverlap
)
return false;
return true;
}
return true;
}
static public void SetupDrawMode()
{
ArrayList sceneViewArray = SceneView.sceneViews;
foreach (SceneView sceneView in sceneViewArray)
sceneView.onValidateCameraMode += RejectDrawMode;
}
static public void SetupDrawMode()
{
ArrayList sceneViewArray = SceneView.sceneViews;
foreach (SceneView sceneView in sceneViewArray)
sceneView.onValidateCameraMode += RejectDrawMode;
}
static public void ResetDrawMode()
{
ArrayList sceneViewArray = SceneView.sceneViews;
foreach (SceneView sceneView in sceneViewArray)
sceneView.onValidateCameraMode -= RejectDrawMode;
static public void ResetDrawMode()
{
ArrayList sceneViewArray = SceneView.sceneViews;
foreach (SceneView sceneView in sceneViewArray)
sceneView.onValidateCameraMode -= RejectDrawMode;
}
}
}
#endif

3
com.unity.render-pipelines.high-definition/HDRP/RenderPipeline/Texture2DAtlas.cs


using System;
using System.Collections.Generic;
using UnityEngine.Rendering;
using UnityEngine.Experimental.Rendering.HDPipeline;
#if UNITY_EDITOR

namespace UnityEngine.Experimental.Rendering
namespace UnityEngine.Experimental.Rendering.HDPipeline
{
public class AtlasAllocator
{

14
com.unity.render-pipelines.high-definition/HDRP/ShaderPass/ShaderPassDBuffer.hlsl


#include "VertMesh.hlsl"
void MeshDecalsPositionZBias(inout VaryingsToPS input)
{
#if defined(UNITY_REVERSED_Z)
input.vmesh.positionCS.z -= _DecalMeshDepthBias * input.vmesh.positionCS.w;
#else
input.vmesh.positionCS.z += _DecalMeshDepthBias * input.vmesh.positionCS.w;
#endif
}
#if (SHADERPASS == SHADERPASS_DBUFFER_MESH)
MeshDecalsPositionZBias(varyingsType);
#endif
return PackVaryingsType(varyingsType);
}

PositionInputs posInput = GetPositionInput(input.positionSS.xy, _ScreenSize.zw, depth, UNITY_MATRIX_I_VP, UNITY_MATRIX_V);
// Transform from relative world space to decal space (DS) to clip the decal
float3 positionDS = TransformWorldToObject(posInput.positionWS);
positionDS = positionDS * float3(1.0, -1.0, 1.0) + float3(0.5, 0.0f, 0.5);
positionDS = positionDS * float3(1.0, -1.0, 1.0) + float3(0.5, 0.5f, 0.5);
clip(positionDS); // clip negative value
clip(1.0 - positionDS); // Clip value above one

1
com.unity.render-pipelines.high-definition/HDRP/Shadows/ContactShadows.cs


// Contact shadows
public BoolParameter enable = new BoolParameter(false);
public ClampedFloatParameter length = new ClampedFloatParameter(0.15f, 0.0f, 1.0f);
public ClampedFloatParameter opacity = new ClampedFloatParameter(1.0f, 0.0f, 1.0f);
public ClampedFloatParameter distanceScaleFactor = new ClampedFloatParameter(0.5f, 0.0f, 1.0f);
public MinFloatParameter maxDistance = new MinFloatParameter(50.0f, 0.0f);
public MinFloatParameter fadeDistance = new MinFloatParameter(5.0f, 0.0f);

1001
TestProjects/HDRP_Tests/Assets/GraphicTests/Common/Textures/Detail_Test_Gradient.png
文件差异内容过多而无法显示
查看文件

132
TestProjects/HDRP_Tests/Assets/GraphicTests/Common/Textures/Detail_Test_Gradient.png.meta


fileFormatVersion: 2
guid: 74fd1ac9c43580348bed6f76951d7628
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 7
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 0
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: -1
wrapV: -1
wrapW: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 2
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: iPhone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: Windows Store Apps
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: Nintendo Switch
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
vertices: []
indices:
edges: []
weights: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:
正在加载...
取消
保存