浏览代码

Merge branch 'master' into pr/798

/main
Sebastien Lagarde 7 年前
当前提交
a79042e5
共有 92 个文件被更改,包括 16481 次插入2318 次删除
  1. 272
      ImageTemplates/HDRenderPipeline/Scenes/3xxx_DebugView/3002_ObjectMotionVector.unity.png
  2. 1001
      ScriptableRenderPipeline/Core/CoreRP/ShaderLibrary/Common.hlsl
  3. 406
      ScriptableRenderPipeline/Core/CoreRP/ShaderLibrary/Debug.hlsl
  4. 616
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Debug/MaterialDebug.cs
  5. 27
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Material/LayeredLit/LayeredLitUI.cs
  6. 39
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Material/Lit/LitUI.cs
  7. 7
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/LayeredLit/LayeredLit.shader
  8. 1001
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/LayeredLit/LayeredLitData.hlsl
  9. 7
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/LayeredLit/LayeredLitTessellation.shader
  10. 8
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/Lit/Lit.shader
  11. 58
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/Lit/LitData.hlsl
  12. 520
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/Lit/LitProperties.hlsl
  13. 8
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/Lit/LitTessellation.shader
  14. 3
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/Unlit/Unlit.shader
  15. 3
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/ShaderPass/ShaderPassLightTransport.hlsl
  16. 23
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/ShaderPass/VaryingMesh.hlsl
  17. 6
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/ShaderPass/VertMesh.hlsl
  18. 2
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/ShaderVariables.hlsl
  19. 2
      ScriptableRenderPipeline/LightweightPipeline/LWRP/Shaders/LightweightStandardTerrain.shader
  20. 2
      Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/CommonAssets/3DObjects/CornelBox/Cornell Box.fbx.meta
  21. 2
      Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/CommonAssets/3DObjects/Sphere/Sphere.fbx.meta
  22. 186
      Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/3xxx_DebugView/3002_ObjectMotionVector.unity
  23. 9
      Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/EditorPlayModeTests.asset
  24. 5
      Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Assets/CommonAssets/Cornell Box.fbx.meta
  25. 3
      Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/040_UpgradeScene/Models/Environment/Floor.fbx.meta
  26. 11
      Tests/Scripts/Editor.meta
  27. 14
      Tests/Scripts/Editor/GraphicTests/Framework/EditorPlayModeTests_Editor.cs
  28. 11
      Tests/Scripts/Editor/GraphicTests/Framework/TestFramework.cs
  29. 14
      Tests/Scripts/GraphicTests/Framework/SetupSceneForRenderPipelineTest.cs
  30. 34
      Tests/Scripts/GraphicTests/Framework/TestFrameworkPlayMode.cs
  31. 35
      Tests/Scripts/GraphicTests/Framework/TestFrameworkTools.cs
  32. 24
      Tests/Scripts/GraphicTests/HDRenderPipeline/DebugViewController.cs
  33. 3
      Tests/ShaderGeneratorTests.meta
  34. 2
      Tests/Scripts/GraphicTests/HDRenderPipeline/SinMove.cs.meta
  35. 5
      Tests/Scripts/GraphicTests/HDRenderPipeline/SinMove.cs
  36. 744
      ImageTemplates/HDRenderPipeline/Scenes/3xxx_DebugView/3003_CameraMotionVector_TranslateX.unity.png
  37. 83
      ImageTemplates/HDRenderPipeline/Scenes/3xxx_DebugView/3003_CameraMotionVector_TranslateX.unity.png.meta
  38. 465
      ImageTemplates/HDRenderPipeline/Scenes/3xxx_DebugView/3004_CameraMotionVector_TranslateY.unity.png
  39. 83
      ImageTemplates/HDRenderPipeline/Scenes/3xxx_DebugView/3004_CameraMotionVector_TranslateY.unity.png.meta
  40. 1001
      ImageTemplates/HDRenderPipeline/Scenes/3xxx_DebugView/3005_CameraMotionVector_TranslateZ.unity.png
  41. 83
      ImageTemplates/HDRenderPipeline/Scenes/3xxx_DebugView/3005_CameraMotionVector_TranslateZ.unity.png.meta
  42. 902
      ImageTemplates/HDRenderPipeline/Scenes/3xxx_DebugView/3006_CameraMotionVector_RotateX.unity.png
  43. 83
      ImageTemplates/HDRenderPipeline/Scenes/3xxx_DebugView/3006_CameraMotionVector_RotateX.unity.png.meta
  44. 956
      ImageTemplates/HDRenderPipeline/Scenes/3xxx_DebugView/3007_CameraMotionVector_RotateY.unity.png
  45. 83
      ImageTemplates/HDRenderPipeline/Scenes/3xxx_DebugView/3007_CameraMotionVector_RotateY.unity.png.meta
  46. 1001
      ImageTemplates/HDRenderPipeline/Scenes/3xxx_DebugView/3008_CameraMotionVector_RotateZ.unity.png
  47. 83
      ImageTemplates/HDRenderPipeline/Scenes/3xxx_DebugView/3008_CameraMotionVector_RotateZ.unity.png.meta
  48. 1001
      ImageTemplates/HDRenderPipeline/Scenes/3xxx_DebugView/3009_CameraMotionVector_FOV.unity.png
  49. 83
      ImageTemplates/HDRenderPipeline/Scenes/3xxx_DebugView/3009_CameraMotionVector_FOV.unity.png.meta
  50. 342
      ScriptableRenderPipeline/Core/CoreRP/ShaderLibrary/UnityInstancing.hlsl
  51. 9
      ScriptableRenderPipeline/Core/CoreRP/ShaderLibrary/UnityInstancing.hlsl.meta
  52. 86
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/Lit/LitBuiltinData.hlsl
  53. 9
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/Lit/LitBuiltinData.hlsl.meta
  54. 8
      Tests/Editor.meta
  55. 8
      Tests/GraphicsTests/Framework.meta
  56. 8
      Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/CommonAssets/Scripts.meta
  57. 1001
      Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/3xxx_DebugView/3003_CameraMotionVector_TranslateX.unity
  58. 7
      Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/3xxx_DebugView/3003_CameraMotionVector_TranslateX.unity.meta
  59. 1001
      Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/3xxx_DebugView/3004_CameraMotionVector_TranslateY.unity
  60. 7
      Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/3xxx_DebugView/3004_CameraMotionVector_TranslateY.unity.meta
  61. 1001
      Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/3xxx_DebugView/3005_CameraMotionVector_TranslateZ.unity
  62. 7
      Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/3xxx_DebugView/3005_CameraMotionVector_TranslateZ.unity.meta
  63. 1001
      Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/3xxx_DebugView/3006_CameraMotionVector_RotateX.unity
  64. 7
      Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/3xxx_DebugView/3006_CameraMotionVector_RotateX.unity.meta
  65. 1001
      Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/3xxx_DebugView/3007_CameraMotionVector_RotateY.unity
  66. 7
      Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/3xxx_DebugView/3007_CameraMotionVector_RotateY.unity.meta
  67. 1001
      Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/3xxx_DebugView/3008_CameraMotionVector_RotateZ.unity
  68. 7
      Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/3xxx_DebugView/3008_CameraMotionVector_RotateZ.unity.meta
  69. 1001
      Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/3xxx_DebugView/3009_CameraMotionVector_FOV.unity
  70. 7
      Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/3xxx_DebugView/3009_CameraMotionVector_FOV.unity.meta
  71. 8
      Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/040_UpgradeScene/Scripts.meta
  72. 14
      Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/EditorPlayModeTests.asset
  73. 8
      Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/EditorPlayModeTests.asset.meta
  74. 53
      Tests/Scripts/Editor/GraphicTests/HDRenderPipeline/DebugViewController_Editor.cs
  75. 11
      Tests/Scripts/Editor/GraphicTests/HDRenderPipeline/DebugViewController_Editor.cs.meta
  76. 34
      Tests/Scripts/GraphicTests/HDRenderPipeline/SinRotate.cs
  77. 11
      Tests/Scripts/GraphicTests/HDRenderPipeline/SinRotate.cs.meta
  78. 25
      Tests/Scripts/GraphicTests/HDRenderPipeline/SinScale.cs
  79. 11
      Tests/Scripts/GraphicTests/HDRenderPipeline/SinScale.cs.meta
  80. 27
      Tests/Scripts/GraphicTests/HDRenderPipeline/Sin_ChangeFOV.cs
  81. 11
      Tests/Scripts/GraphicTests/HDRenderPipeline/Sin_ChangeFOV.cs.meta
  82. 8
      Tests/GraphicsTests/Framework/Editor.meta
  83. 8
      Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/CommonAssets/Scripts/Editor.meta
  84. 8
      Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/040_UpgradeScene/Scripts/Editor.meta
  85. 8
      Tests/ShaderGeneratorTests/Editor.meta
  86. 8
      Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/0xxx.meta
  87. 0
      /Tests/Scripts/GraphicTests/HDRenderPipeline/SinMove.cs.meta
  88. 0
      /Tests/Scripts/GraphicTests/HDRenderPipeline/SinMove.cs

272
ImageTemplates/HDRenderPipeline/Scenes/3xxx_DebugView/3002_ObjectMotionVector.unity.png
文件差异内容过多而无法显示
查看文件

1001
ScriptableRenderPipeline/Core/CoreRP/ShaderLibrary/Common.hlsl
文件差异内容过多而无法显示
查看文件

406
ScriptableRenderPipeline/Core/CoreRP/ShaderLibrary/Debug.hlsl


#ifndef UNITY_DEBUG_INCLUDED
#define UNITY_DEBUG_INCLUDED
// Given an enum (represented by an int here), return a color.
// Use for DebugView of enum
real3 GetIndexColor(int index)
{
real3 outColor = real3(1.0, 0.0, 0.0);
if (index == 0)
outColor = real3(1.0, 0.5, 0.5);
else if (index == 1)
outColor = real3(0.5, 1.0, 0.5);
else if (index == 2)
outColor = real3(0.5, 0.5, 1.0);
else if (index == 3)
outColor = real3(1.0, 1.0, 0.5);
else if (index == 4)
outColor = real3(1.0, 0.5, 1.0);
else if (index == 5)
outColor = real3(0.5, 1.0, 1.0);
else if (index == 6)
outColor = real3(0.25, 0.75, 1.0);
else if (index == 7)
outColor = real3(1.0, 0.75, 0.25);
else if (index == 8)
outColor = real3(0.75, 1.0, 0.25);
else if (index == 9)
outColor = real3(0.75, 0.25, 1.0);
return outColor;
}
bool SampleDebugFont(int2 pixCoord, uint digit)
{
if (pixCoord.x < 0 || pixCoord.y < 0 || pixCoord.x >= 5 || pixCoord.y >= 9 || digit > 9)
return false;
#define PACK_BITS25(_x0,_x1,_x2,_x3,_x4,_x5,_x6,_x7,_x8,_x9,_x10,_x11,_x12,_x13,_x14,_x15,_x16,_x17,_x18,_x19,_x20,_x21,_x22,_x23,_x24) (_x0|(_x1<<1)|(_x2<<2)|(_x3<<3)|(_x4<<4)|(_x5<<5)|(_x6<<6)|(_x7<<7)|(_x8<<8)|(_x9<<9)|(_x10<<10)|(_x11<<11)|(_x12<<12)|(_x13<<13)|(_x14<<14)|(_x15<<15)|(_x16<<16)|(_x17<<17)|(_x18<<18)|(_x19<<19)|(_x20<<20)|(_x21<<21)|(_x22<<22)|(_x23<<23)|(_x24<<24))
#define _ 0
#define x 1
uint fontData[9][2] = {
{ PACK_BITS25(_,_,x,_,_, _,_,x,_,_, _,x,x,x,_, x,x,x,x,x, _,_,_,x,_), PACK_BITS25(x,x,x,x,x, _,x,x,x,_, x,x,x,x,x, _,x,x,x,_, _,x,x,x,_) },
{ PACK_BITS25(_,x,_,x,_, _,x,x,_,_, x,_,_,_,x, _,_,_,_,x, _,_,_,x,_), PACK_BITS25(x,_,_,_,_, x,_,_,_,x, _,_,_,_,x, x,_,_,_,x, x,_,_,_,x) },
{ PACK_BITS25(x,_,_,_,x, x,_,x,_,_, x,_,_,_,x, _,_,_,x,_, _,_,x,x,_), PACK_BITS25(x,_,_,_,_, x,_,_,_,_, _,_,_,x,_, x,_,_,_,x, x,_,_,_,x) },
{ PACK_BITS25(x,_,_,_,x, _,_,x,_,_, _,_,_,_,x, _,_,x,_,_, _,x,_,x,_), PACK_BITS25(x,_,x,x,_, x,_,_,_,_, _,_,_,x,_, x,_,_,_,x, x,_,_,_,x) },
{ PACK_BITS25(x,_,_,_,x, _,_,x,_,_, _,_,_,x,_, _,x,x,x,_, _,x,_,x,_), PACK_BITS25(x,x,_,_,x, x,x,x,x,_, _,_,x,_,_, _,x,x,x,_, _,x,x,x,x) },
{ PACK_BITS25(x,_,_,_,x, _,_,x,_,_, _,_,x,_,_, _,_,_,_,x, x,_,_,x,_), PACK_BITS25(_,_,_,_,x, x,_,_,_,x, _,_,x,_,_, x,_,_,_,x, _,_,_,_,x) },
{ PACK_BITS25(x,_,_,_,x, _,_,x,_,_, _,x,_,_,_, _,_,_,_,x, x,x,x,x,x), PACK_BITS25(_,_,_,_,x, x,_,_,_,x, _,x,_,_,_, x,_,_,_,x, _,_,_,_,x) },
{ PACK_BITS25(_,x,_,x,_, _,_,x,_,_, x,_,_,_,_, x,_,_,_,x, _,_,_,x,_), PACK_BITS25(x,_,_,_,x, x,_,_,_,x, _,x,_,_,_, x,_,_,_,x, x,_,_,_,x) },
{ PACK_BITS25(_,_,x,_,_, x,x,x,x,x, x,x,x,x,x, _,x,x,x,_, _,_,_,x,_), PACK_BITS25(_,x,x,x,_, _,x,x,x,_, _,x,_,_,_, _,x,x,x,_, _,x,x,x,_) }
};
#undef _
#undef x
#undef PACK_BITS25
return (fontData[8 - pixCoord.y][digit >= 5] >> ((digit % 5) * 5 + pixCoord.x)) & 1;
}
bool SampleDebugFontNumber(int2 pixCoord, uint number)
{
pixCoord.y -= 4;
if (number <= 9)
{
return SampleDebugFont(pixCoord - int2(6, 0), number);
}
else
{
return (SampleDebugFont(pixCoord, number / 10) | SampleDebugFont(pixCoord - int2(6, 0), number % 10));
}
}
#ifndef UNITY_DEBUG_INCLUDED
#define UNITY_DEBUG_INCLUDED
// Given an enum (represented by an int here), return a color.
// Use for DebugView of enum
real3 GetIndexColor(int index)
{
real3 outColor = real3(1.0, 0.0, 0.0);
if (index == 0)
outColor = real3(1.0, 0.5, 0.5);
else if (index == 1)
outColor = real3(0.5, 1.0, 0.5);
else if (index == 2)
outColor = real3(0.5, 0.5, 1.0);
else if (index == 3)
outColor = real3(1.0, 1.0, 0.5);
else if (index == 4)
outColor = real3(1.0, 0.5, 1.0);
else if (index == 5)
outColor = real3(0.5, 1.0, 1.0);
else if (index == 6)
outColor = real3(0.25, 0.75, 1.0);
else if (index == 7)
outColor = real3(1.0, 0.75, 0.25);
else if (index == 8)
outColor = real3(0.75, 1.0, 0.25);
else if (index == 9)
outColor = real3(0.75, 0.25, 1.0);
return outColor;
}
bool SampleDebugFont(int2 pixCoord, uint digit)
{
if (pixCoord.x < 0 || pixCoord.y < 0 || pixCoord.x >= 5 || pixCoord.y >= 9 || digit > 9)
return false;
#define PACK_BITS25(_x0,_x1,_x2,_x3,_x4,_x5,_x6,_x7,_x8,_x9,_x10,_x11,_x12,_x13,_x14,_x15,_x16,_x17,_x18,_x19,_x20,_x21,_x22,_x23,_x24) (_x0|(_x1<<1)|(_x2<<2)|(_x3<<3)|(_x4<<4)|(_x5<<5)|(_x6<<6)|(_x7<<7)|(_x8<<8)|(_x9<<9)|(_x10<<10)|(_x11<<11)|(_x12<<12)|(_x13<<13)|(_x14<<14)|(_x15<<15)|(_x16<<16)|(_x17<<17)|(_x18<<18)|(_x19<<19)|(_x20<<20)|(_x21<<21)|(_x22<<22)|(_x23<<23)|(_x24<<24))
#define _ 0
#define x 1
uint fontData[9][2] = {
{ PACK_BITS25(_,_,x,_,_, _,_,x,_,_, _,x,x,x,_, x,x,x,x,x, _,_,_,x,_), PACK_BITS25(x,x,x,x,x, _,x,x,x,_, x,x,x,x,x, _,x,x,x,_, _,x,x,x,_) },
{ PACK_BITS25(_,x,_,x,_, _,x,x,_,_, x,_,_,_,x, _,_,_,_,x, _,_,_,x,_), PACK_BITS25(x,_,_,_,_, x,_,_,_,x, _,_,_,_,x, x,_,_,_,x, x,_,_,_,x) },
{ PACK_BITS25(x,_,_,_,x, x,_,x,_,_, x,_,_,_,x, _,_,_,x,_, _,_,x,x,_), PACK_BITS25(x,_,_,_,_, x,_,_,_,_, _,_,_,x,_, x,_,_,_,x, x,_,_,_,x) },
{ PACK_BITS25(x,_,_,_,x, _,_,x,_,_, _,_,_,_,x, _,_,x,_,_, _,x,_,x,_), PACK_BITS25(x,_,x,x,_, x,_,_,_,_, _,_,_,x,_, x,_,_,_,x, x,_,_,_,x) },
{ PACK_BITS25(x,_,_,_,x, _,_,x,_,_, _,_,_,x,_, _,x,x,x,_, _,x,_,x,_), PACK_BITS25(x,x,_,_,x, x,x,x,x,_, _,_,x,_,_, _,x,x,x,_, _,x,x,x,x) },
{ PACK_BITS25(x,_,_,_,x, _,_,x,_,_, _,_,x,_,_, _,_,_,_,x, x,_,_,x,_), PACK_BITS25(_,_,_,_,x, x,_,_,_,x, _,_,x,_,_, x,_,_,_,x, _,_,_,_,x) },
{ PACK_BITS25(x,_,_,_,x, _,_,x,_,_, _,x,_,_,_, _,_,_,_,x, x,x,x,x,x), PACK_BITS25(_,_,_,_,x, x,_,_,_,x, _,x,_,_,_, x,_,_,_,x, _,_,_,_,x) },
{ PACK_BITS25(_,x,_,x,_, _,_,x,_,_, x,_,_,_,_, x,_,_,_,x, _,_,_,x,_), PACK_BITS25(x,_,_,_,x, x,_,_,_,x, _,x,_,_,_, x,_,_,_,x, x,_,_,_,x) },
{ PACK_BITS25(_,_,x,_,_, x,x,x,x,x, x,x,x,x,x, _,x,x,x,_, _,_,_,x,_), PACK_BITS25(_,x,x,x,_, _,x,x,x,_, _,x,_,_,_, _,x,x,x,_, _,x,x,x,_) }
};
#undef _
#undef x
#undef PACK_BITS25
return (fontData[8 - pixCoord.y][digit >= 5] >> ((digit % 5) * 5 + pixCoord.x)) & 1;
}
bool SampleDebugFontNumber(int2 pixCoord, uint number)
{
pixCoord.y -= 4;
if (number <= 9)
{
return SampleDebugFont(pixCoord - int2(6, 0), number);
}
else
{
return (SampleDebugFont(pixCoord, number / 10) | SampleDebugFont(pixCoord - int2(6, 0), number % 10));
}
}
{
// alpha is amount to blend with source color (0.0 = use original, 1.0 = use new color)
{
// alpha is amount to blend with source color (0.0 = use original, 1.0 = use new color)
// mipInfo :
// x = quality setings minStreamingMipLevel
// y = original mip count for texture
// z = desired on screen mip level
// w = 0
// mipInfo :
// x = quality setings minStreamingMipLevel
// y = original mip count for texture
// z = desired on screen mip level
// w = 0
// If material/shader mip info (original mip level) has not been set its not a streamed texture
if (originalTextureMipCount == 0)
return float4(1.0, 1.0, 1.0, 0.0);
// If material/shader mip info (original mip level) has not been set its not a streamed texture
if (originalTextureMipCount == 0)
return float4(1.0, 1.0, 1.0, 0.0);
uint mipCountDesired = uint(originalTextureMipCount)-uint(desiredMipLevel);
if (mipCount == 0)
{
// Magenta if mip count invalid
return float4(1.0, 0.0, 1.0, 1.0);
}
else if (mipCount < mipCountDesired)
{
// red tones when not at the desired mip level (reduction due to budget). Brighter is further from original, alpha 0 when at desired
float ratioToDesired = float(mipCount) / float(mipCountDesired);
return float4(1.0, 0.0, 0.0, 1.0 - ratioToDesired);
}
else if (mipCount >= originalTextureMipCount)
{
// original color when at (or beyond) original mip count
return float4(1.0, 1.0, 1.0, 0.0);
}
else
{
// green tones when not at the original mip level. Brighter is closer to original, alpha 0 when at original
float ratioToOriginal = float(mipCount) / float(originalTextureMipCount);
return float4(0.0, 1.0, 0.0, 1.0 - ratioToOriginal);
}
uint mipCountDesired = uint(originalTextureMipCount)-uint(desiredMipLevel);
if (mipCount == 0)
{
// Magenta if mip count invalid
return float4(1.0, 0.0, 1.0, 1.0);
}
else if (mipCount < mipCountDesired)
{
// red tones when not at the desired mip level (reduction due to budget). Brighter is further from original, alpha 0 when at desired
float ratioToDesired = float(mipCount) / float(mipCountDesired);
return float4(1.0, 0.0, 0.0, 1.0 - ratioToDesired);
}
else if (mipCount >= originalTextureMipCount)
{
// original color when at (or beyond) original mip count
return float4(1.0, 1.0, 1.0, 0.0);
}
else
{
// green tones when not at the original mip level. Brighter is closer to original, alpha 0 when at original
float ratioToOriginal = float(mipCount) / float(originalTextureMipCount);
return float4(0.0, 1.0, 0.0, 1.0 - ratioToOriginal);
}
{
// Grey scale for mip counts where mip count of 12 = white
float mipCountColor = float(mipCount) / 12.0;
float4 color = float4(mipCountColor, mipCountColor, mipCountColor, 1.0f);
// alpha is amount to blend with source color (0.0 = use original, 1.0 = use new color)
// Magenta is no valid mip count
// Original colour if greater than 12
return mipCount==0 ? float4(1.0, 0.0, 1.0, 1.0) : (mipCount > 12 ? float4(1.0, 1.0, 1.0, 0.0) : color );
{
// Grey scale for mip counts where mip count of 12 = white
float mipCountColor = float(mipCount) / 12.0;
float4 color = float4(mipCountColor, mipCountColor, mipCountColor, 1.0f);
// alpha is amount to blend with source color (0.0 = use original, 1.0 = use new color)
// Magenta is no valid mip count
// Original colour if greater than 12
return mipCount==0 ? float4(1.0, 0.0, 1.0, 1.0) : (mipCount > 12 ? float4(1.0, 1.0, 1.0, 0.0) : color );
// Push down into colors list to "optimal level" in following table.
// .zw is texture width,height so *2 is down one mip, *4 is down two mips
texelSize.zw *= 4.0;
// Push down into colors list to "optimal level" in following table.
// .zw is texture width,height so *2 is down one mip, *4 is down two mips
texelSize.zw *= 4.0;
float mipLevel = ComputeTextureLOD(uv, texelSize.wz);
float mipLevel = ComputeTextureLOD(uv, texelSize.wz);
float4 colors[6] = {
float4 colors[6] = {
float4(0.0, 0.0, 1.0, 0.8), // 0 BLUE = too little texture detail
float4(0.0, 0.5, 1.0, 0.4), // 1
float4(1.0, 1.0, 1.0, 0.0), // 2 = optimal level

float4 color = lerp(a, b, t);
return color;
}
float3 GetDebugMipColor(float3 originalColor, Texture2D tex, float4 texelSize, float2 uv)
}
float3 GetDebugMipColor(float3 originalColor, Texture2D tex, float4 texelSize, float2 uv)
return lerp(originalColor, mipColor.rgb, mipColor.a);
}
float3 GetDebugMipCountColor(float3 originalColor, Texture2D tex)
return lerp(originalColor, mipColor.rgb, mipColor.a);
}
float3 GetDebugMipCountColor(float3 originalColor, Texture2D tex)
uint mipCount = GetMipCount(tex);
uint mipCount = GetMipCount(tex);
return lerp(originalColor, mipColor.rgb, mipColor.a);
}
float3 GetDebugStreamingMipColor(Texture2D tex, float4 mipInfo)
return lerp(originalColor, mipColor.rgb, mipColor.a);
}
float3 GetDebugStreamingMipColor(Texture2D tex, float4 mipInfo)
uint mipCount = GetMipCount(tex);
uint mipCount = GetMipCount(tex);
}
float3 GetDebugStreamingMipColorBlended(float3 originalColor, Texture2D tex, float4 mipInfo)
}
float3 GetDebugStreamingMipColorBlended(float3 originalColor, Texture2D tex, float4 mipInfo)
uint mipCount = GetMipCount(tex);
uint mipCount = GetMipCount(tex);
return lerp(originalColor, mipColor.rgb, mipColor.a);
}
float3 GetDebugMipColorIncludingMipReduction(float3 originalColor, Texture2D tex, float4 texelSize, float2 uv, float4 mipInfo)
return lerp(originalColor, mipColor.rgb, mipColor.a);
}
float3 GetDebugMipColorIncludingMipReduction(float3 originalColor, Texture2D tex, float4 texelSize, float2 uv, float4 mipInfo)
uint originalTextureMipCount = uint(mipInfo.y);
if (originalTextureMipCount != 0)
{
// mipInfo :
// x = quality setings minStreamingMipLevel
// y = original mip count for texture
// z = desired on screen mip level
// w = 0
// Mip count has been reduced but the texelSize was not updated to take that into account
uint mipCount = GetMipCount(tex);
uint mipReductionLevel = originalTextureMipCount - mipCount;
uint mipReductionFactor = 1 << mipReductionLevel;
if (mipReductionFactor)
{
float oneOverMipReductionFactor = 1.0 / mipReductionFactor;
// texelSize.xy *= mipReductionRatio; // Unused in GetDebugMipColor so lets not re-calculate it
texelSize.zw *= oneOverMipReductionFactor;
}
}
return GetDebugMipColor(originalColor, tex, texelSize, uv);
}
float3 GetDebugMipReductionColor(Texture2D tex, float4 mipInfo)
uint originalTextureMipCount = uint(mipInfo.y);
if (originalTextureMipCount != 0)
{
// mipInfo :
// x = quality setings minStreamingMipLevel
// y = original mip count for texture
// z = desired on screen mip level
// w = 0
// Mip count has been reduced but the texelSize was not updated to take that into account
uint mipCount = GetMipCount(tex);
uint mipReductionLevel = originalTextureMipCount - mipCount;
uint mipReductionFactor = 1 << mipReductionLevel;
if (mipReductionFactor)
{
float oneOverMipReductionFactor = 1.0 / mipReductionFactor;
// texelSize.xy *= mipReductionRatio; // Unused in GetDebugMipColor so lets not re-calculate it
texelSize.zw *= oneOverMipReductionFactor;
}
}
return GetDebugMipColor(originalColor, tex, texelSize, uv);
}
float3 GetDebugMipReductionColor(Texture2D tex, float4 mipInfo)
uint originalTextureMipCount = uint(mipInfo.y);
if (originalTextureMipCount != 0)
{
// mipInfo :
// x = quality setings minStreamingMipLevel
// y = original mip count for texture
// z = desired on screen mip level
// w = 0
// Mip count has been reduced but the texelSize was not updated to take that into account
uint mipCount = GetMipCount(tex);
uint mipReductionLevel = originalTextureMipCount - mipCount;
float mipCol = float(mipReductionLevel) / 12.0;
return float3(0, mipCol, 0);
}
// Can't calculate without original mip count - return magenta
return float3(1.0, 0.0, 1.0);
}
#ifdef DEBUG_DISPLAY
uint originalTextureMipCount = uint(mipInfo.y);
if (originalTextureMipCount != 0)
{
// mipInfo :
// x = quality setings minStreamingMipLevel
// y = original mip count for texture
// z = desired on screen mip level
// w = 0
// Mip count has been reduced but the texelSize was not updated to take that into account
uint mipCount = GetMipCount(tex);
uint mipReductionLevel = originalTextureMipCount - mipCount;
float mipCol = float(mipReductionLevel) / 12.0;
return float3(0, mipCol, 0);
}
// Can't calculate without original mip count - return magenta
return float3(1.0, 0.0, 1.0);
}
#ifdef DEBUG_DISPLAY
case DEBUGMIPMAPMODE_MIP_RATIO:
return GetDebugMipColorIncludingMipReduction(originalColor, tex, texelSize, uv, mipInfo);
case DEBUGMIPMAPMODE_MIP_COUNT:
return GetDebugMipCountColor(originalColor, tex);
case DEBUGMIPMAPMODE_MIP_COUNT_REDUCTION:
return GetDebugMipReductionColor(tex, mipInfo);
case DEBUGMIPMAPMODE_STREAMING_MIP_BUDGET:
return GetDebugStreamingMipColor(tex, mipInfo);
case DEBUGMIPMAPMODE_STREAMING_MIP:
return GetDebugStreamingMipColorBlended(originalColor, tex, mipInfo);
}
case DEBUGMIPMAPMODE_MIP_RATIO:
return GetDebugMipColorIncludingMipReduction(originalColor, tex, texelSize, uv, mipInfo);
case DEBUGMIPMAPMODE_MIP_COUNT:
return GetDebugMipCountColor(originalColor, tex);
case DEBUGMIPMAPMODE_MIP_COUNT_REDUCTION:
return GetDebugMipReductionColor(tex, mipInfo);
case DEBUGMIPMAPMODE_STREAMING_MIP_BUDGET:
return GetDebugStreamingMipColor(tex, mipInfo);
case DEBUGMIPMAPMODE_STREAMING_MIP:
return GetDebugStreamingMipColorBlended(originalColor, tex, mipInfo);
}
}
}
#endif // UNITY_DEBUG_INCLUDED
#endif // UNITY_DEBUG_INCLUDED

616
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Debug/MaterialDebug.cs


using System.Collections.Generic;
using UnityEngine;
using System;
namespace UnityEngine.Experimental.Rendering.HDPipeline
{
namespace Attributes
{
// 0 is reserved!
[GenerateHLSL]
public enum DebugViewVarying
{
None = 0,
Texcoord0 = 1,
Texcoord1,
Texcoord2,
Texcoord3,
VertexTangentWS,
VertexBitangentWS,
VertexNormalWS,
VertexColor,
VertexColorAlpha,
Last,
};
// Number must be contiguous
[GenerateHLSL]
public enum DebugViewGbuffer
{
None = 0,
Depth = DebugViewVarying.Last,
BakeDiffuseLightingWithAlbedoPlusEmissive,
BakeShadowMask0,
BakeShadowMask1,
BakeShadowMask2,
BakeShadowMask3,
Last,
}
// Number must be contiguous
[GenerateHLSL]
public enum DebugViewProperties
{
None = 0,
Tessellation = DebugViewGbuffer.Last,
PixelDisplacement,
VertexDisplacement,
TessellationDisplacement,
DepthOffset,
Lightmap,
Last,
}
}
[Serializable]
public class MaterialDebugSettings
{
private static bool isDebugViewMaterialInit = false;
public static GUIContent[] debugViewMaterialStrings = null;
public static int[] debugViewMaterialValues = null;
public static GUIContent[] debugViewEngineStrings = null;
public static int[] debugViewEngineValues = null;
public static GUIContent[] debugViewMaterialVaryingStrings = null;
public static int[] debugViewMaterialVaryingValues = null;
public static GUIContent[] debugViewMaterialPropertiesStrings = null;
public static int[] debugViewMaterialPropertiesValues = null;
public static GUIContent[] debugViewMaterialTextureStrings = null;
using System.Collections.Generic;
using UnityEngine;
using System;
namespace UnityEngine.Experimental.Rendering.HDPipeline
{
namespace Attributes
{
// 0 is reserved!
[GenerateHLSL]
public enum DebugViewVarying
{
None = 0,
Texcoord0 = 1,
Texcoord1,
Texcoord2,
Texcoord3,
VertexTangentWS,
VertexBitangentWS,
VertexNormalWS,
VertexColor,
VertexColorAlpha,
Last,
};
// Number must be contiguous
[GenerateHLSL]
public enum DebugViewGbuffer
{
None = 0,
Depth = DebugViewVarying.Last,
BakeDiffuseLightingWithAlbedoPlusEmissive,
BakeShadowMask0,
BakeShadowMask1,
BakeShadowMask2,
BakeShadowMask3,
Last,
}
// Number must be contiguous
[GenerateHLSL]
public enum DebugViewProperties
{
None = 0,
Tessellation = DebugViewGbuffer.Last,
PixelDisplacement,
VertexDisplacement,
TessellationDisplacement,
DepthOffset,
Lightmap,
Last,
}
}
[Serializable]
public class MaterialDebugSettings
{
private static bool isDebugViewMaterialInit = false;
public static GUIContent[] debugViewMaterialStrings = null;
public static int[] debugViewMaterialValues = null;
public static GUIContent[] debugViewEngineStrings = null;
public static int[] debugViewEngineValues = null;
public static GUIContent[] debugViewMaterialVaryingStrings = null;
public static int[] debugViewMaterialVaryingValues = null;
public static GUIContent[] debugViewMaterialPropertiesStrings = null;
public static int[] debugViewMaterialPropertiesValues = null;
public static GUIContent[] debugViewMaterialTextureStrings = null;
public static GUIContent[] debugViewMaterialGBufferStrings = null;
public static int[] debugViewMaterialGBufferValues = null;
public MaterialDebugSettings()
{
BuildDebugRepresentation();
}
// className include the additional "/"
void FillWithProperties(Type type, GUIContent[] debugViewMaterialStrings, int[] debugViewMaterialValues, string className, ref int index)
{
var attributes = type.GetCustomAttributes(true);
// Get attribute to get the start number of the value for the enum
var attr = attributes[0] as GenerateHLSL;
if (!attr.needParamDebug)
{
return;
}
var fields = type.GetFields();
var localIndex = 0;
foreach (var field in fields)
{
var fieldName = field.Name;
// Check if the display name have been override by the users
if (Attribute.IsDefined(field, typeof(SurfaceDataAttributes)))
{
var propertyAttr = (SurfaceDataAttributes[])field.GetCustomAttributes(typeof(SurfaceDataAttributes), false);
if (propertyAttr[0].displayName != "")
{
fieldName = propertyAttr[0].displayName;
}
}
fieldName = className + fieldName;
debugViewMaterialStrings[index] = new GUIContent(fieldName);
debugViewMaterialValues[index] = attr.paramDefinesStart + (int)localIndex;
index++;
localIndex++;
}
}
void FillWithPropertiesEnum(Type type, GUIContent[] debugViewMaterialStrings, int[] debugViewMaterialValues, string prefix, ref int index)
{
var names = Enum.GetNames(type);
var localIndex = 0;
foreach (var value in Enum.GetValues(type))
{
var valueName = prefix + names[localIndex];
debugViewMaterialStrings[index] = new GUIContent(valueName);
debugViewMaterialValues[index] = (int)value;
index++;
localIndex++;
}
}
public class MaterialItem
{
public String className;
public Type surfaceDataType;
public Type bsdfDataType;
};
void BuildDebugRepresentation()
{
if (!isDebugViewMaterialInit)
{
List<RenderPipelineMaterial> materialList = HDUtils.GetRenderPipelineMaterialList();
// TODO: Share this code to retrieve deferred material with HDRenderPipeline
// Find first material that have non 0 Gbuffer count and assign it as deferredMaterial
Type bsdfDataDeferredType = null;
foreach (RenderPipelineMaterial material in materialList)
{
if (material.GetMaterialGBufferCount() > 0)
{
bsdfDataDeferredType = material.GetType().GetNestedType("BSDFData");
}
}
// TODO: Handle the case of no Gbuffer material
Debug.Assert(bsdfDataDeferredType != null);
List<MaterialItem> materialItems = new List<MaterialItem>();
int numSurfaceDataFields = 0;
int numBSDFDataFields = 0;
foreach (RenderPipelineMaterial material in materialList)
{
MaterialItem item = new MaterialItem();
item.className = material.GetType().Name + "/";
item.surfaceDataType = material.GetType().GetNestedType("SurfaceData");
numSurfaceDataFields += item.surfaceDataType.GetFields().Length;
item.bsdfDataType = material.GetType().GetNestedType("BSDFData");
numBSDFDataFields += item.bsdfDataType.GetFields().Length;
materialItems.Add(item);
}
// Material properties debug
var num = typeof(Builtin.BuiltinData).GetFields().Length * materialList.Count // BuildtinData are duplicated for each material
+ numSurfaceDataFields + 1; // +1 for None case
debugViewMaterialStrings = new GUIContent[num];
debugViewMaterialValues = new int[num];
// Special case for None since it cannot be inferred from SurfaceData/BuiltinData
debugViewMaterialStrings[0] = new GUIContent("None");
debugViewMaterialValues[0] = 0;
var index = 1;
// 0 is a reserved number and should not be used (allow to track error)
foreach (MaterialItem item in materialItems)
{
// BuiltinData are duplicated for each material
FillWithProperties(typeof(Builtin.BuiltinData), debugViewMaterialStrings, debugViewMaterialValues, item.className, ref index);
FillWithProperties(item.surfaceDataType, debugViewMaterialStrings, debugViewMaterialValues, item.className, ref index);
}
// Engine properties debug
num = numBSDFDataFields + 1; // +1 for None case
debugViewEngineStrings = new GUIContent[num];
debugViewEngineValues = new int[num];
// 0 is a reserved number and should not be used (allow to track error)
debugViewEngineStrings[0] = new GUIContent("None");
debugViewEngineValues[0] = 0;
index = 1;
foreach (MaterialItem item in materialItems)
{
FillWithProperties(item.bsdfDataType, debugViewEngineStrings, debugViewEngineValues, item.className, ref index);
}
// Attributes debug
var varyingNames = Enum.GetNames(typeof(Attributes.DebugViewVarying));
debugViewMaterialVaryingStrings = new GUIContent[varyingNames.Length];
debugViewMaterialVaryingValues = new int[varyingNames.Length];
index = 0;
FillWithPropertiesEnum(typeof(Attributes.DebugViewVarying), debugViewMaterialVaryingStrings, debugViewMaterialVaryingValues, "", ref index);
// Properties debug
var propertiesNames = Enum.GetNames(typeof(Attributes.DebugViewProperties));
debugViewMaterialPropertiesStrings = new GUIContent[propertiesNames.Length];
debugViewMaterialPropertiesValues = new int[propertiesNames.Length];
index = 0;
FillWithPropertiesEnum(typeof(Attributes.DebugViewProperties), debugViewMaterialPropertiesStrings, debugViewMaterialPropertiesValues, "", ref index);
// Gbuffer debug
var gbufferNames = Enum.GetNames(typeof(Attributes.DebugViewGbuffer));
debugViewMaterialGBufferStrings = new GUIContent[gbufferNames.Length + bsdfDataDeferredType.GetFields().Length];
debugViewMaterialGBufferValues = new int[gbufferNames.Length + bsdfDataDeferredType.GetFields().Length];
index = 0;
FillWithPropertiesEnum(typeof(Attributes.DebugViewGbuffer), debugViewMaterialGBufferStrings, debugViewMaterialGBufferValues, "", ref index);
FillWithProperties(typeof(Lit.BSDFData), debugViewMaterialGBufferStrings, debugViewMaterialGBufferValues, "", ref index);
isDebugViewMaterialInit = true;
}
}
public int debugViewMaterial { get { return m_DebugViewMaterial; } }
public int debugViewEngine { get { return m_DebugViewEngine; } }
public Attributes.DebugViewVarying debugViewVarying { get { return m_DebugViewVarying; } }
public Attributes.DebugViewProperties debugViewProperties { get { return m_DebugViewProperties; } }
public int debugViewGBuffer { get { return m_DebugViewGBuffer; } }
int m_DebugViewMaterial = 0; // No enum there because everything is generated from materials.
int m_DebugViewEngine = 0; // No enum there because everything is generated from BSDFData
Attributes.DebugViewVarying m_DebugViewVarying = Attributes.DebugViewVarying.None;
Attributes.DebugViewProperties m_DebugViewProperties = Attributes.DebugViewProperties.None;
int m_DebugViewGBuffer = 0; // Can't use GBuffer enum here because the values are actually split between this enum and values from Lit.BSDFData
public int GetDebugMaterialIndex()
{
// This value is used in the shader for the actual debug display.
// There is only one uniform parameter for that so we just add all of them
// They are all mutually exclusive so return the sum will return the right index.
return m_DebugViewGBuffer + m_DebugViewMaterial + m_DebugViewEngine + (int)m_DebugViewVarying + (int)m_DebugViewProperties;
}
public void DisableMaterialDebug()
{
m_DebugViewMaterial = 0;
m_DebugViewEngine = 0;
m_DebugViewVarying = Attributes.DebugViewVarying.None;
m_DebugViewProperties = Attributes.DebugViewProperties.None;
m_DebugViewGBuffer = 0;
}
public void SetDebugViewMaterial(int value)
{
if (value != 0)
DisableMaterialDebug();
m_DebugViewMaterial = value;
}
public void SetDebugViewEngine(int value)
{
if (value != 0)
DisableMaterialDebug();
m_DebugViewEngine = value;
}
public void SetDebugViewVarying(Attributes.DebugViewVarying value)
{
if (value != 0)
DisableMaterialDebug();
m_DebugViewVarying = value;
}
public void SetDebugViewProperties(Attributes.DebugViewProperties value)
{
if (value != 0)
DisableMaterialDebug();
m_DebugViewProperties = value;
}
public void SetDebugViewGBuffer(int value)
{
if (value != 0)
DisableMaterialDebug();
m_DebugViewGBuffer = value;
}
public bool IsDebugGBufferEnabled()
{
return m_DebugViewGBuffer != 0;
}
public bool IsDebugDisplayEnabled()
{
return (m_DebugViewEngine != 0 || m_DebugViewMaterial != 0 || m_DebugViewVarying != Attributes.DebugViewVarying.None || m_DebugViewProperties != Attributes.DebugViewProperties.None || m_DebugViewGBuffer != 0);
}
}
}
public static GUIContent[] debugViewMaterialGBufferStrings = null;
public static int[] debugViewMaterialGBufferValues = null;
public MaterialDebugSettings()
{
BuildDebugRepresentation();
}
// className include the additional "/"
void FillWithProperties(Type type, GUIContent[] debugViewMaterialStrings, int[] debugViewMaterialValues, string className, ref int index)
{
var attributes = type.GetCustomAttributes(true);
// Get attribute to get the start number of the value for the enum
var attr = attributes[0] as GenerateHLSL;
if (!attr.needParamDebug)
{
return;
}
var fields = type.GetFields();
var localIndex = 0;
foreach (var field in fields)
{
var fieldName = field.Name;
// Check if the display name have been override by the users
if (Attribute.IsDefined(field, typeof(SurfaceDataAttributes)))
{
var propertyAttr = (SurfaceDataAttributes[])field.GetCustomAttributes(typeof(SurfaceDataAttributes), false);
if (propertyAttr[0].displayName != "")
{
fieldName = propertyAttr[0].displayName;
}
}
fieldName = className + fieldName;
debugViewMaterialStrings[index] = new GUIContent(fieldName);
debugViewMaterialValues[index] = attr.paramDefinesStart + (int)localIndex;
index++;
localIndex++;
}
}
void FillWithPropertiesEnum(Type type, GUIContent[] debugViewMaterialStrings, int[] debugViewMaterialValues, string prefix, ref int index)
{
var names = Enum.GetNames(type);
var localIndex = 0;
foreach (var value in Enum.GetValues(type))
{
var valueName = prefix + names[localIndex];
debugViewMaterialStrings[index] = new GUIContent(valueName);
debugViewMaterialValues[index] = (int)value;
index++;
localIndex++;
}
}
public class MaterialItem
{
public String className;
public Type surfaceDataType;
public Type bsdfDataType;
};
void BuildDebugRepresentation()
{
if (!isDebugViewMaterialInit)
{
List<RenderPipelineMaterial> materialList = HDUtils.GetRenderPipelineMaterialList();
// TODO: Share this code to retrieve deferred material with HDRenderPipeline
// Find first material that have non 0 Gbuffer count and assign it as deferredMaterial
Type bsdfDataDeferredType = null;
foreach (RenderPipelineMaterial material in materialList)
{
if (material.GetMaterialGBufferCount() > 0)
{
bsdfDataDeferredType = material.GetType().GetNestedType("BSDFData");
}
}
// TODO: Handle the case of no Gbuffer material
Debug.Assert(bsdfDataDeferredType != null);
List<MaterialItem> materialItems = new List<MaterialItem>();
int numSurfaceDataFields = 0;
int numBSDFDataFields = 0;
foreach (RenderPipelineMaterial material in materialList)
{
MaterialItem item = new MaterialItem();
item.className = material.GetType().Name + "/";
item.surfaceDataType = material.GetType().GetNestedType("SurfaceData");
numSurfaceDataFields += item.surfaceDataType.GetFields().Length;
item.bsdfDataType = material.GetType().GetNestedType("BSDFData");
numBSDFDataFields += item.bsdfDataType.GetFields().Length;
materialItems.Add(item);
}
// Material properties debug
var num = typeof(Builtin.BuiltinData).GetFields().Length * materialList.Count // BuildtinData are duplicated for each material
+ numSurfaceDataFields + 1; // +1 for None case
debugViewMaterialStrings = new GUIContent[num];
debugViewMaterialValues = new int[num];
// Special case for None since it cannot be inferred from SurfaceData/BuiltinData
debugViewMaterialStrings[0] = new GUIContent("None");
debugViewMaterialValues[0] = 0;
var index = 1;
// 0 is a reserved number and should not be used (allow to track error)
foreach (MaterialItem item in materialItems)
{
// BuiltinData are duplicated for each material
FillWithProperties(typeof(Builtin.BuiltinData), debugViewMaterialStrings, debugViewMaterialValues, item.className, ref index);
FillWithProperties(item.surfaceDataType, debugViewMaterialStrings, debugViewMaterialValues, item.className, ref index);
}
// Engine properties debug
num = numBSDFDataFields + 1; // +1 for None case
debugViewEngineStrings = new GUIContent[num];
debugViewEngineValues = new int[num];
// 0 is a reserved number and should not be used (allow to track error)
debugViewEngineStrings[0] = new GUIContent("None");
debugViewEngineValues[0] = 0;
index = 1;
foreach (MaterialItem item in materialItems)
{
FillWithProperties(item.bsdfDataType, debugViewEngineStrings, debugViewEngineValues, item.className, ref index);
}
// Attributes debug
var varyingNames = Enum.GetNames(typeof(Attributes.DebugViewVarying));
debugViewMaterialVaryingStrings = new GUIContent[varyingNames.Length];
debugViewMaterialVaryingValues = new int[varyingNames.Length];
index = 0;
FillWithPropertiesEnum(typeof(Attributes.DebugViewVarying), debugViewMaterialVaryingStrings, debugViewMaterialVaryingValues, "", ref index);
// Properties debug
var propertiesNames = Enum.GetNames(typeof(Attributes.DebugViewProperties));
debugViewMaterialPropertiesStrings = new GUIContent[propertiesNames.Length];
debugViewMaterialPropertiesValues = new int[propertiesNames.Length];
index = 0;
FillWithPropertiesEnum(typeof(Attributes.DebugViewProperties), debugViewMaterialPropertiesStrings, debugViewMaterialPropertiesValues, "", ref index);
// Gbuffer debug
var gbufferNames = Enum.GetNames(typeof(Attributes.DebugViewGbuffer));
debugViewMaterialGBufferStrings = new GUIContent[gbufferNames.Length + bsdfDataDeferredType.GetFields().Length];
debugViewMaterialGBufferValues = new int[gbufferNames.Length + bsdfDataDeferredType.GetFields().Length];
index = 0;
FillWithPropertiesEnum(typeof(Attributes.DebugViewGbuffer), debugViewMaterialGBufferStrings, debugViewMaterialGBufferValues, "", ref index);
FillWithProperties(typeof(Lit.BSDFData), debugViewMaterialGBufferStrings, debugViewMaterialGBufferValues, "", ref index);
isDebugViewMaterialInit = true;
}
}
public int debugViewMaterial { get { return m_DebugViewMaterial; } }
public int debugViewEngine { get { return m_DebugViewEngine; } }
public Attributes.DebugViewVarying debugViewVarying { get { return m_DebugViewVarying; } }
public Attributes.DebugViewProperties debugViewProperties { get { return m_DebugViewProperties; } }
public int debugViewGBuffer { get { return m_DebugViewGBuffer; } }
int m_DebugViewMaterial = 0; // No enum there because everything is generated from materials.
int m_DebugViewEngine = 0; // No enum there because everything is generated from BSDFData
Attributes.DebugViewVarying m_DebugViewVarying = Attributes.DebugViewVarying.None;
Attributes.DebugViewProperties m_DebugViewProperties = Attributes.DebugViewProperties.None;
int m_DebugViewGBuffer = 0; // Can't use GBuffer enum here because the values are actually split between this enum and values from Lit.BSDFData
public int GetDebugMaterialIndex()
{
// This value is used in the shader for the actual debug display.
// There is only one uniform parameter for that so we just add all of them
// They are all mutually exclusive so return the sum will return the right index.
return m_DebugViewGBuffer + m_DebugViewMaterial + m_DebugViewEngine + (int)m_DebugViewVarying + (int)m_DebugViewProperties;
}
public void DisableMaterialDebug()
{
m_DebugViewMaterial = 0;
m_DebugViewEngine = 0;
m_DebugViewVarying = Attributes.DebugViewVarying.None;
m_DebugViewProperties = Attributes.DebugViewProperties.None;
m_DebugViewGBuffer = 0;
}
public void SetDebugViewMaterial(int value)
{
if (value != 0)
DisableMaterialDebug();
m_DebugViewMaterial = value;
}
public void SetDebugViewEngine(int value)
{
if (value != 0)
DisableMaterialDebug();
m_DebugViewEngine = value;
}
public void SetDebugViewVarying(Attributes.DebugViewVarying value)
{
if (value != 0)
DisableMaterialDebug();
m_DebugViewVarying = value;
}
public void SetDebugViewProperties(Attributes.DebugViewProperties value)
{
if (value != 0)
DisableMaterialDebug();
m_DebugViewProperties = value;
}
public void SetDebugViewGBuffer(int value)
{
if (value != 0)
DisableMaterialDebug();
m_DebugViewGBuffer = value;
}
public bool IsDebugGBufferEnabled()
{
return m_DebugViewGBuffer != 0;
}
public bool IsDebugDisplayEnabled()
{
return (m_DebugViewEngine != 0 || m_DebugViewMaterial != 0 || m_DebugViewVarying != Attributes.DebugViewVarying.None || m_DebugViewProperties != Attributes.DebugViewProperties.None || m_DebugViewGBuffer != 0);
}
}
}

27
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Material/LayeredLit/LayeredLitUI.cs


CoreUtils.SetKeyword(material, "_INFLUENCEMASK_MAP", material.GetTexture(kLayerInfluenceMaskMap) && material.GetFloat(kkUseMainLayerInfluence) != 0.0f);
CoreUtils.SetKeyword(material, "_EMISSIVE_MAPPING_PLANAR", ((UVBaseMapping)material.GetFloat(kUVEmissive)) == UVBaseMapping.Planar && material.GetTexture(kEmissiveColorMap));
CoreUtils.SetKeyword(material, "_EMISSIVE_MAPPING_TRIPLANAR", ((UVBaseMapping)material.GetFloat(kUVEmissive)) == UVBaseMapping.Triplanar && material.GetTexture(kEmissiveColorMap));
CoreUtils.SetKeyword(material, "_EMISSIVE_COLOR_MAP", material.GetTexture(kEmissiveColorMap));
CoreUtils.SetKeyword(material, "_ENABLESPECULAROCCLUSION", material.GetFloat(kEnableSpecularOcclusion) > 0.0f);

CoreUtils.SetKeyword(material, "_MATERIAL_FEATURE_SUBSURFACE_SCATTERING", materialId == BaseLitGUI.MaterialId.LitSSS);
CoreUtils.SetKeyword(material, "_MATERIAL_FEATURE_TRANSMISSION", materialId == BaseLitGUI.MaterialId.LitSSS);
}
private void DoEmissiveGUI(Material material)
{
EditorGUILayout.Space();
EditorGUILayout.LabelField(Styles.lightingText, EditorStyles.boldLabel);
m_MaterialEditor.ShaderProperty(enableSpecularOcclusion, Styles.enableSpecularOcclusionText);
// TODO: display warning if we don't have bent normal (either OS or TS) and ambient occlusion
//if (enableSpecularOcclusion.floatValue > 0.0f)
{
// EditorGUILayout.HelpBox(Styles.specularOcclusionWarning.text, MessageType.Error);
}
EditorGUI.indentLevel++;
m_MaterialEditor.TexturePropertySingleLine(Styles.emissiveText, emissiveColorMap, emissiveColor);
m_MaterialEditor.ShaderProperty(emissiveIntensity, Styles.emissiveIntensityText);
m_MaterialEditor.ShaderProperty(albedoAffectEmissive, Styles.albedoAffectEmissiveText);
EditorGUI.indentLevel--;
}
public override void OnGUI(MaterialEditor materialEditor, MaterialProperty[] props)

bool layerChanged = DoLayersGUI(materialImporter);
DoEmissiveGUI(material);
EditorGUI.BeginChangeCheck();
{
DoEmissiveGUI(material);
}
if (EditorGUI.EndChangeCheck())
{
optionsChanged = true;
}
DoEmissionArea(material);
EditorGUI.indentLevel--;
m_MaterialEditor.EnableInstancingField();

39
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Material/Lit/LitUI.cs


protected const string kEmissiveIntensity = "_EmissiveIntensity";
protected MaterialProperty albedoAffectEmissive = null;
protected const string kAlbedoAffectEmissive = "_AlbedoAffectEmissive";
protected MaterialProperty UVEmissive = null;
protected const string kUVEmissive = "_UVEmissive";
protected MaterialProperty TexWorldScaleEmissive = null;
protected const string kTexWorldScaleEmissive = "_TexWorldScaleEmissive";
protected MaterialProperty UVMappingMaskEmissive = null;
protected const string kUVMappingMaskEmissive = "_UVMappingMaskEmissive";
protected MaterialProperty enableSpecularOcclusion = null;
protected const string kEnableSpecularOcclusion = "_EnableSpecularOcclusion";

emissiveColorMap = FindProperty(kEmissiveColorMap, props);
emissiveIntensity = FindProperty(kEmissiveIntensity, props);
albedoAffectEmissive = FindProperty(kAlbedoAffectEmissive, props);
UVEmissive = FindProperty(kUVEmissive, props);
TexWorldScaleEmissive = FindProperty(kTexWorldScaleEmissive, props);
UVMappingMaskEmissive = FindProperty(kUVMappingMaskEmissive, props);
enableSpecularOcclusion = FindProperty(kEnableSpecularOcclusion, props);
}

if (EditorGUI.EndChangeCheck())
{
UpdateDisplacement(layerIndex);
}
}
}
switch ((BaseLitGUI.MaterialId)materialID.floatValue)

}
}
private void DoEmissiveGUI(Material material)
protected void DoEmissiveGUI(Material material)
{
EditorGUILayout.Space();
EditorGUILayout.LabelField(Styles.lightingText, EditorStyles.boldLabel);

}
EditorGUI.indentLevel++;
m_MaterialEditor.TexturePropertySingleLine(Styles.emissiveText, emissiveColorMap, emissiveColor);
m_MaterialEditor.ShaderProperty(UVEmissive, Styles.UVBaseMappingText);
UVBaseMapping uvEmissiveMapping = (UVBaseMapping)UVEmissive.floatValue;
float X, Y, Z, W;
X = (uvEmissiveMapping == UVBaseMapping.UV0) ? 1.0f : 0.0f;
Y = (uvEmissiveMapping == UVBaseMapping.UV1) ? 1.0f : 0.0f;
Z = (uvEmissiveMapping == UVBaseMapping.UV2) ? 1.0f : 0.0f;
W = (uvEmissiveMapping == UVBaseMapping.UV3) ? 1.0f : 0.0f;
UVMappingMaskEmissive.colorValue = new Color(X, Y, Z, W);
if ((uvEmissiveMapping == UVBaseMapping.Planar) || (uvEmissiveMapping == UVBaseMapping.Triplanar))
{
m_MaterialEditor.ShaderProperty(TexWorldScaleEmissive, Styles.texWorldScaleText);
}
m_MaterialEditor.ShaderProperty(emissiveIntensity, Styles.emissiveIntensityText);
m_MaterialEditor.ShaderProperty(albedoAffectEmissive, Styles.albedoAffectEmissiveText);
EditorGUI.indentLevel--;

// (MaterialProperty value might come from renderer material property block)
CoreUtils.SetKeyword(material, "_MAPPING_PLANAR", ((UVBaseMapping)material.GetFloat(kUVBase)) == UVBaseMapping.Planar);
CoreUtils.SetKeyword(material, "_MAPPING_TRIPLANAR", ((UVBaseMapping)material.GetFloat(kUVBase)) == UVBaseMapping.Triplanar);
CoreUtils.SetKeyword(material, "_NORMALMAP_TANGENT_SPACE", (normalMapSpace == NormalMapSpace.TangentSpace));
if (normalMapSpace == NormalMapSpace.TangentSpace)

CoreUtils.SetKeyword(material, "_BENTNORMALMAP", material.GetTexture(kBentNormalMapOS));
}
CoreUtils.SetKeyword(material, "_MASKMAP", material.GetTexture(kMaskMap));
CoreUtils.SetKeyword(material, "_EMISSIVE_MAPPING_PLANAR", ((UVBaseMapping)material.GetFloat(kUVEmissive)) == UVBaseMapping.Planar && material.GetTexture(kEmissiveColorMap));
CoreUtils.SetKeyword(material, "_EMISSIVE_MAPPING_TRIPLANAR", ((UVBaseMapping)material.GetFloat(kUVEmissive)) == UVBaseMapping.Triplanar && material.GetTexture(kEmissiveColorMap));
CoreUtils.SetKeyword(material, "_ENABLESPECULAROCCLUSION", material.GetFloat(kEnableSpecularOcclusion) > 0.0f);
CoreUtils.SetKeyword(material, "_HEIGHTMAP", material.GetTexture(kHeightMap));
CoreUtils.SetKeyword(material, "_ANISOTROPYMAP", material.GetTexture(kAnisotropyMap));

7
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/LayeredLit/LayeredLit.shader


[HideInInspector] _InvPrimScale("Inverse primitive scale for non-planar POM", Vector) = (1, 1, 0, 0)
[Enum(Use Emissive Color, 0, Use Emissive Mask, 1)] _EmissiveColorMode("Emissive color mode", Float) = 1
[Enum(UV0, 0, Planar, 4, TriPlanar, 5)] _UVEmissive("UV Set for emissive", Float) = 0
_TexWorldScaleEmissive("Scale to apply on world coordinate", Float) = 1.0
[HideInInspector] _UVMappingMaskEmissive("_UVMappingMaskEmissive", Color) = (1, 0, 0, 0)
// Wind
[ToggleOff] _EnableWind("Enable Wind", Float) = 0.0

#pragma shader_feature _PIXEL_DISPLACEMENT_LOCK_OBJECT_SCALE
#pragma shader_feature _VERTEX_WIND
#pragma shader_feature _ _EMISSIVE_MAPPING_PLANAR _EMISSIVE_MAPPING_TRIPLANAR
#pragma shader_feature _LAYER_TILING_COUPLED_WITH_UNIFORM_OBJECT_SCALE
#pragma shader_feature _ _LAYER_MAPPING_PLANAR_BLENDMASK _LAYER_MAPPING_TRIPLANAR_BLENDMASK
#pragma shader_feature _ _LAYER_MAPPING_PLANAR0 _LAYER_MAPPING_TRIPLANAR0

// enable dithering LOD crossfade
#pragma multi_compile _ LOD_FADE_CROSSFADE
//enable GPU instancing support
#pragma multi_compile_instancing
//-------------------------------------------------------------------------------------
// Define

1001
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/LayeredLit/LayeredLitData.hlsl
文件差异内容过多而无法显示
查看文件

7
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/LayeredLit/LayeredLitTessellation.shader


[HideInInspector] _InvPrimScale("Inverse primitive scale for non-planar POM", Vector) = (1, 1, 0, 0)
[Enum(Use Emissive Color, 0, Use Emissive Mask, 1)] _EmissiveColorMode("Emissive color mode", Float) = 1
[Enum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Planar, 4, Triplanar, 5)] _UVEmissive("UV Set for emissive", Float) = 0
_TexWorldScaleEmissive("Scale to apply on world coordinate", Float) = 1.0
[HideInInspector] _UVMappingMaskEmissive("_UVMappingMaskEmissive", Color) = (1, 0, 0, 0)
// Wind
[ToggleOff] _EnableWind("Enable Wind", Float) = 0.0

#pragma shader_feature _VERTEX_WIND
#pragma shader_feature _TESSELLATION_PHONG
#pragma shader_feature _ _EMISSIVE_MAPPING_PLANAR _EMISSIVE_MAPPING_TRIPLANAR
#pragma shader_feature _LAYER_TILING_COUPLED_WITH_UNIFORM_OBJECT_SCALE
#pragma shader_feature _ _LAYER_MAPPING_PLANAR_BLENDMASK _LAYER_MAPPING_TRIPLANAR_BLENDMASK
#pragma shader_feature _ _LAYER_MAPPING_PLANAR0 _LAYER_MAPPING_TRIPLANAR0

// enable dithering LOD crossfade
#pragma multi_compile _ LOD_FADE_CROSSFADE
// enable GPU instancing
#pragma multi_compile_instancing
//-------------------------------------------------------------------------------------
// Define

8
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/Lit/Lit.shader


[Enum(UV0, 0, UV1, 1, UV2, 2, UV3, 3)] _UVDetail("UV Set for detail", Float) = 0
[HideInInspector] _UVDetailsMappingMask("_UVDetailsMappingMask", Color) = (1, 0, 0, 0)
[ToggleOff] _LinkDetailsWithBase("LinkDetailsWithBase", Float) = 1.0
[Enum(UV0, 0, Planar, 4, TriPlanar, 5)] _UVEmissive("UV Set for emissive", Float) = 0
_TexWorldScaleEmissive("Scale to apply on world coordinate", Float) = 1.0
[HideInInspector] _UVMappingMaskEmissive("_UVMappingMaskEmissive", Color) = (1, 0, 0, 0)
// Wind
[ToggleOff] _EnableWind("Enable Wind", Float) = 0.0

#pragma shader_feature _VERTEX_WIND
#pragma shader_feature _ _REFRACTION_PLANE _REFRACTION_SPHERE
#pragma shader_feature _ _EMISSIVE_MAPPING_PLANAR _EMISSIVE_MAPPING_TRIPLANAR
#pragma shader_feature _ _MAPPING_PLANAR _MAPPING_TRIPLANAR
#pragma shader_feature _NORMALMAP_TANGENT_SPACE
#pragma shader_feature _ _REQUIRE_UV2 _REQUIRE_UV3

// enable dithering LOD crossfade
#pragma multi_compile _ LOD_FADE_CROSSFADE
//enable GPU instancing support
#pragma multi_compile_instancing
//-------------------------------------------------------------------------------------
// Define

58
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/Lit/LitData.hlsl


return SphericalCapIntersectionSolidArea(cosAv, cosAs, cosB) / (TWO_PI * (1.0 - cosAs));
}
void GetBuiltinData(FragInputs input, SurfaceData surfaceData, float alpha, float3 bentNormalWS, float depthOffset, out BuiltinData builtinData)
{
// Builtin Data
builtinData.opacity = alpha;
// TODO: Sample lightmap/lightprobe/volume proxy
// This should also handle projective lightmap
builtinData.bakeDiffuseLighting = SampleBakedGI(input.positionWS, bentNormalWS, input.texCoord1, input.texCoord2);
// It is safe to call this function here as surfaceData have been filled
// We want to know if we must enable transmission on GI for SSS material, if the material have no SSS, this code will be remove by the compiler.
BSDFData bsdfData = ConvertSurfaceDataToBSDFData(surfaceData);
if (HasFeatureFlag(bsdfData.materialFeatures, MATERIALFEATUREFLAGS_LIT_TRANSMISSION))
{
// For now simply recall the function with inverted normal, the compiler should be able to optimize the lightmap case to not resample the directional lightmap
// however it will not optimize the lightprobe case due to the proxy volume relying on dynamic if (we rely must get right of this dynamic if), not a problem for SH9, but a problem for proxy volume.
// TODO: optimize more this code.
// Add GI transmission contribution by resampling the GI for inverted vertex normal
builtinData.bakeDiffuseLighting += SampleBakedGI(input.positionWS, -input.worldToTangent[2], input.texCoord1, input.texCoord2) * bsdfData.transmittance;
}
#ifdef SHADOWS_SHADOWMASK
float4 shadowMask = SampleShadowMask(input.positionWS, input.texCoord1);
builtinData.shadowMask0 = shadowMask.x;
builtinData.shadowMask1 = shadowMask.y;
builtinData.shadowMask2 = shadowMask.z;
builtinData.shadowMask3 = shadowMask.w;
#else
builtinData.shadowMask0 = 0.0;
builtinData.shadowMask1 = 0.0;
builtinData.shadowMask2 = 0.0;
builtinData.shadowMask3 = 0.0;
#endif
// Emissive Intensity is only use here, but is part of BuiltinData to enforce UI parameters as we want the users to fill one color and one intensity
builtinData.emissiveIntensity = _EmissiveIntensity; // We still store intensity here so we can reuse it with debug code
builtinData.emissiveColor = _EmissiveColor * builtinData.emissiveIntensity * lerp(float3(1.0, 1.0, 1.0), surfaceData.baseColor.rgb, _AlbedoAffectEmissive);
#ifdef _EMISSIVE_COLOR_MAP
builtinData.emissiveColor *= SAMPLE_TEXTURE2D(_EmissiveColorMap, sampler_EmissiveColorMap, TRANSFORM_TEX(input.texCoord0, _EmissiveColorMap)).rgb;
#endif
builtinData.velocity = float2(0.0, 0.0);
#if (SHADERPASS == SHADERPASS_DISTORTION) || defined(DEBUG_DISPLAY)
float3 distortion = SAMPLE_TEXTURE2D(_DistortionVectorMap, sampler_DistortionVectorMap, input.texCoord0).rgb;
distortion.rg = distortion.rg * _DistortionVectorScale.xx + _DistortionVectorBias.xx;
builtinData.distortion = distortion.rg * _DistortionScale;
builtinData.distortionBlur = clamp(distortion.b * _DistortionBlurScale, 0.0, 1.0) * (_DistortionBlurRemapMax - _DistortionBlurRemapMin) + _DistortionBlurRemapMin;
#else
builtinData.distortion = float2(0.0, 0.0);
builtinData.distortionBlur = 0.0;
#endif
builtinData.depthOffset = depthOffset;
}
// Struct that gather UVMapping info of all layers + common calculation
// This is use to abstract the mapping that can differ on layers
struct LayerTexCoord

}
#include "LitDataDisplacement.hlsl"
#include "LitBuiltinData.hlsl"
void GetSurfaceAndBuiltinData(FragInputs input, float3 V, inout PositionInputs posInput, out SurfaceData surfaceData, out BuiltinData builtinData)
{

520
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/Lit/LitProperties.hlsl


// ===========================================================================
// WARNING:
// On PS4, texture/sampler declarations need to be outside of CBuffers
// Otherwise those parameters are not bound correctly at runtime.
// ===========================================================================
TEXTURE2D(_DistortionVectorMap);
SAMPLER(sampler_DistortionVectorMap);
TEXTURE2D(_EmissiveColorMap);
SAMPLER(sampler_EmissiveColorMap);
#ifndef LAYERED_LIT_SHADER
TEXTURE2D(_DiffuseLightingMap);
SAMPLER(sampler_DiffuseLightingMap);
TEXTURE2D(_BaseColorMap);
SAMPLER(sampler_BaseColorMap);
TEXTURE2D(_MaskMap);
SAMPLER(sampler_MaskMap);
TEXTURE2D(_BentNormalMap); // Reuse sampler from normal map
SAMPLER(sampler_BentNormalMap);
TEXTURE2D(_NormalMap);
SAMPLER(sampler_NormalMap);
TEXTURE2D(_NormalMapOS);
SAMPLER(sampler_NormalMapOS);
TEXTURE2D(_DetailMap);
SAMPLER(sampler_DetailMap);
TEXTURE2D(_HeightMap);
SAMPLER(sampler_HeightMap);
TEXTURE2D(_TangentMap);
SAMPLER(sampler_TangentMap);
TEXTURE2D(_TangentMapOS);
SAMPLER(sampler_TangentMapOS);
TEXTURE2D(_AnisotropyMap);
SAMPLER(sampler_AnisotropyMap);
TEXTURE2D(_SubsurfaceMaskMap);
SAMPLER(sampler_SubsurfaceMaskMap);
TEXTURE2D(_ThicknessMap);
SAMPLER(sampler_ThicknessMap);
TEXTURE2D(_SpecularColorMap);
SAMPLER(sampler_SpecularColorMap);
TEXTURE2D(_TransmittanceColorMap);
SAMPLER(sampler_TransmittanceColorMap);
#else
// Set of users variables
#define PROP_DECL(type, name) type name##0, name##1, name##2, name##3
// sampler are share by texture type inside a layered material but we need to support that a particualr layer have no texture, so we take the first sampler of available texture as the share one
// mean we must declare all sampler
#define PROP_DECL_TEX2D(name)\
TEXTURE2D(MERGE_NAME(name, 0)); \
SAMPLER(MERGE_NAME(MERGE_NAME(sampler, name), 0)); \
TEXTURE2D(MERGE_NAME(name, 1)); \
SAMPLER(MERGE_NAME(MERGE_NAME(sampler, name), 1)); \
TEXTURE2D(MERGE_NAME(name, 2)); \
SAMPLER(MERGE_NAME(MERGE_NAME(sampler, name), 2)); \
TEXTURE2D(MERGE_NAME(name, 3)); \
SAMPLER(MERGE_NAME(MERGE_NAME(sampler, name), 3))
PROP_DECL_TEX2D(_BaseColorMap);
PROP_DECL_TEX2D(_MaskMap);
PROP_DECL_TEX2D(_BentNormalMap);
PROP_DECL_TEX2D(_NormalMap);
PROP_DECL_TEX2D(_NormalMapOS);
PROP_DECL_TEX2D(_DetailMap);
PROP_DECL_TEX2D(_HeightMap);
PROP_DECL_TEX2D(_SubsurfaceMaskMap);
PROP_DECL_TEX2D(_ThicknessMap);
TEXTURE2D(_LayerMaskMap);
SAMPLER(sampler_LayerMaskMap);
TEXTURE2D(_LayerInfluenceMaskMap);
SAMPLER(sampler_LayerInfluenceMaskMap);
#endif
CBUFFER_START(UnityPerMaterial)
// shared constant between lit and layered lit
float _AlphaCutoff;
float _AlphaCutoffPrepass;
float _AlphaCutoffPostpass;
float4 _DoubleSidedConstants;
float _DistortionScale;
float _DistortionVectorScale;
float _DistortionVectorBias;
float _DistortionBlurScale;
float _DistortionBlurRemapMin;
float _DistortionBlurRemapMax;
float _PPDMaxSamples;
float _PPDMinSamples;
float _PPDLodThreshold;
float3 _EmissiveColor;
float _EmissiveIntensity;
float _AlbedoAffectEmissive;
float _EnableSpecularOcclusion;
// Transparency
float3 _TransmittanceColor;
float _IOR;
float _ATDistance;
float _ThicknessMultiplier;
// Caution: C# code in BaseLitUI.cs call LightmapEmissionFlagsProperty() which assume that there is an existing "_EmissionColor"
// value that exist to identify if the GI emission need to be enabled.
// In our case we don't use such a mechanism but need to keep the code quiet. We declare the value and always enable it.
// TODO: Fix the code in legacy unity so we can customize the beahvior for GI
float3 _EmissionColor;
float4 _EmissiveColorMap_ST;
float4 _InvPrimScale; // Only XY are used
// Wind
float _InitialBend;
float _Stiffness;
float _Drag;
float _ShiverDrag;
float _ShiverDirectionality;
#ifndef LAYERED_LIT_SHADER
// Set of users variables
float4 _BaseColor;
float4 _BaseColorMap_ST;
float4 _BaseColorMap_TexelSize;
// ===========================================================================
// WARNING:
// On PS4, texture/sampler declarations need to be outside of CBuffers
// Otherwise those parameters are not bound correctly at runtime.
// ===========================================================================
TEXTURE2D(_DistortionVectorMap);
SAMPLER(sampler_DistortionVectorMap);
TEXTURE2D(_EmissiveColorMap);
SAMPLER(sampler_EmissiveColorMap);
#ifndef LAYERED_LIT_SHADER
TEXTURE2D(_DiffuseLightingMap);
SAMPLER(sampler_DiffuseLightingMap);
TEXTURE2D(_BaseColorMap);
SAMPLER(sampler_BaseColorMap);
TEXTURE2D(_MaskMap);
SAMPLER(sampler_MaskMap);
TEXTURE2D(_BentNormalMap); // Reuse sampler from normal map
SAMPLER(sampler_BentNormalMap);
TEXTURE2D(_NormalMap);
SAMPLER(sampler_NormalMap);
TEXTURE2D(_NormalMapOS);
SAMPLER(sampler_NormalMapOS);
TEXTURE2D(_DetailMap);
SAMPLER(sampler_DetailMap);
TEXTURE2D(_HeightMap);
SAMPLER(sampler_HeightMap);
TEXTURE2D(_TangentMap);
SAMPLER(sampler_TangentMap);
TEXTURE2D(_TangentMapOS);
SAMPLER(sampler_TangentMapOS);
TEXTURE2D(_AnisotropyMap);
SAMPLER(sampler_AnisotropyMap);
TEXTURE2D(_SubsurfaceMaskMap);
SAMPLER(sampler_SubsurfaceMaskMap);
TEXTURE2D(_ThicknessMap);
SAMPLER(sampler_ThicknessMap);
TEXTURE2D(_SpecularColorMap);
SAMPLER(sampler_SpecularColorMap);
TEXTURE2D(_TransmittanceColorMap);
SAMPLER(sampler_TransmittanceColorMap);
#else
// Set of users variables
#define PROP_DECL(type, name) type name##0, name##1, name##2, name##3
// sampler are share by texture type inside a layered material but we need to support that a particualr layer have no texture, so we take the first sampler of available texture as the share one
// mean we must declare all sampler
#define PROP_DECL_TEX2D(name)\
TEXTURE2D(MERGE_NAME(name, 0)); \
SAMPLER(MERGE_NAME(MERGE_NAME(sampler, name), 0)); \
TEXTURE2D(MERGE_NAME(name, 1)); \
SAMPLER(MERGE_NAME(MERGE_NAME(sampler, name), 1)); \
TEXTURE2D(MERGE_NAME(name, 2)); \
SAMPLER(MERGE_NAME(MERGE_NAME(sampler, name), 2)); \
TEXTURE2D(MERGE_NAME(name, 3)); \
SAMPLER(MERGE_NAME(MERGE_NAME(sampler, name), 3))
PROP_DECL_TEX2D(_BaseColorMap);
PROP_DECL_TEX2D(_MaskMap);
PROP_DECL_TEX2D(_BentNormalMap);
PROP_DECL_TEX2D(_NormalMap);
PROP_DECL_TEX2D(_NormalMapOS);
PROP_DECL_TEX2D(_DetailMap);
PROP_DECL_TEX2D(_HeightMap);
PROP_DECL_TEX2D(_SubsurfaceMaskMap);
PROP_DECL_TEX2D(_ThicknessMap);
TEXTURE2D(_LayerMaskMap);
SAMPLER(sampler_LayerMaskMap);
TEXTURE2D(_LayerInfluenceMaskMap);
SAMPLER(sampler_LayerInfluenceMaskMap);
#endif
CBUFFER_START(UnityPerMaterial)
// shared constant between lit and layered lit
float _AlphaCutoff;
float _AlphaCutoffPrepass;
float _AlphaCutoffPostpass;
float4 _DoubleSidedConstants;
float _DistortionScale;
float _DistortionVectorScale;
float _DistortionVectorBias;
float _DistortionBlurScale;
float _DistortionBlurRemapMin;
float _DistortionBlurRemapMax;
float _PPDMaxSamples;
float _PPDMinSamples;
float _PPDLodThreshold;
float3 _EmissiveColor;
float _EmissiveIntensity;
float _AlbedoAffectEmissive;
float _EnableSpecularOcclusion;
// Transparency
float3 _TransmittanceColor;
float _IOR;
float _ATDistance;
float _ThicknessMultiplier;
// Caution: C# code in BaseLitUI.cs call LightmapEmissionFlagsProperty() which assume that there is an existing "_EmissionColor"
// value that exist to identify if the GI emission need to be enabled.
// In our case we don't use such a mechanism but need to keep the code quiet. We declare the value and always enable it.
// TODO: Fix the code in legacy unity so we can customize the beahvior for GI
float3 _EmissionColor;
float4 _EmissiveColorMap_ST;
float _TexWorldScaleEmissive;
float4 _UVMappingMaskEmissive;
float4 _InvPrimScale; // Only XY are used
// Wind
float _InitialBend;
float _Stiffness;
float _Drag;
float _ShiverDrag;
float _ShiverDirectionality;
#ifndef LAYERED_LIT_SHADER
// Set of users variables
float4 _BaseColor;
float4 _BaseColorMap_ST;
float4 _BaseColorMap_TexelSize;
float _Metallic;
float _Smoothness;
float _SmoothnessRemapMin;
float _SmoothnessRemapMax;
float _AORemapMin;
float _AORemapMax;
float _NormalScale;
float4 _DetailMap_ST;
float _DetailAlbedoScale;
float _DetailNormalScale;
float _DetailSmoothnessScale;
float4 _HeightMap_TexelSize; // Unity facility. This will provide the size of the heightmap to the shader
float _HeightAmplitude;
float _HeightCenter;
float _Anisotropy;
int _DiffusionProfile;
float _SubsurfaceMask;
float _Thickness;
float4 _ThicknessRemap;
float _CoatMask;
float4 _SpecularColor;
float _TexWorldScale;
float _InvTilingScale;
float4 _UVMappingMask;
float4 _UVDetailsMappingMask;
float _LinkDetailsWithBase;
#else // LAYERED_LIT_SHADER
// Set of users variables
PROP_DECL(float4, _BaseColor);
float4 _BaseColorMap0_ST;
float4 _BaseColorMap1_ST;
float4 _BaseColorMap2_ST;
float4 _BaseColorMap3_ST;
float _Metallic;
float _Smoothness;
float _SmoothnessRemapMin;
float _SmoothnessRemapMax;
float _AORemapMin;
float _AORemapMax;
float _NormalScale;
float4 _DetailMap_ST;
float _DetailAlbedoScale;
float _DetailNormalScale;
float _DetailSmoothnessScale;
float4 _HeightMap_TexelSize; // Unity facility. This will provide the size of the heightmap to the shader
float _HeightAmplitude;
float _HeightCenter;
float _Anisotropy;
int _DiffusionProfile;
float _SubsurfaceMask;
float _Thickness;
float4 _ThicknessRemap;
float _CoatMask;
float4 _SpecularColor;
float _TexWorldScale;
float _InvTilingScale;
float4 _UVMappingMask;
float4 _UVDetailsMappingMask;
float _LinkDetailsWithBase;
#else // LAYERED_LIT_SHADER
// Set of users variables
PROP_DECL(float4, _BaseColor);
float4 _BaseColorMap0_ST;
float4 _BaseColorMap1_ST;
float4 _BaseColorMap2_ST;
float4 _BaseColorMap3_ST;
PROP_DECL(float, _Metallic);
PROP_DECL(float, _Smoothness);
PROP_DECL(float, _SmoothnessRemapMin);
PROP_DECL(float, _SmoothnessRemapMax);
PROP_DECL(float, _AORemapMin);
PROP_DECL(float, _AORemapMax);
PROP_DECL(float, _NormalScale);
float4 _NormalMap0_TexelSize; // Unity facility. This will provide the size of the base normal to the shader
float4 _HeightMap0_TexelSize;
float4 _HeightMap1_TexelSize;
float4 _HeightMap2_TexelSize;
float4 _HeightMap3_TexelSize;
float4 _DetailMap0_ST;
float4 _DetailMap1_ST;
float4 _DetailMap2_ST;
float4 _DetailMap3_ST;
PROP_DECL(float, _UVDetail);
PROP_DECL(float, _DetailAlbedoScale);
PROP_DECL(float, _DetailNormalScale);
PROP_DECL(float, _DetailSmoothnessScale);
PROP_DECL(float, _HeightAmplitude);
PROP_DECL(float, _HeightCenter);
PROP_DECL(int, _DiffusionProfile);
PROP_DECL(float, _SubsurfaceMask);
PROP_DECL(float, _Thickness);
PROP_DECL(float4, _ThicknessRemap);
PROP_DECL(float, _OpacityAsDensity);
float _InheritBaseNormal1;
float _InheritBaseNormal2;
float _InheritBaseNormal3;
float _InheritBaseHeight1;
float _InheritBaseHeight2;
float _InheritBaseHeight3;
float _InheritBaseColor1;
float _InheritBaseColor2;
float _InheritBaseColor3;
PROP_DECL(float, _HeightOffset);
float _HeightTransition;
float4 _LayerMaskMap_ST;
float _TexWorldScaleBlendMask;
PROP_DECL(float, _TexWorldScale);
PROP_DECL(float, _InvTilingScale);
float4 _UVMappingMaskBlendMask;
PROP_DECL(float4, _UVMappingMask);
PROP_DECL(float4, _UVDetailsMappingMask);
PROP_DECL(float, _LinkDetailsWithBase);
#endif // LAYERED_LIT_SHADER
// Tessellation specific
#ifdef TESSELLATION_ON
float _TessellationFactor;
float _TessellationFactorMinDistance;
float _TessellationFactorMaxDistance;
float _TessellationFactorTriangleSize;
float _TessellationShapeFactor;
float _TessellationBackFaceCullEpsilon;
float _TessellationObjectScale;
float _TessellationTilingScale;
#endif
CBUFFER_END
PROP_DECL(float, _Metallic);
PROP_DECL(float, _Smoothness);
PROP_DECL(float, _SmoothnessRemapMin);
PROP_DECL(float, _SmoothnessRemapMax);
PROP_DECL(float, _AORemapMin);
PROP_DECL(float, _AORemapMax);
PROP_DECL(float, _NormalScale);
float4 _NormalMap0_TexelSize; // Unity facility. This will provide the size of the base normal to the shader
float4 _HeightMap0_TexelSize;
float4 _HeightMap1_TexelSize;
float4 _HeightMap2_TexelSize;
float4 _HeightMap3_TexelSize;
float4 _DetailMap0_ST;
float4 _DetailMap1_ST;
float4 _DetailMap2_ST;
float4 _DetailMap3_ST;
PROP_DECL(float, _UVDetail);
PROP_DECL(float, _DetailAlbedoScale);
PROP_DECL(float, _DetailNormalScale);
PROP_DECL(float, _DetailSmoothnessScale);
PROP_DECL(float, _HeightAmplitude);
PROP_DECL(float, _HeightCenter);
PROP_DECL(int, _DiffusionProfile);
PROP_DECL(float, _SubsurfaceMask);
PROP_DECL(float, _Thickness);
PROP_DECL(float4, _ThicknessRemap);
PROP_DECL(float, _OpacityAsDensity);
float _InheritBaseNormal1;
float _InheritBaseNormal2;
float _InheritBaseNormal3;
float _InheritBaseHeight1;
float _InheritBaseHeight2;
float _InheritBaseHeight3;
float _InheritBaseColor1;
float _InheritBaseColor2;
float _InheritBaseColor3;
PROP_DECL(float, _HeightOffset);
float _HeightTransition;
float4 _LayerMaskMap_ST;
float _TexWorldScaleBlendMask;
PROP_DECL(float, _TexWorldScale);
PROP_DECL(float, _InvTilingScale);
float4 _UVMappingMaskBlendMask;
PROP_DECL(float4, _UVMappingMask);
PROP_DECL(float4, _UVDetailsMappingMask);
PROP_DECL(float, _LinkDetailsWithBase);
#endif // LAYERED_LIT_SHADER
// Tessellation specific
#ifdef TESSELLATION_ON
float _TessellationFactor;
float _TessellationFactorMinDistance;
float _TessellationFactorMaxDistance;
float _TessellationFactorTriangleSize;
float _TessellationShapeFactor;
float _TessellationBackFaceCullEpsilon;
float _TessellationObjectScale;
float _TessellationTilingScale;
#endif
CBUFFER_END

8
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/Lit/LitTessellation.shader


[Enum(UV0, 0, UV1, 1, UV2, 2, UV3, 3)] _UVDetail("UV Set for detail", Float) = 0
[HideInInspector] _UVDetailsMappingMask("_UVDetailsMappingMask", Color) = (1, 0, 0, 0)
[ToggleOff] _LinkDetailsWithBase("LinkDetailsWithBase", Float) = 1.0
[Enum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Planar, 4, Triplanar, 5)] _UVEmissive("UV Set for emissive", Float) = 0
_TexWorldScaleEmissive("Scale to apply on world coordinate", Float) = 1.0
[HideInInspector] _UVMappingMaskEmissive("_UVMappingMaskEmissive", Color) = (1, 0, 0, 0)
// Wind
[ToggleOff] _EnableWind("Enable Wind", Float) = 0.0

#pragma shader_feature _ _TESSELLATION_PHONG
#pragma shader_feature _ _REFRACTION_PLANE _REFRACTION_SPHERE
#pragma shader_feature _ _EMISSIVE_MAPPING_PLANAR _EMISSIVE_MAPPING_TRIPLANAR
#pragma shader_feature _ _MAPPING_PLANAR _MAPPING_TRIPLANAR
#pragma shader_feature _NORMALMAP_TANGENT_SPACE
#pragma shader_feature _ _REQUIRE_UV2 _REQUIRE_UV3

// enable dithering LOD crossfade
#pragma multi_compile _ LOD_FADE_CROSSFADE
//enable GPU instancing support
#pragma multi_compile_instancing
//-------------------------------------------------------------------------------------
// Define

3
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/Unlit/Unlit.shader


#pragma shader_feature _ _BLENDMODE_ALPHA _BLENDMODE_ADD _BLENDMODE_PRE_MULTIPLY
#pragma shader_feature _ENABLE_FOG_ON_TRANSPARENT
//enable GPU instancing support
#pragma multi_compile_instancing
//-------------------------------------------------------------------------------------
// Define
//-------------------------------------------------------------------------------------

3
ScriptableRenderPipeline/HDRenderPipeline/HDRP/ShaderPass/ShaderPassLightTransport.hlsl


{
VaryingsToPS output;
UNITY_SETUP_INSTANCE_ID(inputMesh);
UNITY_TRANSFER_INSTANCE_ID(inputMesh, output);
// Output UV coordinate in vertex shader
float2 uv;

23
ScriptableRenderPipeline/HDRenderPipeline/HDRP/ShaderPass/VaryingMesh.hlsl


#ifdef ATTRIBUTES_NEED_COLOR
float4 color : COLOR;
#endif
// UNITY_INSTANCE_ID
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct VaryingsMeshToPS

#ifdef VARYINGS_NEED_COLOR
float4 color;
#endif
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct PackedVaryingsMeshToPS

#if defined(VARYINGS_NEED_CULLFACE) && SHADER_STAGE_FRAGMENT
FRONT_FACE_TYPE cullFace : FRONT_FACE_SEMANTIC;
#endif
UNITY_VERTEX_INPUT_INSTANCE_ID
};
// Functions to pack data to use as few interpolator as possible, the ShaderGraph should generate these functions

UNITY_TRANSFER_INSTANCE_ID(input, output);
output.positionCS = input.positionCS;
#ifdef VARYINGS_NEED_POSITION_WS

FragInputs output;
ZERO_INITIALIZE(FragInputs, output);
UNITY_SETUP_INSTANCE_ID(input);
// Init to some default value to make the computer quiet (else it output "divide by zero" warning even if value is not used).
// TODO: this is a really poor workaround, but the variable is used in a bunch of places
// to compute normals which are then passed on elsewhere to compute other values...

#ifdef VARYINGS_DS_NEED_COLOR
float4 color;
#endif
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct PackedVaryingsMeshToDS

#ifdef VARYINGS_DS_NEED_COLOR
float4 interpolators5 : TEXCOORD2;
#endif
UNITY_VERTEX_INPUT_INSTANCE_ID
};
// Functions to pack data to use as few interpolator as possible, the ShaderGraph should generate these functions

UNITY_TRANSFER_INSTANCE_ID(input, output)
output.interpolators0 = input.positionWS;
output.interpolators1 = input.normalWS;
#ifdef VARYINGS_DS_NEED_TANGENT

VaryingsMeshToDS UnpackVaryingsMeshToDS(PackedVaryingsMeshToDS input)
{
VaryingsMeshToDS output;
UNITY_TRANSFER_INSTANCE_ID(input, output)
output.positionWS = input.interpolators0;
output.normalWS = input.interpolators1;

VaryingsMeshToDS InterpolateWithBaryCoordsMeshToDS(VaryingsMeshToDS input0, VaryingsMeshToDS input1, VaryingsMeshToDS input2, float3 baryCoords)
{
VaryingsMeshToDS ouput;
UNITY_TRANSFER_INSTANCE_ID(input0, output)
TESSELLATION_INTERPOLATE_BARY(positionWS, baryCoords);
TESSELLATION_INTERPOLATE_BARY(normalWS, baryCoords);

6
ScriptableRenderPipeline/HDRenderPipeline/HDRP/ShaderPass/VertMesh.hlsl


{
VaryingsMeshType output;
UNITY_SETUP_INSTANCE_ID(input);
UNITY_TRANSFER_INSTANCE_ID(input, output);
float3 positionWS = TransformObjectToWorld(input.positionOS);
#ifdef ATTRIBUTES_NEED_NORMAL
float3 normalWS = TransformObjectToWorldNormal(input.normalOS);

VaryingsMeshToPS VertMeshTesselation(VaryingsMeshToDS input)
{
VaryingsMeshToPS output;
UNITY_SETUP_INSTANCE_ID(input);
UNITY_TRANSFER_INSTANCE_ID(input, output);
output.positionCS = TransformWorldToHClip(input.positionWS);

2
ScriptableRenderPipeline/HDRenderPipeline/HDRP/ShaderVariables.hlsl


#include "ShaderVariablesMatrixDefsHDCamera.hlsl"
#endif
#include "CoreRP/ShaderLibrary/UnityInstancing.hlsl"
#include "ShaderVariablesFunctions.hlsl"
#endif // UNITY_SHADER_VARIABLES_INCLUDED

2
ScriptableRenderPipeline/LightweightPipeline/LWRP/Shaders/LightweightStandardTerrain.shader


#endif
half3 indirectDiffuse = half3(0, 0, 0);
#if LIGHTMAP_ON
#ifdef LIGHTMAP_ON
indirectDiffuse = SampleLightmap(IN.uvControlAndLM.zw, normalWS);
#endif

2
Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/CommonAssets/3DObjects/CornelBox/Cornell Box.fbx.meta


2186277476908879420: ImportLogs
2186277476908879422: ImportLogs
2186277476908879424: ImportLogs
2186277476908879426: ImportLogs
2186277476908879428: ImportLogs
externalObjects:
- first:
type: UnityEngine:Material

2
Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/CommonAssets/3DObjects/Sphere/Sphere.fbx.meta


2186277476908879422: ImportLogs
2186277476908879424: ImportLogs
2186277476908879426: ImportLogs
2186277476908879428: ImportLogs
2186277476908879430: ImportLogs
externalObjects: {}
materials:
importMaterials: 0

186
Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/3xxx_DebugView/3002_ObjectMotionVector.unity


m_Script: {fileID: 11500000, guid: c413a5df32c4fec4eb320c4465678193, type: 3}
m_Name:
m_EditorClassIdentifier:
localSpace: 0
fps: 60
--- !u!23 &12769661
MeshRenderer:
m_ObjectHideFlags: 0

m_Father: {fileID: 0}
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &29872219
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 29872223}
- component: {fileID: 29872222}
- component: {fileID: 29872221}
- component: {fileID: 29872220}
m_Layer: 0
m_Name: Rotate
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &29872220
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 29872219}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 14d7896b83927c247821fa13f452106f, type: 3}
m_Name:
m_EditorClassIdentifier:
localSpace: 0
angles: {x: 0, y: 0, z: 90}
frequency: 5
fps: 60
--- !u!23 &29872221
MeshRenderer:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 29872219}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 4294967295
m_Materials:
- {fileID: 2100000, guid: 051804eacb0bc2144a9e96128a428a15, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!33 &29872222
MeshFilter:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 29872219}
m_Mesh: {fileID: 4300000, guid: b32e17769a31e9c4c8b3176dcb04dea9, type: 3}
--- !u!4 &29872223
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 29872219}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -2.5, y: -3, z: 0}
m_LocalScale: {x: 2, y: 1.9999996, z: 1.9999996}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 7
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &176131434
GameObject:
m_ObjectHideFlags: 0

m_Script: {fileID: 11500000, guid: c413a5df32c4fec4eb320c4465678193, type: 3}
m_Name:
m_EditorClassIdentifier:
localSpace: 0
fps: 60
--- !u!23 &176131436
MeshRenderer:
m_ObjectHideFlags: 0

m_Father: {fileID: 0}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &764440502
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 764440506}
- component: {fileID: 764440505}
- component: {fileID: 764440504}
- component: {fileID: 764440503}
m_Layer: 0
m_Name: Scale
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &764440503
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 764440502}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 382c9a87993196d4596a688b68b60221, type: 3}
m_Name:
m_EditorClassIdentifier:
min: {x: 1.5, y: 1.5, z: 1.5}
max: {x: 3, y: 3, z: 3}
frequency: 5
fps: 60
--- !u!23 &764440504
MeshRenderer:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 764440502}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 4294967295
m_Materials:
- {fileID: 2100000, guid: 051804eacb0bc2144a9e96128a428a15, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!33 &764440505
MeshFilter:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 764440502}
m_Mesh: {fileID: 4300000, guid: b32e17769a31e9c4c8b3176dcb04dea9, type: 3}
--- !u!4 &764440506
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 764440502}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -7, y: -3, z: 0}
m_LocalScale: {x: 2, y: 1.9999996, z: 1.9999996}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 6
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1243403287
GameObject:
m_ObjectHideFlags: 0

m_Script: {fileID: 11500000, guid: c413a5df32c4fec4eb320c4465678193, type: 3}
m_Name:
m_EditorClassIdentifier:
localSpace: 0
fps: 60
--- !u!23 &1243403289
MeshRenderer:
m_ObjectHideFlags: 0

m_Script: {fileID: 11500000, guid: a9ad82d3a5300af40a7a6a9927907436, type: 3}
m_Name:
m_EditorClassIdentifier:
settingType: 1
gBuffer: 0
fullScreenDebugMode: 9
--- !u!4 &1962206527
Transform:

- target: {fileID: 114733060649624252, guid: c07ace9ab142ca9469fa377877c2f1e7,
type: 2}
propertyPath: waitForFrames
value: 15
value: 29
objectReference: {fileID: 0}
- target: {fileID: 114733060649624252, guid: c07ace9ab142ca9469fa377877c2f1e7,
type: 2}

9
Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/EditorPlayModeTests.asset


m_Name: EditorPlayModeTests
m_EditorClassIdentifier:
scenesPath:
- Assets/Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/3xxx_DebugView/3002_ObjectMotionVector.unity
- 3xxx_DebugView/3002_ObjectMotionVector.unity
- 3xxx_DebugView/3003_CameraMotionVector_TranslateX.unity
- 3xxx_DebugView/3004_CameraMotionVector_TranslateY.unity
- 3xxx_DebugView/3005_CameraMotionVector_TranslateZ.unity
- 3xxx_DebugView/3006_CameraMotionVector_RotateX.unity
- 3xxx_DebugView/3007_CameraMotionVector_RotateY.unity
- 3xxx_DebugView/3008_CameraMotionVector_RotateZ.unity
- 3xxx_DebugView/3009_CameraMotionVector_FOV.unity

5
Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Assets/CommonAssets/Cornell Box.fbx.meta


fileFormatVersion: 2
guid: b56f0b54c8a1042f3ae9a8904a576f5d
timeCreated: 1493308431
licenseType: Pro
ModelImporter:
serializedVersion: 22
fileIDToRecycleName:

4300000: Cornell Box
7400000: Take 001
9500000: //RootNode
2186277476908879412: ImportLogs
2186277476908879414: ImportLogs
externalObjects:
- first:
type: UnityEngine:Material

animationRetargetingWarnings:
animationDoRetargetingWarnings: 0
importAnimatedCustomProperties: 0
importConstraints: 0
animationCompression: 1
animationRotationError: 0.5
animationPositionError: 0.5

3
Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/040_UpgradeScene/Models/Environment/Floor.fbx.meta


4300026: SmallPlank
7400000: Take 001
9500000: //RootNode
2186277476908879412: ImportLogs
2186277476908879414: ImportLogs
externalObjects:
- first:
type: UnityEngine:Material

animationRetargetingWarnings:
animationDoRetargetingWarnings: 0
importAnimatedCustomProperties: 0
importConstraints: 0
animationCompression: 1
animationRotationError: 0.5
animationPositionError: 0.5

11
Tests/Scripts/Editor.meta


fileFormatVersion: 2
guid: 0f6887a1ff514ed690ada3786867d216
timeCreated: 1512986333
fileFormatVersion: 2
guid: 2ea8802fb7f2fa641a567a661fb6a58e
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

14
Tests/Scripts/Editor/GraphicTests/Framework/EditorPlayModeTests_Editor.cs


using UnityEngine;
using UnityEditor;
using System;
using System.IO;
[DisallowMultipleComponent]
[CustomEditor(typeof(EditorPlayModeTests))]
class EditorPlayModeTests_Editor : Editor
{

if (newScene != null)
{
string newPath = AssetDatabase.GetAssetPath(newScene);
Debug.Log("New Path : " + newPath);
string listPath = AssetDatabase.GetAssetPath(target);
listPath = listPath.Remove(listPath.Length - 25, 25);
//Debug.Log("List path: " + listPath);
// Get scene path relative to the list file
newPath = newPath.Replace(listPath, "");
//Debug.Log("New Path : " + newPath);
if (newPath.EndsWith("unity"))
{
Debug.Log("Add the scene to the list");

11
Tests/Scripts/Editor/GraphicTests/Framework/TestFramework.cs


yield return null;
}
// Handle play mode and things to do before
if (testSetup.testInPlayMode)
{
//if (!testSetup.invokeAtStart) testSetup.thingToDoBeforeTest.Invoke();
//EditorApplication.isPlaying = true;
}
else
{
testSetup.thingToDoBeforeTest.Invoke();
}
testSetup.thingToDoBeforeTest.Invoke();
// Render the camera
Texture2D captured = TestFrameworkTools.RenderSetupToTexture(testSetup);

14
Tests/Scripts/GraphicTests/Framework/SetupSceneForRenderPipelineTest.cs


public UnityEvent thingToDoBeforeTest;
[Header("Run Play Mode for test")]
public bool testInPlayMode = false;
public bool invokeAtStart = true;
public IEnumerator Start()
{
// Wait for other things to happend, in particular allow for the render pipeline to reset
yield return new WaitForEndOfFrame();
if (invokeAtStart) thingToDoBeforeTest.Invoke();
if (!testInPlayMode) _readyForCapture = true;
Time.captureFramerate = forcedFrameRate;
}
public void Update()
{

34
Tests/Scripts/GraphicTests/Framework/TestFrameworkPlayMode.cs


using System.IO;
using System.Linq;
public class GraphicTestsPlayMode : IPrebuildSetup, IPostBuildCleanup
public class GraphicTestsPlayMode : IPrebuildSetup
{
public virtual string pipelineID { get { return "NoPipeline"; } }

Debug.Log("Setup for the test");
#if UNITY_EDITOR
oldScenes = UnityEditor.EditorBuildSettings.scenes;

#endif
}
[OneTimeTearDown]
//UnityEditor.EditorBuildSettings.scenes = oldScenes;
UnityEditor.EditorBuildSettings.scenes = oldScenes;
//public IEnumerator TestScene([ValueSource(typeof(TestFrameworkTools.CollectScenesPlayMode), "HDRP")]TestFrameworkTools.TestInfo testInfo)
string prjRelativeGraphsPath;
string filePath;
var prjRelativeGraphsPath = TestFrameworkTools.s_Path.Aggregate(TestFrameworkTools.s_RootPath, Path.Combine);
var filePath = Path.Combine(prjRelativeGraphsPath, testInfo.relativePath);
prjRelativeGraphsPath = TestFrameworkTools.s_Path.Aggregate(TestFrameworkTools.s_RootPath, Path.Combine);
filePath = Path.Combine(prjRelativeGraphsPath, testInfo.relativePath);
UnityEngine.SceneManagement.SceneManager.LoadScene( testInfo.relativePath , UnityEngine.SceneManagement.LoadSceneMode.Single);
UnityEngine.SceneManagement.SceneManager.LoadScene( testInfo.sceneListIndex , UnityEngine.SceneManagement.LoadSceneMode.Single);
//Assert.IsNotNull(testSetup, "No SetupSceneForRenderPipelineTest in scene " + testInfo.name);
//Assert.IsNotNull(testSetup.cameraToUse, "No configured camera in <SetupSceneForRenderPipelineTest>");
Time.captureFramerate = testSetup.forcedFrameRate;
// Initialize
testSetup.Setup();

var oldTarget = testSetup.cameraToUse.targetTexture;
testSetup.cameraToUse.targetTexture = tempTarget;
while (!testSetup.IsTestFinished) yield return null;
// Pause
float prevTimeScale = Time.timeScale;
Time.timeScale = 0f;
for (int f = 0; f < testSetup.waitForFrames; ++f) yield return null;
// render the scene

var captured = new Texture2D(tempTarget.width, tempTarget.height, TextureFormat.RGB24, false);
captured.ReadPixels(new Rect(0, 0, testSetup.width, testSetup.height), 0, 0);
RenderTexture.active = oldActive;
//Unpause
Time.timeScale = prevTimeScale;
// Load the template
Texture2D fromDisk = new Texture2D(2, 2);

35
Tests/Scripts/GraphicTests/Framework/TestFrameworkTools.cs


public static Dictionary<string, string> renderPipelineScenesFolder = new Dictionary<string, string>()
{
{ "HDRP", "HDRenderPipeline/Scenes" },
{ "LWRP", "LightweightPipeline" }
{ "LWRP", "LightweightPipeline/Scenes" }
};
// info that gets generated for use

public string relativePath;
public string templatePath;
public int frameWait;
public int sceneListIndex;
public override string ToString()
{

List<string> allPaths_List = new List<string>(allPaths);
allPaths_List.Sort();
// Get the play mode scenes
List<string> playModeScenes = new List<string>();
foreach( TestInfo ti in CollectScenesPlayMode.GetScenesForPipeline( _pipelinePath ) )
{
playModeScenes.Add(ti.templatePath);
}
// construct all the needed test infos
for (int i = 0; i < allPaths_List.Count; ++i)
{

var split = s_Path.Aggregate("", Path.Combine);
split = string.Format("{0}{1}", split, Path.DirectorySeparatorChar);
var splitPaths = p.FullName.Split(new[] { split }, StringSplitOptions.RemoveEmptyEntries);
// Filter out play mode tests from the list
if (playModeScenes.Contains(splitPaths.Last()))
continue;
TestInfo testInfo = new TestInfo()
{

public static IEnumerable GetScenesForPipeline(string _pipelinePath, bool fixtureParam = false)
{
#if UNITY_EDITOR
var absoluteScenesPath = s_Path.Aggregate("Assets", Path.Combine);
string absoluteScenesPath = s_Path.Aggregate(s_RootPath, Path.Combine);
string assetScenesPath = absoluteScenesPath.Replace(Application.dataPath, "");
assetScenesPath = Path.Combine("Assets", assetScenesPath.Remove(0, 1));
var filesPath = Path.Combine(absoluteScenesPath, _pipelinePath);
string filesPath = Path.Combine(assetScenesPath, _pipelinePath);
string listFilePath = Path.Combine(filesPath, "EditorPlayModeTests.asset");

AssetDatabase.CreateAsset(ScriptableObject.CreateInstance<EditorPlayModeTests>(), listFilePath);
AssetDatabase.Refresh();
foreach (string path in listFile.scenesPath)
for ( int i=0 ; i<listFile.scenesPath.Length ; ++i)
var p = new FileInfo(path);
string path = listFile.scenesPath[i];
var p = new FileInfo( Path.Combine(filesPath, path ) );
var split = s_Path.Aggregate("", Path.Combine);
split = string.Format("{0}{1}", split, Path.DirectorySeparatorChar);
var splitPaths = p.FullName.Split(new[] { split }, StringSplitOptions.RemoveEmptyEntries);

name = p.Name,
relativePath = path,
relativePath = p.ToString(),
frameWait = 100
frameWait = 100,
sceneListIndex = i
};
if (fixtureParam)

24
Tests/Scripts/GraphicTests/HDRenderPipeline/DebugViewController.cs


public class DebugViewController : MonoBehaviour
{
[SerializeField] FullScreenDebugMode fullScreenDebugMode = FullScreenDebugMode.None;
public enum SettingType { Material, Rendering }
public SettingType settingType = SettingType.Material;
MaterialDebugSettings materialDebugSettings = new MaterialDebugSettings();
[Header("Material")]
[SerializeField] int gBuffer = 0;
//DebugItemHandlerIntEnum(MaterialDebugSettings.debugViewMaterialGBufferStrings, MaterialDebugSettings.debugViewMaterialGBufferValues)
[Header("Rendering")]
[SerializeField] int fullScreenDebugMode = 0;
hdPipeline.debugDisplaySettings.fullScreenDebugMode = fullScreenDebugMode;
switch ( settingType )
{
case SettingType.Material:
hdPipeline.debugDisplaySettings.SetDebugViewGBuffer(gBuffer);
hdPipeline.debugDisplaySettings.fullScreenDebugMode = FullScreenDebugMode.None;
break;
case SettingType.Rendering:
hdPipeline.debugDisplaySettings.SetDebugViewGBuffer(0);
hdPipeline.debugDisplaySettings.fullScreenDebugMode = (FullScreenDebugMode) fullScreenDebugMode;
break;
}
}
}

3
Tests/ShaderGeneratorTests.meta


fileFormatVersion: 2
guid: 552442937a683d2479830866e050b035
folderAsset: yes
timeCreated: 1474988761
licenseType: Pro
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

2
Tests/Scripts/GraphicTests/HDRenderPipeline/SinMove.cs.meta


fileFormatVersion: 2
guid: c413a5df32c4fec4eb320c4465678193
guid: 9311bd511d7afc04b95779ad6b218383
MonoImporter:
externalObjects: {}
serializedVersion: 2

5
Tests/Scripts/GraphicTests/HDRenderPipeline/SinMove.cs


public class SinMove : MonoBehaviour
{
[SerializeField] bool localSpace = false;
[SerializeField] float fps = 60;
Vector3 startPosition = Vector3.zero;

// Update is called once per frame
void Update ()
{
transform.position = startPosition + Mathf.Sin(Mathf.PI * Time.time * frequency) * vector;
transform.position = startPosition + Mathf.Sin(Mathf.PI * frequency * Time.frameCount / fps) * (localSpace?transform.TransformDirection(vector):vector);
}
}

744
ImageTemplates/HDRenderPipeline/Scenes/3xxx_DebugView/3003_CameraMotionVector_TranslateX.unity.png

之前 之后
宽度: 853  |  高度: 480  |  大小: 137 KiB

83
ImageTemplates/HDRenderPipeline/Scenes/3xxx_DebugView/3003_CameraMotionVector_TranslateX.unity.png.meta


fileFormatVersion: 2
guid: 196a05a9d25c75c41a5488213c68d68e
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 5
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -1
wrapU: -1
wrapV: -1
wrapW: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 2
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
vertices: []
indices:
edges: []
weights: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:

465
ImageTemplates/HDRenderPipeline/Scenes/3xxx_DebugView/3004_CameraMotionVector_TranslateY.unity.png

之前 之后
宽度: 853  |  高度: 480  |  大小: 135 KiB

83
ImageTemplates/HDRenderPipeline/Scenes/3xxx_DebugView/3004_CameraMotionVector_TranslateY.unity.png.meta


fileFormatVersion: 2
guid: 711363d4f145852418f72baec6c6b120
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 5
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -1
wrapU: -1
wrapV: -1
wrapW: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 2
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
vertices: []
indices:
edges: []
weights: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:

1001
ImageTemplates/HDRenderPipeline/Scenes/3xxx_DebugView/3005_CameraMotionVector_TranslateZ.unity.png
文件差异内容过多而无法显示
查看文件

83
ImageTemplates/HDRenderPipeline/Scenes/3xxx_DebugView/3005_CameraMotionVector_TranslateZ.unity.png.meta


fileFormatVersion: 2
guid: e7ea4bdd6b2d99447b094c1a32dfae02
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 5
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -1
wrapU: -1
wrapV: -1
wrapW: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 2
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
vertices: []
indices:
edges: []
weights: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:

902
ImageTemplates/HDRenderPipeline/Scenes/3xxx_DebugView/3006_CameraMotionVector_RotateX.unity.png

之前 之后
宽度: 853  |  高度: 480  |  大小: 253 KiB

83
ImageTemplates/HDRenderPipeline/Scenes/3xxx_DebugView/3006_CameraMotionVector_RotateX.unity.png.meta


fileFormatVersion: 2
guid: a97bb246a85dc1846bedbd03effb6e31
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 5
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -1
wrapU: -1
wrapV: -1
wrapW: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 2
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
vertices: []
indices:
edges: []
weights: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:

956
ImageTemplates/HDRenderPipeline/Scenes/3xxx_DebugView/3007_CameraMotionVector_RotateY.unity.png

之前 之后
宽度: 853  |  高度: 480  |  大小: 256 KiB

83
ImageTemplates/HDRenderPipeline/Scenes/3xxx_DebugView/3007_CameraMotionVector_RotateY.unity.png.meta


fileFormatVersion: 2
guid: 628c41c6730a1474586fa02455196702
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 5
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -1
wrapU: -1
wrapV: -1
wrapW: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 2
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
vertices: []
indices:
edges: []
weights: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:

1001
ImageTemplates/HDRenderPipeline/Scenes/3xxx_DebugView/3008_CameraMotionVector_RotateZ.unity.png
文件差异内容过多而无法显示
查看文件

83
ImageTemplates/HDRenderPipeline/Scenes/3xxx_DebugView/3008_CameraMotionVector_RotateZ.unity.png.meta


fileFormatVersion: 2
guid: fcc5dfdf493e3ec47b7e16102e643933
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 5
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -1
wrapU: -1
wrapV: -1
wrapW: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 2
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
vertices: []
indices:
edges: []
weights: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:

1001
ImageTemplates/HDRenderPipeline/Scenes/3xxx_DebugView/3009_CameraMotionVector_FOV.unity.png
文件差异内容过多而无法显示
查看文件

83
ImageTemplates/HDRenderPipeline/Scenes/3xxx_DebugView/3009_CameraMotionVector_FOV.unity.png.meta


fileFormatVersion: 2
guid: ce4af9e4bd53bea4c8e0dcc1ed4d77d0
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 5
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -1
wrapU: -1
wrapV: -1
wrapW: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 2
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
vertices: []
indices:
edges: []
weights: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:

342
ScriptableRenderPipeline/Core/CoreRP/ShaderLibrary/UnityInstancing.hlsl


#ifndef UNITY_INSTANCING_INCLUDED
#define UNITY_INSTANCING_INCLUDED
#ifndef UNITY_SHADER_VARIABLES_INCLUDED
// We will redefine some built-in shader params e.g. unity_ObjectToWorld and unity_WorldToObject.
#error "Please include ShaderVariables.hlsl first."
#endif
#if SHADER_TARGET >= 35 && (defined(SHADER_API_D3D11) || defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE) || defined(SHADER_API_XBOXONE) || defined(SHADER_API_PSSL) || defined(SHADER_API_VULKAN) || defined(SHADER_API_METAL))
#define UNITY_SUPPORT_INSTANCING
#endif
#if defined(SHADER_API_SWITCH)
#define UNITY_SUPPORT_INSTANCING
#endif
#if defined(SHADER_API_D3D11)
#define UNITY_SUPPORT_STEREO_INSTANCING
#endif
#if defined(SHADER_API_D3D11) || defined(SHADER_API_GLCORE) || defined(SHADER_API_GLES3) || defined(SHADER_API_VULKAN) || defined(SHADER_API_XBOXONE) || defined(SHADER_API_PSSL) || defined(SHADER_API_METAL) || defined(SHADER_API_SWITCH)
#define UNITY_INSTANCING_AOS
#endif
// These platforms support dynamically adjusting the instancing CB size according to the current batch.
#if defined(SHADER_API_D3D11) || defined(SHADER_API_GLCORE) || defined(SHADER_API_GLES3) || defined(SHADER_API_METAL) || defined(SHADER_API_PSSL) || defined(SHADER_API_VULKAN)
#define UNITY_INSTANCING_SUPPORT_FLEXIBLE_ARRAY_SIZE
#endif
#if defined(SHADER_TARGET_SURFACE_ANALYSIS) && defined(UNITY_SUPPORT_INSTANCING)
#undef UNITY_SUPPORT_INSTANCING
#endif
////////////////////////////////////////////////////////
// instancing paths
// - UNITY_INSTANCING_ENABLED Defined if instancing path is taken.
// - UNITY_PROCEDURAL_INSTANCING_ENABLED Defined if procedural instancing path is taken.
// - UNITY_STEREO_INSTANCING_ENABLED Defined if stereo instancing path is taken.
#if defined(UNITY_SUPPORT_INSTANCING) && defined(INSTANCING_ON)
#define UNITY_INSTANCING_ENABLED
#endif
#if defined(UNITY_SUPPORT_INSTANCING) && defined(PROCEDURAL_INSTANCING_ON)
#define UNITY_PROCEDURAL_INSTANCING_ENABLED
#endif
#if defined(UNITY_SUPPORT_STEREO_INSTANCING) && defined(STEREO_INSTANCING_ON)
#define UNITY_STEREO_INSTANCING_ENABLED
#endif
#if defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE) || defined(SHADER_API_METAL) || defined(SHADER_API_VULKAN)
// These platforms have constant buffers disabled normally, but not here (see CBUFFER_START/CBUFFER_END in HLSLSupport.cginc).
#define UNITY_INSTANCING_CBUFFER_SCOPE_BEGIN(name) cbuffer name {
#define UNITY_INSTANCING_CBUFFER_SCOPE_END }
#else
#define UNITY_INSTANCING_CBUFFER_SCOPE_BEGIN(name) CBUFFER_START(name)
#define UNITY_INSTANCING_CBUFFER_SCOPE_END CBUFFER_END
#endif
////////////////////////////////////////////////////////
// basic instancing setups
// - UNITY_VERTEX_INPUT_INSTANCE_ID Declare instance ID field in vertex shader input / output struct.
// - UNITY_GET_INSTANCE_ID (Internal) Get the instance ID from input struct.
#if defined(UNITY_INSTANCING_ENABLED) || defined(UNITY_PROCEDURAL_INSTANCING_ENABLED) || defined(UNITY_STEREO_INSTANCING_ENABLED)
// A global instance ID variable that functions can directly access.
static uint unity_InstanceID;
// Don't make UnityDrawCallInfo an actual CB on GL
#if !defined(SHADER_API_GLES3) && !defined(SHADER_API_GLCORE)
UNITY_INSTANCING_CBUFFER_SCOPE_BEGIN(UnityDrawCallInfo)
#endif
int unity_BaseInstanceID;
int unity_InstanceCount;
#if !defined(SHADER_API_GLES3) && !defined(SHADER_API_GLCORE)
UNITY_INSTANCING_CBUFFER_SCOPE_END
#endif
#ifdef SHADER_API_PSSL
#define DEFAULT_UNITY_VERTEX_INPUT_INSTANCE_ID uint instanceID;
#define UNITY_GET_INSTANCE_ID(input) _GETINSTANCEID(input)
#else
#define DEFAULT_UNITY_VERTEX_INPUT_INSTANCE_ID uint instanceID : SV_InstanceID;
#define UNITY_GET_INSTANCE_ID(input) input.instanceID
#endif
#else
#define DEFAULT_UNITY_VERTEX_INPUT_INSTANCE_ID
#endif // UNITY_INSTANCING_ENABLED || UNITY_PROCEDURAL_INSTANCING_ENABLED || UNITY_STEREO_INSTANCING_ENABLED
#if !defined(UNITY_VERTEX_INPUT_INSTANCE_ID)
# define UNITY_VERTEX_INPUT_INSTANCE_ID DEFAULT_UNITY_VERTEX_INPUT_INSTANCE_ID
#endif
////////////////////////////////////////////////////////
// basic stereo instancing setups
// - UNITY_VERTEX_OUTPUT_STEREO Declare stereo target eye field in vertex shader output struct.
// - UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO Assign the stereo target eye.
// - UNITY_TRANSFER_VERTEX_OUTPUT_STEREO Copy stero target from input struct to output struct. Used in vertex shader.
// - UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX
#ifdef UNITY_STEREO_INSTANCING_ENABLED
#define DEFAULT_UNITY_VERTEX_OUTPUT_STEREO uint stereoTargetEyeIndex : SV_RenderTargetArrayIndex;
#define DEFAULT_UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output) output.stereoTargetEyeIndex = unity_StereoEyeIndex
#define DEFAULT_UNITY_TRANSFER_VERTEX_OUTPUT_STEREO(input, output) output.stereoTargetEyeIndex = input.stereoTargetEyeIndex;
#define DEFAULT_UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input) unity_StereoEyeIndex = input.stereoTargetEyeIndex;
#elif defined(UNITY_STEREO_MULTIVIEW_ENABLED)
#define DEFAULT_UNITY_VERTEX_OUTPUT_STEREO float stereoTargetEyeIndex : BLENDWEIGHT0;
// HACK: Workaround for Mali shader compiler issues with directly using GL_ViewID_OVR (GL_OVR_multiview). This array just contains the values 0 and 1.
#define DEFAULT_UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output) output.stereoTargetEyeIndex = unity_StereoEyeIndices[unity_StereoEyeIndex].x;
#define DEFAULT_UNITY_TRANSFER_VERTEX_OUTPUT_STEREO(input, output) output.stereoTargetEyeIndex = input.stereoTargetEyeIndex;
#if defined(SHADER_STAGE_VERTEX)
#define DEFAULT_UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input)
#else
#define DEFAULT_UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input) unity_StereoEyeIndex = (uint) input.stereoTargetEyeIndex;
#endif
#else
#define DEFAULT_UNITY_VERTEX_OUTPUT_STEREO
#define DEFAULT_UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output)
#define DEFAULT_UNITY_TRANSFER_VERTEX_OUTPUT_STEREO(input, output)
#define DEFAULT_UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input)
#endif
#if !defined(UNITY_VERTEX_OUTPUT_STEREO)
# define UNITY_VERTEX_OUTPUT_STEREO DEFAULT_UNITY_VERTEX_OUTPUT_STEREO
#endif
#if !defined(UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO)
# define UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output) DEFAULT_UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output)
#endif
#if !defined(UNITY_TRANSFER_VERTEX_OUTPUT_STEREO)
# define UNITY_TRANSFER_VERTEX_OUTPUT_STEREO(input, output) DEFAULT_UNITY_TRANSFER_VERTEX_OUTPUT_STEREO(input, output)
#endif
#if !defined(UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX)
# define UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input) DEFAULT_UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input)
#endif
////////////////////////////////////////////////////////
// - UNITY_SETUP_INSTANCE_ID Should be used at the very beginning of the vertex shader / fragment shader,
// so that succeeding code can have access to the global unity_InstanceID.
// Also procedural function is called to setup instance data.
// - UNITY_TRANSFER_INSTANCE_ID Copy instance ID from input struct to output struct. Used in vertex shader.
#if defined(UNITY_INSTANCING_ENABLED) || defined(UNITY_PROCEDURAL_INSTANCING_ENABLED) || defined(UNITY_STEREO_INSTANCING_ENABLED)
void UnitySetupInstanceID(uint inputInstanceID)
{
#ifdef UNITY_STEREO_INSTANCING_ENABLED
// stereo eye index is automatically figured out from the instance ID
unity_StereoEyeIndex = inputInstanceID & 0x01;
unity_InstanceID = unity_BaseInstanceID + (inputInstanceID >> 1);
#else
unity_InstanceID = inputInstanceID + unity_BaseInstanceID;
#endif
}
void UnitySetupCompoundMatrices();
#ifdef UNITY_PROCEDURAL_INSTANCING_ENABLED
#ifndef UNITY_INSTANCING_PROCEDURAL_FUNC
#error "UNITY_INSTANCING_PROCEDURAL_FUNC must be defined."
#else
void UNITY_INSTANCING_PROCEDURAL_FUNC(); // forward declaration of the procedural function
#define DEFAULT_UNITY_SETUP_INSTANCE_ID(input) { UnitySetupInstanceID(UNITY_GET_INSTANCE_ID(input)); UNITY_INSTANCING_PROCEDURAL_FUNC(); UnitySetupCompoundMatrices(); }
#endif
#else
#define DEFAULT_UNITY_SETUP_INSTANCE_ID(input) { UnitySetupInstanceID(UNITY_GET_INSTANCE_ID(input)); UnitySetupCompoundMatrices(); }
#endif
#define UNITY_TRANSFER_INSTANCE_ID(input, output) output.instanceID = UNITY_GET_INSTANCE_ID(input)
#else
#define DEFAULT_UNITY_SETUP_INSTANCE_ID(input)
#define UNITY_TRANSFER_INSTANCE_ID(input, output)
#endif
#if !defined(UNITY_SETUP_INSTANCE_ID)
# define UNITY_SETUP_INSTANCE_ID(input) DEFAULT_UNITY_SETUP_INSTANCE_ID(input)
#endif
////////////////////////////////////////////////////////
// instanced property arrays
#if defined(UNITY_INSTANCING_ENABLED)
#ifdef UNITY_FORCE_MAX_INSTANCE_COUNT
#define UNITY_INSTANCED_ARRAY_SIZE UNITY_FORCE_MAX_INSTANCE_COUNT
#elif defined(UNITY_INSTANCING_SUPPORT_FLEXIBLE_ARRAY_SIZE)
#define UNITY_INSTANCED_ARRAY_SIZE 2 // minimum array size that ensures dynamic indexing
#elif defined(UNITY_MAX_INSTANCE_COUNT)
#define UNITY_INSTANCED_ARRAY_SIZE UNITY_MAX_INSTANCE_COUNT
#else
#if defined(SHADER_API_VULKAN) && defined(SHADER_API_MOBILE)
#define UNITY_INSTANCED_ARRAY_SIZE 250
#else
#define UNITY_INSTANCED_ARRAY_SIZE 500
#endif
#endif
#ifdef UNITY_INSTANCING_AOS
#define UNITY_INSTANCING_BUFFER_START(buf) UNITY_INSTANCING_CBUFFER_SCOPE_BEGIN(UnityInstancing_##buf) struct {
#define UNITY_INSTANCING_BUFFER_END(arr) } arr##Array[UNITY_INSTANCED_ARRAY_SIZE]; UNITY_INSTANCING_CBUFFER_SCOPE_END
#define UNITY_DEFINE_INSTANCED_PROP(type, var) type var;
#define UNITY_ACCESS_INSTANCED_PROP(arr, var) arr##Array[unity_InstanceID].var
#else
#define UNITY_INSTANCING_BUFFER_START(buf) UNITY_INSTANCING_CBUFFER_SCOPE_BEGIN(UnityInstancing_##buf)
#define UNITY_INSTANCING_BUFFER_END(arr) UNITY_INSTANCING_CBUFFER_SCOPE_END
#define UNITY_DEFINE_INSTANCED_PROP(type, var) type var[UNITY_INSTANCED_ARRAY_SIZE];
#define UNITY_ACCESS_INSTANCED_PROP(arr, var) var[unity_InstanceID]
#endif
// Put worldToObject array to a separate CB if UNITY_ASSUME_UNIFORM_SCALING is defined. Most of the time it will not be used.
#ifdef UNITY_ASSUME_UNIFORM_SCALING
#define UNITY_WORLDTOOBJECTARRAY_CB 1
#else
#define UNITY_WORLDTOOBJECTARRAY_CB 0
#endif
#if defined(UNITY_INSTANCED_LOD_FADE) && (defined(LOD_FADE_PERCENTAGE) || defined(LOD_FADE_CROSSFADE))
#define UNITY_USE_LODFADE_ARRAY
#endif
#ifdef UNITY_INSTANCED_LIGHTMAPSTS
#ifdef LIGHTMAP_ON
#define UNITY_USE_LIGHTMAPST_ARRAY
#endif
#ifdef DYNAMICLIGHTMAP_ON
#define UNITY_USE_DYNAMICLIGHTMAPST_ARRAY
#endif
#endif
#if defined(UNITY_INSTANCED_SH) && !defined(LIGHTMAP_ON)
#if UNITY_SHOULD_SAMPLE_SH
#define UNITY_USE_SHCOEFFS_ARRAYS
#endif
#if defined(UNITY_PASS_DEFERRED) && defined(SHADOWS_SHADOWMASK) && (UNITY_ALLOWED_MRT_COUNT > 4)
#define UNITY_USE_PROBESOCCLUSION_ARRAY
#endif
#endif
UNITY_INSTANCING_BUFFER_START(PerDraw0)
UNITY_DEFINE_INSTANCED_PROP(float4x4, unity_ObjectToWorldArray)
#if UNITY_WORLDTOOBJECTARRAY_CB == 0
UNITY_DEFINE_INSTANCED_PROP(float4x4, unity_WorldToObjectArray)
#endif
#if defined(UNITY_USE_LODFADE_ARRAY) && defined(UNITY_INSTANCING_SUPPORT_FLEXIBLE_ARRAY_SIZE)
UNITY_DEFINE_INSTANCED_PROP(float, unity_LODFadeArray)
// the quantized fade value (unity_LODFade.y) is automatically used for cross-fading instances
#define unity_LODFade UNITY_ACCESS_INSTANCED_PROP(unity_Builtins0, unity_LODFadeArray).xxxx
#endif
UNITY_INSTANCING_BUFFER_END(unity_Builtins0)
UNITY_INSTANCING_BUFFER_START(PerDraw1)
#if UNITY_WORLDTOOBJECTARRAY_CB == 1
UNITY_DEFINE_INSTANCED_PROP(float4x4, unity_WorldToObjectArray)
#endif
#if defined(UNITY_USE_LODFADE_ARRAY) && !defined(UNITY_INSTANCING_SUPPORT_FLEXIBLE_ARRAY_SIZE)
UNITY_DEFINE_INSTANCED_PROP(float, unity_LODFadeArray)
// the quantized fade value (unity_LODFade.y) is automatically used for cross-fading instances
#define unity_LODFade UNITY_ACCESS_INSTANCED_PROP(unity_Builtins1, unity_LODFadeArray).xxxx
#endif
UNITY_INSTANCING_BUFFER_END(unity_Builtins1)
UNITY_INSTANCING_BUFFER_START(PerDraw2)
#ifdef UNITY_USE_LIGHTMAPST_ARRAY
UNITY_DEFINE_INSTANCED_PROP(float4, unity_LightmapSTArray)
#define unity_LightmapST UNITY_ACCESS_INSTANCED_PROP(unity_Builtins2, unity_LightmapSTArray)
#endif
#ifdef UNITY_USE_DYNAMICLIGHTMAPST_ARRAY
UNITY_DEFINE_INSTANCED_PROP(float4, unity_DynamicLightmapSTArray)
#define unity_DynamicLightmapST UNITY_ACCESS_INSTANCED_PROP(unity_Builtins2, unity_DynamicLightmapSTArray)
#endif
#ifdef UNITY_USE_SHCOEFFS_ARRAYS
UNITY_DEFINE_INSTANCED_PROP(half4, unity_SHArArray)
UNITY_DEFINE_INSTANCED_PROP(half4, unity_SHAgArray)
UNITY_DEFINE_INSTANCED_PROP(half4, unity_SHAbArray)
UNITY_DEFINE_INSTANCED_PROP(half4, unity_SHBrArray)
UNITY_DEFINE_INSTANCED_PROP(half4, unity_SHBgArray)
UNITY_DEFINE_INSTANCED_PROP(half4, unity_SHBbArray)
UNITY_DEFINE_INSTANCED_PROP(half4, unity_SHCArray)
#define unity_SHAr UNITY_ACCESS_INSTANCED_PROP(unity_Builtins2, unity_SHArArray)
#define unity_SHAg UNITY_ACCESS_INSTANCED_PROP(unity_Builtins2, unity_SHAgArray)
#define unity_SHAb UNITY_ACCESS_INSTANCED_PROP(unity_Builtins2, unity_SHAbArray)
#define unity_SHBr UNITY_ACCESS_INSTANCED_PROP(unity_Builtins2, unity_SHBrArray)
#define unity_SHBg UNITY_ACCESS_INSTANCED_PROP(unity_Builtins2, unity_SHBgArray)
#define unity_SHBb UNITY_ACCESS_INSTANCED_PROP(unity_Builtins2, unity_SHBbArray)
#define unity_SHC UNITY_ACCESS_INSTANCED_PROP(unity_Builtins2, unity_SHCArray)
#endif
#ifdef UNITY_USE_PROBESOCCLUSION_ARRAY
UNITY_DEFINE_INSTANCED_PROP(half4, unity_ProbesOcclusionArray)
#define unity_ProbesOcclusion UNITY_ACCESS_INSTANCED_PROP(unity_Builtins2, unity_ProbesOcclusionArray)
#endif
UNITY_INSTANCING_BUFFER_END(unity_Builtins2)
#define unity_ObjectToWorld UNITY_ACCESS_INSTANCED_PROP(unity_Builtins0, unity_ObjectToWorldArray)
#define MERGE_UNITY_BUILTINS_INDEX(X) unity_Builtins##X
#define unity_WorldToObject UNITY_ACCESS_INSTANCED_PROP(MERGE_UNITY_BUILTINS_INDEX(UNITY_WORLDTOOBJECTARRAY_CB), unity_WorldToObjectArray)
inline float4 UnityObjectToClipPosInstanced(in float3 pos)
{
return mul(UNITY_MATRIX_VP, mul(unity_ObjectToWorld, float4(pos, 1.0)));
}
inline float4 UnityObjectToClipPosInstanced(float4 pos)
{
return UnityObjectToClipPosInstanced(pos.xyz);
}
#define UnityObjectToClipPos UnityObjectToClipPosInstanced
#else // UNITY_INSTANCING_ENABLED
// in procedural mode we don't need cbuffer, and properties are not uniforms
#ifdef UNITY_PROCEDURAL_INSTANCING_ENABLED
#define UNITY_INSTANCING_BUFFER_START(buf)
#define UNITY_INSTANCING_BUFFER_END(arr)
#define UNITY_DEFINE_INSTANCED_PROP(type, var) static type var;
#else
#define UNITY_INSTANCING_BUFFER_START(buf) CBUFFER_START(buf)
#define UNITY_INSTANCING_BUFFER_END(arr) CBUFFER_END
#define UNITY_DEFINE_INSTANCED_PROP(type, var) type var;
#endif
#define UNITY_ACCESS_INSTANCED_PROP(arr, var) var
#endif // UNITY_INSTANCING_ENABLED
#if defined(UNITY_INSTANCING_ENABLED) || defined(UNITY_PROCEDURAL_INSTANCING_ENABLED) || defined(UNITY_STEREO_INSTANCING_ENABLED)
// The following matrix evaluations depend on the static var unity_InstanceID & unity_StereoEyeIndex. They need to be initialized after UnitySetupInstanceID.
static float4x4 unity_MatrixMVP_Instanced;
static float4x4 unity_MatrixMV_Instanced;
static float4x4 unity_MatrixTMV_Instanced;
static float4x4 unity_MatrixITMV_Instanced;
void UnitySetupCompoundMatrices()
{
unity_MatrixMVP_Instanced = mul(UNITY_MATRIX_VP, unity_ObjectToWorld);
unity_MatrixMV_Instanced = mul(UNITY_MATRIX_V, unity_ObjectToWorld);
unity_MatrixTMV_Instanced = transpose(unity_MatrixMV_Instanced);
unity_MatrixITMV_Instanced = transpose(mul(unity_WorldToObject, unity_MatrixInvV));
}
#undef UNITY_MATRIX_MVP
#undef UNITY_MATRIX_MV
#undef UNITY_MATRIX_T_MV
#undef UNITY_MATRIX_IT_MV
#define UNITY_MATRIX_MVP unity_MatrixMVP_Instanced
#define UNITY_MATRIX_MV unity_MatrixMV_Instanced
#define UNITY_MATRIX_T_MV unity_MatrixTMV_Instanced
#define UNITY_MATRIX_IT_MV unity_MatrixITMV_Instanced
#endif
#endif // UNITY_INSTANCING_INCLUDED

9
ScriptableRenderPipeline/Core/CoreRP/ShaderLibrary/UnityInstancing.hlsl.meta


fileFormatVersion: 2
guid: e1cfc5ca61db3d448825f316ff92cb0b
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:

86
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/Lit/LitBuiltinData.hlsl


void GetBuiltinData(FragInputs input, SurfaceData surfaceData, float alpha, float3 bentNormalWS, float depthOffset, out BuiltinData builtinData)
{
// Builtin Data
builtinData.opacity = alpha;
// TODO: Sample lightmap/lightprobe/volume proxy
// This should also handle projective lightmap
builtinData.bakeDiffuseLighting = SampleBakedGI(input.positionWS, bentNormalWS, input.texCoord1, input.texCoord2);
// It is safe to call this function here as surfaceData have been filled
// We want to know if we must enable transmission on GI for SSS material, if the material have no SSS, this code will be remove by the compiler.
BSDFData bsdfData = ConvertSurfaceDataToBSDFData(surfaceData);
if (HasMaterialFeatureFlag(bsdfData.materialFeatures, MATERIALFEATUREFLAGS_LIT_TRANSMISSION))
{
// For now simply recall the function with inverted normal, the compiler should be able to optimize the lightmap case to not resample the directional lightmap
// however it will not optimize the lightprobe case due to the proxy volume relying on dynamic if (we rely must get right of this dynamic if), not a problem for SH9, but a problem for proxy volume.
// TODO: optimize more this code.
// Add GI transmission contribution by resampling the GI for inverted vertex normal
builtinData.bakeDiffuseLighting += SampleBakedGI(input.positionWS, -input.worldToTangent[2], input.texCoord1, input.texCoord2) * bsdfData.transmittance;
}
#ifdef SHADOWS_SHADOWMASK
float4 shadowMask = SampleShadowMask(input.positionWS, input.texCoord1);
builtinData.shadowMask0 = shadowMask.x;
builtinData.shadowMask1 = shadowMask.y;
builtinData.shadowMask2 = shadowMask.z;
builtinData.shadowMask3 = shadowMask.w;
#else
builtinData.shadowMask0 = 0.0;
builtinData.shadowMask1 = 0.0;
builtinData.shadowMask2 = 0.0;
builtinData.shadowMask3 = 0.0;
#endif
// Emissive Intensity is only use here, but is part of BuiltinData to enforce UI parameters as we want the users to fill one color and one intensity
builtinData.emissiveIntensity = _EmissiveIntensity; // We still store intensity here so we can reuse it with debug code
builtinData.emissiveColor = _EmissiveColor * builtinData.emissiveIntensity * lerp(float3(1.0, 1.0, 1.0), surfaceData.baseColor.rgb, _AlbedoAffectEmissive);
#ifdef _EMISSIVE_COLOR_MAP
// Use layer0 of LayerTexCoord to retrieve emissive color mapping information
LayerTexCoord layerTexCoord;
ZERO_INITIALIZE(LayerTexCoord, layerTexCoord);
layerTexCoord.vertexNormalWS = input.worldToTangent[2].xyz;
layerTexCoord.triplanarWeights = ComputeTriplanarWeights(layerTexCoord.vertexNormalWS);
int mappingType = UV_MAPPING_UVSET;
#if defined(_EMISSIVE_MAPPING_PLANAR)
mappingType = UV_MAPPING_PLANAR;
#elif defined(_EMISSIVE_MAPPING_TRIPLANAR)
mappingType = UV_MAPPING_TRIPLANAR;
#endif
// Be sure that the compiler is aware that we don't use UV1 to UV3 for main layer so it can optimize code
#ifndef LAYERED_LIT_SHADER
ComputeLayerTexCoord(input.texCoord0, input.texCoord1, input.texCoord2, input.texCoord3, float4(1.0, 0.0, 0.0, 0.0), float4(1.0, 0.0, 0.0, 0.0),
#else
ComputeLayerTexCoord0(input.texCoord0, input.texCoord1, input.texCoord2, input.texCoord3, _UVMappingMaskEmissive, _UVMappingMaskEmissive,
#endif
_EmissiveColorMap_ST.xy, _EmissiveColorMap_ST.zw, float2(0.0, 0.0), float2(0.0, 0.0), 1.0, false,
input.positionWS, _TexWorldScaleEmissive,
mappingType, layerTexCoord);
#ifndef LAYERED_LIT_SHADER
UVMapping emissiveMapMapping = layerTexCoord.base;
#else
UVMapping emissiveMapMapping = layerTexCoord.base0;
#endif
builtinData.emissiveColor *= SAMPLE_UVMAPPING_TEXTURE2D(_EmissiveColorMap, sampler_EmissiveColorMap, emissiveMapMapping).rgb;
#endif // _EMISSIVE_COLOR_MAP
builtinData.velocity = float2(0.0, 0.0);
#if (SHADERPASS == SHADERPASS_DISTORTION) || defined(DEBUG_DISPLAY)
float3 distortion = SAMPLE_TEXTURE2D(_DistortionVectorMap, sampler_DistortionVectorMap, input.texCoord0).rgb;
distortion.rg = distortion.rg * _DistortionVectorScale.xx + _DistortionVectorBias.xx;
builtinData.distortion = distortion.rg * _DistortionScale;
builtinData.distortionBlur = clamp(distortion.b * _DistortionBlurScale, 0.0, 1.0) * (_DistortionBlurRemapMax - _DistortionBlurRemapMin) + _DistortionBlurRemapMin;
#else
builtinData.distortion = float2(0.0, 0.0);
builtinData.distortionBlur = 0.0;
#endif
builtinData.depthOffset = depthOffset;
}

9
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/Lit/LitBuiltinData.hlsl.meta


fileFormatVersion: 2
guid: b18343016003d0c4aaa0dd7778d3b816
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:

8
Tests/Editor.meta


fileFormatVersion: 2
guid: 0f6887a1ff514ed690ada3786867d216
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

8
Tests/GraphicsTests/Framework.meta


fileFormatVersion: 2
guid: 8305d4811b3aa624ea663e2d7841e470
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

8
Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/CommonAssets/Scripts.meta


fileFormatVersion: 2
guid: c1f6eaf19a5d40045818530f57b09da5
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

1001
Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/3xxx_DebugView/3003_CameraMotionVector_TranslateX.unity
文件差异内容过多而无法显示
查看文件

7
Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/3xxx_DebugView/3003_CameraMotionVector_TranslateX.unity.meta


fileFormatVersion: 2
guid: 32624e48cd276b5418513150e7abd682
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

1001
Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/3xxx_DebugView/3004_CameraMotionVector_TranslateY.unity
文件差异内容过多而无法显示
查看文件

7
Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/3xxx_DebugView/3004_CameraMotionVector_TranslateY.unity.meta


fileFormatVersion: 2
guid: b8bed96a3181ffe49b8e54bc9a3c7687
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

1001
Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/3xxx_DebugView/3005_CameraMotionVector_TranslateZ.unity
文件差异内容过多而无法显示
查看文件

7
Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/3xxx_DebugView/3005_CameraMotionVector_TranslateZ.unity.meta


fileFormatVersion: 2
guid: 55881ec59ae8d414cb8a77aa120a45ed
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

1001
Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/3xxx_DebugView/3006_CameraMotionVector_RotateX.unity
文件差异内容过多而无法显示
查看文件

7
Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/3xxx_DebugView/3006_CameraMotionVector_RotateX.unity.meta


fileFormatVersion: 2
guid: 0225322b58c79bb4d87afeb169e0d119
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

1001
Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/3xxx_DebugView/3007_CameraMotionVector_RotateY.unity
文件差异内容过多而无法显示
查看文件

7
Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/3xxx_DebugView/3007_CameraMotionVector_RotateY.unity.meta


fileFormatVersion: 2
guid: 01e6660110220214782d0ebf364fe7c9
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

1001
Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/3xxx_DebugView/3008_CameraMotionVector_RotateZ.unity
文件差异内容过多而无法显示
查看文件

7
Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/3xxx_DebugView/3008_CameraMotionVector_RotateZ.unity.meta


fileFormatVersion: 2
guid: fabc53a9f87e8784580b4e75dc067ca3
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

1001
Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/3xxx_DebugView/3009_CameraMotionVector_FOV.unity
文件差异内容过多而无法显示
查看文件

7
Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/3xxx_DebugView/3009_CameraMotionVector_FOV.unity.meta


fileFormatVersion: 2
guid: a5fb429214e9b2a4f8b3d258c0585630
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

8
Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/040_UpgradeScene/Scripts.meta


fileFormatVersion: 2
guid: 2c9ce194a1bfc4733b75593a1f4ced22
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

14
Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/EditorPlayModeTests.asset


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0baa057a399734241b8f30441a73b429, type: 3}
m_Name: EditorPlayModeTests
m_EditorClassIdentifier:
scenesPath: []

8
Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/EditorPlayModeTests.asset.meta


fileFormatVersion: 2
guid: 538fb100057717544bdaac8705d4a015
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

53
Tests/Scripts/Editor/GraphicTests/HDRenderPipeline/DebugViewController_Editor.cs


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using UnityEngine.Experimental.Rendering;
using UnityEngine.Experimental.Rendering.HDPipeline;
using UnityEditor.Experimental.Rendering;
using UnityEditor.Experimental.Rendering.HDPipeline;
[DisallowMultipleComponent]
[CustomEditor(typeof(DebugViewController))]
public class DebugViewController_Editor : Editor
{
SerializedProperty s_settingType;
SerializedProperty s_gBuffer;
SerializedProperty s_fullScreenDebugMode;
public void OnEnable()
{
s_settingType = serializedObject.FindProperty("settingType");
s_gBuffer = serializedObject.FindProperty("gBuffer");
s_fullScreenDebugMode = serializedObject.FindProperty("fullScreenDebugMode");
}
public override void OnInspectorGUI()
{
//base.OnInspectorGUI();
//EditorGUILayout.PropertyField(s_settingType);
int i_settingType = s_settingType.intValue;//= (int) (target as DebugViewController).settingType;
s_settingType.intValue = GUILayout.Toolbar(s_settingType.intValue, new string[] { "Material", "Rendering" });
switch ( (DebugViewController.SettingType) s_settingType.intValue )
{
case DebugViewController.SettingType.Material :
s_gBuffer.intValue = EditorGUILayout.IntPopup(new GUIContent("GBuffer"), s_gBuffer.intValue, MaterialDebugSettings.debugViewMaterialGBufferStrings, MaterialDebugSettings.debugViewMaterialGBufferValues);
break;
case DebugViewController.SettingType.Rendering:
s_fullScreenDebugMode.intValue = EditorGUILayout.IntPopup(new GUIContent("GBuffer"), s_fullScreenDebugMode.intValue, DebugDisplaySettings.renderingFullScreenDebugStrings, DebugDisplaySettings.renderingFullScreenDebugValues);
break;
}
if ( serializedObject.ApplyModifiedProperties() )
{
serializedObject.Update();
(target as DebugViewController).SetDebugView();
}
}
}

11
Tests/Scripts/Editor/GraphicTests/HDRenderPipeline/DebugViewController_Editor.cs.meta


fileFormatVersion: 2
guid: da59c0df09fb17e4f99a667936fce895
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

34
Tests/Scripts/GraphicTests/HDRenderPipeline/SinRotate.cs


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class SinRotate : MonoBehaviour
{
[SerializeField] bool localSpace = false;
[SerializeField] Vector3 angles = new Vector3(45f, 0f, 0f);
[SerializeField] float frequency = 1f;
[SerializeField] float fps = 60;
Vector3 startAngles = Vector3.zero;
// Use this for initialization
void Start()
{
startAngles = transform.eulerAngles;
}
// Update is called once per frame
void Update()
{
if (localSpace)
{
transform.eulerAngles = startAngles;
transform.Rotate(angles * Mathf.Sin(Mathf.PI * frequency * Time.frameCount / fps), Space.Self);
}
else
{
transform.eulerAngles = startAngles + Mathf.Sin(Mathf.PI * frequency * Time.frameCount / fps) * angles;
}
}
}

11
Tests/Scripts/GraphicTests/HDRenderPipeline/SinRotate.cs.meta


fileFormatVersion: 2
guid: 14d7896b83927c247821fa13f452106f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

25
Tests/Scripts/GraphicTests/HDRenderPipeline/SinScale.cs


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class SinScale : MonoBehaviour
{
[SerializeField] Vector3 min = new Vector3(1f, 1f, 1f);
[SerializeField] Vector3 max = new Vector3(2f, 2f, 2f);
[SerializeField] float frequency = 1f;
[SerializeField] float fps = 60;
Vector3 startAngles = Vector3.zero;
// Use this for initialization
void Start()
{
startAngles = transform.eulerAngles;
}
// Update is called once per frame
void Update()
{
transform.localScale = Vector3.Lerp(min, max, Mathf.Sin(Mathf.PI * frequency * Time.frameCount / fps) * 0.5f + 0.5f);
}
}

11
Tests/Scripts/GraphicTests/HDRenderPipeline/SinScale.cs.meta


fileFormatVersion: 2
guid: 382c9a87993196d4596a688b68b60221
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

27
Tests/Scripts/GraphicTests/HDRenderPipeline/Sin_ChangeFOV.cs


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[RequireComponent(typeof(Camera))]
public class Sin_ChangeFOV : MonoBehaviour
{
[SerializeField] float min = 45f;
[SerializeField] float max = 90f;
[SerializeField] float frequency = 1f;
[SerializeField] float fps = 60;
new Camera camera;
// Use this for initialization
void Start()
{
camera = GetComponent<Camera>();
}
// Update is called once per frame
void Update()
{
camera.fieldOfView = min + (max - min) * Mathf.Sin(Mathf.PI * frequency * Time.frameCount / fps);
}
}

11
Tests/Scripts/GraphicTests/HDRenderPipeline/Sin_ChangeFOV.cs.meta


fileFormatVersion: 2
guid: b154df1eef1794b4a8de0a7c73131da1
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

8
Tests/GraphicsTests/Framework/Editor.meta


fileFormatVersion: 2
guid: ac919a67e7c764f70a75900c12043d9b
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

8
Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/CommonAssets/Scripts/Editor.meta


fileFormatVersion: 2
guid: 129562301394edd45a199c538cda6f8f
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

8
Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/040_UpgradeScene/Scripts/Editor.meta


fileFormatVersion: 2
guid: 8a8e7dc88956341568162060a68f1e7e
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

8
Tests/ShaderGeneratorTests/Editor.meta


fileFormatVersion: 2
guid: 76dedef1a7bcc354e900c23b8135d94c
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

8
Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/0xxx.meta


fileFormatVersion: 2
guid: 405d053465ae98342849302f26ddfee0
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

/Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/3xxx_DebugView/3002_ObjectMotionVector/SinMove.cs.meta → /Tests/Scripts/GraphicTests/HDRenderPipeline/SinMove.cs.meta

/Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/3xxx_DebugView/3002_ObjectMotionVector/SinMove.cs → /Tests/Scripts/GraphicTests/HDRenderPipeline/SinMove.cs

正在加载...
取消
保存