浏览代码

Merge pull request #503 from Unity-Technologies/Branch_FogAndProceduralSky

Branch fog and procedural sky
/Yibing-Project-2
GitHub 7 年前
当前提交
6ef6a1b3
共有 107 个文件被更改,包括 5691 次插入535 次删除
  1. 2
      ScriptableRenderPipeline/Core/Camera/FreeCamera.cs
  2. 2
      ScriptableRenderPipeline/HDRenderPipeline/Debug/DebugDisplay.cs
  3. 1
      ScriptableRenderPipeline/HDRenderPipeline/Editor/HDAssetFactory.cs
  4. 27
      ScriptableRenderPipeline/HDRenderPipeline/Editor/HDRenderPipelineMenuItems.cs
  5. 3
      ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipeline.cs
  6. 1
      ScriptableRenderPipeline/HDRenderPipeline/HDStringConstants.cs
  7. 2
      ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/TilePass.cs
  8. 8
      ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/TilePass.hlsl
  9. 21
      ScriptableRenderPipeline/HDRenderPipeline/Material/LayeredLit/LayeredLit.shader
  10. 24
      ScriptableRenderPipeline/HDRenderPipeline/Material/LayeredLit/LayeredLitTessellation.shader
  11. 11
      ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Lit.hlsl
  12. 9
      ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Lit.shader
  13. 7
      ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/LitTessellation.shader
  14. 38
      ScriptableRenderPipeline/HDRenderPipeline/Material/Material.hlsl
  15. 54
      ScriptableRenderPipeline/HDRenderPipeline/Material/Unlit/Editor/BaseUnlitUI.cs
  16. 4
      ScriptableRenderPipeline/HDRenderPipeline/Material/Unlit/ShaderPass/UnlitSharePass.hlsl
  17. 9
      ScriptableRenderPipeline/HDRenderPipeline/Material/Unlit/Unlit.shader
  18. 2
      ScriptableRenderPipeline/HDRenderPipeline/RenderPipelineResources/HDRenderPipelineResources.asset
  19. 1
      ScriptableRenderPipeline/HDRenderPipeline/RenderPipelineResources/RenderPipelineResources.cs
  20. 3
      ScriptableRenderPipeline/HDRenderPipeline/ShaderPass/ShaderPassForward.hlsl
  21. 4
      ScriptableRenderPipeline/HDRenderPipeline/ShaderPass/ShaderPassForwardUnlit.hlsl
  22. 42
      ScriptableRenderPipeline/HDRenderPipeline/Sky/HDRISky/Editor/HDRISkyEditor.cs
  23. 2
      ScriptableRenderPipeline/HDRenderPipeline/Sky/HDRISky/HDRISkyRenderer.cs
  24. 4
      ScriptableRenderPipeline/HDRenderPipeline/Sky/ProceduralSky.meta
  25. 4
      ScriptableRenderPipeline/HDRenderPipeline/Sky/ProceduralSky/Editor.meta
  26. 144
      ScriptableRenderPipeline/HDRenderPipeline/Sky/ProceduralSky/Editor/ProceduralSkyEditor.cs
  27. 2
      ScriptableRenderPipeline/HDRenderPipeline/Sky/ProceduralSky/Editor/ProceduralSkyEditor.cs.meta
  28. 182
      ScriptableRenderPipeline/HDRenderPipeline/Sky/ProceduralSky/ProceduralSkyRenderer.cs
  29. 2
      ScriptableRenderPipeline/HDRenderPipeline/Sky/ProceduralSky/ProceduralSkyRenderer.cs.meta
  30. 158
      ScriptableRenderPipeline/HDRenderPipeline/Sky/ProceduralSky/ProceduralSkySettings.cs
  31. 2
      ScriptableRenderPipeline/HDRenderPipeline/Sky/ProceduralSky/ProceduralSkySettings.cs.meta
  32. 4
      ScriptableRenderPipeline/HDRenderPipeline/Sky/ProceduralSky/Resources.meta
  33. 27
      ScriptableRenderPipeline/HDRenderPipeline/Sky/SkyManager.cs
  34. 2
      ScriptableRenderPipeline/HDRenderPipeline/Sky/SkyRenderer.cs
  35. 2
      ScriptableRenderPipeline/HDRenderPipeline/Sky/SkySettings.cs
  36. 4
      ScriptableRenderPipeline/HDRenderPipeline/Sky/BlacksmithlSky/Resources/SkyBlacksmith.shader
  37. 158
      SampleScenes/HDTest/Material/HDRenderLoopMaterials/Grid_Planar_Red.mat
  38. 10
      SampleScenes/HDTest/Material/HDRenderLoopMaterials/Grid_Planar_Red.mat.meta
  39. 10
      SampleScenes/HDTest/ShadowsTest.meta
  40. 10
      SampleScenes/HDTest/SkyFogTest.meta
  41. 1001
      SampleScenes/HDTest/SkyFogTest.unity
  42. 9
      SampleScenes/HDTest/SkyFogTest.unity.meta
  43. 10
      ScriptableRenderPipeline/HDRenderPipeline/Sky/AtmosphericScattering.meta
  44. 9
      ScriptableRenderPipeline/HDRenderPipeline/Sky/BlacksmithlSky.meta
  45. 10
      ScriptableRenderPipeline/HDRenderPipeline/Sky/Editor.meta
  46. 53
      ScriptableRenderPipeline/HDRenderPipeline/Sky/OpaqueAtmosphericScattering.shader
  47. 10
      ScriptableRenderPipeline/HDRenderPipeline/Sky/OpaqueAtmosphericScattering.shader.meta
  48. 313
      ScriptableRenderPipeline/HDRenderPipeline/Sky/ProceduralSky/Resources/ProceduralSky.shader
  49. 9
      ScriptableRenderPipeline/HDRenderPipeline/Sky/ProceduralSky/Resources/ProceduralSky.shader.meta
  50. 21
      ScriptableRenderPipeline/HDRenderPipeline/Sky/SkyVariables.hlsl
  51. 10
      ScriptableRenderPipeline/HDRenderPipeline/Sky/SkyVariables.hlsl.meta
  52. 32
      SampleScenes/HDTest/SkyFogTest/SkyFogHDRISky.asset
  53. 10
      SampleScenes/HDTest/SkyFogTest/SkyFogHDRISky.asset.meta
  54. 10
      SampleScenes/HDTest/SkyFogTest/SkyFogProceduralSky.asset.meta
  55. 891
      SampleScenes/HDTest/SkyFogTest/Pyramid.prefab
  56. 10
      SampleScenes/HDTest/SkyFogTest/Pyramid.prefab.meta
  57. 10
      SampleScenes/HDTest/SkyFogTest/Lit_Transparent_Add.mat.meta
  58. 10
      SampleScenes/HDTest/SkyFogTest/Lit_Transparent_Add_NoFog.mat.meta
  59. 10
      SampleScenes/HDTest/SkyFogTest/Lit_Transparent_Multiply.mat.meta
  60. 10
      SampleScenes/HDTest/SkyFogTest/Lit_Transparent_PreMultipliedAlpha.mat.meta
  61. 10
      SampleScenes/HDTest/SkyFogTest/Unlit_Transparent_Add.mat.meta
  62. 10
      SampleScenes/HDTest/SkyFogTest/Unlit_Transparent_Add_NoFog.mat.meta
  63. 10
      SampleScenes/HDTest/SkyFogTest/Unlit_Transparent_Multiply.mat.meta
  64. 10
      SampleScenes/HDTest/SkyFogTest/Unlit_Transparent_PreMultipliedAlpha.mat.meta
  65. 181
      SampleScenes/HDTest/SkyFogTest/Lit_Transparent_Add.mat
  66. 180
      SampleScenes/HDTest/SkyFogTest/Lit_Transparent_Add_NoFog.mat
  67. 181
      SampleScenes/HDTest/SkyFogTest/Lit_Transparent_Alpha.mat
  68. 181
      SampleScenes/HDTest/SkyFogTest/Lit_Transparent_Multiply.mat
  69. 181
      SampleScenes/HDTest/SkyFogTest/Lit_Transparent_PreMultipliedAlpha.mat
  70. 38
      SampleScenes/HDTest/SkyFogTest/SkyFogProceduralSky.asset
  71. 178
      SampleScenes/HDTest/SkyFogTest/Unlit_Transparent_Add.mat
  72. 177
      SampleScenes/HDTest/SkyFogTest/Unlit_Transparent_Add_NoFog.mat
  73. 178
      SampleScenes/HDTest/SkyFogTest/Unlit_Transparent_Multiply.mat
  74. 178
      SampleScenes/HDTest/SkyFogTest/Unlit_Transparent_PreMultipliedAlpha.mat
  75. 10
      SampleScenes/HDTest/SkyFogTest/Lit_Transparent_Alpha.mat.meta
  76. 10
      SampleScenes/HDTest/SkyFogTest/Unlit_Transparent_Alpha.mat.meta
  77. 178
      SampleScenes/HDTest/SkyFogTest/Unlit_Transparent_Alpha.mat
  78. 21
      ScriptableRenderPipeline/HDRenderPipeline/Sky/AtmosphericScattering/AtmosphericScattering.cs.hlsl
  79. 10
      ScriptableRenderPipeline/HDRenderPipeline/Sky/AtmosphericScattering/AtmosphericScattering.cs.hlsl.meta
  80. 13
      ScriptableRenderPipeline/HDRenderPipeline/Sky/AtmosphericScattering/AtmosphericScattering.cs.meta
  81. 10
      ScriptableRenderPipeline/HDRenderPipeline/Sky/AtmosphericScattering/AtmosphericScattering.hlsl.meta
  82. 10
      ScriptableRenderPipeline/HDRenderPipeline/Sky/AtmosphericScattering/Editor.meta
  83. 13
      ScriptableRenderPipeline/HDRenderPipeline/Sky/AtmosphericScattering/Editor/AtmosphericScatteringEditor.cs.meta
  84. 102
      ScriptableRenderPipeline/HDRenderPipeline/Sky/AtmosphericScattering/Editor/AtmosphericScatteringEditor.cs
  85. 82
      ScriptableRenderPipeline/HDRenderPipeline/Sky/AtmosphericScattering/AtmosphericScattering.cs
  86. 73
      ScriptableRenderPipeline/HDRenderPipeline/Sky/AtmosphericScattering/AtmosphericScattering.hlsl
  87. 177
      ScriptableRenderPipeline/HDRenderPipeline/Sky/BlacksmithlSky/BlacksmithSkyRenderer.cs
  88. 12
      ScriptableRenderPipeline/HDRenderPipeline/Sky/BlacksmithlSky/BlacksmithSkyRenderer.cs.meta
  89. 165
      ScriptableRenderPipeline/HDRenderPipeline/Sky/BlacksmithlSky/BlacksmithSkySettings.cs
  90. 12
      ScriptableRenderPipeline/HDRenderPipeline/Sky/BlacksmithlSky/BlacksmithSkySettings.cs.meta
  91. 9
      ScriptableRenderPipeline/HDRenderPipeline/Sky/BlacksmithlSky/Editor.meta
  92. 155
      ScriptableRenderPipeline/HDRenderPipeline/Sky/BlacksmithlSky/Editor/BlacksmithSkyEditor.cs
  93. 12
      ScriptableRenderPipeline/HDRenderPipeline/Sky/BlacksmithlSky/Editor/BlacksmithSkyEditor.cs.meta
  94. 9
      ScriptableRenderPipeline/HDRenderPipeline/Sky/BlacksmithlSky/Resources.meta

2
ScriptableRenderPipeline/Core/Camera/FreeCamera.cs


{
public float m_LookSpeedController = 120f;
public float m_LookSpeedMouse = 10.0f;
public float m_MoveSpeed = 50.0f;
public float m_MoveSpeed = 10.0f;
public float m_Turbo = 10.0f;
private static string kMouseX = "Mouse X";

2
ScriptableRenderPipeline/HDRenderPipeline/Debug/DebugDisplay.cs


DebugMenuManager.instance.AddDebugItem<bool>("Rendering", "Display Opaque",() => renderingDebugSettings.displayOpaqueObjects, (value) => renderingDebugSettings.displayOpaqueObjects = (bool)value);
DebugMenuManager.instance.AddDebugItem<bool>("Rendering", "Display Transparency",() => renderingDebugSettings.displayTransparentObjects, (value) => renderingDebugSettings.displayTransparentObjects = (bool)value);
DebugMenuManager.instance.AddDebugItem<bool>("Rendering", "Enable Atmospheric Scattering",() => renderingDebugSettings.enableAtmosphericScattering, (value) => renderingDebugSettings.enableAtmosphericScattering = (bool)value);
DebugMenuManager.instance.AddDebugItem<bool>("Rendering", "Enable Distortion",() => renderingDebugSettings.enableDistortion, (value) => renderingDebugSettings.enableDistortion = (bool)value);
DebugMenuManager.instance.AddDebugItem<bool>("Rendering", "Enable Subsurface Scattering",() => renderingDebugSettings.enableSSSAndTransmission, (value) => renderingDebugSettings.enableSSSAndTransmission = (bool)value);
DebugMenuManager.instance.AddDebugItem<int>("Rendering", kFullScreenDebugMode, () => (int)fullScreenDebugMode, (value) => fullScreenDebugMode = (FullScreenDebugMode)value, DebugItemFlag.None, new DebugItemHandlerIntEnum(DebugDisplaySettings.renderingFullScreenDebugStrings, DebugDisplaySettings.renderingFullScreenDebugValues));

public bool enableDistortion = true;
public bool enableGaussianPyramid = true;
public bool enableSSSAndTransmission = true;
public bool enableAtmosphericScattering = true;
}
public enum ShadowMapDebugMode

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");

27
ScriptableRenderPipeline/HDRenderPipeline/Editor/HDRenderPipelineMenuItems.cs


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

class DoCreateNewAssetCommonSettings : DoCreateNewAsset<CommonSettings> {}
class DoCreateNewAssetHDRISkySettings : DoCreateNewAsset<HDRISkySettings> {}
class DoCreateNewAssetBlacksmithSkySettings : DoCreateNewAsset<BlacksmithSkySettings> {}
[MenuItem("Assets/Create/HDRenderPipeline/Common Settings", priority = 677)]
[MenuItem("Assets/Create/HDRenderPipeline/Common Settings", priority = 700)]
static void MenuCreateCommonSettings()
{
var icon = EditorGUIUtility.FindTexture("ScriptableObject Icon");

[MenuItem("Assets/Create/HDRenderPipeline/HDRISky Settings", priority = 678)]
[MenuItem("Assets/Create/HDRenderPipeline/Subsurface Scattering Settings", priority = 702)]
static void MenuCreateSubsurfaceScatteringProfile()
{
var icon = EditorGUIUtility.FindTexture("ScriptableObject Icon");
ProjectWindowUtil.StartNameEditingIfProjectWindowExists(0, ScriptableObject.CreateInstance<DoCreateNewAssetSubsurfaceScatteringSettings>(), "New SSS Profile.asset", icon, null);
}
[MenuItem("Assets/Create/HDRenderPipeline/HDRISky Settings", priority = 750)]
static void MenuCreateHDRISkySettings()
{
var icon = EditorGUIUtility.FindTexture("ScriptableObject Icon");

[MenuItem("Assets/Create/HDRenderPipeline/ProceduralSky Settings", priority = 679)]
static void MenuCreateProceduralSkySettings()
[MenuItem("Assets/Create/HDRenderPipeline/BlacksmithSky Settings", priority = 751)]
static void MenuCreateBlacksmithSkySettings()
ProjectWindowUtil.StartNameEditingIfProjectWindowExists(0, ScriptableObject.CreateInstance<DoCreateNewAssetProceduralSkySettings>(), "New ProceduralSkySettings.asset", icon, null);
ProjectWindowUtil.StartNameEditingIfProjectWindowExists(0, ScriptableObject.CreateInstance<DoCreateNewAssetBlacksmithSkySettings>(), "New BlacksmithSkySettings.asset", icon, null);
[MenuItem("Assets/Create/HDRenderPipeline/Subsurface Scattering Settings", priority = 681)]
static void MenuCreateSubsurfaceScatteringSettings()
[MenuItem("Assets/Create/HDRenderPipeline/ProceduralSky Settings", priority = 752)]
static void MenuCreateProceduralSkySettings()
ProjectWindowUtil.StartNameEditingIfProjectWindowExists(0, ScriptableObject.CreateInstance<DoCreateNewAssetSubsurfaceScatteringSettings>(), "New SSS Settings.asset", icon, null);
ProjectWindowUtil.StartNameEditingIfProjectWindowExists(0, ScriptableObject.CreateInstance<DoCreateNewAssetProceduralSkySettings>(), "New ProceduralSkySettings.asset", icon, null);
}
}

3
ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipeline.cs


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

1
ScriptableRenderPipeline/HDRenderPipeline/HDStringConstants.cs


public static readonly int _EnvLightSkyEnabled = Shader.PropertyToID("_EnvLightSkyEnabled");
public static readonly int _AmbientOcclusionParam = Shader.PropertyToID("_AmbientOcclusionParam");
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.SetComputeVectorParam(deferredComputeShader, HDShaderIDs._AmbientOcclusionParam, ambientOcclusionParam);
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);

8
ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/TilePass.hlsl


#include "TilePass.cs.hlsl"
#include "TilePass.cs.hlsl"
#include "../../Sky/SkyVariables.hlsl"
StructuredBuffer<uint> g_vLightListGlobal; // don't support Buffer yet in unity

// Use texture array for reflection (or LatLong 2D array for mobile)
TEXTURECUBE_ARRAY_ABSTRACT(_EnvTextures);
SAMPLERCUBE_ABSTRACT(sampler_EnvTextures);
TEXTURECUBE(_SkyTexture);
SAMPLERCUBE(sampler_SkyTexture); // NOTE: Sampler could be share here with _EnvTextures. Don't know if the shader compiler will complain...
TEXTURE2D(_DeferredShadowTexture);

}
else // SINGLE_PASS_SAMPLE_SKY
{
return SAMPLE_TEXTURECUBE_LOD(_SkyTexture, sampler_SkyTexture, texCoord, lod);
return SampleSkyTexture(texCoord, lod);
}
}

21
ScriptableRenderPipeline/HDRenderPipeline/Material/LayeredLit/LayeredLit.shader


[HideInInspector] _CullMode("__cullmode", Float) = 2.0
[HideInInspector] _ZTestMode("_ZTestMode", Int) = 8
[ToggleOff] _EnableFog ("Enable Fog", Float) = 1.0
[ToggleOff] _DoubleSidedEnable("Double sided enable", Float) = 0.0
[Enum(None, 0, Mirror, 1, Flip, 2)] _DoubleSidedNormalMode("Double sided normal mode", Float) = 1
[HideInInspector] _DoubleSidedConstants("_DoubleSidedConstants", Vector) = (1, 1, -1, 0)

#pragma shader_feature _HEIGHT_BASED_BLEND
#pragma shader_feature _ _LAYEREDLIT_3_LAYERS _LAYEREDLIT_4_LAYERS
#pragma shader_feature _ _BLENDMODE_LERP _BLENDMODE_ADD _BLENDMODE_SOFT_ADD _BLENDMODE_MULTIPLY _BLENDMODE_PRE_MULTIPLY
#pragma shader_feature _ _BLENDMODE_ALPHA _BLENDMODE_ADD _BLENDMODE_SOFT_ADD _BLENDMODE_MULTIPLY _BLENDMODE_PRE_MULTIPLY
// This feature is only for transparent Lit
#pragma shader_feature _ENABLE_FOG
#pragma multi_compile LIGHTMAP_OFF LIGHTMAP_ON
#pragma multi_compile DIRLIGHTMAP_OFF DIRLIGHTMAP_COMBINED

ENDHLSL
}
Pass
{
Name "Forward" // Name is not used
Tags{ "LightMode" = "Forward" } // This will be only for transparent object based on the RenderQueue index
Blend[_SrcBlend][_DstBlend]
ZWrite[_ZWrite]
Cull[_CullMode]
HLSLPROGRAM
#define SHADERPASS SHADERPASS_FORWARD
#include "../../ShaderVariables.hlsl"
#include "../../Lighting/Forward.hlsl"
Pass
{
Name "Forward" // Name is not used

24
ScriptableRenderPipeline/HDRenderPipeline/Material/LayeredLit/LayeredLitTessellation.shader


[HideInInspector] _CullMode("__cullmode", Float) = 2.0
[HideInInspector] _ZTestMode("_ZTestMode", Int) = 8
[ToggleOff] _EnableFog ("Enable Fog", Float) = 1.0
[ToggleOff] _DoubleSidedEnable("Double sided enable", Float) = 0.0
[Enum(None, 0, Mirror, 1, Flip, 2)] _DoubleSidedNormalMode("Double sided normal mode", Float) = 1
[HideInInspector] _DoubleSidedConstants("_DoubleSidedConstants", Vector) = (1, 1, -1, 0)

#pragma shader_feature _HEIGHT_BASED_BLEND
#pragma shader_feature _ _LAYEREDLIT_3_LAYERS _LAYEREDLIT_4_LAYERS
#pragma shader_feature _ _BLENDMODE_LERP _BLENDMODE_ADD _BLENDMODE_SOFT_ADD _BLENDMODE_MULTIPLY _BLENDMODE_PRE_MULTIPLY
#pragma shader_feature _ _BLENDMODE_ALPHA _BLENDMODE_ADD _BLENDMODE_SOFT_ADD _BLENDMODE_MULTIPLY _BLENDMODE_PRE_MULTIPLY
// This feature is only for transparent Lit
#pragma shader_feature _ENABLE_FOG
#pragma multi_compile LIGHTMAP_OFF LIGHTMAP_ON
#pragma multi_compile DIRLIGHTMAP_OFF DIRLIGHTMAP_COMBINED

ENDHLSL
}
Pass
{
Name "Forward" // Name is not used
Tags{ "LightMode" = "Forward" } // This will be only for transparent object based on the RenderQueue index
Blend[_SrcBlend][_DstBlend]
ZWrite[_ZWrite]
Cull[_CullMode]
HLSLPROGRAM
#pragma hull Hull
#pragma domain Domain
#define SHADERPASS SHADERPASS_FORWARD
#include "../../ShaderVariables.hlsl"
#include "../../Lighting/Forward.hlsl"
Pass
{
Name "Forward" // Name is not used

11
ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Lit.hlsl


// Rough refraction texture
// Color pyramid (width, height, lodcount, Unused)
float4 _GaussianPyramidColorMipSize;
TEXTURE2D(_PyramidDepthTexture);
CBUFFER_START(UnityGaussianPyramidParameters)
float4 _GaussianPyramidColorMipSize;
TEXTURE2D(_PyramidDepthTexture);
CBUFFER_END
CBUFFER_START(UnityAmbientOcclusionParameters)
CBUFFER_END
// Area light textures
// TODO: This one should be set into a constant Buffer at pass frequency (with _Screensize)

9
ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Lit.shader


[HideInInspector] _CullMode("__cullmode", Float) = 2.0
[HideInInspector] _ZTestMode("_ZTestMode", Int) = 8
[ToggleOff] _EnableFog ("Enable Fog", Float) = 1.0
[ToggleOff] _DoubleSidedEnable("Double sided enable", Float) = 0.0
[Enum(None, 0, Mirror, 1, Flip, 2)] _DoubleSidedNormalMode("Double sided normal mode", Float) = 1
[HideInInspector] _DoubleSidedConstants("_DoubleSidedConstants", Vector) = (1, 1, -1, 0)

#pragma target 4.5
#pragma only_renderers d3d11 ps4 metal // TEMP: until we go futher in dev
// #pragma enable_d3d11_debug_symbols
//#pragma enable_d3d11_debug_symbols
//-------------------------------------------------------------------------------------
// Variant

#pragma shader_feature _THICKNESSMAP
#pragma shader_feature _SPECULARCOLORMAP
#pragma shader_feature _ _BLENDMODE_LERP _BLENDMODE_ADD _BLENDMODE_SOFT_ADD _BLENDMODE_MULTIPLY _BLENDMODE_PRE_MULTIPLY
#pragma shader_feature _ _BLENDMODE_ALPHA _BLENDMODE_ADD _BLENDMODE_SOFT_ADD _BLENDMODE_MULTIPLY _BLENDMODE_PRE_MULTIPLY
// This feature is only for transparent Lit
#pragma shader_feature _ENABLE_FOG
// MaterialId are used as shader feature to allow compiler to optimize properly
// Note _MATID_STANDARD is not define as there is always the default case "_". We assign default as _MATID_STANDARD, so we never test _MATID_STANDARD

7
ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/LitTessellation.shader


[HideInInspector] _CullMode("__cullmode", Float) = 2.0
[HideInInspector] _ZTestMode("_ZTestMode", Int) = 8
[ToggleOff] _EnableFog ("Enable Fog", Float) = 1.0
[ToggleOff] _DoubleSidedEnable("Double sided enable", Float) = 0.0
[Enum(None, 0, Mirror, 1, Flip, 2)] _DoubleSidedNormalMode("Double sided normal mode", Float) = 1
[HideInInspector] _DoubleSidedConstants("_DoubleSidedConstants", Vector) = (1, 1, -1, 0)

#pragma shader_feature _THICKNESSMAP
#pragma shader_feature _SPECULARCOLORMAP
#pragma shader_feature _ _BLENDMODE_LERP _BLENDMODE_ADD _BLENDMODE_SOFT_ADD _BLENDMODE_MULTIPLY _BLENDMODE_PRE_MULTIPLY
#pragma shader_feature _ _BLENDMODE_ALPHA _BLENDMODE_ADD _BLENDMODE_SOFT_ADD _BLENDMODE_MULTIPLY _BLENDMODE_PRE_MULTIPLY
// This feature is only for transparent Lit
#pragma shader_feature _ENABLE_FOG
// MaterialId are used as shader feature to allow compiler to optimize properly
// Note _MATID_STANDARD is not define as there is always the default case "_". We assign default as _MATID_STANDARD, so we never test _MATID_STANDARD

38
ScriptableRenderPipeline/HDRenderPipeline/Material/Material.hlsl


#include "../../Core/ShaderLibrary/CommonMaterial.hlsl"
#include "../../Core/ShaderLibrary/EntityLighting.hlsl"
#include "../../Core/ShaderLibrary/ImageBasedLighting.hlsl"
#include "../Sky/AtmosphericScattering/AtmosphericScattering.hlsl"
#if defined(_BLENDMODE_LERP) || defined(_BLENDMODE_ADD) || defined(_BLENDMODE_SOFT_ADD) || defined(_BLENDMODE_MULTIPLY) || defined(_BLENDMODE_PRE_MULTIPLY)
#if defined(_BLENDMODE_ALPHA) || defined(_BLENDMODE_ADD) || defined(_BLENDMODE_SOFT_ADD) || defined(_BLENDMODE_MULTIPLY) || defined(_BLENDMODE_PRE_MULTIPLY)
//-----------------------------------------------------------------------------
// Fog sampling function for materials
//-----------------------------------------------------------------------------
// Used for transparent object. input color is color + alpha of the original transparent pixel.
float4 EvaluateAtmosphericScattering(PositionInputs posInput, float4 inputColor)
{
float4 result = inputColor;
#if defined(SURFACE_TYPE_TRANSPARENT) && defined(_ENABLE_FOG)
float4 fog = EvaluateAtmosphericScattering(posInput);
#if defined(_BLENDMODE_ALPHA)
// Regular alpha blend only need a lerp to work
result.rgb = lerp(result.rgb, fog.rgb, fog.a);
#elif defined(_BLENDMODE_ADD)
// For additive, we just need to fade to black with fog density (black + background == background color == fog color)
result.rgb = result.rgb * (1.0 - fog.a);
#elif defined(_BLENDMODE_MULTIPLY)
// For multiplicative, we just need to fade to white with fog density (white * background == background color == fog color)
result.rgb = lerp(result.rgb, float3(1.0, 1.0, 1.0), fog.a);
#elif defined(_BLENDMODE_PRE_MULTIPLY)
// For Pre-Multiplied Alpha Blend, we need to multiply fog color by src alpha to match regular alpha blending formula.
result.rgb = lerp(result.rgb, fog.rgb * result.a, fog.a);
#endif
#else
// Evaluation of fog for opaque objects is currently done in a full screen pass independent from any material parameters.
// but this funtction is called in generic forward shader code so we need it to be neutral in this case.
#endif
return result;
}
//-----------------------------------------------------------------------------
// BuiltinData

54
ScriptableRenderPipeline/HDRenderPipeline/Material/Unlit/Editor/BaseUnlitUI.cs


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

public static GUIContent alphaCutoffText = new GUIContent("Alpha Cutoff", "Threshold for alpha cutoff");
public static GUIContent alphaCutoffShadowText = new GUIContent("Alpha Cutoff Shadow", "Threshold for alpha cutoff in case of shadow pass");
public static GUIContent alphaCutoffPrepassText = new GUIContent("Alpha Cutoff Prepass", "Threshold for alpha cutoff in case of depth prepass");
public static GUIContent transparentDepthPrepassEnableText = new GUIContent("Enable transparent depth prepass", "It allow to ");
public static GUIContent transparentDepthPrepassEnableText = new GUIContent("Enable transparent depth prepass", "It allow to ");
public static GUIContent enableFogText = new GUIContent("Enable Fog");
public static GUIContent doubleSidedEnableText = new GUIContent("Double Sided", "This will render the two face of the objects (disable backface culling) and flip/mirror normal");
public static GUIContent distortionEnableText = new GUIContent("Distortion", "Enable distortion on this shader");

Transparent
}
// Enum values are hardcoded for retrocompatibility. Don't change them.
Lerp,
Add,
SoftAdd,
Multiply,
Premultiply
Alpha = 0,
Additive = 1,
Multiplicative = 3,
PremultipliedAlpha = 4
}
protected MaterialEditor m_MaterialEditor;

protected const string kDistortionBlurRemapMax = "_DistortionBlurRemapMax";
protected MaterialProperty preRefractionPass = null;
protected const string kPreRefractionPass = "_PreRefractionPass";
protected MaterialProperty enableFog = null;
protected const string kEnableFog = "_EnableFog";
// See comment in LitProperties.hlsl
const string kEmissionColor = "_EmissionColor";

distortionBlurRemapMin = FindProperty(kDistortionBlurRemapMin, props, false);
distortionBlurRemapMax = FindProperty(kDistortionBlurRemapMax, props, false);
preRefractionPass = FindProperty(kPreRefractionPass, props, false);
enableFog = FindProperty(kEnableFog, props, false);
}
void SurfaceTypePopup()

if ((SurfaceType)surfaceType.floatValue == SurfaceType.Transparent)
{
BlendModePopup();
m_MaterialEditor.ShaderProperty(enableFog, StylesBaseUnlit.enableFogText);
m_MaterialEditor.ShaderProperty(preRefractionPass, StylesBaseUnlit.transparentPrePassText);
}

BlendMode blendMode = (BlendMode)material.GetFloat(kBlendMode);
// These need to always been set either with opaque or transparent! So a users can swtich to opaque and remove the keyword correctly
SetKeyword(material, "_BLENDMODE_LERP", false);
SetKeyword(material, "_BLENDMODE_ALPHA", false);
SetKeyword(material, "_BLENDMODE_ADD", false);
SetKeyword(material, "_BLENDMODE_SOFT_ADD", false);
SetKeyword(material, "_BLENDMODE_MULTIPLY", false);

var isPrePass = material.HasProperty(kPreRefractionPass) && material.GetFloat(kPreRefractionPass) > 0.0f;
material.renderQueue = (int)(isPrePass ? HDRenderQueue.PreRefraction : HDRenderQueue.Transparent);
SetKeyword(material, "_BLENDMODE_LERP", BlendMode.Lerp == blendMode);
SetKeyword(material, "_BLENDMODE_ADD", BlendMode.Add == blendMode);
SetKeyword(material, "_BLENDMODE_SOFT_ADD", BlendMode.SoftAdd == blendMode);
SetKeyword(material, "_BLENDMODE_MULTIPLY", BlendMode.Multiply == blendMode);
SetKeyword(material, "_BLENDMODE_PRE_MULTIPLY", BlendMode.Premultiply == blendMode);
SetKeyword(material, "_BLENDMODE_ALPHA", BlendMode.Alpha == blendMode);
SetKeyword(material, "_BLENDMODE_ADD", BlendMode.Additive == blendMode);
SetKeyword(material, "_BLENDMODE_MULTIPLY", BlendMode.Multiplicative == blendMode);
SetKeyword(material, "_BLENDMODE_PRE_MULTIPLY", BlendMode.PremultipliedAlpha == blendMode);
case BlendMode.Lerp:
case BlendMode.Alpha:
case BlendMode.Add:
case BlendMode.Additive:
case BlendMode.SoftAdd:
material.SetInt("_SrcBlend", (int)UnityEngine.Rendering.BlendMode.OneMinusDstColor);
material.SetInt("_DstBlend", (int)UnityEngine.Rendering.BlendMode.One);
break;
case BlendMode.Multiply:
case BlendMode.Multiplicative:
case BlendMode.Premultiply:
case BlendMode.PremultipliedAlpha:
material.SetInt("_SrcBlend", (int)UnityEngine.Rendering.BlendMode.One);
material.SetInt("_DstBlend", (int)UnityEngine.Rendering.BlendMode.OneMinusSrcAlpha);
break;

SetKeyword(material, "_DOUBLESIDED_ON", doubleSidedEnable);
SetKeyword(material, "_ALPHATEST_ON", alphaTestEnable);
bool fogEnabled = material.GetFloat(kEnableFog) > 0.0f;
SetKeyword(material, "_ENABLE_FOG", fogEnabled);
{
{
bool distortionDepthTest = material.GetFloat(kDistortionDepthTest) > 0.0f;
if (distortionDepthTest)
{

material.SetInt("_DistortionBlurDstBlend", (int)UnityEngine.Rendering.BlendMode.One);
material.SetInt("_DistortionBlurBlendOp", (int)UnityEngine.Rendering.BlendOp.Max);
break;
}
}
case 1: // Multiply
material.SetInt("_DistortionSrcBlend", (int)UnityEngine.Rendering.BlendMode.DstColor);
material.SetInt("_DistortionDstBlend", (int)UnityEngine.Rendering.BlendMode.Zero);

// If distortion only is enabled, disable all passes (except distortion and debug)
bool enablePass = !(distortionEnable && distortionOnly);
// Disable all passes except distortion
// Distortion is setup in code above
material.SetShaderPassEnabled(HDShaderPassNames.s_ForwardStr, enablePass);

4
ScriptableRenderPipeline/HDRenderPipeline/Material/Unlit/ShaderPass/UnlitSharePass.hlsl


#define ATTRIBUTES_NEED_TEXCOORD0
#if defined(_ENABLE_FOG)
#define VARYINGS_NEED_POSITION_WS
#endif
#define VARYINGS_NEED_TEXCOORD0
// This include will define the various Attributes/Varyings structure

9
ScriptableRenderPipeline/HDRenderPipeline/Material/Unlit/Unlit.shader


[ToggleOff] _DoubleSidedEnable("Double sided enable", Float) = 0.0
[ToggleOff] _EnableFog ("Enable Fog", Float) = 0.0
// Caution: C# code in BaseLitUI.cs call LightmapEmissionFlagsProperty() which assume that there is an existing "_EmissionColor"
// value that exist to identify if the GI emission need to be enabled.
// In our case we don't use such a mechanism but need to keep the code quiet. We declare the value and always enable it.

#pragma target 4.5
#pragma only_renderers d3d11 ps4 metal // TEMP: until we go further in dev
// #pragma enable_d3d11_debug_symbols
//#pragma enable_d3d11_debug_symbols
//-------------------------------------------------------------------------------------
// Variant

#pragma shader_feature _EMISSIVE_COLOR_MAP
#pragma shader_feature _ _BLENDMODE_LERP _BLENDMODE_ADD _BLENDMODE_SOFT_ADD _BLENDMODE_MULTIPLY _BLENDMODE_PRE_MULTIPLY
#pragma shader_feature _ _BLENDMODE_ALPHA _BLENDMODE_ADD _BLENDMODE_SOFT_ADD _BLENDMODE_MULTIPLY _BLENDMODE_PRE_MULTIPLY
// This feature is only for transparent Unlit
#pragma shader_feature _ENABLE_FOG
//-------------------------------------------------------------------------------------
// Define

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;

3
ScriptableRenderPipeline/HDRenderPipeline/ShaderPass/ShaderPassForward.hlsl


float3 bakeDiffuseLighting = GetBakedDiffuseLigthing(surfaceData, builtinData, bsdfData, preLightData);
LightLoop(V, posInput, preLightData, bsdfData, bakeDiffuseLighting, featureFlags, diffuseLighting, specularLighting);
#ifdef _BLENDMODE_LERP
#ifdef _BLENDMODE_ALPHA
outColor = EvaluateAtmosphericScattering(posInput, outColor);
}
#ifdef _DEPTHOFFSET_ON

4
ScriptableRenderPipeline/HDRenderPipeline/ShaderPass/ShaderPassForwardUnlit.hlsl


#if SHADERPASS != SHADERPASS_FORWARD_UNLIT
#if SHADERPASS != SHADERPASS_FORWARD_UNLIT
#error SHADERPASS_is_not_correctly_define
#endif

BSDFData bsdfData = ConvertSurfaceDataToBSDFData(surfaceData);
// TODO: we must not access bsdfData here, it break the genericity of the code!
float4 outColor = float4(bsdfData.color + builtinData.emissiveColor, builtinData.opacity);
float4 outColor = EvaluateAtmosphericScattering(posInput, float4(bsdfData.color + builtinData.emissiveColor, builtinData.opacity));
#ifdef DEBUG_DISPLAY
// Same code in ShaderPassForward.shader

42
ScriptableRenderPipeline/HDRenderPipeline/Sky/HDRISky/Editor/HDRISkyEditor.cs


{
[CanEditMultipleObjects]
[CustomEditor(typeof(HDRISkySettings))]
public class HDRISkyParametersEditor
: Editor
public class HDRISkySettingsEditor
: SkySettingsEditor
public readonly GUIContent skyResolution = new GUIContent("Resolution", "Resolution of the environment lighting generated from the sky.");
public readonly GUIContent skyExposure = new GUIContent("Exposure", "Exposure of the sky in EV.");
public readonly GUIContent skyRotation = new GUIContent("Rotation", "Rotation of the sky.");
public readonly GUIContent skyMultiplier = new GUIContent("Multiplier", "Intensity multiplier for the sky.");
public readonly GUIContent environmentUpdateMode = new GUIContent("Environment Update Mode", "Specify how the environment lighting should be updated.");
public readonly GUIContent environmentUpdatePeriod = new GUIContent("Environment Update Period", "If environment update is set to realtime, period in seconds at which it is updated (0.0 means every frame).");
public readonly GUIContent lightingOverride = new GUIContent("Lighting Override", "If a lighting override cubemap is provided, this cubemap will be used to compute lighting instead of the result from the visible sky.");
}
private static Styles s_Styles = null;

}
private SerializedProperty m_SkyHDRI;
private SerializedProperty m_SkyResolution;
private SerializedProperty m_SkyExposure;
private SerializedProperty m_SkyMultiplier;
private SerializedProperty m_SkyRotation;
private SerializedProperty m_EnvUpdateMode;
private SerializedProperty m_EnvUpdatePeriod;
private SerializedProperty m_LightingOverride;
void OnEnable()
protected override void InitializeProperties()
base.InitializeProperties();
m_SkyResolution = serializedObject.FindProperty("resolution");
m_SkyExposure = serializedObject.FindProperty("exposure");
m_SkyMultiplier = serializedObject.FindProperty("multiplier");
m_SkyRotation = serializedObject.FindProperty("rotation");
m_EnvUpdateMode = serializedObject.FindProperty("updateMode");
m_EnvUpdatePeriod = serializedObject.FindProperty("updatePeriod");
m_LightingOverride = serializedObject.FindProperty("lightingOverride");
}
public override void OnInspectorGUI()

EditorGUILayout.PropertyField(m_SkyHDRI, styles.skyHDRI);
EditorGUILayout.PropertyField(m_SkyResolution, styles.skyResolution);
EditorGUILayout.PropertyField(m_SkyExposure, styles.skyExposure);
EditorGUILayout.PropertyField(m_SkyMultiplier, styles.skyMultiplier);
EditorGUILayout.PropertyField(m_SkyRotation, styles.skyRotation);
EditorGUILayout.Space();
EditorGUILayout.PropertyField(m_EnvUpdateMode, styles.environmentUpdateMode);
if (!m_EnvUpdateMode.hasMultipleDifferentValues && m_EnvUpdateMode.intValue == (int)EnvironementUpdateMode.Realtime)
{
EditorGUILayout.PropertyField(m_EnvUpdatePeriod, styles.environmentUpdatePeriod);
}
EditorGUILayout.PropertyField(m_LightingOverride, styles.lightingOverride);
base.CommonSkySettingsGUI();
serializedObject.ApplyModifiedProperties();
}

2
ScriptableRenderPipeline/HDRenderPipeline/Sky/HDRISky/HDRISkyRenderer.cs


}
}
public override void RenderSky(BuiltinSkyParameters builtinParams, SkySettings skyParameters, bool renderForCubemap)
public override void RenderSky(BuiltinSkyParameters builtinParams, bool renderForCubemap)
{
m_SkyHDRIMaterial.SetTexture(HDShaderIDs._Cubemap, m_HdriSkyParams.skyHDRI);
m_SkyHDRIMaterial.SetVector(HDShaderIDs._SkyParam, new Vector4(m_HdriSkyParams.exposure, m_HdriSkyParams.multiplier, m_HdriSkyParams.rotation, 0.0f));

4
ScriptableRenderPipeline/HDRenderPipeline/Sky/ProceduralSky.meta


fileFormatVersion: 2
guid: 65f9231eb40b6914eb24ea0b555778f0
guid: 3b82dc4603e0dc94a8845a0e0b716046
timeCreated: 1481646017
timeCreated: 1481626018
licenseType: Pro
DefaultImporter:
userData:

4
ScriptableRenderPipeline/HDRenderPipeline/Sky/ProceduralSky/Editor.meta


fileFormatVersion: 2
guid: 00372bf7f144a724bba68a081fd79e78
guid: b0f1613f908d934488f326668e5ab334
timeCreated: 1481646149
timeCreated: 1481635912
licenseType: Pro
DefaultImporter:
userData:

144
ScriptableRenderPipeline/HDRenderPipeline/Sky/ProceduralSky/Editor/ProceduralSkyEditor.cs


{
[CanEditMultipleObjects]
[CustomEditor(typeof(ProceduralSkySettings))]
public class ProceduralSkySettingsEditor : Editor
public class ProceduralSkySettingsEditor
: SkySettingsEditor
private float heightFogHeight = 0.0f;
public readonly GUIContent skyHDRI = new GUIContent("HDRI");
public readonly GUIContent skyResolution = new GUIContent("Resolution");
public readonly GUIContent skyExposure = new GUIContent("Exposure");
public readonly GUIContent skyRotation = new GUIContent("Rotation");
public readonly GUIContent skyMultiplier = new GUIContent("Multiplier");
public readonly GUIContent lightingOverride = new GUIContent("Lighting Override", "If a lighting override cubemap is provided, this cubemap will be used to compute lighting instead of the result from the visible sky.");
public readonly GUIContent sunSize = new GUIContent("Sun Size");
public readonly GUIContent sunSizeConvergence = new GUIContent("Sun Size Convergence");
public readonly GUIContent atmosphereThickness = new GUIContent("Atmosphere Thickness");
public readonly GUIContent skyTint = new GUIContent("SkyTint");
public readonly GUIContent groundColor = new GUIContent("Ground Color");
public readonly GUIContent enableSunDisk = new GUIContent("Enable Sun Disk");
}
private static Styles s_Styles = null;

}
}
private SerializedProperty m_SkyHDRI;
private SerializedProperty m_SkyResolution;
private SerializedProperty m_SkyExposure;
private SerializedProperty m_SkyMultiplier;
private SerializedProperty m_SkyRotation;
private SerializedProperty m_LightingOverride;
private SerializedProperty m_updateMode;
private SerializedProperty m_updatePeriod;
private SerializedProperty m_worldScaleExponent;
private SerializedProperty m_maxSkyDistance;
private SerializedProperty m_worldMieColorIntensity;
private SerializedProperty m_worldMieColorRamp;
private SerializedProperty m_worldMieDensity;
private SerializedProperty m_worldMieNearScatterPush;
private SerializedProperty m_worldMiePhaseAnisotropy;
private SerializedProperty m_worldRayleighColorIntensity;
private SerializedProperty m_worldRayleighColorRamp;
private SerializedProperty m_worldRayleighDensity;
private SerializedProperty m_worldRayleighNearScatterPush;
private SerializedProperty m_heightSeaLevel;
private SerializedProperty m_heightDistance;
private SerializedProperty m_heightMieDensity;
private SerializedProperty m_heightMieNearScatterPush;
private SerializedProperty m_heightRayleighColor;
private SerializedProperty m_heightRayleighDensity;
private SerializedProperty m_heightRayleighIntensity;
private SerializedProperty m_heightRayleighNearScatterPush;
private SerializedProperty m_SunSize;
private SerializedProperty m_SunSizeConvergence;
private SerializedProperty m_AtmosphericThickness;
private SerializedProperty m_SkyTint;
private SerializedProperty m_GroundColor;
private SerializedProperty m_EnableSunDisk;
void OnEnable()
protected override void InitializeProperties()
m_SkyHDRI = serializedObject.FindProperty("skyHDRI");
m_SkyResolution = serializedObject.FindProperty("resolution");
m_SkyExposure = serializedObject.FindProperty("exposure");
m_SkyMultiplier = serializedObject.FindProperty("multiplier");
m_SkyRotation = serializedObject.FindProperty("rotation");
m_updateMode = serializedObject.FindProperty("updateMode");
m_updatePeriod = serializedObject.FindProperty("updatePeriod");
m_LightingOverride = serializedObject.FindProperty("lightingOverride");
m_maxSkyDistance = serializedObject.FindProperty("maxSkyDistance");
m_worldScaleExponent = serializedObject.FindProperty("worldScaleExponent");
m_worldMieColorIntensity = serializedObject.FindProperty("worldMieColorIntensity");
m_worldMieColorRamp = serializedObject.FindProperty("worldMieColorRamp");
m_worldMieDensity = serializedObject.FindProperty("worldMieDensity");
m_worldMieNearScatterPush = serializedObject.FindProperty("worldMieNearScatterPush");
m_worldMiePhaseAnisotropy = serializedObject.FindProperty("worldMiePhaseAnisotropy");
base.InitializeProperties();
m_worldRayleighColorIntensity = serializedObject.FindProperty("worldRayleighColorIntensity");
m_worldRayleighColorRamp = serializedObject.FindProperty("worldRayleighColorRamp");
m_worldRayleighDensity = serializedObject.FindProperty("worldRayleighDensity");
m_worldRayleighNearScatterPush = serializedObject.FindProperty("worldRayleighNearScatterPush");
m_heightSeaLevel = serializedObject.FindProperty("heightSeaLevel");
m_heightDistance = serializedObject.FindProperty("heightDistance");
m_heightMieDensity = serializedObject.FindProperty("heightMieDensity");
m_heightMieNearScatterPush = serializedObject.FindProperty("heightMieNearScatterPush");
m_heightRayleighColor = serializedObject.FindProperty("heightRayleighColor");
m_heightRayleighDensity = serializedObject.FindProperty("heightRayleighDensity");
m_heightRayleighIntensity = serializedObject.FindProperty("heightRayleighIntensity");
m_heightRayleighNearScatterPush = serializedObject.FindProperty("heightRayleighNearScatterPush");
m_SunSize = serializedObject.FindProperty("sunSize");
m_SunSizeConvergence = serializedObject.FindProperty("sunSizeConvergence");
m_AtmosphericThickness = serializedObject.FindProperty("atmosphereThickness");
m_SkyTint = serializedObject.FindProperty("skyTint");
m_GroundColor = serializedObject.FindProperty("groundColor");
m_EnableSunDisk = serializedObject.FindProperty("enableSunDisk");
}
public override void OnInspectorGUI()

EditorGUILayout.LabelField(new GUIContent("Skydome"), EditorStyles.boldLabel);
EditorGUILayout.PropertyField(m_SkyHDRI, styles.skyHDRI);
EditorGUILayout.PropertyField(m_SkyResolution, styles.skyResolution);
EditorGUILayout.PropertyField(m_SkyExposure, styles.skyExposure);
EditorGUILayout.PropertyField(m_SkyMultiplier, styles.skyMultiplier);
EditorGUILayout.PropertyField(m_SkyRotation, styles.skyRotation);
EditorGUILayout.PropertyField(m_updateMode);
EditorGUILayout.PropertyField(m_updatePeriod);
EditorGUILayout.PropertyField(m_LightingOverride, styles.lightingOverride);
EditorGUILayout.Space();
EditorGUILayout.LabelField(new GUIContent("Atmosphere"), EditorStyles.boldLabel);
EditorGUILayout.PropertyField(m_worldMieDensity, new GUIContent("Density"));
m_worldRayleighDensity.floatValue = m_worldMieDensity.floatValue;
EditorGUILayout.PropertyField(m_worldScaleExponent, new GUIContent("Global scale"));
EditorGUILayout.PropertyField(m_maxSkyDistance, new GUIContent("Sky distance"));
EditorGUILayout.Space();
EditorGUILayout.PropertyField(m_worldMieColorRamp);
EditorGUILayout.PropertyField(m_worldMieColorIntensity);
EditorGUILayout.PropertyField(m_worldMieNearScatterPush);
EditorGUILayout.PropertyField(m_worldMiePhaseAnisotropy);
EditorGUILayout.Space();
EditorGUILayout.PropertyField(m_worldRayleighColorRamp);
EditorGUILayout.PropertyField(m_worldRayleighColorIntensity);
//EditorGUILayout.PropertyField(m_worldRayleighDensity);
EditorGUILayout.PropertyField(m_worldRayleighNearScatterPush);
EditorGUILayout.PropertyField(m_EnableSunDisk, styles.enableSunDisk);
EditorGUILayout.PropertyField(m_SunSize, styles.sunSize);
EditorGUILayout.PropertyField(m_SunSizeConvergence, styles.sunSizeConvergence);
EditorGUILayout.PropertyField(m_AtmosphericThickness, styles.atmosphereThickness);
EditorGUILayout.PropertyField(m_SkyTint, styles.skyTint);
EditorGUILayout.PropertyField(m_GroundColor, styles.groundColor);
EditorGUILayout.LabelField(new GUIContent("Height fog"), EditorStyles.boldLabel);
heightFogHeight = EditorGUILayout.FloatField(new GUIContent("Height"), heightFogHeight);
EditorGUILayout.PropertyField(m_heightDistance, new GUIContent("Falloff"));
m_heightSeaLevel.floatValue = heightFogHeight + m_heightDistance.floatValue * 2.0f - 2.0f;
EditorGUILayout.PropertyField(m_heightMieDensity, new GUIContent("Density"));
m_heightRayleighDensity.floatValue = m_heightMieDensity.floatValue;
EditorGUILayout.PropertyField(m_heightMieNearScatterPush);
EditorGUILayout.PropertyField(m_heightRayleighColor);
//EditorGUILayout.PropertyField(m_heightRayleighDensity);
EditorGUILayout.PropertyField(m_heightRayleighIntensity);
EditorGUILayout.PropertyField(m_heightRayleighNearScatterPush);
//base.DrawDefaultInspector();
base.CommonSkySettingsGUI();
serializedObject.ApplyModifiedProperties();
}

2
ScriptableRenderPipeline/HDRenderPipeline/Sky/ProceduralSky/Editor/ProceduralSkyEditor.cs.meta


fileFormatVersion: 2
guid: 40b56ef8d02cefa49ab82e6b7df9266b
guid: c0dee295943199545a69be3662dc5d1b
timeCreated: 1481635925
licenseType: Pro
MonoImporter:

182
ScriptableRenderPipeline/HDRenderPipeline/Sky/ProceduralSky/ProceduralSkyRenderer.cs


{
public class ProceduralSkyRenderer : SkyRenderer
{
Material m_ProceduralSkyMaterial = null; // Renders a cubemap into a render texture (can be cube or 2D)
private ProceduralSkySettings m_ProceduralSkySettings;
Material m_SkyProceduralMaterial;
MaterialPropertyBlock m_PropertyBlock;
ProceduralSkySettings m_ProceduralSkyParams;
readonly int _SunSizeParam = Shader.PropertyToID("_SunSize");
readonly int _SunSizeConvergenceParam = Shader.PropertyToID("_SunSizeConvergence");
readonly int _AtmoshpereThicknessParam = Shader.PropertyToID("_AtmosphereThickness");
readonly int _SkyTintParam = Shader.PropertyToID("_SkyTint");
readonly int _GroundColorParam = Shader.PropertyToID("_GroundColor");
readonly int _SunColorParam = Shader.PropertyToID("_SunColor");
readonly int _SunDirectionParam = Shader.PropertyToID("_SunDirection");
public ProceduralSkyRenderer(ProceduralSkySettings proceduralSkySettings)
public ProceduralSkyRenderer(ProceduralSkySettings proceduralSkyParams)
m_ProceduralSkySettings = proceduralSkySettings;
m_ProceduralSkyParams = proceduralSkyParams;
m_PropertyBlock = new MaterialPropertyBlock();
m_ProceduralSkyMaterial = CoreUtils.CreateEngineMaterial("Hidden/HDRenderPipeline/Sky/SkyProcedural");
m_SkyProceduralMaterial = CoreUtils.CreateEngineMaterial("Hidden/HDRenderPipeline/Sky/SkyProcedural");
CoreUtils.Destroy(m_ProceduralSkyMaterial);
}
public override bool IsSkyValid()
{
if (m_ProceduralSkyMaterial == null || m_ProceduralSkySettings == null)
return false;
return m_ProceduralSkySettings.skyHDRI != null &&
m_ProceduralSkySettings.worldMieColorRamp != null &&
m_ProceduralSkySettings.worldRayleighColorRamp != null;
CoreUtils.Destroy(m_SkyProceduralMaterial);
// We do not bind the depth buffer as a depth-stencil target since it is
// bound as a color texture which is then sampled from within the shader.
CoreUtils.SetRenderTarget(builtinParams.commandBuffer, builtinParams.colorBuffer);
}
void SetKeywords(BuiltinSkyParameters builtinParams, ProceduralSkySettings param, bool renderForCubemap)
{
// Ensure that all preprocessor symbols are initially undefined.
m_ProceduralSkyMaterial.DisableKeyword("ATMOSPHERICS");
m_ProceduralSkyMaterial.DisableKeyword("ATMOSPHERICS_PER_PIXEL");
m_ProceduralSkyMaterial.DisableKeyword("ATMOSPHERICS_DEBUG");
m_ProceduralSkyMaterial.DisableKeyword("ATMOSPHERICS_OCCLUSION");
m_ProceduralSkyMaterial.DisableKeyword("ATMOSPHERICS_OCCLUSION_EDGE_FIXUP");
m_ProceduralSkyMaterial.DisableKeyword("ATMOSPHERICS_OCCLUSION_FULLSKY");
m_ProceduralSkyMaterial.DisableKeyword("ATMOSPHERICS_SUNRAYS");
m_ProceduralSkyMaterial.DisableKeyword("PERFORM_SKY_OCCLUSION_TEST");
m_ProceduralSkyMaterial.EnableKeyword("ATMOSPHERICS_PER_PIXEL");
/*
if (useOcclusion)
if (builtinParams.depthBuffer == BuiltinSkyParameters.nullRT)
m_ProceduralSkyMaterial.EnableKeyword("ATMOSPHERICS_OCCLUSION");
if(occlusionDepthFixup && occlusionDownscale != OcclusionDownscale.x1)
m_ProceduralSkyMaterial.EnableKeyword("ATMOSPHERICS_OCCLUSION_EDGE_FIXUP");
if(occlusionFullSky)
m_ProceduralSkyMaterial.EnableKeyword("ATMOSPHERICS_OCCLUSION_FULLSKY");
CoreUtils.SetRenderTarget(builtinParams.commandBuffer, builtinParams.colorBuffer);
*/
// Expected to be valid for the sky pass, and invalid for the cube map generation pass.
if (!renderForCubemap)
else
m_ProceduralSkyMaterial.EnableKeyword("PERFORM_SKY_OCCLUSION_TEST");
}
if (param.debugMode != ProceduralSkySettings.ScatterDebugMode.None)
{
m_ProceduralSkyMaterial.EnableKeyword("ATMOSPHERICS_DEBUG");
CoreUtils.SetRenderTarget(builtinParams.commandBuffer, builtinParams.colorBuffer, builtinParams.depthBuffer);
void SetUniforms(BuiltinSkyParameters builtinParams, ProceduralSkySettings param, bool renderForCubemap, ref MaterialPropertyBlock properties)
public override void RenderSky(BuiltinSkyParameters builtinParams, bool renderForCubemap)
properties.SetTexture("_Cubemap", param.skyHDRI);
properties.SetVector("_SkyParam", new Vector4(param.exposure, param.multiplier, param.rotation, 0.0f));
properties.SetMatrix("_InvViewProjMatrix", builtinParams.invViewProjMatrix);
properties.SetVector("_CameraPosWS", builtinParams.cameraPosWS);
properties.SetVector("_ScreenSize", builtinParams.screenSize);
m_ProceduralSkyMaterial.SetInt("_AtmosphericsDebugMode", (int)param.debugMode);
Vector3 sunDirection = (builtinParams.sunLight != null) ? -builtinParams.sunLight.transform.forward : Vector3.zero;
m_ProceduralSkyMaterial.SetVector("_SunDirection", sunDirection);
var pixelRect = new Rect(0f, 0f, builtinParams.screenSize.x, builtinParams.screenSize.y);
var scale = 1.0f; //(float)(int)occlusionDownscale;
var depthTextureScaledTexelSize = new Vector4(scale / pixelRect.width,
scale / pixelRect.height,
-scale / pixelRect.width,
-scale / pixelRect.height);
properties.SetVector("_DepthTextureScaledTexelSize", depthTextureScaledTexelSize);
CoreUtils.SetKeyword(m_SkyProceduralMaterial, "_ENABLE_SUN_DISK", m_ProceduralSkyParams.enableSunDisk);
/*
m_ProceduralSkyMaterial.SetFloat("_ShadowBias", useOcclusion ? occlusionBias : 1f);
m_ProceduralSkyMaterial.SetFloat("_ShadowBiasIndirect", useOcclusion ? occlusionBiasIndirect : 1f);
m_ProceduralSkyMaterial.SetFloat("_ShadowBiasClouds", useOcclusion ? occlusionBiasClouds : 1f);
m_ProceduralSkyMaterial.SetVector("_ShadowBiasSkyRayleighMie", useOcclusion ? new Vector4(occlusionBiasSkyRayleigh, occlusionBiasSkyMie, 0f, 0f) : Vector4.zero);
m_ProceduralSkyMaterial.SetFloat("_OcclusionDepthThreshold", occlusionDepthThreshold);
m_ProceduralSkyMaterial.SetVector("_OcclusionTexture_TexelSize", ???);
*/
m_ProceduralSkyMaterial.SetFloat("_WorldScaleExponent", param.worldScaleExponent);
m_ProceduralSkyMaterial.SetFloat("_WorldNormalDistanceRcp", 1f / param.worldNormalDistance);
m_ProceduralSkyMaterial.SetFloat("_WorldMieNearScatterPush", -Mathf.Pow(Mathf.Abs(param.worldMieNearScatterPush), param.worldScaleExponent) * Mathf.Sign(param.worldMieNearScatterPush));
m_ProceduralSkyMaterial.SetFloat("_WorldRayleighNearScatterPush", -Mathf.Pow(Mathf.Abs(param.worldRayleighNearScatterPush), param.worldScaleExponent) * Mathf.Sign(param.worldRayleighNearScatterPush));
m_ProceduralSkyMaterial.SetFloat("_WorldRayleighDensity", -param.worldRayleighDensity / 100000f);
m_ProceduralSkyMaterial.SetFloat("_WorldMieDensity", -param.worldMieDensity / 100000f);
m_ProceduralSkyMaterial.SetFloat("_SkyDepth", 1.0f / param.maxSkyDistance);
Color sunColor = Color.white;
Vector3 sunDirection = Vector3.zero;
if(builtinParams.sunLight != null)
{
sunColor = builtinParams.sunLight.color * builtinParams.sunLight.intensity;
sunDirection = -builtinParams.sunLight.transform.forward;
}
var rayleighColorM20 = param.worldRayleighColorRamp.Evaluate(0.00f);
var rayleighColorM10 = param.worldRayleighColorRamp.Evaluate(0.25f);
var rayleighColorO00 = param.worldRayleighColorRamp.Evaluate(0.50f);
var rayleighColorP10 = param.worldRayleighColorRamp.Evaluate(0.75f);
var rayleighColorP20 = param.worldRayleighColorRamp.Evaluate(1.00f);
m_SkyProceduralMaterial.SetVector(HDShaderIDs._SkyParam, new Vector4(m_ProceduralSkyParams.exposure, m_ProceduralSkyParams.multiplier, m_ProceduralSkyParams.rotation, 0.0f));
m_SkyProceduralMaterial.SetFloat(_SunSizeParam, m_ProceduralSkyParams.sunSize);
m_SkyProceduralMaterial.SetFloat(_SunSizeConvergenceParam, m_ProceduralSkyParams.sunSizeConvergence);
m_SkyProceduralMaterial.SetFloat(_AtmoshpereThicknessParam, m_ProceduralSkyParams.atmosphereThickness);
m_SkyProceduralMaterial.SetColor(_SkyTintParam, m_ProceduralSkyParams.skyTint);
m_SkyProceduralMaterial.SetColor(_GroundColorParam, m_ProceduralSkyParams.groundColor);
m_SkyProceduralMaterial.SetColor(_SunColorParam, sunColor);
m_SkyProceduralMaterial.SetVector(_SunDirectionParam, sunDirection);
var mieColorM20 = param.worldMieColorRamp.Evaluate(0.00f);
var mieColorO00 = param.worldMieColorRamp.Evaluate(0.50f);
var mieColorP20 = param.worldMieColorRamp.Evaluate(1.00f);
// This matrix needs to be updated at the draw call frequency.
m_PropertyBlock.SetMatrix(HDShaderIDs._PixelCoordToViewDirWS, builtinParams.pixelCoordToViewDirMatrix);
m_ProceduralSkyMaterial.SetVector("_RayleighColorM20", (Vector4)rayleighColorM20 * param.worldRayleighColorIntensity);
m_ProceduralSkyMaterial.SetVector("_RayleighColorM10", (Vector4)rayleighColorM10 * param.worldRayleighColorIntensity);
m_ProceduralSkyMaterial.SetVector("_RayleighColorO00", (Vector4)rayleighColorO00 * param.worldRayleighColorIntensity);
m_ProceduralSkyMaterial.SetVector("_RayleighColorP10", (Vector4)rayleighColorP10 * param.worldRayleighColorIntensity);
m_ProceduralSkyMaterial.SetVector("_RayleighColorP20", (Vector4)rayleighColorP20 * param.worldRayleighColorIntensity);
m_ProceduralSkyMaterial.SetVector("_MieColorM20", (Vector4)mieColorM20 * param.worldMieColorIntensity);
m_ProceduralSkyMaterial.SetVector("_MieColorO00", (Vector4)mieColorO00 * param.worldMieColorIntensity);
m_ProceduralSkyMaterial.SetVector("_MieColorP20", (Vector4)mieColorP20 * param.worldMieColorIntensity);
m_ProceduralSkyMaterial.SetFloat("_HeightNormalDistanceRcp", 1f / param.heightNormalDistance);
m_ProceduralSkyMaterial.SetFloat("_HeightMieNearScatterPush", -Mathf.Pow(Mathf.Abs(param.heightMieNearScatterPush), param.worldScaleExponent) * Mathf.Sign(param.heightMieNearScatterPush));
m_ProceduralSkyMaterial.SetFloat("_HeightRayleighNearScatterPush", -Mathf.Pow(Mathf.Abs(param.heightRayleighNearScatterPush), param.worldScaleExponent) * Mathf.Sign(param.heightRayleighNearScatterPush));
// m_ProceduralSkyMaterial.SetFloat("_HeightRayleighDensity", -param.heightRayleighDensity / 100000f);
// m_ProceduralSkyMaterial.SetFloat("_HeightMieDensity", -param.heightMieDensity / 100000f);
m_ProceduralSkyMaterial.SetFloat("_HeightSeaLevel", param.heightSeaLevel);
m_ProceduralSkyMaterial.SetVector("_HeightPlaneShift", param.heightPlaneShift);
m_ProceduralSkyMaterial.SetFloat("_HeightDistanceRcp", 1f / param.heightDistance);
m_ProceduralSkyMaterial.SetVector("_HeightRayleighColor", (Vector4)param.heightRayleighColor * param.heightRayleighIntensity);
m_ProceduralSkyMaterial.SetFloat("_HeightExtinctionFactor", param.heightExtinctionFactor);
m_ProceduralSkyMaterial.SetVector("_RayleighInScatterPct", new Vector4(1f - param.worldRayleighIndirectScatter, param.worldRayleighIndirectScatter, 0f, 0f));
m_ProceduralSkyMaterial.SetFloat("_RayleighExtinctionFactor", param.worldRayleighExtinctionFactor);
m_ProceduralSkyMaterial.SetFloat("_MiePhaseAnisotropy", param.worldMiePhaseAnisotropy);
m_ProceduralSkyMaterial.SetFloat("_MieExtinctionFactor", param.worldMieExtinctionFactor);
// Since we use the material for rendering the sky both into the cubemap, and
// during the fullscreen pass, setting the 'PERFORM_SKY_OCCLUSION_TEST' keyword has no effect.
properties.SetFloat("_DisableSkyOcclusionTest", renderForCubemap ? 1.0f : 0.0f);
// We do not render the height fog into the sky IBL cubemap.
properties.SetFloat("_HeightRayleighDensity", renderForCubemap ? -0.0f : -param.heightRayleighDensity / 100000f);
properties.SetFloat("_HeightMieDensity", renderForCubemap ? -0.0f : -param.heightMieDensity / 100000f);
properties.SetMatrix(HDShaderIDs._PixelCoordToViewDirWS, builtinParams.pixelCoordToViewDirMatrix);
CoreUtils.DrawFullScreen(builtinParams.commandBuffer, m_SkyProceduralMaterial, m_PropertyBlock, renderForCubemap ? 0 : 1);
override public void RenderSky(BuiltinSkyParameters builtinParams, SkySettings skyParameters, bool renderForCubemap)
public override bool IsSkyValid()
MaterialPropertyBlock properties = new MaterialPropertyBlock();
// Define select preprocessor symbols.
SetKeywords(builtinParams, m_ProceduralSkySettings, renderForCubemap);
// Set shader constants.
SetUniforms(builtinParams, m_ProceduralSkySettings, renderForCubemap, ref properties);
CoreUtils.DrawFullScreen(builtinParams.commandBuffer, m_ProceduralSkyMaterial, properties);
return true;
}
}
}

2
ScriptableRenderPipeline/HDRenderPipeline/Sky/ProceduralSky/ProceduralSkyRenderer.cs.meta


fileFormatVersion: 2
guid: 476423447c1989948a128fc0a0b27413
guid: 2b673ee33719b0d47bdddf170bc4e3ff
timeCreated: 1481631774
licenseType: Pro
MonoImporter:

158
ScriptableRenderPipeline/HDRenderPipeline/Sky/ProceduralSky/ProceduralSkySettings.cs


namespace UnityEngine.Experimental.Rendering.HDPipeline
{
[ExecuteInEditMode]
public enum OcclusionDownscale { x1 = 1, x2 = 2, x4 = 4 }
public enum OcclusionSamples { x64 = 0, x164 = 1, x244 = 2 }
public enum ScatterDebugMode { None, Scattering, Occlusion, OccludedScattering, Rayleigh, Mie, Height }
[Header("Global Settings")]
public float worldMieColorIntensity = 1f;
public Gradient worldMieColorRamp = null;
public float worldMieDensity = 15f;
public float worldMieExtinctionFactor = 0f;
public float worldMieNearScatterPush = 0f;
public float worldMiePhaseAnisotropy = 0.9f;
public float worldNormalDistance = 1000f;
public float worldRayleighColorIntensity = 1f;
public Gradient worldRayleighColorRamp = null;
public float worldRayleighDensity = 10f;
public float worldRayleighExtinctionFactor = 1.1f;
public float worldRayleighIndirectScatter = 0.33f;
public float worldRayleighNearScatterPush = 0f;
[Header("Height Settings")]
public float heightDistance = 50f;
public float heightExtinctionFactor = 1.1f;
public float heightMieDensity = 0f;
public float heightMieNearScatterPush = 0f;
public float heightNormalDistance = 1000f;
public Vector3 heightPlaneShift = Vector3.zero;
public Color heightRayleighColor = Color.white;
public float heightRayleighDensity = 10f;
public float heightRayleighIntensity = 1f;
public float heightRayleighNearScatterPush = 0f;
public float heightSeaLevel = 0f;
/*
[Header("Scatter Occlusion")]
public bool useOcclusion = false;
public bool occlusionFullSky = false;
public bool occlusionDepthFixup = true;
public float occlusionBias = 0f;
public float occlusionBiasClouds = 0.3f;
public float occlusionBiasIndirect = 0.6f;
public float occlusionBiasSkyMie = 0.4f;
public float occlusionBiasSkyRayleigh = 0.2f;
public float occlusionDepthThreshold = 25f;
public OcclusionDownscale occlusionDownscale = OcclusionDownscale.x2;
public OcclusionSamples occlusionSamples = OcclusionSamples.x64;
*/
[Header("Other")]
public Cubemap skyHDRI = null;
// public Shader atmosphericShader = null;
// public Shader occlusionShader = null;
public float worldScaleExponent = 1.0f;
public float maxSkyDistance = 4000.0f;
public ScatterDebugMode debugMode = ScatterDebugMode.None;
// Camera m_currentCamera;
// UnityEngine.Rendering.CommandBuffer m_occlusionCmdAfterShadows, m_occlusionCmdBeforeScreen;
void Awake()
{
if (worldRayleighColorRamp == null)
{
worldRayleighColorRamp = new Gradient();
worldRayleighColorRamp.SetKeys(
new[] { new GradientColorKey(new Color(0.3f, 0.4f, 0.6f), 0f),
new GradientColorKey(new Color(0.5f, 0.6f, 0.8f), 1f) },
new[] { new GradientAlphaKey(1f, 0f),
new GradientAlphaKey(1f, 1f) }
);
}
if (worldMieColorRamp == null)
{
worldMieColorRamp = new Gradient();
worldMieColorRamp.SetKeys(
new[] { new GradientColorKey(new Color(0.95f, 0.75f, 0.5f), 0f),
new GradientColorKey(new Color(1f, 0.9f, 8.0f), 1f) },
new[] { new GradientAlphaKey(1f, 0f),
new GradientAlphaKey(1f, 1f) }
);
}
}
public void OnValidate()
{
worldMieDensity = Mathf.Clamp(worldMieDensity, 0f, 1000f);
worldMiePhaseAnisotropy = Mathf.Clamp01(worldMiePhaseAnisotropy);
worldMieNearScatterPush = Mathf.Clamp(worldMieNearScatterPush, -200f, 300f);
worldNormalDistance = Mathf.Clamp(worldNormalDistance, 1f, 10000f);
worldRayleighDensity = Mathf.Clamp(worldRayleighDensity, 0, 1000f);
worldRayleighIndirectScatter = Mathf.Clamp(worldRayleighIndirectScatter, 0f, 1f);
worldRayleighNearScatterPush = Mathf.Clamp(worldRayleighNearScatterPush, -200f, 300f);
heightMieDensity = Mathf.Clamp(heightMieDensity, 0, 1000f);
heightMieNearScatterPush = Mathf.Clamp(heightMieNearScatterPush, -200f, 300f);
heightNormalDistance = Mathf.Clamp(heightNormalDistance, 1f, 10000f);
heightRayleighDensity = Mathf.Clamp(heightRayleighDensity, 0, 1000f);
heightRayleighNearScatterPush = Mathf.Clamp(heightRayleighNearScatterPush, -200f, 300f);
worldScaleExponent = Mathf.Clamp(worldScaleExponent, 1f, 2f);
maxSkyDistance = Mathf.Clamp(maxSkyDistance, 1.0f, 1000000.0f);
/*
occlusionBias = Mathf.Clamp01(occlusionBias);
occlusionBiasClouds = Mathf.Clamp01(occlusionBiasClouds);
occlusionBiasIndirect = Mathf.Clamp01(occlusionBiasIndirect);
occlusionBiasSkyMie = Mathf.Clamp01(occlusionBiasSkyMie);
occlusionBiasSkyRayleigh = Mathf.Clamp01(occlusionBiasSkyRayleigh);
*/
}
[Range(0.0f,1.0f)]
public float sunSize = 0.04f;
[Range(1.0f,10.0f)]
public float sunSizeConvergence = 5.0f;
[Range(0.0f,5.0f)]
public float atmosphereThickness = 1.0f;
public Color skyTint = new Color(0.5f, 0.5f, 0.5f, 1.0f);
public Color groundColor = new Color(0.369f, 0.349f, 0.341f, 1.0f);
public bool enableSunDisk = true;
public override SkyRenderer GetRenderer()
{

unchecked
{
hash = hash * 23 + worldMieColorIntensity.GetHashCode();
hash = worldMieColorRamp != null ? hash * 23 + worldMieColorRamp.GetHashCode() : hash;
hash = hash * 23 + worldMieDensity.GetHashCode();
hash = hash * 23 + worldMieExtinctionFactor.GetHashCode();
hash = hash * 23 + worldMieNearScatterPush.GetHashCode();
hash = hash * 23 + worldMiePhaseAnisotropy.GetHashCode();
hash = hash * 23 + worldNormalDistance.GetHashCode();
hash = hash * 23 + worldRayleighColorIntensity.GetHashCode();
hash = worldRayleighColorRamp != null ? hash * 23 + worldRayleighColorRamp.GetHashCode() : hash;
hash = hash * 23 + worldRayleighDensity.GetHashCode();
hash = hash * 23 + worldRayleighExtinctionFactor.GetHashCode();
hash = hash * 23 + worldRayleighIndirectScatter.GetHashCode();
hash = hash * 23 + worldRayleighNearScatterPush.GetHashCode();
hash = hash * 23 + heightDistance.GetHashCode();
hash = hash * 23 + heightExtinctionFactor.GetHashCode();
hash = hash * 23 + heightMieDensity.GetHashCode();
hash = hash * 23 + heightMieNearScatterPush.GetHashCode();
hash = hash * 23 + heightNormalDistance.GetHashCode();
hash = hash * 23 + heightPlaneShift.GetHashCode();
hash = hash * 23 + heightRayleighColor.GetHashCode();
hash = hash * 23 + heightRayleighDensity.GetHashCode();
hash = hash * 23 + heightRayleighIntensity.GetHashCode();
hash = hash * 23 + heightRayleighNearScatterPush.GetHashCode();
hash = hash * 23 + heightSeaLevel.GetHashCode();
hash = skyHDRI != null ? hash * 23 + skyHDRI.GetHashCode() : hash;
hash = hash * 23 + worldScaleExponent.GetHashCode();
hash = hash * 23 + maxSkyDistance.GetHashCode();
hash = hash * 23 + debugMode.GetHashCode();
hash = hash * 23 + sunSize.GetHashCode();
hash = hash * 23 + sunSizeConvergence.GetHashCode();
hash = hash * 23 + atmosphereThickness.GetHashCode();
hash = hash * 23 + skyTint.GetHashCode();
hash = hash * 23 + groundColor.GetHashCode();
hash = hash * 23 + multiplier.GetHashCode();
hash = hash * 23 + enableSunDisk.GetHashCode();
}
return hash;

2
ScriptableRenderPipeline/HDRenderPipeline/Sky/ProceduralSky/ProceduralSkySettings.cs.meta


fileFormatVersion: 2
guid: 54bcd1d5cb4984847971142e9444d2fb
guid: 3df29e7cc05fbec4aa43e06ea875565d
timeCreated: 1481631764
licenseType: Pro
MonoImporter:

4
ScriptableRenderPipeline/HDRenderPipeline/Sky/ProceduralSky/Resources.meta


fileFormatVersion: 2
guid: 455c6cbc5c8be404c8ed6ff8b38d1155
guid: 3c4549341d53b5e479e9514d5b0e2a3b
timeCreated: 1481646141
timeCreated: 1481636169
licenseType: Pro
DefaultImporter:
userData:

27
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_StandardSkyboxMaterial = CoreUtils.CreateEngineMaterial(renderPipelinesResources.skyboxCubemap);
m_BlitCubemapMaterial = CoreUtils.CreateEngineMaterial(renderPipelinesResources.blitCubemap);
m_OpaqueAtmScatteringMaterial = CoreUtils.CreateEngineMaterial(renderPipelinesResources.opaqueAtmosphericScattering);
m_CurrentUpdateTime = 0.0f;
}

builtinParams.depthBuffer = BuiltinSkyParameters.nullRT;
CoreUtils.SetRenderTarget(builtinParams.commandBuffer, target, ClearFlag.None, 0, (CubemapFace)i);
m_Renderer.RenderSky(builtinParams, skySettings, true);
m_Renderer.RenderSky(builtinParams, true);
}
// Generate mipmap for our cubemap

}
}
public void RenderSky(HDCamera camera, Light sunLight, RenderTargetIdentifier colorBuffer, RenderTargetIdentifier depthBuffer, CommandBuffer cmd)
public void RenderSky(HDCamera camera, Light sunLight, RenderTargetIdentifier colorBuffer, RenderTargetIdentifier depthBuffer, CommandBuffer cmd, DebugDisplaySettings debugSettings)
// 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, debugSettings.renderingDebugSettings);
m_BuiltinParameters.commandBuffer = cmd;
m_BuiltinParameters.sunLight = sunLight;
m_BuiltinParameters.pixelCoordToViewDirMatrix = ComputePixelCoordToWorldSpaceViewDirectionMatrix(camera.camera.fieldOfView * Mathf.Deg2Rad, camera.screenSize, camera.viewMatrix, false);

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

2
ScriptableRenderPipeline/HDRenderPipeline/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, SkySettings skyParameters, bool renderForCubemap);
public abstract void RenderSky(BuiltinSkyParameters builtinParams, bool renderForCubemap);
public abstract bool IsSkyValid();
}
}

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

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


Shader "Hidden/HDRenderPipeline/Sky/SkyProcedural"
Shader "Hidden/HDRenderPipeline/Sky/SkyBlacksmith"
{
SubShader
{

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

158
SampleScenes/HDTest/Material/HDRenderLoopMaterials/Grid_Planar_Red.mat


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Grid_Planar_Red
m_Shader: {fileID: 4800000, guid: 6e4ae4064600d784cac1e41a9e6f2e59, type: 3}
m_ShaderKeywords: _ALPHACUTOFFENABLE_OFF _DISTORTIONDEPTHTEST_OFF _DISTORTIONENABLE_OFF
_DISTORTIONONLY_OFF _DOUBLESIDED_ON _ENABLEPERPIXELDISPLACEMENT_OFF _ENABLEWIND_OFF
_MAPPING_TRIPLANAR _NORMALMAP_TANGENT_SPACE
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses:
- DistortionVectors
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _AnisotropyMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BaseColorMap:
m_Texture: {fileID: 2800000, guid: fef12d96364197f49b3aac63e72bf9d9, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BentNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BentNormalMapOS:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DistortionVectorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissiveColorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _HeightMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MaskMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _NormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _NormalMapOS:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularColorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularOcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SubsurfaceRadiusMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _TangentMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _TangentMapOS:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ThicknessMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _AlbedoAffectEmissive: 0
- _AlphaCutoff: 0.5
- _AlphaCutoffEnable: 0
- _Anisotropy: 0
- _BlendMode: 0
- _CoatCoverage: 1
- _CoatIOR: 0.5
- _CullMode: 0
- _DepthOffsetEnable: 1
- _DetailAlbedoScale: 1
- _DetailNormalScale: 1
- _DetailSmoothnessScale: 1
- _DistortionDepthTest: 0
- _DistortionEnable: 0
- _DistortionOnly: 0
- _DoubleSidedEnable: 1
- _DoubleSidedNormalMode: 1
- _Drag: 1
- _DstBlend: 0
- _EmissiveColorMode: 1
- _EmissiveIntensity: 0
- _EnablePerPixelDisplacement: 0
- _EnableSpecularOcclusion: 0
- _EnableWind: 0
- _HeightAmplitude: 0.01
- _HeightCenter: 0.5
- _HeightMax: 1
- _HeightMin: -1
- _HorizonFade: 1
- _InitialBend: 1
- _MaterialID: 1
- _Metallic: 0
- _NormalMapSpace: 0
- _NormalScale: 1
- _PPDLodThreshold: 5
- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _ShiverDirectionality: 0.5
- _ShiverDrag: 0.2
- _Smoothness: 0
- _SmoothnessRemapMax: 1
- _SmoothnessRemapMin: 0
- _SrcBlend: 1
- _StencilRef: 2
- _Stiffness: 1
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 1
- _SurfaceType: 0
- _TexWorldScale: 1
- _Thickness: 1
- _UVBase: 5
- _UVDetail: 0
- _ZTestMode: 8
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 1, g: 0, b: 0, a: 1}
- _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0}
- _EmissionColor: {r: 1, g: 1, b: 1, a: 1}
- _EmissiveColor: {r: 0, g: 0, b: 0, a: 1}
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 0, g: 0, b: 0, a: 0}

10
SampleScenes/HDTest/Material/HDRenderLoopMaterials/Grid_Planar_Red.mat.meta


fileFormatVersion: 2
guid: 3e44a0e0df39acd4e81cd6de3719781f
timeCreated: 1504540207
licenseType: Pro
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

10
SampleScenes/HDTest/ShadowsTest.meta


fileFormatVersion: 2
guid: 37b64947bf0ad024fb931d24f17a52b7
folderAsset: yes
timeCreated: 1504864302
licenseType: Pro
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

10
SampleScenes/HDTest/SkyFogTest.meta


fileFormatVersion: 2
guid: 2154938a6af2f324990e61b493a65c15
folderAsset: yes
timeCreated: 1507624145
licenseType: Pro
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

1001
SampleScenes/HDTest/SkyFogTest.unity
文件差异内容过多而无法显示
查看文件

9
SampleScenes/HDTest/SkyFogTest.unity.meta


fileFormatVersion: 2
guid: c8035f90c465bcc49b6a194bf4a62860
timeCreated: 1507624085
licenseType: Pro
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

10
ScriptableRenderPipeline/HDRenderPipeline/Sky/AtmosphericScattering.meta


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

9
ScriptableRenderPipeline/HDRenderPipeline/Sky/BlacksmithlSky.meta


fileFormatVersion: 2
guid: 65f9231eb40b6914eb24ea0b555778f0
folderAsset: yes
timeCreated: 1481646017
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

10
ScriptableRenderPipeline/HDRenderPipeline/Sky/Editor.meta


fileFormatVersion: 2
guid: 09f0f3359d1afd440a042038fa83eccb
folderAsset: yes
timeCreated: 1507627712
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:

313
ScriptableRenderPipeline/HDRenderPipeline/Sky/ProceduralSky/Resources/ProceduralSky.shader


// ==================================================================================================
// This shader is a copy of sky-procedural available in legacy Unity
// It's been ported to HDRP in order to have a basic procedural sky
// It has been left mostly untouched but has been adapted to run per-pixel instead of per vertex
// ==================================================================================================
Shader "Hidden/HDRenderPipeline/Sky/SkyProcedural"
{
HLSLINCLUDE
#pragma vertex Vert
#pragma fragment Frag
#pragma target 4.5
#pragma only_renderers d3d11 ps4 metal // TEMP: until we go further in dev
#pragma multi_compile _ _ENABLE_SUN_DISK
#include "../../../../Core/ShaderLibrary/Color.hlsl"
#include "../../../../Core/ShaderLibrary/Common.hlsl"
#include "../../../../Core/ShaderLibrary/CommonLighting.hlsl"
float4 _SkyParam; // x exposure, y multiplier, z rotation
float4x4 _PixelCoordToViewDirWS; // Actually just 3x3, but Unity can only set 4x4
float _SunSize;
float _SunSizeConvergence;
float _AtmosphereThickness;
float4 _SkyTint;
float4 _GroundColor;
float4 _SunColor;
float3 _SunDirection;
struct Attributes
{
uint vertexID : SV_VertexID;
};
struct Varyings
{
float4 positionCS : SV_POSITION;
};
Varyings Vert(Attributes input)
{
Varyings output;
output.positionCS = GetFullScreenTriangleVertexPosition(input.vertexID, UNITY_RAW_FAR_CLIP_VALUE);
return output;
}
// RGB wavelengths
// .35 (.62=158), .43 (.68=174), .525 (.75=190)
static const float3 kDefaultScatteringWavelength = float3(.65, .57, .475);
static const float3 kVariableRangeForScatteringWavelength = float3(.15, .15, .15);
#define OUTER_RADIUS 1.025
static const float kOuterRadius = OUTER_RADIUS;
static const float kOuterRadius2 = OUTER_RADIUS*OUTER_RADIUS;
static const float kInnerRadius = 1.0;
static const float kInnerRadius2 = 1.0;
static const float kCameraHeight = 0.0001;
#define kRAYLEIGH (lerp(0.0, 0.0025, pow(_AtmosphereThickness,2.5))) // Rayleigh constant
#define kMIE 0.0010 // Mie constant
#define kSUN_BRIGHTNESS 20.0 // Sun brightness
#define kMAX_SCATTER 50.0 // Maximum scattering value, to prevent math overflows on Adrenos
static const float kHDSundiskIntensityFactor = 15.0;
static const float kSimpleSundiskIntensityFactor = 27.0;
static const float kSunScale = 400.0 * kSUN_BRIGHTNESS;
static const float kKmESun = kMIE * kSUN_BRIGHTNESS;
static const float kKm4PI = kMIE * 4.0 * 3.14159265;
static const float kScale = 1.0 / (OUTER_RADIUS - 1.0);
static const float kScaleDepth = 0.25;
static const float kScaleOverScaleDepth = (1.0 / (OUTER_RADIUS - 1.0)) / 0.25;
static const float kSamples = 2.0; // THIS IS UNROLLED MANUALLY, DON'T TOUCH
#define MIE_G (-0.990)
#define MIE_G2 0.9801
#define SKY_GROUND_THRESHOLD 0.02
// Calculates the Rayleigh phase function
float getRayleighPhase(float eyeCos2)
{
return 0.75 + 0.75*eyeCos2;
}
float getRayleighPhase(float3 light, float3 ray)
{
float eyeCos = dot(light, ray);
return getRayleighPhase(eyeCos * eyeCos);
}
float scale(float inCos)
{
float x = 1.0 - inCos;
return 0.25 * exp(-0.00287 + x*(0.459 + x*(3.83 + x*(-6.80 + x*5.25))));
}
// Calculates the Mie phase function
float getMiePhase(float eyeCos, float eyeCos2)
{
float temp = 1.0 + MIE_G2 - 2.0 * MIE_G * eyeCos;
temp = pow(max(temp, 0), pow(_SunSize,0.65) * 10);
temp = max(temp,1.0e-4); // prevent division by zero, esp. in float precision
temp = 1.5 * ((1.0 - MIE_G2) / (2.0 + MIE_G2)) * (1.0 + eyeCos2) / temp;
#if defined(UNITY_COLORSPACE_GAMMA) && SKYBOX_COLOR_IN_TARGET_COLOR_SPACE
temp = pow(temp, .454545);
#endif
return temp;
}
// Calculates the sun shape
float calcSunAttenuation(float3 lightPos, float3 ray)
{
float focusedEyeCos = pow(saturate(dot(lightPos, ray)), _SunSizeConvergence);
return getMiePhase(-focusedEyeCos, focusedEyeCos * focusedEyeCos);
}
float4 Frag(Varyings input) : SV_Target
{
// Points towards the camera
float3 viewDirWS = normalize(mul(float3(input.positionCS.xy, 1.0), (float3x3)_PixelCoordToViewDirWS));
// Reverse it to point into the scene
float3 dir = -viewDirWS;
// Rotate direction
float phi = DegToRad(_SkyParam.z);
float cosPhi, sinPhi;
sincos(phi, sinPhi, cosPhi);
float3 rotDirX = float3(cosPhi, 0, -sinPhi);
float3 rotDirY = float3(sinPhi, 0, cosPhi);
dir = float3(dot(rotDirX, dir), dir.y, dot(rotDirY, dir));
float3 kScatteringWavelength = lerp (
kDefaultScatteringWavelength-kVariableRangeForScatteringWavelength,
kDefaultScatteringWavelength+kVariableRangeForScatteringWavelength,
float3(1,1,1) - _SkyTint); // using Tint in sRGB gamma allows for more visually linear interpolation and to keep (.5) at (128, gray in sRGB) point
float3 kInvWavelength = 1.0 / pow(kScatteringWavelength, 4);
float kKrESun = kRAYLEIGH * kSUN_BRIGHTNESS;
float kKr4PI = kRAYLEIGH * 4.0 * 3.14159265;
float3 cameraPos = float3(0,kInnerRadius + kCameraHeight,0); // The camera's current position
// Get the ray from the camera to the vertex and its length (which is the far point of the ray passing through the atmosphere)
float3 eyeRay = dir; // normalize(mul((float3x3)unity_ObjectToWorld, v.vertex.xyz));
float far = 0.0;
float3 cIn = float3(0.0, 0.0, 0.0);
float3 cOut = float3(0.0, 0.0, 0.0);
float3 groundColor = float3(0.0, 0.0, 0.0);
float3 skyColor = float3(0.0, 0.0, 0.0);
// Modification for per-pixel procedural sky:
// Contrary to the legacy version that is run per-vertex, this version is per pixel.
// The fact that it was run per-vertex means that the colors were never computed at the horizon.
// Now that it's per vertex, we reach the limitation of the computation at the horizon where a very bright line appears.
// To avoid that, we clampe the height of the eye ray just above and below the horizon for sky and ground respectively.
// Another modification to make this work was to add ground and sky contribution instead of lerping between them.
// For this to work we also needed to change slightly the computation so that cIn and cOut factor computed for the sky did not affect ground and vice versa (it was the case before) so that we can add both contribution without adding energy
float horizonThreshold = 0.02;
if(eyeRay.y >= 0.0)
{
float3 clampedEyeRay = eyeRay;
clampedEyeRay.y = max(clampedEyeRay.y, horizonThreshold);
// Sky
// Calculate the length of the "atmosphere"
far = sqrt(kOuterRadius2 + kInnerRadius2 * clampedEyeRay.y * clampedEyeRay.y - kInnerRadius2) - kInnerRadius * clampedEyeRay.y;
float3 pos = cameraPos + far * clampedEyeRay;
// Calculate the ray's starting position, then calculate its scattering offset
float height = kInnerRadius + kCameraHeight;
float depth = exp(kScaleOverScaleDepth * (-kCameraHeight));
float startAngle = dot(clampedEyeRay, cameraPos) / height;
float startOffset = depth*scale(startAngle);
// Initialize the scattering loop variables
float sampleLength = far / kSamples;
float scaledLength = sampleLength * kScale;
float3 sampleRay = clampedEyeRay * sampleLength;
float3 samplePoint = cameraPos + sampleRay * 0.5;
// Now loop through the sample rays
float3 frontColor = float3(0.0, 0.0, 0.0);
for(int i=0; i<int(kSamples); i++)
{
float sampleHeight = length(samplePoint);
float sampleDepth = exp(kScaleOverScaleDepth * (kInnerRadius - sampleHeight));
float lightAngle = dot(_SunDirection.xyz, samplePoint) / sampleHeight;
float cameraAngle = dot(clampedEyeRay, samplePoint) / sampleHeight;
float scatter = (startOffset + sampleDepth*(scale(lightAngle) - scale(cameraAngle)));
float3 attenuate = exp(-clamp(scatter, 0.0, kMAX_SCATTER) * (kInvWavelength * kKr4PI + kKm4PI));
frontColor += attenuate * (sampleDepth * scaledLength);
samplePoint += sampleRay;
}
// Finally, scale the Mie and Rayleigh colors and set up the varying variables for the pixel shader
cIn = frontColor * (kInvWavelength * kKrESun);
cOut = frontColor * kKmESun;
skyColor = _SkyParam.y * (cIn * getRayleighPhase(_SunDirection.xyz, -eyeRay));
}
else
{
float3 clampedEyeRay = eyeRay;
clampedEyeRay.y = min(clampedEyeRay.y, -horizonThreshold);
// Ground
far = (-kCameraHeight) / (min(-0.001, clampedEyeRay.y));
float3 pos = cameraPos + far * clampedEyeRay;
// Calculate the ray's starting position, then calculate its scattering offset
float depth = exp((-kCameraHeight) * (1.0/kScaleDepth));
float cameraAngle = dot(-clampedEyeRay, pos);
float lightAngle = dot(_SunDirection.xyz, pos);
float cameraScale = scale(cameraAngle);
float lightScale = scale(lightAngle);
float cameraOffset = depth*cameraScale;
float temp = (lightScale + cameraScale);
// Initialize the scattering loop variables
float sampleLength = far / kSamples;
float scaledLength = sampleLength * kScale;
float3 sampleRay = clampedEyeRay * sampleLength;
float3 samplePoint = cameraPos + sampleRay * 0.5;
// Now loop through the sample rays
float3 frontColor = float3(0.0, 0.0, 0.0);
float3 attenuate;
{
float sampleHeight = length(samplePoint);
float sampleDepth = exp(kScaleOverScaleDepth * (kInnerRadius - sampleHeight));
float scatter = sampleDepth*temp - cameraOffset;
attenuate = exp(-clamp(scatter, 0.0, kMAX_SCATTER) * (kInvWavelength * kKr4PI + kKm4PI));
frontColor += attenuate * (sampleDepth * scaledLength);
samplePoint += sampleRay;
}
cIn = frontColor * (kInvWavelength * kKrESun + kKmESun);
cOut = clamp(attenuate, 0.0, 1.0);
groundColor = _SkyParam.y * (cIn + _GroundColor * _GroundColor * cOut);
}
float3 sunColor = float3(0.0, 0.0, 0.0);
#if _ENABLE_SUN_DISK
// The sun should have a stable intensity in its course in the sky. Moreover it should match the highlight of a purely specular material.
// This matching was done using the standard shader BRDF1 on the 5/31/2017
// Finally we want the sun to be always bright even in LDR thus the normalization of the lightColor for low intensity.
float lightColorIntensity = clamp(length(_SunColor.xyz), 0.25, 1);
sunColor = kHDSundiskIntensityFactor * saturate(cOut) * _SunColor.xyz / lightColorIntensity;
#endif
float3 col = float3(0.0, 0.0, 0.0);
// if y > 1 [eyeRay.y < -SKY_GROUND_THRESHOLD] - ground
// if y >= 0 and < 1 [eyeRay.y <= 0 and > -SKY_GROUND_THRESHOLD] - horizon
// if y < 0 [eyeRay.y > 0] - sky
float y = -eyeRay.y / SKY_GROUND_THRESHOLD;
col = groundColor + skyColor;
#if _ENABLE_SUN_DISK
if(y < 0.0)
{
col += sunColor * calcSunAttenuation(_SunDirection.xyz, eyeRay);
}
#endif
return float4(col * exp2(_SkyParam.x), 1.0);
}
ENDHLSL
SubShader
{
Pass
{
ZWrite Off
ZTest Always
Blend Off
Cull Off
HLSLPROGRAM
ENDHLSL
}
Pass
{
ZWrite Off
ZTest LEqual
Blend Off
Cull Off
HLSLPROGRAM
ENDHLSL
}
}
Fallback Off
}

9
ScriptableRenderPipeline/HDRenderPipeline/Sky/ProceduralSky/Resources/ProceduralSky.shader.meta


fileFormatVersion: 2
guid: ec63f47fd265df243a7b1d40f9ef7fe7
timeCreated: 1479239909
licenseType: Pro
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:

21
ScriptableRenderPipeline/HDRenderPipeline/Sky/SkyVariables.hlsl


#ifndef UNITY_SKY_VARIABLES_INCLUDED
#define UNITY_SKY_VARIABLES_INCLUDED
TEXTURECUBE(_SkyTexture);
SAMPLERCUBE(sampler_SkyTexture); // NOTE: Sampler could be share here with _EnvTextures. Don't know if the shader compiler will complain...
CBUFFER_START(SkyParameters)
float _SkyTextureMipCount;
CBUFFER_END
float4 SampleSkyTexture(float3 texCoord)
{
return SAMPLE_TEXTURECUBE(_SkyTexture, sampler_SkyTexture, texCoord);
}
float4 SampleSkyTexture(float3 texCoord, float lod)
{
return SAMPLE_TEXTURECUBE_LOD(_SkyTexture, sampler_SkyTexture, texCoord, lod);
}
#endif

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


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

32
SampleScenes/HDTest/SkyFogTest/SkyFogHDRISky.asset


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 59b6606ef2548734bb6d11b9d160bc7e, type: 3}
m_Name: SkyFogHDRISky
m_EditorClassIdentifier:
rotation: 16
exposure: 0
multiplier: 1
resolution: 256
updateMode: 0
updatePeriod: 0
lightingOverride: {fileID: 0}
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}

10
SampleScenes/HDTest/SkyFogTest/SkyFogHDRISky.asset.meta


fileFormatVersion: 2
guid: 2647470268f148548bb957878139fc56
timeCreated: 1507624166
licenseType: Pro
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

10
SampleScenes/HDTest/SkyFogTest/SkyFogProceduralSky.asset.meta


fileFormatVersion: 2
guid: 7d119d7ec4e5e964d92d40232696fa43
timeCreated: 1507634536
licenseType: Pro
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

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
SampleScenes/HDTest/SkyFogTest/Lit_Transparent_Add.mat.meta


fileFormatVersion: 2
guid: d568642ed8e35324eb77c0d67841dea6
timeCreated: 1507906791
licenseType: Pro
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

10
SampleScenes/HDTest/SkyFogTest/Lit_Transparent_Add_NoFog.mat.meta


fileFormatVersion: 2
guid: 002211a18f5e53146be4913325a252a1
timeCreated: 1507906791
licenseType: Pro
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

10
SampleScenes/HDTest/SkyFogTest/Lit_Transparent_Multiply.mat.meta


fileFormatVersion: 2
guid: 42c1c0c87247d1046a23e8416bc86732
timeCreated: 1507906791
licenseType: Pro
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

10
SampleScenes/HDTest/SkyFogTest/Lit_Transparent_PreMultipliedAlpha.mat.meta


fileFormatVersion: 2
guid: 76c2b429b4669d041a48320bce001214
timeCreated: 1507906791
licenseType: Pro
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

10
SampleScenes/HDTest/SkyFogTest/Unlit_Transparent_Add.mat.meta


fileFormatVersion: 2
guid: 52399ac40c3d96c4190db612dd4bf01e
timeCreated: 1507906791
licenseType: Pro
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

10
SampleScenes/HDTest/SkyFogTest/Unlit_Transparent_Add_NoFog.mat.meta


fileFormatVersion: 2
guid: f24dfa286700689408ca369a67aecf0b
timeCreated: 1507906791
licenseType: Pro
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

10
SampleScenes/HDTest/SkyFogTest/Unlit_Transparent_Multiply.mat.meta


fileFormatVersion: 2
guid: 34176682b0b560a49b3bcee3894f36a0
timeCreated: 1507906791
licenseType: Pro
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

10
SampleScenes/HDTest/SkyFogTest/Unlit_Transparent_PreMultipliedAlpha.mat.meta


fileFormatVersion: 2
guid: 8dd3404cfeb7d08469dbd63457dc71a6
timeCreated: 1507906791
licenseType: Pro
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

181
SampleScenes/HDTest/SkyFogTest/Lit_Transparent_Add.mat


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Lit_Transparent_Add
m_Shader: {fileID: 4800000, guid: 6e4ae4064600d784cac1e41a9e6f2e59, type: 3}
m_ShaderKeywords: _ALBEDOAFFECTEMISSIVE_OFF _ALPHACUTOFFENABLE_OFF _BLENDMODE_ADD
_DEPTHOFFSETENABLE_OFF _DISTORTIONDEPTHTEST_OFF _DISTORTIONENABLE_OFF _DISTORTIONONLY_OFF
_DOUBLESIDEDENABLE_OFF _ENABLEPERPIXELDISPLACEMENT_OFF _ENABLESPECULAROCCLUSION_OFF
_ENABLEVERTEXDISPLACEMENT_OFF _ENABLEWIND_OFF _ENABLE_FOG _NORMALMAP_TANGENT_SPACE
_PREREFRACTIONPASS_OFF
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: 3000
stringTagMap:
RenderType: Transparent
disabledShaderPasses:
- DistortionVectors
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _AnisotropyMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BaseColorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BentNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BentNormalMapOS:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DistortionVectorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissiveColorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _HeightMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MaskMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _NormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _NormalMapOS:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularColorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SubsurfaceRadiusMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _TangentMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _TangentMapOS:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ThicknessMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _ATDistance: 1
- _AlbedoAffectEmissive: 0
- _AlphaCutoff: 0.5
- _AlphaCutoffEnable: 0
- _Anisotropy: 0
- _BlendMode: 1
- _CoatCoverage: 1
- _CoatIOR: 0.5
- _CullMode: 2
- _DepthOffsetEnable: 0
- _DetailAlbedoScale: 1
- _DetailNormalScale: 1
- _DetailSmoothnessScale: 1
- _DisplacementLockObjectScale: 1
- _DisplacementLockTilingScale: 1
- _DisplacementMode: 0
- _DistortionBlendMode: 0
- _DistortionBlurBlendMode: 0
- _DistortionBlurDstBlend: 1
- _DistortionBlurRemapMax: 1
- _DistortionBlurRemapMin: 0
- _DistortionBlurScale: 1
- _DistortionBlurSrcBlend: 1
- _DistortionDepthTest: 0
- _DistortionDstBlend: 1
- _DistortionEnable: 0
- _DistortionOnly: 0
- _DistortionScale: 1
- _DistortionSrcBlend: 1
- _DoubleSidedEnable: 0
- _DoubleSidedNormalMode: 1
- _Drag: 1
- _DstBlend: 1
- _EmissiveColorMode: 1
- _EmissiveIntensity: 0
- _EnableFog: 1
- _EnablePerPixelDisplacement: 0
- _EnableSpecularOcclusion: 0
- _EnableVertexDisplacement: 0
- _EnableWind: 0
- _HeightAmplitude: 0.01
- _HeightCenter: 0.5
- _HeightMax: 1
- _HeightMin: -1
- _IOR: 1
- _InitialBend: 1
- _InvTilingScale: 1
- _LinkDetailsWithBase: 1
- _MaterialID: 1
- _Metallic: 0
- _NormalMapSpace: 0
- _NormalScale: 1
- _PPDLodThreshold: 5
- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _PPDPrimitiveLength: 1
- _PPDPrimitiveWidth: 1
- _PerPixelDisplacementObjectScale: 1
- _PreRefractionPass: 0
- _RefractionMode: 0
- _ShiverDirectionality: 0.5
- _ShiverDrag: 0.2
- _Smoothness: 1
- _SmoothnessRemapMax: 1
- _SmoothnessRemapMin: 0
- _SrcBlend: 1
- _StencilRef: 2
- _Stiffness: 1
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 1
- _SurfaceType: 1
- _TexWorldScale: 1
- _Thickness: 1
- _ThicknessMultiplier: 1
- _UVBase: 0
- _UVDetail: 0
- _VertexDisplacementObjectScale: 1
- _VertexDisplacementTilingScale: 1
- _ZTestMode: 8
- _ZWrite: 0
m_Colors:
- _BaseColor: {r: 1, g: 0, b: 0, a: 0.741}
- _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0}
- _EmissionColor: {r: 1, g: 1, b: 1, a: 1}
- _EmissiveColor: {r: 0, g: 0, b: 0, a: 1}
- _InvPrimScale: {r: 1, g: 1, b: 0, a: 0}
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1}
- _TransmittanceColor: {r: 1, g: 1, b: 1, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

180
SampleScenes/HDTest/SkyFogTest/Lit_Transparent_Add_NoFog.mat


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Lit_Transparent_Add_NoFog
m_Shader: {fileID: 4800000, guid: 6e4ae4064600d784cac1e41a9e6f2e59, type: 3}
m_ShaderKeywords: _ALBEDOAFFECTEMISSIVE_OFF _ALPHACUTOFFENABLE_OFF _BLENDMODE_ADD
_DEPTHOFFSETENABLE_OFF _DISTORTIONDEPTHTEST_OFF _DISTORTIONENABLE_OFF _DISTORTIONONLY_OFF
_DOUBLESIDEDENABLE_OFF _ENABLEFOG_OFF _ENABLEPERPIXELDISPLACEMENT_OFF _ENABLESPECULAROCCLUSION_OFF
_ENABLEVERTEXDISPLACEMENT_OFF _ENABLEWIND_OFF _NORMALMAP_TANGENT_SPACE _PREREFRACTIONPASS_OFF
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: 3000
stringTagMap:
RenderType: Transparent
disabledShaderPasses:
- DistortionVectors
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _AnisotropyMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BaseColorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BentNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BentNormalMapOS:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DistortionVectorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissiveColorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _HeightMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MaskMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _NormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _NormalMapOS:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularColorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SubsurfaceRadiusMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _TangentMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _TangentMapOS:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ThicknessMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _ATDistance: 1
- _AlbedoAffectEmissive: 0
- _AlphaCutoff: 0.5
- _AlphaCutoffEnable: 0
- _Anisotropy: 0
- _BlendMode: 1
- _CoatCoverage: 1
- _CoatIOR: 0.5
- _CullMode: 2
- _DepthOffsetEnable: 0
- _DetailAlbedoScale: 1
- _DetailNormalScale: 1
- _DetailSmoothnessScale: 1
- _DisplacementLockObjectScale: 1
- _DisplacementLockTilingScale: 1
- _DisplacementMode: 0
- _DistortionBlendMode: 0
- _DistortionBlurBlendMode: 0
- _DistortionBlurDstBlend: 1
- _DistortionBlurRemapMax: 1
- _DistortionBlurRemapMin: 0
- _DistortionBlurScale: 1
- _DistortionBlurSrcBlend: 1
- _DistortionDepthTest: 0
- _DistortionDstBlend: 1
- _DistortionEnable: 0
- _DistortionOnly: 0
- _DistortionScale: 1
- _DistortionSrcBlend: 1
- _DoubleSidedEnable: 0
- _DoubleSidedNormalMode: 1
- _Drag: 1
- _DstBlend: 1
- _EmissiveColorMode: 1
- _EmissiveIntensity: 0
- _EnableFog: 0
- _EnablePerPixelDisplacement: 0
- _EnableSpecularOcclusion: 0
- _EnableVertexDisplacement: 0
- _EnableWind: 0
- _HeightAmplitude: 0.01
- _HeightCenter: 0.5
- _HeightMax: 1
- _HeightMin: -1
- _IOR: 1
- _InitialBend: 1
- _InvTilingScale: 1
- _LinkDetailsWithBase: 1
- _MaterialID: 1
- _Metallic: 0
- _NormalMapSpace: 0
- _NormalScale: 1
- _PPDLodThreshold: 5
- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _PPDPrimitiveLength: 1
- _PPDPrimitiveWidth: 1
- _PerPixelDisplacementObjectScale: 1
- _PreRefractionPass: 0
- _RefractionMode: 0
- _ShiverDirectionality: 0.5
- _ShiverDrag: 0.2
- _Smoothness: 1
- _SmoothnessRemapMax: 1
- _SmoothnessRemapMin: 0
- _SrcBlend: 1
- _StencilRef: 2
- _Stiffness: 1
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 1
- _SurfaceType: 1
- _TexWorldScale: 1
- _Thickness: 1
- _ThicknessMultiplier: 1
- _UVBase: 0
- _UVDetail: 0
- _VertexDisplacementObjectScale: 1
- _VertexDisplacementTilingScale: 1
- _ZTestMode: 8
- _ZWrite: 0
m_Colors:
- _BaseColor: {r: 1, g: 0, b: 0, a: 0.741}
- _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0}
- _EmissionColor: {r: 1, g: 1, b: 1, a: 1}
- _EmissiveColor: {r: 0, g: 0, b: 0, a: 1}
- _InvPrimScale: {r: 1, g: 1, b: 0, a: 0}
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1}
- _TransmittanceColor: {r: 1, g: 1, b: 1, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

181
SampleScenes/HDTest/SkyFogTest/Lit_Transparent_Alpha.mat


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Lit_Transparent_Alpha
m_Shader: {fileID: 4800000, guid: 6e4ae4064600d784cac1e41a9e6f2e59, type: 3}
m_ShaderKeywords: _ALBEDOAFFECTEMISSIVE_OFF _ALPHACUTOFFENABLE_OFF _BLENDMODE_ALPHA
_BLENDMODE_LERP _DEPTHOFFSETENABLE_OFF _DISTORTIONDEPTHTEST_OFF _DISTORTIONENABLE_OFF
_DISTORTIONONLY_OFF _DOUBLESIDEDENABLE_OFF _ENABLEPERPIXELDISPLACEMENT_OFF _ENABLESPECULAROCCLUSION_OFF
_ENABLEVERTEXDISPLACEMENT_OFF _ENABLEWIND_OFF _ENABLE_FOG _NORMALMAP_TANGENT_SPACE
_PREREFRACTIONPASS_OFF
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: 3000
stringTagMap:
RenderType: Transparent
disabledShaderPasses:
- DistortionVectors
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _AnisotropyMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BaseColorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BentNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BentNormalMapOS:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DistortionVectorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissiveColorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _HeightMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MaskMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _NormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _NormalMapOS:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularColorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SubsurfaceRadiusMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _TangentMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _TangentMapOS:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ThicknessMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _ATDistance: 1
- _AlbedoAffectEmissive: 0
- _AlphaCutoff: 0.5
- _AlphaCutoffEnable: 0
- _Anisotropy: 0
- _BlendMode: 0
- _CoatCoverage: 1
- _CoatIOR: 0.5
- _CullMode: 2
- _DepthOffsetEnable: 0
- _DetailAlbedoScale: 1
- _DetailNormalScale: 1
- _DetailSmoothnessScale: 1
- _DisplacementLockObjectScale: 1
- _DisplacementLockTilingScale: 1
- _DisplacementMode: 0
- _DistortionBlendMode: 0
- _DistortionBlurBlendMode: 0
- _DistortionBlurDstBlend: 1
- _DistortionBlurRemapMax: 1
- _DistortionBlurRemapMin: 0
- _DistortionBlurScale: 1
- _DistortionBlurSrcBlend: 1
- _DistortionDepthTest: 0
- _DistortionDstBlend: 1
- _DistortionEnable: 0
- _DistortionOnly: 0
- _DistortionScale: 1
- _DistortionSrcBlend: 1
- _DoubleSidedEnable: 0
- _DoubleSidedNormalMode: 1
- _Drag: 1
- _DstBlend: 10
- _EmissiveColorMode: 1
- _EmissiveIntensity: 0
- _EnableFog: 1
- _EnablePerPixelDisplacement: 0
- _EnableSpecularOcclusion: 0
- _EnableVertexDisplacement: 0
- _EnableWind: 0
- _HeightAmplitude: 0.01
- _HeightCenter: 0.5
- _HeightMax: 1
- _HeightMin: -1
- _IOR: 1
- _InitialBend: 1
- _InvTilingScale: 1
- _LinkDetailsWithBase: 1
- _MaterialID: 1
- _Metallic: 0
- _NormalMapSpace: 0
- _NormalScale: 1
- _PPDLodThreshold: 5
- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _PPDPrimitiveLength: 1
- _PPDPrimitiveWidth: 1
- _PerPixelDisplacementObjectScale: 1
- _PreRefractionPass: 0
- _RefractionMode: 0
- _ShiverDirectionality: 0.5
- _ShiverDrag: 0.2
- _Smoothness: 1
- _SmoothnessRemapMax: 1
- _SmoothnessRemapMin: 0
- _SrcBlend: 5
- _StencilRef: 2
- _Stiffness: 1
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 1
- _SurfaceType: 1
- _TexWorldScale: 1
- _Thickness: 1
- _ThicknessMultiplier: 1
- _UVBase: 0
- _UVDetail: 0
- _VertexDisplacementObjectScale: 1
- _VertexDisplacementTilingScale: 1
- _ZTestMode: 8
- _ZWrite: 0
m_Colors:
- _BaseColor: {r: 1, g: 0, b: 0, a: 0.741}
- _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0}
- _EmissionColor: {r: 1, g: 1, b: 1, a: 1}
- _EmissiveColor: {r: 0, g: 0, b: 0, a: 1}
- _InvPrimScale: {r: 1, g: 1, b: 0, a: 0}
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1}
- _TransmittanceColor: {r: 1, g: 1, b: 1, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

181
SampleScenes/HDTest/SkyFogTest/Lit_Transparent_Multiply.mat


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Lit_Transparent_Multiply
m_Shader: {fileID: 4800000, guid: 6e4ae4064600d784cac1e41a9e6f2e59, type: 3}
m_ShaderKeywords: _ALBEDOAFFECTEMISSIVE_OFF _ALPHACUTOFFENABLE_OFF _BLENDMODE_MULTIPLY
_DEPTHOFFSETENABLE_OFF _DISTORTIONDEPTHTEST_OFF _DISTORTIONENABLE_OFF _DISTORTIONONLY_OFF
_DOUBLESIDEDENABLE_OFF _ENABLEPERPIXELDISPLACEMENT_OFF _ENABLESPECULAROCCLUSION_OFF
_ENABLEVERTEXDISPLACEMENT_OFF _ENABLEWIND_OFF _ENABLE_FOG _NORMALMAP_TANGENT_SPACE
_PREREFRACTIONPASS_OFF
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: 3000
stringTagMap:
RenderType: Transparent
disabledShaderPasses:
- DistortionVectors
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _AnisotropyMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BaseColorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BentNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BentNormalMapOS:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DistortionVectorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissiveColorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _HeightMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MaskMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _NormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _NormalMapOS:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularColorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SubsurfaceRadiusMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _TangentMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _TangentMapOS:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ThicknessMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _ATDistance: 1
- _AlbedoAffectEmissive: 0
- _AlphaCutoff: 0.5
- _AlphaCutoffEnable: 0
- _Anisotropy: 0
- _BlendMode: 3
- _CoatCoverage: 1
- _CoatIOR: 0.5
- _CullMode: 2
- _DepthOffsetEnable: 0
- _DetailAlbedoScale: 1
- _DetailNormalScale: 1
- _DetailSmoothnessScale: 1
- _DisplacementLockObjectScale: 1
- _DisplacementLockTilingScale: 1
- _DisplacementMode: 0
- _DistortionBlendMode: 0
- _DistortionBlurBlendMode: 0
- _DistortionBlurDstBlend: 1
- _DistortionBlurRemapMax: 1
- _DistortionBlurRemapMin: 0
- _DistortionBlurScale: 1
- _DistortionBlurSrcBlend: 1
- _DistortionDepthTest: 0
- _DistortionDstBlend: 1
- _DistortionEnable: 0
- _DistortionOnly: 0
- _DistortionScale: 1
- _DistortionSrcBlend: 1
- _DoubleSidedEnable: 0
- _DoubleSidedNormalMode: 1
- _Drag: 1
- _DstBlend: 0
- _EmissiveColorMode: 1
- _EmissiveIntensity: 0
- _EnableFog: 1
- _EnablePerPixelDisplacement: 0
- _EnableSpecularOcclusion: 0
- _EnableVertexDisplacement: 0
- _EnableWind: 0
- _HeightAmplitude: 0.01
- _HeightCenter: 0.5
- _HeightMax: 1
- _HeightMin: -1
- _IOR: 1
- _InitialBend: 1
- _InvTilingScale: 1
- _LinkDetailsWithBase: 1
- _MaterialID: 1
- _Metallic: 0
- _NormalMapSpace: 0
- _NormalScale: 1
- _PPDLodThreshold: 5
- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _PPDPrimitiveLength: 1
- _PPDPrimitiveWidth: 1
- _PerPixelDisplacementObjectScale: 1
- _PreRefractionPass: 0
- _RefractionMode: 0
- _ShiverDirectionality: 0.5
- _ShiverDrag: 0.2
- _Smoothness: 1
- _SmoothnessRemapMax: 1
- _SmoothnessRemapMin: 0
- _SrcBlend: 2
- _StencilRef: 2
- _Stiffness: 1
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 1
- _SurfaceType: 1
- _TexWorldScale: 1
- _Thickness: 1
- _ThicknessMultiplier: 1
- _UVBase: 0
- _UVDetail: 0
- _VertexDisplacementObjectScale: 1
- _VertexDisplacementTilingScale: 1
- _ZTestMode: 8
- _ZWrite: 0
m_Colors:
- _BaseColor: {r: 1, g: 0, b: 0, a: 0.741}
- _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0}
- _EmissionColor: {r: 1, g: 1, b: 1, a: 1}
- _EmissiveColor: {r: 0, g: 0, b: 0, a: 1}
- _InvPrimScale: {r: 1, g: 1, b: 0, a: 0}
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1}
- _TransmittanceColor: {r: 1, g: 1, b: 1, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

181
SampleScenes/HDTest/SkyFogTest/Lit_Transparent_PreMultipliedAlpha.mat


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Lit_Transparent_PreMultipliedAlpha
m_Shader: {fileID: 4800000, guid: 6e4ae4064600d784cac1e41a9e6f2e59, type: 3}
m_ShaderKeywords: _ALBEDOAFFECTEMISSIVE_OFF _ALPHACUTOFFENABLE_OFF _BLENDMODE_PRE_MULTIPLY
_DEPTHOFFSETENABLE_OFF _DISTORTIONDEPTHTEST_OFF _DISTORTIONENABLE_OFF _DISTORTIONONLY_OFF
_DOUBLESIDEDENABLE_OFF _ENABLEPERPIXELDISPLACEMENT_OFF _ENABLESPECULAROCCLUSION_OFF
_ENABLEVERTEXDISPLACEMENT_OFF _ENABLEWIND_OFF _ENABLE_FOG _NORMALMAP_TANGENT_SPACE
_PREREFRACTIONPASS_OFF
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: 3000
stringTagMap:
RenderType: Transparent
disabledShaderPasses:
- DistortionVectors
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _AnisotropyMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BaseColorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BentNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BentNormalMapOS:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DistortionVectorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissiveColorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _HeightMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MaskMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _NormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _NormalMapOS:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularColorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SubsurfaceRadiusMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _TangentMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _TangentMapOS:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ThicknessMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _ATDistance: 1
- _AlbedoAffectEmissive: 0
- _AlphaCutoff: 0.5
- _AlphaCutoffEnable: 0
- _Anisotropy: 0
- _BlendMode: 4
- _CoatCoverage: 1
- _CoatIOR: 0.5
- _CullMode: 2
- _DepthOffsetEnable: 0
- _DetailAlbedoScale: 1
- _DetailNormalScale: 1
- _DetailSmoothnessScale: 1
- _DisplacementLockObjectScale: 1
- _DisplacementLockTilingScale: 1
- _DisplacementMode: 0
- _DistortionBlendMode: 0
- _DistortionBlurBlendMode: 0
- _DistortionBlurDstBlend: 1
- _DistortionBlurRemapMax: 1
- _DistortionBlurRemapMin: 0
- _DistortionBlurScale: 1
- _DistortionBlurSrcBlend: 1
- _DistortionDepthTest: 0
- _DistortionDstBlend: 1
- _DistortionEnable: 0
- _DistortionOnly: 0
- _DistortionScale: 1
- _DistortionSrcBlend: 1
- _DoubleSidedEnable: 0
- _DoubleSidedNormalMode: 1
- _Drag: 1
- _DstBlend: 10
- _EmissiveColorMode: 1
- _EmissiveIntensity: 0
- _EnableFog: 1
- _EnablePerPixelDisplacement: 0
- _EnableSpecularOcclusion: 0
- _EnableVertexDisplacement: 0
- _EnableWind: 0
- _HeightAmplitude: 0.01
- _HeightCenter: 0.5
- _HeightMax: 1
- _HeightMin: -1
- _IOR: 1
- _InitialBend: 1
- _InvTilingScale: 1
- _LinkDetailsWithBase: 1
- _MaterialID: 1
- _Metallic: 0
- _NormalMapSpace: 0
- _NormalScale: 1
- _PPDLodThreshold: 5
- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _PPDPrimitiveLength: 1
- _PPDPrimitiveWidth: 1
- _PerPixelDisplacementObjectScale: 1
- _PreRefractionPass: 0
- _RefractionMode: 0
- _ShiverDirectionality: 0.5
- _ShiverDrag: 0.2
- _Smoothness: 1
- _SmoothnessRemapMax: 1
- _SmoothnessRemapMin: 0
- _SrcBlend: 1
- _StencilRef: 2
- _Stiffness: 1
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 1
- _SurfaceType: 1
- _TexWorldScale: 1
- _Thickness: 1
- _ThicknessMultiplier: 1
- _UVBase: 0
- _UVDetail: 0
- _VertexDisplacementObjectScale: 1
- _VertexDisplacementTilingScale: 1
- _ZTestMode: 8
- _ZWrite: 0
m_Colors:
- _BaseColor: {r: 1, g: 0, b: 0, a: 0.741}
- _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0}
- _EmissionColor: {r: 1, g: 1, b: 1, a: 1}
- _EmissiveColor: {r: 0, g: 0, b: 0, a: 1}
- _InvPrimScale: {r: 1, g: 1, b: 0, a: 0}
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1}
- _TransmittanceColor: {r: 1, g: 1, b: 1, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

38
SampleScenes/HDTest/SkyFogTest/SkyFogProceduralSky.asset


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 3df29e7cc05fbec4aa43e06ea875565d, type: 3}
m_Name: SkyFogProceduralSky
m_EditorClassIdentifier:
rotation: 0
exposure: 0
multiplier: 1
resolution: 256
updateMode: 0
updatePeriod: 0
lightingOverride: {fileID: 0}
atmosphericScatteringSettings:
type: 1
colorMode: 1
fogColor: {r: 0.36937714, g: 0.40825674, b: 0.41176468, a: 1}
mipFogMaxMip: 0.514
mipFogNear: 40
mipFogFar: 400
linearFogDensity: 1
linearFogStart: 40
linearFogEnd: 120
expFogDistance: 150
expFogDensity: 1
sunSize: 0.054
sunSizeConvergence: 6.27
atmosphereThickness: 1.17
skyTint: {r: 0.5019608, g: 0.5019608, b: 0.5019608, a: 1}
groundColor: {r: 0.5808823, g: 0.5808823, b: 0.5808823, a: 1}
enableSunDisk: 1

178
SampleScenes/HDTest/SkyFogTest/Unlit_Transparent_Add.mat


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Unlit_Transparent_Add
m_Shader: {fileID: 4800000, guid: c4edd00ff2db5b24391a4fcb1762e459, type: 3}
m_ShaderKeywords: _ALBEDOAFFECTEMISSIVE_OFF _ALPHACUTOFFENABLE_OFF _BLENDMODE_ADD
_DEPTHOFFSETENABLE_OFF _DISTORTIONDEPTHTEST_OFF _DISTORTIONENABLE_OFF _DISTORTIONONLY_OFF
_DOUBLESIDEDENABLE_OFF _ENABLEPERPIXELDISPLACEMENT_OFF _ENABLESPECULAROCCLUSION_OFF
_ENABLEVERTEXDISPLACEMENT_OFF _ENABLEWIND_OFF _ENABLE_FOG _NORMALMAP_TANGENT_SPACE
_PREREFRACTIONPASS_OFF
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: 3000
stringTagMap:
RenderType: Transparent
disabledShaderPasses:
- DistortionVectors
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _AnisotropyMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BaseColorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BentNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BentNormalMapOS:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ColorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DistortionVectorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissiveColorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _HeightMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MaskMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _NormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _NormalMapOS:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularColorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SubsurfaceRadiusMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _TangentMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _TangentMapOS:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ThicknessMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _ATDistance: 1
- _AlbedoAffectEmissive: 0
- _AlphaCutoff: 0.5
- _AlphaCutoffEnable: 0
- _Anisotropy: 0
- _BlendMode: 1
- _CoatCoverage: 1
- _CoatIOR: 0.5
- _CullMode: 2
- _DepthOffsetEnable: 0
- _DetailAlbedoScale: 1
- _DetailNormalScale: 1
- _DetailSmoothnessScale: 1
- _DistortionBlendMode: 0
- _DistortionBlurBlendMode: 0
- _DistortionBlurDstBlend: 1
- _DistortionBlurRemapMax: 1
- _DistortionBlurRemapMin: 0
- _DistortionBlurScale: 1
- _DistortionBlurSrcBlend: 1
- _DistortionDepthTest: 0
- _DistortionDstBlend: 1
- _DistortionEnable: 0
- _DistortionOnly: 0
- _DistortionScale: 1
- _DistortionSrcBlend: 1
- _DoubleSidedEnable: 0
- _DoubleSidedNormalMode: 1
- _Drag: 1
- _DstBlend: 1
- _EmissiveColorMode: 1
- _EmissiveIntensity: 0
- _EnableFog: 1
- _EnablePerPixelDisplacement: 0
- _EnableSpecularOcclusion: 0
- _EnableVertexDisplacement: 0
- _EnableWind: 0
- _HeightAmplitude: 0.01
- _HeightCenter: 0.5
- _HeightMax: 1
- _HeightMin: -1
- _IOR: 1
- _InitialBend: 1
- _MaterialID: 1
- _Metallic: 0
- _NormalMapSpace: 0
- _NormalScale: 1
- _PPDLodThreshold: 5
- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _PerPixelDisplacementObjectScale: 1
- _PreRefractionPass: 0
- _RefractionMode: 0
- _ShiverDirectionality: 0.5
- _ShiverDrag: 0.2
- _Smoothness: 1
- _SmoothnessRemapMax: 1
- _SmoothnessRemapMin: 0
- _SrcBlend: 1
- _StencilRef: 2
- _Stiffness: 1
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 1
- _SurfaceType: 1
- _TexWorldScale: 1
- _Thickness: 1
- _ThicknessMultiplier: 1
- _UVBase: 0
- _UVDetail: 0
- _VertexDisplacementObjectScale: 1
- _VertexDisplacementTilingScale: 1
- _ZTestMode: 8
- _ZWrite: 0
m_Colors:
- _BaseColor: {r: 1, g: 0, b: 0, a: 0.741}
- _Color: {r: 1, g: 0, b: 0, a: 0.49803922}
- _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0}
- _EmissionColor: {r: 1, g: 1, b: 1, a: 1}
- _EmissiveColor: {r: 0, g: 0, b: 0, a: 1}
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1}
- _TransmittanceColor: {r: 1, g: 1, b: 1, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

177
SampleScenes/HDTest/SkyFogTest/Unlit_Transparent_Add_NoFog.mat


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Unlit_Transparent_Add_NoFog
m_Shader: {fileID: 4800000, guid: c4edd00ff2db5b24391a4fcb1762e459, type: 3}
m_ShaderKeywords: _ALBEDOAFFECTEMISSIVE_OFF _ALPHACUTOFFENABLE_OFF _BLENDMODE_ADD
_DEPTHOFFSETENABLE_OFF _DISTORTIONDEPTHTEST_OFF _DISTORTIONENABLE_OFF _DISTORTIONONLY_OFF
_DOUBLESIDEDENABLE_OFF _ENABLEFOG_OFF _ENABLEPERPIXELDISPLACEMENT_OFF _ENABLESPECULAROCCLUSION_OFF
_ENABLEVERTEXDISPLACEMENT_OFF _ENABLEWIND_OFF _NORMALMAP_TANGENT_SPACE _PREREFRACTIONPASS_OFF
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: 3000
stringTagMap:
RenderType: Transparent
disabledShaderPasses:
- DistortionVectors
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _AnisotropyMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BaseColorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BentNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BentNormalMapOS:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ColorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DistortionVectorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissiveColorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _HeightMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MaskMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _NormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _NormalMapOS:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularColorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SubsurfaceRadiusMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _TangentMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _TangentMapOS:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ThicknessMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _ATDistance: 1
- _AlbedoAffectEmissive: 0
- _AlphaCutoff: 0.5
- _AlphaCutoffEnable: 0
- _Anisotropy: 0
- _BlendMode: 1
- _CoatCoverage: 1
- _CoatIOR: 0.5
- _CullMode: 2
- _DepthOffsetEnable: 0
- _DetailAlbedoScale: 1
- _DetailNormalScale: 1
- _DetailSmoothnessScale: 1
- _DistortionBlendMode: 0
- _DistortionBlurBlendMode: 0
- _DistortionBlurDstBlend: 1
- _DistortionBlurRemapMax: 1
- _DistortionBlurRemapMin: 0
- _DistortionBlurScale: 1
- _DistortionBlurSrcBlend: 1
- _DistortionDepthTest: 0
- _DistortionDstBlend: 1
- _DistortionEnable: 0
- _DistortionOnly: 0
- _DistortionScale: 1
- _DistortionSrcBlend: 1
- _DoubleSidedEnable: 0
- _DoubleSidedNormalMode: 1
- _Drag: 1
- _DstBlend: 1
- _EmissiveColorMode: 1
- _EmissiveIntensity: 0
- _EnableFog: 0
- _EnablePerPixelDisplacement: 0
- _EnableSpecularOcclusion: 0
- _EnableVertexDisplacement: 0
- _EnableWind: 0
- _HeightAmplitude: 0.01
- _HeightCenter: 0.5
- _HeightMax: 1
- _HeightMin: -1
- _IOR: 1
- _InitialBend: 1
- _MaterialID: 1
- _Metallic: 0
- _NormalMapSpace: 0
- _NormalScale: 1
- _PPDLodThreshold: 5
- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _PerPixelDisplacementObjectScale: 1
- _PreRefractionPass: 0
- _RefractionMode: 0
- _ShiverDirectionality: 0.5
- _ShiverDrag: 0.2
- _Smoothness: 1
- _SmoothnessRemapMax: 1
- _SmoothnessRemapMin: 0
- _SrcBlend: 1
- _StencilRef: 2
- _Stiffness: 1
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 1
- _SurfaceType: 1
- _TexWorldScale: 1
- _Thickness: 1
- _ThicknessMultiplier: 1
- _UVBase: 0
- _UVDetail: 0
- _VertexDisplacementObjectScale: 1
- _VertexDisplacementTilingScale: 1
- _ZTestMode: 8
- _ZWrite: 0
m_Colors:
- _BaseColor: {r: 1, g: 0, b: 0, a: 0.741}
- _Color: {r: 1, g: 0, b: 0, a: 0.49803922}
- _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0}
- _EmissionColor: {r: 1, g: 1, b: 1, a: 1}
- _EmissiveColor: {r: 0, g: 0, b: 0, a: 1}
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1}
- _TransmittanceColor: {r: 1, g: 1, b: 1, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

178
SampleScenes/HDTest/SkyFogTest/Unlit_Transparent_Multiply.mat


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Unlit_Transparent_Multiply
m_Shader: {fileID: 4800000, guid: c4edd00ff2db5b24391a4fcb1762e459, type: 3}
m_ShaderKeywords: _ALBEDOAFFECTEMISSIVE_OFF _ALPHACUTOFFENABLE_OFF _BLENDMODE_MULTIPLY
_DEPTHOFFSETENABLE_OFF _DISTORTIONDEPTHTEST_OFF _DISTORTIONENABLE_OFF _DISTORTIONONLY_OFF
_DOUBLESIDEDENABLE_OFF _ENABLEPERPIXELDISPLACEMENT_OFF _ENABLESPECULAROCCLUSION_OFF
_ENABLEVERTEXDISPLACEMENT_OFF _ENABLEWIND_OFF _ENABLE_FOG _NORMALMAP_TANGENT_SPACE
_PREREFRACTIONPASS_OFF
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: 3000
stringTagMap:
RenderType: Transparent
disabledShaderPasses:
- DistortionVectors
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _AnisotropyMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BaseColorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BentNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BentNormalMapOS:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ColorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DistortionVectorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissiveColorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _HeightMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MaskMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _NormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _NormalMapOS:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularColorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SubsurfaceRadiusMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _TangentMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _TangentMapOS:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ThicknessMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _ATDistance: 1
- _AlbedoAffectEmissive: 0
- _AlphaCutoff: 0.5
- _AlphaCutoffEnable: 0
- _Anisotropy: 0
- _BlendMode: 3
- _CoatCoverage: 1
- _CoatIOR: 0.5
- _CullMode: 2
- _DepthOffsetEnable: 0
- _DetailAlbedoScale: 1
- _DetailNormalScale: 1
- _DetailSmoothnessScale: 1
- _DistortionBlendMode: 0
- _DistortionBlurBlendMode: 0
- _DistortionBlurDstBlend: 1
- _DistortionBlurRemapMax: 1
- _DistortionBlurRemapMin: 0
- _DistortionBlurScale: 1
- _DistortionBlurSrcBlend: 1
- _DistortionDepthTest: 0
- _DistortionDstBlend: 1
- _DistortionEnable: 0
- _DistortionOnly: 0
- _DistortionScale: 1
- _DistortionSrcBlend: 1
- _DoubleSidedEnable: 0
- _DoubleSidedNormalMode: 1
- _Drag: 1
- _DstBlend: 0
- _EmissiveColorMode: 1
- _EmissiveIntensity: 0
- _EnableFog: 1
- _EnablePerPixelDisplacement: 0
- _EnableSpecularOcclusion: 0
- _EnableVertexDisplacement: 0
- _EnableWind: 0
- _HeightAmplitude: 0.01
- _HeightCenter: 0.5
- _HeightMax: 1
- _HeightMin: -1
- _IOR: 1
- _InitialBend: 1
- _MaterialID: 1
- _Metallic: 0
- _NormalMapSpace: 0
- _NormalScale: 1
- _PPDLodThreshold: 5
- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _PerPixelDisplacementObjectScale: 1
- _PreRefractionPass: 0
- _RefractionMode: 0
- _ShiverDirectionality: 0.5
- _ShiverDrag: 0.2
- _Smoothness: 1
- _SmoothnessRemapMax: 1
- _SmoothnessRemapMin: 0
- _SrcBlend: 2
- _StencilRef: 2
- _Stiffness: 1
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 1
- _SurfaceType: 1
- _TexWorldScale: 1
- _Thickness: 1
- _ThicknessMultiplier: 1
- _UVBase: 0
- _UVDetail: 0
- _VertexDisplacementObjectScale: 1
- _VertexDisplacementTilingScale: 1
- _ZTestMode: 8
- _ZWrite: 0
m_Colors:
- _BaseColor: {r: 1, g: 0, b: 0, a: 0.741}
- _Color: {r: 1, g: 0, b: 0, a: 0.49803922}
- _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0}
- _EmissionColor: {r: 1, g: 1, b: 1, a: 1}
- _EmissiveColor: {r: 0, g: 0, b: 0, a: 0}
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1}
- _TransmittanceColor: {r: 1, g: 1, b: 1, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

178
SampleScenes/HDTest/SkyFogTest/Unlit_Transparent_PreMultipliedAlpha.mat


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Unlit_Transparent_PreMultipliedAlpha
m_Shader: {fileID: 4800000, guid: c4edd00ff2db5b24391a4fcb1762e459, type: 3}
m_ShaderKeywords: _ALBEDOAFFECTEMISSIVE_OFF _ALPHACUTOFFENABLE_OFF _BLENDMODE_PRE_MULTIPLY
_DEPTHOFFSETENABLE_OFF _DISTORTIONDEPTHTEST_OFF _DISTORTIONENABLE_OFF _DISTORTIONONLY_OFF
_DOUBLESIDEDENABLE_OFF _ENABLEPERPIXELDISPLACEMENT_OFF _ENABLESPECULAROCCLUSION_OFF
_ENABLEVERTEXDISPLACEMENT_OFF _ENABLEWIND_OFF _ENABLE_FOG _NORMALMAP_TANGENT_SPACE
_PREREFRACTIONPASS_OFF
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: 3000
stringTagMap:
RenderType: Transparent
disabledShaderPasses:
- DistortionVectors
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _AnisotropyMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BaseColorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BentNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BentNormalMapOS:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ColorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DistortionVectorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissiveColorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _HeightMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MaskMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _NormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _NormalMapOS:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularColorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SubsurfaceRadiusMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _TangentMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _TangentMapOS:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ThicknessMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _ATDistance: 1
- _AlbedoAffectEmissive: 0
- _AlphaCutoff: 0.5
- _AlphaCutoffEnable: 0
- _Anisotropy: 0
- _BlendMode: 4
- _CoatCoverage: 1
- _CoatIOR: 0.5
- _CullMode: 2
- _DepthOffsetEnable: 0
- _DetailAlbedoScale: 1
- _DetailNormalScale: 1
- _DetailSmoothnessScale: 1
- _DistortionBlendMode: 0
- _DistortionBlurBlendMode: 0
- _DistortionBlurDstBlend: 1
- _DistortionBlurRemapMax: 1
- _DistortionBlurRemapMin: 0
- _DistortionBlurScale: 1
- _DistortionBlurSrcBlend: 1
- _DistortionDepthTest: 0
- _DistortionDstBlend: 1
- _DistortionEnable: 0
- _DistortionOnly: 0
- _DistortionScale: 1
- _DistortionSrcBlend: 1
- _DoubleSidedEnable: 0
- _DoubleSidedNormalMode: 1
- _Drag: 1
- _DstBlend: 10
- _EmissiveColorMode: 1
- _EmissiveIntensity: 0
- _EnableFog: 1
- _EnablePerPixelDisplacement: 0
- _EnableSpecularOcclusion: 0
- _EnableVertexDisplacement: 0
- _EnableWind: 0
- _HeightAmplitude: 0.01
- _HeightCenter: 0.5
- _HeightMax: 1
- _HeightMin: -1
- _IOR: 1
- _InitialBend: 1
- _MaterialID: 1
- _Metallic: 0
- _NormalMapSpace: 0
- _NormalScale: 1
- _PPDLodThreshold: 5
- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _PerPixelDisplacementObjectScale: 1
- _PreRefractionPass: 0
- _RefractionMode: 0
- _ShiverDirectionality: 0.5
- _ShiverDrag: 0.2
- _Smoothness: 1
- _SmoothnessRemapMax: 1
- _SmoothnessRemapMin: 0
- _SrcBlend: 1
- _StencilRef: 2
- _Stiffness: 1
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 1
- _SurfaceType: 1
- _TexWorldScale: 1
- _Thickness: 1
- _ThicknessMultiplier: 1
- _UVBase: 0
- _UVDetail: 0
- _VertexDisplacementObjectScale: 1
- _VertexDisplacementTilingScale: 1
- _ZTestMode: 8
- _ZWrite: 0
m_Colors:
- _BaseColor: {r: 1, g: 0, b: 0, a: 0.741}
- _Color: {r: 1, g: 0, b: 0, a: 0.49803922}
- _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0}
- _EmissionColor: {r: 1, g: 1, b: 1, a: 1}
- _EmissiveColor: {r: 0, g: 0, b: 0, a: 0}
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1}
- _TransmittanceColor: {r: 1, g: 1, b: 1, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

10
SampleScenes/HDTest/SkyFogTest/Lit_Transparent_Alpha.mat.meta


fileFormatVersion: 2
guid: 411ac36f0f5cddc46968f9b2b37b9a8d
timeCreated: 1507906791
licenseType: Pro
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

10
SampleScenes/HDTest/SkyFogTest/Unlit_Transparent_Alpha.mat.meta


fileFormatVersion: 2
guid: 5f31a2adeb161614cb2b50693c8aa3c2
timeCreated: 1507906791
licenseType: Pro
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

178
SampleScenes/HDTest/SkyFogTest/Unlit_Transparent_Alpha.mat


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Unlit_Transparent_Alpha
m_Shader: {fileID: 4800000, guid: c4edd00ff2db5b24391a4fcb1762e459, type: 3}
m_ShaderKeywords: _ALBEDOAFFECTEMISSIVE_OFF _ALPHACUTOFFENABLE_OFF _BLENDMODE_ALPHA
_BLENDMODE_LERP _DEPTHOFFSETENABLE_OFF _DISTORTIONDEPTHTEST_OFF _DISTORTIONENABLE_OFF
_DISTORTIONONLY_OFF _DOUBLESIDEDENABLE_OFF _ENABLEPERPIXELDISPLACEMENT_OFF _ENABLESPECULAROCCLUSION_OFF
_ENABLEVERTEXDISPLACEMENT_OFF _ENABLEWIND_OFF _ENABLE_FOG _NORMALMAP_TANGENT_SPACE
_PREREFRACTIONPASS_OFF
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: 3000
stringTagMap:
RenderType: Transparent
disabledShaderPasses:
- DistortionVectors
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _AnisotropyMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BaseColorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BentNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BentNormalMapOS:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ColorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DistortionVectorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissiveColorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _HeightMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MaskMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _NormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _NormalMapOS:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularColorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SubsurfaceRadiusMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _TangentMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _TangentMapOS:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ThicknessMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _ATDistance: 1
- _AlbedoAffectEmissive: 0
- _AlphaCutoff: 0.5
- _AlphaCutoffEnable: 0
- _Anisotropy: 0
- _BlendMode: 0
- _CoatCoverage: 1
- _CoatIOR: 0.5
- _CullMode: 2
- _DepthOffsetEnable: 0
- _DetailAlbedoScale: 1
- _DetailNormalScale: 1
- _DetailSmoothnessScale: 1
- _DistortionBlendMode: 0
- _DistortionBlurBlendMode: 0
- _DistortionBlurDstBlend: 1
- _DistortionBlurRemapMax: 1
- _DistortionBlurRemapMin: 0
- _DistortionBlurScale: 1
- _DistortionBlurSrcBlend: 1
- _DistortionDepthTest: 0
- _DistortionDstBlend: 1
- _DistortionEnable: 0
- _DistortionOnly: 0
- _DistortionScale: 1
- _DistortionSrcBlend: 1
- _DoubleSidedEnable: 0
- _DoubleSidedNormalMode: 1
- _Drag: 1
- _DstBlend: 10
- _EmissiveColorMode: 1
- _EmissiveIntensity: 0
- _EnableFog: 1
- _EnablePerPixelDisplacement: 0
- _EnableSpecularOcclusion: 0
- _EnableVertexDisplacement: 0
- _EnableWind: 0
- _HeightAmplitude: 0.01
- _HeightCenter: 0.5
- _HeightMax: 1
- _HeightMin: -1
- _IOR: 1
- _InitialBend: 1
- _MaterialID: 1
- _Metallic: 0
- _NormalMapSpace: 0
- _NormalScale: 1
- _PPDLodThreshold: 5
- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _PerPixelDisplacementObjectScale: 1
- _PreRefractionPass: 0
- _RefractionMode: 0
- _ShiverDirectionality: 0.5
- _ShiverDrag: 0.2
- _Smoothness: 1
- _SmoothnessRemapMax: 1
- _SmoothnessRemapMin: 0
- _SrcBlend: 5
- _StencilRef: 2
- _Stiffness: 1
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 1
- _SurfaceType: 1
- _TexWorldScale: 1
- _Thickness: 1
- _ThicknessMultiplier: 1
- _UVBase: 0
- _UVDetail: 0
- _VertexDisplacementObjectScale: 1
- _VertexDisplacementTilingScale: 1
- _ZTestMode: 8
- _ZWrite: 0
m_Colors:
- _BaseColor: {r: 1, g: 0, b: 0, a: 0.741}
- _Color: {r: 1, g: 0, b: 0, a: 0.49803922}
- _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0}
- _EmissionColor: {r: 1, g: 1, b: 1, a: 1}
- _EmissiveColor: {r: 0, g: 0, b: 0, a: 1}
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1}
- _TransmittanceColor: {r: 1, g: 1, b: 1, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

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:

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:

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:

102
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 expFogDensity = new GUIContent("Fog Density");
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;
private SerializedProperty m_ExpFogDensity;
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");
m_ExpFogDensity = atmScatterProperty.FindPropertyRelative("expFogDensity");
}
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_ExpFogDensity, styles.expFogDensity);
EditorGUILayout.PropertyField(m_ExpFogDistance, styles.expFogDistance);
}
}
}
}
}
}

82
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;
[Range(0.0f, 1.0f)]
public float expFogDensity = 1.0f;
public bool NeedFogRendering()
{
return type != FogType.None;
}
public void PushShaderParameters(CommandBuffer cmd, RenderingDebugSettings renderingDebug)
{
if(renderingDebug.enableAtmosphericScattering)
cmd.SetGlobalFloat(m_TypeParam, (float)type);
else
cmd.SetGlobalFloat(m_TypeParam, (float)FogType.None);
// 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), expFogDensity, 0.0f, 0.0f));
}
}
}

73
ScriptableRenderPipeline/HDRenderPipeline/Sky/AtmosphericScattering/AtmosphericScattering.hlsl


#ifndef UNITY_ATMOSPHERIC_SCATTERING_INCLUDED
#define UNITY_ATMOSPHERIC_SCATTERING_INCLUDED
#include "../../../Core/ShaderLibrary/VolumeRendering.hlsl"
#include "AtmosphericScattering.cs.hlsl"
#include "../SkyVariables.hlsl"
#include "../../ShaderVariables.hlsl"
CBUFFER_START(AtmosphericScattering)
float _AtmosphericScatteringType;
// Common
float _FogColorMode;
float4 _FogColor;
float4 _MipFogParameters;
// Linear fog
float4 _LinearFogParameters;
// Exp fog
float4 _ExpFogParameters;
CBUFFER_END
#define _MipFogNear _MipFogParameters.x
#define _MipFogFar _MipFogParameters.y
#define _MipFogMaxMip _MipFogParameters.z
#define _LinearFogStart _LinearFogParameters.x
#define _LinearFogEnd _LinearFogParameters.y
#define _LinearFogOoRange _LinearFogParameters.z
#define _LinearFogDensity _LinearFogParameters.w
#define _ExpFogDistance _ExpFogParameters.x
#define _ExpFogDensity _ExpFogParameters.y
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 - GetPrimaryCameraPosition());
return SampleSkyTexture(dir, mipLevel).rgb;
}
else // Should not be possible.
return float3(0.0, 0.0, 0.0);
}
// Returns fog color in rgb and fog factor in alpha.
float4 EvaluateAtmosphericScattering(PositionInputs posInput)
{
if (_AtmosphericScatteringType == FOGTYPE_EXPONENTIAL)
{
float3 fogColor = GetFogColor(posInput);
float fogFactor = _ExpFogDensity * (1.0f - Transmittance(OpticalDepthHomogeneous(1.0f / _ExpFogDistance, 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

177
ScriptableRenderPipeline/HDRenderPipeline/Sky/BlacksmithlSky/BlacksmithSkyRenderer.cs


namespace UnityEngine.Experimental.Rendering.HDPipeline
{
public class BlacksmithSkyRenderer : SkyRenderer
{
Material m_ProceduralSkyMaterial = null; // Renders a cubemap into a render texture (can be cube or 2D)
private BlacksmithSkySettings m_ProceduralSkySettings;
public BlacksmithSkyRenderer(BlacksmithSkySettings proceduralSkySettings)
{
m_ProceduralSkySettings = proceduralSkySettings;
}
public override void Build()
{
m_ProceduralSkyMaterial = CoreUtils.CreateEngineMaterial("Hidden/HDRenderPipeline/Sky/SkyProcedural");
}
public override void Cleanup()
{
CoreUtils.Destroy(m_ProceduralSkyMaterial);
}
public override bool IsSkyValid()
{
if (m_ProceduralSkyMaterial == null || m_ProceduralSkySettings == null)
return false;
return m_ProceduralSkySettings.skyHDRI != null &&
m_ProceduralSkySettings.worldMieColorRamp != null &&
m_ProceduralSkySettings.worldRayleighColorRamp != null;
}
public override void SetRenderTargets(BuiltinSkyParameters builtinParams)
{
// We do not bind the depth buffer as a depth-stencil target since it is
// bound as a color texture which is then sampled from within the shader.
CoreUtils.SetRenderTarget(builtinParams.commandBuffer, builtinParams.colorBuffer);
}
void SetKeywords(BuiltinSkyParameters builtinParams, BlacksmithSkySettings param, bool renderForCubemap)
{
// Ensure that all preprocessor symbols are initially undefined.
m_ProceduralSkyMaterial.DisableKeyword("ATMOSPHERICS");
m_ProceduralSkyMaterial.DisableKeyword("ATMOSPHERICS_PER_PIXEL");
m_ProceduralSkyMaterial.DisableKeyword("ATMOSPHERICS_DEBUG");
m_ProceduralSkyMaterial.DisableKeyword("ATMOSPHERICS_OCCLUSION");
m_ProceduralSkyMaterial.DisableKeyword("ATMOSPHERICS_OCCLUSION_EDGE_FIXUP");
m_ProceduralSkyMaterial.DisableKeyword("ATMOSPHERICS_OCCLUSION_FULLSKY");
m_ProceduralSkyMaterial.DisableKeyword("ATMOSPHERICS_SUNRAYS");
m_ProceduralSkyMaterial.DisableKeyword("PERFORM_SKY_OCCLUSION_TEST");
m_ProceduralSkyMaterial.EnableKeyword("ATMOSPHERICS_PER_PIXEL");
/*
if (useOcclusion)
{
m_ProceduralSkyMaterial.EnableKeyword("ATMOSPHERICS_OCCLUSION");
if(occlusionDepthFixup && occlusionDownscale != OcclusionDownscale.x1)
m_ProceduralSkyMaterial.EnableKeyword("ATMOSPHERICS_OCCLUSION_EDGE_FIXUP");
if(occlusionFullSky)
m_ProceduralSkyMaterial.EnableKeyword("ATMOSPHERICS_OCCLUSION_FULLSKY");
}
*/
// Expected to be valid for the sky pass, and invalid for the cube map generation pass.
if (!renderForCubemap)
{
m_ProceduralSkyMaterial.EnableKeyword("PERFORM_SKY_OCCLUSION_TEST");
}
if (param.debugMode != BlacksmithSkySettings.ScatterDebugMode.None)
{
m_ProceduralSkyMaterial.EnableKeyword("ATMOSPHERICS_DEBUG");
}
}
void SetUniforms(BuiltinSkyParameters builtinParams, BlacksmithSkySettings param, bool renderForCubemap, ref MaterialPropertyBlock properties)
{
properties.SetTexture("_Cubemap", param.skyHDRI);
properties.SetVector("_SkyParam", new Vector4(param.exposure, param.multiplier, param.rotation, 0.0f));
properties.SetMatrix("_InvViewProjMatrix", builtinParams.invViewProjMatrix);
properties.SetVector("_CameraPosWS", builtinParams.cameraPosWS);
properties.SetVector("_ScreenSize", builtinParams.screenSize);
m_ProceduralSkyMaterial.SetInt("_AtmosphericsDebugMode", (int)param.debugMode);
Vector3 sunDirection = (builtinParams.sunLight != null) ? -builtinParams.sunLight.transform.forward : Vector3.zero;
m_ProceduralSkyMaterial.SetVector("_SunDirection", sunDirection);
var pixelRect = new Rect(0f, 0f, builtinParams.screenSize.x, builtinParams.screenSize.y);
var scale = 1.0f; //(float)(int)occlusionDownscale;
var depthTextureScaledTexelSize = new Vector4(scale / pixelRect.width,
scale / pixelRect.height,
-scale / pixelRect.width,
-scale / pixelRect.height);
properties.SetVector("_DepthTextureScaledTexelSize", depthTextureScaledTexelSize);
/*
m_ProceduralSkyMaterial.SetFloat("_ShadowBias", useOcclusion ? occlusionBias : 1f);
m_ProceduralSkyMaterial.SetFloat("_ShadowBiasIndirect", useOcclusion ? occlusionBiasIndirect : 1f);
m_ProceduralSkyMaterial.SetFloat("_ShadowBiasClouds", useOcclusion ? occlusionBiasClouds : 1f);
m_ProceduralSkyMaterial.SetVector("_ShadowBiasSkyRayleighMie", useOcclusion ? new Vector4(occlusionBiasSkyRayleigh, occlusionBiasSkyMie, 0f, 0f) : Vector4.zero);
m_ProceduralSkyMaterial.SetFloat("_OcclusionDepthThreshold", occlusionDepthThreshold);
m_ProceduralSkyMaterial.SetVector("_OcclusionTexture_TexelSize", ???);
*/
m_ProceduralSkyMaterial.SetFloat("_WorldScaleExponent", param.worldScaleExponent);
m_ProceduralSkyMaterial.SetFloat("_WorldNormalDistanceRcp", 1f / param.worldNormalDistance);
m_ProceduralSkyMaterial.SetFloat("_WorldMieNearScatterPush", -Mathf.Pow(Mathf.Abs(param.worldMieNearScatterPush), param.worldScaleExponent) * Mathf.Sign(param.worldMieNearScatterPush));
m_ProceduralSkyMaterial.SetFloat("_WorldRayleighNearScatterPush", -Mathf.Pow(Mathf.Abs(param.worldRayleighNearScatterPush), param.worldScaleExponent) * Mathf.Sign(param.worldRayleighNearScatterPush));
m_ProceduralSkyMaterial.SetFloat("_WorldRayleighDensity", -param.worldRayleighDensity / 100000f);
m_ProceduralSkyMaterial.SetFloat("_WorldMieDensity", -param.worldMieDensity / 100000f);
m_ProceduralSkyMaterial.SetFloat("_SkyDepth", 1.0f / param.maxSkyDistance);
var rayleighColorM20 = param.worldRayleighColorRamp.Evaluate(0.00f);
var rayleighColorM10 = param.worldRayleighColorRamp.Evaluate(0.25f);
var rayleighColorO00 = param.worldRayleighColorRamp.Evaluate(0.50f);
var rayleighColorP10 = param.worldRayleighColorRamp.Evaluate(0.75f);
var rayleighColorP20 = param.worldRayleighColorRamp.Evaluate(1.00f);
var mieColorM20 = param.worldMieColorRamp.Evaluate(0.00f);
var mieColorO00 = param.worldMieColorRamp.Evaluate(0.50f);
var mieColorP20 = param.worldMieColorRamp.Evaluate(1.00f);
m_ProceduralSkyMaterial.SetVector("_RayleighColorM20", (Vector4)rayleighColorM20 * param.worldRayleighColorIntensity);
m_ProceduralSkyMaterial.SetVector("_RayleighColorM10", (Vector4)rayleighColorM10 * param.worldRayleighColorIntensity);
m_ProceduralSkyMaterial.SetVector("_RayleighColorO00", (Vector4)rayleighColorO00 * param.worldRayleighColorIntensity);
m_ProceduralSkyMaterial.SetVector("_RayleighColorP10", (Vector4)rayleighColorP10 * param.worldRayleighColorIntensity);
m_ProceduralSkyMaterial.SetVector("_RayleighColorP20", (Vector4)rayleighColorP20 * param.worldRayleighColorIntensity);
m_ProceduralSkyMaterial.SetVector("_MieColorM20", (Vector4)mieColorM20 * param.worldMieColorIntensity);
m_ProceduralSkyMaterial.SetVector("_MieColorO00", (Vector4)mieColorO00 * param.worldMieColorIntensity);
m_ProceduralSkyMaterial.SetVector("_MieColorP20", (Vector4)mieColorP20 * param.worldMieColorIntensity);
m_ProceduralSkyMaterial.SetFloat("_HeightNormalDistanceRcp", 1f / param.heightNormalDistance);
m_ProceduralSkyMaterial.SetFloat("_HeightMieNearScatterPush", -Mathf.Pow(Mathf.Abs(param.heightMieNearScatterPush), param.worldScaleExponent) * Mathf.Sign(param.heightMieNearScatterPush));
m_ProceduralSkyMaterial.SetFloat("_HeightRayleighNearScatterPush", -Mathf.Pow(Mathf.Abs(param.heightRayleighNearScatterPush), param.worldScaleExponent) * Mathf.Sign(param.heightRayleighNearScatterPush));
// m_ProceduralSkyMaterial.SetFloat("_HeightRayleighDensity", -param.heightRayleighDensity / 100000f);
// m_ProceduralSkyMaterial.SetFloat("_HeightMieDensity", -param.heightMieDensity / 100000f);
m_ProceduralSkyMaterial.SetFloat("_HeightSeaLevel", param.heightSeaLevel);
m_ProceduralSkyMaterial.SetVector("_HeightPlaneShift", param.heightPlaneShift);
m_ProceduralSkyMaterial.SetFloat("_HeightDistanceRcp", 1f / param.heightDistance);
m_ProceduralSkyMaterial.SetVector("_HeightRayleighColor", (Vector4)param.heightRayleighColor * param.heightRayleighIntensity);
m_ProceduralSkyMaterial.SetFloat("_HeightExtinctionFactor", param.heightExtinctionFactor);
m_ProceduralSkyMaterial.SetVector("_RayleighInScatterPct", new Vector4(1f - param.worldRayleighIndirectScatter, param.worldRayleighIndirectScatter, 0f, 0f));
m_ProceduralSkyMaterial.SetFloat("_RayleighExtinctionFactor", param.worldRayleighExtinctionFactor);
m_ProceduralSkyMaterial.SetFloat("_MiePhaseAnisotropy", param.worldMiePhaseAnisotropy);
m_ProceduralSkyMaterial.SetFloat("_MieExtinctionFactor", param.worldMieExtinctionFactor);
// Since we use the material for rendering the sky both into the cubemap, and
// during the fullscreen pass, setting the 'PERFORM_SKY_OCCLUSION_TEST' keyword has no effect.
properties.SetFloat("_DisableSkyOcclusionTest", renderForCubemap ? 1.0f : 0.0f);
// We do not render the height fog into the sky IBL cubemap.
properties.SetFloat("_HeightRayleighDensity", renderForCubemap ? -0.0f : -param.heightRayleighDensity / 100000f);
properties.SetFloat("_HeightMieDensity", renderForCubemap ? -0.0f : -param.heightMieDensity / 100000f);
properties.SetMatrix(HDShaderIDs._PixelCoordToViewDirWS, builtinParams.pixelCoordToViewDirMatrix);
}
override public void RenderSky(BuiltinSkyParameters builtinParams, bool renderForCubemap)
{
MaterialPropertyBlock properties = new MaterialPropertyBlock();
// Define select preprocessor symbols.
SetKeywords(builtinParams, m_ProceduralSkySettings, renderForCubemap);
// Set shader constants.
SetUniforms(builtinParams, m_ProceduralSkySettings, renderForCubemap, ref properties);
CoreUtils.DrawFullScreen(builtinParams.commandBuffer, m_ProceduralSkyMaterial, properties);
}
}
}

12
ScriptableRenderPipeline/HDRenderPipeline/Sky/BlacksmithlSky/BlacksmithSkyRenderer.cs.meta


fileFormatVersion: 2
guid: 476423447c1989948a128fc0a0b27413
timeCreated: 1481631774
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

165
ScriptableRenderPipeline/HDRenderPipeline/Sky/BlacksmithlSky/BlacksmithSkySettings.cs


namespace UnityEngine.Experimental.Rendering.HDPipeline
{
[ExecuteInEditMode]
[DisallowMultipleComponent]
public class BlacksmithSkySettings : SkySettings
{
public enum OcclusionDownscale { x1 = 1, x2 = 2, x4 = 4 }
public enum OcclusionSamples { x64 = 0, x164 = 1, x244 = 2 }
public enum ScatterDebugMode { None, Scattering, Occlusion, OccludedScattering, Rayleigh, Mie, Height }
[Header("Global Settings")]
public float worldMieColorIntensity = 1f;
public Gradient worldMieColorRamp = null;
public float worldMieDensity = 15f;
public float worldMieExtinctionFactor = 0f;
public float worldMieNearScatterPush = 0f;
public float worldMiePhaseAnisotropy = 0.9f;
public float worldNormalDistance = 1000f;
public float worldRayleighColorIntensity = 1f;
public Gradient worldRayleighColorRamp = null;
public float worldRayleighDensity = 10f;
public float worldRayleighExtinctionFactor = 1.1f;
public float worldRayleighIndirectScatter = 0.33f;
public float worldRayleighNearScatterPush = 0f;
[Header("Height Settings")]
public float heightDistance = 50f;
public float heightExtinctionFactor = 1.1f;
public float heightMieDensity = 0f;
public float heightMieNearScatterPush = 0f;
public float heightNormalDistance = 1000f;
public Vector3 heightPlaneShift = Vector3.zero;
public Color heightRayleighColor = Color.white;
public float heightRayleighDensity = 10f;
public float heightRayleighIntensity = 1f;
public float heightRayleighNearScatterPush = 0f;
public float heightSeaLevel = 0f;
/*
[Header("Scatter Occlusion")]
public bool useOcclusion = false;
public bool occlusionFullSky = false;
public bool occlusionDepthFixup = true;
public float occlusionBias = 0f;
public float occlusionBiasClouds = 0.3f;
public float occlusionBiasIndirect = 0.6f;
public float occlusionBiasSkyMie = 0.4f;
public float occlusionBiasSkyRayleigh = 0.2f;
public float occlusionDepthThreshold = 25f;
public OcclusionDownscale occlusionDownscale = OcclusionDownscale.x2;
public OcclusionSamples occlusionSamples = OcclusionSamples.x64;
*/
[Header("Other")]
public Cubemap skyHDRI = null;
// public Shader atmosphericShader = null;
// public Shader occlusionShader = null;
public float worldScaleExponent = 1.0f;
public float maxSkyDistance = 4000.0f;
public ScatterDebugMode debugMode = ScatterDebugMode.None;
// Camera m_currentCamera;
// UnityEngine.Rendering.CommandBuffer m_occlusionCmdAfterShadows, m_occlusionCmdBeforeScreen;
void Awake()
{
if (worldRayleighColorRamp == null)
{
worldRayleighColorRamp = new Gradient();
worldRayleighColorRamp.SetKeys(
new[] { new GradientColorKey(new Color(0.3f, 0.4f, 0.6f), 0f),
new GradientColorKey(new Color(0.5f, 0.6f, 0.8f), 1f) },
new[] { new GradientAlphaKey(1f, 0f),
new GradientAlphaKey(1f, 1f) }
);
}
if (worldMieColorRamp == null)
{
worldMieColorRamp = new Gradient();
worldMieColorRamp.SetKeys(
new[] { new GradientColorKey(new Color(0.95f, 0.75f, 0.5f), 0f),
new GradientColorKey(new Color(1f, 0.9f, 8.0f), 1f) },
new[] { new GradientAlphaKey(1f, 0f),
new GradientAlphaKey(1f, 1f) }
);
}
}
public void OnValidate()
{
worldMieDensity = Mathf.Clamp(worldMieDensity, 0f, 1000f);
worldMiePhaseAnisotropy = Mathf.Clamp01(worldMiePhaseAnisotropy);
worldMieNearScatterPush = Mathf.Clamp(worldMieNearScatterPush, -200f, 300f);
worldNormalDistance = Mathf.Clamp(worldNormalDistance, 1f, 10000f);
worldRayleighDensity = Mathf.Clamp(worldRayleighDensity, 0, 1000f);
worldRayleighIndirectScatter = Mathf.Clamp(worldRayleighIndirectScatter, 0f, 1f);
worldRayleighNearScatterPush = Mathf.Clamp(worldRayleighNearScatterPush, -200f, 300f);
heightMieDensity = Mathf.Clamp(heightMieDensity, 0, 1000f);
heightMieNearScatterPush = Mathf.Clamp(heightMieNearScatterPush, -200f, 300f);
heightNormalDistance = Mathf.Clamp(heightNormalDistance, 1f, 10000f);
heightRayleighDensity = Mathf.Clamp(heightRayleighDensity, 0, 1000f);
heightRayleighNearScatterPush = Mathf.Clamp(heightRayleighNearScatterPush, -200f, 300f);
worldScaleExponent = Mathf.Clamp(worldScaleExponent, 1f, 2f);
maxSkyDistance = Mathf.Clamp(maxSkyDistance, 1.0f, 1000000.0f);
/*
occlusionBias = Mathf.Clamp01(occlusionBias);
occlusionBiasClouds = Mathf.Clamp01(occlusionBiasClouds);
occlusionBiasIndirect = Mathf.Clamp01(occlusionBiasIndirect);
occlusionBiasSkyMie = Mathf.Clamp01(occlusionBiasSkyMie);
occlusionBiasSkyRayleigh = Mathf.Clamp01(occlusionBiasSkyRayleigh);
*/
}
public override SkyRenderer GetRenderer()
{
return new BlacksmithSkyRenderer(this);
}
public override int GetHashCode()
{
int hash = base.GetHashCode();
unchecked
{
hash = hash * 23 + worldMieColorIntensity.GetHashCode();
hash = worldMieColorRamp != null ? hash * 23 + worldMieColorRamp.GetHashCode() : hash;
hash = hash * 23 + worldMieDensity.GetHashCode();
hash = hash * 23 + worldMieExtinctionFactor.GetHashCode();
hash = hash * 23 + worldMieNearScatterPush.GetHashCode();
hash = hash * 23 + worldMiePhaseAnisotropy.GetHashCode();
hash = hash * 23 + worldNormalDistance.GetHashCode();
hash = hash * 23 + worldRayleighColorIntensity.GetHashCode();
hash = worldRayleighColorRamp != null ? hash * 23 + worldRayleighColorRamp.GetHashCode() : hash;
hash = hash * 23 + worldRayleighDensity.GetHashCode();
hash = hash * 23 + worldRayleighExtinctionFactor.GetHashCode();
hash = hash * 23 + worldRayleighIndirectScatter.GetHashCode();
hash = hash * 23 + worldRayleighNearScatterPush.GetHashCode();
hash = hash * 23 + heightDistance.GetHashCode();
hash = hash * 23 + heightExtinctionFactor.GetHashCode();
hash = hash * 23 + heightMieDensity.GetHashCode();
hash = hash * 23 + heightMieNearScatterPush.GetHashCode();
hash = hash * 23 + heightNormalDistance.GetHashCode();
hash = hash * 23 + heightPlaneShift.GetHashCode();
hash = hash * 23 + heightRayleighColor.GetHashCode();
hash = hash * 23 + heightRayleighDensity.GetHashCode();
hash = hash * 23 + heightRayleighIntensity.GetHashCode();
hash = hash * 23 + heightRayleighNearScatterPush.GetHashCode();
hash = hash * 23 + heightSeaLevel.GetHashCode();
hash = skyHDRI != null ? hash * 23 + skyHDRI.GetHashCode() : hash;
hash = hash * 23 + worldScaleExponent.GetHashCode();
hash = hash * 23 + maxSkyDistance.GetHashCode();
hash = hash * 23 + debugMode.GetHashCode();
}
return hash;
}
}
}

12
ScriptableRenderPipeline/HDRenderPipeline/Sky/BlacksmithlSky/BlacksmithSkySettings.cs.meta


fileFormatVersion: 2
guid: 54bcd1d5cb4984847971142e9444d2fb
timeCreated: 1481631764
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

9
ScriptableRenderPipeline/HDRenderPipeline/Sky/BlacksmithlSky/Editor.meta


fileFormatVersion: 2
guid: 00372bf7f144a724bba68a081fd79e78
folderAsset: yes
timeCreated: 1481646149
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

155
ScriptableRenderPipeline/HDRenderPipeline/Sky/BlacksmithlSky/Editor/BlacksmithSkyEditor.cs


using UnityEngine;
using UnityEditor;
namespace UnityEngine.Experimental.Rendering.HDPipeline
{
[CanEditMultipleObjects]
[CustomEditor(typeof(BlacksmithSkySettings))]
public class BlacksmithSkySettingsEditor : Editor
{
private float heightFogHeight = 0.0f;
private class Styles
{
public readonly GUIContent skyHDRI = new GUIContent("HDRI");
public readonly GUIContent skyResolution = new GUIContent("Resolution");
public readonly GUIContent skyExposure = new GUIContent("Exposure");
public readonly GUIContent skyRotation = new GUIContent("Rotation");
public readonly GUIContent skyMultiplier = new GUIContent("Multiplier");
public readonly GUIContent lightingOverride = new GUIContent("Lighting Override", "If a lighting override cubemap is provided, this cubemap will be used to compute lighting instead of the result from the visible sky.");
}
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_SkyHDRI;
private SerializedProperty m_SkyResolution;
private SerializedProperty m_SkyExposure;
private SerializedProperty m_SkyMultiplier;
private SerializedProperty m_SkyRotation;
private SerializedProperty m_LightingOverride;
private SerializedProperty m_updateMode;
private SerializedProperty m_updatePeriod;
private SerializedProperty m_worldScaleExponent;
private SerializedProperty m_maxSkyDistance;
private SerializedProperty m_worldMieColorIntensity;
private SerializedProperty m_worldMieColorRamp;
private SerializedProperty m_worldMieDensity;
private SerializedProperty m_worldMieNearScatterPush;
private SerializedProperty m_worldMiePhaseAnisotropy;
private SerializedProperty m_worldRayleighColorIntensity;
private SerializedProperty m_worldRayleighColorRamp;
private SerializedProperty m_worldRayleighDensity;
private SerializedProperty m_worldRayleighNearScatterPush;
private SerializedProperty m_heightSeaLevel;
private SerializedProperty m_heightDistance;
private SerializedProperty m_heightMieDensity;
private SerializedProperty m_heightMieNearScatterPush;
private SerializedProperty m_heightRayleighColor;
private SerializedProperty m_heightRayleighDensity;
private SerializedProperty m_heightRayleighIntensity;
private SerializedProperty m_heightRayleighNearScatterPush;
void OnEnable()
{
m_SkyHDRI = serializedObject.FindProperty("skyHDRI");
m_SkyResolution = serializedObject.FindProperty("resolution");
m_SkyExposure = serializedObject.FindProperty("exposure");
m_SkyMultiplier = serializedObject.FindProperty("multiplier");
m_SkyRotation = serializedObject.FindProperty("rotation");
m_updateMode = serializedObject.FindProperty("updateMode");
m_updatePeriod = serializedObject.FindProperty("updatePeriod");
m_LightingOverride = serializedObject.FindProperty("lightingOverride");
m_maxSkyDistance = serializedObject.FindProperty("maxSkyDistance");
m_worldScaleExponent = serializedObject.FindProperty("worldScaleExponent");
m_worldMieColorIntensity = serializedObject.FindProperty("worldMieColorIntensity");
m_worldMieColorRamp = serializedObject.FindProperty("worldMieColorRamp");
m_worldMieDensity = serializedObject.FindProperty("worldMieDensity");
m_worldMieNearScatterPush = serializedObject.FindProperty("worldMieNearScatterPush");
m_worldMiePhaseAnisotropy = serializedObject.FindProperty("worldMiePhaseAnisotropy");
m_worldRayleighColorIntensity = serializedObject.FindProperty("worldRayleighColorIntensity");
m_worldRayleighColorRamp = serializedObject.FindProperty("worldRayleighColorRamp");
m_worldRayleighDensity = serializedObject.FindProperty("worldRayleighDensity");
m_worldRayleighNearScatterPush = serializedObject.FindProperty("worldRayleighNearScatterPush");
m_heightSeaLevel = serializedObject.FindProperty("heightSeaLevel");
m_heightDistance = serializedObject.FindProperty("heightDistance");
m_heightMieDensity = serializedObject.FindProperty("heightMieDensity");
m_heightMieNearScatterPush = serializedObject.FindProperty("heightMieNearScatterPush");
m_heightRayleighColor = serializedObject.FindProperty("heightRayleighColor");
m_heightRayleighDensity = serializedObject.FindProperty("heightRayleighDensity");
m_heightRayleighIntensity = serializedObject.FindProperty("heightRayleighIntensity");
m_heightRayleighNearScatterPush = serializedObject.FindProperty("heightRayleighNearScatterPush");
}
public override void OnInspectorGUI()
{
serializedObject.Update();
EditorGUILayout.LabelField(new GUIContent("Skydome"), EditorStyles.boldLabel);
EditorGUILayout.PropertyField(m_SkyHDRI, styles.skyHDRI);
EditorGUILayout.PropertyField(m_SkyResolution, styles.skyResolution);
EditorGUILayout.PropertyField(m_SkyExposure, styles.skyExposure);
EditorGUILayout.PropertyField(m_SkyMultiplier, styles.skyMultiplier);
EditorGUILayout.PropertyField(m_SkyRotation, styles.skyRotation);
EditorGUILayout.PropertyField(m_updateMode);
EditorGUILayout.PropertyField(m_updatePeriod);
EditorGUILayout.PropertyField(m_LightingOverride, styles.lightingOverride);
EditorGUILayout.Space();
EditorGUILayout.LabelField(new GUIContent("Atmosphere"), EditorStyles.boldLabel);
EditorGUILayout.PropertyField(m_worldMieDensity, new GUIContent("Density"));
m_worldRayleighDensity.floatValue = m_worldMieDensity.floatValue;
EditorGUILayout.PropertyField(m_worldScaleExponent, new GUIContent("Global scale"));
EditorGUILayout.PropertyField(m_maxSkyDistance, new GUIContent("Sky distance"));
EditorGUILayout.Space();
EditorGUILayout.PropertyField(m_worldMieColorRamp);
EditorGUILayout.PropertyField(m_worldMieColorIntensity);
EditorGUILayout.PropertyField(m_worldMieNearScatterPush);
EditorGUILayout.PropertyField(m_worldMiePhaseAnisotropy);
EditorGUILayout.Space();
EditorGUILayout.PropertyField(m_worldRayleighColorRamp);
EditorGUILayout.PropertyField(m_worldRayleighColorIntensity);
//EditorGUILayout.PropertyField(m_worldRayleighDensity);
EditorGUILayout.PropertyField(m_worldRayleighNearScatterPush);
EditorGUILayout.Space();
EditorGUILayout.LabelField(new GUIContent("Height fog"), EditorStyles.boldLabel);
heightFogHeight = EditorGUILayout.FloatField(new GUIContent("Height"), heightFogHeight);
EditorGUILayout.PropertyField(m_heightDistance, new GUIContent("Falloff"));
m_heightSeaLevel.floatValue = heightFogHeight + m_heightDistance.floatValue * 2.0f - 2.0f;
EditorGUILayout.PropertyField(m_heightMieDensity, new GUIContent("Density"));
m_heightRayleighDensity.floatValue = m_heightMieDensity.floatValue;
EditorGUILayout.PropertyField(m_heightMieNearScatterPush);
EditorGUILayout.PropertyField(m_heightRayleighColor);
//EditorGUILayout.PropertyField(m_heightRayleighDensity);
EditorGUILayout.PropertyField(m_heightRayleighIntensity);
EditorGUILayout.PropertyField(m_heightRayleighNearScatterPush);
//base.DrawDefaultInspector();
serializedObject.ApplyModifiedProperties();
}
}
}

12
ScriptableRenderPipeline/HDRenderPipeline/Sky/BlacksmithlSky/Editor/BlacksmithSkyEditor.cs.meta


fileFormatVersion: 2
guid: 40b56ef8d02cefa49ab82e6b7df9266b
timeCreated: 1481635925
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

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


fileFormatVersion: 2
guid: 455c6cbc5c8be404c8ed6ff8b38d1155
folderAsset: yes
timeCreated: 1481646141
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

部分文件因为文件数量过多而无法显示

正在加载...
取消
保存