Evgenii Golubev 8 年前
当前提交
f38f5e1a
共有 284 个文件被更改,包括 2004 次插入699 次删除
  1. 102
      Assets/BasicRenderLoopTutorial/BasicRenderLoop.cs
  2. 4
      Assets/Editor/Tests/RenderloopTests/CullResultsTest.cs
  3. 40
      Assets/Editor/Tests/RenderloopTests/RenderloopTestFixture.cs
  4. 2
      Assets/Editor/Tests/ShaderGeneratorTests/ShaderGeneratorTests.cs
  5. 10
      Assets/ScriptableRenderLoop/AdditionalLightData.cs
  6. 5
      Assets/ScriptableRenderLoop/Editor/MaterialUpgrader.cs
  7. 2
      Assets/ScriptableRenderLoop/RenderPasses/ShadowRenderPass.cs
  8. 35
      Assets/ScriptableRenderLoop/ShaderLibrary/Common.hlsl
  9. 11
      Assets/ScriptableRenderLoop/ShaderLibrary/Packing.hlsl
  10. 2
      Assets/ScriptableRenderLoop/common/TextureSettings.cs
  11. 75
      Assets/ScriptableRenderLoop/core/RenderPipeline.cs
  12. 84
      Assets/ScriptableRenderLoop/fptl/FptlLighting.cs
  13. 2
      Assets/ScriptableRenderLoop/fptl/LightDefinitions.cs
  14. 5
      Assets/ShaderGenerator/Editor/CSharpToHLSL.cs
  15. 4
      Assets/ShaderGenerator/Editor/ShaderGeneratorMenu.cs
  16. 4
      Assets/ShaderGenerator/Editor/ShaderTypeGeneration.cs
  17. 2
      Assets/ShaderGenerator/ShaderGeneratorAttributes.cs
  18. 5
      Assets/TestScenes/HDTest/GlobalIlluminationTest/TestRealtime.cs
  19. 896
      Assets/TestScenes/HDTest/LayeredLitTest.unity
  20. 25
      Assets/TestScenes/HDTest/LayeredLitTest/Material/Layered_BlendColor.mat
  21. 28
      Assets/TestScenes/HDTest/LayeredLitTest/Material/Layered_BlendMask.mat
  22. 14
      Assets/TestScenes/HDTest/LayeredLitTest/Material/Layered_Layer0_Planar.mat
  23. 14
      Assets/TestScenes/HDTest/LayeredLitTest/Material/Layered_Layer0_Triplanar.mat
  24. 28
      Assets/TestScenes/HDTest/LayeredLitTest/Material/Layered_Layer0_UV0.mat
  25. 25
      Assets/TestScenes/HDTest/LayeredLitTest/Material/Layered_Layer0_UV1.mat
  26. 14
      Assets/TestScenes/HDTest/LayeredLitTest/Material/Layered_Layer0_UV2.mat
  27. 14
      Assets/TestScenes/HDTest/LayeredLitTest/Material/Layered_Layer0_UV3.mat
  28. 14
      Assets/TestScenes/HDTest/LayeredLitTest/Material/Layered_Layer1_Planar.mat
  29. 14
      Assets/TestScenes/HDTest/LayeredLitTest/Material/Layered_Layer1_Triplanar.mat
  30. 27
      Assets/TestScenes/HDTest/LayeredLitTest/Material/Layered_Layer1_UV0.mat
  31. 27
      Assets/TestScenes/HDTest/LayeredLitTest/Material/Layered_Layer1_UV1.mat
  32. 14
      Assets/TestScenes/HDTest/LayeredLitTest/Material/Layered_Layer1_UV2.mat
  33. 14
      Assets/TestScenes/HDTest/LayeredLitTest/Material/Layered_Layer1_UV3.mat
  34. 16
      Assets/TestScenes/HDTest/LayeredLitTest/Material/Layered_Layer2_Planar.mat
  35. 16
      Assets/TestScenes/HDTest/LayeredLitTest/Material/Layered_Layer2_Triplanar.mat
  36. 28
      Assets/TestScenes/HDTest/LayeredLitTest/Material/Layered_Layer2_UV0.mat
  37. 28
      Assets/TestScenes/HDTest/LayeredLitTest/Material/Layered_Layer2_UV1.mat
  38. 16
      Assets/TestScenes/HDTest/LayeredLitTest/Material/Layered_Layer2_UV2.mat
  39. 16
      Assets/TestScenes/HDTest/LayeredLitTest/Material/Layered_Layer2_UV3.mat
  40. 22
      Assets/TestScenes/HDTest/LayeredLitTest/Material/Layered_Layer3_Planar.mat
  41. 18
      Assets/TestScenes/HDTest/LayeredLitTest/Material/Layered_Layer3_Triplanar.mat
  42. 30
      Assets/TestScenes/HDTest/LayeredLitTest/Material/Layered_Layer3_UV0.mat
  43. 30
      Assets/TestScenes/HDTest/LayeredLitTest/Material/Layered_Layer3_UV1.mat
  44. 18
      Assets/TestScenes/HDTest/LayeredLitTest/Material/Layered_Layer3_UV2.mat
  45. 18
      Assets/TestScenes/HDTest/LayeredLitTest/Material/Layered_Layer3_UV3.mat
  46. 9
      Assets/TestScenes/HDTest/LayeredLitTest/Material/Lit_UVChart_Layer2_Detail.mat
  47. 12
      Assets/TestScenes/HDTest/LayeredLitTest/Material/Lit_White_Detail.mat
  48. 10
      ProjectSettings/GraphicsSettings.asset
  49. 4
      Assets/ScriptableRenderLoop/HDRenderPipeline/Shadow/FixedSizePCF/FixedSizePCF.cs
  50. 2
      Assets/ScriptableRenderLoop/HDRenderPipeline/Lighting.meta
  51. 2
      Assets/ScriptableRenderLoop/HDRenderPipeline/Material.meta
  52. 2
      Assets/ScriptableRenderLoop/HDRenderPipeline/ShaderConfig.cs
  53. 2
      Assets/ScriptableRenderLoop/HDRenderPipeline/ShaderConfig.cs.hlsl
  54. 4
      Assets/ScriptableRenderLoop/HDRenderPipeline/PostProcess/Resources/FinalPass.shader
  55. 8
      Assets/ScriptableRenderLoop/HDRenderPipeline/Debug/Resources/DebugViewTiles.shader
  56. 10
      Assets/ScriptableRenderLoop/HDRenderPipeline/Debug/Resources/DebugViewMaterialGBuffer.shader
  57. 2
      Assets/ScriptableRenderLoop/HDRenderPipeline/Debug/DebugViewMaterial.cs.hlsl
  58. 6
      Assets/ScriptableRenderLoop/HDRenderPipeline/Debug/DebugViewMaterial.cs
  59. 24
      Assets/ScriptableRenderLoop/HDRenderPipeline/Editor/HDRenderPipelineMenuItems.cs
  60. 48
      Assets/ScriptableRenderLoop/HDRenderPipeline/Editor/HDRenderPipelineInspector.cs
  61. 16
      Assets/ScriptableRenderLoop/HDRenderPipeline/Editor/UpgradeStandardShaderMaterials.cs
  62. 2
      Assets/ScriptableRenderLoop/HDRenderPipeline/Sky.meta
  63. 60
      Assets/ScriptableRenderLoop/HDRenderPipeline/Utilities.cs
  64. 2
      Assets/ScriptableRenderLoop/HDRenderPipeline/SceneSettings/Editor/CommonSettingsEditor.cs
  65. 28
      Assets/ScriptableRenderLoop/HDRenderPipeline/SceneSettings/CommonSettings.cs
  66. 285
      Assets/ScriptableRenderLoop/HDRenderPipeline/HDRenderPipeline.cs
  67. 15
      Assets/ScriptableRenderLoop/HDRenderPipeline/Lighting/TilePass/TilePass.hlsl
  68. 2
      Assets/ScriptableRenderLoop/HDRenderPipeline/Lighting/TilePass/TilePass.cs.hlsl
  69. 26
      Assets/ScriptableRenderLoop/HDRenderPipeline/Lighting/TilePass/TilePass.cs
  70. 120
      Assets/ScriptableRenderLoop/HDRenderPipeline/Lighting/TilePass/Resources/shadeopaque.compute
  71. 2
      Assets/ScriptableRenderLoop/HDRenderPipeline/Lighting/TilePass.meta
  72. 8
      Assets/ScriptableRenderLoop/HDRenderPipeline/Lighting/Resources/Deferred.shader
  73. 12
      Assets/ScriptableRenderLoop/HDRenderPipeline/Lighting/Lighting.hlsl
  74. 8
      Assets/ScriptableRenderLoop/HDRenderPipeline/Lighting/LightLoop.cs
  75. 12
      Assets/ScriptableRenderLoop/HDRenderPipeline/Lighting/LightDefinition.cs.hlsl
  76. 6
      Assets/ScriptableRenderLoop/HDRenderPipeline/Lighting/LightDefinition.cs
  77. 4
      Assets/ScriptableRenderLoop/HDRenderPipeline/ShaderPass/ShaderPass.cs
  78. 2
      Assets/ScriptableRenderLoop/HDRenderPipeline/ShaderPass/ShaderPass.cs.hlsl
  79. 2
      Assets/ScriptableRenderLoop/HDRenderPipeline/ShaderPass/ShaderPassLightTransport.hlsl
  80. 4
      Assets/ScriptableRenderLoop/HDRenderPipeline/Sky/SkyRenderer.cs
  81. 20
      Assets/ScriptableRenderLoop/HDRenderPipeline/Sky/SkyParameters.cs
  82. 2
      Assets/ScriptableRenderLoop/HDRenderPipeline/Sky/SkyManager.cs.hlsl
  83. 46
      Assets/ScriptableRenderLoop/HDRenderPipeline/Sky/SkyManager.cs
  84. 2
      Assets/ScriptableRenderLoop/HDRenderPipeline/Sky/Resources/GGXConvolve.shader
  85. 2
      Assets/ScriptableRenderLoop/HDRenderPipeline/Sky/ProceduralSky/Resources/SkyProcedural.shader
  86. 8
      Assets/ScriptableRenderLoop/HDRenderPipeline/Sky/ProceduralSky/ProceduralSkyRenderer.cs
  87. 2
      Assets/ScriptableRenderLoop/HDRenderPipeline/Sky/ProceduralSky/ProceduralSkyParameters.cs
  88. 2
      Assets/ScriptableRenderLoop/HDRenderPipeline/Sky/ProceduralSky/Editor/ProceduralSkyEditor.cs
  89. 2
      Assets/ScriptableRenderLoop/HDRenderPipeline/Sky/HDRISky/Resources/SkyHDRI.shader
  90. 8
      Assets/ScriptableRenderLoop/HDRenderPipeline/Sky/HDRISky/HDRISkyRenderer.cs
  91. 2
      Assets/ScriptableRenderLoop/HDRenderPipeline/Sky/HDRISky/HDRISkyParameters.cs
  92. 2
      Assets/ScriptableRenderLoop/HDRenderPipeline/Sky/HDRISky/Editor/HDRISkyEditor.cs
  93. 2
      Assets/ScriptableRenderLoop/HDRenderPipeline/Material/LayeredLit.meta
  94. 2
      Assets/ScriptableRenderLoop/HDRenderPipeline/Material/Lit.meta
  95. 2
      Assets/ScriptableRenderLoop/HDRenderPipeline/Material/Attributes.hlsl
  96. 2
      Assets/ScriptableRenderLoop/HDRenderPipeline/Material/Builtin/BuiltinData.cs.hlsl
  97. 2
      Assets/ScriptableRenderLoop/HDRenderPipeline/Material/Builtin/BuiltinData.cs
  98. 10
      Assets/ScriptableRenderLoop/HDRenderPipeline/Material/Unlit/Unlit.shader
  99. 2
      Assets/ScriptableRenderLoop/HDRenderPipeline/Material/Unlit/Unlit.cs.hlsl
  100. 4
      Assets/ScriptableRenderLoop/HDRenderPipeline/Material/Unlit/Unlit.cs

102
Assets/BasicRenderLoopTutorial/BasicRenderLoop.cs


using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Experimental.Rendering;
using UnityEngine.ScriptableRenderPipeline;
// Very basic scriptable rendering loop example:
// - Use with BasicRenderLoopShader.shader (the loop expects "BasicPass" pass type to exist)

// - This loop also does not setup lightmaps, light probes, reflection probes or light cookies
[ExecuteInEditMode]
public class BasicRenderLoop : RenderPipeline
public class BasicRenderLoop : RenderPipelineAsset
[UnityEditor.MenuItem("Renderloop/Create BasicRenderLoop")]
[UnityEditor.MenuItem("RenderPipeline/Create BasicRenderLoop")]
static void CreateBasicRenderLoop()
{
var instance = ScriptableObject.CreateInstance<BasicRenderLoop>();

[NonSerialized]
readonly List<Camera> m_CamerasToRender = new List<Camera>();
public override void Render(ScriptableRenderContext renderLoop, IScriptableRenderDataStore dataStore)
protected override IRenderPipeline InternalCreatePipeline()
base.Render(renderLoop, dataStore);
cameraProvider.GetCamerasToRender(m_CamerasToRender);
Render(renderLoop, m_CamerasToRender);
CleanCameras(m_CamerasToRender);
m_CamerasToRender.Clear();
return new BasicRenderLoopInstance();
}
}
public class BasicRenderLoopInstance : RenderPipeline
{
public override void Render(ScriptableRenderContext renderContext, Camera[] cameras)
{
base.Render(renderContext, cameras);
BasicRendering.Render(renderContext, cameras);
}
public static class BasicRendering
{
public static void Render(ScriptableRenderContext context, IEnumerable<Camera> cameras)
{
foreach (var camera in cameras)

if (!CullResults.GetCullingParameters (camera, out cullingParams))
if (!CullResults.GetCullingParameters(camera, out cullingParams))
CullResults cull = CullResults.Cull (ref cullingParams, context);
CullResults cull = CullResults.Cull(ref cullingParams, context);
context.SetupCameraProperties (camera);
context.SetupCameraProperties(camera);
// clear depth buffer
var cmd = new CommandBuffer();

// Setup global lighting shader variables
SetupLightShaderVariables (cull.visibleLights, context);
SetupLightShaderVariables(cull.visibleLights, context);
var settings = new DrawRendererSettings (cull, camera, new ShaderPassName("BasicPass"));
var settings = new DrawRendererSettings(cull, camera, new ShaderPassName("BasicPass"));
settings.inputFilter.SetQueuesOpaque ();
context.DrawRenderers (ref settings);
settings.inputFilter.SetQueuesOpaque();
context.DrawRenderers(ref settings);
context.DrawSkybox (camera);
context.DrawSkybox(camera);
settings.inputFilter.SetQueuesTransparent ();
context.DrawRenderers (ref settings);
settings.inputFilter.SetQueuesTransparent();
context.DrawRenderers(ref settings);
context.Submit ();
context.Submit();
static void SetupLightShaderVariables (VisibleLight[] lights, ScriptableRenderContext context)
private static void SetupLightShaderVariables(VisibleLight[] lights, ScriptableRenderContext context)
{
// We only support up to 8 visible lights here. More complex approaches would
// be doing some sort of per-object light setups, but here we go for simplest possible

// to the viewer, so that "most important" lights in the scene are picked, and not the 8
// that happened to be first.
int lightCount = Mathf.Min (lights.Length, kMaxLights);
int lightCount = Mathf.Min(lights.Length, kMaxLights);
// Prepare light data
Vector4[] lightColors = new Vector4[kMaxLights];

if (light.lightType == LightType.Directional)
{
// light position for directional lights is: (-direction, 0)
var dir = light.localToWorld.GetColumn (2);
lightPositions[i] = new Vector4 (-dir.x, -dir.y, -dir.z, 0);
var dir = light.localToWorld.GetColumn(2);
lightPositions[i] = new Vector4(-dir.x, -dir.y, -dir.z, 0);
var pos = light.localToWorld.GetColumn (3);
lightPositions[i] = new Vector4 (pos.x, pos.y, pos.z, 1);
var pos = light.localToWorld.GetColumn(3);
lightPositions[i] = new Vector4(pos.x, pos.y, pos.z, 1);
}
// attenuation set in a way where distance attenuation can be computed:
// float lengthSq = dot(toLight, toLight);

// spot direction & attenuation
if (light.lightType == LightType.Spot)
{
var dir = light.localToWorld.GetColumn (2);
lightSpotDirections[i] = new Vector4 (-dir.x, -dir.y, -dir.z, 0);
var dir = light.localToWorld.GetColumn(2);
lightSpotDirections[i] = new Vector4(-dir.x, -dir.y, -dir.z, 0);
float cosTheta = Mathf.Cos (radAngle * 0.25f);
float cosPhi = Mathf.Cos (radAngle * 0.5f);
float cosTheta = Mathf.Cos(radAngle * 0.25f);
float cosPhi = Mathf.Cos(radAngle * 0.5f);
lightAtten[i] = new Vector4 (cosPhi, (cosDiff != 0.0f) ? 1.0f / cosDiff : 1.0f, quadAtten, rangeSq);
lightAtten[i] = new Vector4(cosPhi, (cosDiff != 0.0f) ? 1.0f / cosDiff : 1.0f, quadAtten, rangeSq);
lightSpotDirections[i] = new Vector4 (0, 0, 1, 0);
lightAtten[i] = new Vector4 (-1, 1, quadAtten, rangeSq);
lightSpotDirections[i] = new Vector4(0, 0, 1, 0);
lightAtten[i] = new Vector4(-1, 1, quadAtten, rangeSq);
}
}
GetShaderConstantsFromNormalizedSH (ref ambientSH, shConstants);
GetShaderConstantsFromNormalizedSH(ref ambientSH, shConstants);
cmd.SetGlobalVectorArray ("globalLightColor", lightColors);
cmd.SetGlobalVectorArray ("globalLightPos", lightPositions);
cmd.SetGlobalVectorArray ("globalLightSpotDir", lightSpotDirections);
cmd.SetGlobalVectorArray ("globalLightAtten", lightAtten);
cmd.SetGlobalVector ("globalLightCount", new Vector4 (lightCount, 0, 0, 0));
cmd.SetGlobalVectorArray ("globalSH", shConstants);
context.ExecuteCommandBuffer (cmd);
cmd.Dispose ();
cmd.SetGlobalVectorArray("globalLightColor", lightColors);
cmd.SetGlobalVectorArray("globalLightPos", lightPositions);
cmd.SetGlobalVectorArray("globalLightSpotDir", lightSpotDirections);
cmd.SetGlobalVectorArray("globalLightAtten", lightAtten);
cmd.SetGlobalVector("globalLightCount", new Vector4(lightCount, 0, 0, 0));
cmd.SetGlobalVectorArray("globalSH", shConstants);
context.ExecuteCommandBuffer(cmd);
cmd.Dispose();
static void GetShaderConstantsFromNormalizedSH (ref SphericalHarmonicsL2 ambientProbe, Vector4[] outCoefficients)
private static void GetShaderConstantsFromNormalizedSH(ref SphericalHarmonicsL2 ambientProbe, Vector4[] outCoefficients)
{
for (int channelIdx = 0; channelIdx < 3; ++channelIdx)
{

outCoefficients[6].z = ambientProbe[2, 8];
outCoefficients[6].w = 1.0f;
}
}

4
Assets/Editor/Tests/RenderloopTests/CullResultsTest.cs


[TestFixture]
public class CullResultsTest
{
void InspectCullResults(Camera camera, CullResults cullResults, ScriptableRenderContext renderLoop)
void InspectCullResults(Camera camera, CullResults cullResults, ScriptableRenderContext renderContext)
{
VisibleReflectionProbe[] probes = cullResults.visibleReflectionProbes;

public void TestReflectionProbes()
{
UnityEditor.SceneManagement.EditorSceneManager.OpenScene("Assets/Editor/Tests/TestScene.unity");
RenderLoopTestFixture.Run(InspectCullResults);
RenderLoopTestFixtureInstance.Run(InspectCullResults);
}
}

40
Assets/Editor/Tests/RenderloopTests/RenderloopTestFixture.cs


using System;
using System.Collections.Generic;
using UnityEngine.ScriptableRenderPipeline;
public class RenderLoopTestFixture : RenderPipeline
public class RenderLoopTestFixture : RenderPipelineAsset
public delegate void TestDelegate(Camera camera, CullResults cullResults, ScriptableRenderContext renderLoop);
private static TestDelegate s_Callback;
protected override IRenderPipeline InternalCreatePipeline()
{
return new BasicRenderLoopInstance();
}
}
private static RenderLoopTestFixture m_Instance;
public class RenderLoopTestFixtureInstance : RenderPipeline
{
public delegate void TestDelegate(Camera camera, CullResults cullResults, ScriptableRenderContext renderContext);
[NonSerialized]
readonly List<Camera> m_CamerasToRender = new List<Camera>();
private static TestDelegate s_Callback;
public override void Render(ScriptableRenderContext renderLoop, IScriptableRenderDataStore dataStore)
private static RenderLoopTestFixture m_Instance;
public override void Render(ScriptableRenderContext renderContext, Camera[] cameras)
cameraProvider.GetCamerasToRender(m_CamerasToRender);
base.Render(renderContext, cameras);
foreach (var camera in m_CamerasToRender)
foreach (var camera in cameras)
CullResults cullResults = CullResults.Cull(ref cullingParams, renderLoop);
CullResults cullResults = CullResults.Cull(ref cullingParams, renderContext);
s_Callback(camera, cullResults, renderLoop);
s_Callback(camera, cullResults, renderContext);
renderLoop.Submit();
CleanCameras(m_CamerasToRender);
m_CamerasToRender.Clear();
renderContext.Submit();
public static void Run(TestDelegate renderCallback)
{
if (m_Instance == null)

2
Assets/Editor/Tests/ShaderGeneratorTests/ShaderGeneratorTests.cs


using UnityEngine;
using UnityEditor;
using UnityEngine.Experimental.Rendering;
using UnityEngine.Experimental.ScriptableRenderLoop;
using UnityEditor.Experimental.Rendering;
[TestFixture]
public class ShaderGeneratorTests

10
Assets/ScriptableRenderLoop/AdditionalLightData.cs


namespace UnityEngine.Experimental.ScriptableRenderLoop
namespace UnityEngine.Experimental.Rendering
{
public enum LightArchetype {Punctual, Rectangle, Line};

return DefaultShadowResolution;
}
[RangeAttribute(0.0F, 100.0F)]
[Range(0.0F, 100.0F)]
private float m_innerSpotPercent = 0.0F;
public float GetInnerSpotPercent01()

[RangeAttribute(0.0F, 1.0F)]
[Range(0.0F, 1.0F)]
public float shadowDimmer = 1.0f;
public bool affectDiffuse = true;

public bool isDoubleSided = false;
[RangeAttribute(0.0f, 20.0f)]
[Range(0.0f, 20.0f)]
[RangeAttribute(0.0f, 20.0f)]
[Range(0.0f, 20.0f)]
public float areaLightWidth = 0.0f;
}
}

5
Assets/ScriptableRenderLoop/Editor/MaterialUpgrader.cs


using System.Collections;
using System.Collections.Generic;
using System.Collections.Generic;
namespace UnityEditor.Experimental.ScriptableRenderLoop
namespace UnityEditor.Experimental.Rendering
{
public class MaterialUpgrader
{

2
Assets/ScriptableRenderLoop/RenderPasses/ShadowRenderPass.cs


using System.Collections.Generic;
using System;
namespace UnityEngine.Experimental.ScriptableRenderLoop
namespace UnityEngine.Experimental.Rendering
{
[System.Serializable]
public class ShadowSettings

35
Assets/ScriptableRenderLoop/ShaderLibrary/Common.hlsl


float4 t = a; a = b; b = t;
}
#define CUBEMAPFACE_POSITIVE_X 0
#define CUBEMAPFACE_NEGATIVE_X 1
#define CUBEMAPFACE_POSITIVE_Y 2
#define CUBEMAPFACE_NEGATIVE_Y 3
#define CUBEMAPFACE_POSITIVE_Z 4
#define CUBEMAPFACE_NEGATIVE_Z 5
#ifndef INTRINSIC_CUBEMAP_FACE_ID
// TODO: implement this. Is the reference implementation of cubemapID provide by AMD the reverse of our ?
/*

return faceID;
}
*/
#endif // INTRINSIC_CUBEMAP_FACE_ID
#define CUBEMAPFACE_POSITIVE_X 0
#define CUBEMAPFACE_NEGATIVE_X 1
#define CUBEMAPFACE_POSITIVE_Y 2
#define CUBEMAPFACE_NEGATIVE_Y 3
#define CUBEMAPFACE_POSITIVE_Z 4
#define CUBEMAPFACE_NEGATIVE_Z 5
void GetCubeFaceID(float3 dir, out int faceIndex)
{

faceIndex = dir.y > 0.0 ? CUBEMAPFACE_NEGATIVE_Y : CUBEMAPFACE_POSITIVE_Y;
}
}
#endif // INTRINSIC_CUBEMAP_FACE_ID
// ----------------------------------------------------------------------------
// Common math definition and fastmath function

}
// ----------------------------------------------------------------------------
// Texture format sampling
// ----------------------------------------------------------------------------
float2 DirectionToLatLongCoordinate(float3 dir)
{
// coordinate frame is (-Z, X) meaning negative Z is primary axis and X is secondary axis.
return float2(1.0 - 0.5 * INV_PI * atan2(dir.x, -dir.z), asin(dir.y) * INV_PI + 0.5);
}
// ----------------------------------------------------------------------------
// Z buffer to linear 0..1 depth
// Z buffer to linear 0..1 depth (0 at near plane, 1 at far plane)
float Linear01DepthFromNear(float depth, float4 zBufferParam)
{
return 1.0 / (zBufferParam.x + zBufferParam.y / depth);
}
// Z buffer to linear 0..1 depth (0 at camera position, 1 at far plane)
float Linear01Depth(float depth, float4 zBufferParam)
{
return 1.0 / (zBufferParam.x * depth + zBufferParam.y);

11
Assets/ScriptableRenderLoop/ShaderLibrary/Packing.hlsl


return normalize(n);
}
float3 UnpackNormalRGB(float4 packedNormal, float scale = 1.0)
{
float3 normal;
normal.xyz = packedNormal.rgb * 2.0 - 1.0;
normal.xy *= scale;
return normalize(normal);
}
float3 UnpackNormalAG(float4 packedNormal, float scale = 1.0)
{
float3 normal;

}
// Unpack normal as DXT5nm (1, y, 0, x) or BC5 (x, y, 0, 1)
float3 UnpackNormalmapRGorAG(float4 packedNormal)
float3 UnpackNormalmapRGorAG(float4 packedNormal, float scale = 1.0)
{
// This do the trick
packedNormal.x *= packedNormal.w;

normal.xy *= scale;
normal.z = sqrt(1.0 - saturate(dot(normal.xy, normal.xy)));
return normal;
}

2
Assets/ScriptableRenderLoop/common/TextureSettings.cs


namespace UnityEngine.Experimental.ScriptableRenderLoop
namespace UnityEngine.Experimental.Rendering
{
[System.Serializable]
public struct TextureSettings

75
Assets/ScriptableRenderLoop/core/RenderPipeline.cs


using System;
using System.Collections.Generic;
using UnityEngine.Experimental.Rendering;
namespace UnityEngine.ScriptableRenderPipeline
namespace UnityEngine.Experimental.Rendering
public abstract class RenderPipeline : BaseRenderPipeline
{
private readonly HashSet<IScriptableRenderDataStore> m_AssociatedDataStores = new HashSet<IScriptableRenderDataStore>();
private ICameraProvider m_CameraProvider;
public override ICameraProvider cameraProvider
{
get
{
if (m_CameraProvider == null)
m_CameraProvider = ConstructCameraProvider();
return m_CameraProvider;
}
set { m_CameraProvider = value; }
}
public override void Render(ScriptableRenderContext renderContext, IScriptableRenderDataStore dataStore)
{
if (dataStore == null)
throw new ArgumentException(string.Format("Null DataStore has been passed into pipe {0}", this));
if (dataStore.owner == null)
throw new ArgumentException(string.Format("DataStore owner is null. It needs o be owned by loop {0}", this));
if (dataStore.owner != null && !ReferenceEquals(dataStore.owner, this))
throw new ArgumentException(string.Format("DataStore {0} has been passed into pipe {1}, but is owned by {2}", dataStore, this, dataStore.owner));
m_AssociatedDataStores.Add(dataStore);
dataStore.Build();
}
public override void ClearCachedData()
{
foreach (var store in m_AssociatedDataStores)
store.Cleanup();
m_AssociatedDataStores.Clear();
}
public override ICameraProvider ConstructCameraProvider()
{
return new DefaultCameraProvider();
}
public override IScriptableRenderDataStore ConstructDataStore()
{
return new RenderingDataStore(this);
}
public static void CleanCameras(IEnumerable<Camera> cameras)
{
foreach (var camera in cameras)
camera.ClearIntermediateRenderers();
}
}
public abstract class RenderPipeline : IRenderPipeline
{
public virtual void Render(ScriptableRenderContext renderContext, Camera[] cameras)
{
if (disposed)
throw new ObjectDisposedException(string.Format("{0} has been disposed. Do not call Render on disposed RenderLoops.", this));
}
public bool disposed { get; private set; }
public virtual void Dispose()
{
disposed = true;
}
}
}

84
Assets/ScriptableRenderLoop/fptl/FptlLighting.cs


using UnityEngine.Rendering;
using UnityEngine.Experimental.Rendering;
using UnityEngine.ScriptableRenderPipeline;
namespace UnityEngine.Experimental.ScriptableRenderLoop
namespace UnityEngine.Experimental.Rendering.Fptl
public class FptlLightingInstance : RenderPipeline
{
private readonly FptlLighting m_Owner;
public FptlLightingInstance(FptlLighting owner)
{
m_Owner = owner;
if (m_Owner != null)
m_Owner.Build();
}
public override void Dispose()
{
base.Dispose();
if (m_Owner != null)
m_Owner.Cleanup();
}
public override void Render(ScriptableRenderContext renderContext, Camera[] cameras)
{
base.Render(renderContext, cameras);
m_Owner.Render(renderContext, cameras);
}
}
public class FptlLighting : RenderPipeline
public class FptlLighting : RenderPipelineAsset
[UnityEditor.MenuItem("Renderloop/CreateRenderLoopFPTL")]
[UnityEditor.MenuItem("RenderPipeline/CreateRenderLoopFPTL")]
static void CreateRenderLoopFPTL()
{
var instance = ScriptableObject.CreateInstance<FptlLighting>();

#endif
private class FptlLightingDataStore : RenderingDataStore
protected override IRenderPipeline InternalCreatePipeline()
public FptlLightingDataStore(BaseRenderPipeline owner) : base(owner)
{}
protected override void InternalBuild()
{
base.InternalBuild();
FptlLighting theOwner = owner as FptlLighting;
if (theOwner != null)
theOwner.Build();
}
protected override void InternalCleanup()
{
base.InternalCleanup();
FptlLighting theOwner = owner as FptlLighting;
if (theOwner != null)
theOwner.Cleanup();
}
return new FptlLightingInstance(this);
}
[SerializeField]

m_shadowBufferID = Shader.PropertyToID("g_tShadowBuffer");
}
public override IScriptableRenderDataStore ConstructDataStore()
{
return new FptlLightingDataStore(this);
}
static void SetupGBuffer(int width, int height, CommandBuffer cmd)
{
var format10 = RenderTextureFormat.ARGB32;

return numLightsOut + numProbesOut;
}
[NonSerialized]
readonly List<Camera> m_CamerasToRender = new List<Camera>();
public override void Render(ScriptableRenderContext renderLoop, IScriptableRenderDataStore dataStore)
public void Render(ScriptableRenderContext renderContext, IEnumerable<Camera> cameras)
base.Render(renderLoop, dataStore);
cameraProvider.GetCamerasToRender(m_CamerasToRender);
foreach (var camera in m_CamerasToRender)
foreach (var camera in cameras)
{
CullingParameters cullingParams;
if (!CullResults.GetCullingParameters(camera, out cullingParams))

var cullResults = CullResults.Cull(ref cullingParams, renderLoop);
ExecuteRenderLoop(camera, cullResults, renderLoop);
var cullResults = CullResults.Cull(ref cullingParams, renderContext);
ExecuteRenderLoop(camera, cullResults, renderContext);
renderLoop.Submit();
CleanCameras(m_CamerasToRender);
m_CamerasToRender.Clear();
renderContext.Submit();
}
void FinalPass(ScriptableRenderContext loop)

2
Assets/ScriptableRenderLoop/fptl/LightDefinitions.cs


using UnityEngine;
using UnityEngine.Experimental.ScriptableRenderLoop;
using UnityEngine.Experimental.Rendering;
[GenerateHLSL]
public struct SFiniteLightData

5
Assets/ShaderGenerator/Editor/CSharpToHLSL.cs


using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using UnityEditor;
using UnityEngine;
using UnityEngine.Experimental.Rendering;
namespace UnityEngine.Experimental.ScriptableRenderLoop
namespace UnityEditor.Experimental.Rendering
{
public class CSharpToHLSL
{

4
Assets/ShaderGenerator/Editor/ShaderGeneratorMenu.cs


namespace UnityEngine.Experimental.ScriptableRenderLoop
namespace UnityEditor.Experimental.Rendering
[UnityEditor.MenuItem("Renderloop/Generate Shader Includes")]
[UnityEditor.MenuItem("RenderPipeline/Generate Shader Includes")]
static void GenerateShaderIncludes()
{
CSharpToHLSL.GenerateAll();

4
Assets/ShaderGenerator/Editor/ShaderTypeGeneration.cs


using System;
using System.Collections.Generic;
using System.Reflection;
using UnityEngine;
using UnityEngine.Experimental.Rendering;
namespace UnityEngine.Experimental.ScriptableRenderLoop
namespace UnityEditor.Experimental.Rendering
{
internal class ShaderTypeGenerator
{

2
Assets/ShaderGenerator/ShaderGeneratorAttributes.cs


using System;
namespace UnityEngine.Experimental.ScriptableRenderLoop
namespace UnityEngine.Experimental.Rendering
{
public enum PackingRules
{

5
Assets/TestScenes/HDTest/GlobalIlluminationTest/TestRealtime.cs


using System.Collections;
using System.Collections.Generic;
using UnityEngine.Experimental.ScriptableRenderLoop;
using UnityEngine.Experimental.Rendering.HDPipeline;
public class TestRealtime : MonoBehaviour {

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

25
Assets/TestScenes/HDTest/LayeredLitTest/Material/Layered_BlendColor.mat


m_LightmapFlags: 1
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
disabledShaderPasses:
- DistortionVectors
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:

m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DiffuseLightingMap:
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}

- _AlphaCutoffEnable: 0
- _Anisotropy: 0
- _BlendMode: 0
- _BlendSize1: 0
- _BlendSize2: 0
- _BlendSize3: 0
- _DepthOffsetEnable: 0
- _DetailAOScale0: 1
- _DetailAOScale1: 1
- _DetailAOScale2: 1

- _DetailSmoothnessScale2: 1
- _DetailSmoothnessScale3: 1
- _DistortionDepthTest: 0
- _DistortionEnable: 0
- _DistortionOnly: 0
- _DoubleSidedMode: 0
- _DstBlend: 0

- _HeightBias1: 0
- _HeightBias2: 0
- _HeightBias3: 0
- _HeightFactor1: 1
- _HeightFactor2: 1
- _HeightFactor3: 1
- _HeightOffset1: 0
- _HeightOffset2: 0
- _HeightOffset3: 0
- _HeightScale: 1
- _HeightScale0: 1
- _HeightScale1: 1

- _UVDetailsMappingMask1: 0
- _UVDetailsMappingMask2: 0
- _UVDetailsMappingMask3: 0
- _UVMappingPlanar0: 0
- _UVMappingPlanar1: 0
- _UVMappingPlanar2: 0
- _UVMappingPlanar3: 0
- _UseHeightBasedBlend: 0
- _VertexColorHeightFactor: 1
- _ZTestMode: 8
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}

28
Assets/TestScenes/HDTest/LayeredLitTest/Material/Layered_BlendMask.mat


m_LightmapFlags: 1
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:

m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DiffuseLightingMap:
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}

- _AlphaCutoffEnable: 0
- _Anisotropy: 0
- _BlendMode: 0
- _BlendSize1: 0
- _BlendSize2: 0
- _BlendSize3: 0
- _DepthOffsetEnable: 0
- _DetailAOScale0: 1
- _DetailAOScale1: 1
- _DetailAOScale2: 1

- _DetailSmoothnessScale2: 1
- _DetailSmoothnessScale3: 1
- _DistortionDepthTest: 0
- _DistortionEnable: 0
- _DistortionOnly: 0
- _DoubleSidedMode: 0
- _DstBlend: 0

- _HeightBias1: 0
- _HeightBias2: 0
- _HeightBias3: 0
- _HeightFactor1: 1
- _HeightFactor2: 1
- _HeightFactor3: 1
- _HeightOffset1: 0
- _HeightOffset2: 0
- _HeightOffset3: 0
- _HeightScale: 1
- _HeightScale0: 1
- _HeightScale1: 1

- _Parallax: 0.02
- _Smoothness: 0.5
- _Smoothness0: 0.5
- _Smoothness1: 0.5
- _Smoothness1: 0.2
- _Smoothness3: 0.5
- _Smoothness3: 0.4
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1

- _UVDetailsMappingMask1: 0
- _UVDetailsMappingMask2: 0
- _UVDetailsMappingMask3: 0
- _UVMappingPlanar0: 0
- _UVMappingPlanar1: 0
- _UVMappingPlanar2: 0
- _UVMappingPlanar3: 0
- _UseHeightBasedBlend1: 0
- _UseHeightBasedBlend2: 0
- _UseHeightBasedBlend3: 0
- _ZTestMode: 8
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}

14
Assets/TestScenes/HDTest/LayeredLitTest/Material/Layered_Layer0_Planar.mat


m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BaseColorMap1:
m_Texture: {fileID: 0}
m_Texture: {fileID: 2800000, guid: 866df234625deb44a8db971e2f2dca7c, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BaseColorMap2:

- _AlphaCutoff: 0.5
- _AlphaCutoffEnable: 0
- _BlendMode: 0
- _BlendSize1: 0
- _BlendSize2: 0
- _BlendSize3: 0
- _BumpScale: 1
- _CullMode: 2
- _Cutoff: 0.5

- _HeightBias1: 0
- _HeightBias2: 0
- _HeightBias3: 0
- _HeightFactor1: 1
- _HeightFactor2: 1
- _HeightFactor3: 1
- _HeightOffset1: 0
- _HeightOffset2: 0
- _HeightOffset3: 0
- _HeightScale0: 1
- _HeightScale1: 1
- _HeightScale2: 1

- _UVMappingPlanar2: 0
- _UVMappingPlanar3: 0
- _UVSec: 0
- _UseHeightBasedBlend1: 0
- _UseHeightBasedBlend2: 0
- _UseHeightBasedBlend3: 0
- _ZTestMode: 8
- _ZWrite: 1
m_Colors:

14
Assets/TestScenes/HDTest/LayeredLitTest/Material/Layered_Layer0_Triplanar.mat


m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BaseColorMap1:
m_Texture: {fileID: 0}
m_Texture: {fileID: 2800000, guid: 866df234625deb44a8db971e2f2dca7c, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BaseColorMap2:

- _AlphaCutoff: 0.5
- _AlphaCutoffEnable: 0
- _BlendMode: 0
- _BlendSize1: 0
- _BlendSize2: 0
- _BlendSize3: 0
- _BumpScale: 1
- _CullMode: 0
- _Cutoff: 0.5

- _HeightBias1: 0
- _HeightBias2: 0
- _HeightBias3: 0
- _HeightFactor1: 1
- _HeightFactor2: 1
- _HeightFactor3: 1
- _HeightOffset1: 0
- _HeightOffset2: 0
- _HeightOffset3: 0
- _HeightScale0: 1
- _HeightScale1: 1
- _HeightScale2: 1

- _UVMappingPlanar2: 0
- _UVMappingPlanar3: 0
- _UVSec: 0
- _UseHeightBasedBlend1: 0
- _UseHeightBasedBlend2: 0
- _UseHeightBasedBlend3: 0
- _ZTestMode: 8
- _ZWrite: 1
m_Colors:

28
Assets/TestScenes/HDTest/LayeredLitTest/Material/Layered_Layer0_UV0.mat


m_LightmapFlags: 1
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
disabledShaderPasses:
- DistortionVectors
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:

m_Offset: {x: 0, y: 0}
- _BaseColorMap1:
m_Texture: {fileID: 0}
m_Texture: {fileID: 2800000, guid: 866df234625deb44a8db971e2f2dca7c, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BaseColorMap2:

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}

- _AlphaCutoff: 0.5
- _AlphaCutoffEnable: 0
- _BlendMode: 0
- _BlendSize1: 0
- _BlendSize2: 0
- _BlendSize3: 0
- _DepthOffsetEnable: 0
- _DetailAOScale0: 1
- _DetailAOScale1: 1
- _DetailAOScale2: 1

- _DetailSmoothnessScale2: 1
- _DetailSmoothnessScale3: 1
- _DistortionDepthTest: 0
- _DistortionEnable: 0
- _DistortionOnly: 0
- _DoubleSidedMode: 0
- _DstBlend: 0

- _HeightBias1: 0
- _HeightBias2: 0
- _HeightBias3: 0
- _HeightFactor1: 1
- _HeightFactor2: 1
- _HeightFactor3: 1
- _HeightOffset1: 0
- _HeightOffset2: 0
- _HeightOffset3: 0
- _HeightScale0: 1
- _HeightScale1: 1
- _HeightScale2: 1

- _UVDetailsMappingMask1: 0
- _UVDetailsMappingMask2: 0
- _UVDetailsMappingMask3: 0
- _UVMappingPlanar0: 0
- _UVMappingPlanar1: 0
- _UVMappingPlanar2: 0
- _UVMappingPlanar3: 0
- _UseHeightBasedBlend1: 0
- _UseHeightBasedBlend2: 0
- _UseHeightBasedBlend3: 0
- _ZTestMode: 8
- _ZWrite: 1
m_Colors:
- _BaseColor0: {r: 1, g: 1, b: 1, a: 1}

25
Assets/TestScenes/HDTest/LayeredLitTest/Material/Layered_Layer0_UV1.mat


m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BaseColorMap1:
m_Texture: {fileID: 0}
m_Texture: {fileID: 2800000, guid: 866df234625deb44a8db971e2f2dca7c, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BaseColorMap2:

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}

- _AlphaCutoff: 0.5
- _AlphaCutoffEnable: 0
- _BlendMode: 0
- _BlendSize1: 0
- _BlendSize2: 0
- _BlendSize3: 0
- _DepthOffsetEnable: 0
- _DetailAOScale0: 1
- _DetailAOScale1: 1
- _DetailAOScale2: 1

- _DetailSmoothnessScale2: 1
- _DetailSmoothnessScale3: 1
- _DistortionDepthTest: 0
- _DistortionEnable: 0
- _DistortionOnly: 0
- _DoubleSidedMode: 0
- _DstBlend: 0

- _HeightBias1: 0
- _HeightBias2: 0
- _HeightBias3: 0
- _HeightFactor1: 1
- _HeightFactor2: 1
- _HeightFactor3: 1
- _HeightOffset1: 0
- _HeightOffset2: 0
- _HeightOffset3: 0
- _HeightScale0: 1
- _HeightScale1: 1
- _HeightScale2: 1

- _UVDetailsMappingMask1: 0
- _UVDetailsMappingMask2: 0
- _UVDetailsMappingMask3: 0
- _UVMappingPlanar0: 0
- _UVMappingPlanar1: 0
- _UVMappingPlanar2: 0
- _UVMappingPlanar3: 0
- _UseHeightBasedBlend1: 0
- _UseHeightBasedBlend2: 0
- _UseHeightBasedBlend3: 0
- _ZTestMode: 8
- _ZWrite: 1
m_Colors:
- _BaseColor0: {r: 1, g: 1, b: 1, a: 1}

14
Assets/TestScenes/HDTest/LayeredLitTest/Material/Layered_Layer0_UV2.mat


m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BaseColorMap1:
m_Texture: {fileID: 0}
m_Texture: {fileID: 2800000, guid: 866df234625deb44a8db971e2f2dca7c, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BaseColorMap2:

- _AlphaCutoff: 0.5
- _AlphaCutoffEnable: 0
- _BlendMode: 0
- _BlendSize1: 0
- _BlendSize2: 0
- _BlendSize3: 0
- _BumpScale: 1
- _CullMode: 2
- _Cutoff: 0.5

- _HeightBias1: 0
- _HeightBias2: 0
- _HeightBias3: 0
- _HeightFactor1: 1
- _HeightFactor2: 1
- _HeightFactor3: 1
- _HeightOffset1: 0
- _HeightOffset2: 0
- _HeightOffset3: 0
- _HeightScale0: 1
- _HeightScale1: 1
- _HeightScale2: 1

- _UVMappingPlanar2: 0
- _UVMappingPlanar3: 0
- _UVSec: 0
- _UseHeightBasedBlend1: 0
- _UseHeightBasedBlend2: 0
- _UseHeightBasedBlend3: 0
- _ZTestMode: 8
- _ZWrite: 1
m_Colors:

14
Assets/TestScenes/HDTest/LayeredLitTest/Material/Layered_Layer0_UV3.mat


m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BaseColorMap1:
m_Texture: {fileID: 0}
m_Texture: {fileID: 2800000, guid: 866df234625deb44a8db971e2f2dca7c, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BaseColorMap2:

- _AlphaCutoff: 0.5
- _AlphaCutoffEnable: 0
- _BlendMode: 0
- _BlendSize1: 0
- _BlendSize2: 0
- _BlendSize3: 0
- _BumpScale: 1
- _CullMode: 2
- _Cutoff: 0.5

- _HeightBias1: 0
- _HeightBias2: 0
- _HeightBias3: 0
- _HeightFactor1: 1
- _HeightFactor2: 1
- _HeightFactor3: 1
- _HeightOffset1: 0
- _HeightOffset2: 0
- _HeightOffset3: 0
- _HeightScale0: 1
- _HeightScale1: 1
- _HeightScale2: 1

- _UVMappingPlanar2: 0
- _UVMappingPlanar3: 0
- _UVSec: 0
- _UseHeightBasedBlend1: 0
- _UseHeightBasedBlend2: 0
- _UseHeightBasedBlend3: 0
- _ZTestMode: 8
- _ZWrite: 1
m_Colors:

14
Assets/TestScenes/HDTest/LayeredLitTest/Material/Layered_Layer1_Planar.mat


serializedVersion: 3
m_TexEnvs:
- _BaseColorMap0:
m_Texture: {fileID: 0}
m_Texture: {fileID: 2800000, guid: 866df234625deb44a8db971e2f2dca7c, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BaseColorMap1:

- _AlphaCutoff: 0.5
- _AlphaCutoffEnable: 0
- _BlendMode: 0
- _BlendSize1: 0
- _BlendSize2: 0
- _BlendSize3: 0
- _BumpScale: 1
- _CullMode: 2
- _Cutoff: 0.5

- _HeightBias1: 0
- _HeightBias2: 0
- _HeightBias3: 0
- _HeightFactor1: 1
- _HeightFactor2: 1
- _HeightFactor3: 1
- _HeightOffset1: 0
- _HeightOffset2: 0
- _HeightOffset3: 0
- _HeightScale0: 1
- _HeightScale1: 1
- _HeightScale2: 1

- _UVMappingPlanar2: 0
- _UVMappingPlanar3: 0
- _UVSec: 0
- _UseHeightBasedBlend1: 0
- _UseHeightBasedBlend2: 0
- _UseHeightBasedBlend3: 0
- _ZTestMode: 8
- _ZWrite: 1
m_Colors:

14
Assets/TestScenes/HDTest/LayeredLitTest/Material/Layered_Layer1_Triplanar.mat


serializedVersion: 3
m_TexEnvs:
- _BaseColorMap0:
m_Texture: {fileID: 0}
m_Texture: {fileID: 2800000, guid: 866df234625deb44a8db971e2f2dca7c, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BaseColorMap1:

- _AlphaCutoff: 0.5
- _AlphaCutoffEnable: 0
- _BlendMode: 0
- _BlendSize1: 0
- _BlendSize2: 0
- _BlendSize3: 0
- _BumpScale: 1
- _CullMode: 0
- _Cutoff: 0.5

- _HeightBias1: 0
- _HeightBias2: 0
- _HeightBias3: 0
- _HeightFactor1: 1
- _HeightFactor2: 1
- _HeightFactor3: 1
- _HeightOffset1: 0
- _HeightOffset2: 0
- _HeightOffset3: 0
- _HeightScale0: 1
- _HeightScale1: 1
- _HeightScale2: 1

- _UVMappingPlanar2: 0
- _UVMappingPlanar3: 0
- _UVSec: 0
- _UseHeightBasedBlend1: 0
- _UseHeightBasedBlend2: 0
- _UseHeightBasedBlend3: 0
- _ZTestMode: 8
- _ZWrite: 1
m_Colors:

27
Assets/TestScenes/HDTest/LayeredLitTest/Material/Layered_Layer1_UV0.mat


m_LightmapFlags: 1
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses:
- DistortionVectors
m_Texture: {fileID: 0}
m_Texture: {fileID: 2800000, guid: 866df234625deb44a8db971e2f2dca7c, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BaseColorMap1:

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}

- _AlphaCutoff: 0.5
- _AlphaCutoffEnable: 0
- _BlendMode: 0
- _BlendSize1: 0
- _BlendSize2: 0
- _BlendSize3: 0
- _DepthOffsetEnable: 0
- _DetailAOScale0: 1
- _DetailAOScale1: 1
- _DetailAOScale2: 1

- _DetailSmoothnessScale2: 1
- _DetailSmoothnessScale3: 1
- _DistortionDepthTest: 0
- _DistortionEnable: 0
- _DistortionOnly: 0
- _DoubleSidedMode: 0
- _DstBlend: 0

- _HeightBias1: 0
- _HeightBias2: 0
- _HeightBias3: 0
- _HeightFactor1: 1
- _HeightFactor2: 1
- _HeightFactor3: 1
- _HeightOffset1: 0
- _HeightOffset2: 0
- _HeightOffset3: 0
- _HeightScale0: 1
- _HeightScale1: 1
- _HeightScale2: 1

- _UVDetailsMappingMask1: 0
- _UVDetailsMappingMask2: 0
- _UVDetailsMappingMask3: 0
- _UVMappingPlanar0: 0
- _UVMappingPlanar1: 0
- _UVMappingPlanar2: 0
- _UVMappingPlanar3: 0
- _UseHeightBasedBlend1: 0
- _UseHeightBasedBlend2: 0
- _UseHeightBasedBlend3: 0
- _ZTestMode: 8
- _ZWrite: 1
m_Colors:
- _BaseColor0: {r: 1, g: 1, b: 1, a: 1}

27
Assets/TestScenes/HDTest/LayeredLitTest/Material/Layered_Layer1_UV1.mat


m_LightmapFlags: 1
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses:
- DistortionVectors
m_Texture: {fileID: 0}
m_Texture: {fileID: 2800000, guid: 866df234625deb44a8db971e2f2dca7c, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BaseColorMap1:

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}

- _AlphaCutoff: 0.5
- _AlphaCutoffEnable: 0
- _BlendMode: 0
- _BlendSize1: 0
- _BlendSize2: 0
- _BlendSize3: 0
- _DepthOffsetEnable: 0
- _DetailAOScale0: 1
- _DetailAOScale1: 1
- _DetailAOScale2: 1

- _DetailSmoothnessScale2: 1
- _DetailSmoothnessScale3: 1
- _DistortionDepthTest: 0
- _DistortionEnable: 0
- _DistortionOnly: 0
- _DoubleSidedMode: 0
- _DstBlend: 0

- _HeightBias1: 0
- _HeightBias2: 0
- _HeightBias3: 0
- _HeightFactor1: 1
- _HeightFactor2: 1
- _HeightFactor3: 1
- _HeightOffset1: 0
- _HeightOffset2: 0
- _HeightOffset3: 0
- _HeightScale0: 1
- _HeightScale1: 1
- _HeightScale2: 1

- _UVDetailsMappingMask1: 0
- _UVDetailsMappingMask2: 0
- _UVDetailsMappingMask3: 0
- _UVMappingPlanar0: 0
- _UVMappingPlanar1: 0
- _UVMappingPlanar2: 0
- _UVMappingPlanar3: 0
- _UseHeightBasedBlend1: 0
- _UseHeightBasedBlend2: 0
- _UseHeightBasedBlend3: 0
- _ZTestMode: 8
- _ZWrite: 1
m_Colors:
- _BaseColor0: {r: 1, g: 1, b: 1, a: 1}

14
Assets/TestScenes/HDTest/LayeredLitTest/Material/Layered_Layer1_UV2.mat


serializedVersion: 3
m_TexEnvs:
- _BaseColorMap0:
m_Texture: {fileID: 0}
m_Texture: {fileID: 2800000, guid: 866df234625deb44a8db971e2f2dca7c, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BaseColorMap1:

- _AlphaCutoff: 0.5
- _AlphaCutoffEnable: 0
- _BlendMode: 0
- _BlendSize1: 0
- _BlendSize2: 0
- _BlendSize3: 0
- _BumpScale: 1
- _CullMode: 2
- _Cutoff: 0.5

- _HeightBias1: 0
- _HeightBias2: 0
- _HeightBias3: 0
- _HeightFactor1: 1
- _HeightFactor2: 1
- _HeightFactor3: 1
- _HeightOffset1: 0
- _HeightOffset2: 0
- _HeightOffset3: 0
- _HeightScale0: 1
- _HeightScale1: 1
- _HeightScale2: 1

- _UVMappingPlanar2: 0
- _UVMappingPlanar3: 0
- _UVSec: 0
- _UseHeightBasedBlend1: 0
- _UseHeightBasedBlend2: 0
- _UseHeightBasedBlend3: 0
- _ZTestMode: 8
- _ZWrite: 1
m_Colors:

14
Assets/TestScenes/HDTest/LayeredLitTest/Material/Layered_Layer1_UV3.mat


serializedVersion: 3
m_TexEnvs:
- _BaseColorMap0:
m_Texture: {fileID: 0}
m_Texture: {fileID: 2800000, guid: 866df234625deb44a8db971e2f2dca7c, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BaseColorMap1:

- _AlphaCutoff: 0.5
- _AlphaCutoffEnable: 0
- _BlendMode: 0
- _BlendSize1: 0
- _BlendSize2: 0
- _BlendSize3: 0
- _BumpScale: 1
- _CullMode: 2
- _Cutoff: 0.5

- _HeightBias1: 0
- _HeightBias2: 0
- _HeightBias3: 0
- _HeightFactor1: 1
- _HeightFactor2: 1
- _HeightFactor3: 1
- _HeightOffset1: 0
- _HeightOffset2: 0
- _HeightOffset3: 0
- _HeightScale0: 1
- _HeightScale1: 1
- _HeightScale2: 1

- _UVMappingPlanar2: 0
- _UVMappingPlanar3: 0
- _UVSec: 0
- _UseHeightBasedBlend1: 0
- _UseHeightBasedBlend2: 0
- _UseHeightBasedBlend3: 0
- _ZTestMode: 8
- _ZWrite: 1
m_Colors:

16
Assets/TestScenes/HDTest/LayeredLitTest/Material/Layered_Layer2_Planar.mat


serializedVersion: 3
m_TexEnvs:
- _BaseColorMap0:
m_Texture: {fileID: 0}
m_Texture: {fileID: 2800000, guid: 866df234625deb44a8db971e2f2dca7c, type: 3}
m_Texture: {fileID: 0}
m_Texture: {fileID: 2800000, guid: 866df234625deb44a8db971e2f2dca7c, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BaseColorMap2:

- _AlphaCutoff: 0.5
- _AlphaCutoffEnable: 0
- _BlendMode: 0
- _BlendSize1: 0
- _BlendSize2: 0
- _BlendSize3: 0
- _BumpScale: 1
- _CullMode: 2
- _Cutoff: 0.5

- _HeightBias1: 0
- _HeightBias2: 0
- _HeightBias3: 0
- _HeightFactor1: 1
- _HeightFactor2: 1
- _HeightFactor3: 1
- _HeightOffset1: 0
- _HeightOffset2: 0
- _HeightOffset3: 0
- _HeightScale0: 1
- _HeightScale1: 1
- _HeightScale2: 1

- _UVMappingPlanar2: 0
- _UVMappingPlanar3: 0
- _UVSec: 0
- _UseHeightBasedBlend1: 0
- _UseHeightBasedBlend2: 0
- _UseHeightBasedBlend3: 0
- _ZTestMode: 8
- _ZWrite: 1
m_Colors:

16
Assets/TestScenes/HDTest/LayeredLitTest/Material/Layered_Layer2_Triplanar.mat


serializedVersion: 3
m_TexEnvs:
- _BaseColorMap0:
m_Texture: {fileID: 0}
m_Texture: {fileID: 2800000, guid: 866df234625deb44a8db971e2f2dca7c, type: 3}
m_Texture: {fileID: 0}
m_Texture: {fileID: 2800000, guid: 866df234625deb44a8db971e2f2dca7c, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BaseColorMap2:

- _AlphaCutoff: 0.5
- _AlphaCutoffEnable: 0
- _BlendMode: 0
- _BlendSize1: 0
- _BlendSize2: 0
- _BlendSize3: 0
- _BumpScale: 1
- _CullMode: 0
- _Cutoff: 0.5

- _HeightBias1: 0
- _HeightBias2: 0
- _HeightBias3: 0
- _HeightFactor1: 1
- _HeightFactor2: 1
- _HeightFactor3: 1
- _HeightOffset1: 0
- _HeightOffset2: 0
- _HeightOffset3: 0
- _HeightScale0: 1
- _HeightScale1: 1
- _HeightScale2: 1

- _UVMappingPlanar2: 0
- _UVMappingPlanar3: 0
- _UVSec: 0
- _UseHeightBasedBlend1: 0
- _UseHeightBasedBlend2: 0
- _UseHeightBasedBlend3: 0
- _ZTestMode: 8
- _ZWrite: 1
m_Colors:

28
Assets/TestScenes/HDTest/LayeredLitTest/Material/Layered_Layer2_UV0.mat


m_LightmapFlags: 1
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_Texture: {fileID: 0}
m_Texture: {fileID: 2800000, guid: 866df234625deb44a8db971e2f2dca7c, type: 3}
m_Texture: {fileID: 0}
m_Texture: {fileID: 2800000, guid: 866df234625deb44a8db971e2f2dca7c, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BaseColorMap2:

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}

- _AlphaCutoff: 0.5
- _AlphaCutoffEnable: 0
- _BlendMode: 0
- _BlendSize1: 0
- _BlendSize2: 0
- _BlendSize3: 0
- _DepthOffsetEnable: 0
- _DetailAOScale0: 1
- _DetailAOScale1: 1
- _DetailAOScale2: 1

- _DetailSmoothnessScale2: 1
- _DetailSmoothnessScale3: 1
- _DistortionDepthTest: 0
- _DistortionEnable: 0
- _DistortionOnly: 0
- _DoubleSidedMode: 0
- _DstBlend: 0

- _HeightBias1: 0
- _HeightBias2: 0
- _HeightBias3: 0
- _HeightFactor1: 1
- _HeightFactor2: 1
- _HeightFactor3: 1
- _HeightOffset1: 0
- _HeightOffset2: 0
- _HeightOffset3: 0
- _HeightScale0: 1
- _HeightScale1: 1
- _HeightScale2: 1

- _UVDetailsMappingMask1: 0
- _UVDetailsMappingMask2: 0
- _UVDetailsMappingMask3: 0
- _UVMappingPlanar0: 0
- _UVMappingPlanar1: 0
- _UVMappingPlanar2: 0
- _UVMappingPlanar3: 0
- _UseHeightBasedBlend1: 0
- _UseHeightBasedBlend2: 0
- _UseHeightBasedBlend3: 0
- _ZTestMode: 8
- _ZWrite: 1
m_Colors:
- _BaseColor0: {r: 1, g: 1, b: 1, a: 1}

28
Assets/TestScenes/HDTest/LayeredLitTest/Material/Layered_Layer2_UV1.mat


m_LightmapFlags: 1
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_Texture: {fileID: 0}
m_Texture: {fileID: 2800000, guid: 866df234625deb44a8db971e2f2dca7c, type: 3}
m_Texture: {fileID: 0}
m_Texture: {fileID: 2800000, guid: 866df234625deb44a8db971e2f2dca7c, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BaseColorMap2:

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}

- _AlphaCutoff: 0.5
- _AlphaCutoffEnable: 0
- _BlendMode: 0
- _BlendSize1: 0
- _BlendSize2: 0
- _BlendSize3: 0
- _DepthOffsetEnable: 0
- _DetailAOScale0: 1
- _DetailAOScale1: 1
- _DetailAOScale2: 1

- _DetailSmoothnessScale2: 1
- _DetailSmoothnessScale3: 1
- _DistortionDepthTest: 0
- _DistortionEnable: 0
- _DistortionOnly: 0
- _DoubleSidedMode: 0
- _DstBlend: 0

- _HeightBias1: 0
- _HeightBias2: 0
- _HeightBias3: 0
- _HeightFactor1: 1
- _HeightFactor2: 1
- _HeightFactor3: 1
- _HeightOffset1: 0
- _HeightOffset2: 0
- _HeightOffset3: 0
- _HeightScale0: 1
- _HeightScale1: 1
- _HeightScale2: 1

- _UVDetailsMappingMask1: 0
- _UVDetailsMappingMask2: 0
- _UVDetailsMappingMask3: 0
- _UVMappingPlanar0: 0
- _UVMappingPlanar1: 0
- _UVMappingPlanar2: 0
- _UVMappingPlanar3: 0
- _UseHeightBasedBlend1: 0
- _UseHeightBasedBlend2: 0
- _UseHeightBasedBlend3: 0
- _ZTestMode: 8
- _ZWrite: 1
m_Colors:
- _BaseColor0: {r: 1, g: 1, b: 1, a: 1}

16
Assets/TestScenes/HDTest/LayeredLitTest/Material/Layered_Layer2_UV2.mat


serializedVersion: 3
m_TexEnvs:
- _BaseColorMap0:
m_Texture: {fileID: 0}
m_Texture: {fileID: 2800000, guid: 866df234625deb44a8db971e2f2dca7c, type: 3}
m_Texture: {fileID: 0}
m_Texture: {fileID: 2800000, guid: 866df234625deb44a8db971e2f2dca7c, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BaseColorMap2:

- _AlphaCutoff: 0.5
- _AlphaCutoffEnable: 0
- _BlendMode: 0
- _BlendSize1: 0
- _BlendSize2: 0
- _BlendSize3: 0
- _BumpScale: 1
- _CullMode: 2
- _Cutoff: 0.5

- _HeightBias1: 0
- _HeightBias2: 0
- _HeightBias3: 0
- _HeightFactor1: 1
- _HeightFactor2: 1
- _HeightFactor3: 1
- _HeightOffset1: 0
- _HeightOffset2: 0
- _HeightOffset3: 0
- _HeightScale0: 1
- _HeightScale1: 1
- _HeightScale2: 1

- _UVMappingPlanar2: 0
- _UVMappingPlanar3: 0
- _UVSec: 0
- _UseHeightBasedBlend1: 0
- _UseHeightBasedBlend2: 0
- _UseHeightBasedBlend3: 0
- _ZTestMode: 8
- _ZWrite: 1
m_Colors:

16
Assets/TestScenes/HDTest/LayeredLitTest/Material/Layered_Layer2_UV3.mat


serializedVersion: 3
m_TexEnvs:
- _BaseColorMap0:
m_Texture: {fileID: 0}
m_Texture: {fileID: 2800000, guid: 866df234625deb44a8db971e2f2dca7c, type: 3}
m_Texture: {fileID: 0}
m_Texture: {fileID: 2800000, guid: 866df234625deb44a8db971e2f2dca7c, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BaseColorMap2:

- _AlphaCutoff: 0.5
- _AlphaCutoffEnable: 0
- _BlendMode: 0
- _BlendSize1: 0
- _BlendSize2: 0
- _BlendSize3: 0
- _BumpScale: 1
- _CullMode: 2
- _Cutoff: 0.5

- _HeightBias1: 0
- _HeightBias2: 0
- _HeightBias3: 0
- _HeightFactor1: 1
- _HeightFactor2: 1
- _HeightFactor3: 1
- _HeightOffset1: 0
- _HeightOffset2: 0
- _HeightOffset3: 0
- _HeightScale0: 1
- _HeightScale1: 1
- _HeightScale2: 1

- _UVMappingPlanar2: 0
- _UVMappingPlanar3: 0
- _UVSec: 0
- _UseHeightBasedBlend1: 0
- _UseHeightBasedBlend2: 0
- _UseHeightBasedBlend3: 0
- _ZTestMode: 8
- _ZWrite: 1
m_Colors:

22
Assets/TestScenes/HDTest/LayeredLitTest/Material/Layered_Layer3_Planar.mat


serializedVersion: 3
m_TexEnvs:
- _BaseColorMap0:
m_Texture: {fileID: 0}
m_Texture: {fileID: 2800000, guid: 866df234625deb44a8db971e2f2dca7c, type: 3}
m_Texture: {fileID: 2800000, guid: 0e413f4460470044d93a7c42e4275b09, type: 3}
m_Texture: {fileID: 2800000, guid: 866df234625deb44a8db971e2f2dca7c, type: 3}
m_Texture: {fileID: 2800000, guid: 0e413f4460470044d93a7c42e4275b09, type: 3}
m_Texture: {fileID: 2800000, guid: 866df234625deb44a8db971e2f2dca7c, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BaseColorMap3:

- _AlphaCutoff: 0.5
- _AlphaCutoffEnable: 0
- _BlendMode: 0
- _BlendSize1: 0
- _BlendSize2: 0
- _BlendSize3: 0
- _BumpScale: 1
- _CullMode: 2
- _Cutoff: 0.5

- _HeightBias1: 0
- _HeightBias2: 0
- _HeightBias3: 0
- _HeightFactor1: 1
- _HeightFactor2: 1
- _HeightFactor3: 1
- _HeightOffset1: 0
- _HeightOffset2: 0
- _HeightOffset3: 0
- _HeightScale0: 1
- _HeightScale1: 1
- _HeightScale2: 1

- _UVMappingPlanar2: 0
- _UVMappingPlanar3: 0
- _UVSec: 0
- _UseHeightBasedBlend1: 0
- _UseHeightBasedBlend2: 0
- _UseHeightBasedBlend3: 0
- _BaseColor1: {r: 0.97058815, g: 0.51384073, b: 0.51384073, a: 1}
- _BaseColor2: {r: 0.61764705, g: 1, b: 0.74685603, a: 1}
- _BaseColor1: {r: 1, g: 1, b: 1, a: 1}
- _BaseColor2: {r: 1, g: 1, b: 1, a: 1}
- _BaseColor3: {r: 0.6602435, g: 0.63235295, b: 1, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}

18
Assets/TestScenes/HDTest/LayeredLitTest/Material/Layered_Layer3_Triplanar.mat


serializedVersion: 3
m_TexEnvs:
- _BaseColorMap0:
m_Texture: {fileID: 0}
m_Texture: {fileID: 2800000, guid: 866df234625deb44a8db971e2f2dca7c, type: 3}
m_Texture: {fileID: 0}
m_Texture: {fileID: 2800000, guid: 866df234625deb44a8db971e2f2dca7c, type: 3}
m_Texture: {fileID: 0}
m_Texture: {fileID: 2800000, guid: 866df234625deb44a8db971e2f2dca7c, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BaseColorMap3:

- _AlphaCutoff: 0.5
- _AlphaCutoffEnable: 0
- _BlendMode: 0
- _BlendSize1: 0
- _BlendSize2: 0
- _BlendSize3: 0
- _BumpScale: 1
- _CullMode: 0
- _Cutoff: 0.5

- _HeightBias1: 0
- _HeightBias2: 0
- _HeightBias3: 0
- _HeightFactor1: 1
- _HeightFactor2: 1
- _HeightFactor3: 1
- _HeightOffset1: 0
- _HeightOffset2: 0
- _HeightOffset3: 0
- _HeightScale0: 1
- _HeightScale1: 1
- _HeightScale2: 1

- _UVMappingPlanar2: 0
- _UVMappingPlanar3: 0
- _UVSec: 0
- _UseHeightBasedBlend1: 0
- _UseHeightBasedBlend2: 0
- _UseHeightBasedBlend3: 0
- _ZTestMode: 8
- _ZWrite: 1
m_Colors:

30
Assets/TestScenes/HDTest/LayeredLitTest/Material/Layered_Layer3_UV0.mat


m_LightmapFlags: 1
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_Texture: {fileID: 0}
m_Texture: {fileID: 2800000, guid: 866df234625deb44a8db971e2f2dca7c, type: 3}
m_Texture: {fileID: 0}
m_Texture: {fileID: 2800000, guid: 866df234625deb44a8db971e2f2dca7c, type: 3}
m_Texture: {fileID: 0}
m_Texture: {fileID: 2800000, guid: 866df234625deb44a8db971e2f2dca7c, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BaseColorMap3:

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}

- _AlphaCutoff: 0.5
- _AlphaCutoffEnable: 0
- _BlendMode: 0
- _BlendSize1: 0
- _BlendSize2: 0
- _BlendSize3: 0
- _DepthOffsetEnable: 0
- _DetailAOScale0: 1
- _DetailAOScale1: 1
- _DetailAOScale2: 1

- _DetailSmoothnessScale2: 1
- _DetailSmoothnessScale3: 1
- _DistortionDepthTest: 0
- _DistortionEnable: 0
- _DistortionOnly: 0
- _DoubleSidedMode: 0
- _DstBlend: 0

- _HeightBias1: 0
- _HeightBias2: 0
- _HeightBias3: 0
- _HeightFactor1: 1
- _HeightFactor2: 1
- _HeightFactor3: 1
- _HeightOffset1: 0
- _HeightOffset2: 0
- _HeightOffset3: 0
- _HeightScale0: 1
- _HeightScale1: 1
- _HeightScale2: 1

- _UVDetailsMappingMask1: 0
- _UVDetailsMappingMask2: 0
- _UVDetailsMappingMask3: 0
- _UVMappingPlanar0: 0
- _UVMappingPlanar1: 0
- _UVMappingPlanar2: 0
- _UVMappingPlanar3: 0
- _UseHeightBasedBlend1: 0
- _UseHeightBasedBlend2: 0
- _UseHeightBasedBlend3: 0
- _ZTestMode: 8
- _ZWrite: 1
m_Colors:
- _BaseColor0: {r: 1, g: 1, b: 1, a: 1}

30
Assets/TestScenes/HDTest/LayeredLitTest/Material/Layered_Layer3_UV1.mat


m_LightmapFlags: 1
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_Texture: {fileID: 0}
m_Texture: {fileID: 2800000, guid: 866df234625deb44a8db971e2f2dca7c, type: 3}
m_Texture: {fileID: 0}
m_Texture: {fileID: 2800000, guid: 866df234625deb44a8db971e2f2dca7c, type: 3}
m_Texture: {fileID: 0}
m_Texture: {fileID: 2800000, guid: 866df234625deb44a8db971e2f2dca7c, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BaseColorMap3:

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}

- _AlphaCutoff: 0.5
- _AlphaCutoffEnable: 0
- _BlendMode: 0
- _BlendSize1: 0
- _BlendSize2: 0
- _BlendSize3: 0
- _DepthOffsetEnable: 0
- _DetailAOScale0: 1
- _DetailAOScale1: 1
- _DetailAOScale2: 1

- _DetailSmoothnessScale2: 1
- _DetailSmoothnessScale3: 1
- _DistortionDepthTest: 0
- _DistortionEnable: 0
- _DistortionOnly: 0
- _DoubleSidedMode: 0
- _DstBlend: 0

- _HeightBias1: 0
- _HeightBias2: 0
- _HeightBias3: 0
- _HeightFactor1: 1
- _HeightFactor2: 1
- _HeightFactor3: 1
- _HeightOffset1: 0
- _HeightOffset2: 0
- _HeightOffset3: 0
- _HeightScale0: 1
- _HeightScale1: 1
- _HeightScale2: 1

- _UVDetailsMappingMask1: 0
- _UVDetailsMappingMask2: 0
- _UVDetailsMappingMask3: 0
- _UVMappingPlanar0: 0
- _UVMappingPlanar1: 0
- _UVMappingPlanar2: 0
- _UVMappingPlanar3: 0
- _UseHeightBasedBlend1: 0
- _UseHeightBasedBlend2: 0
- _UseHeightBasedBlend3: 0
- _ZTestMode: 8
- _ZWrite: 1
m_Colors:
- _BaseColor0: {r: 1, g: 1, b: 1, a: 1}

18
Assets/TestScenes/HDTest/LayeredLitTest/Material/Layered_Layer3_UV2.mat


serializedVersion: 3
m_TexEnvs:
- _BaseColorMap0:
m_Texture: {fileID: 0}
m_Texture: {fileID: 2800000, guid: 866df234625deb44a8db971e2f2dca7c, type: 3}
m_Texture: {fileID: 0}
m_Texture: {fileID: 2800000, guid: 866df234625deb44a8db971e2f2dca7c, type: 3}
m_Texture: {fileID: 0}
m_Texture: {fileID: 2800000, guid: 866df234625deb44a8db971e2f2dca7c, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BaseColorMap3:

- _AlphaCutoff: 0.5
- _AlphaCutoffEnable: 0
- _BlendMode: 0
- _BlendSize1: 0
- _BlendSize2: 0
- _BlendSize3: 0
- _BumpScale: 1
- _CullMode: 2
- _Cutoff: 0.5

- _HeightBias1: 0
- _HeightBias2: 0
- _HeightBias3: 0
- _HeightFactor1: 1
- _HeightFactor2: 1
- _HeightFactor3: 1
- _HeightOffset1: 0
- _HeightOffset2: 0
- _HeightOffset3: 0
- _HeightScale0: 1
- _HeightScale1: 1
- _HeightScale2: 1

- _UVMappingPlanar2: 0
- _UVMappingPlanar3: 0
- _UVSec: 0
- _UseHeightBasedBlend1: 0
- _UseHeightBasedBlend2: 0
- _UseHeightBasedBlend3: 0
- _ZTestMode: 8
- _ZWrite: 1
m_Colors:

18
Assets/TestScenes/HDTest/LayeredLitTest/Material/Layered_Layer3_UV3.mat


serializedVersion: 3
m_TexEnvs:
- _BaseColorMap0:
m_Texture: {fileID: 0}
m_Texture: {fileID: 2800000, guid: 866df234625deb44a8db971e2f2dca7c, type: 3}
m_Texture: {fileID: 0}
m_Texture: {fileID: 2800000, guid: 866df234625deb44a8db971e2f2dca7c, type: 3}
m_Texture: {fileID: 0}
m_Texture: {fileID: 2800000, guid: 866df234625deb44a8db971e2f2dca7c, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BaseColorMap3:

- _AlphaCutoff: 0.5
- _AlphaCutoffEnable: 0
- _BlendMode: 0
- _BlendSize1: 0
- _BlendSize2: 0
- _BlendSize3: 0
- _BumpScale: 1
- _CullMode: 2
- _Cutoff: 0.5

- _HeightBias1: 0
- _HeightBias2: 0
- _HeightBias3: 0
- _HeightFactor1: 1
- _HeightFactor2: 1
- _HeightFactor3: 1
- _HeightOffset1: 0
- _HeightOffset2: 0
- _HeightOffset3: 0
- _HeightScale0: 1
- _HeightScale1: 1
- _HeightScale2: 1

- _UVMappingPlanar2: 0
- _UVMappingPlanar3: 0
- _UVSec: 0
- _UseHeightBasedBlend1: 0
- _UseHeightBasedBlend2: 0
- _UseHeightBasedBlend3: 0
- _ZTestMode: 8
- _ZWrite: 1
m_Colors:

9
Assets/TestScenes/HDTest/LayeredLitTest/Material/Lit_UVChart_Layer2_Detail.mat


m_LightmapFlags: 1
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:

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}

- _BumpScale: 1
- _CullMode: 2
- _Cutoff: 0.5
- _DepthOffsetEnable: 0
- _DetailAOScale: 1
- _DetailAlbedoScale: 1
- _DetailHeightScale: 1

- _DetailSmoothnessScale: 1
- _DistortionDepthTest: 0
- _DistortionEnable: 0
- _DistortionOnly: 0
- _DoubleSidedMode: 0
- _DstBlend: 0

- _TexWorldScale: 1
- _UVBase: 0
- _UVDetail: 0
- _UVMappingPlanar: 0
- _ZTestMode: 8
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 0.61764705, g: 1, b: 0.74685603, a: 1}

12
Assets/TestScenes/HDTest/LayeredLitTest/Material/Lit_White_Detail.mat


m_LightmapFlags: 1
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses:
- DistortionVectors
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:

m_Offset: {x: 0, y: 0}
- _BaseColorMap:
m_Texture: {fileID: 0}
m_Texture: {fileID: 2800000, guid: 866df234625deb44a8db971e2f2dca7c, 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}
- _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}

- _BumpScale: 1
- _CullMode: 2
- _Cutoff: 0.5
- _DepthOffsetEnable: 0
- _DetailAOScale: 1
- _DetailAlbedoScale: 1
- _DetailHeightScale: 1

- _DetailSmoothnessScale: 1
- _DistortionDepthTest: 0
- _DistortionEnable: 0
- _DistortionOnly: 0
- _DoubleSidedMode: 0
- _DstBlend: 0

- _TexWorldScale: 1
- _UVBase: 0
- _UVDetail: 0
- _UVMappingPlanar: 0
- _ZTestMode: 8
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}

10
ProjectSettings/GraphicsSettings.asset


--- !u!30 &1
GraphicsSettings:
m_ObjectHideFlags: 0
serializedVersion: 10
serializedVersion: 11
m_Deferred:
m_Mode: 0
m_Shader: {fileID: 0}

m_PreloadedShaders: []
m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000,
type: 0}
m_CustomRenderPipeline: {fileID: 11400000, guid: 2400b74f5ce370c4481e5dc417d03703,
m_CustomRenderPipeline: {fileID: 11400000, guid: e185fecca3c73cd47a09f1092663ef32,
type: 2}
m_TransparencySortMode: 0
m_TransparencySortAxis: {x: 0, y: 0, z: 1}

m_FogStripping: 0
m_LightmapKeepPlain: 1
m_LightmapKeepDirCombined: 1
m_LightmapKeepDirSeparate: 1
m_LightmapKeepDynamicDirSeparate: 1
m_LightmapKeepShadowMask: 1
m_LightmapKeepSubtractive: 1
m_LightsUseLinearIntensity: 1
m_LightsUseCCT: 1

4
Assets/ScriptableRenderLoop/HDRenderPipeline/Shadow/FixedSizePCF/FixedSizePCF.cs


using UnityEngine;
using UnityEngine.Experimental.Rendering;
using UnityEngine.Experimental.Rendering.HDPipeline;
namespace UnityEngine.Experimental.ScriptableRenderLoop
namespace UnityEngine.Experimental.Rendering.HDPipeline
{
public class ShadowFilteringFixedSizePCF
{

2
Assets/ScriptableRenderLoop/HDRenderPipeline/Lighting.meta


fileFormatVersion: 2
guid: 7dc18395c5211d44bbe417b8b8b2e81a
guid: 1c14e71d397fce047b1675fc26d0bb48
folderAsset: yes
timeCreated: 1474297943
licenseType: Pro

2
Assets/ScriptableRenderLoop/HDRenderPipeline/Material.meta


fileFormatVersion: 2
guid: 752ba4c5a264906428ff58cb5973e10a
guid: 96af336cb096f854ea18990a1c0a4e19
folderAsset: yes
timeCreated: 1474297943
licenseType: Pro

2
Assets/ScriptableRenderLoop/HDRenderPipeline/ShaderConfig.cs


// Configuration
//-----------------------------------------------------------------------------
namespace UnityEngine.Experimental.ScriptableRenderLoop
namespace UnityEngine.Experimental.Rendering.HDPipeline
{
[GenerateHLSL(PackingRules.Exact)]
public enum ShaderOptions

2
Assets/ScriptableRenderLoop/HDRenderPipeline/ShaderConfig.cs.hlsl


//
// This file was automatically generated from Assets/ScriptableRenderLoop/HDRenderLoop/ShaderConfig.cs. Please don't edit by hand.
// This file was automatically generated from Assets/ScriptableRenderLoop/HDRenderPipeline/ShaderConfig.cs. Please don't edit by hand.
//
#ifndef SHADERCONFIG_CS_HLSL

4
Assets/ScriptableRenderLoop/HDRenderPipeline/PostProcess/Resources/FinalPass.shader


// Final compositing pass, just does gamma correction for now.
Shader "Hidden/HDRenderLoop/FinalPass"
Shader "Hidden/HDRenderPipeline/FinalPass"
{
Properties
{

#include "Common.hlsl"
#include "Color.hlsl"
#include "Assets/ScriptableRenderLoop/HDRenderLoop/ShaderVariables.hlsl"
#include "Assets/ScriptableRenderLoop/HDRenderPipeline/ShaderVariables.hlsl"
TEXTURE2D(_MainTex);
SAMPLER2D(sampler_MainTex);

8
Assets/ScriptableRenderLoop/HDRenderPipeline/Debug/Resources/DebugViewTiles.shader


Shader "Hidden/HDRenderLoop/DebugViewTiles"
Shader "Hidden/HDRenderPipeline/DebugViewTiles"
{
SubShader
{

// deferred material must replace the old one here. If in the future we want to support multiple layout (cause a lot of consistency problem),
// the deferred shader will require to use multicompile.
#define UNITY_MATERIAL_LIT // Need to be define before including Material.hlsl
#include "Assets/ScriptableRenderLoop/HDRenderLoop/ShaderConfig.cs.hlsl"
#include "Assets/ScriptableRenderLoop/HDRenderLoop/ShaderVariables.hlsl"
#include "Assets/ScriptableRenderLoop/HDRenderLoop/Lighting/Lighting.hlsl" // This include Material.hlsl
#include "Assets/ScriptableRenderLoop/HDRenderPipeline/ShaderConfig.cs.hlsl"
#include "Assets/ScriptableRenderLoop/HDRenderPipeline/ShaderVariables.hlsl"
#include "Assets/ScriptableRenderLoop/HDRenderPipeline/Lighting/Lighting.hlsl" // This include Material.hlsl
//-------------------------------------------------------------------------------------
// variable declaration

10
Assets/ScriptableRenderLoop/HDRenderPipeline/Debug/Resources/DebugViewMaterialGBuffer.shader


Shader "Hidden/HDRenderLoop/DebugViewMaterialGBuffer"
Shader "Hidden/HDRenderPipeline/DebugViewMaterialGBuffer"
{
SubShader
{

// CAUTION: In case deferred lighting need to support various lighting model statically, we will require to do multicompile with different define like UNITY_MATERIAL_LIT
#define UNITY_MATERIAL_LIT // Need to be define before including Material.hlsl
#include "Assets/ScriptableRenderLoop/HDRenderLoop/ShaderConfig.cs.hlsl"
#include "Assets/ScriptableRenderLoop/HDRenderLoop/ShaderVariables.hlsl"
#include "Assets/ScriptableRenderLoop/HDRenderLoop/Debug/DebugViewMaterial.cs.hlsl"
#include "Assets/ScriptableRenderLoop/HDRenderLoop/Material/Material.hlsl"
#include "Assets/ScriptableRenderLoop/HDRenderPipeline/ShaderConfig.cs.hlsl"
#include "Assets/ScriptableRenderLoop/HDRenderPipeline/ShaderVariables.hlsl"
#include "Assets/ScriptableRenderLoop/HDRenderPipeline/Debug/DebugViewMaterial.cs.hlsl"
#include "Assets/ScriptableRenderLoop/HDRenderPipeline/Material/Material.hlsl"
DECLARE_GBUFFER_TEXTURE(_GBufferTexture);

2
Assets/ScriptableRenderLoop/HDRenderPipeline/Debug/DebugViewMaterial.cs.hlsl


//
// This file was automatically generated from Assets/ScriptableRenderLoop/HDRenderLoop/Debug/DebugViewMaterial.cs. Please don't edit by hand.
// This file was automatically generated from Assets/ScriptableRenderLoop/HDRenderPipeline/Debug/DebugViewMaterial.cs. Please don't edit by hand.
//
#ifndef DEBUGVIEWMATERIAL_CS_HLSL

6
Assets/ScriptableRenderLoop/HDRenderPipeline/Debug/DebugViewMaterial.cs


using UnityEngine;
namespace UnityEngine.Experimental.ScriptableRenderLoop
namespace UnityEngine.Experimental.Rendering.HDPipeline
{
namespace Attributes
{

BakeDiffuseLighting,
}
}
} // namespace UnityEngine.Experimental.ScriptableRenderLoop
}

24
Assets/ScriptableRenderLoop/HDRenderPipeline/Editor/HDRenderPipelineMenuItems.cs


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using UnityEngine.Experimental.Rendering.HDPipeline;
namespace UnityEngine.Experimental.ScriptableRenderLoop
namespace UnityEditor.Experimental.ScriptableRenderLoop
public class HDRenderLoopMenuItems
public class HDRenderPipelineMenuItems
[UnityEditor.MenuItem("HDRenderLoop/Create Scene Settings")]
[UnityEditor.MenuItem("HDRenderPipeline/Create Scene Settings")]
if(settings.Length == 0)
if (settings.Length == 0)
{
GameObject go = new GameObject();
go.name = "SceneSettings";

{
Debug.LogWarning("SceneSettings has already been created.");
}
}
[UnityEditor.MenuItem("HDRenderPipeline/Synchronize all Layered materials")]
static void SynchronizeAllLayeredMaterial()
{
Object[] materials = Resources.FindObjectsOfTypeAll<Material>();
foreach (Object obj in materials)
{
Material mat = obj as Material;
if(mat.shader.name == "HDRenderLoop/LayeredLit")
{
LayeredLitGUI.SynchronizeAllLayers(mat);
}
}
}
}

48
Assets/ScriptableRenderLoop/HDRenderPipeline/Editor/HDRenderPipelineInspector.cs


//using EditorGUIUtility=UnityEditor.EditorGUIUtility;
namespace UnityEngine.Experimental.ScriptableRenderLoop
namespace UnityEngine.Experimental.Rendering.HDPipeline
[CustomEditor(typeof(HDRenderLoop))]
public class HDRenderLoopInspector : Editor
[CustomEditor(typeof(HDRenderPipeline))]
public class HDRenderPipelineInspector : Editor
{
private class Styles
{

}
}
private void DebugParametersUI(HDRenderLoop renderLoop)
private void DebugParametersUI(HDRenderPipeline renderContext)
var debugParameters = renderLoop.debugParameters;
var debugParameters = renderContext.debugParameters;
EditorGUILayout.LabelField(styles.debugParameters);
EditorGUI.indentLevel++;

if (EditorGUI.EndChangeCheck())
{
EditorUtility.SetDirty(renderLoop); // Repaint
EditorUtility.SetDirty(renderContext); // Repaint
private void ShadowParametersUI(HDRenderLoop renderLoop)
private void ShadowParametersUI(HDRenderPipeline renderContext)
var shadowParameters = renderLoop.shadowSettings;
var shadowParameters = renderContext.shadowSettings;
EditorGUILayout.LabelField(styles.shadowSettings);
EditorGUI.indentLevel++;

if (EditorGUI.EndChangeCheck())
{
EditorUtility.SetDirty(renderLoop); // Repaint
EditorUtility.SetDirty(renderContext); // Repaint
private void TextureParametersUI(HDRenderLoop renderLoop)
private void TextureParametersUI(HDRenderPipeline renderContext)
var textureParameters = renderLoop.textureSettings;
var textureParameters = renderContext.textureSettings;
EditorGUILayout.LabelField(styles.textureSettings);
EditorGUI.indentLevel++;

if (EditorGUI.EndChangeCheck())
{
renderLoop.textureSettings = textureParameters;
EditorUtility.SetDirty(renderLoop); // Repaint
renderContext.textureSettings = textureParameters;
EditorUtility.SetDirty(renderContext); // Repaint
private void TilePassUI(HDRenderLoop renderLoop)
private void TilePassUI(HDRenderPipeline renderContext)
TilePass.LightLoop tilePass = renderLoop.lightLoop as TilePass.LightLoop;
TilePass.LightLoop tilePass = renderContext.lightLoop as TilePass.LightLoop;
if (tilePass != null)
{
EditorGUILayout.LabelField(styles.tileLightLoopSettings);

if (EditorGUI.EndChangeCheck())
{
EditorUtility.SetDirty(renderLoop); // Repaint
EditorUtility.SetDirty(renderContext); // Repaint
renderLoop.ClearCachedData();
renderContext.DestroyCreatedInstances();
}
EditorGUI.BeginChangeCheck();

if (EditorGUI.EndChangeCheck())
{
EditorUtility.SetDirty(renderLoop); // Repaint
EditorUtility.SetDirty(renderContext); // Repaint
UnityEditorInternal.InternalEditorUtility.RepaintAllViews();
}
EditorGUI.indentLevel--;

public override void OnInspectorGUI()
{
var renderLoop = target as HDRenderLoop;
var renderContext = target as HDRenderPipeline;
if (!renderLoop)
if (!renderContext)
DebugParametersUI(renderLoop);
ShadowParametersUI(renderLoop);
TextureParametersUI(renderLoop);
TilePassUI(renderLoop);
DebugParametersUI(renderContext);
ShadowParametersUI(renderContext);
TextureParametersUI(renderContext);
TilePassUI(renderContext);
}
}
}

16
Assets/ScriptableRenderLoop/HDRenderPipeline/Editor/UpgradeStandardShaderMaterials.cs


using System.Collections;
using UnityEditor;
using System;
using NUnit.Framework;
namespace UnityEditor.Experimental.ScriptableRenderLoop
namespace UnityEditor.Experimental.Rendering.HDPipeline
public class UpgradeStandardShaderMaterials
public class UpgradeStandardShaderMaterials
{
static List<MaterialUpgrader> GetHDUpgraders()
{

return upgraders;
}
[MenuItem("HDRenderLoop/Upgrade Materials - Project")]
[MenuItem("HDRenderPipeline/Upgrade Materials - Project")]
[MenuItem("HDRenderLoop/Upgrade Materials - Selection")]
[MenuItem("HDRenderPipeline/Upgrade Materials - Selection")]
[MenuItem("HDRenderLoop/Modify Light Intensity for Upgrade - Scene Only")]
[MenuItem("HDRenderPipeline/Modify Light Intensity for Upgrade - Scene Only")]
static void UpgradeLights()
{
Light[] lights = Light.GetLights(LightType.Directional, 0);

}
}
}
}
}

2
Assets/ScriptableRenderLoop/HDRenderPipeline/Sky.meta


fileFormatVersion: 2
guid: d7469c05ebee66f4886264af0ab8bf2a
guid: 066ab4d03bd03384f81c9d82b479f8dd
folderAsset: yes
timeCreated: 1479239906
licenseType: Pro

60
Assets/ScriptableRenderLoop/HDRenderPipeline/Utilities.cs


using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Experimental.Rendering;
using UnityEngine.Experimental.Rendering.HDPipeline;
namespace UnityEngine.Experimental.ScriptableRenderLoop
namespace UnityEngine.Experimental.Rendering.HDPipeline
{
[Flags]
public enum ClearFlag

// Render Target Management.
public const ClearFlag kClearAll = ClearFlag.ClearDepth | ClearFlag.ClearColor;
public static void SetRenderTarget(ScriptableRenderContext renderLoop, RenderTargetIdentifier buffer, ClearFlag clearFlag = ClearFlag.ClearNone, int miplevel = 0, CubemapFace cubemapFace = CubemapFace.Unknown)
public static void SetRenderTarget(ScriptableRenderContext renderContext, RenderTargetIdentifier buffer, ClearFlag clearFlag = ClearFlag.ClearNone, int miplevel = 0, CubemapFace cubemapFace = CubemapFace.Unknown)
renderLoop.ExecuteCommandBuffer(cmd);
renderContext.ExecuteCommandBuffer(cmd);
public static void SetRenderTarget(ScriptableRenderContext renderLoop, RenderTargetIdentifier colorBuffer, RenderTargetIdentifier depthBuffer, int miplevel = 0, CubemapFace cubemapFace = CubemapFace.Unknown)
public static void SetRenderTarget(ScriptableRenderContext renderContext, RenderTargetIdentifier colorBuffer, RenderTargetIdentifier depthBuffer, int miplevel = 0, CubemapFace cubemapFace = CubemapFace.Unknown)
SetRenderTarget(renderLoop, colorBuffer, depthBuffer, ClearFlag.ClearNone, new Color(0.0f, 0.0f, 0.0f, 0.0f), miplevel, cubemapFace);
SetRenderTarget(renderContext, colorBuffer, depthBuffer, ClearFlag.ClearNone, new Color(0.0f, 0.0f, 0.0f, 0.0f), miplevel, cubemapFace);
public static void SetRenderTarget(ScriptableRenderContext renderLoop, RenderTargetIdentifier colorBuffer, RenderTargetIdentifier depthBuffer, ClearFlag clearFlag, int miplevel = 0, CubemapFace cubemapFace = CubemapFace.Unknown)
public static void SetRenderTarget(ScriptableRenderContext renderContext, RenderTargetIdentifier colorBuffer, RenderTargetIdentifier depthBuffer, ClearFlag clearFlag, int miplevel = 0, CubemapFace cubemapFace = CubemapFace.Unknown)
SetRenderTarget(renderLoop, colorBuffer, depthBuffer, clearFlag, new Color(0.0f, 0.0f, 0.0f, 0.0f), miplevel, cubemapFace);
SetRenderTarget(renderContext, colorBuffer, depthBuffer, clearFlag, new Color(0.0f, 0.0f, 0.0f, 0.0f), miplevel, cubemapFace);
public static void SetRenderTarget(ScriptableRenderContext renderLoop, RenderTargetIdentifier colorBuffer, RenderTargetIdentifier depthBuffer, ClearFlag clearFlag, Color clearColor, int miplevel = 0, CubemapFace cubemapFace = CubemapFace.Unknown)
public static void SetRenderTarget(ScriptableRenderContext renderContext, RenderTargetIdentifier colorBuffer, RenderTargetIdentifier depthBuffer, ClearFlag clearFlag, Color clearColor, int miplevel = 0, CubemapFace cubemapFace = CubemapFace.Unknown)
{
var cmd = new CommandBuffer();
cmd.name = "";

renderLoop.ExecuteCommandBuffer(cmd);
renderContext.ExecuteCommandBuffer(cmd);
public static void SetRenderTarget(ScriptableRenderContext renderLoop, RenderTargetIdentifier[] colorBuffers, RenderTargetIdentifier depthBuffer)
public static void SetRenderTarget(ScriptableRenderContext renderContext, RenderTargetIdentifier[] colorBuffers, RenderTargetIdentifier depthBuffer)
SetRenderTarget(renderLoop, colorBuffers, depthBuffer, ClearFlag.ClearNone, Color.black);
SetRenderTarget(renderContext, colorBuffers, depthBuffer, ClearFlag.ClearNone, Color.black);
public static void SetRenderTarget(ScriptableRenderContext renderLoop, RenderTargetIdentifier[] colorBuffers, RenderTargetIdentifier depthBuffer, ClearFlag clearFlag = ClearFlag.ClearNone)
public static void SetRenderTarget(ScriptableRenderContext renderContext, RenderTargetIdentifier[] colorBuffers, RenderTargetIdentifier depthBuffer, ClearFlag clearFlag = ClearFlag.ClearNone)
SetRenderTarget(renderLoop, colorBuffers, depthBuffer, clearFlag, Color.black);
SetRenderTarget(renderContext, colorBuffers, depthBuffer, clearFlag, Color.black);
public static void SetRenderTarget(ScriptableRenderContext renderLoop, RenderTargetIdentifier[] colorBuffers, RenderTargetIdentifier depthBuffer, ClearFlag clearFlag, Color clearColor)
public static void SetRenderTarget(ScriptableRenderContext renderContext, RenderTargetIdentifier[] colorBuffers, RenderTargetIdentifier depthBuffer, ClearFlag clearFlag, Color clearColor)
{
var cmd = new CommandBuffer();
cmd.name = "";

renderLoop.ExecuteCommandBuffer(cmd);
renderContext.ExecuteCommandBuffer(cmd);
cmd.Dispose();
}

: IDisposable
{
bool disposed = false;
ScriptableRenderContext renderLoop;
ScriptableRenderContext renderContext;
renderLoop = _renderloop;
renderContext = _renderloop;
renderLoop.ExecuteCommandBuffer(cmd);
renderContext.ExecuteCommandBuffer(cmd);
cmd.Dispose();
}

CommandBuffer cmd = new CommandBuffer();
cmd.name = "";
cmd.EndSample(name);
renderLoop.ExecuteCommandBuffer(cmd);
renderContext.ExecuteCommandBuffer(cmd);
cmd.Dispose();
}

return gpuVP;
}
public static HDRenderLoop.HDCamera GetHDCamera(Camera camera)
public static HDRenderPipeline.HDCamera GetHDCamera(Camera camera)
HDRenderLoop.HDCamera hdCamera = new HDRenderLoop.HDCamera();
HDRenderPipeline.HDCamera hdCamera = new HDRenderPipeline.HDCamera();
hdCamera.camera = camera;
hdCamera.screenSize = new Vector4(camera.pixelWidth, camera.pixelHeight, 1.0f / camera.pixelWidth, 1.0f / camera.pixelHeight);

return hdCamera;
}
public static void SetupMaterialHDCamera(HDRenderLoop.HDCamera hdCamera, Material material)
public static void SetupMaterialHDCamera(HDRenderPipeline.HDCamera hdCamera, Material material)
{
material.SetVector("_ScreenSize", hdCamera.screenSize);
material.SetMatrix("_ViewProjMatrix", hdCamera.viewProjectionMatrix);

m.DisableKeyword(keyword);
}
public static HDRenderLoop GetHDRenderLoop()
public static HDRenderPipeline GetHDRenderPipeline()
HDRenderLoop renderLoop = UnityEngine.Rendering.GraphicsSettings.renderPipeline as HDRenderLoop;
if (renderLoop == null)
HDRenderPipeline renderContext = UnityEngine.Rendering.GraphicsSettings.renderPipeline as HDRenderPipeline;
if (renderContext == null)
Debug.LogWarning("SkyParameters component can only be used with HDRenderLoop custom RenderPipeline.");
Debug.LogWarning("SkyParameters component can only be used with HDRenderPipeline custom RenderPipeline.");
return renderLoop;
return renderContext;
}
}
}

2
Assets/ScriptableRenderLoop/HDRenderPipeline/SceneSettings/Editor/CommonSettingsEditor.cs


using System.Linq;
using System.Reflection;
namespace UnityEngine.Experimental.ScriptableRenderLoop
namespace UnityEngine.Experimental.Rendering.HDPipeline
{
[CustomEditor(typeof(CommonSettings))]
[CanEditMultipleObjects]

28
Assets/ScriptableRenderLoop/HDRenderPipeline/SceneSettings/CommonSettings.cs


using System.Linq;
using System.Reflection;
namespace UnityEngine.Experimental.ScriptableRenderLoop
namespace UnityEngine.Experimental.Rendering.HDPipeline
{
[ExecuteInEditMode]
[DisallowMultipleComponent]

void OnEnable()
{
HDRenderLoop renderLoop = Utilities.GetHDRenderLoop();
if (renderLoop == null)
HDRenderPipeline renderPipeline = Utilities.GetHDRenderPipeline();
if (renderPipeline == null)
if (renderLoop.commonSettings == null)
renderLoop.commonSettings = this;
else if (renderLoop.commonSettings != this)
if (renderPipeline.commonSettings == null)
renderPipeline.commonSettings = this;
else if (renderPipeline.commonSettings != this)
Debug.LogWarning("Only one CommonSettings can be setup at a time.");
OnSkyRendererChanged();

{
HDRenderLoop renderLoop = Utilities.GetHDRenderLoop();
if (renderLoop == null)
HDRenderPipeline renderPipeline = Utilities.GetHDRenderPipeline();
if (renderPipeline == null)
if (renderLoop.commonSettings == this)
renderLoop.commonSettings = null;
if (renderPipeline.commonSettings == this)
renderPipeline.commonSettings = null;
}
void OnValidate()

void OnSkyRendererChanged()
{
HDRenderLoop renderLoop = Utilities.GetHDRenderLoop();
if (renderLoop == null)
HDRenderPipeline renderPipeline = Utilities.GetHDRenderPipeline();
if (renderPipeline == null)
renderLoop.InstantiateSkyRenderer(skyRendererType);
renderPipeline.InstantiateSkyRenderer(skyRendererType);
Type skyParamType = renderLoop.skyManager.GetSkyParameterType();
Type skyParamType = renderPipeline.skyManager.GetSkyParameterType();
// Disable all incompatible sky parameters and enable the compatible one
bool found = false;

285
Assets/ScriptableRenderLoop/HDRenderPipeline/HDRenderPipeline.cs


using UnityEngine.Rendering;
using UnityEngine.Experimental.Rendering;
using UnityEngine.ScriptableRenderPipeline;
namespace UnityEngine.Experimental.ScriptableRenderLoop
namespace UnityEngine.Experimental.Rendering.HDPipeline
public class HDRenderPipelineInstance : RenderPipeline
{
private readonly HDRenderPipeline m_Owner;
public HDRenderPipelineInstance(HDRenderPipeline owner)
{
m_Owner = owner;
if (m_Owner != null)
m_Owner.Build();
}
public override void Dispose()
{
base.Dispose();
if (m_Owner != null)
m_Owner.Cleanup();
}
public override void Render(ScriptableRenderContext renderContext, Camera[] cameras)
{
base.Render(renderContext, cameras);
m_Owner.Render(renderContext, cameras);
}
}
// This HDRenderLoop assume linear lighting. Don't work with gamma.
public partial class HDRenderLoop : RenderPipeline
// This HDRenderPipeline assume linear lighting. Don't work with gamma.
public class HDRenderPipeline : RenderPipelineAsset
const string k_HDRenderLoopPath = "Assets/ScriptableRenderLoop/HDRenderLoop/HDRenderLoop.asset";
const string k_HDRenderPipelinePath = "Assets/ScriptableRenderLoop/HDRenderPipeline/HDRenderPipeline.asset";
[UnityEditor.MenuItem("Renderloop/CreateHDRenderLoop")]
static void CreateHDRenderLoop()
[UnityEditor.MenuItem("RenderPipeline/CreateHDRenderPipeline")]
static void CreateHDRenderPipeline()
var instance = ScriptableObject.CreateInstance<HDRenderLoop>();
UnityEditor.AssetDatabase.CreateAsset(instance, k_HDRenderLoopPath);
var instance = ScriptableObject.CreateInstance<HDRenderPipeline>();
UnityEditor.AssetDatabase.CreateAsset(instance, k_HDRenderPipelinePath);
[UnityEditor.MenuItem("HDRenderLoop/Add \"Additional Light Data\" (if not present)")]
[UnityEditor.MenuItem("HDRenderPipeline/Add \"Additional Light Data\" (if not present)")]
static void AddAdditionalLightData()
{
Light[] lights = FindObjectsOfType(typeof(Light)) as Light[];

}
}
#endif
private class HDLoopDataStore : RenderingDataStore
{
public HDLoopDataStore(BaseRenderPipeline owner) : base(owner)
{ }
protected override void InternalBuild()
{
base.InternalBuild();
HDRenderLoop theOwner = owner as HDRenderLoop;
if (theOwner != null)
theOwner.Build();
}
protected override void InternalCleanup()
{
base.InternalCleanup();
HDRenderLoop theOwner = owner as HDRenderLoop;
if (theOwner != null)
theOwner.Cleanup();
}
}
public override IScriptableRenderDataStore ConstructDataStore()
protected override IRenderPipeline InternalCreatePipeline()
return new HDLoopDataStore(this);
return new HDRenderPipelineInstance(this);
SkyManager m_SkyManager = new SkyManager();
public SkyManager skyManager
{

m_SkyManager.Build();
m_FinalPassMaterial = Utilities.CreateEngineMaterial("Hidden/HDRenderLoop/FinalPass");
m_DebugViewMaterialGBuffer = Utilities.CreateEngineMaterial("Hidden/HDRenderLoop/DebugViewMaterialGBuffer");
m_FinalPassMaterial = Utilities.CreateEngineMaterial("Hidden/HDRenderPipeline/FinalPass");
m_DebugViewMaterialGBuffer = Utilities.CreateEngineMaterial("Hidden/HDRenderPipeline/DebugViewMaterialGBuffer");
m_ShadowPass = new ShadowRenderPass(m_ShadowSettings);

UnityEngine.Rendering.GraphicsSettings.lightsUseCCT = previousLightsUseCCT;
}
void InitAndClearBuffer(Camera camera, ScriptableRenderContext renderLoop)
void InitAndClearBuffer(Camera camera, ScriptableRenderContext renderContext)
using (new Utilities.ProfilingSample("InitAndClearBuffer", renderLoop))
using (new Utilities.ProfilingSample("InitAndClearBuffer", renderContext))
using (new Utilities.ProfilingSample("InitGBuffers and clear Depth/Stencil", renderLoop))
using (new Utilities.ProfilingSample("InitGBuffers and clear Depth/Stencil", renderContext))
{
var cmd = new CommandBuffer();
cmd.name = "";

// Also we manage ourself the HDR format, here allocating fp16 directly.
// With scriptable render loop we can allocate temporary RT in a command buffer, they will not be release with ExecuteCommandBuffer
// These temporary surface are release automatically at the end of the scriptable renderloop if not release explicitly
// These temporary surface are release automatically at the end of the scriptable render pipeline if not release explicitly
int w = camera.pixelWidth;
int h = camera.pixelHeight;

{
m_gbufferManager.InitGBuffers(w, h, cmd);
}
renderLoop.ExecuteCommandBuffer(cmd);
renderContext.ExecuteCommandBuffer(cmd);
Utilities.SetRenderTarget(renderLoop, m_CameraColorBufferRT, m_CameraDepthBufferRT, ClearFlag.ClearDepth);
Utilities.SetRenderTarget(renderContext, m_CameraColorBufferRT, m_CameraDepthBufferRT, ClearFlag.ClearDepth);
using (new Utilities.ProfilingSample("Clear HDR target", renderLoop))
using (new Utilities.ProfilingSample("Clear HDR target", renderContext))
Utilities.SetRenderTarget(renderLoop, m_CameraColorBufferRT, m_CameraDepthBufferRT, ClearFlag.ClearColor, Color.black);
Utilities.SetRenderTarget(renderContext, m_CameraColorBufferRT, m_CameraDepthBufferRT, ClearFlag.ClearColor, Color.black);
using (new Utilities.ProfilingSample("Clear GBuffer", renderLoop))
using (new Utilities.ProfilingSample("Clear GBuffer", renderContext))
Utilities.SetRenderTarget(renderLoop, m_gbufferManager.GetGBuffers(), m_CameraDepthBufferRT, ClearFlag.ClearColor, Color.black);
Utilities.SetRenderTarget(renderContext, m_gbufferManager.GetGBuffers(), m_CameraDepthBufferRT, ClearFlag.ClearColor, Color.black);
}
// END TEMP

void RenderOpaqueRenderList(CullResults cull, Camera camera, ScriptableRenderContext renderLoop, string passName, RendererConfiguration rendererConfiguration = 0)
void RenderOpaqueRenderList(CullResults cull, Camera camera, ScriptableRenderContext renderContext, string passName, RendererConfiguration rendererConfiguration = 0)
{
if (!debugParameters.displayOpaqueObjects)
return;

sorting = { flags = SortFlags.CommonOpaque }
};
settings.inputFilter.SetQueuesOpaque();
renderLoop.DrawRenderers(ref settings);
renderContext.DrawRenderers(ref settings);
void RenderTransparentRenderList(CullResults cull, Camera camera, ScriptableRenderContext renderLoop, string passName, RendererConfiguration rendererConfiguration = 0)
void RenderTransparentRenderList(CullResults cull, Camera camera, ScriptableRenderContext renderContext, string passName, RendererConfiguration rendererConfiguration = 0)
{
if (!debugParameters.displayTransparentObjects)
return;

sorting = { flags = SortFlags.CommonTransparent }
};
settings.inputFilter.SetQueuesTransparent();
renderLoop.DrawRenderers(ref settings);
renderContext.DrawRenderers(ref settings);
void RenderDepthPrepass(CullResults cull, Camera camera, ScriptableRenderContext renderLoop)
void RenderDepthPrepass(CullResults cull, Camera camera, ScriptableRenderContext renderContext)
{
// If we are forward only we will do a depth prepass
// TODO: Depth prepass should be enabled based on light loop settings. LightLoop define if they need a depth prepass + forward only...

using (new Utilities.ProfilingSample("Depth Prepass", renderLoop))
using (new Utilities.ProfilingSample("Depth Prepass", renderContext))
Utilities.SetRenderTarget(renderLoop, m_CameraDepthBufferRT);
RenderOpaqueRenderList(cull, camera, renderLoop, "DepthOnly");
Utilities.SetRenderTarget(renderContext, m_CameraDepthBufferRT);
RenderOpaqueRenderList(cull, camera, renderContext, "DepthOnly");
void RenderGBuffer(CullResults cull, Camera camera, ScriptableRenderContext renderLoop)
void RenderGBuffer(CullResults cull, Camera camera, ScriptableRenderContext renderContext)
{
if (debugParameters.useForwardRenderingOnly)
{

using (new Utilities.ProfilingSample("GBuffer Pass", renderLoop))
using (new Utilities.ProfilingSample("GBuffer Pass", renderContext))
Utilities.SetRenderTarget(renderLoop, m_gbufferManager.GetGBuffers(), m_CameraDepthBufferRT);
Utilities.SetRenderTarget(renderContext, m_gbufferManager.GetGBuffers(), m_CameraDepthBufferRT);
RenderOpaqueRenderList(cull, camera, renderLoop, "GBuffer", Utilities.kRendererConfigurationBakedLighting);
RenderOpaqueRenderList(cull, camera, renderContext, "GBuffer", Utilities.kRendererConfigurationBakedLighting);
void RenderForwardOnlyDepthPrepass(CullResults cull, Camera camera, ScriptableRenderContext renderLoop)
void RenderForwardOnlyDepthPrepass(CullResults cull, Camera camera, ScriptableRenderContext renderContext)
{
// If we are forward only we don't need to render ForwardOpaqueDepth object
// But in case we request a prepass we render it

using (new Utilities.ProfilingSample("Forward opaque depth", renderLoop))
using (new Utilities.ProfilingSample("Forward opaque depth", renderContext))
Utilities.SetRenderTarget(renderLoop, m_CameraDepthBufferRT);
RenderOpaqueRenderList(cull, camera, renderLoop, "ForwardOnlyDepthOnly");
Utilities.SetRenderTarget(renderContext, m_CameraDepthBufferRT);
RenderOpaqueRenderList(cull, camera, renderContext, "ForwardOnlyDepthOnly");
void RenderDebugViewMaterial(CullResults cull, HDCamera hdCamera, ScriptableRenderContext renderLoop)
void RenderDebugViewMaterial(CullResults cull, HDCamera hdCamera, ScriptableRenderContext renderContext)
using (new Utilities.ProfilingSample("DebugView Material Mode Pass", renderLoop))
using (new Utilities.ProfilingSample("DebugView Material Mode Pass", renderContext))
Utilities.SetRenderTarget(renderLoop, m_CameraColorBufferRT, m_CameraDepthBufferRT, Utilities.kClearAll, Color.black);
Utilities.SetRenderTarget(renderContext, m_CameraColorBufferRT, m_CameraDepthBufferRT, Utilities.kClearAll, Color.black);
RenderOpaqueRenderList(cull, hdCamera.camera, renderLoop, "DebugViewMaterial");
RenderOpaqueRenderList(cull, hdCamera.camera, renderContext, "DebugViewMaterial");
}
// Render GBuffer opaque

// TODO: Bind depth textures
var cmd = new CommandBuffer { name = "GBuffer Debug Pass" };
cmd.Blit(null, m_CameraColorBufferRT, m_DebugViewMaterialGBuffer, 0);
renderLoop.ExecuteCommandBuffer(cmd);
renderContext.ExecuteCommandBuffer(cmd);
RenderTransparentRenderList(cull, hdCamera.camera, renderLoop, "DebugViewMaterial");
RenderTransparentRenderList(cull, hdCamera.camera, renderContext, "DebugViewMaterial");
}
// Last blit

renderLoop.ExecuteCommandBuffer(cmd);
renderContext.ExecuteCommandBuffer(cmd);
void RenderDeferredLighting(HDCamera hdCamera, ScriptableRenderContext renderLoop)
void RenderDeferredLighting(HDCamera hdCamera, ScriptableRenderContext renderContext)
{
if (debugParameters.useForwardRenderingOnly)
{

// Bind material data
m_LitRenderLoop.Bind();
m_lightLoop.RenderDeferredLighting(hdCamera, renderLoop, m_CameraColorBuffer);
m_lightLoop.RenderDeferredLighting(hdCamera, renderContext, m_CameraColorBuffer);
void UpdateSkyEnvironment(HDCamera hdCamera, ScriptableRenderContext renderLoop)
void UpdateSkyEnvironment(HDCamera hdCamera, ScriptableRenderContext renderContext)
m_SkyManager.UpdateEnvironment(hdCamera, m_lightLoop.GetCurrentSunLight(), renderLoop);
m_SkyManager.UpdateEnvironment(hdCamera, m_lightLoop.GetCurrentSunLight(), renderContext);
void RenderSky(HDCamera hdCamera, ScriptableRenderContext renderLoop)
void RenderSky(HDCamera hdCamera, ScriptableRenderContext renderContext)
m_SkyManager.RenderSky(hdCamera, m_lightLoop.GetCurrentSunLight(), m_CameraColorBufferRT, m_CameraDepthBufferRT, renderLoop);
m_SkyManager.RenderSky(hdCamera, m_lightLoop.GetCurrentSunLight(), m_CameraColorBufferRT, m_CameraDepthBufferRT, renderContext);
void RenderForward(CullResults cullResults, Camera camera, ScriptableRenderContext renderLoop, bool renderOpaque)
void RenderForward(CullResults cullResults, Camera camera, ScriptableRenderContext renderContext, bool renderOpaque)
{
// TODO: Currently we can't render opaque object forward when deferred is enabled
// miss option

using (new Utilities.ProfilingSample("Forward Pass", renderLoop))
using (new Utilities.ProfilingSample("Forward Pass", renderContext))
Utilities.SetRenderTarget(renderLoop, m_CameraColorBufferRT, m_CameraDepthBufferRT);
Utilities.SetRenderTarget(renderContext, m_CameraColorBufferRT, m_CameraDepthBufferRT);
m_lightLoop.RenderForward(camera, renderLoop, renderOpaque);
m_lightLoop.RenderForward(camera, renderContext, renderOpaque);
RenderOpaqueRenderList(cullResults, camera, renderLoop, "Forward");
RenderOpaqueRenderList(cullResults, camera, renderContext, "Forward");
RenderTransparentRenderList(cullResults, camera, renderLoop, "Forward", Utilities.kRendererConfigurationBakedLighting);
RenderTransparentRenderList(cullResults, camera, renderContext, "Forward", Utilities.kRendererConfigurationBakedLighting);
}
}
}

void RenderForwardOnly(CullResults cullResults, Camera camera, ScriptableRenderContext renderLoop)
void RenderForwardOnly(CullResults cullResults, Camera camera, ScriptableRenderContext renderContext)
using (new Utilities.ProfilingSample("Forward Only Pass", renderLoop))
using (new Utilities.ProfilingSample("Forward Only Pass", renderContext))
Utilities.SetRenderTarget(renderLoop, m_CameraColorBufferRT, m_CameraDepthBufferRT);
Utilities.SetRenderTarget(renderContext, m_CameraColorBufferRT, m_CameraDepthBufferRT);
m_lightLoop.RenderForward(camera, renderLoop, true);
RenderOpaqueRenderList(cullResults, camera, renderLoop, "ForwardOnly");
m_lightLoop.RenderForward(camera, renderContext, true);
RenderOpaqueRenderList(cullResults, camera, renderContext, "ForwardOnly");
void RenderForwardUnlit(CullResults cullResults, Camera camera, ScriptableRenderContext renderLoop)
void RenderForwardUnlit(CullResults cullResults, Camera camera, ScriptableRenderContext renderContext)
using (new Utilities.ProfilingSample("Forward Unlit Pass", renderLoop))
using (new Utilities.ProfilingSample("Forward Unlit Pass", renderContext))
Utilities.SetRenderTarget(renderLoop, m_CameraColorBufferRT, m_CameraDepthBufferRT);
RenderOpaqueRenderList(cullResults, camera, renderLoop, "ForwardUnlit");
RenderTransparentRenderList(cullResults, camera, renderLoop, "ForwardUnlit");
Utilities.SetRenderTarget(renderContext, m_CameraColorBufferRT, m_CameraDepthBufferRT);
RenderOpaqueRenderList(cullResults, camera, renderContext, "ForwardUnlit");
RenderTransparentRenderList(cullResults, camera, renderContext, "ForwardUnlit");
void RenderVelocity(CullResults cullResults, Camera camera, ScriptableRenderContext renderLoop)
void RenderVelocity(CullResults cullResults, Camera camera, ScriptableRenderContext renderContext)
using (new Utilities.ProfilingSample("Velocity Pass", renderLoop))
using (new Utilities.ProfilingSample("Velocity Pass", renderContext))
{
// If opaque velocity have been render during GBuffer no need to render it here
if ((ShaderConfig.s_VelocityInGbuffer == 0) || debugParameters.useForwardRenderingOnly)

var cmd = new CommandBuffer { name = "" };
cmd.GetTemporaryRT(m_VelocityBuffer, w, h, 0, FilterMode.Point, Builtin.RenderLoop.GetVelocityBufferFormat(), Builtin.RenderLoop.GetVelocityBufferReadWrite());
cmd.SetRenderTarget(m_VelocityBufferRT, m_CameraDepthBufferRT);
renderLoop.ExecuteCommandBuffer(cmd);
renderContext.ExecuteCommandBuffer(cmd);
RenderOpaqueRenderList(cullResults, camera, renderLoop, "MotionVectors");
RenderOpaqueRenderList(cullResults, camera, renderContext, "MotionVectors");
void RenderDistortion(CullResults cullResults, Camera camera, ScriptableRenderContext renderLoop)
void RenderDistortion(CullResults cullResults, Camera camera, ScriptableRenderContext renderContext)
using (new Utilities.ProfilingSample("Distortion Pass", renderLoop))
using (new Utilities.ProfilingSample("Distortion Pass", renderContext))
{
int w = camera.pixelWidth;
int h = camera.pixelHeight;

cmd.SetRenderTarget(m_DistortionBufferRT, m_CameraDepthBufferRT);
cmd.ClearRenderTarget(false, true, Color.black); // TODO: can we avoid this clear for performance ?
renderLoop.ExecuteCommandBuffer(cmd);
renderContext.ExecuteCommandBuffer(cmd);
RenderTransparentRenderList(cullResults, camera, renderLoop, "DistortionVectors");
RenderTransparentRenderList(cullResults, camera, renderContext, "DistortionVectors");
void FinalPass(ScriptableRenderContext renderLoop)
void FinalPass(ScriptableRenderContext renderContext)
using (new Utilities.ProfilingSample("Final Pass", renderLoop))
using (new Utilities.ProfilingSample("Final Pass", renderContext))
{
// Those could be tweakable for the neutral tonemapper, but in the case of the LookDev we don't need that
const float blackIn = 0.02f;

// Resolve our HDR texture to CameraTarget.
cmd.Blit(m_CameraColorBufferRT, BuiltinRenderTextureType.CameraTarget, m_FinalPassMaterial, 0);
renderLoop.ExecuteCommandBuffer(cmd);
renderContext.ExecuteCommandBuffer(cmd);
cmd.Dispose();
}
}

}
}
public void PushGlobalParams(HDCamera hdCamera, ScriptableRenderContext renderLoop)
public void PushGlobalParams(HDCamera hdCamera, ScriptableRenderContext renderContext)
{
if (m_SkyManager.IsSkyValid())
{

cmd.SetGlobalMatrix("_ViewProjMatrix", hdCamera.viewProjectionMatrix);
cmd.SetGlobalMatrix("_InvViewProjMatrix", hdCamera.invViewProjectionMatrix);
renderLoop.ExecuteCommandBuffer(cmd);
renderContext.ExecuteCommandBuffer(cmd);
m_lightLoop.PushGlobalParams(hdCamera.camera, renderLoop);
m_lightLoop.PushGlobalParams(hdCamera.camera, renderContext);
}
void UpdateCommonSettings()

m_ShadowSettings.maxShadowDistance = m_CommonSettings.shadowMaxDistance;
}
}
[NonSerialized]
readonly List<Camera> m_CamerasToRender = new List<Camera>();
public override void Render(ScriptableRenderContext renderLoop, IScriptableRenderDataStore dataStore)
public void Render(ScriptableRenderContext renderContext, IEnumerable<Camera> cameras)
base.Render(renderLoop, dataStore);
cameraProvider.GetCamerasToRender(m_CamerasToRender);
m_LitRenderLoop.RenderInit(renderLoop);
m_LitRenderLoop.RenderInit(renderContext);
}
// Do anything we need to do upon a new frame.

// Set Frame constant buffer
// TODO...
foreach (var camera in m_CamerasToRender)
foreach (var camera in cameras)
{
// Set camera constant buffer
// TODO...

m_ShadowPass.UpdateCullingParameters(ref cullingParams);
var cullResults = CullResults.Cull(ref cullingParams, renderLoop);
var cullResults = CullResults.Cull(ref cullingParams, renderContext);
renderLoop.SetupCameraProperties(camera);
renderContext.SetupCameraProperties(camera);
InitAndClearBuffer(camera, renderLoop);
InitAndClearBuffer(camera, renderContext);
RenderDepthPrepass(cullResults, camera, renderLoop);
RenderDepthPrepass(cullResults, camera, renderContext);
RenderForwardOnlyDepthPrepass(cullResults, camera, renderLoop);
RenderGBuffer(cullResults, camera, renderLoop);
RenderForwardOnlyDepthPrepass(cullResults, camera, renderContext);
RenderGBuffer(cullResults, camera, renderContext);
RenderDebugViewMaterial(cullResults, hdCamera, renderLoop);
RenderDebugViewMaterial(cullResults, hdCamera, renderContext);
using (new Utilities.ProfilingSample("Shadow Pass", renderLoop))
using (new Utilities.ProfilingSample("Shadow Pass", renderContext))
m_ShadowPass.Render(renderLoop, cullResults, out shadows);
m_ShadowPass.Render(renderContext, cullResults, out shadows);
renderLoop.SetupCameraProperties(camera); // Need to recall SetupCameraProperties after m_ShadowPass.Render
renderContext.SetupCameraProperties(camera); // Need to recall SetupCameraProperties after m_ShadowPass.Render
using (new Utilities.ProfilingSample("Build Light list", renderLoop))
using (new Utilities.ProfilingSample("Build Light list", renderContext))
m_lightLoop.BuildGPULightLists(camera, renderLoop, m_CameraDepthBufferRT);
m_lightLoop.BuildGPULightLists(camera, renderContext, m_CameraDepthBufferRT);
PushGlobalParams(hdCamera, renderLoop);
PushGlobalParams(hdCamera, renderContext);
UpdateSkyEnvironment(hdCamera, renderLoop);
UpdateSkyEnvironment(hdCamera, renderContext);
RenderDeferredLighting(hdCamera, renderLoop);
RenderDeferredLighting(hdCamera, renderContext);
RenderForward(cullResults, camera, renderLoop, true);
RenderForwardOnly(cullResults, camera, renderLoop);
RenderForward(cullResults, camera, renderContext, true);
RenderForwardOnly(cullResults, camera, renderContext);
RenderSky(hdCamera, renderLoop);
RenderSky(hdCamera, renderContext);
RenderForward(cullResults, camera, renderLoop, false);
RenderForward(cullResults, camera, renderContext, false);
RenderForwardUnlit(cullResults, camera, renderLoop);
RenderForwardUnlit(cullResults, camera, renderContext);
RenderVelocity(cullResults, camera, renderLoop); // Note we may have to render velocity earlier if we do temporalAO, temporal volumetric etc... Mean we will not take into account forward opaque in case of deferred rendering ?
RenderVelocity(cullResults, camera, renderContext); // Note we may have to render velocity earlier if we do temporalAO, temporal volumetric etc... Mean we will not take into account forward opaque in case of deferred rendering ?
RenderDistortion(cullResults, camera, renderLoop);
RenderDistortion(cullResults, camera, renderContext);
FinalPass(renderLoop);
FinalPass(renderContext);
}
// bind depth surface for editor grid/gizmo/selection rendering

cmd.SetRenderTarget(BuiltinRenderTextureType.CameraTarget, m_CameraDepthBufferRT);
renderLoop.ExecuteCommandBuffer(cmd);
renderContext.ExecuteCommandBuffer(cmd);
renderLoop.Submit();
renderContext.Submit();
CleanCameras(m_CamerasToRender);
m_CamerasToRender.Clear();
// Post effects
}
}

15
Assets/ScriptableRenderLoop/HDRenderPipeline/Lighting/TilePass/TilePass.hlsl


TEXTURECUBE_ARRAY(_CookieCubeTextures);
SAMPLERCUBE(sampler_CookieCubeTextures);
// Use texture array for reflection
// Use texture array for reflection (or LatLong 2D array for mobile)
#ifdef CUBE_ARRAY_NOT_SUPPORTED
TEXTURE2D_ARRAY(_EnvTextures);
SAMPLER2D(sampler_EnvTextures);
#else
#endif
TEXTURECUBE(_SkyTexture);
SAMPLERCUBE(sampler_SkyTexture); // NOTE: Sampler could be share here with _EnvTextures. Don't know if the shader compiler will complain...

// Shadow sampling function
// ----------------------------------------------------------------------------
float GetPunctualShadowAttenuation(LightLoopContext lightLoopContext, float3 positionWS, int index, float3 L, float2 unPositionSS)
float GetPunctualShadowAttenuation(LightLoopContext lightLoopContext, uint lightType, float3 positionWS, int index, float3 L, float2 unPositionSS)
if (_ShadowDatas[index].lightType == GPULIGHTTYPE_POINT)
if (lightType == GPULIGHTTYPE_POINT)
{
GetCubeFaceID(L, faceIndex);
}

// This code will be inlined as lightLoopContext is hardcoded in the light loop
if (lightLoopContext.sampleReflection == SINGLE_PASS_CONTEXT_SAMPLE_REFLECTION_PROBES)
{
#ifdef CUBE_ARRAY_NOT_SUPPORTED
return SAMPLE_TEXTURE2D_ARRAY_LOD(_EnvTextures, sampler_EnvTextures, DirectionToLatLongCoordinate(texCoord), index, lod);
#else
#endif
}
else // SINGLE_PASS_SAMPLE_SKY
{

2
Assets/ScriptableRenderLoop/HDRenderPipeline/Lighting/TilePass/TilePass.cs.hlsl


//
// This file was automatically generated from Assets/ScriptableRenderLoop/HDRenderLoop/Lighting/TilePass/TilePass.cs. Please don't edit by hand.
// This file was automatically generated from Assets/ScriptableRenderLoop/HDRenderPipeline/Lighting/TilePass/TilePass.cs. Please don't edit by hand.
//
#ifndef TILEPASS_CS_HLSL

26
Assets/ScriptableRenderLoop/HDRenderPipeline/Lighting/TilePass/TilePass.cs


using UnityEngine;
using UnityEngine.Experimental.Rendering;
using UnityEngine.Experimental.Rendering.HDPipeline;
namespace UnityEngine.Experimental.ScriptableRenderLoop
namespace UnityEngine.Experimental.Rendering.HDPipeline
{
namespace TilePass
{

s_LightList = null;
m_DeferredDirectMaterial = Utilities.CreateEngineMaterial("Hidden/HDRenderLoop/Deferred");
m_DeferredDirectMaterial = Utilities.CreateEngineMaterial("Hidden/HDRenderPipeline/Deferred");
m_DeferredIndirectMaterial = Utilities.CreateEngineMaterial("Hidden/HDRenderLoop/Deferred");
m_DeferredIndirectMaterial = Utilities.CreateEngineMaterial("Hidden/HDRenderPipeline/Deferred");
m_DeferredAllMaterial = Utilities.CreateEngineMaterial("Hidden/HDRenderLoop/Deferred");
m_DeferredAllMaterial = Utilities.CreateEngineMaterial("Hidden/HDRenderPipeline/Deferred");
m_DebugViewTilesMaterial = Utilities.CreateEngineMaterial("Hidden/HDRenderLoop/DebugViewTiles");
m_DebugViewTilesMaterial = Utilities.CreateEngineMaterial("Hidden/HDRenderPipeline/DebugViewTiles");
m_SingleDeferredMaterial = Utilities.CreateEngineMaterial("Hidden/HDRenderLoop/Deferred");
m_SingleDeferredMaterial = Utilities.CreateEngineMaterial("Hidden/HDRenderPipeline/Deferred");
m_SingleDeferredMaterial.EnableKeyword("LIGHTLOOP_SINGLE_PASS");
m_DefaultTexture2DArray = new Texture2DArray(1, 1, 1, TextureFormat.ARGB32, false);

}
#endif
public override void RenderDeferredLighting(HDRenderLoop.HDCamera hdCamera, ScriptableRenderContext renderLoop, RenderTargetIdentifier cameraColorBufferRT)
public override void RenderDeferredLighting(HDRenderPipeline.HDCamera hdCamera, ScriptableRenderContext renderContext, RenderTargetIdentifier cameraColorBufferRT)
{
var bUseClusteredForDeferred = !usingFptl;

}
#endif
using (new Utilities.ProfilingSample(disableTileAndCluster ? "SinglePass - Deferred Lighting Pass" : "TilePass - Deferred Lighting Pass", renderLoop))
using (new Utilities.ProfilingSample(disableTileAndCluster ? "SinglePass - Deferred Lighting Pass" : "TilePass - Deferred Lighting Pass", renderContext))
{
var cmd = new CommandBuffer();

// Pass global parameters to compute shader
// TODO: get rid of this by making global parameters visible to compute shaders
BindGlobalParams(cmd, shadeOpaqueShader, kernel, camera, renderLoop);
BindGlobalParams(cmd, shadeOpaqueShader, kernel, camera, renderContext);
cmd.SetComputeTextureParam(shadeOpaqueShader, kernel, "_CameraDepthTexture", Shader.PropertyToID("_CameraDepthTexture"));
cmd.SetComputeTextureParam(shadeOpaqueShader, kernel, "_GBufferTexture0", Shader.PropertyToID("_GBufferTexture0"));

SetGlobalPropertyRedirect(null, 0, null);
//}
renderLoop.ExecuteCommandBuffer(cmd);
renderContext.ExecuteCommandBuffer(cmd);
public override void RenderForward(Camera camera, ScriptableRenderContext renderLoop, bool renderOpaque)
public override void RenderForward(Camera camera, ScriptableRenderContext renderContext, bool renderOpaque)
{
// Note: if we use render opaque with deferred tiling we need to render a opque depth pass for these opaque objects
bool useFptl = renderOpaque && usingFptl;

cmd.SetGlobalBuffer("g_vLightListGlobal", useFptl ? s_LightList : s_PerVoxelLightLists);
}
renderLoop.ExecuteCommandBuffer(cmd);
renderContext.ExecuteCommandBuffer(cmd);
cmd.Dispose();
}
}

120
Assets/ScriptableRenderLoop/HDRenderPipeline/Lighting/TilePass/Resources/shadeopaque.compute


#pragma kernel ShadeOpaque_Fptl SHADE_OPAQUE_ENTRY=ShadeOpaque_Fptl USE_FPTL_LIGHTLIST=1
#pragma kernel ShadeOpaque_Clustered SHADE_OPAQUE_ENTRY=ShadeOpaque_Clustered USE_CLUSTERED_LIGHTLIST=1
#define LIGHTLOOP_TILE_PASS 1
#define LIGHTLOOP_TILE_DIRECT 1
#define LIGHTLOOP_TILE_INDIRECT 1
#define LIGHTLOOP_TILE_ALL 1
#define USE_FPTL_LIGHTLIST 1
//-------------------------------------------------------------------------------------
// Include
//-------------------------------------------------------------------------------------
#include "Common.hlsl"
// Note: We have fix as guidelines that we have only one deferred material (with control of GBuffer enabled). Mean a users that add a new
// deferred material must replace the old one here. If in the future we want to support multiple layout (cause a lot of consistency problem),
// the deferred shader will require to use multicompile.
#define UNITY_MATERIAL_LIT // Need to be define before including Material.hlsl
#include "Assets/ScriptableRenderLoop/HDRenderLoop/ShaderConfig.cs.hlsl"
#include "Assets/ScriptableRenderLoop/HDRenderLoop/ShaderVariables.hlsl"
#include "Assets/ScriptableRenderLoop/HDRenderLoop/Lighting/Lighting.hlsl" // This include Material.hlsl
//-------------------------------------------------------------------------------------
// variable declaration
//-------------------------------------------------------------------------------------
DECLARE_GBUFFER_TEXTURE(_GBufferTexture);
TEXTURE2D(_CameraDepthTexture);
SAMPLER2D(sampler_CameraDepthTexture);
RWTexture2D<float4> uavOutput;
[numthreads(TILE_SIZE, TILE_SIZE, 1)]
void SHADE_OPAQUE_ENTRY(uint2 dispatchThreadId : SV_DispatchThreadID, uint2 groupId : SV_GroupID)
{
// input.positionCS is SV_Position
uint2 pixelCoord = dispatchThreadId;
PositionInputs posInput = GetPositionInput(pixelCoord.xy, _ScreenSize.zw);
float depth = LOAD_TEXTURE2D(_CameraDepthTexture, posInput.unPositionSS).x;
UpdatePositionInput(depth, _InvViewProjMatrix, _ViewProjMatrix, posInput);
float3 V = GetWorldSpaceNormalizeViewDir(posInput.positionWS);
FETCH_GBUFFER(gbuffer, _GBufferTexture, posInput.unPositionSS);
BSDFData bsdfData;
float3 bakeDiffuseLighting;
DECODE_FROM_GBUFFER(gbuffer, bsdfData, bakeDiffuseLighting);
PreLightData preLightData = GetPreLightData(V, posInput, bsdfData);
float3 diffuseLighting;
float3 specularLighting;
LightLoop(V, posInput, preLightData, bsdfData, bakeDiffuseLighting, diffuseLighting, specularLighting);
uavOutput[pixelCoord] = float4(diffuseLighting + specularLighting, 1.0);
}
#pragma kernel ShadeOpaque_Fptl SHADE_OPAQUE_ENTRY=ShadeOpaque_Fptl USE_FPTL_LIGHTLIST=1
#pragma kernel ShadeOpaque_Clustered SHADE_OPAQUE_ENTRY=ShadeOpaque_Clustered USE_CLUSTERED_LIGHTLIST=1
#define LIGHTLOOP_TILE_PASS 1
#define LIGHTLOOP_TILE_DIRECT 1
#define LIGHTLOOP_TILE_INDIRECT 1
#define LIGHTLOOP_TILE_ALL 1
#define USE_FPTL_LIGHTLIST 1
//-------------------------------------------------------------------------------------
// Include
//-------------------------------------------------------------------------------------
#include "Common.hlsl"
// Note: We have fix as guidelines that we have only one deferred material (with control of GBuffer enabled). Mean a users that add a new
// deferred material must replace the old one here. If in the future we want to support multiple layout (cause a lot of consistency problem),
// the deferred shader will require to use multicompile.
#define UNITY_MATERIAL_LIT // Need to be define before including Material.hlsl
#include "Assets/ScriptableRenderLoop/HDRenderPipeline/ShaderConfig.cs.hlsl"
#include "Assets/ScriptableRenderLoop/HDRenderPipeline/ShaderVariables.hlsl"
#include "Assets/ScriptableRenderLoop/HDRenderPipeline/Lighting/Lighting.hlsl" // This include Material.hlsl
//-------------------------------------------------------------------------------------
// variable declaration
//-------------------------------------------------------------------------------------
DECLARE_GBUFFER_TEXTURE(_GBufferTexture);
TEXTURE2D(_CameraDepthTexture);
SAMPLER2D(sampler_CameraDepthTexture);
RWTexture2D<float4> uavOutput;
[numthreads(TILE_SIZE, TILE_SIZE, 1)]
void SHADE_OPAQUE_ENTRY(uint2 dispatchThreadId : SV_DispatchThreadID, uint2 groupId : SV_GroupID)
{
// input.positionCS is SV_Position
uint2 pixelCoord = dispatchThreadId;
PositionInputs posInput = GetPositionInput(pixelCoord.xy, _ScreenSize.zw);
float depth = LOAD_TEXTURE2D(_CameraDepthTexture, posInput.unPositionSS).x;
UpdatePositionInput(depth, _InvViewProjMatrix, _ViewProjMatrix, posInput);
float3 V = GetWorldSpaceNormalizeViewDir(posInput.positionWS);
FETCH_GBUFFER(gbuffer, _GBufferTexture, posInput.unPositionSS);
BSDFData bsdfData;
float3 bakeDiffuseLighting;
DECODE_FROM_GBUFFER(gbuffer, bsdfData, bakeDiffuseLighting);
PreLightData preLightData = GetPreLightData(V, posInput, bsdfData);
float3 diffuseLighting;
float3 specularLighting;
LightLoop(V, posInput, preLightData, bsdfData, bakeDiffuseLighting, diffuseLighting, specularLighting);
uavOutput[pixelCoord] = float4(diffuseLighting + specularLighting, 1.0);
}

2
Assets/ScriptableRenderLoop/HDRenderPipeline/Lighting/TilePass.meta


fileFormatVersion: 2
guid: ef8815a81d7dd9147b37093f06d9977c
guid: 8a355c056864a5d4cb26d9c3168ae0bb
folderAsset: yes
timeCreated: 1479218330
licenseType: Pro

8
Assets/ScriptableRenderLoop/HDRenderPipeline/Lighting/Resources/Deferred.shader


Shader "Hidden/HDRenderLoop/Deferred"
Shader "Hidden/HDRenderPipeline/Deferred"
{
Properties
{

// deferred material must replace the old one here. If in the future we want to support multiple layout (cause a lot of consistency problem),
// the deferred shader will require to use multicompile.
#define UNITY_MATERIAL_LIT // Need to be define before including Material.hlsl
#include "Assets/ScriptableRenderLoop/HDRenderLoop/ShaderConfig.cs.hlsl"
#include "Assets/ScriptableRenderLoop/HDRenderLoop/ShaderVariables.hlsl"
#include "Assets/ScriptableRenderLoop/HDRenderLoop/Lighting/Lighting.hlsl" // This include Material.hlsl
#include "Assets/ScriptableRenderLoop/HDRenderPipeline/ShaderConfig.cs.hlsl"
#include "Assets/ScriptableRenderLoop/HDRenderPipeline/ShaderVariables.hlsl"
#include "Assets/ScriptableRenderLoop/HDRenderPipeline/Lighting/Lighting.hlsl" // This include Material.hlsl
//-------------------------------------------------------------------------------------
// variable declaration

12
Assets/ScriptableRenderLoop/HDRenderPipeline/Lighting/Lighting.hlsl


#define HAS_LIGHTLOOP // Allow to not define LightLoop related function in Material.hlsl
#include "Assets/ScriptableRenderLoop/HDRenderLoop/Lighting/LightDefinition.cs.hlsl"
#include "Assets/ScriptableRenderLoop/HDRenderLoop/Lighting/LightUtilities.hlsl"
#include "Assets/ScriptableRenderLoop/HDRenderPipeline/Lighting/LightDefinition.cs.hlsl"
#include "Assets/ScriptableRenderLoop/HDRenderPipeline/Lighting/LightUtilities.hlsl"
#include "Assets/ScriptableRenderLoop/HDRenderLoop/Lighting/TilePass/TilePass.hlsl"
#include "Assets/ScriptableRenderLoop/HDRenderPipeline/Lighting/TilePass/TilePass.hlsl"
#include "Assets/ScriptableRenderLoop/HDRenderLoop/Shadow/Shadow.hlsl"
#include "Assets/ScriptableRenderLoop/HDRenderLoop/Material/Material.hlsl"
#include "Assets/ScriptableRenderLoop/HDRenderPipeline/Shadow/Shadow.hlsl"
#include "Assets/ScriptableRenderLoop/HDRenderPipeline/Material/Material.hlsl"
#include "Assets/ScriptableRenderLoop/HDRenderLoop/Lighting/TilePass/TilePassLoop.hlsl"
#include "Assets/ScriptableRenderLoop/HDRenderPipeline/Lighting/TilePass/TilePassLoop.hlsl"
#endif

8
Assets/ScriptableRenderLoop/HDRenderPipeline/Lighting/LightLoop.cs


using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Experimental.Rendering;
using UnityEngine.Experimental.Rendering.HDPipeline;
namespace UnityEngine.Experimental.ScriptableRenderLoop
namespace UnityEngine.Experimental.Rendering.HDPipeline
{
public class BaseLightLoop
{

public virtual void PushGlobalParams(Camera camera, ScriptableRenderContext loop) {}
public virtual void RenderDeferredLighting(HDRenderLoop.HDCamera hdCamera, ScriptableRenderContext renderLoop, RenderTargetIdentifier cameraColorBufferRT) {}
public virtual void RenderDeferredLighting(HDRenderPipeline.HDCamera hdCamera, ScriptableRenderContext renderContext, RenderTargetIdentifier cameraColorBufferRT) {}
public virtual void RenderForward(Camera camera, ScriptableRenderContext renderLoop, bool renderOpaque) {}
public virtual void RenderForward(Camera camera, ScriptableRenderContext renderContext, bool renderOpaque) {}
public Light GetCurrentSunLight() { return m_CurrentSunLight; }
}

12
Assets/ScriptableRenderLoop/HDRenderPipeline/Lighting/LightDefinition.cs.hlsl


//
// This file was automatically generated from Assets/ScriptableRenderLoop/HDRenderLoop/Lighting/LightDefinition.cs. Please don't edit by hand.
// This file was automatically generated from Assets/ScriptableRenderLoop/HDRenderPipeline/Lighting/LightDefinition.cs. Please don't edit by hand.
//
#ifndef LIGHTDEFINITION_CS_HLSL

struct ShadowData
{
float4x4 worldToShadow;
int lightType;
float unused2;
float4 invResolution;
};

{
return value.worldToShadow;
}
int GetLightType(ShadowData value)
{
return value.lightType;
}
float GetBias(ShadowData value)
{
return value.bias;

float GetUnused(ShadowData value)
{
return value.unused;
}
float GetUnused2(ShadowData value)
{
return value.unused2;
}
float4 GetInvResolution(ShadowData value)
{

6
Assets/ScriptableRenderLoop/HDRenderPipeline/Lighting/LightDefinition.cs


using UnityEngine;
namespace UnityEngine.Experimental.ScriptableRenderLoop
namespace UnityEngine.Experimental.Rendering.HDPipeline
{
//-----------------------------------------------------------------------------
// structure definition

// Include scale and bias for shadow atlas if any
public Matrix4x4 worldToShadow;
public GPULightType lightType;
public float unused2;
public Vector4 invResolution;
};

public Vector3 offsetLS;
public float unused2;
};
} // namespace UnityEngine.Experimental.ScriptableRenderLoop
}

4
Assets/ScriptableRenderLoop/HDRenderPipeline/ShaderPass/ShaderPass.cs


using UnityEngine;
using UnityEngine.Experimental.Rendering;
using UnityEngine.Experimental.Rendering.HDPipeline;
namespace UnityEngine.Experimental.ScriptableRenderLoop
namespace UnityEngine.Experimental.Rendering.HDPipeline
{
[GenerateHLSL(PackingRules.Exact)]
public enum ShaderPass

2
Assets/ScriptableRenderLoop/HDRenderPipeline/ShaderPass/ShaderPass.cs.hlsl


//
// This file was automatically generated from Assets/ScriptableRenderLoop/HDRenderLoop/ShaderPass/ShaderPass.cs. Please don't edit by hand.
// This file was automatically generated from Assets/ScriptableRenderLoop/HDRenderPipeline/ShaderPass/ShaderPass.cs. Please don't edit by hand.
//
#ifndef SHADERPASS_CS_HLSL

2
Assets/ScriptableRenderLoop/HDRenderPipeline/ShaderPass/ShaderPassLightTransport.hlsl


#include "Color.hlsl"
// TODO: This is the max value allowed for emissive (bad name - but keep for now to retrieve it) (It is 8^2.2 (gamma) and 8 is the limit of punctual light slider...), comme from UnityCg.cginc. Fix it!
// Ask Jesper if this can be change for HDRenderLoop
// Ask Jesper if this can be change for HDRenderPipeline
#define EMISSIVE_RGBM_SCALE 97.0
float4 Frag(PackedVaryings packedInput) : SV_Target

4
Assets/ScriptableRenderLoop/HDRenderPipeline/Sky/SkyRenderer.cs


using UnityEngine.Rendering;
using UnityEngine.Experimental.Rendering;
using UnityEngine.Experimental.Rendering.HDPipeline;
namespace UnityEngine.Experimental.ScriptableRenderLoop
namespace UnityEngine.Experimental.Rendering.HDPipeline
{
abstract public class SkyRenderer
{

20
Assets/ScriptableRenderLoop/HDRenderPipeline/Sky/SkyParameters.cs


using System.Reflection;
using System.Linq;
namespace UnityEngine.Experimental.ScriptableRenderLoop
namespace UnityEngine.Experimental.Rendering.HDPipeline
{
[ExecuteInEditMode]
public class SkyParameters : MonoBehaviour

protected void OnEnable()
{
HDRenderLoop renderLoop = Utilities.GetHDRenderLoop();
if (renderLoop == null)
HDRenderPipeline renderPipeline = Utilities.GetHDRenderPipeline();
if (renderPipeline == null)
{
return;
}

.GetFields(BindingFlags.Public | BindingFlags.Instance)
.ToArray();
if (renderLoop.skyManager.skyParameters == null || renderLoop.skyManager.skyParameters.GetType() != this.GetType()) // We allow override of parameters only if the type is different. It means that we changed the Sky Renderer and might need a new set of parameters.
renderLoop.skyManager.skyParameters = this;
else if (renderLoop.skyManager.skyParameters != this && renderLoop.skyManager.skyParameters.GetType() == this.GetType())
if (renderPipeline.skyManager.skyParameters == null || renderPipeline.skyManager.skyParameters.GetType() != this.GetType()) // We allow override of parameters only if the type is different. It means that we changed the Sky Renderer and might need a new set of parameters.
renderPipeline.skyManager.skyParameters = this;
else if (renderPipeline.skyManager.skyParameters != this && renderPipeline.skyManager.skyParameters.GetType() == this.GetType())
HDRenderLoop renderLoop = Utilities.GetHDRenderLoop();
if (renderLoop == null)
HDRenderPipeline renderPipeline = Utilities.GetHDRenderPipeline();
if (renderPipeline == null)
if (renderLoop.skyManager.skyParameters == this)
renderLoop.skyManager.skyParameters = null;
if (renderPipeline.skyManager.skyParameters == this)
renderPipeline.skyManager.skyParameters = null;
}
public int GetHash()

2
Assets/ScriptableRenderLoop/HDRenderPipeline/Sky/SkyManager.cs.hlsl


//
// This file was automatically generated from Assets/ScriptableRenderLoop/HDRenderLoop/Sky/SkyManager.cs. Please don't edit by hand.
// This file was automatically generated from Assets/ScriptableRenderLoop/HDRenderPipeline/Sky/SkyManager.cs. Please don't edit by hand.
//
#ifndef SKYMANAGER_CS_HLSL

46
Assets/ScriptableRenderLoop/HDRenderPipeline/Sky/SkyManager.cs


using UnityEngine.Rendering;
using UnityEngine.Experimental.Rendering;
using UnityEngine.Experimental.Rendering.HDPipeline;
namespace UnityEngine.Experimental.ScriptableRenderLoop
namespace UnityEngine.Experimental.Rendering.HDPipeline
{
[Serializable]
public enum SkyResolution

public Vector3 cameraPosWS;
public Vector4 screenSize;
public Mesh skyMesh;
public ScriptableRenderContext renderLoop;
public ScriptableRenderContext renderContext;
public Light sunLight;
public RenderTargetIdentifier colorBuffer;
public RenderTargetIdentifier depthBuffer;

bool m_UpdateRequired = true;
float m_CurrentUpdateTime = 0.0f;
const bool m_useMIS = false;
bool m_useMIS = false;
SkyParameters m_SkyParameters = null;

// TODO: We need to have an API to send our sky information to Enlighten. For now use a workaround through skybox/cubemap material...
m_StandardSkyboxMaterial = Utilities.CreateEngineMaterial("Skybox/Cubemap");
m_GGXConvolveMaterial = Utilities.CreateEngineMaterial("Hidden/HDRenderLoop/GGXConvolve");
m_GGXConvolveMaterial = Utilities.CreateEngineMaterial("Hidden/HDRenderPipeline/GGXConvolve");
m_BuildProbabilityTablesCS = Resources.Load<ComputeShader>("BuildProbabilityTables");
m_ConditionalDensitiesKernel = m_BuildProbabilityTablesCS.FindKernel("ComputeConditionalDensities");

{
for (int i = 0; i < 6; ++i)
{
Utilities.SetRenderTarget(builtinParams.renderLoop, target, ClearFlag.ClearNone, 0, (CubemapFace)i);
Utilities.SetRenderTarget(builtinParams.renderContext, target, ClearFlag.ClearNone, 0, (CubemapFace)i);
builtinParams.invViewProjMatrix = m_faceCameraInvViewProjectionMatrix[i];
builtinParams.viewProjMatrix = m_faceCameraViewProjectionMatrix[i];

}
}
private void BuildProbabilityTables(ScriptableRenderContext renderLoop)
private void BuildProbabilityTables(ScriptableRenderContext renderContext)
{
// Bind the input cubemap.
m_BuildProbabilityTablesCS.SetTexture(m_ConditionalDensitiesKernel, "envMap", m_SkyboxCubemapRT);

var cmd = new CommandBuffer() { name = "" };
cmd.DispatchCompute(m_BuildProbabilityTablesCS, m_ConditionalDensitiesKernel, (int)LightSamplingParameters.TextureHeight, 1, 1);
cmd.DispatchCompute(m_BuildProbabilityTablesCS, m_MarginalRowDensitiesKernel, 1, 1, 1);
renderLoop.ExecuteCommandBuffer(cmd);
renderContext.ExecuteCommandBuffer(cmd);
private void RenderCubemapGGXConvolution(ScriptableRenderContext renderLoop, BuiltinSkyParameters builtinParams, SkyParameters skyParams, Texture input, RenderTexture target)
private void RenderCubemapGGXConvolution(ScriptableRenderContext renderContext, BuiltinSkyParameters builtinParams, SkyParameters skyParams, Texture input, RenderTexture target)
using (new Utilities.ProfilingSample("Sky Pass: GGX Convolution", renderLoop))
using (new Utilities.ProfilingSample("Sky Pass: GGX Convolution", renderContext))
{
int mipCount = 1 + (int)Mathf.Log(input.width, 2.0f);
if (mipCount < ((int)EnvConstants.SpecCubeLodStep + 1))

if (m_useMIS)
{
BuildProbabilityTables(renderLoop);
BuildProbabilityTables(renderContext);
}
// Copy the first mip.

for (int face = 0; face < 6; ++face)
{
Utilities.SetRenderTarget(renderLoop, target, ClearFlag.ClearNone, mip, (CubemapFace)face);
Utilities.SetRenderTarget(renderContext, target, ClearFlag.ClearNone, mip, (CubemapFace)face);
renderLoop.ExecuteCommandBuffer(cmd);
renderContext.ExecuteCommandBuffer(cmd);
cmd.Dispose();
}
}

m_UpdateRequired = true;
}
public void UpdateEnvironment(HDRenderLoop.HDCamera camera, Light sunLight, ScriptableRenderContext renderLoop)
public void UpdateEnvironment(HDRenderPipeline.HDCamera camera, Light sunLight, ScriptableRenderContext renderContext)
using (new Utilities.ProfilingSample("Sky Environment Pass", renderLoop))
using (new Utilities.ProfilingSample("Sky Environment Pass", renderContext))
m_BuiltinParameters.renderLoop = renderLoop;
m_BuiltinParameters.renderContext = renderContext;
m_BuiltinParameters.sunLight = sunLight;
// We need one frame delay for this update to work since DynamicGI.UpdateEnvironment is executed direclty but the renderloop is not (so we need to wait for the sky texture to be rendered first)

// Render sky into a cubemap - doesn't happen every frame, can be controlled
RenderSkyToCubemap(m_BuiltinParameters, skyParameters, m_SkyboxCubemapRT);
// Convolve downsampled cubemap
RenderCubemapGGXConvolution(renderLoop, m_BuiltinParameters, skyParameters, m_SkyboxCubemapRT, m_SkyboxGGXCubemapRT);
RenderCubemapGGXConvolution(renderContext, m_BuiltinParameters, skyParameters, m_SkyboxCubemapRT, m_SkyboxGGXCubemapRT);
m_NeedLowLevelUpdateEnvironment = true;
m_UpdateRequired = false;

// DynamicGI.UpdateEnvironment();
// // Clear temp cubemap and redo GGX from black
// Utilities.SetRenderTarget(renderLoop, m_SkyboxCubemapRT, ClearFlag.ClearColor);
// RenderCubemapGGXConvolution(renderLoop, m_BuiltinParameters, skyParameters, m_SkyboxCubemapRT, m_SkyboxGGXCubemapRT);
// Utilities.SetRenderTarget(renderContext, m_SkyboxCubemapRT, ClearFlag.ClearColor);
// RenderCubemapGGXConvolution(renderContext, m_BuiltinParameters, skyParameters, m_SkyboxCubemapRT, m_SkyboxGGXCubemapRT);
// m_SkyParametersHash = 0;
//}

}
public void RenderSky(HDRenderLoop.HDCamera camera, Light sunLight, RenderTargetIdentifier colorBuffer, RenderTargetIdentifier depthBuffer, ScriptableRenderContext renderLoop)
public void RenderSky(HDRenderPipeline.HDCamera camera, Light sunLight, RenderTargetIdentifier colorBuffer, RenderTargetIdentifier depthBuffer, ScriptableRenderContext renderContext)
using (new Utilities.ProfilingSample("Sky Pass", renderLoop))
using (new Utilities.ProfilingSample("Sky Pass", renderContext))
m_BuiltinParameters.renderLoop = renderLoop;
m_BuiltinParameters.renderContext = renderContext;
m_BuiltinParameters.sunLight = sunLight;
m_BuiltinParameters.invViewProjMatrix = camera.invViewProjectionMatrix;
m_BuiltinParameters.viewProjMatrix = camera.viewProjectionMatrix;

m_BuiltinParameters.colorBuffer = colorBuffer;
m_BuiltinParameters.depthBuffer = depthBuffer;
Utilities.SetRenderTarget(renderLoop, colorBuffer, depthBuffer);
Utilities.SetRenderTarget(renderContext, colorBuffer, depthBuffer);
m_Renderer.RenderSky(m_BuiltinParameters, skyParameters);
}
}

2
Assets/ScriptableRenderLoop/HDRenderPipeline/Sky/Resources/GGXConvolve.shader


Shader "Hidden/HDRenderLoop/GGXConvolve"
Shader "Hidden/HDRenderPipeline/GGXConvolve"
{
SubShader
{

2
Assets/ScriptableRenderLoop/HDRenderPipeline/Sky/ProceduralSky/Resources/SkyProcedural.shader


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

8
Assets/ScriptableRenderLoop/HDRenderPipeline/Sky/ProceduralSky/ProceduralSkyRenderer.cs


using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Experimental.Rendering;
using UnityEngine.Experimental.Rendering.HDPipeline;
namespace UnityEngine.Experimental.ScriptableRenderLoop
namespace UnityEngine.Experimental.Rendering.HDPipeline
{
public class ProceduralSkyRenderer
: SkyRenderer<ProceduralSkyParameters>

override public void Build()
{
m_ProceduralSkyMaterial = Utilities.CreateEngineMaterial("Hidden/HDRenderLoop/Sky/SkyProcedural");
m_ProceduralSkyMaterial = Utilities.CreateEngineMaterial("Hidden/HDRenderPipeline/Sky/SkyProcedural");
}
override public void Cleanup()

cmd.SetGlobalTexture("_CameraDepthTexture", builtinParams.depthBuffer);
}
cmd.DrawMesh(builtinParams.skyMesh, Matrix4x4.identity, m_ProceduralSkyMaterial);
builtinParams.renderLoop.ExecuteCommandBuffer(cmd);
builtinParams.renderContext.ExecuteCommandBuffer(cmd);
cmd.Dispose();
}
}

2
Assets/ScriptableRenderLoop/HDRenderPipeline/Sky/ProceduralSky/ProceduralSkyParameters.cs


using System.Collections.Generic;
using UnityEngine;
namespace UnityEngine.Experimental.ScriptableRenderLoop
namespace UnityEngine.Experimental.Rendering.HDPipeline
{
[ExecuteInEditMode]
[DisallowMultipleComponent]

2
Assets/ScriptableRenderLoop/HDRenderPipeline/Sky/ProceduralSky/Editor/ProceduralSkyEditor.cs


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

2
Assets/ScriptableRenderLoop/HDRenderPipeline/Sky/HDRISky/Resources/SkyHDRI.shader


Shader "Hidden/HDRenderLoop/Sky/SkyHDRI"
Shader "Hidden/HDRenderPipeline/Sky/SkyHDRI"
{
SubShader
{

8
Assets/ScriptableRenderLoop/HDRenderPipeline/Sky/HDRISky/HDRISkyRenderer.cs


using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Experimental.Rendering;
using UnityEngine.Experimental.Rendering.HDPipeline;
namespace UnityEngine.Experimental.ScriptableRenderLoop
namespace UnityEngine.Experimental.Rendering.HDPipeline
{
public class HDRISkyRenderer
: SkyRenderer<HDRISkyParameters>

override public void Build()
{
m_SkyHDRIMaterial = Utilities.CreateEngineMaterial("Hidden/HDRenderLoop/Sky/SkyHDRI");
m_SkyHDRIMaterial = Utilities.CreateEngineMaterial("Hidden/HDRenderPipeline/Sky/SkyHDRI");
}
override public void Cleanup()

var cmd = new CommandBuffer { name = "" };
cmd.DrawMesh(builtinParams.skyMesh, Matrix4x4.identity, m_SkyHDRIMaterial);
builtinParams.renderLoop.ExecuteCommandBuffer(cmd);
builtinParams.renderContext.ExecuteCommandBuffer(cmd);
cmd.Dispose();
}
}

2
Assets/ScriptableRenderLoop/HDRenderPipeline/Sky/HDRISky/HDRISkyParameters.cs


using System.Collections.Generic;
using UnityEngine;
namespace UnityEngine.Experimental.ScriptableRenderLoop
namespace UnityEngine.Experimental.Rendering.HDPipeline
{
[DisallowMultipleComponent]
public class HDRISkyParameters

2
Assets/ScriptableRenderLoop/HDRenderPipeline/Sky/HDRISky/Editor/HDRISkyEditor.cs


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

2
Assets/ScriptableRenderLoop/HDRenderPipeline/Material/LayeredLit.meta


fileFormatVersion: 2
guid: d43c06a2afd9f2f4ab88a7a94c43e1a6
guid: e173dfe6cd75d954b95306237244f6de
folderAsset: yes
timeCreated: 1476653183
licenseType: Pro

2
Assets/ScriptableRenderLoop/HDRenderPipeline/Material/Lit.meta


fileFormatVersion: 2
guid: 24406b9cf8c7f2543b7d20ead11e37d5
guid: d6cadd3aaf3ad6641b86e85a0929b245
folderAsset: yes
timeCreated: 1476653183
licenseType: Pro

2
Assets/ScriptableRenderLoop/HDRenderPipeline/Material/Attributes.hlsl


// This structure gather all possible varying/interpolator for this shader.
//-------------------------------------------------------------------------------------
#include "Assets/ScriptableRenderLoop/HDRenderLoop/Debug/DebugViewMaterial.cs.hlsl"
#include "Assets/ScriptableRenderLoop/HDRenderPipeline/Debug/DebugViewMaterial.cs.hlsl"
struct FragInputs
{

2
Assets/ScriptableRenderLoop/HDRenderPipeline/Material/Builtin/BuiltinData.cs.hlsl


//
// This file was automatically generated from Assets/ScriptableRenderLoop/HDRenderLoop/Material/Builtin/BuiltinData.cs. Please don't edit by hand.
// This file was automatically generated from Assets/ScriptableRenderLoop/HDRenderPipeline/Material/Builtin/BuiltinData.cs. Please don't edit by hand.
//
#ifndef BUILTINDATA_CS_HLSL

2
Assets/ScriptableRenderLoop/HDRenderPipeline/Material/Builtin/BuiltinData.cs


//-----------------------------------------------------------------------------
// structure definition
//-----------------------------------------------------------------------------
namespace UnityEngine.Experimental.ScriptableRenderLoop
namespace UnityEngine.Experimental.Rendering.HDPipeline
{
namespace Builtin
{

10
Assets/ScriptableRenderLoop/HDRenderPipeline/Material/Unlit/Unlit.shader


Shader "HDRenderLoop/Unlit"
Shader "HDRenderPipeline/Unlit"
{
Properties
{

//-------------------------------------------------------------------------------------
#include "common.hlsl"
#include "Assets/ScriptableRenderLoop/HDRenderLoop/ShaderConfig.cs.hlsl"
#include "Assets/ScriptableRenderLoop/HDRenderLoop/ShaderVariables.hlsl"
#include "Assets/ScriptableRenderLoop/HDRenderLoop/Material/Attributes.hlsl"
#include "Assets/ScriptableRenderLoop/HDRenderLoop/ShaderPass/ShaderPass.cs.hlsl"
#include "Assets/ScriptableRenderLoop/HDRenderPipeline/ShaderConfig.cs.hlsl"
#include "Assets/ScriptableRenderLoop/HDRenderPipeline/ShaderVariables.hlsl"
#include "Assets/ScriptableRenderLoop/HDRenderPipeline/Material/Attributes.hlsl"
#include "Assets/ScriptableRenderLoop/HDRenderPipeline/ShaderPass/ShaderPass.cs.hlsl"
//-------------------------------------------------------------------------------------
// variable declaration

2
Assets/ScriptableRenderLoop/HDRenderPipeline/Material/Unlit/Unlit.cs.hlsl


//
// This file was automatically generated from Assets/ScriptableRenderLoop/HDRenderLoop/Material/Unlit/Unlit.cs. Please don't edit by hand.
// This file was automatically generated from Assets/ScriptableRenderLoop/HDRenderPipeline/Material/Unlit/Unlit.cs. Please don't edit by hand.
//
#ifndef UNLIT_CS_HLSL

4
Assets/ScriptableRenderLoop/HDRenderPipeline/Material/Unlit/Unlit.cs


using UnityEngine;
using UnityEngine.Experimental.Rendering;
using UnityEngine.Experimental.Rendering.HDPipeline;
namespace UnityEngine.Experimental.ScriptableRenderLoop
namespace UnityEngine.Experimental.Rendering.HDPipeline
{
namespace Unlit
{

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

正在加载...
取消
保存