浏览代码

Merge branch 'master' into LuxIntensityForHDRISky And moved HDRI multiplier to the editor

/main
Antoine Lelievre 6 年前
当前提交
6b451d7a
共有 21 个文件被更改,包括 1430 次插入2054 次删除
  1. 177
      TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9005_Decals-stress-test.unity
  2. 999
      TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/1401_StackLit.png
  3. 999
      TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/9005_Decals-stress-test.png
  4. 999
      TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/9201_Camera-relative-rendering.png
  5. 1
      com.unity.render-pipelines.high-definition/CHANGELOG.md
  6. 3
      com.unity.render-pipelines.high-definition/HDRP/Camera/HDAdditionalCameraData.cs
  7. 52
      com.unity.render-pipelines.high-definition/HDRP/Camera/HDCamera.cs
  8. 5
      com.unity.render-pipelines.high-definition/HDRP/Editor/Camera/HDCameraUI.cs
  9. 2
      com.unity.render-pipelines.high-definition/HDRP/Editor/Camera/SerializedHDCamera.cs
  10. 69
      com.unity.render-pipelines.high-definition/HDRP/Editor/Sky/HDRISky/HDRISkyEditor.cs
  11. 5
      com.unity.render-pipelines.high-definition/HDRP/Editor/Sky/ProceduralSky/ProceduralSkyEditor.cs
  12. 35
      com.unity.render-pipelines.high-definition/HDRP/Editor/Sky/SkySettingsEditor.cs
  13. 2
      com.unity.render-pipelines.high-definition/HDRP/Lighting/LightLoop/LightLoop.cs
  14. 48
      com.unity.render-pipelines.high-definition/HDRP/RenderPipeline/HDRenderPipeline.cs
  15. 21
      com.unity.render-pipelines.high-definition/HDRP/Sky/HDRISky/HDRISkyRenderer.cs
  16. 19
      com.unity.render-pipelines.high-definition/HDRP/Sky/HDRISky/IntegrateHDRISky.shader
  17. 25
      com.unity.render-pipelines.high-definition/HDRP/Sky/ProceduralSky/ProceduralSkyRenderer.cs
  18. 6
      com.unity.render-pipelines.high-definition/HDRP/Sky/SkyManager.cs
  19. 2
      com.unity.render-pipelines.high-definition/HDRP/Sky/SkyRenderer.cs
  20. 5
      com.unity.render-pipelines.high-definition/HDRP/Sky/SkyRenderingContext.cs
  21. 10
      com.unity.render-pipelines.high-definition/HDRP/Sky/SkySettings.cs

177
TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9005_Decals-stress-test.unity


m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0.07875386, g: 0.07704143, b: 0.066761576, a: 1}
m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:

m_UVScale: {x: 1, y: 1}
m_UVBias: {x: 0, y: 0}
m_AffectsTransparency: 0
m_Offset: {x: 0, y: -0.5, z: 0}
m_Size: {x: 1, y: 1, z: 1}
--- !u!1 &74334710
GameObject:
m_ObjectHideFlags: 0

m_UVScale: {x: 1, y: 1}
m_UVBias: {x: 0, y: 0}
m_AffectsTransparency: 0
m_Offset: {x: 0, y: -0.5, z: 0}
m_Size: {x: 1, y: 1, z: 1}
--- !u!1 &127561052
GameObject:
m_ObjectHideFlags: 0

m_UVScale: {x: 1, y: 1}
m_UVBias: {x: 0, y: 0}
m_AffectsTransparency: 0
m_Offset: {x: 0, y: -0.5, z: 0}
m_Size: {x: 1, y: 1, z: 1}
--- !u!1 &173526623
GameObject:
m_ObjectHideFlags: 0

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

m_UVScale: {x: 1, y: 1}
m_UVBias: {x: 0, y: 0}
m_AffectsTransparency: 0
m_Offset: {x: 0, y: -0.5, z: 0}
m_Size: {x: 1, y: 1, z: 1}
--- !u!1 &225041350
GameObject:
m_ObjectHideFlags: 0

m_UVScale: {x: 1, y: 1}
m_UVBias: {x: 0, y: 0}
m_AffectsTransparency: 0
m_Offset: {x: 0, y: -0.5, z: 0}
m_Size: {x: 1, y: 1, z: 1}
--- !u!1 &243692027
GameObject:
m_ObjectHideFlags: 0

m_UVScale: {x: 1, y: 1}
m_UVBias: {x: 0, y: 0}
m_AffectsTransparency: 0
m_Offset: {x: 0, y: -0.5, z: 0}
m_Size: {x: 1, y: 1, z: 1}
--- !u!1 &250966354
GameObject:
m_ObjectHideFlags: 0

m_UVScale: {x: 1, y: 1}
m_UVBias: {x: 0, y: 0}
m_AffectsTransparency: 0
m_Offset: {x: 0, y: -0.5, z: 0}
m_Size: {x: 1, y: 1, z: 1}
--- !u!1 &260575850
GameObject:
m_ObjectHideFlags: 0

m_UVScale: {x: 1, y: 1}
m_UVBias: {x: 0, y: 0}
m_AffectsTransparency: 0
m_Offset: {x: 0, y: -0.5, z: 0}
m_Size: {x: 1, y: 1, z: 1}
--- !u!1 &286314541
GameObject:
m_ObjectHideFlags: 0

m_UVScale: {x: 1, y: 1}
m_UVBias: {x: 0, y: 0}
m_AffectsTransparency: 0
m_Offset: {x: 0, y: -0.5, z: 0}
m_Size: {x: 1, y: 1, z: 1}
--- !u!1 &294464788
GameObject:
m_ObjectHideFlags: 0

m_UVScale: {x: 0.16, y: 1}
m_UVBias: {x: 0, y: 0}
m_AffectsTransparency: 0
m_Offset: {x: 0, y: -0.5, z: 0}
m_Size: {x: 1, y: 1, z: 1}
--- !u!1 &332810623
GameObject:
m_ObjectHideFlags: 0

m_UVScale: {x: 1, y: 1}
m_UVBias: {x: 0, y: 0}
m_AffectsTransparency: 0
m_Offset: {x: 0, y: -0.5, z: 0}
m_Size: {x: 1, y: 1, z: 1}
--- !u!1 &338930937
GameObject:
m_ObjectHideFlags: 0

m_UVScale: {x: 1, y: 1}
m_UVBias: {x: 0, y: 0}
m_AffectsTransparency: 0
m_Offset: {x: 0, y: -0.5, z: 0}
m_Size: {x: 1, y: 1, z: 1}
--- !u!1 &341993383
GameObject:
m_ObjectHideFlags: 0

m_UVScale: {x: 0.16, y: 1}
m_UVBias: {x: 0, y: 0}
m_AffectsTransparency: 0
m_Offset: {x: 0, y: -0.5, z: 0}
m_Size: {x: 1, y: 1, z: 1}
--- !u!1 &369311313
GameObject:
m_ObjectHideFlags: 0

m_UVScale: {x: 1, y: 1}
m_UVBias: {x: 0, y: 0}
m_AffectsTransparency: 0
m_Offset: {x: 0, y: -0.5, z: 0}
m_Size: {x: 1, y: 1, z: 1}
--- !u!1 &374113650
GameObject:
m_ObjectHideFlags: 0

m_UVScale: {x: 1, y: 1}
m_UVBias: {x: 0, y: 0}
m_AffectsTransparency: 0
m_Offset: {x: 0, y: -0.5, z: 0}
m_Size: {x: 1, y: 1, z: 1}
--- !u!1 &399218098
GameObject:
m_ObjectHideFlags: 0

m_UVScale: {x: 1, y: 1}
m_UVBias: {x: 0, y: 0}
m_AffectsTransparency: 0
m_Offset: {x: 0, y: -0.5, z: 0}
m_Size: {x: 1, y: 1, z: 1}
--- !u!1 &404697366
GameObject:
m_ObjectHideFlags: 0

m_UVScale: {x: 1, y: 1}
m_UVBias: {x: 0, y: 0}
m_AffectsTransparency: 0
m_Offset: {x: 0, y: -0.5, z: 0}
m_Size: {x: 1, y: 1, z: 1}
--- !u!1 &414065951
GameObject:
m_ObjectHideFlags: 0

m_UVScale: {x: 1, y: 1}
m_UVBias: {x: 0, y: 0}
m_AffectsTransparency: 0
m_Offset: {x: 0, y: -0.5, z: 0}
m_Size: {x: 1, y: 1, z: 1}
--- !u!1 &435068001
GameObject:
m_ObjectHideFlags: 0

m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 4294967295
m_RendererPriority: 0
m_Materials:
- {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0}
m_StaticBatchInfo:

m_UVScale: {x: 1, y: 1}
m_UVBias: {x: 0, y: 0}
m_AffectsTransparency: 0
m_Offset: {x: 0, y: -0.5, z: 0}
m_Size: {x: 1, y: 1, z: 1}
--- !u!1 &466355172
GameObject:
m_ObjectHideFlags: 0

m_UVScale: {x: 1, y: 1}
m_UVBias: {x: 0, y: 0}
m_AffectsTransparency: 0
m_Offset: {x: 0, y: -0.5, z: 0}
m_Size: {x: 1, y: 1, z: 1}
--- !u!1 &521922984
GameObject:
m_ObjectHideFlags: 0

m_UVScale: {x: 1, y: 1}
m_UVBias: {x: 0, y: 0}
m_AffectsTransparency: 0
m_Offset: {x: 0, y: -0.5, z: 0}
m_Size: {x: 1, y: 1, z: 1}
--- !u!1 &541365535
GameObject:
m_ObjectHideFlags: 0

m_UVScale: {x: 1, y: 1}
m_UVBias: {x: 0, y: 0}
m_AffectsTransparency: 0
m_Offset: {x: 0, y: -0.5, z: 0}
m_Size: {x: 1, y: 1, z: 1}
--- !u!1 &558484125
GameObject:
m_ObjectHideFlags: 0

m_UVScale: {x: 1, y: 1}
m_UVBias: {x: 0, y: 0}
m_AffectsTransparency: 0
m_Offset: {x: 0, y: -0.5, z: 0}
m_Size: {x: 1, y: 1, z: 1}
--- !u!1 &576360073
GameObject:
m_ObjectHideFlags: 0

m_UVScale: {x: 1, y: 1}
m_UVBias: {x: 0, y: 0}
m_AffectsTransparency: 0
m_Offset: {x: 0, y: -0.5, z: 0}
m_Size: {x: 1, y: 1, z: 1}
--- !u!1 &578980835
GameObject:
m_ObjectHideFlags: 0

m_UVScale: {x: 1, y: 1}
m_UVBias: {x: 0, y: 0}
m_AffectsTransparency: 0
m_Offset: {x: 0, y: -0.5, z: 0}
m_Size: {x: 1, y: 1, z: 1}
--- !u!1 &650886796
GameObject:
m_ObjectHideFlags: 0

m_UVScale: {x: 0.16, y: 1}
m_UVBias: {x: 0, y: 0}
m_AffectsTransparency: 0
m_Offset: {x: 0, y: -0.5, z: 0}
m_Size: {x: 1, y: 1, z: 1}
--- !u!1 &673193209
GameObject:
m_ObjectHideFlags: 0

m_UVScale: {x: 0.5, y: 0.5}
m_UVBias: {x: 0, y: 0}
m_AffectsTransparency: 0
m_Offset: {x: 0, y: -0.5, z: 0}
m_Size: {x: 1, y: 1, z: 1}
--- !u!1 &691491257
GameObject:
m_ObjectHideFlags: 0

m_UVScale: {x: 0.16, y: 1}
m_UVBias: {x: 0, y: 0}
m_AffectsTransparency: 0
m_Offset: {x: 0, y: -0.5, z: 0}
m_Size: {x: 1, y: 1, z: 1}
--- !u!1 &723869257
GameObject:
m_ObjectHideFlags: 0

m_UVScale: {x: 1, y: 1}
m_UVBias: {x: 0, y: 0}
m_AffectsTransparency: 0
m_Offset: {x: 0, y: -0.5, z: 0}
m_Size: {x: 1, y: 1, z: 1}
--- !u!1 &730821749
GameObject:
m_ObjectHideFlags: 0

m_UVScale: {x: 1, y: 1}
m_UVBias: {x: 0, y: 0}
m_AffectsTransparency: 0
m_Offset: {x: 0, y: -0.5, z: 0}
m_Size: {x: 1, y: 1, z: 1}
--- !u!1 &748390694
GameObject:
m_ObjectHideFlags: 0

m_UVScale: {x: 1, y: 1}
m_UVBias: {x: 35.9, y: 2.32}
m_AffectsTransparency: 0
m_Offset: {x: 0, y: -0.5, z: 0}
m_Size: {x: 1, y: 1, z: 1}
--- !u!1 &774909013
GameObject:
m_ObjectHideFlags: 0

m_UVScale: {x: 1, y: 1}
m_UVBias: {x: 0, y: 0}
m_AffectsTransparency: 0
m_Offset: {x: 0, y: -0.5, z: 0}
m_Size: {x: 1, y: 1, z: 1}
--- !u!1 &780717197
GameObject:
m_ObjectHideFlags: 0

m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 4294967295
m_RendererPriority: 0
m_Materials:
- {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0}
m_StaticBatchInfo:

m_UVScale: {x: 1, y: 1}
m_UVBias: {x: 0, y: 0}
m_AffectsTransparency: 0
m_Offset: {x: 0, y: -0.5, z: 0}
m_Size: {x: 1, y: 1, z: 1}
--- !u!1 &792889985
GameObject:
m_ObjectHideFlags: 0

m_UVScale: {x: 1, y: 1}
m_UVBias: {x: 0, y: 0}
m_AffectsTransparency: 0
m_Offset: {x: 0, y: -0.5, z: 0}
m_Size: {x: 1, y: 1, z: 1}
--- !u!1 &800528687
GameObject:
m_ObjectHideFlags: 0

m_UVScale: {x: 1, y: 1}
m_UVBias: {x: 0, y: 0}
m_AffectsTransparency: 0
m_Offset: {x: 0, y: -0.5, z: 0}
m_Size: {x: 1, y: 1, z: 1}
--- !u!1 &853628977
GameObject:
m_ObjectHideFlags: 0

m_UVScale: {x: 0.16, y: 1}
m_UVBias: {x: 0, y: 0}
m_AffectsTransparency: 0
m_Offset: {x: 0, y: -0.5, z: 0}
m_Size: {x: 1, y: 1, z: 1}
--- !u!1 &858039326
GameObject:
m_ObjectHideFlags: 0

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

m_UVScale: {x: 1, y: 1}
m_UVBias: {x: 0, y: 0}
m_AffectsTransparency: 0
m_Offset: {x: 0, y: -0.5, z: 0}
m_Size: {x: 1, y: 1, z: 1}
--- !u!1 &916940777
GameObject:
m_ObjectHideFlags: 0

m_UVScale: {x: 0.16, y: 1}
m_UVBias: {x: 0, y: 0}
m_AffectsTransparency: 0
m_Offset: {x: 0, y: -0.5, z: 0}
m_Size: {x: 1, y: 1, z: 1}
--- !u!1 &928243931
GameObject:
m_ObjectHideFlags: 0

m_UVScale: {x: 1, y: 1}
m_UVBias: {x: 0, y: 0}
m_AffectsTransparency: 0
m_Offset: {x: 0, y: -0.5, z: 0}
m_Size: {x: 1, y: 1, z: 1}
--- !u!1 &970943824
GameObject:
m_ObjectHideFlags: 0

m_UVScale: {x: 1, y: 1}
m_UVBias: {x: 0, y: 0}
m_AffectsTransparency: 0
m_Offset: {x: 0, y: -0.5, z: 0}
m_Size: {x: 1, y: 1, z: 1}
--- !u!1 &993425094
GameObject:
m_ObjectHideFlags: 0

m_UVScale: {x: 1, y: 1}
m_UVBias: {x: 0, y: 0}
m_AffectsTransparency: 0
m_Offset: {x: 0, y: -0.5, z: 0}
m_Size: {x: 1, y: 1, z: 1}
--- !u!1 &1005978163
GameObject:
m_ObjectHideFlags: 0

m_UVScale: {x: 1, y: 1}
m_UVBias: {x: 0, y: 0}
m_AffectsTransparency: 0
m_Offset: {x: 0, y: -0.5, z: 0}
m_Size: {x: 1, y: 1, z: 1}
--- !u!1 &1046408022
GameObject:
m_ObjectHideFlags: 0

m_UVScale: {x: 1, y: 1}
m_UVBias: {x: 0, y: 0}
m_AffectsTransparency: 0
m_Offset: {x: 0, y: -0.5, z: 0}
m_Size: {x: 1, y: 1, z: 1}
--- !u!1 &1095346273
GameObject:
m_ObjectHideFlags: 0

m_UVScale: {x: 0.16, y: 1}
m_UVBias: {x: 0, y: 0}
m_AffectsTransparency: 0
m_Offset: {x: 0, y: -0.5, z: 0}
m_Size: {x: 1, y: 1, z: 1}
--- !u!1 &1112771833
GameObject:
m_ObjectHideFlags: 0

m_UVScale: {x: 1, y: 1}
m_UVBias: {x: 0, y: 0}
m_AffectsTransparency: 0
m_Offset: {x: 0, y: -0.5, z: 0}
m_Size: {x: 1, y: 1, z: 1}
--- !u!1 &1125739647
GameObject:
m_ObjectHideFlags: 0

serializedVersion: 3
m_Convex: 0
m_CookingOptions: 14
m_SkinWidth: 0.01
m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &1125739649
MeshRenderer:

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

propertyPath: m_LocalEulerAnglesHint.x
value: 90
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}
propertyPath: far clip plane
value: 80
objectReference: {fileID: 0}

m_UVScale: {x: 0.16, y: 1}
m_UVBias: {x: 0, y: 0}
m_AffectsTransparency: 0
m_Offset: {x: 0, y: -0.5, z: 0}
m_Size: {x: 1, y: 1, z: 1}
--- !u!1 &1254724135
GameObject:
m_ObjectHideFlags: 0

m_UVScale: {x: 1, y: 1}
m_UVBias: {x: 0, y: 0}
m_AffectsTransparency: 0
m_Offset: {x: 0, y: -0.5, z: 0}
m_Size: {x: 1, y: 1, z: 1}
--- !u!1 &1278989599
GameObject:
m_ObjectHideFlags: 0

m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 4294967295
m_RendererPriority: 0
m_Materials:
- {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0}
m_StaticBatchInfo:

m_UVScale: {x: 1, y: 1}
m_UVBias: {x: 0, y: 0}
m_AffectsTransparency: 0
m_Offset: {x: 0, y: -0.5, z: 0}
m_Size: {x: 1, y: 1, z: 1}
--- !u!1 &1330830820
GameObject:
m_ObjectHideFlags: 0

m_UVScale: {x: 1, y: 1}
m_UVBias: {x: 0, y: 0}
m_AffectsTransparency: 0
m_Offset: {x: 0, y: -0.5, z: 0}
m_Size: {x: 1, y: 1, z: 1}
--- !u!1 &1359134011
GameObject:
m_ObjectHideFlags: 0

m_UVScale: {x: 1, y: 1}
m_UVBias: {x: 0, y: 0}
m_AffectsTransparency: 0
m_Offset: {x: 0, y: -0.5, z: 0}
m_Size: {x: 1, y: 1, z: 1}
--- !u!1 &1385914845
GameObject:
m_ObjectHideFlags: 0

m_UVScale: {x: 1, y: 1}
m_UVBias: {x: 0, y: 0}
m_AffectsTransparency: 0
m_Offset: {x: 0, y: -0.5, z: 0}
m_Size: {x: 1, y: 1, z: 1}
--- !u!1 &1388927182
GameObject:
m_ObjectHideFlags: 0

m_UVScale: {x: 1, y: 1}
m_UVBias: {x: 0, y: 0}
m_AffectsTransparency: 0
m_Offset: {x: 0, y: -0.5, z: 0}
m_Size: {x: 1, y: 1, z: 1}
--- !u!1 &1401264637
GameObject:
m_ObjectHideFlags: 0

m_UVScale: {x: 1, y: 1}
m_UVBias: {x: 0, y: 0}
m_AffectsTransparency: 0
m_Offset: {x: 0, y: -0.5, z: 0}
m_Size: {x: 1, y: 1, z: 1}
--- !u!1 &1417088810
GameObject:
m_ObjectHideFlags: 0

m_UVScale: {x: 1, y: 1}
m_UVBias: {x: 0, y: 0}
m_AffectsTransparency: 0
m_Offset: {x: 0, y: -0.5, z: 0}
m_Size: {x: 1, y: 1, z: 1}
--- !u!1 &1428726872
GameObject:
m_ObjectHideFlags: 0

m_UVScale: {x: 1, y: 1}
m_UVBias: {x: 0, y: 0}
m_AffectsTransparency: 0
m_Offset: {x: 0, y: -0.5, z: 0}
m_Size: {x: 1, y: 1, z: 1}
--- !u!1 &1430823196
GameObject:
m_ObjectHideFlags: 0

m_UVScale: {x: 1, y: 1}
m_UVBias: {x: 0, y: 0}
m_AffectsTransparency: 0
m_Offset: {x: 0, y: -0.5, z: 0}
m_Size: {x: 1, y: 1, z: 1}
--- !u!1 &1434343681
GameObject:
m_ObjectHideFlags: 0

m_UVScale: {x: 1, y: 1}
m_UVBias: {x: 0, y: 0}
m_AffectsTransparency: 0
m_Offset: {x: 0, y: -0.5, z: 0}
m_Size: {x: 1, y: 1, z: 1}
--- !u!1 &1461738263
GameObject:
m_ObjectHideFlags: 0

m_UVScale: {x: 1, y: 1}
m_UVBias: {x: 0, y: 0}
m_AffectsTransparency: 0
m_Offset: {x: 0, y: -0.5, z: 0}
m_Size: {x: 1, y: 1, z: 1}
--- !u!1 &1498584143
GameObject:
m_ObjectHideFlags: 0

m_UVScale: {x: 0.16, y: 1}
m_UVBias: {x: 0, y: 0}
m_AffectsTransparency: 0
m_Offset: {x: 0, y: -0.5, z: 0}
m_Size: {x: 1, y: 1, z: 1}
--- !u!1 &1563933641
GameObject:
m_ObjectHideFlags: 0

m_UVScale: {x: 1, y: 1}
m_UVBias: {x: 0, y: 0}
m_AffectsTransparency: 0
m_Offset: {x: 0, y: -0.5, z: 0}
m_Size: {x: 1, y: 1, z: 1}
--- !u!1 &1599307487
GameObject:
m_ObjectHideFlags: 0

m_UVScale: {x: 1, y: 1}
m_UVBias: {x: 0, y: 0}
m_AffectsTransparency: 0
m_Offset: {x: 0, y: -0.5, z: 0}
m_Size: {x: 1, y: 1, z: 1}
--- !u!1 &1599862839
GameObject:
m_ObjectHideFlags: 0

m_UVScale: {x: 1, y: 1}
m_UVBias: {x: 0, y: 0}
m_AffectsTransparency: 0
m_Offset: {x: 0, y: -0.5, z: 0}
m_Size: {x: 1, y: 1, z: 1}
--- !u!1 &1691808983
GameObject:
m_ObjectHideFlags: 0

m_UVScale: {x: 1, y: 1}
m_UVBias: {x: 0, y: 0}
m_AffectsTransparency: 0
m_Offset: {x: 0, y: -0.5, z: 0}
m_Size: {x: 1, y: 1, z: 1}
--- !u!1 &1697367095
GameObject:
m_ObjectHideFlags: 0

m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 4294967295
m_RendererPriority: 0
m_Materials:
- {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0}
m_StaticBatchInfo:

m_UVScale: {x: 1, y: 1}
m_UVBias: {x: 0, y: 0}
m_AffectsTransparency: 0
m_Offset: {x: 0, y: -0.5, z: 0}
m_Size: {x: 1, y: 1, z: 1}
--- !u!1 &1761218374
GameObject:
m_ObjectHideFlags: 0

m_Name:
m_EditorClassIdentifier:
m_Profile: {fileID: 11400000, guid: 4f498417c99f5004da63865a022cb07d, type: 2}
m_BakingSkyUniqueID: 2
m_BakingSkyUniqueID: 1
--- !u!114 &1761218376
MonoBehaviour:
m_ObjectHideFlags: 0

m_Script: {fileID: 11500000, guid: c6c2871f720b2af4e9210febdac74517, type: 3}
m_Name:
m_EditorClassIdentifier:
version: 1
m_Version: 1
shadowResolution: 512
shadowDimmer: 1
shadowFadeDistance: 10000

m_Script: {fileID: 11500000, guid: 7a68c43fe1f2a47cfa234b5eeaa98012, type: 3}
m_Name:
m_EditorClassIdentifier:
version: 1.1
version: 2
m_Version: 2
directionalIntensity: 3.1415927
punctualIntensity: 600
areaIntensity: 200

showAdditionalSettings: 0
displayLightIntensity: 3.1415927
displayAreaLightEmissiveMesh: 0
lightLayers: 1
--- !u!1 &1827502608
GameObject:
m_ObjectHideFlags: 0

m_UVScale: {x: 1, y: 1}
m_UVBias: {x: 0, y: 0}
m_AffectsTransparency: 0
m_Offset: {x: 0, y: -0.5, z: 0}
m_Size: {x: 1, y: 1, z: 1}
--- !u!1 &1878558920
GameObject:
m_ObjectHideFlags: 0

m_UVScale: {x: 1, y: 1}
m_UVBias: {x: 0, y: 0}
m_AffectsTransparency: 0
m_Offset: {x: 0, y: -0.5, z: 0}
m_Size: {x: 1, y: 1, z: 1}
--- !u!1 &1946326916
GameObject:
m_ObjectHideFlags: 0

m_UVScale: {x: 1, y: 1}
m_UVBias: {x: 0, y: 0}
m_AffectsTransparency: 0
m_Offset: {x: 0, y: -0.5, z: 0}
m_Size: {x: 1, y: 1, z: 1}
--- !u!1 &2003187185
GameObject:
m_ObjectHideFlags: 0

m_UVScale: {x: 1, y: 1}
m_UVBias: {x: 0, y: 0}
m_AffectsTransparency: 0
m_Offset: {x: 0, y: -0.5, z: 0}
m_Size: {x: 1, y: 1, z: 1}
--- !u!1 &2045259974
GameObject:
m_ObjectHideFlags: 0

m_UVScale: {x: 1, y: 1}
m_UVBias: {x: 0, y: 0}
m_AffectsTransparency: 0
m_Offset: {x: 0, y: -0.5, z: 0}
m_Size: {x: 1, y: 1, z: 1}
--- !u!1 &2058823762
GameObject:
m_ObjectHideFlags: 0

m_UVScale: {x: 0.16, y: 1}
m_UVBias: {x: 0, y: 0}
m_AffectsTransparency: 0
m_Offset: {x: 0, y: -0.5, z: 0}
m_Size: {x: 1, y: 1, z: 1}
--- !u!1 &2101771495
GameObject:
m_ObjectHideFlags: 0

m_UVScale: {x: 1, y: 1}
m_UVBias: {x: 0, y: 0}
m_AffectsTransparency: 0
m_Offset: {x: 0, y: -0.5, z: 0}
m_Size: {x: 1, y: 1, z: 1}
--- !u!1 &2109464410
GameObject:
m_ObjectHideFlags: 0

m_UVScale: {x: 0.16, y: 1}
m_UVBias: {x: 0, y: 0}
m_AffectsTransparency: 0
m_Offset: {x: 0, y: -0.5, z: 0}
m_Size: {x: 1, y: 1, z: 1}
--- !u!1 &2114125598
GameObject:
m_ObjectHideFlags: 0

m_UVScale: {x: 1, y: 1}
m_UVBias: {x: 0, y: 0}
m_AffectsTransparency: 0
m_Offset: {x: 0, y: -0.5, z: 0}
m_Size: {x: 1, y: 1, z: 1}
--- !u!1 &2121937319
GameObject:
m_ObjectHideFlags: 0

m_UVScale: {x: 0.16, y: 1}
m_UVBias: {x: 0, y: 0}
m_AffectsTransparency: 0
m_Offset: {x: 0, y: -0.5, z: 0}
m_Size: {x: 1, y: 1, z: 1}
--- !u!1 &2125202485
GameObject:
m_ObjectHideFlags: 0

m_UVScale: {x: 1, y: 1}
m_UVBias: {x: 0, y: 0}
m_AffectsTransparency: 0
m_Offset: {x: 0, y: -0.5, z: 0}
m_Size: {x: 1, y: 1, z: 1}

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

999
TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/9005_Decals-stress-test.png
文件差异内容过多而无法显示
查看文件

999
TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/9201_Camera-relative-rendering.png
文件差异内容过多而无法显示
查看文件

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


- Decal material now supports draw order for decal projectors
- Added LightLayers support (Base on mask from renderers name RenderingLayers and mask from light name LightLayers - if they match, the light apply) - cost an extra GBuffer in deferred (more bandwidth)
- When LightLayers is enabled, the AmbientOclusion is store in the GBuffer in deferred path allowing to avoid double occlusion with SSAO. In forward the double occlusion is now always avoided.
- Added the possibility to add an override transform on the camera for volume interpolation
### Fixed
- Fixed an issue with PreIntegratedFGD texture being sometimes destroyed and not regenerated causing rendering to break

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


public RenderingPath renderingPath = RenderingPath.Default;
[Tooltip("Layer Mask used for the volume interpolation for this camera.")]
public LayerMask volumeLayerMask = -1;
[Tooltip("Transform used for the volume interpolation for this camera.")]
public Transform volumeAnchorOverride;
// Physical parameters
public float aperture = 8f;

data.clearDepth = clearDepth;
data.renderingPath = renderingPath;
data.volumeLayerMask = volumeLayerMask;
data.volumeAnchorOverride = volumeAnchorOverride;
data.aperture = aperture;
data.shutterSpeed = shutterSpeed;
data.iso = iso;

52
com.unity.render-pipelines.high-definition/HDRP/Camera/HDCamera.cs


public Vector4 unity_OrthoParams;
public Vector4 projectionParams;
public Vector4 screenParams;
public int volumeLayerMask;
public Transform volumeAnchor;
public VolumetricLightingSystem.VBufferParameters[] vBufferParams; // Double-buffered

{
vlSys.UpdatePerCameraData(this);
}
UpdateVolumeParameters();
}
void UpdateVolumeParameters()
{
volumeAnchor = null;
volumeLayerMask = -1;
if (m_AdditionalCameraData != null)
{
volumeLayerMask = m_AdditionalCameraData.volumeLayerMask;
volumeAnchor = m_AdditionalCameraData.volumeAnchorOverride;
}
else
{
// Temporary hack:
// For scene view, by default, we use the "main" camera volume layer mask if it exists
// Otherwise we just remove the lighting override layers in the current sky to avoid conflicts
// This is arbitrary and should be editable in the scene view somehow.
if (camera.cameraType == CameraType.SceneView)
{
var mainCamera = Camera.main;
bool needFallback = true;
if (mainCamera != null)
{
var mainCamAdditionalData = mainCamera.GetComponent<HDAdditionalCameraData>();
if (mainCamAdditionalData != null)
{
volumeLayerMask = mainCamAdditionalData.volumeLayerMask;
volumeAnchor = mainCamAdditionalData.volumeAnchorOverride;
needFallback = false;
}
}
if (needFallback)
{
HDRenderPipeline hdPipeline = RenderPipelineManager.currentPipeline as HDRenderPipeline;
// If the override layer is "Everything", we fall-back to "Everything" for the current layer mask to avoid issues by having no current layer
// In practice we should never have "Everything" as an override mask as it does not make sense (a warning is issued in the UI)
if (hdPipeline.asset.renderPipelineSettings.lightLoopSettings.skyLightingOverrideLayerMask == -1)
volumeLayerMask = -1;
else
volumeLayerMask = (-1 & ~hdPipeline.asset.renderPipelineSettings.lightLoopSettings.skyLightingOverrideLayerMask);
}
}
}
// If no override is provided, use the camera transform.
if (volumeAnchor == null)
volumeAnchor = camera.transform;
}
// Stopgap method used to extract stereo combined matrix state.

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


CED.Action(Drawer_FieldClearDepth),
CED.Action(Drawer_FieldCullingMask),
CED.Action(Drawer_FieldVolumeLayerMask),
CED.Action(Drawer_FieldVolumeAnchorOverride),
CED.space,
CED.Action(Drawer_Projection),
CED.Action(Drawer_FieldClippingPlanes),

static void Drawer_FieldVolumeLayerMask(HDCameraUI s, SerializedHDCamera p, Editor owner)
{
EditorGUILayout.PropertyField(p.volumeLayerMask, _.GetContent("Volume Layer Mask"));
}
static void Drawer_FieldVolumeAnchorOverride(HDCameraUI s, SerializedHDCamera p, Editor owner)
{
EditorGUILayout.PropertyField(p.volumeAnchorOverride, _.GetContent("Volume Anchor Override"));
}
static void Drawer_FieldCullingMask(HDCameraUI s, SerializedHDCamera p, Editor owner)

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


public SerializedProperty renderingPath;
public SerializedProperty clearDepth;
public SerializedProperty volumeLayerMask;
public SerializedProperty volumeAnchorOverride;
public SerializedFrameSettings frameSettings;

renderingPath = serializedAdditionalDataObject.Find((HDAdditionalCameraData d) => d.renderingPath);
clearDepth = serializedAdditionalDataObject.Find((HDAdditionalCameraData d) => d.clearDepth);
volumeLayerMask = serializedAdditionalDataObject.Find((HDAdditionalCameraData d) => d.volumeLayerMask);
volumeAnchorOverride = serializedAdditionalDataObject.Find((HDAdditionalCameraData d) => d.volumeAnchorOverride);
frameSettings = new SerializedFrameSettings(serializedAdditionalDataObject.FindProperty("m_FrameSettings"));
}

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


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

: SkySettingsEditor
{
SerializedDataParameter m_hdriSky;
SerializedDataParameter m_Lux;
SerializedDataParameter m_DesiredLuxValue;
SerializedDataParameter m_UpperHemisphereLuxValue;
RTHandleSystem.RTHandle m_IntensityTexture;
Material m_IntegrateHDRISkyMaterial; // Compute the HDRI sky intensity in lux for the skybox
Texture2D readBackTexture;
// HDRI sky does not have control over sun display.
m_CommonUIElementsMask = 0xFFFFFFFF & ~(uint)(SkySettingsUIElement.IncludeSunInBaking);
m_Lux = Unpack(o.Find(x => x.lux));
m_DesiredLuxValue = Unpack(o.Find(x => x.desiredLuxValue));
m_UpperHemisphereLuxValue = Unpack(o.Find(x => x.upperHemisphereLuxValue));
m_IntensityTexture = RTHandles.Alloc(1, 1, colorFormat: RenderTextureFormat.ARGBFloat, sRGB: false);
var hdrp = GraphicsSettings.renderPipelineAsset as HDRenderPipelineAsset;
m_IntegrateHDRISkyMaterial = CoreUtils.CreateEngineMaterial(hdrp.renderPipelineResources.integrateHdriSky);
readBackTexture = new Texture2D(1, 1, TextureFormat.RGBAFloat, false, false);
}
public override void OnDisable()
{
if (m_IntensityTexture != null)
RTHandles.Release(m_IntensityTexture);
readBackTexture = null;
}
public void GetUpperHemisphereLuxValue()
{
Cubemap hdri = m_hdriSky.value.objectReferenceValue as Cubemap;
// GPU texture readback
HDRISky sky = target as HDRISky;
float omegaP = (Mathf.PI * 4) / (6.0f * hdri.width * hdri.width);
m_IntegrateHDRISkyMaterial.SetTexture(HDShaderIDs._Cubemap, hdri);
m_IntegrateHDRISkyMaterial.SetFloat(HDShaderIDs._InvOmegaP, 1.0f / omegaP);
Graphics.Blit(Texture2D.whiteTexture, m_IntensityTexture.rt, m_IntegrateHDRISkyMaterial);
RenderTexture.active = m_IntensityTexture.rt;
readBackTexture.ReadPixels(new Rect(0.0f, 0.0f, 1, 1), 0, 0);
RenderTexture.active = null;
Color hdriIntensity = readBackTexture.GetPixel(0, 0);
m_UpperHemisphereLuxValue.value.floatValue = hdriIntensity.r;
EditorGUI.BeginChangeCheck();
if (EditorGUI.EndChangeCheck())
{
GetUpperHemisphereLuxValue();
}
EditorGUILayout.Space();

{
// Hide EV and Multiplier fields
m_ShowProperties.value.intValue &= ~(int)SkySettingsPropertyFlags.ShowMultiplierAndEV;
PropertyField(m_Lux);
EditorGUI.indentLevel++;
PropertyField(m_DesiredLuxValue);
// Hide exposure and multiplier
m_CommonUIElementsMask &= ~(uint)(SkySettingsUIElement.Exposure | SkySettingsUIElement.Multiplier);
m_CommonUIElementsMask |= (uint)SkySettingsUIElement.IndentExposureAndMultiplier;
// Show the multiplier as read-only
EditorGUI.BeginDisabledGroup(true);
PropertyField(m_UpperHemisphereLuxValue);
EditorGUI.EndDisabledGroup();
EditorGUI.indentLevel--;
m_ShowProperties.value.intValue |= (int)SkySettingsPropertyFlags.ShowMultiplierAndEV;
m_CommonUIElementsMask |= (uint)(SkySettingsUIElement.Exposure | SkySettingsUIElement.Multiplier);
}
base.CommonSkySettingsGUI();

5
com.unity.render-pipelines.high-definition/HDRP/Editor/Sky/ProceduralSky/ProceduralSkyEditor.cs


{
base.OnEnable();
// Procedural sky orientation depends on the sun direction
m_CommonUIElementsMask = 0xFFFFFFFF & ~(uint)(SkySettingsUIElement.Rotation);
var o = new PropertyFetcher<ProceduralSky>(serializedObject);
m_SunSize = Unpack(o.Find(x => x.sunSize));

PropertyField(m_GroundColor);
EditorGUILayout.Space();
m_ShowProperties.value.intValue &= ~(int)SkySettingsPropertyFlags.ShowRotation;
base.CommonSkySettingsGUI();
}

35
com.unity.render-pipelines.high-definition/HDRP/Editor/Sky/SkySettingsEditor.cs


{
public abstract class SkySettingsEditor : VolumeComponentEditor
{
[System.Flags]
protected enum SkySettingsUIElement
{
Exposure = 1 << 0,
Multiplier = 1 << 1,
Rotation = 1 << 2,
UpdateMode = 1 << 3,
IncludeSunInBaking = 1 << 4,
IndentExposureAndMultiplier = 1 << 5,
}
protected SerializedDataParameter m_ShowProperties;
SerializedDataParameter m_IncludeSunInBaking;
protected uint m_CommonUIElementsMask = 0xFFFFFFFF;
m_ShowProperties = Unpack(o.Find(x => x.showProperties));
m_IncludeSunInBaking = Unpack(o.Find(x => x.includeSunInBaking));
if ((m_ShowProperties.value.intValue & (int)SkySettingsPropertyFlags.ShowMultiplierAndEV) != 0)
{
if ((m_CommonUIElementsMask & (uint)SkySettingsUIElement.IndentExposureAndMultiplier) != 0)
EditorGUI.indentLevel++;
if ((m_CommonUIElementsMask & (uint)SkySettingsUIElement.Exposure) != 0)
if ((m_CommonUIElementsMask & (uint)SkySettingsUIElement.Multiplier) != 0)
}
if ((m_ShowProperties.value.intValue & (int)SkySettingsPropertyFlags.ShowRotation) != 0)
if ((m_CommonUIElementsMask & (uint)SkySettingsUIElement.IndentExposureAndMultiplier) != 0)
EditorGUI.indentLevel--;
if ((m_CommonUIElementsMask & (uint)SkySettingsUIElement.Rotation) != 0)
if ((m_ShowProperties.value.intValue & (int)SkySettingsPropertyFlags.ShowUpdateMode) != 0)
if ((m_CommonUIElementsMask & (uint)SkySettingsUIElement.UpdateMode) != 0)
{
PropertyField(m_EnvUpdateMode);
if (!m_EnvUpdateMode.value.hasMultipleDifferentValues && m_EnvUpdateMode.value.intValue == (int)EnvironementUpdateMode.Realtime)

EditorGUI.indentLevel--;
}
}
if ((m_CommonUIElementsMask & (uint)SkySettingsUIElement.IncludeSunInBaking) != 0)
PropertyField(m_IncludeSunInBaking);
}
}
}

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


var sinSpotOuterHalfAngle = Mathf.Sqrt(1.0f - cosSpotOuterHalfAngle * cosSpotOuterHalfAngle);
var cosSpotInnerHalfAngle = Mathf.Clamp(Mathf.Cos(spotAngle * 0.5f * innerConePercent * Mathf.Deg2Rad), 0.0f, 1.0f); // inner cone
var val = Mathf.Max(0.001f, (cosSpotInnerHalfAngle - cosSpotOuterHalfAngle));
var val = Mathf.Max(0.0001f, (cosSpotInnerHalfAngle - cosSpotOuterHalfAngle));
lightData.angleScale = 1.0f / val;
lightData.angleOffset = -cosSpotOuterHalfAngle * lightData.angleScale;

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


{
CoreUtils.SetKeyword(cmd, "LIGHT_LAYERS", enableLightLayers);
cmd.SetGlobalInt(HDShaderIDs._EnableLightLayers, enableLightLayers ? 1 : 0);
}
}
public void ConfigureForDecal(CommandBuffer cmd)
{

m_CurrentDebugDisplaySettings = m_DebugDisplaySettings;
}
using (new ProfilingSample(cmd, "Volume Update", CustomSamplerId.VolumeUpdate.GetSampler()))
{
LayerMask layerMask = -1;
if (additionalCameraData != null)
{
layerMask = additionalCameraData.volumeLayerMask;
}
else
{
// Temporary hack:
// For scene view, by default, we use the "main" camera volume layer mask if it exists
// Otherwise we just remove the lighting override layers in the current sky to avoid conflicts
// This is arbitrary and should be editable in the scene view somehow.
if (camera.cameraType == CameraType.SceneView)
{
var mainCamera = Camera.main;
bool needFallback = true;
if (mainCamera != null)
{
var mainCamAdditionalData = mainCamera.GetComponent<HDAdditionalCameraData>();
if (mainCamAdditionalData != null)
{
layerMask = mainCamAdditionalData.volumeLayerMask;
needFallback = false;
}
}
if (needFallback)
{
// If the override layer is "Everything", we fall-back to "Everything" for the current layer mask to avoid issues by having no current layer
// In practice we should never have "Everything" as an override mask as it does not make sense (a warning is issued in the UI)
if (m_Asset.renderPipelineSettings.lightLoopSettings.skyLightingOverrideLayerMask == -1)
layerMask = -1;
else
layerMask = (-1 & ~m_Asset.renderPipelineSettings.lightLoopSettings.skyLightingOverrideLayerMask);
}
}
}
VolumeManager.instance.Update(camera.transform, layerMask);
}
var postProcessLayer = camera.GetComponent<PostProcessLayer>();
// Disable post process if we enable debug mode or if the post process layer is disabled

// From this point, we should only use frame settings from the camera
hdCamera.Update(currentFrameSettings, postProcessLayer, m_VolumetricLightingSystem);
using (new ProfilingSample(cmd, "Volume Update", CustomSamplerId.VolumeUpdate.GetSampler()))
{
VolumeManager.instance.Update(hdCamera.volumeAnchor, hdCamera.volumeLayerMask);
}
Resize(hdCamera);

21
com.unity.render-pipelines.high-definition/HDRP/Sky/HDRISky/HDRISkyRenderer.cs


public class HDRISkyRenderer : SkyRenderer
{
Material m_SkyHDRIMaterial; // Renders a cubemap into a render texture (can be cube or 2D)
Material m_IntegrateHDRISkyMaterial; // Compute the HDRI sky intensity in lux for the skybox
RTHandleSystem.RTHandle m_IntensityTexture;
m_IntensityTexture = RTHandles.Alloc(1, 1, colorFormat: RenderTextureFormat.RFloat, sRGB: false);
}
public override void Build()

m_IntegrateHDRISkyMaterial = CoreUtils.CreateEngineMaterial(hdrp.renderPipelineResources.integrateHdriSky);
}
public override void Cleanup()

using (new ProfilingSample(builtinParams.commandBuffer, "Get hdri skybox intensity"))
{
// if (m_HdriSkyParams.updateHDRISkyIntensity)
{
float omegaP = (Mathf.PI * 4) / (6.0f * m_HdriSkyParams.hdriSky.value.width * m_HdriSkyParams.hdriSky.value.width);
m_IntegrateHDRISkyMaterial.SetTexture(HDShaderIDs._Cubemap, m_HdriSkyParams.hdriSky);
m_IntegrateHDRISkyMaterial.SetFloat(HDShaderIDs._InvOmegaP, 1.0f / omegaP);
CoreUtils.SetRenderTarget(builtinParams.commandBuffer, m_IntensityTexture, ClearFlag.None);
CoreUtils.DrawFullScreen(builtinParams.commandBuffer, m_IntegrateHDRISkyMaterial);
m_HdriSkyParams.updateHDRISkyIntensity.value = false;
}
public override void RenderSky(BuiltinSkyParameters builtinParams, bool renderForCubemap)
public override void RenderSky(BuiltinSkyParameters builtinParams, bool renderForCubemap, bool renderSunDisk)
{
float lux = (m_HdriSkyParams.skyIntensityMode == SkyIntensityMode.Lux) ? m_HdriSkyParams.lux.value : 1;
float multiplier = (m_HdriSkyParams.skyIntensityMode == SkyIntensityMode.Exposure) ? m_HdriSkyParams.multiplier.value : 1;

using (new ProfilingSample(builtinParams.commandBuffer, "Draw sky"))
{
// Bind a white texture if the intensity mode isn't lux so we sample an intensity of 1
if (m_HdriSkyParams.skyIntensityMode == SkyIntensityMode.Lux)
m_SkyHDRIMaterial.SetTexture(HDShaderIDs._SkyIntensity, m_IntensityTexture);
else
// if (m_HdriSkyParams.skyIntensityMode == SkyIntensityMode.Lux)
// m_SkyHDRIMaterial.SetTexture(HDShaderIDs._SkyIntensity, m_IntensityTexture);
// else
m_SkyHDRIMaterial.SetTexture(HDShaderIDs._SkyIntensity, Texture2D.whiteTexture);
// This matrix needs to be updated at the draw call frequency.

19
com.unity.render-pipelines.high-definition/HDRP/Sky/HDRISky/IntegrateHDRISky.shader


}
real IntegrateHDRISky(TEXTURECUBE_ARGS(skybox, sampler_skybox), real3 N, uint sampleCount = 4096)
real GetUpperHemisphereLuxValue(TEXTURECUBE_ARGS(skybox, sampler_skybox), real3 N, uint sampleCount = 16384)
float sum = 0.0;
float dphi = 0.002;
float dtheta = 0.002;
for (float phi = 0; phi < 2.0 * PI; phi += dphi)
{
for (float theta = 0; theta < PI / 2.0; theta += dtheta)
{
float3 L = TransformGLtoDX(SphericalToCartesian(phi, cos(theta)));
real val = Luminance(SAMPLE_TEXTURECUBE_LOD(skybox, sampler_skybox, L, 0).rgb);
sum += cos(theta) * sin(theta) * val;
}
}
sum *= dphi * dtheta;
return sum;
real acc = 0.0;
// Add some jittering on Hammersley2d

{
float3 N = float3(0.0, 1.0, 0.0);
float intensity = IntegrateHDRISky(TEXTURECUBE_PARAM(_Cubemap, s_trilinear_clamp_sampler), N);
float intensity = GetUpperHemisphereLuxValue(TEXTURECUBE_PARAM(_Cubemap, s_trilinear_clamp_sampler), N);
return float4(intensity, 1.0, 1.0, 1.0);
}

25
com.unity.render-pipelines.high-definition/HDRP/Sky/ProceduralSky/ProceduralSkyRenderer.cs


}
}
public override void RenderSky(BuiltinSkyParameters builtinParams, bool renderForCubemap)
public override void RenderSky(BuiltinSkyParameters builtinParams, bool renderForCubemap, bool renderSunDisk)
// Default values when no sun is provided
float sunSize = 0.0f;
sunSize = m_ProceduralSkyParams.sunSize;
m_ProceduralSkyMaterial.SetVector(HDShaderIDs._SkyParam, new Vector4(GetExposure(m_ProceduralSkyParams, builtinParams.debugSettings), m_ProceduralSkyParams.multiplier, 0.0f, 0.0f));
m_ProceduralSkyMaterial.SetFloat(_SunSizeParam, m_ProceduralSkyParams.sunSize);
m_ProceduralSkyMaterial.SetFloat(_SunSizeConvergenceParam, m_ProceduralSkyParams.sunSizeConvergence);
m_ProceduralSkyMaterial.SetFloat(_AtmoshpereThicknessParam, m_ProceduralSkyParams.atmosphereThickness);
m_ProceduralSkyMaterial.SetColor(_SkyTintParam, m_ProceduralSkyParams.skyTint);
m_ProceduralSkyMaterial.SetColor(_GroundColorParam, m_ProceduralSkyParams.groundColor);
m_ProceduralSkyMaterial.SetColor(_SunColorParam, sunColor);
m_ProceduralSkyMaterial.SetVector(_SunDirectionParam, sunDirection);
if (!renderSunDisk)
sunSize = 0.0f;
// This matrix needs to be updated at the draw call frequency.
m_PropertyBlock.SetVector(HDShaderIDs._SkyParam, new Vector4(GetExposure(m_ProceduralSkyParams, builtinParams.debugSettings), m_ProceduralSkyParams.multiplier, 0.0f, 0.0f));
m_PropertyBlock.SetFloat(_SunSizeParam, sunSize);
m_PropertyBlock.SetFloat(_SunSizeConvergenceParam, m_ProceduralSkyParams.sunSizeConvergence);
m_PropertyBlock.SetFloat(_AtmoshpereThicknessParam, m_ProceduralSkyParams.atmosphereThickness);
m_PropertyBlock.SetColor(_SkyTintParam, m_ProceduralSkyParams.skyTint);
m_PropertyBlock.SetColor(_GroundColorParam, m_ProceduralSkyParams.groundColor);
m_PropertyBlock.SetColor(_SunColorParam, sunColor);
m_PropertyBlock.SetVector(_SunDirectionParam, sunDirection);
m_PropertyBlock.SetMatrix(HDShaderIDs._PixelCoordToViewDirWS, builtinParams.pixelCoordToViewDirMatrix);
CoreUtils.DrawFullScreen(builtinParams.commandBuffer, m_ProceduralSkyMaterial, m_PropertyBlock, renderForCubemap ? 0 : 1);

6
com.unity.render-pipelines.high-definition/HDRP/Sky/SkyManager.cs


m_BakingSky.skySettings = SkyManager.GetBakingSkySettings();
// Update needs to happen before testing if the component is active other internal data structure are not properly updated yet.
VolumeManager.instance.Update(m_LightingOverrideVolumeStack, hdCamera.camera.transform, m_LightingOverrideLayerMask);
VolumeManager.instance.Update(m_LightingOverrideVolumeStack, hdCamera.volumeAnchor, m_LightingOverrideLayerMask);
if (VolumeManager.instance.IsComponentActiveInMask<VisualEnvironment>(m_LightingOverrideLayerMask))
{
SkySettings newSkyOverride = GetSkySetting(m_LightingOverrideVolumeStack);

m_NeedUpdateRealtimeEnv = false;
}
// For the baking sky, we don't want to take the sun into account because we usually won't include it (this would cause double highlight in the reflection for example).
// So we pass null so that's it doesn't affect the hash and the rendering.
m_NeedUpdateBakingSky = m_BakingSkyRenderingContext.UpdateEnvironment(m_BakingSky, camera, null, m_UpdateRequired, cmd);
m_NeedUpdateBakingSky = m_BakingSkyRenderingContext.UpdateEnvironment(m_BakingSky, camera, sunLight, m_UpdateRequired, cmd);
SkyUpdateContext currentSky = m_LightingOverrideSky.IsValid() ? m_LightingOverrideSky : m_VisualSky;
m_NeedUpdateRealtimeEnv = m_SkyRenderingContext.UpdateEnvironment(currentSky, camera, sunLight, m_UpdateRequired, cmd);

2
com.unity.render-pipelines.high-definition/HDRP/Sky/SkyRenderer.cs


public abstract void Cleanup();
public abstract void SetRenderTargets(BuiltinSkyParameters builtinParams);
// renderForCubemap: When rendering into a cube map, no depth buffer is available so user has to make sure not to use depth testing or the depth texture.
public abstract void RenderSky(BuiltinSkyParameters builtinParams, bool renderForCubemap);
public abstract void RenderSky(BuiltinSkyParameters builtinParams, bool renderForCubemap, bool renderSunDisk);
public abstract bool IsValid();
public virtual void UpdateSky(BuiltinSkyParameters builtinParams) {}

5
com.unity.render-pipelines.high-definition/HDRP/Sky/SkyRenderingContext.cs


skyContext.renderer.UpdateSky(m_BuiltinParameters);
CoreUtils.SetRenderTarget(m_BuiltinParameters.commandBuffer, m_SkyboxCubemapRT, ClearFlag.None, 0, (CubemapFace)i);
skyContext.renderer.RenderSky(m_BuiltinParameters, true);
skyContext.renderer.RenderSky(m_BuiltinParameters, true, skyContext.skySettings.includeSunInBaking);
}
// Generate mipmap for our cubemap

skyContext.renderer.UpdateSky(m_BuiltinParameters);
skyContext.renderer.SetRenderTargets(m_BuiltinParameters);
skyContext.renderer.RenderSky(m_BuiltinParameters, false);
// When rendering the visual sky for reflection probes, we need to remove the sun disk if skySettings.includeSunInBaking is false.
skyContext.renderer.RenderSky(m_BuiltinParameters, false, hdCamera.camera.cameraType != CameraType.Reflection || skyContext.skySettings.includeSunInBaking);
}
}
}

10
com.unity.render-pipelines.high-definition/HDRP/Sky/SkySettings.cs


public FloatParameter exposure = new FloatParameter(0.0f);
[Tooltip("Intensity multiplier for the sky.")]
public MinFloatParameter multiplier = new MinFloatParameter(1.0f, 0.0f);
[Tooltip("Auto multiplier from the HDRI sky")]
public MinFloatParameter upperHemisphereLuxValue = new MinFloatParameter(1.0f, 0.0f);
public FloatParameter lux = new FloatParameter(20000);
public FloatParameter desiredLuxValue = new FloatParameter(20000);
// Display all fields by default
public IntParameter showProperties = new IntParameter(~0);
[HideInInspector]
[Tooltip("If set to true, the sun disk will be used in baked lighting (ambient and reflection probes).")]
public BoolParameter includeSunInBaking = new BoolParameter(false);
// Unused for now. In the future we might want to expose this option for very high range skies.
bool m_useMIS = false;

//<<<
hash = hash * 23 + updatePeriod.GetHashCode();
hash = hash * 23 + includeSunInBaking.GetHashCode();
return hash;
}
}

正在加载...
取消
保存