Evgenii Golubev 8 年前
当前提交
9470df9a
共有 69 个文件被更改,包括 2406 次插入747 次删除
  1. 1
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Debug/HDRenderPipelineDebug.cs
  2. 126
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Editor/HDRenderPipelineInspector.cs
  3. 6
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Editor/SceneSettingsManagementWindow.cs
  4. 125
      Assets/ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipeline.asset
  5. 2
      Assets/ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipeline.asset.meta
  6. 44
      Assets/ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipeline.cs
  7. 2
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/LayeredLit/LayeredLit.shader
  8. 2
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/LayeredLit/LayeredLitTessellation.shader
  9. 2
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Lit.shader
  10. 68
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/LitData.hlsl
  11. 2
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/LitDataInternal.hlsl
  12. 2
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/LitTessellation.shader
  13. 20
      Assets/ScriptableRenderPipeline/ShaderLibrary/CommonMaterial.hlsl
  14. 15
      Assets/ScriptableRenderPipeline/ShaderLibrary/PerPixelDisplacement.hlsl
  15. 3
      Assets/ScriptableRenderPipeline/ShaderLibrary/SampleUVMappingNormalInternal.hlsl
  16. 112
      Assets/TestScenes/HDTest/CascadedShadowsTest.unity
  17. 9
      Assets/TestScenes/HDTest/CascadedShadowsTest/CommonSettings_Cascaded.asset
  18. 2
      Assets/TestScenes/HDTest/CascadedShadowsTest/CommonSettings_Cascaded.asset.meta
  19. 6
      Assets/TestScenes/HDTest/GraphicTest/Parallax Occlusion Mapping/Material/POM - Rock.mat
  20. 8
      Assets/TestScenes/HDTest/GraphicTest/Parallax Occlusion Mapping/Material/POM - Wood.mat
  21. 6
      Assets/TestScenes/HDTest/GraphicTest/Tessellation/Material/Tessellation - Rock.mat
  22. 6
      Assets/TestScenes/HDTest/GraphicTest/Tessellation/Material/Tessellation - Wood.mat
  23. 887
      Assets/TestScenes/HDTest/HDRenderLoopTest.unity
  24. 9
      ProjectSettings/GraphicsSettings.asset
  25. 12
      Assets/TestScenes/HDTest/GraphicTest/LayeredTessellation/Material/Layer-2-woord-rock.mat
  26. 7
      Assets/TestScenes/HDTest/GraphicTest/Common/Textures/FourShapesColor.tga.meta
  27. 7
      Assets/TestScenes/HDTest/GraphicTest/Common/Textures/FourShapesRelief.tga.meta
  28. 7
      Assets/TestScenes/HDTest/GraphicTest/Common/Textures/FourShapesReliefHeightmap.tga.meta
  29. 7
      Assets/TestScenes/HDTest/GraphicTest/Common/Textures/RockColor.jpg.meta
  30. 7
      Assets/TestScenes/HDTest/GraphicTest/Common/Textures/RockHeightmap.tga.meta
  31. 7
      Assets/TestScenes/HDTest/GraphicTest/Common/Textures/RockRelief.tga.meta
  32. 295
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/SubsurfaceScatteringSettings.cs
  33. 8
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/SubsurfaceScatteringSettings.cs.meta
  34. 20
      Assets/TestScenes/HDTest/CascadedShadowsTest/HDRISkySettings_Cascaded.asset
  35. 9
      Assets/TestScenes/HDTest/CascadedShadowsTest/HDRISkySettings_Cascaded.asset.meta
  36. 9
      Assets/TestScenes/HDTest/GraphicTest/LayeredTessellation/Material.meta
  37. 175
      Assets/TestScenes/HDTest/GraphicTest/Parallax Occlusion Mapping/Material/POM - Rock planar.mat
  38. 9
      Assets/TestScenes/HDTest/GraphicTest/Parallax Occlusion Mapping/Material/POM - Rock planar.mat.meta
  39. 175
      Assets/TestScenes/HDTest/GraphicTest/Parallax Occlusion Mapping/Material/POM - Wood Planar.mat
  40. 9
      Assets/TestScenes/HDTest/GraphicTest/Parallax Occlusion Mapping/Material/POM - Wood Planar.mat.meta
  41. 175
      Assets/TestScenes/HDTest/GraphicTest/Parallax Occlusion Mapping/Material/POM - Wood triplanar.mat
  42. 9
      Assets/TestScenes/HDTest/GraphicTest/Parallax Occlusion Mapping/Material/POM - Wood triplanar.mat.meta
  43. 9
      Assets/TestScenes/HDTest/GraphicTest/Triplanar.meta
  44. 9
      Assets/TestScenes/HDTest/GraphicTest/Triplanar/Material.meta
  45. 175
      Assets/TestScenes/HDTest/GraphicTest/Triplanar/Material/Wood triplanar.mat
  46. 9
      Assets/TestScenes/HDTest/GraphicTest/Triplanar/Material/Wood triplanar.mat.meta
  47. 12
      Assets/ScriptableRenderPipeline/HDRenderPipeline/SceneSettings/SubsurfaceScatteringParameters.cs.meta
  48. 509
      Assets/ScriptableRenderPipeline/HDRenderPipeline/SceneSettings/SubsurfaceScatteringParameters.cs
  49. 9
      Assets/TestScenes/HDTest/GraphicTest/Parallax Occlusion Mapping/Textures.meta
  50. 9
      Assets/TestScenes/HDTest/GraphicTest/Tessellation/Textures.meta
  51. 0
      /Assets/TestScenes/HDTest/GraphicTest/LayeredTessellation/Material/Layer-2-woord-rock.mat
  52. 0
      /Assets/TestScenes/HDTest/GraphicTest/LayeredTessellation/Material/Layer-2-woord-rock.mat.meta
  53. 0
      /Assets/TestScenes/HDTest/GraphicTest/Common/Textures/FourShapesColor.tga
  54. 0
      /Assets/TestScenes/HDTest/GraphicTest/Common/Textures/FourShapesColor.tga.meta
  55. 0
      /Assets/TestScenes/HDTest/GraphicTest/Common/Textures/FourShapesRelief.tga
  56. 0
      /Assets/TestScenes/HDTest/GraphicTest/Common/Textures/FourShapesRelief.tga.meta
  57. 0
      /Assets/TestScenes/HDTest/GraphicTest/Common/Textures/FourShapesReliefHeightmap.tga
  58. 0
      /Assets/TestScenes/HDTest/GraphicTest/Common/Textures/FourShapesReliefHeightmap.tga.meta
  59. 0
      /Assets/TestScenes/HDTest/GraphicTest/Common/Textures/RockColor.jpg
  60. 0
      /Assets/TestScenes/HDTest/GraphicTest/Common/Textures/RockColor.jpg.meta
  61. 0
      /Assets/TestScenes/HDTest/GraphicTest/Common/Textures/RockHeightmap.tga
  62. 0
      /Assets/TestScenes/HDTest/GraphicTest/Common/Textures/RockHeightmap.tga.meta
  63. 0
      /Assets/TestScenes/HDTest/GraphicTest/Common/Textures/RockRelief.tga
  64. 0
      /Assets/TestScenes/HDTest/GraphicTest/Common/Textures/RockRelief.tga.meta

1
Assets/ScriptableRenderPipeline/HDRenderPipeline/Debug/HDRenderPipelineDebug.cs


public bool displayOpaqueObjects = true;
public bool displayTransparentObjects = true;
public bool enableDistortion = true;
public bool enableSSS = true;
}
public enum ShadowDebugMode

126
Assets/ScriptableRenderPipeline/HDRenderPipeline/Editor/HDRenderPipelineInspector.cs


public readonly GUIContent shadowsAtlasWidth = new GUIContent("Atlas width");
public readonly GUIContent shadowsAtlasHeight = new GUIContent("Atlas height");
// Subsurface Scaterring Settings
public readonly GUIContent[] sssProfiles = new GUIContent[SubsurfaceScatteringSettings.maxNumProfiles] { new GUIContent("Profile #0"), new GUIContent("Profile #1"), new GUIContent("Profile #2"), new GUIContent("Profile #3"), new GUIContent("Profile #4"), new GUIContent("Profile #5"), new GUIContent("Profile #6"), new GUIContent("Profile #7") };
public readonly GUIContent sssProfilePreview0 = new GUIContent("Profile preview");
public readonly GUIContent sssProfilePreview1 = new GUIContent("Shows the fraction of light scattered from the source as radius increases to 1.");
public readonly GUIContent sssProfilePreview2 = new GUIContent("Note that the intensity of the region in the center may be clamped.");
public readonly GUIContent sssTransmittancePreview0 = new GUIContent("Transmittance preview");
public readonly GUIContent sssTransmittancePreview1 = new GUIContent("Shows the fraction of light passing through the object as thickness increases to 1.");
public readonly GUIContent sssNumProfiles = new GUIContent("Number of profiles");
public readonly GUIContent sssProfileStdDev1 = new GUIContent("Standard deviation #1", "Determines the shape of the 1st Gaussian filter. Increases the strength and the radius of the blur of the corresponding color channel.");
public readonly GUIContent sssProfileStdDev2 = new GUIContent("Standard deviation #2", "Determines the shape of the 2nd Gaussian filter. Increases the strength and the radius of the blur of the corresponding color channel.");
public readonly GUIContent sssProfileLerpWeight = new GUIContent("Filter interpolation", "Controls linear interpolation between the two Gaussian filters.");
public readonly GUIContent sssProfileTransmission = new GUIContent("Enable transmission", "Toggles simulation of light passing through thin objects. Depends on the thickness of the material.");
public readonly GUIContent sssProfileThicknessRemap = new GUIContent("Thickness remap", "Remaps the thickness parameter from [0, 1] to the desired range.");
public readonly GUIStyle centeredMiniBoldLabel = new GUIStyle(GUI.skin.label);
// Tile pass Settings
public readonly GUIContent tileLightLoopSettings = new GUIContent("Tile Light Loop Settings");
public readonly string[] tileLightLoopDebugTileFlagStrings = new string[] { "Punctual Light", "Area Light", "Env Light"};

public readonly GUIContent displayOpaqueObjects = new GUIContent("Display Opaque Objects", "Toggle opaque objects rendering on and off.");
public readonly GUIContent displayTransparentObjects = new GUIContent("Display Transparent Objects", "Toggle transparent objects rendering on and off.");
public readonly GUIContent enableDistortion = new GUIContent("Enable Distortion");
public readonly GUIContent enableSSS = new GUIContent("Enable Subsurface Scattering");
// Lighting Debug
public readonly GUIContent lightingDebugSettings = new GUIContent("Lighting Debug");

public readonly GUIContent lightingDebugOverrideSmoothness = new GUIContent("Override Smoothness");
public readonly GUIContent lightingDebugOverrideSmoothnessValue = new GUIContent("Smoothness Value");
public readonly GUIContent lightingDebugAlbedo = new GUIContent("Lighting Debug Albedo");
public Styles()
{
centeredMiniBoldLabel.alignment = TextAnchor.MiddleCenter;
centeredMiniBoldLabel.fontSize = 10;
centeredMiniBoldLabel.fontStyle = FontStyle.Bold;
}
}
private static Styles s_Styles = null;

SerializedProperty m_ShowRenderingDebug = null;
SerializedProperty m_DebugOverlayRatio = null;
// Rendering Debug
// Material Debug
SerializedProperty m_MaterialDebugMode = null;
// Rendering Debug

SerializedProperty m_EnableSSS = null;
// Lighting debug
SerializedProperty m_DebugShadowEnabled = null;

SerializedProperty m_RenderingUseForwardOnly = null;
SerializedProperty m_RenderingUseDepthPrepass = null;
// Subsurface Scattering Settings
SerializedProperty m_Profiles = null;
SerializedProperty m_NumProfiles = null;
// Subsurface Scattering internal data
private Material m_ProfileMaterial, m_TransmittanceMaterial;
private RenderTexture[] m_ProfileImages, m_TransmittanceImages;
private void InitializeProperties()
{
// Global debug

m_DisplayOpaqueObjects = FindProperty(x => x.globalDebugSettings.renderingDebugSettings.displayOpaqueObjects);
m_DisplayTransparentObjects = FindProperty(x => x.globalDebugSettings.renderingDebugSettings.displayTransparentObjects);
m_EnableDistortion = FindProperty(x => x.globalDebugSettings.renderingDebugSettings.enableDistortion);
m_EnableSSS = FindProperty(x => x.globalDebugSettings.renderingDebugSettings.enableSSS);
// Lighting debug
m_DebugShadowEnabled = FindProperty(x => x.globalDebugSettings.lightingDebugSettings.enableShadows);

m_RenderingUseForwardOnly = FindProperty(x => x.renderingSettings.useForwardRenderingOnly);
m_RenderingUseDepthPrepass = FindProperty(x => x.renderingSettings.useDepthPrepass);
// Subsurface Scattering Settings
m_Profiles = FindProperty(x => x.sssSettings.profiles);
m_NumProfiles = m_Profiles.FindPropertyRelative("Array.size");
}
void InitializeSSS()
{
m_ProfileMaterial = Utilities.CreateEngineMaterial("Hidden/HDRenderPipeline/DrawGaussianProfile");
m_TransmittanceMaterial = Utilities.CreateEngineMaterial("Hidden/HDRenderPipeline/DrawTransmittanceGraph");
m_ProfileImages = new RenderTexture[SubsurfaceScatteringSettings.maxNumProfiles];
m_TransmittanceImages = new RenderTexture[SubsurfaceScatteringSettings.maxNumProfiles];
for (int i = 0; i < SubsurfaceScatteringSettings.maxNumProfiles; i++)
{
m_ProfileImages[i] = new RenderTexture(256, 256, 0, RenderTextureFormat.DefaultHDR);
m_TransmittanceImages[i] = new RenderTexture(16, 256, 0, RenderTextureFormat.DefaultHDR);
}
}
SerializedProperty FindProperty<TValue>(Expression<Func<HDRenderPipeline, TValue>> expr)

EditorGUILayout.PropertyField(m_DisplayOpaqueObjects, styles.displayOpaqueObjects);
EditorGUILayout.PropertyField(m_DisplayTransparentObjects, styles.displayTransparentObjects);
EditorGUILayout.PropertyField(m_EnableDistortion, styles.enableDistortion);
EditorGUILayout.PropertyField(m_EnableSSS, styles.enableSSS);
EditorGUI.indentLevel--;
}

EditorGUILayout.LabelField(styles.sssSettings);
EditorGUI.BeginChangeCheck();
EditorGUI.indentLevel++;
pipe.localSssParameters = (SubsurfaceScatteringParameters) EditorGUILayout.ObjectField(new GUIContent("Subsurface Scattering Parameters"), pipe.localSssParameters, typeof(SubsurfaceScatteringParameters), false);
EditorGUI.indentLevel--;
EditorGUI.BeginChangeCheck();
EditorGUILayout.PropertyField(m_NumProfiles, styles.sssNumProfiles);
EditorGUILayout.PropertyField(m_Profiles);
if (EditorGUI.EndChangeCheck())
if (m_Profiles.isExpanded)
HackSetDirty(pipe); // Repaint
EditorGUI.indentLevel++;
for (int i = 0, n = Math.Min(m_Profiles.arraySize, SubsurfaceScatteringSettings.maxNumProfiles); i < n; i++)
{
SerializedProperty profile = m_Profiles.GetArrayElementAtIndex(i);
EditorGUILayout.PropertyField(profile, styles.sssProfiles[i]);
if (profile.isExpanded)
{
EditorGUI.indentLevel++;
SerializedProperty profileStdDev1 = profile.FindPropertyRelative("stdDev1");
SerializedProperty profileStdDev2 = profile.FindPropertyRelative("stdDev2");
SerializedProperty profileLerpWeight = profile.FindPropertyRelative("lerpWeight");
SerializedProperty profileTransmission = profile.FindPropertyRelative("enableTransmission");
SerializedProperty profileThicknessRemap = profile.FindPropertyRelative("thicknessRemap");
EditorGUILayout.PropertyField(profileStdDev1, styles.sssProfileStdDev1);
EditorGUILayout.PropertyField(profileStdDev2, styles.sssProfileStdDev2);
EditorGUILayout.PropertyField(profileLerpWeight, styles.sssProfileLerpWeight);
EditorGUILayout.PropertyField(profileTransmission, styles.sssProfileTransmission);
Vector2 thicknessRemap = profileThicknessRemap.vector2Value;
EditorGUILayout.LabelField("Min thickness: ", thicknessRemap.x.ToString());
EditorGUILayout.LabelField("Max thickness: ", thicknessRemap.y.ToString());
EditorGUILayout.MinMaxSlider(styles.sssProfileThicknessRemap, ref thicknessRemap.x, ref thicknessRemap.y, 0, 10);
profileThicknessRemap.vector2Value = thicknessRemap;
EditorGUILayout.Space();
EditorGUILayout.LabelField(styles.sssProfilePreview0, styles.centeredMiniBoldLabel);
EditorGUILayout.LabelField(styles.sssProfilePreview1, EditorStyles.centeredGreyMiniLabel);
EditorGUILayout.LabelField(styles.sssProfilePreview2, EditorStyles.centeredGreyMiniLabel);
EditorGUILayout.Space();
// Draw the profile.
m_ProfileMaterial.SetColor("_StdDev1", profileStdDev1.colorValue);
m_ProfileMaterial.SetColor("_StdDev2", profileStdDev2.colorValue);
m_ProfileMaterial.SetFloat("_LerpWeight", profileLerpWeight.floatValue);
EditorGUI.DrawPreviewTexture(GUILayoutUtility.GetRect(256, 256), m_ProfileImages[i], m_ProfileMaterial, ScaleMode.ScaleToFit, 1.0f);
EditorGUILayout.Space();
EditorGUILayout.LabelField(styles.sssTransmittancePreview0, styles.centeredMiniBoldLabel);
EditorGUILayout.LabelField(styles.sssTransmittancePreview1, EditorStyles.centeredGreyMiniLabel);
EditorGUILayout.Space();
// Draw the transmittance graph.
m_TransmittanceMaterial.SetColor("_StdDev1", profileStdDev1.colorValue);
m_TransmittanceMaterial.SetColor("_StdDev2", profileStdDev2.colorValue);
m_TransmittanceMaterial.SetFloat("_LerpWeight", profileLerpWeight.floatValue);
m_TransmittanceMaterial.SetVector("_ThicknessRemap", profileThicknessRemap.vector2Value);
EditorGUI.DrawPreviewTexture(GUILayoutUtility.GetRect(16, 16), m_TransmittanceImages[i], m_TransmittanceMaterial, ScaleMode.ScaleToFit, 16.0f);
EditorGUILayout.Space();
EditorGUI.indentLevel--;
}
}
EditorGUI.indentLevel--;
EditorGUI.indentLevel--;
}
private void LightingDebugSettingsUI(HDRenderPipeline renderContext, HDRenderPipelineInstance renderpipelineInstance)

public void OnEnable()
{
InitializeProperties();
InitializeSSS();
}
public override void OnInspectorGUI()

6
Assets/ScriptableRenderPipeline/HDRenderPipeline/Editor/SceneSettingsManagementWindow.cs


void OnGUI()
{
// Keep it there temporarily until it's back to an "engine" setting in the HDRenderPipeline asset.
SubsurfaceScatteringSettings.overrideSettings = (SubsurfaceScatteringParameters)EditorGUILayout.ObjectField(new GUIContent("SSS Settings"), SubsurfaceScatteringSettings.overrideSettings, typeof(SubsurfaceScatteringParameters), false);
EditorGUILayout.Space();
if (GUILayout.Button("Create new Common Settings"))

if (GUILayout.Button("Create new Procedural sky params"))
{
CreateAsset<ProceduralSkySettings>("NewProceduralSkyParameters");
}
if (GUILayout.Button("Create new SSS params"))
{
CreateAsset<SubsurfaceScatteringParameters>("NewSssParameters");
}
EditorGUILayout.Space();

125
Assets/ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipeline.asset


displayOpaqueObjects: 1
displayTransparentObjects: 1
enableDistortion: 1
enableSSS: 1
sssSettings:
numProfiles: 1
transmissionFlags: 0
profiles:
- stdDev1: {r: 0.3, g: 0.3, b: 0.3, a: 0}
stdDev2: {r: 0.6, g: 0.6, b: 0.6, a: 0}
lerpWeight: 0.5
enableTransmission: 0
thicknessRemap: {x: 0, y: 3}
m_FilterKernel:
- {x: 0.14285715, y: 0.14285715, z: 0.14285715, w: -0.6594821}
- {x: 0.14285715, y: 0.14285715, z: 0.14285715, w: -0.3561445}
- {x: 0.14285715, y: 0.14285715, z: 0.14285715, w: -0.16454786}
- {x: 0.14285715, y: 0.14285715, z: 0.14285715, w: -0.000000048879357}
- {x: 0.14285715, y: 0.14285715, z: 0.14285715, w: 0.16454786}
- {x: 0.14285715, y: 0.14285715, z: 0.14285715, w: 0.35614443}
- {x: 0.14285715, y: 0.14285715, z: 0.14285715, w: 0.659482}
m_HalfRcpVariances:
- {x: 5.5555553, y: 5.5555553, z: 5.5555553}
- {x: 1.3888888, y: 1.3888888, z: 1.3888888}
m_HalfRcpWeightedVariances: {x: 2.4691355, y: 2.4691355, z: 2.4691355, w: 2.4691355}
thicknessRemaps:
- 0
- 3
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
halfRcpVariancesAndLerpWeights:
- {x: 5.5555553, y: 5.5555553, z: 5.5555553, w: 0.5}
- {x: 1.3888888, y: 1.3888888, z: 1.3888888, w: 0.5}
- {x: 0, y: 0, z: 0, w: 0}
- {x: 0, y: 0, z: 0, w: 0}
- {x: 0, y: 0, z: 0, w: 0}
- {x: 0, y: 0, z: 0, w: 0}
- {x: 0, y: 0, z: 0, w: 0}
- {x: 0, y: 0, z: 0, w: 0}
- {x: 0, y: 0, z: 0, w: 0}
- {x: 0, y: 0, z: 0, w: 0}
- {x: 0, y: 0, z: 0, w: 0}
- {x: 0, y: 0, z: 0, w: 0}
- {x: 0, y: 0, z: 0, w: 0}
- {x: 0, y: 0, z: 0, w: 0}
- {x: 0, y: 0, z: 0, w: 0}
- {x: 0, y: 0, z: 0, w: 0}
halfRcpWeightedVariances:
- {x: 2.4691355, y: 2.4691355, z: 2.4691355, w: 2.4691355}
- {x: 0, y: 0, z: 0, w: 0}
- {x: 0, y: 0, z: 0, w: 0}
- {x: 0, y: 0, z: 0, w: 0}
- {x: 0, y: 0, z: 0, w: 0}
- {x: 0, y: 0, z: 0, w: 0}
- {x: 0, y: 0, z: 0, w: 0}
- {x: 0, y: 0, z: 0, w: 0}
filterKernels:
- {x: 0.14285715, y: 0.14285715, z: 0.14285715, w: -0.6594821}
- {x: 0.14285715, y: 0.14285715, z: 0.14285715, w: -0.3561445}
- {x: 0.14285715, y: 0.14285715, z: 0.14285715, w: -0.16454786}
- {x: 0.14285715, y: 0.14285715, z: 0.14285715, w: -0.000000048879357}
- {x: 0.14285715, y: 0.14285715, z: 0.14285715, w: 0.16454786}
- {x: 0.14285715, y: 0.14285715, z: 0.14285715, w: 0.35614443}
- {x: 0.14285715, y: 0.14285715, z: 0.14285715, w: 0.659482}
- {x: 0, y: 0, z: 0, w: 0}
- {x: 0, y: 0, z: 0, w: 0}
- {x: 0, y: 0, z: 0, w: 0}
- {x: 0, y: 0, z: 0, w: 0}
- {x: 0, y: 0, z: 0, w: 0}
- {x: 0, y: 0, z: 0, w: 0}
- {x: 0, y: 0, z: 0, w: 0}
- {x: 0, y: 0, z: 0, w: 0}
- {x: 0, y: 0, z: 0, w: 0}
- {x: 0, y: 0, z: 0, w: 0}
- {x: 0, y: 0, z: 0, w: 0}
- {x: 0, y: 0, z: 0, w: 0}
- {x: 0, y: 0, z: 0, w: 0}
- {x: 0, y: 0, z: 0, w: 0}
- {x: 0, y: 0, z: 0, w: 0}
- {x: 0, y: 0, z: 0, w: 0}
- {x: 0, y: 0, z: 0, w: 0}
- {x: 0, y: 0, z: 0, w: 0}
- {x: 0, y: 0, z: 0, w: 0}
- {x: 0, y: 0, z: 0, w: 0}
- {x: 0, y: 0, z: 0, w: 0}
- {x: 0, y: 0, z: 0, w: 0}
- {x: 0, y: 0, z: 0, w: 0}
- {x: 0, y: 0, z: 0, w: 0}
- {x: 0, y: 0, z: 0, w: 0}
- {x: 0, y: 0, z: 0, w: 0}
- {x: 0, y: 0, z: 0, w: 0}
- {x: 0, y: 0, z: 0, w: 0}
- {x: 0, y: 0, z: 0, w: 0}
- {x: 0, y: 0, z: 0, w: 0}
- {x: 0, y: 0, z: 0, w: 0}
- {x: 0, y: 0, z: 0, w: 0}
- {x: 0, y: 0, z: 0, w: 0}
- {x: 0, y: 0, z: 0, w: 0}
- {x: 0, y: 0, z: 0, w: 0}
- {x: 0, y: 0, z: 0, w: 0}
- {x: 0, y: 0, z: 0, w: 0}
- {x: 0, y: 0, z: 0, w: 0}
- {x: 0, y: 0, z: 0, w: 0}
- {x: 0, y: 0, z: 0, w: 0}
- {x: 0, y: 0, z: 0, w: 0}
- {x: 0, y: 0, z: 0, w: 0}
- {x: 0, y: 0, z: 0, w: 0}
- {x: 0, y: 0, z: 0, w: 0}
- {x: 0, y: 0, z: 0, w: 0}
- {x: 0, y: 0, z: 0, w: 0}
- {x: 0, y: 0, z: 0, w: 0}
- {x: 0, y: 0, z: 0, w: 0}
- {x: 0, y: 0, z: 0, w: 0}
maxShadowDistance: 400
maxShadowDistance: 1000
localSssParameters: {fileID: 0}
m_TextureSettings:
spotCookieSize: 128
pointCookieSize: 512

2
Assets/ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipeline.asset.meta


fileFormatVersion: 2
guid: e185fecca3c73cd47a09f1092663ef32
timeCreated: 1486997164
timeCreated: 1487689448
licenseType: Pro
NativeFormatImporter:
mainObjectFileID: 11400000

44
Assets/ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipeline.cs


// Those that are not will be refatored later.
// Debugging
public GlobalDebugSettings globalDebugSettings = new GlobalDebugSettings();
public GlobalDebugSettings globalDebugSettings = new GlobalDebugSettings();
public RenderingSettings renderingSettings = new RenderingSettings();
[SerializeField] ShadowSettings m_ShadowSettings = ShadowSettings.Default;
public SubsurfaceScatteringParameters localSssParameters;
[SerializeField] TextureSettings m_TextureSettings = TextureSettings.Default;
public RenderingSettings renderingSettings = new RenderingSettings();
public SubsurfaceScatteringSettings sssSettings = new SubsurfaceScatteringSettings();
[SerializeField]
ShadowSettings m_ShadowSettings = ShadowSettings.Default;
[SerializeField] TextureSettings m_TextureSettings = TextureSettings.Default;
public ShadowSettings shadowSettings { get { return m_ShadowSettings; } }
public TextureSettings textureSettings { get { return m_TextureSettings; } set { m_TextureSettings = value; } }

}
}
public SubsurfaceScatteringParameters sssParameters
{
get
{
if (SubsurfaceScatteringSettings.overrideSettings != null)
{
return SubsurfaceScatteringSettings.overrideSettings;
}
if (localSssParameters == null)
{
localSssParameters = CreateInstance<SubsurfaceScatteringParameters>();
}
return localSssParameters;
}
}
public void ApplyDebugSettings()
{
m_ShadowSettings.enabled = globalDebugSettings.lightingDebugSettings.enableShadows;

public void OnValidate()
{
globalDebugSettings.OnValidate();
sssSettings.OnValidate();
}
}

}
}
public void PushGlobalParams(HDCamera hdCamera, ScriptableRenderContext renderContext, SubsurfaceScatteringParameters sssParameters)
public void PushGlobalParams(HDCamera hdCamera, ScriptableRenderContext renderContext, SubsurfaceScatteringSettings sssParameters)
{
var cmd = new CommandBuffer {name = "Push Global Parameters"};

cmd.SetGlobalFloatArray("_ThicknessRemaps", sssParameters.thicknessRemaps);
cmd.SetGlobalVectorArray("_HalfRcpVariancesAndLerpWeights", sssParameters.halfRcpVariancesAndLerpWeights);
if (sssParameters.enableSSS)
if (globalDebugSettings.renderingDebugSettings.enableSSS)
{
cmd.EnableShaderKeyword("_SUBSURFACE_SCATTERING");
}

}
}
PushGlobalParams(hdCamera, renderContext, m_Owner.sssParameters);
PushGlobalParams(hdCamera, renderContext, m_Owner.sssSettings);
// Caution: We require sun light here as some sky use the sun light to render, mean UpdateSkyEnvironment
// must be call after BuildGPULightLists.

RenderDeferredLighting(hdCamera, renderContext, m_Owner.sssParameters.enableSSS);
RenderDeferredLighting(hdCamera, renderContext, m_Owner.globalDebugSettings.renderingDebugSettings.enableSSS);
CombineSubsurfaceScattering(hdCamera, renderContext, m_Owner.sssParameters);
CombineSubsurfaceScattering(hdCamera, renderContext, m_Owner.sssSettings);
// For opaque forward we have split rendering in two categories
// Material that are always forward and material that can be deferred or forward depends on render pipeline options (like switch to rendering forward only mode)

}
// Combines specular lighting and diffuse lighting with subsurface scattering.
void CombineSubsurfaceScattering(HDCamera hdCamera, ScriptableRenderContext context, SubsurfaceScatteringParameters sssParameters)
void CombineSubsurfaceScattering(HDCamera hdCamera, ScriptableRenderContext context, SubsurfaceScatteringSettings sssParameters)
if (!sssParameters.enableSSS) return;
if (!globalDebugSettings.renderingDebugSettings.enableSSS) return;
var cmd = new CommandBuffer() { name = "Subsurface Scattering Pass" };

2
Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/LayeredLit/LayeredLit.shader


//-------------------------------------------------------------------------------------
#define UNITY_MATERIAL_LIT // Need to be define before including Material.hlsl
// Use surface gradient normal mapping as it handle correctly triplanar normal mapping and multiple UVSet
#define SURFACE_GRADIENT
//-------------------------------------------------------------------------------------
// Include

2
Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/LayeredLit/LayeredLitTessellation.shader


#define UNITY_MATERIAL_LIT // Need to be define before including Material.hlsl
#define TESSELLATION_ON
// Use surface gradient normal mapping as it handle correctly triplanar normal mapping and multiple UVSet
#define SURFACE_GRADIENT
//-------------------------------------------------------------------------------------
// Include

2
Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Lit.shader


//-------------------------------------------------------------------------------------
#define UNITY_MATERIAL_LIT // Need to be define before including Material.hlsl
// Use surface gradient normal mapping as it handle correctly triplanar normal mapping and multiple UVSet
#define SURFACE_GRADIENT
//-------------------------------------------------------------------------------------
// Include

68
Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/LitData.hlsl


bool isTriplanar = false;
#if defined(_PER_PIXEL_DISPLACEMENT) && defined(_HEIGHTMAP)
// All variable are compile time value
ppdEnable = true;
isPlanar = layerTexCoord.base.mappingType == UV_MAPPING_PLANAR;
isTriplanar = layerTexCoord.base.mappingType == UV_MAPPING_TRIPLANAR;

float height; // final height processed
// planar/triplanar
float2 uvXZ;
float2 uvXY;
float2 uvZY;
GetTriplanarCoordinate(V, uvXZ, uvXY, uvZY);
// TODO: support object space planar/triplanar ?
// TODO: implement. Require 3 call to POM + dedicated viewDirTS based on triplanar convention
// apply the 3 offset on all layers
/*
float3 viewDirTS;
int numSteps;
// Perform a POM in each direction and modify appropriate texture coordinate
ppdParam.uv = layerTexCoord.base.uvZY;
viewDirTS = float3(V.x > 0.0 ? uvZY : -uvZY, V.x);
numSteps = (int)lerp(_PPDMaxSamples, _PPDMinSamples, viewDirTS.z);
float2 offsetZY = ParallaxOcclusionMapping(lod, _PPDLodThreshold, numSteps, viewDirTS, maxHeight, ppdParam, height);
// Apply offset to all triplanar UVSet
layerTexCoord.base.uvZY += offsetZY;
layerTexCoord.details.uvZY += offsetZY;
ppdParam.uv = layerTexCoord.base.uvXZ;
viewDirTS = float3(V.y > 0.0 ? uvXZ : -uvXZ, V.y);
numSteps = (int)lerp(_PPDMaxSamples, _PPDMinSamples, viewDirTS.z);
float2 offsetXZ = ParallaxOcclusionMapping(lod, _PPDLodThreshold, numSteps, viewDirTS, maxHeight, ppdParam, height);
layerTexCoord.base.uvXZ += offsetXZ;
layerTexCoord.details.uvXZ += offsetXZ;
ppdParam.uv = layerTexCoord.base0.uvZY;
ppdParam.uv = layerTexCoord.base.uvXY;
viewDirTS = float3(V.z > 0.0 ? uvXY : -uvXY, V.z);
numSteps = (int)lerp(_PPDMaxSamples, _PPDMinSamples, viewDirTS.z);
float2 offsetXY = ParallaxOcclusionMapping(lod, _PPDLodThreshold, numSteps, viewDirTS, maxHeight, ppdParam, height);
float3 viewDirTS = ;
int numSteps = (int)lerp(_PPDMaxSamples, _PPDMinSamples, abs(viewDirTS.z));
ParallaxOcclusionMapping(lod, _PPDLodThreshold, numSteps, viewDirTS, maxHeight, ppdParam);
layerTexCoord.base.uvXY += offsetXY;
layerTexCoord.details.uvXY += offsetXY;
(...)
*/
height = 0.0; // TODO
ppdParam.uv = layerTexCoord.base.uv;
ppdParam.uv = layerTexCoord.base.uv; // For planar it is uv too, not uvXZ
#ifdef SURFACE_GRADIENT
// The TBN is not normalize, normalize it to do per pixel displacement

float3x3 worldToTangent = input.worldToTangent;
#endif
// For planar the view vector is the world view vector (unless we want to support object triplanar ? and in this case used TransformWorldToObject)
// TODO: do we support object triplanar ? See ComputeLayerTexCoord
float3 viewDirTS = isPlanar ? float3(-V.xz, V.y) : TransformWorldToTangent(V, worldToTangent);
float3 viewDirTS = isPlanar ? float3(uvXZ, V.y) : TransformWorldToTangent(V, worldToTangent);
float2 offset;
ParallaxOcclusionMapping(lod, _PPDLodThreshold, numSteps, viewDirTS, 0.1 * maxHeight, ppdParam, offset, height);
float2 offset = ParallaxOcclusionMapping(lod, _PPDLodThreshold, numSteps, viewDirTS, 0.1 * maxHeight, ppdParam, height);
// Apply offset to all UVSet
// Apply offset to all UVSet0 / planar
layerTexCoord.details.uv += offset;
layerTexCoord.details.uv += isPlanar ? offset : _UVDetailsMappingMask.x * offset; // Only apply offset if details map use UVSet0 _UVDetailsMappingMask.x will be 1 in this case, else 0
}
// Since POM "pushes" geometry inwards (rather than extrude it), { height = height - 1 }.

ppdParam.mainHeightInfluence = 0.0;
#endif
float height;
float height; // final height processed
// We need to calculate the texture space direction. It depends on the mapping.
if (isTriplanar)

// TODO: do we support object triplanar ? See ComputeLayerTexCoord
float3 viewDirTS = isPlanar ? float3(-V.xz, V.y) : TransformWorldToTangent(V, worldToTangent);
int numSteps = (int)lerp(_PPDMaxSamples, _PPDMinSamples, viewDirTS.z);
float2 offset;
ParallaxOcclusionMapping(lod, _PPDLodThreshold, numSteps, viewDirTS, 0.1 * maxHeight, ppdParam, offset, height);
float2 offset = ParallaxOcclusionMapping(lod, _PPDLodThreshold, numSteps, viewDirTS, 0.1 * maxHeight, ppdParam, height);
// Apply offset to all planar UV if applicable
float4 planarWeight = float4( layerTexCoord.base0.mappingType == UV_MAPPING_PLANAR ? 1.0 : 0.0,

ZERO_INITIALIZE(LayerTexCoord, layerTexCoord);
GetLayerTexCoord(input, layerTexCoord);
ApplyPerPixelDisplacement(input, V, layerTexCoord);
float depthOffset = ApplyPerPixelDisplacement(input, V, layerTexCoord);
float depthOffset = 0.0;
#ifdef _DEPTHOFFSET_ON
ApplyDepthOffsetPositionInput(V, depthOffset, _ViewProjMatrix, posInput);
#endif

2
Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/LitDataInternal.hlsl


float2 uvXZ;
float2 uvXY;
float2 uvZY;
GetTriplanarCoordinate(positionWS * worldScale, layerTexCoord.vertexNormalWS, uvXZ, uvXY, uvZY);
GetTriplanarCoordinate(positionWS * worldScale, uvXZ, uvXY, uvZY);
// Planar is just XZ of triplanar
if (mappingType == UV_MAPPING_PLANAR)

2
Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/LitTessellation.shader


#define UNITY_MATERIAL_LIT // Need to be define before including Material.hlsl
#define TESSELLATION_ON
// Use surface gradient normal mapping as it handle correctly triplanar normal mapping and multiple UVSet
#define SURFACE_GRADIENT
//-------------------------------------------------------------------------------------
// Include

20
Assets/ScriptableRenderPipeline/ShaderLibrary/CommonMaterial.hlsl


return blendWeights;
}
// Planar/Triplanar convention for Unity
// position and vertex normal must be in the same space
void GetTriplanarCoordinate(float3 position, float3 vertexNormal, out float2 uvXZ, out float2 uvXY, out float2 uvZY)
{
float3 direction = sign(vertexNormal);
// In triplanar, if we are facing away from the world axis, a different axis will be flipped for each direction.
// This is particularly problematic for tangent space normal maps which need to be in the right direction.
// So we multiplying the offending coordinate by the sign of the normal.
uvXZ = -float2(position.x, direction.y * position.z);
uvXY = float2(-position.x, direction.z * position.y);
uvZY = float2(direction.x * position.z, position.y);
// Planar/Triplanar convention for Unity in world space
void GetTriplanarCoordinate(float3 position, out float2 uvXZ, out float2 uvXY, out float2 uvZY)
{
// Caution: This must follow the same rule as what is use for SurfaceGradient triplanar
// TODO: Currently the normal mapping looks wrong without SURFACE_GRADIENT option because we don't handle corretly the tangent space
uvXZ = float2(position.z, position.x);
uvXY = float2(position.x, position.y);
uvZY = float2(position.z, position.y);
}
float LerpWhiteTo(float b, float t)

15
Assets/ScriptableRenderPipeline/ShaderLibrary/PerPixelDisplacement.hlsl


// it return the offset to apply to the UVSet provide in PerPixelHeightDisplacementParam
// viewDirTS is view vector in texture space matching the UVSet
// ref: https://www.gamedev.net/resources/_/technical/graphics-programming-and-theory/a-closer-look-at-parallax-occlusion-mapping-r3262
void ParallaxOcclusionMapping(float lod, float lodThreshold, int numSteps, float3 viewDirTS, float maxHeight, PerPixelHeightDisplacementParam ppdParam, out float2 outOffset, out float outHeight)
float2 ParallaxOcclusionMapping(float lod, float lodThreshold, int numSteps, float3 viewDirTS, float maxHeight, PerPixelHeightDisplacementParam ppdParam, out float outHeight)
{
// Convention: 1.0 is top, 0.0 is bottom - POM is always inward, no extrusion
float stepSize = 1.0 / (float)numSteps;

float pt1 = rayHeight;
float delta0 = pt0 - prevHeight;
float delta1 = pt1 - currHeight;
// Secant method to affine the search
// Ref: Faster Relief Mapping Using the Secant Method - Eric Risser
for (int i = 0; i < 5; ++i)

}
#else // regular POM intersection
//float pt1 = rayHeight;
//float pt1 = rayHeight;
//float delta0 = pt0 - prevHeight;
//float delta1 = pt1 - currHeight;
//float intersectionHeight = (pt0 * delta1 - pt1 * delta0) / (delta1 - delta0);

#endif
outHeight = currHeight;
outOffset = offset;
outHeight = currHeight;
return offset;
}

3
Assets/ScriptableRenderPipeline/ShaderLibrary/SampleUVMappingNormalInternal.hlsl


#ifdef SURFACE_GRADIENT
else if (uvMapping.mappingType == UV_MAPPING_PLANAR)
{
float2 derivYPlane = UNPACK_DERIVATIVE_FUNC(SAMPLE_TEXTURE_FUNC(textureName, samplerName, uvMapping.uvXZ, param), scale);
// Note: Planar is on uv coordinate (and not uvXZ)
float2 derivYPlane = UNPACK_DERIVATIVE_FUNC(SAMPLE_TEXTURE_FUNC(textureName, samplerName, uvMapping.uv, param), scale);
// See comment above
float3 volumeGrad = float3(derivYPlane.y, 0.0, derivYPlane.x);
return SurfaceGradientFromVolumeGradient(uvMapping.normalWS, volumeGrad);

112
Assets/TestScenes/HDTest/CascadedShadowsTest.unity


m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1}
m_IndirectSpecularColor: {r: 0.21215841, g: 0.21215841, b: 0.21215841, a: 1}
--- !u!157 &3
LightmapSettings:
m_ObjectHideFlags: 0

m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 39480640}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!1 &44546677
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 44546679}
- component: {fileID: 44546678}
m_Layer: 0
m_Name: Scene Settings
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &44546678
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 44546677}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0e34c98127e05d340ba44a1d4a734454, type: 3}
m_Name:
m_EditorClassIdentifier:
m_CommonSettings: {fileID: 11400000, guid: 075f395cb6ba2534196f2ce83c32e633, type: 2}
m_SkySettings: {fileID: 11400000, guid: 622aa06566c087b41ac0edc80769f45f, type: 2}
--- !u!4 &44546679
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 44546677}
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: []
m_Father: {fileID: 0}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &58245422
GameObject:
m_ObjectHideFlags: 0

- {fileID: 451535687}
- {fileID: 2049083844}
m_Father: {fileID: 0}
m_RootOrder: 3
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &80788017
GameObject:

m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 2082161877}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!1 &2100643537
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 2100643540}
- component: {fileID: 2100643539}
- component: {fileID: 2100643538}
m_Layer: 0
m_Name: SceneSettings
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &2100643538
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 2100643537}
m_Enabled: 0
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 59b6606ef2548734bb6d11b9d160bc7e, type: 3}
m_Name:
m_EditorClassIdentifier:
rotation: 0
exposure: 0
multiplier: 1
resolution: 256
updateMode: 0
updatePeriod: 0
skyHDRI: {fileID: 8900000, guid: 805167636edb6ce4fb580f8da1053bad, type: 3}
--- !u!114 &2100643539
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 2100643537}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: bc357c46587fc9d4cb8f311794d7d2f3, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Settings:
m_ShadowMaxDistance: 1000
m_ShadowCascadeCount: 4
m_ShadowCascadeSplit0: 0.05
m_ShadowCascadeSplit1: 0.2
m_ShadowCascadeSplit2: 0.3
m_ShadowNearPlaneOffset: 5
--- !u!4 &2100643540
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 2100643537}
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: []
m_Father: {fileID: 0}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &2115816428
GameObject:
m_ObjectHideFlags: 0

9
Assets/TestScenes/HDTest/CascadedShadowsTest/CommonSettings_Cascaded.asset


m_Name: CommonSettings_Cascaded
m_EditorClassIdentifier:
m_Settings:
m_ShadowMaxDistance: 450
m_ShadowMaxDistance: 800
m_ShadowCascadeSplit0: 0.015
m_ShadowCascadeSplit1: 0.05
m_ShadowCascadeSplit2: 0.2
m_ShadowCascadeSplit0: 0.05
m_ShadowCascadeSplit1: 0.2
m_ShadowCascadeSplit2: 0.3
m_ShadowNearPlaneOffset: 10

2
Assets/TestScenes/HDTest/CascadedShadowsTest/CommonSettings_Cascaded.asset.meta


fileFormatVersion: 2
guid: 075f395cb6ba2534196f2ce83c32e633
timeCreated: 1485858348
timeCreated: 1487264310
licenseType: Pro
NativeFormatImporter:
mainObjectFileID: 11400000

6
Assets/TestScenes/HDTest/GraphicTest/Parallax Occlusion Mapping/Material/POM - Rock.mat


m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BaseColorMap:
m_Texture: {fileID: 2800000, guid: 37411c7405e8c1a42ac0a0f50983bd46, type: 3}
m_Texture: {fileID: 2800000, guid: 25f2c87d04c2d19479e747dc71259c7d, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:

m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _HeightMap:
m_Texture: {fileID: 2800000, guid: a3f1edea0cb01de42968bf3e4317f387, type: 3}
m_Texture: {fileID: 2800000, guid: 2fe61f09f223eab4a85aef4a327f3040, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:

m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _NormalMap:
m_Texture: {fileID: 2800000, guid: bbc15758a54df6f43a834cbf4e150d45, type: 3}
m_Texture: {fileID: 2800000, guid: 7b40159cc66d36e4baef6f3290b9078e, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:

8
Assets/TestScenes/HDTest/GraphicTest/Parallax Occlusion Mapping/Material/POM - Wood.mat


m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BaseColorMap:
m_Texture: {fileID: 2800000, guid: 0353c00d9bc99f14780836a6a51a6d97, type: 3}
m_Texture: {fileID: 2800000, guid: 927434958f610214aa6a4179f134f5fd, type: 3}
m_Scale: {x: 2, y: 2}
m_Offset: {x: 0, y: 0}
- _BumpMap:

m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _HeightMap:
m_Texture: {fileID: 2800000, guid: db7b513b0c2406e40be832dc28133281, type: 3}
m_Texture: {fileID: 2800000, guid: 870243a1ef675dd4cac0433df1aa80a3, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:

m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _NormalMap:
m_Texture: {fileID: 2800000, guid: ccbd506f77c77e04eaa274a3d3d417e3, type: 3}
m_Texture: {fileID: 2800000, guid: ca958f697884e254d8d7c1d8a2255a37, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:

- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 1
- _SurfaceType: 0
- _TexWorldScale: 1
- _TexWorldScale: 0.2
- _Thickness: 1
- _UVBase: 0
- _UVDetail: 0

6
Assets/TestScenes/HDTest/GraphicTest/Tessellation/Material/Tessellation - Rock.mat


m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BaseColorMap:
m_Texture: {fileID: 2800000, guid: 37411c7405e8c1a42ac0a0f50983bd46, type: 3}
m_Texture: {fileID: 2800000, guid: 25f2c87d04c2d19479e747dc71259c7d, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:

m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _HeightMap:
m_Texture: {fileID: 2800000, guid: a3f1edea0cb01de42968bf3e4317f387, type: 3}
m_Texture: {fileID: 2800000, guid: 2fe61f09f223eab4a85aef4a327f3040, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:

m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _NormalMap:
m_Texture: {fileID: 2800000, guid: bbc15758a54df6f43a834cbf4e150d45, type: 3}
m_Texture: {fileID: 2800000, guid: 7b40159cc66d36e4baef6f3290b9078e, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:

6
Assets/TestScenes/HDTest/GraphicTest/Tessellation/Material/Tessellation - Wood.mat


m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BaseColorMap:
m_Texture: {fileID: 2800000, guid: 0353c00d9bc99f14780836a6a51a6d97, type: 3}
m_Texture: {fileID: 2800000, guid: 927434958f610214aa6a4179f134f5fd, type: 3}
m_Scale: {x: 2, y: 2}
m_Offset: {x: 0, y: 0}
- _BumpMap:

m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _HeightMap:
m_Texture: {fileID: 2800000, guid: db7b513b0c2406e40be832dc28133281, type: 3}
m_Texture: {fileID: 2800000, guid: 870243a1ef675dd4cac0433df1aa80a3, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:

m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _NormalMap:
m_Texture: {fileID: 2800000, guid: ccbd506f77c77e04eaa274a3d3d417e3, type: 3}
m_Texture: {fileID: 2800000, guid: ca958f697884e254d8d7c1d8a2255a37, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:

887
Assets/TestScenes/HDTest/HDRenderLoopTest.unity
文件差异内容过多而无法显示
查看文件

9
ProjectSettings/GraphicsSettings.asset


m_DefaultRenderingPath: 1
m_DefaultMobileRenderingPath: 1
m_TierSettings:
- serializedVersion: 4
- serializedVersion: 5
m_BuildTarget: 1
m_Tier: 0
m_Settings:

useHDR: 1
useDetailNormalMap: 1
useCascadedShadowMaps: 1
prefer32BitShadowMaps: 0
- serializedVersion: 4
- serializedVersion: 5
m_BuildTarget: 1
m_Tier: 1
m_Settings:

useHDR: 1
useDetailNormalMap: 1
useCascadedShadowMaps: 1
prefer32BitShadowMaps: 0
- serializedVersion: 4
- serializedVersion: 5
m_BuildTarget: 1
m_Tier: 2
m_Settings:

useHDR: 1
useDetailNormalMap: 1
useCascadedShadowMaps: 1
prefer32BitShadowMaps: 0
useDitherMaskForAlphaBlendedShadows: 1
m_Automatic: 0
m_LightmapStripping: 0

12
Assets/TestScenes/HDTest/GraphicTest/LayeredTessellation/Material/Layer-2-woord-rock.mat


serializedVersion: 3
m_TexEnvs:
- _BaseColorMap0:
m_Texture: {fileID: 2800000, guid: 37411c7405e8c1a42ac0a0f50983bd46, type: 3}
m_Texture: {fileID: 2800000, guid: 25f2c87d04c2d19479e747dc71259c7d, type: 3}
m_Texture: {fileID: 2800000, guid: 0353c00d9bc99f14780836a6a51a6d97, type: 3}
m_Texture: {fileID: 2800000, guid: 927434958f610214aa6a4179f134f5fd, type: 3}
m_Scale: {x: 2, y: 2}
m_Offset: {x: 0, y: 0}
- _BaseColorMap2:

m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _HeightMap0:
m_Texture: {fileID: 2800000, guid: a3f1edea0cb01de42968bf3e4317f387, type: 3}
m_Texture: {fileID: 2800000, guid: 2fe61f09f223eab4a85aef4a327f3040, type: 3}
m_Texture: {fileID: 2800000, guid: db7b513b0c2406e40be832dc28133281, type: 3}
m_Texture: {fileID: 2800000, guid: 870243a1ef675dd4cac0433df1aa80a3, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _HeightMap2:

m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _NormalMap0:
m_Texture: {fileID: 2800000, guid: bbc15758a54df6f43a834cbf4e150d45, type: 3}
m_Texture: {fileID: 2800000, guid: 7b40159cc66d36e4baef6f3290b9078e, type: 3}
m_Texture: {fileID: 2800000, guid: ccbd506f77c77e04eaa274a3d3d417e3, type: 3}
m_Texture: {fileID: 2800000, guid: ca958f697884e254d8d7c1d8a2255a37, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _NormalMap2:

7
Assets/TestScenes/HDTest/GraphicTest/Common/Textures/FourShapesColor.tga.meta


fileFormatVersion: 2
guid: 0353c00d9bc99f14780836a6a51a6d97
guid: 927434958f610214aa6a4179f134f5fd
timeCreated: 1484821419
licenseType: Pro
TextureImporter:

textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
wrapMode: -1
wrapU: -1
wrapV: -1
wrapW: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50

7
Assets/TestScenes/HDTest/GraphicTest/Common/Textures/FourShapesRelief.tga.meta


fileFormatVersion: 2
guid: ccbd506f77c77e04eaa274a3d3d417e3
guid: ca958f697884e254d8d7c1d8a2255a37
timeCreated: 1484821420
licenseType: Pro
TextureImporter:

textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
wrapMode: -1
wrapU: -1
wrapV: -1
wrapW: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50

7
Assets/TestScenes/HDTest/GraphicTest/Common/Textures/FourShapesReliefHeightmap.tga.meta


fileFormatVersion: 2
guid: db7b513b0c2406e40be832dc28133281
guid: 870243a1ef675dd4cac0433df1aa80a3
timeCreated: 1484821420
licenseType: Pro
TextureImporter:

textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
wrapMode: -1
wrapU: -1
wrapV: -1
wrapW: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50

7
Assets/TestScenes/HDTest/GraphicTest/Common/Textures/RockColor.jpg.meta


fileFormatVersion: 2
guid: 37411c7405e8c1a42ac0a0f50983bd46
guid: 25f2c87d04c2d19479e747dc71259c7d
timeCreated: 1484821420
licenseType: Pro
TextureImporter:

textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
wrapMode: -1
wrapU: -1
wrapV: -1
wrapW: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50

7
Assets/TestScenes/HDTest/GraphicTest/Common/Textures/RockHeightmap.tga.meta


fileFormatVersion: 2
guid: a3f1edea0cb01de42968bf3e4317f387
guid: 2fe61f09f223eab4a85aef4a327f3040
timeCreated: 1484821420
licenseType: Pro
TextureImporter:

textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
wrapMode: -1
wrapU: -1
wrapV: -1
wrapW: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50

7
Assets/TestScenes/HDTest/GraphicTest/Common/Textures/RockRelief.tga.meta


fileFormatVersion: 2
guid: bbc15758a54df6f43a834cbf4e150d45
guid: 7b40159cc66d36e4baef6f3290b9078e
timeCreated: 1484821420
licenseType: Pro
TextureImporter:

textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
wrapMode: -1
wrapU: -1
wrapV: -1
wrapW: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50

295
Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/SubsurfaceScatteringSettings.cs


using System;
using UnityEngine.Rendering;
#if UNITY_EDITOR
using UnityEditor;
#endif
namespace UnityEngine.Experimental.Rendering.HDPipeline
{
[Serializable]
public class SubsurfaceScatteringProfile
{
public const int numSamples = 7; // Must be an odd number
[SerializeField, ColorUsage(false, true, 0.05f, 2.0f, 1.0f, 1.0f)]
public Color stdDev1;
[SerializeField, ColorUsage(false, true, 0.05f, 2.0f, 1.0f, 1.0f)]
public Color stdDev2;
[SerializeField]
public float lerpWeight;
[SerializeField]
public bool enableTransmission;
[SerializeField]
public Vector2 thicknessRemap;
[SerializeField] [HideInInspector]
Vector4[] m_FilterKernel;
[SerializeField] [HideInInspector]
Vector3[] m_HalfRcpVariances;
[SerializeField] [HideInInspector]
Vector4 m_HalfRcpWeightedVariances;
// --- Public Methods ---
public SubsurfaceScatteringProfile()
{
stdDev1 = new Color(0.3f, 0.3f, 0.3f, 0.0f);
stdDev2 = new Color(0.6f, 0.6f, 0.6f, 0.0f);
lerpWeight = 0.5f;
enableTransmission = false;
thicknessRemap = new Vector2(0, 3);
UpdateKernelAndVarianceData();
}
public Vector4[] filterKernel
{
// Set via UpdateKernelAndVarianceData().
get { return m_FilterKernel; }
}
public Vector3[] halfRcpVariances
{
// Set via UpdateKernelAndVarianceData().
get { return m_HalfRcpVariances; }
}
public Vector4 halfRcpWeightedVariances
{
// Set via UpdateKernelAndVarianceData().
get { return m_HalfRcpWeightedVariances; }
}
public void UpdateKernelAndVarianceData()
{
if (m_FilterKernel == null)
{
m_FilterKernel = new Vector4[numSamples];
}
if (m_HalfRcpVariances == null)
{
m_HalfRcpVariances = new Vector3[2];
}
// Our goal is to blur the image using a filter which is represented
// as a product of a linear combination of two normalized 1D Gaussians
// as suggested by Jimenez et al. in "Separable Subsurface Scattering".
// A normalized (i.e. energy-preserving) 1D Gaussian with the mean of 0
// is defined as follows: G1(x, v) = exp(-x� / (2 * v)) / sqrt(2 * Pi * v),
// where 'v' is variance and 'x' is the radial distance from the origin.
// Using the weight 'w', our 1D and the resulting 2D filters are given as:
// A1(v1, v2, w, x) = G1(x, v1) * (1 - w) + G1(r, v2) * w,
// A2(v1, v2, w, x, y) = A1(v1, v2, w, x) * A1(v1, v2, w, y).
// The resulting filter function is a non-Gaussian PDF.
// It is separable by design, but generally not radially symmetric.
// Find the widest Gaussian across 3 color channels.
float maxStdDev1 = Mathf.Max(stdDev1.r, stdDev1.g, stdDev1.b);
float maxStdDev2 = Mathf.Max(stdDev2.r, stdDev2.g, stdDev2.b);
Vector3 weightSum = new Vector3(0, 0, 0);
// Importance sample the linear combination of two Gaussians.
for (uint i = 0; i < numSamples; i++)
{
float u = (i + 0.5f) / numSamples;
float pos = GaussianCombinationCdfInverse(u, maxStdDev1, maxStdDev2, lerpWeight);
float pdf = GaussianCombination(pos, maxStdDev1, maxStdDev2, lerpWeight);
Vector3 val;
val.x = GaussianCombination(pos, stdDev1.r, stdDev2.r, lerpWeight);
val.y = GaussianCombination(pos, stdDev1.g, stdDev2.g, lerpWeight);
val.z = GaussianCombination(pos, stdDev1.b, stdDev2.b, lerpWeight);
// We do not divide by 'numSamples' since we will renormalize, anyway.
m_FilterKernel[i].x = val.x * (1 / pdf);
m_FilterKernel[i].y = val.y * (1 / pdf);
m_FilterKernel[i].z = val.z * (1 / pdf);
m_FilterKernel[i].w = pos;
weightSum.x += m_FilterKernel[i].x;
weightSum.y += m_FilterKernel[i].y;
weightSum.z += m_FilterKernel[i].z;
}
// Renormalize the weights to conserve energy.
for (uint i = 0; i < numSamples; i++)
{
m_FilterKernel[i].x *= 1 / weightSum.x;
m_FilterKernel[i].y *= 1 / weightSum.y;
m_FilterKernel[i].z *= 1 / weightSum.z;
}
// Store (1 / (2 * Variance)) per color channel per Gaussian.
m_HalfRcpVariances[0].x = 0.5f / (stdDev1.r * stdDev1.r);
m_HalfRcpVariances[0].y = 0.5f / (stdDev1.g * stdDev1.g);
m_HalfRcpVariances[0].z = 0.5f / (stdDev1.b * stdDev1.b);
m_HalfRcpVariances[1].x = 0.5f / (stdDev2.r * stdDev2.r);
m_HalfRcpVariances[1].y = 0.5f / (stdDev2.g * stdDev2.g);
m_HalfRcpVariances[1].z = 0.5f / (stdDev2.b * stdDev2.b);
Vector4 weightedStdDev;
weightedStdDev.x = Mathf.Lerp(stdDev1.r, stdDev2.r, lerpWeight);
weightedStdDev.y = Mathf.Lerp(stdDev1.g, stdDev2.g, lerpWeight);
weightedStdDev.z = Mathf.Lerp(stdDev1.b, stdDev2.b, lerpWeight);
weightedStdDev.w = Mathf.Lerp(maxStdDev1, maxStdDev2, lerpWeight);
// Store (1 / (2 * WeightedVariance)) per color channel.
m_HalfRcpWeightedVariances.x = 0.5f / (weightedStdDev.x * weightedStdDev.x);
m_HalfRcpWeightedVariances.y = 0.5f / (weightedStdDev.y * weightedStdDev.y);
m_HalfRcpWeightedVariances.z = 0.5f / (weightedStdDev.z * weightedStdDev.z);
m_HalfRcpWeightedVariances.w = 0.5f / (weightedStdDev.w * weightedStdDev.w);
}
// --- Private Methods ---
static float Gaussian(float x, float stdDev)
{
float variance = stdDev * stdDev;
return Mathf.Exp(-x * x / (2 * variance)) / Mathf.Sqrt(2 * Mathf.PI * variance);
}
static float GaussianCombination(float x, float stdDev1, float stdDev2, float lerpWeight)
{
return Mathf.Lerp(Gaussian(x, stdDev1), Gaussian(x, stdDev2), lerpWeight);
}
static float RationalApproximation(float t)
{
// Abramowitz and Stegun formula 26.2.23.
// The absolute value of the error should be less than 4.5 e-4.
float[] c = {2.515517f, 0.802853f, 0.010328f};
float[] d = {1.432788f, 0.189269f, 0.001308f};
return t - ((c[2] * t + c[1]) * t + c[0]) / (((d[2] * t + d[1]) * t + d[0]) * t + 1.0f);
}
// Ref: https://www.johndcook.com/blog/csharp_phi_inverse/
static float NormalCdfInverse(float p, float stdDev)
{
float x;
if (p < 0.5)
{
// F^-1(p) = - G^-1(p)
x = -RationalApproximation(Mathf.Sqrt(-2.0f * Mathf.Log(p)));
}
else
{
// F^-1(p) = G^-1(1-p)
x = RationalApproximation(Mathf.Sqrt(-2.0f * Mathf.Log(1.0f - p)));
}
return x * stdDev;
}
static float GaussianCombinationCdfInverse(float p, float stdDev1, float stdDev2, float lerpWeight)
{
return Mathf.Lerp(NormalCdfInverse(p, stdDev1), NormalCdfInverse(p, stdDev2), lerpWeight);
}
}
[Serializable]
public class SubsurfaceScatteringSettings
{
public const int maxNumProfiles = 8;
public int numProfiles;
public int transmissionFlags;
public SubsurfaceScatteringProfile[] profiles;
public float[] thicknessRemaps;
public Vector4[] halfRcpVariancesAndLerpWeights;
public Vector4[] halfRcpWeightedVariances;
public Vector4[] filterKernels;
// --- Public Methods ---
public SubsurfaceScatteringSettings()
{
numProfiles = 1;
profiles = new SubsurfaceScatteringProfile[numProfiles];
for (int i = 0; i < numProfiles; i++)
{
profiles[i] = new SubsurfaceScatteringProfile();
}
OnValidate();
}
public void OnValidate()
{
if (profiles.Length > maxNumProfiles)
{
Array.Resize(ref profiles, maxNumProfiles);
}
numProfiles = profiles.Length;
transmissionFlags = 0;
if (thicknessRemaps == null)
{
thicknessRemaps = new float[maxNumProfiles * 2];
}
if (halfRcpVariancesAndLerpWeights == null)
{
halfRcpVariancesAndLerpWeights = new Vector4[maxNumProfiles * 2];
}
if (halfRcpWeightedVariances == null)
{
halfRcpWeightedVariances = new Vector4[maxNumProfiles];
}
if (filterKernels == null)
{
filterKernels = new Vector4[maxNumProfiles * SubsurfaceScatteringProfile.numSamples];
}
Color c = new Color();
for (int i = 0; i < numProfiles; i++)
{
transmissionFlags |= (profiles[i].enableTransmission ? 1 : 0) << i;
c.r = Mathf.Clamp(profiles[i].stdDev1.r, 0.05f, 2.0f);
c.g = Mathf.Clamp(profiles[i].stdDev1.g, 0.05f, 2.0f);
c.b = Mathf.Clamp(profiles[i].stdDev1.b, 0.05f, 2.0f);
c.a = 0.0f;
profiles[i].stdDev1 = c;
c.r = Mathf.Clamp(profiles[i].stdDev2.r, 0.05f, 2.0f);
c.g = Mathf.Clamp(profiles[i].stdDev2.g, 0.05f, 2.0f);
c.b = Mathf.Clamp(profiles[i].stdDev2.b, 0.05f, 2.0f);
c.a = 0.0f;
profiles[i].stdDev2 = c;
profiles[i].lerpWeight = Mathf.Clamp01(profiles[i].lerpWeight);
profiles[i].thicknessRemap.x = Mathf.Clamp(profiles[i].thicknessRemap.x, 0, profiles[i].thicknessRemap.y);
profiles[i].thicknessRemap.y = Mathf.Max(profiles[i].thicknessRemap.x, profiles[i].thicknessRemap.y);
profiles[i].UpdateKernelAndVarianceData();
}
// Use the updated data to fill the cache.
for (int i = 0; i < numProfiles; i++)
{
thicknessRemaps[2 * i] = profiles[i].thicknessRemap.x;
thicknessRemaps[2 * i + 1] = profiles[i].thicknessRemap.y - profiles[i].thicknessRemap.x;
halfRcpVariancesAndLerpWeights[2 * i] = profiles[i].halfRcpVariances[0];
halfRcpVariancesAndLerpWeights[2 * i].w = 1.0f - profiles[i].lerpWeight;
halfRcpVariancesAndLerpWeights[2 * i + 1] = profiles[i].halfRcpVariances[1];
halfRcpVariancesAndLerpWeights[2 * i + 1].w = profiles[i].lerpWeight;
halfRcpWeightedVariances[i] = profiles[i].halfRcpWeightedVariances;
for (int j = 0, n = SubsurfaceScatteringProfile.numSamples; j < n; j++)
{
filterKernels[n * i + j] = profiles[i].filterKernel[j];
}
}
}
}
}

8
Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/SubsurfaceScatteringSettings.cs.meta


fileFormatVersion: 2
guid: cccb0727e6924014ebb35773fbfed141
timeCreated: 1487685614
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

20
Assets/TestScenes/HDTest/CascadedShadowsTest/HDRISkySettings_Cascaded.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: HDRISkySettings_Cascaded
m_EditorClassIdentifier:
rotation: 0
exposure: 0
multiplier: 1
resolution: 256
updateMode: 0
updatePeriod: 0
skyHDRI: {fileID: 0}

9
Assets/TestScenes/HDTest/CascadedShadowsTest/HDRISkySettings_Cascaded.asset.meta


fileFormatVersion: 2
guid: 622aa06566c087b41ac0edc80769f45f
timeCreated: 1487264328
licenseType: Pro
NativeFormatImporter:
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

9
Assets/TestScenes/HDTest/GraphicTest/LayeredTessellation/Material.meta


fileFormatVersion: 2
guid: 956ee5586345f3d4ea4c4fc743131204
folderAsset: yes
timeCreated: 1487627739
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

175
Assets/TestScenes/HDTest/GraphicTest/Parallax Occlusion Mapping/Material/POM - Rock planar.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: POM - Rock planar
m_Shader: {fileID: 4800000, guid: 6e4ae4064600d784cac1e41a9e6f2e59, type: 3}
m_ShaderKeywords: _HEIGHTMAP _MAPPING_PLANAR _NORMALMAP _NORMALMAP_TANGENT_SPACE
_PER_PIXEL_DISPLACEMENT
m_LightmapFlags: 4
m_EnableInstancingVariants: 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: 25f2c87d04c2d19479e747dc71259c7d, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
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}
- _DetailNormalMap:
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}
- _EmissionMap:
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: 2800000, guid: 2fe61f09f223eab4a85aef4a327f3040, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
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}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _NormalMap:
m_Texture: {fileID: 2800000, guid: 7b40159cc66d36e4baef6f3290b9078e, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
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}
- _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}
- _ThicknessMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _AlphaCutoff: 0.5
- _AlphaCutoffEnable: 0
- _Anisotropy: 0
- _BlendMode: 0
- _BumpScale: 1
- _CullMode: 2
- _Cutoff: 0.5
- _DepthOffsetEnable: 0
- _DetailAOScale: 1
- _DetailAlbedoScale: 1
- _DetailHeightScale: 1
- _DetailMapMode: 0
- _DetailNormalMapScale: 1
- _DetailNormalScale: 1
- _DetailSmoothnessScale: 1
- _DistortionDepthTest: 0
- _DistortionEnable: 0
- _DistortionOnly: 0
- _DoubleSidedEnable: 0
- _DoubleSidedMirrorEnable: 1
- _DoubleSidedMode: 0
- _DstBlend: 0
- _EmissiveColorMode: 1
- _EmissiveIntensity: 0
- _EnablePerPixelDisplacement: 1
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _HeightAmplitude: 0.09
- _HeightCenter: 0.5
- _HorizonFade: 1
- _MaterialID: 0
- _Metallic: 0
- _Mode: 0
- _NormalMapSpace: 0
- _NormalScale: 1
- _OcclusionStrength: 1
- _PPDLodThreshold: 5
- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _Parallax: 0.02
- _Smoothness: 0.5
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _StencilRef: 2
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 1
- _SurfaceType: 0
- _TexWorldScale: 0.1
- _Thickness: 1
- _UVBase: 1
- _UVDetail: 0
- _UVMappingPlanar: 0
- _UVSec: 0
- _ZTestMode: 8
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _EmissiveColor: {r: 0, g: 0, b: 0, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

9
Assets/TestScenes/HDTest/GraphicTest/Parallax Occlusion Mapping/Material/POM - Rock planar.mat.meta


fileFormatVersion: 2
guid: e7e1469b04b87ae4bac2441f1d4b2570
timeCreated: 1484821442
licenseType: Pro
NativeFormatImporter:
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:

175
Assets/TestScenes/HDTest/GraphicTest/Parallax Occlusion Mapping/Material/POM - Wood Planar.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: POM - Wood Planar
m_Shader: {fileID: 4800000, guid: 6e4ae4064600d784cac1e41a9e6f2e59, type: 3}
m_ShaderKeywords: _HEIGHTMAP _MAPPING_PLANAR _NORMALMAP _NORMALMAP_TANGENT_SPACE
_PER_PIXEL_DISPLACEMENT
m_LightmapFlags: 4
m_EnableInstancingVariants: 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: 927434958f610214aa6a4179f134f5fd, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
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}
- _DetailNormalMap:
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}
- _EmissionMap:
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: 2800000, guid: 870243a1ef675dd4cac0433df1aa80a3, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
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}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _NormalMap:
m_Texture: {fileID: 2800000, guid: ca958f697884e254d8d7c1d8a2255a37, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
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}
- _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}
- _ThicknessMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _AlphaCutoff: 0.5
- _AlphaCutoffEnable: 0
- _Anisotropy: 0
- _BlendMode: 0
- _BumpScale: 1
- _CullMode: 2
- _Cutoff: 0.5
- _DepthOffsetEnable: 0
- _DetailAOScale: 1
- _DetailAlbedoScale: 1
- _DetailHeightScale: 1
- _DetailMapMode: 0
- _DetailNormalMapScale: 1
- _DetailNormalScale: 1
- _DetailSmoothnessScale: 1
- _DistortionDepthTest: 0
- _DistortionEnable: 0
- _DistortionOnly: 0
- _DoubleSidedEnable: 0
- _DoubleSidedMirrorEnable: 1
- _DoubleSidedMode: 0
- _DstBlend: 0
- _EmissiveColorMode: 1
- _EmissiveIntensity: 0
- _EnablePerPixelDisplacement: 1
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _HeightAmplitude: 0.17
- _HeightCenter: 0.5
- _HorizonFade: 1
- _MaterialID: 0
- _Metallic: 0
- _Mode: 0
- _NormalMapSpace: 0
- _NormalScale: 1
- _OcclusionStrength: 1
- _PPDLodThreshold: 5
- _PPDMaxSamples: 15
- _PPDMinSamples: 1
- _Parallax: 0.02
- _Smoothness: 0.5
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _StencilRef: 2
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 1
- _SurfaceType: 0
- _TexWorldScale: 0.2
- _Thickness: 1
- _UVBase: 1
- _UVDetail: 0
- _UVMappingPlanar: 0
- _UVSec: 0
- _ZTestMode: 8
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _EmissiveColor: {r: 0, g: 0, b: 0, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

9
Assets/TestScenes/HDTest/GraphicTest/Parallax Occlusion Mapping/Material/POM - Wood Planar.mat.meta


fileFormatVersion: 2
guid: 19f7e1d983a5915459d8dc6dc616f864
timeCreated: 1484821457
licenseType: Pro
NativeFormatImporter:
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:

175
Assets/TestScenes/HDTest/GraphicTest/Parallax Occlusion Mapping/Material/POM - Wood triplanar.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: POM - Wood triplanar
m_Shader: {fileID: 4800000, guid: 6e4ae4064600d784cac1e41a9e6f2e59, type: 3}
m_ShaderKeywords: _ENABLEPERPIXELDISPLACEMENT_OFF _HEIGHTMAP _MAPPING_TRIPLANAR
_NORMALMAP _NORMALMAP_TANGENT_SPACE
m_LightmapFlags: 4
m_EnableInstancingVariants: 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: 927434958f610214aa6a4179f134f5fd, type: 3}
m_Scale: {x: 2, y: 2}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
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}
- _DetailNormalMap:
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}
- _EmissionMap:
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: 2800000, guid: 870243a1ef675dd4cac0433df1aa80a3, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
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}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _NormalMap:
m_Texture: {fileID: 2800000, guid: ca958f697884e254d8d7c1d8a2255a37, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
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}
- _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}
- _ThicknessMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _AlphaCutoff: 0.5
- _AlphaCutoffEnable: 0
- _Anisotropy: 0
- _BlendMode: 0
- _BumpScale: 1
- _CullMode: 2
- _Cutoff: 0.5
- _DepthOffsetEnable: 0
- _DetailAOScale: 1
- _DetailAlbedoScale: 1
- _DetailHeightScale: 1
- _DetailMapMode: 0
- _DetailNormalMapScale: 1
- _DetailNormalScale: 1
- _DetailSmoothnessScale: 1
- _DistortionDepthTest: 0
- _DistortionEnable: 0
- _DistortionOnly: 0
- _DoubleSidedEnable: 0
- _DoubleSidedMirrorEnable: 1
- _DoubleSidedMode: 0
- _DstBlend: 0
- _EmissiveColorMode: 1
- _EmissiveIntensity: 0
- _EnablePerPixelDisplacement: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _HeightAmplitude: 0.17
- _HeightCenter: 0.5
- _HorizonFade: 1
- _MaterialID: 0
- _Metallic: 0
- _Mode: 0
- _NormalMapSpace: 0
- _NormalScale: 1
- _OcclusionStrength: 1
- _PPDLodThreshold: 5
- _PPDMaxSamples: 15
- _PPDMinSamples: 1
- _Parallax: 0.02
- _Smoothness: 0.5
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _StencilRef: 2
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 1
- _SurfaceType: 0
- _TexWorldScale: 0.1
- _Thickness: 1
- _UVBase: 2
- _UVDetail: 0
- _UVMappingPlanar: 0
- _UVSec: 0
- _ZTestMode: 8
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _EmissiveColor: {r: 0, g: 0, b: 0, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

9
Assets/TestScenes/HDTest/GraphicTest/Parallax Occlusion Mapping/Material/POM - Wood triplanar.mat.meta


fileFormatVersion: 2
guid: 0089cd1f6067ec9449d0340daddfc68a
timeCreated: 1484821457
licenseType: Pro
NativeFormatImporter:
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:

9
Assets/TestScenes/HDTest/GraphicTest/Triplanar.meta


fileFormatVersion: 2
guid: 9efeff080508d264c93035c6f1d0cf47
folderAsset: yes
timeCreated: 1487627676
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

9
Assets/TestScenes/HDTest/GraphicTest/Triplanar/Material.meta


fileFormatVersion: 2
guid: 5c8f07414aa870c43996eea22693a5d6
folderAsset: yes
timeCreated: 1487627676
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

175
Assets/TestScenes/HDTest/GraphicTest/Triplanar/Material/Wood triplanar.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: Wood triplanar
m_Shader: {fileID: 4800000, guid: 6e4ae4064600d784cac1e41a9e6f2e59, type: 3}
m_ShaderKeywords: _HEIGHTMAP _MAPPING_TRIPLANAR _NORMALMAP _NORMALMAP_TANGENT_SPACE
_PER_PIXEL_DISPLACEMENT
m_LightmapFlags: 4
m_EnableInstancingVariants: 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: 927434958f610214aa6a4179f134f5fd, type: 3}
m_Scale: {x: 2, y: 2}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
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}
- _DetailNormalMap:
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}
- _EmissionMap:
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: 2800000, guid: 870243a1ef675dd4cac0433df1aa80a3, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
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}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _NormalMap:
m_Texture: {fileID: 2800000, guid: ca958f697884e254d8d7c1d8a2255a37, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
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}
- _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}
- _ThicknessMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _AlphaCutoff: 0.5
- _AlphaCutoffEnable: 0
- _Anisotropy: 0
- _BlendMode: 0
- _BumpScale: 1
- _CullMode: 2
- _Cutoff: 0.5
- _DepthOffsetEnable: 0
- _DetailAOScale: 1
- _DetailAlbedoScale: 1
- _DetailHeightScale: 1
- _DetailMapMode: 0
- _DetailNormalMapScale: 1
- _DetailNormalScale: 1
- _DetailSmoothnessScale: 1
- _DistortionDepthTest: 0
- _DistortionEnable: 0
- _DistortionOnly: 0
- _DoubleSidedEnable: 0
- _DoubleSidedMirrorEnable: 1
- _DoubleSidedMode: 0
- _DstBlend: 0
- _EmissiveColorMode: 1
- _EmissiveIntensity: 0
- _EnablePerPixelDisplacement: 1
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _HeightAmplitude: 0.17
- _HeightCenter: 0.5
- _HorizonFade: 1
- _MaterialID: 0
- _Metallic: 0
- _Mode: 0
- _NormalMapSpace: 0
- _NormalScale: 1
- _OcclusionStrength: 1
- _PPDLodThreshold: 5
- _PPDMaxSamples: 15
- _PPDMinSamples: 1
- _Parallax: 0.02
- _Smoothness: 0.5
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _StencilRef: 2
- _SubsurfaceProfile: 0
- _SubsurfaceRadius: 1
- _SurfaceType: 0
- _TexWorldScale: 0.1
- _Thickness: 1
- _UVBase: 2
- _UVDetail: 0
- _UVMappingPlanar: 0
- _UVSec: 0
- _ZTestMode: 8
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _EmissiveColor: {r: 0, g: 0, b: 0, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}

9
Assets/TestScenes/HDTest/GraphicTest/Triplanar/Material/Wood triplanar.mat.meta


fileFormatVersion: 2
guid: 998e1f8e78cb5a546808b041e32b928b
timeCreated: 1484821457
licenseType: Pro
NativeFormatImporter:
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:

12
Assets/ScriptableRenderPipeline/HDRenderPipeline/SceneSettings/SubsurfaceScatteringParameters.cs.meta


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

509
Assets/ScriptableRenderPipeline/HDRenderPipeline/SceneSettings/SubsurfaceScatteringParameters.cs


using System;
using UnityEngine.Rendering;
#if UNITY_EDITOR
using UnityEditor;
#endif
namespace UnityEngine.Experimental.Rendering.HDPipeline
{
[Serializable]
public class SubsurfaceScatteringProfile
{
public const int numSamples = 7; // Must be an odd number
[SerializeField, ColorUsage(false, true, 0.05f, 2.0f, 1.0f, 1.0f)]
public Color stdDev1;
[SerializeField, ColorUsage(false, true, 0.05f, 2.0f, 1.0f, 1.0f)]
public Color stdDev2;
[SerializeField]
public float lerpWeight;
[SerializeField]
public bool enableTransmission;
[SerializeField]
public Vector2 thicknessRemap;
[SerializeField] [HideInInspector]
Vector4[] m_FilterKernel;
[SerializeField] [HideInInspector]
Vector3[] m_HalfRcpVariances;
[SerializeField] [HideInInspector]
Vector4 m_HalfRcpWeightedVariances;
// --- Public Methods ---
public SubsurfaceScatteringProfile()
{
stdDev1 = new Color(0.3f, 0.3f, 0.3f, 0.0f);
stdDev2 = new Color(0.6f, 0.6f, 0.6f, 0.0f);
lerpWeight = 0.5f;
enableTransmission = false;
thicknessRemap = new Vector2(0, 3);
UpdateKernelAndVarianceData();
}
public Vector4[] filterKernel
{
// Set via UpdateKernelAndVarianceData().
get { return m_FilterKernel; }
}
public Vector3[] halfRcpVariances
{
// Set via UpdateKernelAndVarianceData().
get { return m_HalfRcpVariances; }
}
public Vector4 halfRcpWeightedVariances
{
// Set via UpdateKernelAndVarianceData().
get { return m_HalfRcpWeightedVariances; }
}
public void UpdateKernelAndVarianceData()
{
if (m_FilterKernel == null)
{
m_FilterKernel = new Vector4[numSamples];
}
if (m_HalfRcpVariances == null)
{
m_HalfRcpVariances = new Vector3[2];
}
// Our goal is to blur the image using a filter which is represented
// as a product of a linear combination of two normalized 1D Gaussians
// as suggested by Jimenez et al. in "Separable Subsurface Scattering".
// A normalized (i.e. energy-preserving) 1D Gaussian with the mean of 0
// is defined as follows: G1(x, v) = exp(-x� / (2 * v)) / sqrt(2 * Pi * v),
// where 'v' is variance and 'x' is the radial distance from the origin.
// Using the weight 'w', our 1D and the resulting 2D filters are given as:
// A1(v1, v2, w, x) = G1(x, v1) * (1 - w) + G1(r, v2) * w,
// A2(v1, v2, w, x, y) = A1(v1, v2, w, x) * A1(v1, v2, w, y).
// The resulting filter function is a non-Gaussian PDF.
// It is separable by design, but generally not radially symmetric.
// Find the widest Gaussian across 3 color channels.
float maxStdDev1 = Mathf.Max(stdDev1.r, stdDev1.g, stdDev1.b);
float maxStdDev2 = Mathf.Max(stdDev2.r, stdDev2.g, stdDev2.b);
Vector3 weightSum = new Vector3(0, 0, 0);
// Importance sample the linear combination of two Gaussians.
for (uint i = 0; i < numSamples; i++)
{
float u = (i + 0.5f) / numSamples;
float pos = GaussianCombinationCdfInverse(u, maxStdDev1, maxStdDev2, lerpWeight);
float pdf = GaussianCombination(pos, maxStdDev1, maxStdDev2, lerpWeight);
Vector3 val;
val.x = GaussianCombination(pos, stdDev1.r, stdDev2.r, lerpWeight);
val.y = GaussianCombination(pos, stdDev1.g, stdDev2.g, lerpWeight);
val.z = GaussianCombination(pos, stdDev1.b, stdDev2.b, lerpWeight);
// We do not divide by 'numSamples' since we will renormalize, anyway.
m_FilterKernel[i].x = val.x * (1 / pdf);
m_FilterKernel[i].y = val.y * (1 / pdf);
m_FilterKernel[i].z = val.z * (1 / pdf);
m_FilterKernel[i].w = pos;
weightSum.x += m_FilterKernel[i].x;
weightSum.y += m_FilterKernel[i].y;
weightSum.z += m_FilterKernel[i].z;
}
// Renormalize the weights to conserve energy.
for (uint i = 0; i < numSamples; i++)
{
m_FilterKernel[i].x *= 1 / weightSum.x;
m_FilterKernel[i].y *= 1 / weightSum.y;
m_FilterKernel[i].z *= 1 / weightSum.z;
}
// Store (1 / (2 * Variance)) per color channel per Gaussian.
m_HalfRcpVariances[0].x = 0.5f / (stdDev1.r * stdDev1.r);
m_HalfRcpVariances[0].y = 0.5f / (stdDev1.g * stdDev1.g);
m_HalfRcpVariances[0].z = 0.5f / (stdDev1.b * stdDev1.b);
m_HalfRcpVariances[1].x = 0.5f / (stdDev2.r * stdDev2.r);
m_HalfRcpVariances[1].y = 0.5f / (stdDev2.g * stdDev2.g);
m_HalfRcpVariances[1].z = 0.5f / (stdDev2.b * stdDev2.b);
Vector4 weightedStdDev;
weightedStdDev.x = Mathf.Lerp(stdDev1.r, stdDev2.r, lerpWeight);
weightedStdDev.y = Mathf.Lerp(stdDev1.g, stdDev2.g, lerpWeight);
weightedStdDev.z = Mathf.Lerp(stdDev1.b, stdDev2.b, lerpWeight);
weightedStdDev.w = Mathf.Lerp(maxStdDev1, maxStdDev2, lerpWeight);
// Store (1 / (2 * WeightedVariance)) per color channel.
m_HalfRcpWeightedVariances.x = 0.5f / (weightedStdDev.x * weightedStdDev.x);
m_HalfRcpWeightedVariances.y = 0.5f / (weightedStdDev.y * weightedStdDev.y);
m_HalfRcpWeightedVariances.z = 0.5f / (weightedStdDev.z * weightedStdDev.z);
m_HalfRcpWeightedVariances.w = 0.5f / (weightedStdDev.w * weightedStdDev.w);
}
// --- Private Methods ---
static float Gaussian(float x, float stdDev)
{
float variance = stdDev * stdDev;
return Mathf.Exp(-x * x / (2 * variance)) / Mathf.Sqrt(2 * Mathf.PI * variance);
}
static float GaussianCombination(float x, float stdDev1, float stdDev2, float lerpWeight)
{
return Mathf.Lerp(Gaussian(x, stdDev1), Gaussian(x, stdDev2), lerpWeight);
}
static float RationalApproximation(float t)
{
// Abramowitz and Stegun formula 26.2.23.
// The absolute value of the error should be less than 4.5 e-4.
float[] c = {2.515517f, 0.802853f, 0.010328f};
float[] d = {1.432788f, 0.189269f, 0.001308f};
return t - ((c[2] * t + c[1]) * t + c[0]) / (((d[2] * t + d[1]) * t + d[0]) * t + 1.0f);
}
// Ref: https://www.johndcook.com/blog/csharp_phi_inverse/
static float NormalCdfInverse(float p, float stdDev)
{
float x;
if (p < 0.5)
{
// F^-1(p) = - G^-1(p)
x = -RationalApproximation(Mathf.Sqrt(-2.0f * Mathf.Log(p)));
}
else
{
// F^-1(p) = G^-1(1-p)
x = RationalApproximation(Mathf.Sqrt(-2.0f * Mathf.Log(1.0f - p)));
}
return x * stdDev;
}
static float GaussianCombinationCdfInverse(float p, float stdDev1, float stdDev2, float lerpWeight)
{
return Mathf.Lerp(NormalCdfInverse(p, stdDev1), NormalCdfInverse(p, stdDev2), lerpWeight);
}
}
public class SubsurfaceScatteringParameters : ScriptableObject
{
public const int maxNumProfiles = 8;
[SerializeField]
bool m_EnableSSS;
[SerializeField]
int m_NumProfiles;
[SerializeField]
int m_TransmissionFlags;
[SerializeField]
SubsurfaceScatteringProfile[] m_Profiles;
[SerializeField]
float[] m_ThicknessRemaps;
[SerializeField]
Vector4[] m_HalfRcpVariancesAndLerpWeights;
[SerializeField]
Vector4[] m_HalfRcpWeightedVariances;
[SerializeField]
Vector4[] m_FilterKernels;
// --- Public Methods ---
public SubsurfaceScatteringParameters()
{
m_EnableSSS = true;
m_NumProfiles = 1;
m_Profiles = new SubsurfaceScatteringProfile[m_NumProfiles];
for (int i = 0; i < m_NumProfiles; i++)
{
m_Profiles[i] = new SubsurfaceScatteringProfile();
}
OnValidate();
}
public bool enableSSS {
// Set via serialization.
get { return m_EnableSSS; }
}
public SubsurfaceScatteringProfile[] profiles {
// Set via serialization.
get { return m_Profiles; }
}
// Returns a bit mask s.t. the i-th bit indicates whether the i-th profile requires transmittance evaluation.
// Supplies '_TransmissionFlags' to Lit.hlsl.
public int transmissionFlags {
// Set during OnValidate().
get { return m_TransmissionFlags; }
}
// Supplies '_ThicknessRemaps' to Lit.hlsl.
public float[] thicknessRemaps
{
// Set during OnValidate().
get { return m_ThicknessRemaps; }
}
// Supplies '_HalfRcpVariancesAndLerpWeights' to Lit.hlsl.
public Vector4[] halfRcpVariancesAndLerpWeights {
// Set during OnValidate().
get { return m_HalfRcpVariancesAndLerpWeights; }
}
// Supplies '_HalfRcpWeightedVariances' to CombineSubsurfaceScattering.shader.
public Vector4[] halfRcpWeightedVariances {
// Set during OnValidate().
get { return m_HalfRcpWeightedVariances; }
}
// Supplies '_FilterKernels' to CombineSubsurfaceScattering.shader.
public Vector4[] filterKernels
{
// Set during OnValidate().
get { return m_FilterKernels; }
}
public void OnValidate()
{
if (m_Profiles.Length > maxNumProfiles)
{
Array.Resize(ref m_Profiles, maxNumProfiles);
}
m_NumProfiles = m_Profiles.Length;
m_TransmissionFlags = 0;
if (m_ThicknessRemaps == null)
{
m_ThicknessRemaps = new float[maxNumProfiles * 2];
}
if (m_HalfRcpVariancesAndLerpWeights == null)
{
m_HalfRcpVariancesAndLerpWeights = new Vector4[maxNumProfiles * 2];
}
if (m_HalfRcpWeightedVariances == null)
{
m_HalfRcpWeightedVariances = new Vector4[maxNumProfiles];
}
if (m_FilterKernels == null)
{
m_FilterKernels = new Vector4[maxNumProfiles * SubsurfaceScatteringProfile.numSamples];
}
Color c = new Color();
for (int i = 0; i < m_NumProfiles; i++)
{
m_TransmissionFlags |= (m_Profiles[i].enableTransmission ? 1 : 0) << i;
c.r = Mathf.Clamp(m_Profiles[i].stdDev1.r, 0.05f, 2.0f);
c.g = Mathf.Clamp(m_Profiles[i].stdDev1.g, 0.05f, 2.0f);
c.b = Mathf.Clamp(m_Profiles[i].stdDev1.b, 0.05f, 2.0f);
c.a = 0.0f;
m_Profiles[i].stdDev1 = c;
c.r = Mathf.Clamp(m_Profiles[i].stdDev2.r, 0.05f, 2.0f);
c.g = Mathf.Clamp(m_Profiles[i].stdDev2.g, 0.05f, 2.0f);
c.b = Mathf.Clamp(m_Profiles[i].stdDev2.b, 0.05f, 2.0f);
c.a = 0.0f;
m_Profiles[i].stdDev2 = c;
m_Profiles[i].lerpWeight = Mathf.Clamp01(m_Profiles[i].lerpWeight);
m_Profiles[i].thicknessRemap.x = Mathf.Clamp(m_Profiles[i].thicknessRemap.x, 0, m_Profiles[i].thicknessRemap.y);
m_Profiles[i].thicknessRemap.y = Mathf.Max(m_Profiles[i].thicknessRemap.x, m_Profiles[i].thicknessRemap.y);
m_Profiles[i].UpdateKernelAndVarianceData();
}
// Use the updated data to fill the cache.
for (int i = 0; i < m_NumProfiles; i++)
{
m_ThicknessRemaps[2 * i] = m_Profiles[i].thicknessRemap.x;
m_ThicknessRemaps[2 * i + 1] = m_Profiles[i].thicknessRemap.y - m_Profiles[i].thicknessRemap.x;
m_HalfRcpVariancesAndLerpWeights[2 * i] = m_Profiles[i].halfRcpVariances[0];
m_HalfRcpVariancesAndLerpWeights[2 * i].w = 1.0f - m_Profiles[i].lerpWeight;
m_HalfRcpVariancesAndLerpWeights[2 * i + 1] = m_Profiles[i].halfRcpVariances[1];
m_HalfRcpVariancesAndLerpWeights[2 * i + 1].w = m_Profiles[i].lerpWeight;
m_HalfRcpWeightedVariances[i] = m_Profiles[i].halfRcpWeightedVariances;
for (int j = 0, n = SubsurfaceScatteringProfile.numSamples; j < n; j++)
{
m_FilterKernels[n * i + j] = m_Profiles[i].filterKernel[j];
}
}
}
}
public class SubsurfaceScatteringSettings : Singleton<SubsurfaceScatteringSettings>
{
SubsurfaceScatteringParameters settings { get; set; }
public static SubsurfaceScatteringParameters overrideSettings
{
get { return instance.settings; }
set { instance.settings = value; }
}
}
#if UNITY_EDITOR
[CustomEditor(typeof(SubsurfaceScatteringParameters))]
public class SubsurfaceScatteringParametersEditor : Editor
{
private class Styles
{
public readonly GUIContent category = new GUIContent("Subsurface scattering parameters");
public readonly GUIContent[] profiles = new GUIContent[SubsurfaceScatteringParameters.maxNumProfiles] { new GUIContent("Profile #0"), new GUIContent("Profile #1"), new GUIContent("Profile #2"), new GUIContent("Profile #3"), new GUIContent("Profile #4"), new GUIContent("Profile #5"), new GUIContent("Profile #6"), new GUIContent("Profile #7") };
public readonly GUIContent profilePreview0 = new GUIContent("Profile preview");
public readonly GUIContent profilePreview1 = new GUIContent("Shows the fraction of light scattered from the source as radius increases to 1.");
public readonly GUIContent profilePreview2 = new GUIContent("Note that the intensity of the region in the center may be clamped.");
public readonly GUIContent transmittancePreview0 = new GUIContent("Transmittance preview");
public readonly GUIContent transmittancePreview1 = new GUIContent("Shows the fraction of light passing through the object as thickness increases to 1.");
public readonly GUIContent numProfiles = new GUIContent("Number of profiles");
public readonly GUIContent profileStdDev1 = new GUIContent("Standard deviation #1", "Determines the shape of the 1st Gaussian filter. Increases the strength and the radius of the blur of the corresponding color channel.");
public readonly GUIContent profileStdDev2 = new GUIContent("Standard deviation #2", "Determines the shape of the 2nd Gaussian filter. Increases the strength and the radius of the blur of the corresponding color channel.");
public readonly GUIContent profileLerpWeight = new GUIContent("Filter interpolation", "Controls linear interpolation between the two Gaussian filters.");
public readonly GUIContent profileTransmission = new GUIContent("Enable transmission", "Toggles simulation of light passing through thin objects. Depends on the thickness of the material.");
public readonly GUIContent profileThicknessRemap = new GUIContent("Thickness remap", "Remaps the thickness parameter from [0, 1] to the desired range.");
public readonly GUIStyle centeredMiniBoldLabel = new GUIStyle (GUI.skin.label);
}
private static Styles s_Styles;
private SerializedProperty m_EnableSSS, m_Profiles, m_NumProfiles;
private Material m_ProfileMaterial, m_TransmittanceMaterial;
private RenderTexture[] m_ProfileImages, m_TransmittanceImages;
// --- Public Methods ---
private static Styles styles
{
get
{
if (s_Styles == null)
{
s_Styles = new Styles();
s_Styles.centeredMiniBoldLabel.alignment = TextAnchor.MiddleCenter;
s_Styles.centeredMiniBoldLabel.fontSize = 10;
s_Styles.centeredMiniBoldLabel.fontStyle = FontStyle.Bold;
}
return s_Styles;
}
}
void OnEnable()
{
m_EnableSSS = serializedObject.FindProperty("m_EnableSSS");
m_Profiles = serializedObject.FindProperty("m_Profiles");
m_NumProfiles = m_Profiles.FindPropertyRelative("Array.size");
m_ProfileMaterial = Utilities.CreateEngineMaterial("Hidden/HDRenderPipeline/DrawGaussianProfile");
m_TransmittanceMaterial = Utilities.CreateEngineMaterial("Hidden/HDRenderPipeline/DrawTransmittanceGraph");
m_ProfileImages = new RenderTexture[SubsurfaceScatteringParameters.maxNumProfiles];
m_TransmittanceImages = new RenderTexture[SubsurfaceScatteringParameters.maxNumProfiles];
for (int i = 0; i < SubsurfaceScatteringParameters.maxNumProfiles; i++)
{
m_ProfileImages[i] = new RenderTexture(256, 256, 0, RenderTextureFormat.DefaultHDR);
m_TransmittanceImages[i] = new RenderTexture(16, 256, 0, RenderTextureFormat.DefaultHDR);
}
}
public override void OnInspectorGUI()
{
serializedObject.Update();
EditorGUI.BeginChangeCheck();
// Validate the data before displaying it.
((SubsurfaceScatteringParameters)serializedObject.targetObject).OnValidate();
EditorGUILayout.LabelField(styles.category, EditorStyles.boldLabel);
EditorGUILayout.PropertyField(m_EnableSSS);
EditorGUILayout.PropertyField(m_NumProfiles, styles.numProfiles);
EditorGUILayout.PropertyField(m_Profiles);
if (m_Profiles.isExpanded)
{
EditorGUI.indentLevel++;
for (int i = 0, n = Math.Min(m_Profiles.arraySize, SubsurfaceScatteringParameters.maxNumProfiles); i < n; i++)
{
SerializedProperty profile = m_Profiles.GetArrayElementAtIndex(i);
EditorGUILayout.PropertyField(profile, styles.profiles[i]);
if (profile.isExpanded)
{
EditorGUI.indentLevel++;
SerializedProperty profileStdDev1 = profile.FindPropertyRelative("stdDev1");
SerializedProperty profileStdDev2 = profile.FindPropertyRelative("stdDev2");
SerializedProperty profileLerpWeight = profile.FindPropertyRelative("lerpWeight");
SerializedProperty profileTransmission = profile.FindPropertyRelative("enableTransmission");
SerializedProperty profileThicknessRemap = profile.FindPropertyRelative("thicknessRemap");
EditorGUILayout.PropertyField(profileStdDev1, styles.profileStdDev1);
EditorGUILayout.PropertyField(profileStdDev2, styles.profileStdDev2);
EditorGUILayout.PropertyField(profileLerpWeight, styles.profileLerpWeight);
EditorGUILayout.PropertyField(profileTransmission, styles.profileTransmission);
Vector2 thicknessRemap = profileThicknessRemap.vector2Value;
EditorGUILayout.LabelField("Min thickness: ", thicknessRemap.x.ToString());
EditorGUILayout.LabelField("Max thickness: ", thicknessRemap.y.ToString());
EditorGUILayout.MinMaxSlider(styles.profileThicknessRemap, ref thicknessRemap.x, ref thicknessRemap.y, 0, 10);
profileThicknessRemap.vector2Value = thicknessRemap;
EditorGUILayout.Space();
EditorGUILayout.LabelField(styles.profilePreview0, styles.centeredMiniBoldLabel);
EditorGUILayout.LabelField(styles.profilePreview1, EditorStyles.centeredGreyMiniLabel);
EditorGUILayout.LabelField(styles.profilePreview2, EditorStyles.centeredGreyMiniLabel);
EditorGUILayout.Space();
// Draw the profile.
m_ProfileMaterial.SetColor("_StdDev1", profileStdDev1.colorValue);
m_ProfileMaterial.SetColor("_StdDev2", profileStdDev2.colorValue);
m_ProfileMaterial.SetFloat("_LerpWeight", profileLerpWeight.floatValue);
EditorGUI.DrawPreviewTexture(GUILayoutUtility.GetRect(256, 256), m_ProfileImages[i], m_ProfileMaterial, ScaleMode.ScaleToFit, 1.0f);
EditorGUILayout.Space();
EditorGUILayout.LabelField(styles.transmittancePreview0, styles.centeredMiniBoldLabel);
EditorGUILayout.LabelField(styles.transmittancePreview1, EditorStyles.centeredGreyMiniLabel);
EditorGUILayout.Space();
// Draw the transmittance graph.
m_TransmittanceMaterial.SetColor("_StdDev1", profileStdDev1.colorValue);
m_TransmittanceMaterial.SetColor("_StdDev2", profileStdDev2.colorValue);
m_TransmittanceMaterial.SetFloat("_LerpWeight", profileLerpWeight.floatValue);
m_TransmittanceMaterial.SetVector("_ThicknessRemap", profileThicknessRemap.vector2Value);
EditorGUI.DrawPreviewTexture(GUILayoutUtility.GetRect(16, 16), m_TransmittanceImages[i], m_TransmittanceMaterial, ScaleMode.ScaleToFit, 16.0f);
EditorGUILayout.Space();
EditorGUI.indentLevel--;
}
}
EditorGUI.indentLevel--;
}
if (EditorGUI.EndChangeCheck())
{
// Serialization does not invoke setters, but does call OnValidate().
serializedObject.ApplyModifiedProperties();
}
}
}
#endif
}

9
Assets/TestScenes/HDTest/GraphicTest/Parallax Occlusion Mapping/Textures.meta


fileFormatVersion: 2
guid: 0a646597d80703d48add34acf3a04212
folderAsset: yes
timeCreated: 1484821419
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

9
Assets/TestScenes/HDTest/GraphicTest/Tessellation/Textures.meta


fileFormatVersion: 2
guid: c7be485d3168a55498cd871c89da7505
folderAsset: yes
timeCreated: 1484821419
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

/Assets/TestScenes/HDTest/GraphicTest/LayeredTessellation/Layer-2-woord-rock.mat → /Assets/TestScenes/HDTest/GraphicTest/LayeredTessellation/Material/Layer-2-woord-rock.mat

/Assets/TestScenes/HDTest/GraphicTest/LayeredTessellation/Layer-2-woord-rock.mat.meta → /Assets/TestScenes/HDTest/GraphicTest/LayeredTessellation/Material/Layer-2-woord-rock.mat.meta

/Assets/TestScenes/HDTest/GraphicTest/Parallax Occlusion Mapping/Textures/FourShapesColor.tga → /Assets/TestScenes/HDTest/GraphicTest/Common/Textures/FourShapesColor.tga

/Assets/TestScenes/HDTest/GraphicTest/Parallax Occlusion Mapping/Textures/FourShapesColor.tga.meta → /Assets/TestScenes/HDTest/GraphicTest/Common/Textures/FourShapesColor.tga.meta

/Assets/TestScenes/HDTest/GraphicTest/Parallax Occlusion Mapping/Textures/FourShapesRelief.tga → /Assets/TestScenes/HDTest/GraphicTest/Common/Textures/FourShapesRelief.tga

/Assets/TestScenes/HDTest/GraphicTest/Parallax Occlusion Mapping/Textures/FourShapesRelief.tga.meta → /Assets/TestScenes/HDTest/GraphicTest/Common/Textures/FourShapesRelief.tga.meta

/Assets/TestScenes/HDTest/GraphicTest/Parallax Occlusion Mapping/Textures/FourShapesReliefHeightmap.tga → /Assets/TestScenes/HDTest/GraphicTest/Common/Textures/FourShapesReliefHeightmap.tga

/Assets/TestScenes/HDTest/GraphicTest/Parallax Occlusion Mapping/Textures/FourShapesReliefHeightmap.tga.meta → /Assets/TestScenes/HDTest/GraphicTest/Common/Textures/FourShapesReliefHeightmap.tga.meta

/Assets/TestScenes/HDTest/GraphicTest/Parallax Occlusion Mapping/Textures/RockColor.jpg → /Assets/TestScenes/HDTest/GraphicTest/Common/Textures/RockColor.jpg

/Assets/TestScenes/HDTest/GraphicTest/Parallax Occlusion Mapping/Textures/RockColor.jpg.meta → /Assets/TestScenes/HDTest/GraphicTest/Common/Textures/RockColor.jpg.meta

/Assets/TestScenes/HDTest/GraphicTest/Parallax Occlusion Mapping/Textures/RockHeightmap.tga → /Assets/TestScenes/HDTest/GraphicTest/Common/Textures/RockHeightmap.tga

/Assets/TestScenes/HDTest/GraphicTest/Parallax Occlusion Mapping/Textures/RockHeightmap.tga.meta → /Assets/TestScenes/HDTest/GraphicTest/Common/Textures/RockHeightmap.tga.meta

/Assets/TestScenes/HDTest/GraphicTest/Parallax Occlusion Mapping/Textures/RockRelief.tga → /Assets/TestScenes/HDTest/GraphicTest/Common/Textures/RockRelief.tga

/Assets/TestScenes/HDTest/GraphicTest/Parallax Occlusion Mapping/Textures/RockRelief.tga.meta → /Assets/TestScenes/HDTest/GraphicTest/Common/Textures/RockRelief.tga.meta

正在加载...
取消
保存