浏览代码

Implemented base of "Atmospheric Scattering" framework.

- AtmosphericScatteringXXX files where definition/editor and shader code of the fog functions are and that are used by any shader where fog is needed (full pass opaque fog, transparent forward materials...)
- Implemented basic linear/exponential fog with Uncharted 4 "Mip Sky" color fetch trick.
/stochastic_alpha_test
Julien Ignace 7 年前
当前提交
6f585179
共有 32 个文件被更改,包括 2018 次插入98 次删除
  1. 740
      SampleScenes/HDTest/SkyFogTest.unity
  2. 15
      SampleScenes/HDTest/SkyFogTest/SkyFogHDRISky.asset
  3. 21
      SampleScenes/HDTest/SkyFogTest/SkyFogProceduralSky.asset
  4. 1
      ScriptableRenderPipeline/HDRenderPipeline/Editor/HDAssetFactory.cs
  5. 1
      ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipeline.cs
  6. 1
      ScriptableRenderPipeline/HDRenderPipeline/HDStringConstants.cs
  7. 2
      ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/TilePass.cs
  8. 1
      ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/TilePass.hlsl
  9. 2
      ScriptableRenderPipeline/HDRenderPipeline/RenderPipelineResources/HDRenderPipelineResources.asset
  10. 1
      ScriptableRenderPipeline/HDRenderPipeline/RenderPipelineResources/RenderPipelineResources.cs
  11. 2
      ScriptableRenderPipeline/HDRenderPipeline/Sky/BlacksmithlSky/Resources/SkyBlacksmith.shader
  12. 9
      ScriptableRenderPipeline/HDRenderPipeline/Sky/Editor/SkySettingsEditor.cs
  13. 21
      ScriptableRenderPipeline/HDRenderPipeline/Sky/SkyManager.cs
  14. 2
      ScriptableRenderPipeline/HDRenderPipeline/Sky/SkySettings.cs
  15. 891
      SampleScenes/HDTest/SkyFogTest/Pyramid.prefab
  16. 10
      SampleScenes/HDTest/SkyFogTest/Pyramid.prefab.meta
  17. 10
      ScriptableRenderPipeline/HDRenderPipeline/Sky/AtmosphericScattering.meta
  18. 53
      ScriptableRenderPipeline/HDRenderPipeline/Sky/OpaqueAtmosphericScattering.shader
  19. 10
      ScriptableRenderPipeline/HDRenderPipeline/Sky/OpaqueAtmosphericScattering.shader.meta
  20. 77
      ScriptableRenderPipeline/HDRenderPipeline/Sky/AtmosphericScattering/AtmosphericScattering.cs
  21. 21
      ScriptableRenderPipeline/HDRenderPipeline/Sky/AtmosphericScattering/AtmosphericScattering.cs.hlsl
  22. 10
      ScriptableRenderPipeline/HDRenderPipeline/Sky/AtmosphericScattering/AtmosphericScattering.cs.hlsl.meta
  23. 13
      ScriptableRenderPipeline/HDRenderPipeline/Sky/AtmosphericScattering/AtmosphericScattering.cs.meta
  24. 71
      ScriptableRenderPipeline/HDRenderPipeline/Sky/AtmosphericScattering/AtmosphericScattering.hlsl
  25. 10
      ScriptableRenderPipeline/HDRenderPipeline/Sky/AtmosphericScattering/AtmosphericScattering.hlsl.meta
  26. 10
      ScriptableRenderPipeline/HDRenderPipeline/Sky/AtmosphericScattering/Editor.meta
  27. 98
      ScriptableRenderPipeline/HDRenderPipeline/Sky/AtmosphericScattering/Editor/AtmosphericScatteringEditor.cs
  28. 13
      ScriptableRenderPipeline/HDRenderPipeline/Sky/AtmosphericScattering/Editor/AtmosphericScatteringEditor.cs.meta
  29. 0
      /ScriptableRenderPipeline/HDRenderPipeline/Sky/BlacksmithlSky/Resources/AtmosphericScattering_blacksmith.hlsl
  30. 0
      /ScriptableRenderPipeline/HDRenderPipeline/Sky/BlacksmithlSky/Resources/AtmosphericScattering_blacksmith.hlsl.meta

740
SampleScenes/HDTest/SkyFogTest.unity


m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0.18392481, g: 0.22375022, b: 0.3024745, a: 1}
m_IndirectSpecularColor: {r: 0.25314978, g: 0.28629857, b: 0.31537795, a: 1}
--- !u!157 &3
LightmapSettings:
m_ObjectHideFlags: 0

m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 60359362}
m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261}
m_LocalPosition: {x: 0, y: 3, z: 0}
m_LocalRotation: {x: -0.0983268, y: -0.9575796, z: 0.23520999, w: -0.13434815}
m_LocalPosition: {x: 0, y: 53.3, z: 0}
m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
m_LocalEulerAnglesHint: {x: 28.482002, y: -193.89299, z: 8.183001}
--- !u!114 &60359365
MonoBehaviour:
m_ObjectHideFlags: 2

useOldInspector: 0
featuresFoldout: 1
showAdditionalSettings: 1
--- !u!1 &142686423
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 142686427}
- component: {fileID: 142686426}
- component: {fileID: 142686425}
- component: {fileID: 142686424}
m_Layer: 0
m_Name: Sphere
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!23 &142686424
MeshRenderer:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 142686423}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_Materials:
- {fileID: 2100000, guid: 948836267934e104294e03adad5c7bf7, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!135 &142686425
SphereCollider:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 142686423}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Radius: 0.5
m_Center: {x: 0, y: 0, z: 0}
--- !u!33 &142686426
MeshFilter:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 142686423}
m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0}
--- !u!4 &142686427
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 142686423}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 1.336, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &185241297
GameObject:
m_ObjectHideFlags: 0

m_Father: {fileID: 0}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &596119525
Prefab:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalPosition.x
value: -33.3
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalPosition.z
value: 149.4
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_RootOrder
value: 5
objectReference: {fileID: 0}
- target: {fileID: 1826863781589606, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_Name
value: Pyramid (1)
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalScale.x
value: 1.5
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalScale.y
value: 1.5
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalScale.z
value: 1.5
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
m_IsPrefabParent: 0
--- !u!1001 &608570509
Prefab:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalPosition.x
value: 30.644007
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalPosition.z
value: -88.271454
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalRotation.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalRotation.y
value: 0.79473543
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalRotation.w
value: 0.606956
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_RootOrder
value: 13
objectReference: {fileID: 0}
- target: {fileID: 1826863781589606, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_Name
value: Pyramid (9)
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalScale.x
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalScale.y
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalScale.z
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalEulerAnglesHint.y
value: 105.261
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
m_IsPrefabParent: 0
--- !u!1001 &760906947
Prefab:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalPosition.x
value: 11.696484
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalPosition.z
value: -31.376503
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalRotation.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalRotation.y
value: 0.6076712
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalRotation.w
value: 0.79418874
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_RootOrder
value: 10
objectReference: {fileID: 0}
- target: {fileID: 1826863781589606, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_Name
value: Pyramid (6)
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalScale.x
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalScale.y
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalScale.z
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalEulerAnglesHint.y
value: 74.843
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
m_IsPrefabParent: 0
--- !u!1001 &905430902
Prefab:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalPosition.x
value: 14.3
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalPosition.z
value: 106.6
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_RootOrder
value: 6
objectReference: {fileID: 0}
- target: {fileID: 1826863781589606, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_Name
value: Pyramid (2)
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalScale.x
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalScale.y
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalScale.z
value: 0.5
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
m_IsPrefabParent: 0
--- !u!1001 &963430273
Prefab:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalPosition.x
value: 43.088997
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalPosition.z
value: -26.788668
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalRotation.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalRotation.y
value: 0.6076712
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalRotation.w
value: 0.79418874
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_RootOrder
value: 9
objectReference: {fileID: 0}
- target: {fileID: 1826863781589606, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_Name
value: Pyramid (5)
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalScale.x
value: 1.1470399
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalScale.y
value: 1.14704
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalScale.z
value: 1.14704
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalEulerAnglesHint.y
value: 74.843
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
m_IsPrefabParent: 0
--- !u!1001 &986401225
Prefab:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalPosition.x
value: 48.62
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalPosition.z
value: 53.1
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_RootOrder
value: 8
objectReference: {fileID: 0}
- target: {fileID: 1826863781589606, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_Name
value: Pyramid (4)
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalScale.x
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalScale.y
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalScale.z
value: 0.5
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
m_IsPrefabParent: 0
--- !u!1001 &1032135070
Prefab:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalPosition.x
value: -69.2
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalPosition.z
value: 112.5
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_RootOrder
value: 4
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
m_IsPrefabParent: 0
--- !u!1 &1208684576
GameObject:
m_ObjectHideFlags: 0

m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &1274375938
Prefab:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalPosition.x
value: 91.29087
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalPosition.z
value: -69.243286
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalRotation.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalRotation.y
value: 0.79473543
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalRotation.w
value: 0.606956
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_RootOrder
value: 14
objectReference: {fileID: 0}
- target: {fileID: 1826863781589606, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_Name
value: Pyramid (10)
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalScale.x
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalScale.y
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalScale.z
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalEulerAnglesHint.y
value: 105.261
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
m_IsPrefabParent: 0
--- !u!1001 &1282551463
Prefab:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalPosition.x
value: 52.4
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalPosition.z
value: 84.6
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_RootOrder
value: 7
objectReference: {fileID: 0}
- target: {fileID: 1826863781589606, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_Name
value: Pyramid (3)
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalScale.x
value: 1.1470399
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalScale.y
value: 1.14704
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalScale.z
value: 1.14704
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
m_IsPrefabParent: 0
--- !u!1001 &1303871240
Prefab:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalPosition.x
value: 54.361603
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalPosition.z
value: 15.738251
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalRotation.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalRotation.y
value: 0.6076712
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalRotation.w
value: 0.79418874
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_RootOrder
value: 11
objectReference: {fileID: 0}
- target: {fileID: 1826863781589606, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_Name
value: Pyramid (7)
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalScale.x
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalScale.y
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalScale.z
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalEulerAnglesHint.y
value: 74.843
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
m_IsPrefabParent: 0
--- !u!1001 &1414196680
Prefab:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalPosition.x
value: 60.03838
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalPosition.z
value: -100.20925
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalRotation.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalRotation.y
value: 0.79473543
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalRotation.w
value: 0.606956
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_RootOrder
value: 12
objectReference: {fileID: 0}
- target: {fileID: 1826863781589606, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_Name
value: Pyramid (8)
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalScale.x
value: 1.1470399
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalScale.y
value: 1.14704
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalScale.z
value: 1.14704
objectReference: {fileID: 0}
- target: {fileID: 4842016611183212, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
propertyPath: m_LocalEulerAnglesHint.y
value: 105.261
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 87dc9ecf0fda675419ce82a06ffdaa23, type: 2}
m_IsPrefabParent: 0
--- !u!1 &1664461187
GameObject:
m_ObjectHideFlags: 0

m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
m_IsActive: 1
--- !u!23 &1664461188
MeshRenderer:
m_ObjectHideFlags: 0

15
SampleScenes/HDTest/SkyFogTest/SkyFogHDRISky.asset


m_Script: {fileID: 11500000, guid: 59b6606ef2548734bb6d11b9d160bc7e, type: 3}
m_Name: SkyFogHDRISky
m_EditorClassIdentifier:
rotation: 0
rotation: 16
exposure: 0
multiplier: 1
resolution: 256

skyHDRI: {fileID: 8900000, guid: a615f6de0224d55408b4e74da3b0bac0, type: 3}
atmosphericScatteringSettings:
type: 1
colorMode: 1
fogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
mipFogMaxMip: 0.692
mipFogNear: 200
mipFogFar: 500
linearFogDensity: 0.875
linearFogStart: 10
linearFogEnd: 56.82
expFogDistance: 100
skyHDRI: {fileID: 8900000, guid: de78f930088fc194290da7400c89bfb5, type: 3}

21
SampleScenes/HDTest/SkyFogTest/SkyFogProceduralSky.asset


m_EditorClassIdentifier:
rotation: 0
exposure: 0
multiplier: 1.3
multiplier: 1
sunSize: 0.04
sunSizeConvergence: 5
atmosphereThickness: 1
atmosphericScatteringSettings:
type: 2
colorMode: 1
fogColor: {r: 0.36937714, g: 0.40825674, b: 0.41176468, a: 1}
mipFogMaxMip: 0.554
mipFogNear: 40
mipFogFar: 400
linearFogDensity: 1
linearFogStart: 40
linearFogEnd: 100
expFogDistance: 100
sunSize: 0.054
sunSizeConvergence: 6.27
atmosphereThickness: 1.17
groundColor: {r: 0.36862746, g: 0.34901962, b: 0.34117648, a: 1}
groundColor: {r: 0.5661765, g: 0.5661765, b: 0.5661765, a: 1}
enableSunDisk: 1

1
ScriptableRenderPipeline/HDRenderPipeline/Editor/HDAssetFactory.cs


instance.buildProbabilityTables = Load<ComputeShader>(HDRenderPipelinePath + "Sky/BuildProbabilityTables.compute");
instance.computeGgxIblSampleData = Load<ComputeShader>(HDRenderPipelinePath + "Sky/ComputeGgxIblSampleData.compute");
instance.GGXConvolve = Load<Shader>(HDRenderPipelinePath + "Sky/GGXConvolve.shader");
instance.opaqueAtmosphericScattering = Load<Shader>(HDRenderPipelinePath + "Sky/OpaqueAtmosphericScattering.shader");
// Skybox/Cubemap is a builtin shader, must use Sahder.Find to access it. It is fine because we are in the editor
instance.skyboxCubemap = Shader.Find("Skybox/Cubemap");

1
ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipeline.cs


void RenderSky(HDCamera hdCamera, CommandBuffer cmd)
{
m_SkyManager.RenderSky(hdCamera, m_LightLoop.GetCurrentSunLight(), m_CameraColorBufferRT, m_CameraDepthStencilBufferRT, cmd);
m_SkyManager.RenderOpaqueAtmosphericScattering(cmd);
}
public Texture2D ExportSkyToTexture()

1
ScriptableRenderPipeline/HDRenderPipeline/HDStringConstants.cs


public static readonly int _EnvLightSkyEnabled = Shader.PropertyToID("_EnvLightSkyEnabled");
public static readonly int _AmbientOcclusionDirectLightStrenght = Shader.PropertyToID("_AmbientOcclusionDirectLightStrenght");
public static readonly int _SkyTexture = Shader.PropertyToID("_SkyTexture");
public static readonly int _SkyTextureMipCount = Shader.PropertyToID("_SkyTextureMipCount");
public static readonly int _UseDisneySSS = Shader.PropertyToID("_UseDisneySSS");
public static readonly int _EnableSSSAndTransmission = Shader.PropertyToID("_EnableSSSAndTransmission");

2
ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/TilePass.cs


Vector4[] halfRcpVariancesAndWeights = Shader.GetGlobalVectorArray(HDShaderIDs._HalfRcpVariancesAndWeights);
Texture skyTexture = Shader.GetGlobalTexture(HDShaderIDs._SkyTexture);
float skyTextureMipCount = Shader.GetGlobalFloat(HDShaderIDs._SkyTextureMipCount);
for (int variant = 0; variant < numVariants; variant++)
{

cmd.SetComputeFloatParam(deferredComputeShader, HDShaderIDs._AmbientOcclusionDirectLightStrenght, ambientOcclusionDirectLightStrenght);
cmd.SetComputeTextureParam(deferredComputeShader, kernel, HDShaderIDs._SkyTexture, skyTexture ? skyTexture : m_DefaultTexture2DArray);
cmd.SetComputeFloatParam(deferredComputeShader, HDShaderIDs._SkyTextureMipCount, skyTextureMipCount);
// Set SSS parameters.
cmd.SetComputeIntParam( deferredComputeShader, HDShaderIDs._EnableSSSAndTransmission, enableSSSAndTransmission);

1
ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/TilePass.hlsl


TEXTURECUBE(_SkyTexture);
SAMPLERCUBE(sampler_SkyTexture); // NOTE: Sampler could be share here with _EnvTextures. Don't know if the shader compiler will complain...
float _SkyTextureMipCount;
TEXTURE2D(_AmbientOcclusionTexture);

2
ScriptableRenderPipeline/HDRenderPipeline/RenderPipelineResources/HDRenderPipelineResources.asset


computeGgxIblSampleData: {fileID: 7200000, guid: 764a24bb47ef5ba4781d9ae82ca07445,
type: 3}
GGXConvolve: {fileID: 4800000, guid: 123ed592ad5c2494b8aed301fd609e7b, type: 3}
opaqueAtmosphericScattering: {fileID: 4800000, guid: 326059e48e5735e46a98047eff4f0295,
type: 3}
skyboxCubemap: {fileID: 103, guid: 0000000000000000f000000000000000, type: 0}

1
ScriptableRenderPipeline/HDRenderPipeline/RenderPipelineResources/RenderPipelineResources.cs


public ComputeShader buildProbabilityTables;
public ComputeShader computeGgxIblSampleData;
public Shader GGXConvolve;
public Shader opaqueAtmosphericScattering;
public Shader skyboxCubemap;
}

2
ScriptableRenderPipeline/HDRenderPipeline/Sky/BlacksmithlSky/Resources/SkyBlacksmith.shader


float _DisableSkyOcclusionTest;
#define IS_RENDERING_SKY
#include "AtmosphericScattering.hlsl"
#include "AtmosphericScattering_blacksmith.hlsl"
struct Attributes
{

9
ScriptableRenderPipeline/HDRenderPipeline/Sky/Editor/SkySettingsEditor.cs


private SerializedProperty m_EnvUpdatePeriod;
private SerializedProperty m_LightingOverride;
private AtmosphericScatteringEditor m_AtmosphericScatteringEditor = new AtmosphericScatteringEditor();
protected void OnEnable()
{
m_SkyResolution = serializedObject.FindProperty("resolution");

m_EnvUpdateMode = serializedObject.FindProperty("updateMode");
m_EnvUpdatePeriod = serializedObject.FindProperty("updatePeriod");
m_LightingOverride = serializedObject.FindProperty("lightingOverride");
SerializedProperty atmosphericScattering = serializedObject.FindProperty("atmosphericScatteringSettings");
m_AtmosphericScatteringEditor.OnEnable(atmosphericScattering);
}
protected void CommonSkySettingsGUI()

EditorGUILayout.PropertyField(m_EnvUpdatePeriod, SkySettingsStyles.environmentUpdatePeriod);
}
EditorGUILayout.PropertyField(m_LightingOverride, SkySettingsStyles.lightingOverride);
EditorGUILayout.Space();
m_AtmosphericScatteringEditor.OnGUI();
}
}
}

21
ScriptableRenderPipeline/HDRenderPipeline/Sky/SkyManager.cs


Material m_StandardSkyboxMaterial; // This is the Unity standard skybox material. Used to pass the correct cubemap to Enlighten.
Material m_BlitCubemapMaterial;
Material m_OpaqueAtmScatteringMaterial;
IBLFilterGGX m_iblFilterGgx;

// The texture being set is the sky (environment) map pre-convolved with GGX.
public void SetGlobalSkyTexture()
{
Shader.SetGlobalTexture("_SkyTexture", m_SkyboxGGXCubemapRT);
Shader.SetGlobalTexture(HDShaderIDs._SkyTexture, m_SkyboxGGXCubemapRT);
float mipCount = Mathf.Clamp(Mathf.Log((float)m_SkyboxGGXCubemapRT.width, 2.0f) + 1, 0.0f, 6.0f);
Shader.SetGlobalFloat(HDShaderIDs._SkyTextureMipCount, mipCount);
}
public void Resize(float nearPlane, float farPlane)

m_BlitCubemapMaterial = CoreUtils.CreateEngineMaterial(renderPipelinesResources.blitCubemap);
m_OpaqueAtmScatteringMaterial = CoreUtils.CreateEngineMaterial(renderPipelinesResources.opaqueAtmosphericScattering);
m_CurrentUpdateTime = 0.0f;
}

{
if (IsSkyValid())
{
// Rendering the sky is the first time in the frame where we need fog parameters so we push them here for the whole frame.
m_SkySettings.atmosphericScatteringSettings.PushShaderParameters(cmd);
m_BuiltinParameters.commandBuffer = cmd;
m_BuiltinParameters.sunLight = sunLight;
m_BuiltinParameters.pixelCoordToViewDirMatrix = ComputePixelCoordToWorldSpaceViewDirectionMatrix(camera.camera.fieldOfView * Mathf.Deg2Rad, camera.screenSize, camera.viewMatrix, false);

m_Renderer.SetRenderTargets(m_BuiltinParameters);
m_Renderer.RenderSky(m_BuiltinParameters, false);
}
}
}
public void RenderOpaqueAtmosphericScattering(CommandBuffer cmd)
{
using (new ProfilingSample(cmd, "Opaque Atmospheric Scattering"))
{
if(skySettings.atmosphericScatteringSettings.NeedFogRendering())
{
CoreUtils.DrawFullScreen(cmd, m_OpaqueAtmScatteringMaterial);
}
}
}

2
ScriptableRenderPipeline/HDRenderPipeline/Sky/SkySettings.cs


public float updatePeriod = 0.0f;
public Cubemap lightingOverride = null;
public AtmosphericScatteringSettings atmosphericScatteringSettings = new AtmosphericScatteringSettings();
public override int GetHashCode()
{
unchecked

891
SampleScenes/HDTest/SkyFogTest/Pyramid.prefab


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1001 &100100000
Prefab:
m_ObjectHideFlags: 1
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications: []
m_RemovedComponents: []
m_ParentPrefab: {fileID: 0}
m_RootGameObject: {fileID: 1826863781589606}
m_IsPrefabParent: 1
--- !u!1 &1179404133024320
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4738644725814364}
- component: {fileID: 33452171502097156}
- component: {fileID: 65017144405968654}
- component: {fileID: 23362672135292090}
m_Layer: 0
m_Name: Floor_5
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1256022625527062
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4663545736594658}
- component: {fileID: 33536666439887886}
- component: {fileID: 65382848989579318}
- component: {fileID: 23458755086349748}
m_Layer: 0
m_Name: Floor_0
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1262272297306844
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4566950832489612}
- component: {fileID: 33426121659174134}
- component: {fileID: 65584722675669574}
- component: {fileID: 23914490759603862}
m_Layer: 0
m_Name: Floor_8
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1288373574785400
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4298091361550904}
- component: {fileID: 33120372550037680}
- component: {fileID: 65288048382319608}
- component: {fileID: 23440782676529056}
m_Layer: 0
m_Name: Floor_9
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1340756112822894
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4895351386597108}
- component: {fileID: 33905725492912884}
- component: {fileID: 65206750551733284}
- component: {fileID: 23930288201591662}
m_Layer: 0
m_Name: Floor_2
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1528370597470502
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4699754294092930}
- component: {fileID: 33543304438963868}
- component: {fileID: 65678804652465120}
- component: {fileID: 23969281621024100}
m_Layer: 0
m_Name: Floor_3
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1674685860813296
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4950281792724926}
- component: {fileID: 33952973197500482}
- component: {fileID: 65505627169581778}
- component: {fileID: 23584191765241946}
m_Layer: 0
m_Name: Floor_7
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1713293003618316
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4489013056356618}
- component: {fileID: 33012316406586848}
- component: {fileID: 65729873740920338}
- component: {fileID: 23044740033380412}
m_Layer: 0
m_Name: Floor_1
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1730709508842646
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4719756950304810}
- component: {fileID: 33601964476685248}
- component: {fileID: 65837712509929806}
- component: {fileID: 23965628561521942}
m_Layer: 0
m_Name: Floor_4
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1826863781589606
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4842016611183212}
m_Layer: 0
m_Name: Pyramid
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1853014546931842
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4287529710980180}
- component: {fileID: 33133913275333978}
- component: {fileID: 65883434583280154}
- component: {fileID: 23977189031534580}
m_Layer: 0
m_Name: Floor_6
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4287529710980180
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1853014546931842}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 13, z: 0}
m_LocalScale: {x: 20, y: 2, z: 20}
m_Children: []
m_Father: {fileID: 4842016611183212}
m_RootOrder: 6
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &4298091361550904
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1288373574785400}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 19, z: 0}
m_LocalScale: {x: 5, y: 2, z: 5}
m_Children: []
m_Father: {fileID: 4842016611183212}
m_RootOrder: 9
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &4489013056356618
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1713293003618316}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 3, z: 0}
m_LocalScale: {x: 45, y: 2, z: 45}
m_Children: []
m_Father: {fileID: 4842016611183212}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &4566950832489612
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1262272297306844}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 17, z: 0}
m_LocalScale: {x: 10, y: 2, z: 10}
m_Children: []
m_Father: {fileID: 4842016611183212}
m_RootOrder: 8
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &4663545736594658
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1256022625527062}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 1, z: 0}
m_LocalScale: {x: 50, y: 2, z: 50}
m_Children: []
m_Father: {fileID: 4842016611183212}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &4699754294092930
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1528370597470502}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 7, z: 0}
m_LocalScale: {x: 35, y: 2, z: 35}
m_Children: []
m_Father: {fileID: 4842016611183212}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &4719756950304810
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1730709508842646}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 9, z: 0}
m_LocalScale: {x: 30, y: 2, z: 30}
m_Children: []
m_Father: {fileID: 4842016611183212}
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &4738644725814364
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1179404133024320}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 11, z: 0}
m_LocalScale: {x: 25, y: 2, z: 25}
m_Children: []
m_Father: {fileID: 4842016611183212}
m_RootOrder: 5
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &4842016611183212
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1826863781589606}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 4663545736594658}
- {fileID: 4489013056356618}
- {fileID: 4895351386597108}
- {fileID: 4699754294092930}
- {fileID: 4719756950304810}
- {fileID: 4738644725814364}
- {fileID: 4287529710980180}
- {fileID: 4950281792724926}
- {fileID: 4566950832489612}
- {fileID: 4298091361550904}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &4895351386597108
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1340756112822894}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 5, z: 0}
m_LocalScale: {x: 40, y: 2, z: 40}
m_Children: []
m_Father: {fileID: 4842016611183212}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &4950281792724926
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1674685860813296}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 15, z: 0}
m_LocalScale: {x: 15, y: 2, z: 15}
m_Children: []
m_Father: {fileID: 4842016611183212}
m_RootOrder: 7
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!23 &23044740033380412
MeshRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1713293003618316}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_Materials:
- {fileID: 2100000, guid: 948836267934e104294e03adad5c7bf7, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!23 &23362672135292090
MeshRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1179404133024320}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_Materials:
- {fileID: 2100000, guid: 948836267934e104294e03adad5c7bf7, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!23 &23440782676529056
MeshRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1288373574785400}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_Materials:
- {fileID: 2100000, guid: 948836267934e104294e03adad5c7bf7, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!23 &23458755086349748
MeshRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1256022625527062}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_Materials:
- {fileID: 2100000, guid: 948836267934e104294e03adad5c7bf7, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!23 &23584191765241946
MeshRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1674685860813296}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_Materials:
- {fileID: 2100000, guid: 948836267934e104294e03adad5c7bf7, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!23 &23914490759603862
MeshRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1262272297306844}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_Materials:
- {fileID: 2100000, guid: 948836267934e104294e03adad5c7bf7, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!23 &23930288201591662
MeshRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1340756112822894}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_Materials:
- {fileID: 2100000, guid: 948836267934e104294e03adad5c7bf7, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!23 &23965628561521942
MeshRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1730709508842646}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_Materials:
- {fileID: 2100000, guid: 948836267934e104294e03adad5c7bf7, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!23 &23969281621024100
MeshRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1528370597470502}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_Materials:
- {fileID: 2100000, guid: 948836267934e104294e03adad5c7bf7, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!23 &23977189031534580
MeshRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1853014546931842}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_Materials:
- {fileID: 2100000, guid: 948836267934e104294e03adad5c7bf7, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!33 &33012316406586848
MeshFilter:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1713293003618316}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!33 &33120372550037680
MeshFilter:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1288373574785400}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!33 &33133913275333978
MeshFilter:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1853014546931842}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!33 &33426121659174134
MeshFilter:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1262272297306844}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!33 &33452171502097156
MeshFilter:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1179404133024320}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!33 &33536666439887886
MeshFilter:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1256022625527062}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!33 &33543304438963868
MeshFilter:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1528370597470502}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!33 &33601964476685248
MeshFilter:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1730709508842646}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!33 &33905725492912884
MeshFilter:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1340756112822894}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!33 &33952973197500482
MeshFilter:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1674685860813296}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!65 &65017144405968654
BoxCollider:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1179404133024320}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!65 &65206750551733284
BoxCollider:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1340756112822894}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!65 &65288048382319608
BoxCollider:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1288373574785400}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!65 &65382848989579318
BoxCollider:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1256022625527062}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!65 &65505627169581778
BoxCollider:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1674685860813296}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!65 &65584722675669574
BoxCollider:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1262272297306844}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!65 &65678804652465120
BoxCollider:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1528370597470502}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!65 &65729873740920338
BoxCollider:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1713293003618316}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!65 &65837712509929806
BoxCollider:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1730709508842646}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!65 &65883434583280154
BoxCollider:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1853014546931842}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}

10
SampleScenes/HDTest/SkyFogTest/Pyramid.prefab.meta


fileFormatVersion: 2
guid: 87dc9ecf0fda675419ce82a06ffdaa23
timeCreated: 1507824033
licenseType: Pro
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 100100000
userData:
assetBundleName:
assetBundleVariant:

10
ScriptableRenderPipeline/HDRenderPipeline/Sky/AtmosphericScattering.meta


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

53
ScriptableRenderPipeline/HDRenderPipeline/Sky/OpaqueAtmosphericScattering.shader


Shader "Hidden/HDRenderPipeline/OpaqueAtmosphericScattering"
{
SubShader
{
Pass
{
Cull Off
ZTest Always
ZWrite Off
Blend SrcAlpha OneMinusSrcAlpha
HLSLPROGRAM
#pragma target 4.5
#pragma only_renderers d3d11 ps4 metal // TEMP: until we go further in dev
#pragma vertex Vert
#pragma fragment Frag
#pragma enable_d3d11_debug_symbols
#include "../../Core/ShaderLibrary/Common.hlsl"
#include "../ShaderVariables.hlsl"
#include "AtmosphericScattering/AtmosphericScattering.hlsl"
struct Attributes
{
uint vertexID : SV_VertexID;
};
struct Varyings
{
float4 positionCS : SV_POSITION;
};
Varyings Vert(Attributes input)
{
Varyings output;
output.positionCS = GetFullScreenTriangleVertexPosition(input.vertexID);
return output;
}
float4 Frag(Varyings input) : SV_Target
{
PositionInputs posInput = GetPositionInput(input.positionCS.xy, _ScreenSize.zw);
float depth = LOAD_TEXTURE2D(_MainDepthTexture, posInput.unPositionSS).x;
UpdatePositionInput(depth, _InvViewProjMatrix, _ViewProjMatrix, posInput);
return EvaluateAtmosphericScattering(posInput);
}
ENDHLSL
}
}
}

10
ScriptableRenderPipeline/HDRenderPipeline/Sky/OpaqueAtmosphericScattering.shader.meta


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

77
ScriptableRenderPipeline/HDRenderPipeline/Sky/AtmosphericScattering/AtmosphericScattering.cs


using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Rendering;
namespace UnityEngine.Experimental.Rendering.HDPipeline
{
[Serializable]
public class AtmosphericScatteringSettings
{
[GenerateHLSL]
public enum FogType
{
None,
Linear,
Exponential
}
[GenerateHLSL]
public enum FogColorMode
{
ConstantColor,
SkyColor,
}
private readonly static int m_TypeParam = Shader.PropertyToID("_AtmosphericScatteringType");
// Fog Color
private readonly static int m_ColorModeParam = Shader.PropertyToID("_FogColorMode");
private readonly static int m_FogColorParam = Shader.PropertyToID("_FogColor");
private readonly static int m_MipFogParam = Shader.PropertyToID("_MipFogParameters");
// Linear Fog
private readonly static int m_LinearFogParam = Shader.PropertyToID("_LinearFogParameters");
// Exp Fog
private readonly static int m_ExpFogParam = Shader.PropertyToID("_ExpFogParameters");
public FogType type;
// Fog Color
public FogColorMode colorMode = FogColorMode.SkyColor;
public Color fogColor = Color.grey;
[Range(0.0f, 1.0f)]
public float mipFogMaxMip = 1.0f;
public float mipFogNear = 0.0f;
public float mipFogFar = 1000.0f;
// Linear Fog
[Range(0.0f, 1.0f)]
public float linearFogDensity = 1.0f;
public float linearFogStart = 500.0f;
public float linearFogEnd = 1000.0f;
// Exponential fog
//[Min(0.0f)] Not available until 2018.1
public float expFogDistance = 100.0f;
public bool NeedFogRendering()
{
return type != FogType.None;
}
public void PushShaderParameters(CommandBuffer cmd)
{
cmd.SetGlobalFloat(m_TypeParam, (float)type);
// Fog Color
cmd.SetGlobalFloat(m_ColorModeParam, (float)colorMode);
cmd.SetGlobalColor(m_FogColorParam, fogColor);
cmd.SetGlobalVector(m_MipFogParam, new Vector4(mipFogNear, mipFogFar, mipFogMaxMip, 0.0f));
// Linear Fog
cmd.SetGlobalVector(m_LinearFogParam, new Vector4(linearFogStart, linearFogEnd, 1.0f / (linearFogEnd - linearFogStart), linearFogDensity));
// Exp fog
cmd.SetGlobalVector(m_ExpFogParam, new Vector4(Mathf.Max(0.0f, expFogDistance), 0.0f, 0.0f, 0.0f));
}
}
}

21
ScriptableRenderPipeline/HDRenderPipeline/Sky/AtmosphericScattering/AtmosphericScattering.cs.hlsl


//
// This file was automatically generated from Assets/ScriptableRenderLoop/ScriptableRenderPipeline/HDRenderPipeline/Sky/AtmosphericScattering/AtmosphericScattering.cs. Please don't edit by hand.
//
#ifndef ATMOSPHERICSCATTERING_CS_HLSL
#define ATMOSPHERICSCATTERING_CS_HLSL
//
// UnityEngine.Experimental.Rendering.HDPipeline.AtmosphericScatteringSettings+FogType: static fields
//
#define FOGTYPE_NONE (0)
#define FOGTYPE_LINEAR (1)
#define FOGTYPE_EXPONENTIAL (2)
//
// UnityEngine.Experimental.Rendering.HDPipeline.AtmosphericScatteringSettings+FogColorMode: static fields
//
#define FOGCOLORMODE_CONSTANT_COLOR (0)
#define FOGCOLORMODE_SKY_COLOR (1)
#endif

10
ScriptableRenderPipeline/HDRenderPipeline/Sky/AtmosphericScattering/AtmosphericScattering.cs.hlsl.meta


fileFormatVersion: 2
guid: 746eb08eff3e2bd40b7f247282758859
timeCreated: 1507735980
licenseType: Pro
ShaderImporter:
externalObjects: {}
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:

13
ScriptableRenderPipeline/HDRenderPipeline/Sky/AtmosphericScattering/AtmosphericScattering.cs.meta


fileFormatVersion: 2
guid: 953beb541740ddc499d005ee80c9ff29
timeCreated: 1507718592
licenseType: Pro
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

71
ScriptableRenderPipeline/HDRenderPipeline/Sky/AtmosphericScattering/AtmosphericScattering.hlsl


#ifndef UNITY_ATMOSPHERIC_SCATTERING_INCLUDED
#define UNITY_ATMOSPHERIC_SCATTERING_INCLUDED
#include "AtmosphericScattering.cs.hlsl"
#include "../../../Core/ShaderLibrary/VolumeRendering.hlsl"
uniform float _AtmosphericScatteringType;
// Common
uniform float _FogColorMode;
uniform float4 _FogColor;
float4 _MipFogParameters;
#define _MipFogNear _MipFogParameters.x
#define _MipFogFar _MipFogParameters.y
#define _MipFogMaxMip _MipFogParameters.z
TEXTURECUBE(_SkyTexture); // Global name defined in SkyManager
SAMPLERCUBE(sampler_SkyTexture);
float _SkyTextureMipCount;
// Linear fog
uniform float4 _LinearFogParameters;
#define _LinearFogStart _LinearFogParameters.x
#define _LinearFogEnd _LinearFogParameters.y
#define _LinearFogOoRange _LinearFogParameters.z
#define _LinearFogDensity _LinearFogParameters.w
// Exp fog
uniform float4 _ExpFogParameters;
#define _ExpFogDensity _ExpFogParameters.x
float3 GetFogColor(PositionInputs posInput)
{
if (_FogColorMode == FOGCOLORMODE_CONSTANT_COLOR)
{
return _FogColor.rgb;
}
else if (_FogColorMode == FOGCOLORMODE_SKY_COLOR)
{
// Based on Uncharted 4 "Mip Sky Fog" trick: http://advances.realtimerendering.com/other/2016/naughty_dog/NaughtyDog_TechArt_Final.pdf
float mipLevel = (1.0 - _MipFogMaxMip * saturate((posInput.depthVS - _MipFogNear) / (_MipFogFar - _MipFogNear))) * _SkyTextureMipCount;
float3 dir = normalize(posInput.positionWS - _WorldSpaceCameraPos);
return SAMPLE_TEXTURECUBE_LOD(_SkyTexture, sampler_SkyTexture, dir, mipLevel).rgb;
}
else // Should not be possible.
return float3(0.0, 0.0, 0.0);
}
// Returns fog color in rgb and fog factor in alpha.
float4 EvaluateAtmosphericScattering(PositionInputs posInput)
{
if (_AtmosphericScatteringType == FOGTYPE_EXPONENTIAL)
{
float3 fogColor = GetFogColor(posInput);
float fogFactor = 1.0f - Transmittance(OpticalDepthHomogeneous(1.0f / _ExpFogDensity, posInput.depthVS));
return float4(fogColor, fogFactor);
}
else if (_AtmosphericScatteringType == FOGTYPE_LINEAR)
{
float3 fogColor = GetFogColor(posInput);
float fogFactor = _LinearFogDensity * saturate((posInput.depthVS - _LinearFogStart) * _LinearFogOoRange);
return float4(fogColor, fogFactor);
}
else // NONE
{
return float4(0.0, 0.0, 0.0, 0.0);
}
}
#endif

10
ScriptableRenderPipeline/HDRenderPipeline/Sky/AtmosphericScattering/AtmosphericScattering.hlsl.meta


fileFormatVersion: 2
guid: 79c365cd29649284492547604a3cf00f
timeCreated: 1507717326
licenseType: Pro
ShaderImporter:
externalObjects: {}
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:

10
ScriptableRenderPipeline/HDRenderPipeline/Sky/AtmosphericScattering/Editor.meta


fileFormatVersion: 2
guid: 8cfc4d75944230c49ab7bf04f1e8cb76
folderAsset: yes
timeCreated: 1507718601
licenseType: Pro
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

98
ScriptableRenderPipeline/HDRenderPipeline/Sky/AtmosphericScattering/Editor/AtmosphericScatteringEditor.cs


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
namespace UnityEngine.Experimental.Rendering.HDPipeline
{
public class AtmosphericScatteringEditor
{
private class Styles
{
public readonly GUIContent fog = new GUIContent("Fog Parameters");
public readonly GUIContent type = new GUIContent("Type", "Type of fog.");
public readonly GUIContent colorMode = new GUIContent("Color Mode");
public readonly GUIContent color = new GUIContent("Color", "Constant Fog Color");
public readonly GUIContent mipFogNear = new GUIContent("Mip Fog Near", "Distance at which minimum mip of blurred sky texture is used as fog color.");
public readonly GUIContent mipFogFar = new GUIContent("Mip Fog Far", "Distance at which maximum mip of blurred sky texture is used as fog color.");
public readonly GUIContent mipFogMaxMip = new GUIContent("Mip Fog Max Mip", "Maximum mip map used for mip fog (0 being lowest and 1 heighest mip).");
public readonly GUIContent linearFogDensity = new GUIContent("Fog Density");
public readonly GUIContent linearFogStart = new GUIContent("Fog Start Distance");
public readonly GUIContent linearFogEnd = new GUIContent("Fog End Distance");
public readonly GUIContent expFogDistance = new GUIContent("Fog Distance");
}
private static Styles s_Styles = null;
private static Styles styles { get { if (s_Styles == null) s_Styles = new Styles(); return s_Styles; } }
private SerializedProperty m_Type;
private SerializedProperty m_ColorMode;
private SerializedProperty m_Color;
private SerializedProperty m_MipFogNear;
private SerializedProperty m_MipFogFar;
private SerializedProperty m_MipFogMaxMip;
private SerializedProperty m_LinearFogDensity;
private SerializedProperty m_LinearFogStart;
private SerializedProperty m_LinearFogEnd;
private SerializedProperty m_ExpFogDistance;
public void OnEnable(SerializedProperty atmScatterProperty)
{
m_Type = atmScatterProperty.FindPropertyRelative("type");
// Fog Color
m_ColorMode = atmScatterProperty.FindPropertyRelative("colorMode");
m_Color = atmScatterProperty.FindPropertyRelative("fogColor");
m_MipFogNear = atmScatterProperty.FindPropertyRelative("mipFogNear");
m_MipFogFar = atmScatterProperty.FindPropertyRelative("mipFogFar");
m_MipFogMaxMip = atmScatterProperty.FindPropertyRelative("mipFogMaxMip");
// Linear Fog
m_LinearFogDensity = atmScatterProperty.FindPropertyRelative("linearFogDensity");
m_LinearFogStart = atmScatterProperty.FindPropertyRelative("linearFogStart");
m_LinearFogEnd = atmScatterProperty.FindPropertyRelative("linearFogEnd");
// Exp fog
m_ExpFogDistance = atmScatterProperty.FindPropertyRelative("expFogDistance");
}
public void OnGUI()
{
EditorGUILayout.LabelField(styles.fog, EditorStyles.boldLabel);
EditorGUILayout.PropertyField(m_Type, styles.type);
if(!m_Type.hasMultipleDifferentValues)
{
if((AtmosphericScatteringSettings.FogType)m_Type.intValue != AtmosphericScatteringSettings.FogType.None)
{
EditorGUILayout.PropertyField(m_ColorMode, styles.colorMode);
if(!m_ColorMode.hasMultipleDifferentValues && (AtmosphericScatteringSettings.FogColorMode)m_ColorMode.intValue == AtmosphericScatteringSettings.FogColorMode.ConstantColor)
{
EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(m_Color, styles.color);
EditorGUI.indentLevel--;
}
else
{
EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(m_MipFogNear, styles.mipFogNear);
EditorGUILayout.PropertyField(m_MipFogFar, styles.mipFogFar);
EditorGUILayout.PropertyField(m_MipFogMaxMip, styles.mipFogMaxMip);
EditorGUI.indentLevel--;
}
if ((AtmosphericScatteringSettings.FogType)m_Type.intValue == AtmosphericScatteringSettings.FogType.Linear)
{
EditorGUILayout.PropertyField(m_LinearFogDensity, styles.linearFogDensity);
EditorGUILayout.PropertyField(m_LinearFogStart, styles.linearFogStart);
EditorGUILayout.PropertyField(m_LinearFogEnd, styles.linearFogEnd);
}
else if((AtmosphericScatteringSettings.FogType)m_Type.intValue == AtmosphericScatteringSettings.FogType.Exponential)
{
EditorGUILayout.PropertyField(m_ExpFogDistance, styles.expFogDistance);
}
}
}
}
}
}

13
ScriptableRenderPipeline/HDRenderPipeline/Sky/AtmosphericScattering/Editor/AtmosphericScatteringEditor.cs.meta


fileFormatVersion: 2
guid: 2215770abb40237488238a9db6de9dab
timeCreated: 1507718622
licenseType: Pro
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

/ScriptableRenderPipeline/HDRenderPipeline/Sky/BlacksmithlSky/Resources/AtmosphericScattering.hlsl → /ScriptableRenderPipeline/HDRenderPipeline/Sky/BlacksmithlSky/Resources/AtmosphericScattering_blacksmith.hlsl

/ScriptableRenderPipeline/HDRenderPipeline/Sky/BlacksmithlSky/Resources/AtmosphericScattering.hlsl.meta → /ScriptableRenderPipeline/HDRenderPipeline/Sky/BlacksmithlSky/Resources/AtmosphericScattering_blacksmith.hlsl.meta

正在加载...
取消
保存