浏览代码

Merge branch 'master' into lw/terrain_optimization

/main
Aleksandr Kirillov 6 年前
当前提交
4695f235
共有 3877 个文件被更改,包括 8013 次插入639 次删除
  1. 4
      .gitattributes
  2. 19
      .gitignore
  3. 12
      .gitmodules
  4. 2
      README.md
  5. 250
      TestProjects/ShaderGraph/Assets/TestbedAssets/BW_logo.png
  6. 463
      TestProjects/ShaderGraph/Assets/TestbedAssets/Clouds.png
  7. 174
      TestProjects/ShaderGraph/Assets/TestbedAssets/Gradient.png
  8. 1001
      TestProjects/ShaderGraph/Assets/TestbedAssets/Lava_flowmap.png
  9. 1001
      TestProjects/ShaderGraph/Assets/TestbedAssets/Rock_Pack_01/Rocks_Textures/Tileable_Rock_A/Tileable_Rock_A_H.png
  10. 410
      TestProjects/ShaderGraph/Assets/TestbedAssets/an_gradient.png
  11. 448
      TestProjects/ShaderGraph/Assets/TestbedAssets/bricks_height.png
  12. 646
      TestProjects/ShaderGraph/Assets/TestbedAssets/flowmap.png
  13. 1001
      TestProjects/ShaderGraph/Assets/TestbedAssets/ground_cracked_ground_roughness.png
  14. 1001
      TestProjects/ShaderGraph/Assets/TestbedAssets/normal.png
  15. 247
      TestProjects/ShaderGraph/Assets/TestbedAssets/portrait_mask.png
  16. 35
      TestProjects/ShaderGraph/Assets/TestbedAssets/sfn_vertexcolor.png
  17. 3
      TestProjects/ShaderGraph/Assets/Testing/Editor/IntegrationTests/ShaderGenerationTest.cs
  18. 21
      TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Advanced/Absolute.png
  19. 21
      TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Advanced/Exponential.png
  20. 21
      TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Advanced/Length.png
  21. 21
      TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Advanced/Log.png
  22. 21
      TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Advanced/Modulo.png
  23. 21
      TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Advanced/Negate.png
  24. 21
      TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Advanced/Normalize.png
  25. 21
      TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Advanced/Posterize.png
  26. 21
      TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Advanced/Reciprocal Square Root.png
  27. 21
      TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Advanced/Reciprocal.png
  28. 23
      TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Basic/Add.png
  29. 21
      TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Basic/Divide.png
  30. 21
      TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Basic/Multiply.png
  31. 21
      TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Basic/Power.png
  32. 21
      TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Basic/Square Root.png
  33. 21
      TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Basic/Subtract.png
  34. 21
      TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Derivative/DDX.png
  35. 21
      TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Derivative/DDXY.png
  36. 21
      TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Derivative/DDY.png
  37. 21
      TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Interpolation/Inverse Lerp.png
  38. 21
      TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Interpolation/Lerp.png
  39. 21
      TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Interpolation/Smoothstep.png
  40. 21
      TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Matrix/Matrix Construction.png
  41. 21
      TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Matrix/Matrix Determinant.png
  42. 21
      TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Matrix/Matrix Split.png
  43. 21
      TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Matrix/Matrix Transpose.png
  44. 21
      TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Range/Clamp.png
  45. 21
      TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Range/Fraction.png
  46. 21
      TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Range/Maximum.png
  47. 21
      TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Range/Minimum.png
  48. 21
      TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Range/One Minus.png
  49. 21
      TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Range/Random Range.png
  50. 21
      TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Range/Remap.png
  51. 21
      TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Range/Saturate.png
  52. 21
      TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Round/Ceiling.png
  53. 21
      TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Round/Floor.png
  54. 21
      TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Round/Round.png
  55. 21
      TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Round/Sign.png
  56. 21
      TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Round/Step.png
  57. 21
      TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Round/Truncate.png
  58. 21
      TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Trigonometry/Arccosine.png
  59. 21
      TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Trigonometry/Arcsine.png
  60. 21
      TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Trigonometry/Arctangent.png
  61. 21
      TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Trigonometry/Arctangent2.png
  62. 21
      TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Trigonometry/Cosine.png
  63. 21
      TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Trigonometry/Degrees To Radians.png
  64. 21
      TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Trigonometry/Hyporbolic Cosine.png
  65. 21
      TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Trigonometry/Hyporbolic Sine.png
  66. 21
      TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Trigonometry/Hyporbolic Tangent.png
  67. 21
      TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Trigonometry/Radians To Degrees.png
  68. 21
      TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Trigonometry/Sine.png
  69. 21
      TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Trigonometry/Tangent.png
  70. 21
      TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Vector/Cross Product.png
  71. 21
      TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Vector/Distance.png
  72. 21
      TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Vector/Dot Product.png
  73. 21
      TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Vector/Fresnel Effect.png
  74. 21
      TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Vector/Projection.png
  75. 21
      TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Vector/Rejection.png
  76. 21
      TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Vector/Transform.png
  77. 15
      TestProjects/ShaderGraph/Packages/manifest.json
  78. 22
      TestProjects/ShaderGraph/ProjectSettings/EditorBuildSettings.asset
  79. 123
      TestProjects/ShaderGraph/ProjectSettings/GraphicsSettings.asset
  80. 14
      TestProjects/ShaderGraph/ProjectSettings/ProjectSettings.asset
  81. 5
      build.py
  82. 3
      com.unity.render-pipelines.core/CHANGELOG.md
  83. 13
      com.unity.render-pipelines.core/CoreRP/Debugging/MousePositionDebug.cs
  84. 294
      com.unity.render-pipelines.core/CoreRP/Editor/CoreEditorUtils.cs
  85. 4
      com.unity.render-pipelines.core/CoreRP/Editor/Debugging/DebugWindow.cs
  86. 12
      com.unity.render-pipelines.core/CoreRP/Editor/IncludePaths/CoreShaderIncludePaths.cs
  87. 5
      com.unity.render-pipelines.core/CoreRP/Editor/ShaderGenerator/ShaderTypeGeneration.cs
  88. 7
      com.unity.render-pipelines.core/CoreRP/Inputs/InputRegistering.cs
  89. 44
      com.unity.render-pipelines.core/CoreRP/ShaderLibrary/API/D3D11.hlsl
  90. 23
      com.unity.render-pipelines.core/CoreRP/ShaderLibrary/API/GLCore.hlsl
  91. 2
      com.unity.render-pipelines.core/CoreRP/ShaderLibrary/API/GLES2.hlsl
  92. 23
      com.unity.render-pipelines.core/CoreRP/ShaderLibrary/API/GLES3.hlsl
  93. 41
      com.unity.render-pipelines.core/CoreRP/ShaderLibrary/API/Metal.hlsl
  94. 44
      com.unity.render-pipelines.core/CoreRP/ShaderLibrary/API/PSSL.hlsl

4
.gitattributes


com.unity.shadergraph/**/*.png filter=lfs diff=lfs merge=lfs -text
com.unity.shadergraph/**/*.gif filter=lfs diff=lfs merge=lfs -text
TestProjects/ShaderGraph/**/*.png filter=lfs diff=lfs merge=lfs -text
TestProjects/LWRP/**/*.tif filter=lfs diff=lfs merge=lfs -text

19
.gitignore


artifacts/**
build/**
DataSource/*
**/Library/**
obj/*
Temp/*
[Aa]rtifacts/
[Bb]uild/
[Ll]ibrary/
[Oo]bj/
[Tt]emp/
[Ss]treaming[Aa]ssets/
[Aa]ctual[Ii]mages/
[Ll]og/
[Aa]ctual[Ii]mages.meta
[Ss]treaming[Aa]ssets.meta
.vs
.vscode
.idea

ShaderGraph/DebugOutput.meta
ShaderGraph/DebugOutput/**
ShaderGraph/Testing/IntegrationTests/.Failed
TestProjects/GraphicsTests/Temp/
TestProjects/LWRP/GraphicsTests/Temp/
TestProjects/ShaderGraph/ProjectSettings/ProjectVersion.txt

12
.gitmodules


[submodule "PostProcessing"]
path = PostProcessing
url = https://github.com/Unity-Technologies/PostProcessing
[submodule "com.unity.postprocessing"]
path = com.unity.postprocessing
url = https://github.com/Unity-Technologies/PostProcessing.git
[submodule "TestProjects/GraphicsTests/Assets/Tests/UTF_Core"]
path = TestProjects/GraphicsTests/Assets/Tests/UTF_Core
url = https://github.com/Unity-Technologies/UTF_Core.git
[submodule "TestProjects/GraphicsTests/Assets/Tests/UTF_Tests_HDRP"]
path = TestProjects/GraphicsTests/Assets/Tests/UTF_Tests_HDRP
url = https://github.com/Unity-Technologies/UTF_Tests_HDRP.git

2
README.md


## NOTE: We are migrating reported issues to fogbugz. Please log issues there.
# Unity Scriptable Render Pipeline
The Scriptable Render Pipeline (SRP) is a new Unity feature in active development. SRP has been designed to give artists and developers the tools they need to create modern, high-fidelity graphics in Unity. Including a built-in Lightweight Render Pipeline for use on all platforms, and a High Definition Render Pipeline (HDRP) for use on compute shader compatible platforms. These features are available in Unity 2018.1+.

250
TestProjects/ShaderGraph/Assets/TestbedAssets/BW_logo.png

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

463
TestProjects/ShaderGraph/Assets/TestbedAssets/Clouds.png

之前 之后
宽度: 512  |  高度: 512  |  大小: 90 KiB

174
TestProjects/ShaderGraph/Assets/TestbedAssets/Gradient.png

之前 之后
宽度: 512  |  高度: 512  |  大小: 16 KiB

1001
TestProjects/ShaderGraph/Assets/TestbedAssets/Lava_flowmap.png
文件差异内容过多而无法显示
查看文件

1001
TestProjects/ShaderGraph/Assets/TestbedAssets/Rock_Pack_01/Rocks_Textures/Tileable_Rock_A/Tileable_Rock_A_H.png
文件差异内容过多而无法显示
查看文件

410
TestProjects/ShaderGraph/Assets/TestbedAssets/an_gradient.png

之前 之后
宽度: 300  |  高度: 300  |  大小: 75 KiB

448
TestProjects/ShaderGraph/Assets/TestbedAssets/bricks_height.png

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

646
TestProjects/ShaderGraph/Assets/TestbedAssets/flowmap.png

之前 之后
宽度: 1024  |  高度: 1024  |  大小: 169 KiB

1001
TestProjects/ShaderGraph/Assets/TestbedAssets/ground_cracked_ground_roughness.png
文件差异内容过多而无法显示
查看文件

1001
TestProjects/ShaderGraph/Assets/TestbedAssets/normal.png
文件差异内容过多而无法显示
查看文件

247
TestProjects/ShaderGraph/Assets/TestbedAssets/portrait_mask.png

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

35
TestProjects/ShaderGraph/Assets/TestbedAssets/sfn_vertexcolor.png

之前 之后
宽度: 96  |  高度: 96  |  大小: 9.9 KiB

3
TestProjects/ShaderGraph/Assets/Testing/Editor/IntegrationTests/ShaderGenerationTest.cs


Object.DestroyImmediate(m_FromDisk);
}
[Test, TestCaseSource(typeof(CollectGraphs), "graphs")]
// [Test, TestCaseSource(typeof(CollectGraphs), "graphs")]
[Ignore("Not currently runable")]
public void Graph(TestInfo testInfo)
{
var file = testInfo.info;

21
TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Advanced/Absolute.png

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

21
TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Advanced/Exponential.png

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

21
TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Advanced/Length.png

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

21
TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Advanced/Log.png

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

21
TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Advanced/Modulo.png

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

21
TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Advanced/Negate.png

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

21
TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Advanced/Normalize.png

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

21
TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Advanced/Posterize.png

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

21
TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Advanced/Reciprocal Square Root.png

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

21
TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Advanced/Reciprocal.png

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

23
TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Basic/Add.png

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

21
TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Basic/Divide.png

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

21
TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Basic/Multiply.png

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

21
TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Basic/Power.png

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

21
TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Basic/Square Root.png

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

21
TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Basic/Subtract.png

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

21
TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Derivative/DDX.png

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

21
TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Derivative/DDXY.png

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

21
TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Derivative/DDY.png

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

21
TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Interpolation/Inverse Lerp.png

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

21
TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Interpolation/Lerp.png

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

21
TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Interpolation/Smoothstep.png

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

21
TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Matrix/Matrix Construction.png

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

21
TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Matrix/Matrix Determinant.png

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

21
TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Matrix/Matrix Split.png

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

21
TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Matrix/Matrix Transpose.png

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

21
TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Range/Clamp.png

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

21
TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Range/Fraction.png

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

21
TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Range/Maximum.png

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

21
TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Range/Minimum.png

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

21
TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Range/One Minus.png

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

21
TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Range/Random Range.png

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

21
TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Range/Remap.png

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

21
TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Range/Saturate.png

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

21
TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Round/Ceiling.png

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

21
TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Round/Floor.png

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

21
TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Round/Round.png

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

21
TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Round/Sign.png

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

21
TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Round/Step.png

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

21
TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Round/Truncate.png

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

21
TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Trigonometry/Arccosine.png

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

21
TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Trigonometry/Arcsine.png

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

21
TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Trigonometry/Arctangent.png

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

21
TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Trigonometry/Arctangent2.png

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

21
TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Trigonometry/Cosine.png

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

21
TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Trigonometry/Degrees To Radians.png

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

21
TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Trigonometry/Hyporbolic Cosine.png

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

21
TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Trigonometry/Hyporbolic Sine.png

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

21
TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Trigonometry/Hyporbolic Tangent.png

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

21
TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Trigonometry/Radians To Degrees.png

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

21
TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Trigonometry/Sine.png

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

21
TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Trigonometry/Tangent.png

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

21
TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Vector/Cross Product.png

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

21
TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Vector/Distance.png

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

21
TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Vector/Dot Product.png

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

21
TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Vector/Fresnel Effect.png

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

21
TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Vector/Projection.png

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

21
TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Vector/Rejection.png

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

21
TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/.ShaderTemplates/Math/Vector/Transform.png

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

15
TestProjects/ShaderGraph/Packages/manifest.json


{
"dependencies": {
}
"dependencies": {
"com.unity.postprocessing": "file:../../../com.unity.postprocessing",
"com.unity.render-pipelines.core": "file:../../../com.unity.render-pipelines.core",
"com.unity.render-pipelines.high-definition": "file:../../../com.unity.render-pipelines.high-definition",
"com.unity.render-pipelines.lightweight": "file:../../../com.unity.render-pipelines.lightweight",
"com.unity.shadergraph": "file:../../../com.unity.shadergraph",
"com.unity.testframework.graphics": "file:../../../com.unity.testframework.graphics",
"com.unity.textmeshpro": "1.2.4"
},
"testables": [
"com.unity.render-pipelines.shadergraph",
"com.unity.testframework.graphics"
]
}

22
TestProjects/ShaderGraph/ProjectSettings/EditorBuildSettings.asset


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1045 &1
EditorBuildSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Scenes:
- enabled: 1
path: Assets/Scenes/SampleScene.unity
guid: 99c9720ab356a0642a771bea13969a05
m_configObjects: {}
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1045 &1
EditorBuildSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Scenes:
- enabled: 1
path: Assets/Scenes/MathNodes.unity
guid: a57ba07320e44f145ab52a48fadc4dca
m_configObjects: {}

123
TestProjects/ShaderGraph/ProjectSettings/GraphicsSettings.asset


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!30 &1
GraphicsSettings:
m_ObjectHideFlags: 0
serializedVersion: 12
m_Deferred:
m_Mode: 1
m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0}
m_DeferredReflections:
m_Mode: 1
m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0}
m_ScreenSpaceShadows:
m_Mode: 1
m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0}
m_LegacyDeferred:
m_Mode: 1
m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0}
m_DepthNormals:
m_Mode: 1
m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0}
m_MotionVectors:
m_Mode: 1
m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0}
m_LightHalo:
m_Mode: 1
m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0}
m_LensFlare:
m_Mode: 1
m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0}
m_AlwaysIncludedShaders:
- {fileID: 7, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0}
m_PreloadedShaders: []
m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000,
type: 0}
m_CustomRenderPipeline: {fileID: 0}
m_TransparencySortMode: 0
m_TransparencySortAxis: {x: 0, y: 0, z: 1}
m_DefaultRenderingPath: 1
m_DefaultMobileRenderingPath: 1
m_TierSettings: []
m_LightmapStripping: 0
m_FogStripping: 0
m_InstancingStripping: 0
m_LightmapKeepPlain: 1
m_LightmapKeepDirCombined: 1
m_LightmapKeepDynamicPlain: 1
m_LightmapKeepDynamicDirCombined: 1
m_LightmapKeepShadowMask: 1
m_LightmapKeepSubtractive: 1
m_FogKeepLinear: 1
m_FogKeepExp: 1
m_FogKeepExp2: 1
m_AlbedoSwatchInfos: []
m_LightsUseLinearIntensity: 0
m_LightsUseColorTemperature: 0
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!30 &1
GraphicsSettings:
m_ObjectHideFlags: 0
serializedVersion: 12
m_Deferred:
m_Mode: 1
m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0}
m_DeferredReflections:
m_Mode: 1
m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0}
m_ScreenSpaceShadows:
m_Mode: 1
m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0}
m_LegacyDeferred:
m_Mode: 1
m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0}
m_DepthNormals:
m_Mode: 1
m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0}
m_MotionVectors:
m_Mode: 1
m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0}
m_LightHalo:
m_Mode: 1
m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0}
m_LensFlare:
m_Mode: 1
m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0}
m_AlwaysIncludedShaders:
- {fileID: 7, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0}
m_PreloadedShaders: []
m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000,
type: 0}
m_CustomRenderPipeline: {fileID: 11400000, guid: 9c068d834ef325345b87395bd103e074,
type: 2}
m_TransparencySortMode: 0
m_TransparencySortAxis: {x: 0, y: 0, z: 1}
m_DefaultRenderingPath: 1
m_DefaultMobileRenderingPath: 1
m_TierSettings: []
m_LightmapStripping: 0
m_FogStripping: 0
m_InstancingStripping: 0
m_LightmapKeepPlain: 1
m_LightmapKeepDirCombined: 1
m_LightmapKeepDynamicPlain: 1
m_LightmapKeepDynamicDirCombined: 1
m_LightmapKeepShadowMask: 1
m_LightmapKeepSubtractive: 1
m_FogKeepLinear: 1
m_FogKeepExp: 1
m_FogKeepExp2: 1
m_AlbedoSwatchInfos: []
m_LightsUseLinearIntensity: 1
m_LightsUseColorTemperature: 0

14
TestProjects/ShaderGraph/ProjectSettings/ProjectSettings.asset


defaultScreenWidthWeb: 960
defaultScreenHeightWeb: 600
m_StereoRenderingPath: 0
m_ActiveColorSpace: 0
m_ActiveColorSpace: 1
m_MTRendering: 1
m_StackTraceTypes: 010000000100000001000000010000000100000001000000
iosShowActivityIndicatorOnLoading: -1

use32BitDisplayBuffer: 1
preserveFramebufferAlpha: 0
disableDepthAndStencilBuffers: 0
androidStartInFullscreen: 1
androidBlitType: 0
defaultIsNativeResolution: 1
macRetinaSupport: 1

switchDataLossConfirmation: 0
switchSupportedNpadStyles: 3
switchNativeFsCacheSize: 32
switchIsHoldTypeHorizontal: 0
switchSupportedNpadCount: 8
switchSocketConfigEnabled: 0
switchTcpInitialSendBufferSize: 32
switchTcpInitialReceiveBufferSize: 64

platformArchitecture: {}
scriptingBackend: {}
il2cppCompilerConfiguration: {}
managedStrippingLevel: {}
incrementalIl2cppBuild: {}
allowUnsafeCode: 0
additionalIl2CppArgs:

cloudServicesEnabled:
UNet: 1
facebookSdkVersion: 7.9.4
facebookAppId:
facebookCookies: 1
facebookLogging: 1
facebookStatus: 1
facebookXfbml: 0
facebookFrictionlessRequests: 1
framebufferDepthMemorylessMode: 0
legacyClampBlendShapeWeights: 0

5
build.py


("com.unity.render-pipelines.lightweight", os.path.join("com.unity.render-pipelines.lightweight")),
("com.unity.render-pipelines.high-definition", os.path.join("com.unity.render-pipelines.high-definition")),
("com.unity.shadergraph", os.path.join("com.unity.shadergraph")),
("com.unity.postprocessing", os.path.join("com.unity.postprocessing")),
("com.unity.testframework.graphics", os.path.join("com.unity.testframework.graphics")),
]
def test_packages_list():

"com.unity.render-pipelines.high-definition",
"com.unity.shadergraph"
"com.unity.shadergraph",
"com.unity.postprocessing"
]
if __name__ == "__main__":

3
com.unity.render-pipelines.core/CHANGELOG.md


## [Unreleased]
### Added
- Add PCSS shadow filter
### Improvements
- Improved volume UI & styling

13
com.unity.render-pipelines.core/CoreRP/Debugging/MousePositionDebug.cs


public static void Cleanup()
{
if (s_Instance != null)
DestroyImmediate(s_Instance.gameObject);
{
// Either we call DestroyImmediate or Destroy we get an error :(
// GameViewEventCatcher is only use for SSR debugging currently so comment this code and uncomment it if you want to debug SSR
//DestroyImmediate(s_Instance.gameObject);
//Destroy(s_Instance.gameObject);
}
}
public static void Build()

#if UNITY_EDITOR
UnityEditor.SceneView.onSceneGUIDelegate -= OnSceneGUI;
UnityEditor.SceneView.onSceneGUIDelegate += OnSceneGUI;
GameViewEventCatcher.Build();
// Disabled as it cause error: GameViewEventCatcher is only use for SSR debugging currently so comment this code and uncomment it if you want to debug SSR
//GameViewEventCatcher.Build();
#endif
}

UnityEditor.SceneView.onSceneGUIDelegate -= OnSceneGUI;
GameViewEventCatcher.Cleanup();
// Disabled as it cause error: GameViewEventCatcher is only use for SSR debugging currently so comment this code and uncomment it if you want to debug SSR
//GameViewEventCatcher.Cleanup();
#endif
}

294
com.unity.render-pipelines.core/CoreRP/Editor/CoreEditorUtils.cs


using System;
using System.IO;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;

namespace UnityEditor.Experimental.Rendering
{
using UnityObject = UnityEngine.Object;
public static class CoreEditorUtils
{
// GUIContent cache utilities

return group.isExpanded;
}
static readonly GUIContent[] k_DrawVector6Slider_LabelPositives =
static readonly GUIContent[] k_DrawVector6_Label =
new GUIContent("+X"),
new GUIContent("+Y"),
new GUIContent("+Z"),
};
static readonly GUIContent[] k_DrawVector6Slider_LabelNegatives =
{
new GUIContent("-X"),
new GUIContent("-Y"),
new GUIContent("-Z"),
new GUIContent("X"),
new GUIContent("Y"),
new GUIContent("Z"),
public static void DrawVector6Slider(GUIContent label, SerializedProperty positive, SerializedProperty negative, Vector3 min, Vector3 max)
public static void DrawVector6(GUIContent label, SerializedProperty positive, SerializedProperty negative, Vector3 min, Vector3 max, Color[][] colors = null)
if (colors != null && (colors.Length != 2 || colors[0].Length != 3 || colors[1].Length != 3))
throw new System.ArgumentException("Colors must be a 2x3 array.");
EditorGUILayout.LabelField(label);
if(label != GUIContent.none)
EditorGUILayout.LabelField(label);
v = DrawVector3Slider(rect, k_DrawVector6Slider_LabelPositives, v, min, max);
v = DrawVector3(rect, k_DrawVector6_Label, v, min, max, false, colors == null ? null : colors[0]);
if (EditorGUI.EndChangeCheck())
positive.vector3Value = v;

v = negative.vector3Value;
EditorGUI.BeginChangeCheck();
v = DrawVector3Slider(rect, k_DrawVector6Slider_LabelNegatives, v, min, max);
v = DrawVector3(rect, k_DrawVector6_Label, v, min, max, true, colors == null ? null : colors[1]);
if (EditorGUI.EndChangeCheck())
negative.vector3Value = v;
--EditorGUI.indentLevel;

static Vector3 DrawVector3Slider(Rect rect, GUIContent[] labels, Vector3 value, Vector3 min, Vector3 max)
static Vector3 DrawVector3(Rect rect, GUIContent[] labels, Vector3 value, Vector3 min, Vector3 max, bool addMinusPrefix, Color[] colors)
// Use a corrected width due to the hacks used for layouting the slider properly below
rect.width -= 20;
var fieldWidth = rect.width / 3f;
float[] multifloat = new float[] { value.x, value.y, value.z };
rect = EditorGUI.IndentedRect(rect);
float fieldWidth = rect.width / 3f;
EditorGUI.BeginChangeCheck();
EditorGUI.MultiFloatField(rect, labels, multifloat);
if(EditorGUI.EndChangeCheck())
{
value.x = Mathf.Max(Mathf.Min(multifloat[0], max.x), min.x);
value.y = Mathf.Max(Mathf.Min(multifloat[1], max.y), min.y);
value.z = Mathf.Max(Mathf.Min(multifloat[2], max.z), min.z);
}
for (var i = 0; i < 3; ++i)
//Suffix is a hack as sublabel only work with 1 character
if(addMinusPrefix)
var c = new Rect(rect.x + fieldWidth * i, rect.y, fieldWidth, rect.height);
var labelRect = new Rect(c.x, c.y, k_DrawVector6Slider_LabelSize, c.height);
var sliderRect = new Rect(labelRect.x + labelRect.width, c.y, c.width - k_DrawVector6Slider_LabelSize - k_DrawVector6Slider_FieldSize + 45, c.height);
var fieldRect = new Rect(sliderRect.x + sliderRect.width - 25, c.y, k_DrawVector6Slider_FieldSize, c.height);
EditorGUI.LabelField(labelRect, labels[i]);
value[i] = GUI.HorizontalSlider(sliderRect, value[i], min[i], max[i]);
value[i] = EditorGUI.FloatField(fieldRect, value[i]);
Rect suffixRect = new Rect(rect.x-33, rect.y, 100, rect.height);
for(int i = 0; i < 3; ++i)
{
EditorGUI.LabelField(suffixRect, "-");
suffixRect.x += fieldWidth + .5f;
}
}
//Color is a hack as nothing is done to handle this at the moment
if(colors != null)
{
if (colors.Length != 3)
throw new System.ArgumentException("colors must have 3 elements.");
Rect suffixRect = new Rect(rect.x - 23, rect.y, 100, rect.height);
GUIStyle colorMark = new GUIStyle(EditorStyles.label);
colorMark.normal.textColor = colors[0];
EditorGUI.LabelField(suffixRect, "|", colorMark);
suffixRect.x += 1;
EditorGUI.LabelField(suffixRect, "|", colorMark);
suffixRect.x += fieldWidth - .5f;
colorMark.normal.textColor = colors[1];
EditorGUI.LabelField(suffixRect, "|", colorMark);
suffixRect.x += 1;
EditorGUI.LabelField(suffixRect, "|", colorMark);
suffixRect.x += fieldWidth + .5f;
colorMark.normal.textColor = colors[2];
EditorGUI.LabelField(suffixRect, "|", colorMark);
suffixRect.x += 1;
EditorGUI.LabelField(suffixRect, "|", colorMark);
}
return value;
}

mode = EditorGUILayout.Popup(label, mode, options);
if (EditorGUI.EndChangeCheck())
{
Undo.RecordObject(property.objectReferenceValue, property.name);
}
}
public static void DrawCascadeSplitGUI<T>(ref SerializedProperty shadowCascadeSplit)

return data;
}
}
static class ShadowCascadeSplitGUI
{
private const int kSliderbarTopMargin = 2;
private const int kSliderbarHeight = 24;
private const int kSliderbarBottomMargin = 2;
private const int kPartitionHandleWidth = 2;
private const int kPartitionHandleExtraHitAreaWidth = 2;
private static readonly Color[] kCascadeColors =
{
new Color(0.5f, 0.5f, 0.6f, 1.0f),
new Color(0.5f, 0.6f, 0.5f, 1.0f),
new Color(0.6f, 0.6f, 0.5f, 1.0f),
new Color(0.6f, 0.5f, 0.5f, 1.0f),
};
// using a LODGroup skin
private static readonly GUIStyle s_CascadeSliderBG = "LODSliderRange";
private static readonly GUIStyle s_TextCenteredStyle = new GUIStyle(EditorStyles.whiteMiniLabel)
static public GameObject CreateGameObject(GameObject parent, string name, params Type[] types)
alignment = TextAnchor.MiddleCenter
};
return ObjectFactory.CreateGameObject(GameObjectUtility.GetUniqueNameForSibling(parent != null ? parent.transform : null, name), types);
}
// Internal struct to bundle drag information
private class DragCache
static public string GetCurrentProjectVersion()
public int m_ActivePartition; // the cascade partition that we are currently dragging/resizing
public float m_NormalizedPartitionSize; // the normalized size of the partition (0.0f < size < 1.0f)
public Vector2 m_LastCachedMousePosition; // mouse position the last time we registered a drag or mouse down.
public DragCache(int activePartition, float normalizedPartitionSize, Vector2 currentMousePos)
{
m_ActivePartition = activePartition;
m_NormalizedPartitionSize = normalizedPartitionSize;
m_LastCachedMousePosition = currentMousePos;
}
};
private static DragCache s_DragCache;
private static readonly int s_CascadeSliderId = "s_CascadeSliderId".GetHashCode();
private static SceneView s_RestoreSceneView;
private static SceneView.CameraMode s_OldSceneDrawMode;
private static bool s_OldSceneLightingMode;
string[] readText = File.ReadAllLines("ProjectSettings/ProjectVersion.txt");
// format is m_EditorVersion: 2018.2.0b7
string[] versionText = readText[0].Split(' ');
return versionText[1];
}
/**
* Static function to handle the GUI and User input related to the cascade slider.
*
* @param normalizedCascadePartition The array of partition sizes in the range 0.0f - 1.0f; expects ONE entry if cascades = 2, and THREE if cascades=4
* The last entry will be automatically determined by summing up the array, and doing 1.0f - sum
*/
public static void HandleCascadeSliderGUI(ref float[] normalizedCascadePartitions)
static public void CheckOutFile(bool VCSEnabled, UnityObject mat)
EditorGUILayout.LabelField("Cascade splits");
// get the inspector width since we need it while drawing the partition rects.
// Only way currently is to reserve the block in the layout using GetRect(), and then immediately drawing the empty box
// to match the call to GetRect.
// From this point on, we move to non-layout based code.
var sliderRect = GUILayoutUtility.GetRect(GUIContent.none
, s_CascadeSliderBG
, GUILayout.Height(kSliderbarTopMargin + kSliderbarHeight + kSliderbarBottomMargin)
, GUILayout.ExpandWidth(true));
GUI.Box(sliderRect, GUIContent.none);
float currentX = sliderRect.x;
float cascadeBoxStartY = sliderRect.y + kSliderbarTopMargin;
float cascadeSliderWidth = sliderRect.width - (normalizedCascadePartitions.Length * kPartitionHandleWidth);
Color origTextColor = GUI.color;
Color origBackgroundColor = GUI.backgroundColor;
int colorIndex = -1;
// setup the array locally with the last partition
float[] adjustedCascadePartitions = new float[normalizedCascadePartitions.Length + 1];
System.Array.Copy(normalizedCascadePartitions, adjustedCascadePartitions, normalizedCascadePartitions.Length);
adjustedCascadePartitions[adjustedCascadePartitions.Length - 1] = 1.0f - normalizedCascadePartitions.Sum();
// check for user input on any of the partition handles
// this mechanism gets the current event in the queue... make sure that the mouse is over our control before consuming the event
int sliderControlId = GUIUtility.GetControlID(s_CascadeSliderId, FocusType.Passive);
Event currentEvent = Event.current;
int hotPartitionHandleIndex = -1; // the index of any partition handle that we are hovering over or dragging
// draw each cascade partition
for (int i = 0; i < adjustedCascadePartitions.Length; ++i)
if (VCSEnabled)
float currentPartition = adjustedCascadePartitions[i];
colorIndex = (colorIndex + 1) % kCascadeColors.Length;
GUI.backgroundColor = kCascadeColors[colorIndex];
float boxLength = (cascadeSliderWidth * currentPartition);
UnityEditor.VersionControl.Task task = UnityEditor.VersionControl.Provider.Checkout(mat, UnityEditor.VersionControl.CheckoutMode.Both);
// main cascade box
Rect partitionRect = new Rect(currentX, cascadeBoxStartY, boxLength, kSliderbarHeight);
GUI.Box(partitionRect, GUIContent.none, s_CascadeSliderBG);
currentX += boxLength;
// cascade box percentage text
GUI.color = Color.white;
Rect textRect = partitionRect;
var cascadeText = string.Format("{0}\n{1:F1}%", i, currentPartition * 100.0f);
GUI.Label(textRect, cascadeText, s_TextCenteredStyle);
// no need to draw the partition handle for last box
if (i == adjustedCascadePartitions.Length - 1)
break;
// partition handle
GUI.backgroundColor = Color.black;
Rect handleRect = partitionRect;
handleRect.x = currentX;
handleRect.width = kPartitionHandleWidth;
GUI.Box(handleRect, GUIContent.none, s_CascadeSliderBG);
// we want a thin handle visually (since wide black bar looks bad), but a slightly larger
// hit area for easier manipulation
Rect handleHitRect = handleRect;
handleHitRect.xMin -= kPartitionHandleExtraHitAreaWidth;
handleHitRect.xMax += kPartitionHandleExtraHitAreaWidth;
if (handleHitRect.Contains(currentEvent.mousePosition))
hotPartitionHandleIndex = i;
// add regions to slider where the cursor changes to Resize-Horizontal
if (s_DragCache == null)
if (!task.success)
EditorGUIUtility.AddCursorRect(handleHitRect, MouseCursor.ResizeHorizontal, sliderControlId);
Debug.Log(task.text + " " + task.resultCode);
currentX += kPartitionHandleWidth;
}
GUI.color = origTextColor;
GUI.backgroundColor = origBackgroundColor;
EventType eventType = currentEvent.GetTypeForControl(sliderControlId);
switch (eventType)
{
case EventType.MouseDown:
if (hotPartitionHandleIndex >= 0)
{
s_DragCache = new DragCache(hotPartitionHandleIndex, normalizedCascadePartitions[hotPartitionHandleIndex], currentEvent.mousePosition);
if (GUIUtility.hotControl == 0)
GUIUtility.hotControl = sliderControlId;
currentEvent.Use();
// Switch active scene view into shadow cascades visualization mode, once we start
// tweaking cascade splits.
if (s_RestoreSceneView == null)
{
s_RestoreSceneView = SceneView.lastActiveSceneView;
if (s_RestoreSceneView != null)
{
s_OldSceneDrawMode = s_RestoreSceneView.cameraMode;
s_OldSceneLightingMode = s_RestoreSceneView.m_SceneLighting;
s_RestoreSceneView.cameraMode = SceneView.GetBuiltinCameraMode(DrawCameraMode.ShadowCascades);
}
}
}
break;
case EventType.MouseUp:
// mouseUp event anywhere should release the hotcontrol (if it belongs to us), drags (if any)
if (GUIUtility.hotControl == sliderControlId)
{
GUIUtility.hotControl = 0;
currentEvent.Use();
}
s_DragCache = null;
// Restore previous scene view drawing mode once we stop tweaking cascade splits.
if (s_RestoreSceneView != null)
{
s_RestoreSceneView.cameraMode = s_OldSceneDrawMode;
s_RestoreSceneView.m_SceneLighting = s_OldSceneLightingMode;
s_RestoreSceneView = null;
}
break;
case EventType.MouseDrag:
if (GUIUtility.hotControl != sliderControlId)
break;
// convert the mouse movement to normalized cascade width. Make sure that we are safe to apply the delta before using it.
float delta = (currentEvent.mousePosition - s_DragCache.m_LastCachedMousePosition).x / cascadeSliderWidth;
bool isLeftPartitionHappy = ((adjustedCascadePartitions[s_DragCache.m_ActivePartition] + delta) > 0.0f);
bool isRightPartitionHappy = ((adjustedCascadePartitions[s_DragCache.m_ActivePartition + 1] - delta) > 0.0f);
if (isLeftPartitionHappy && isRightPartitionHappy)
{
s_DragCache.m_NormalizedPartitionSize += delta;
normalizedCascadePartitions[s_DragCache.m_ActivePartition] = s_DragCache.m_NormalizedPartitionSize;
if (s_DragCache.m_ActivePartition < normalizedCascadePartitions.Length - 1)
normalizedCascadePartitions[s_DragCache.m_ActivePartition + 1] -= delta;
GUI.changed = true;
}
s_DragCache.m_LastCachedMousePosition = currentEvent.mousePosition;
currentEvent.Use();
break;
}
}
}

4
com.unity.render-pipelines.core/CoreRP/Editor/Debugging/DebugWindow.cs


s_TypeMapDirty = false;
}
[MenuItem("Window/Render Pipeline/Debug Window", priority = CoreUtils.editMenuPriority2)]
[MenuItem("Window/General/Render Pipeline Debug", priority = 112)] // 112 is hardcoded number given by the UxTeam to fit correctly in the Windows menu
window.titleContent = new GUIContent("Debugging");
window.titleContent = new GUIContent("Debug");
}
void OnEnable()

12
com.unity.render-pipelines.core/CoreRP/Editor/IncludePaths/CoreShaderIncludePaths.cs


[ShaderIncludePath]
public static string[] GetPaths()
{
var srpMarker = Directory.GetFiles(Application.dataPath, "SRPMARKER", SearchOption.AllDirectories).FirstOrDefault();
var paths = new string[srpMarker == null ? 1 : 2];
var index = 0;
if (srpMarker != null)
{
var rootPath = Directory.GetParent(srpMarker).ToString();
paths[index] = Path.Combine(rootPath, "ScriptableRenderPipeline/Core");
index++;
}
paths[index] = Path.GetFullPath("Packages/com.unity.render-pipelines.core");
var paths = new string[1];
paths[0] = Path.GetFullPath("Packages/com.unity.render-pipelines.core");
return paths;
}
}

5
com.unity.render-pipelines.core/CoreRP/Editor/ShaderGenerator/ShaderTypeGeneration.cs


}
}
shaderText += "\treturn value." + acc.name + swizzle + ";\n";
shaderText +=
//"\t"
" " // unity convention use space instead of tab...
+ "return value." + acc.name + swizzle + ";\n";
shaderText += "}\n";
}

7
com.unity.render-pipelines.core/CoreRP/Inputs/InputRegistering.cs


public static void RegisterInputs(List<InputManagerEntry> entries)
{
// Grab reference to input manager
var inputManager = AssetDatabase.LoadAllAssetsAtPath("ProjectSettings/InputManager.asset")[0];
var assets = AssetDatabase.LoadAllAssetsAtPath("ProjectSettings/InputManager.asset");
// Temporary fix. This happens some time with HDRP init when it's called before asset database is initialized (probably related to package load order).
if (assets.Length == 0)
return;
var inputManager = assets[0];
// Wrap in serialized object
var soInputManager = new SerializedObject(inputManager);

44
com.unity.render-pipelines.core/CoreRP/ShaderLibrary/API/D3D11.hlsl


#define TEXTURECUBE_ARRAY_SHADOW(textureName) TEXTURECUBE_ARRAY(textureName)
#define RW_TEXTURE2D(type, textureName) RWTexture2D<type> textureName
#define RW_TEXTURE2D_ARRAY(type, textureName) RWTexture2DArray<type> textureName
#define RW_TEXTURE3D(type, textureName) RWTexture3D<type> textureName
#define SAMPLER(samplerName) SamplerState samplerName

#define TEXTURECUBE_SHADOW_PARAM(textureName, samplerName) textureName, samplerName
#define TEXTURECUBE_ARRAY_SHADOW_PARAM(textureName, samplerName) textureName, samplerName
#define SAMPLE_TEXTURE2D(textureName, samplerName, coord2) textureName.Sample(samplerName, coord2)
#define SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod) textureName.SampleLevel(samplerName, coord2, lod)
#define SAMPLE_TEXTURE2D_BIAS(textureName, samplerName, coord2, bias) textureName.SampleBias(samplerName, coord2, bias)
#define SAMPLE_TEXTURE2D_GRAD(textureName, samplerName, coord2, dpdx, dpdy) textureName.SampleGrad(samplerName, coord2, dpdx, dpdy)
#define SAMPLE_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Sample(samplerName, float3(coord2, index))
#define SAMPLE_TEXTURE2D_ARRAY_LOD(textureName, samplerName, coord2, index, lod) textureName.SampleLevel(samplerName, float3(coord2, index), lod)
#define SAMPLE_TEXTURE2D_ARRAY_BIAS(textureName, samplerName, coord2, index, bias) textureName.SampleBias(samplerName, float3(coord2, index), bias)
#define SAMPLE_TEXTURECUBE(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3)
#define SAMPLE_TEXTURECUBE_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod)
#define SAMPLE_TEXTURECUBE_BIAS(textureName, samplerName, coord3, bias) textureName.SampleBias(samplerName, coord3, bias)
#define SAMPLE_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Sample(samplerName, float4(coord3, index))
#define SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, lod) textureName.SampleLevel(samplerName, float4(coord3, index), lod)
#define SAMPLE_TEXTURECUBE_ARRAY_BIAS(textureName, samplerName, coord3, index, bias) textureName.SampleBias(samplerName, float4(coord3, index), bias)
#define SAMPLE_TEXTURE3D(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3)
#define SAMPLE_TEXTURE3D_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod)
#define SAMPLE_TEXTURE2D(textureName, samplerName, coord2) textureName.Sample(samplerName, coord2)
#define SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod) textureName.SampleLevel(samplerName, coord2, lod)
#define SAMPLE_TEXTURE2D_BIAS(textureName, samplerName, coord2, bias) textureName.SampleBias(samplerName, coord2, bias)
#define SAMPLE_TEXTURE2D_GRAD(textureName, samplerName, coord2, dpdx, dpdy) textureName.SampleGrad(samplerName, coord2, dpdx, dpdy)
#define SAMPLE_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Sample(samplerName, float3(coord2, index))
#define SAMPLE_TEXTURE2D_ARRAY_LOD(textureName, samplerName, coord2, index, lod) textureName.SampleLevel(samplerName, float3(coord2, index), lod)
#define SAMPLE_TEXTURE2D_ARRAY_BIAS(textureName, samplerName, coord2, index, bias) textureName.SampleBias(samplerName, float3(coord2, index), bias)
#define SAMPLE_TEXTURE2D_ARRAY_GRAD(textureName, samplerName, coord2, index, dpdx, dpdy) textureName.SampleGrad(samplerName, float3(coord2, index), dpdx, dpdy)
#define SAMPLE_TEXTURECUBE(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3)
#define SAMPLE_TEXTURECUBE_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod)
#define SAMPLE_TEXTURECUBE_BIAS(textureName, samplerName, coord3, bias) textureName.SampleBias(samplerName, coord3, bias)
#define SAMPLE_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Sample(samplerName, float4(coord3, index))
#define SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, lod) textureName.SampleLevel(samplerName, float4(coord3, index), lod)
#define SAMPLE_TEXTURECUBE_ARRAY_BIAS(textureName, samplerName, coord3, index, bias) textureName.SampleBias(samplerName, float4(coord3, index), bias)
#define SAMPLE_TEXTURE3D(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3)
#define SAMPLE_TEXTURE3D_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod)
#define SAMPLE_TEXTURE2D_SHADOW(textureName, samplerName, coord3) textureName.SampleCmpLevelZero(samplerName, (coord3).xy, (coord3).z)
#define SAMPLE_TEXTURE2D_ARRAY_SHADOW(textureName, samplerName, coord3, index) textureName.SampleCmpLevelZero(samplerName, float3((coord3).xy, index), (coord3).z)

#define LOAD_TEXTURE3D_LOD(textureName, unCoord3, lod) textureName.Load(int4(unCoord3, lod))
#define PLATFORM_SUPPORT_GATHER
#define GATHER_TEXTURE2D(textureName, samplerName, coord2, offset) textureName.Gather(samplerName, coord2, offset)
#define GATHER_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Gather(samplerName, float3(coord2, index), offset)
#define GATHER_TEXTURE2D(textureName, samplerName, coord2) textureName.Gather(samplerName, coord2)
#define GATHER_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Gather(samplerName, float3(coord2, index))
#define GATHER_RED_TEXTURE2D(textureName, samplerName, coord2, offset) textureName.GatherRed(samplerName, coord2, offset)
#define GATHER_GREEN_TEXTURE2D(textureName, samplerName, coord2, offset) textureName.GatherGreen(samplerName, coord2, offset)
#define GATHER_BLUE_TEXTURE2D(textureName, samplerName, coord2, offset) textureName.GatherBlue(samplerName, coord2, offset)
#define GATHER_RED_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherRed(samplerName, coord2)
#define GATHER_GREEN_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherGreen(samplerName, coord2)
#define GATHER_BLUE_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherBlue(samplerName, coord2)
#define GATHER_ALPHA_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherAlpha(samplerName, coord2)

23
com.unity.render-pipelines.core/CoreRP/ShaderLibrary/API/GLCore.hlsl


#define TEXTURECUBE_ARRAY_SHADOW(textureName) TEXTURECUBE_ARRAY(textureName)
#define RW_TEXTURE2D(type, textureName) RWTexture2D<type> textureName
#define RW_TEXTURE2D_ARRAY(type, textureName) RWTexture2DArray<type> textureName
#define RW_TEXTURE3D(type, textureName) RWTexture3D<type> textureName
#define SAMPLER(samplerName) SamplerState samplerName

#define TEXTURECUBE_SHADOW_PARAM(textureName, samplerName) textureName, samplerName
#define TEXTURECUBE_ARRAY_SHADOW_PARAM(textureName, samplerName) textureName, samplerName
#define SAMPLE_TEXTURE2D(textureName, samplerName, coord2) textureName.Sample(samplerName, coord2)
#define SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod) textureName.SampleLevel(samplerName, coord2, lod)
#define SAMPLE_TEXTURE2D_BIAS(textureName, samplerName, coord2, bias) textureName.SampleBias(samplerName, coord2, bias)
#define SAMPLE_TEXTURE2D_GRAD(textureName, samplerName, coord2, ddx, ddy) textureName.SampleGrad(samplerName, coord2, ddx, ddy)
#define SAMPLE_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Sample(samplerName, float3(coord2, index))
#define SAMPLE_TEXTURE2D_ARRAY_LOD(textureName, samplerName, coord2, index, lod) textureName.SampleLevel(samplerName, float3(coord2, index), lod)
#define SAMPLE_TEXTURE2D_ARRAY_BIAS(textureName, samplerName, coord2, index, bias) textureName.SampleBias(samplerName, float3(coord2, index), bias)
#define SAMPLE_TEXTURECUBE(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3)
#define SAMPLE_TEXTURECUBE_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod)
#define SAMPLE_TEXTURECUBE_BIAS(textureName, samplerName, coord3, bias) textureName.SampleBias(samplerName, coord3, bias)
#define SAMPLE_TEXTURE2D(textureName, samplerName, coord2) textureName.Sample(samplerName, coord2)
#define SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod) textureName.SampleLevel(samplerName, coord2, lod)
#define SAMPLE_TEXTURE2D_BIAS(textureName, samplerName, coord2, bias) textureName.SampleBias(samplerName, coord2, bias)
#define SAMPLE_TEXTURE2D_GRAD(textureName, samplerName, coord2, ddx, ddy) textureName.SampleGrad(samplerName, coord2, ddx, ddy)
#define SAMPLE_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Sample(samplerName, float3(coord2, index))
#define SAMPLE_TEXTURE2D_ARRAY_LOD(textureName, samplerName, coord2, index, lod) textureName.SampleLevel(samplerName, float3(coord2, index), lod)
#define SAMPLE_TEXTURE2D_ARRAY_BIAS(textureName, samplerName, coord2, index, bias) textureName.SampleBias(samplerName, float3(coord2, index), bias)
#define SAMPLE_TEXTURE2D_ARRAY_GRAD(textureName, samplerName, coord2, index, dpdx, dpdy) textureName.SampleGrad(samplerName, float3(coord2, index), dpdx, dpdy)
#define SAMPLE_TEXTURECUBE(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3)
#define SAMPLE_TEXTURECUBE_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod)
#define SAMPLE_TEXTURECUBE_BIAS(textureName, samplerName, coord3, bias) textureName.SampleBias(samplerName, coord3, bias)
#ifdef UNITY_NO_CUBEMAP_ARRAY
#define SAMPLE_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURECUBE_ARRAY)
#define SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, lod) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURECUBE_ARRAY_LOD)

#define GATHER_TEXTURECUBE(textureName, samplerName, coord3) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_TEXTURECUBE)
#define GATHER_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_TEXTURECUBE_ARRAY)
#endif

2
com.unity.render-pipelines.core/CoreRP/ShaderLibrary/API/GLES2.hlsl


#define TEXTURECUBE_ARRAY_SHADOW(textureName) TEXTURECUBE_SHADOW(textureName) // No support to texture array
#define RW_TEXTURE2D(type, textureNam) ERROR_ON_UNSUPPORTED_FUNCTION(RWTexture2D)
#define RW_TEXTURE2D_ARRAY(type, textureName) ERROR_ON_UNSUPPORTED_FUNCTION(RWTexture2DArray)
#define RW_TEXTURE3D(type, textureNam) ERROR_ON_UNSUPPORTED_FUNCTION(RWTexture3D)
#define SAMPLER(samplerName)

#define SAMPLE_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURE2D_ARRAY)
#define SAMPLE_TEXTURE2D_ARRAY_LOD(textureName, samplerName, coord2, index, lod) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURE2D_ARRAY_LOD)
#define SAMPLE_TEXTURE2D_ARRAY_BIAS(textureName, samplerName, coord2, index, bias) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURE2D_ARRAY_BIAS)
#define SAMPLE_TEXTURE2D_ARRAY_GRAD(textureName, samplerName, coord2, index, dpdx, dpdy) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURE2D_ARRAY_GRAD)
#define SAMPLE_TEXTURECUBE(textureName, samplerName, coord3) texCUBE(textureName, coord3)
// No lod support. Very poor approximation with bias.
#define SAMPLE_TEXTURECUBE_LOD(textureName, samplerName, coord3, lod) SAMPLE_TEXTURECUBE_BIAS(textureName, samplerName, coord3, lod)

23
com.unity.render-pipelines.core/CoreRP/ShaderLibrary/API/GLES3.hlsl


#define TEXTURECUBE_ARRAY_SHADOW(textureName) TEXTURECUBE_ARRAY(textureName)
#define RW_TEXTURE2D(type, textureName) ERROR_ON_UNSUPPORTED_FUNCTION(RWTexture2D)
#define RW_TEXTURE2D_ARRAY(type, textureName) ERROR_ON_UNSUPPORTED_FUNCTION(RWTexture2DArray)
#define RW_TEXTURE3D(type, textureName) ERROR_ON_UNSUPPORTED_FUNCTION(RWTexture3D)
#define SAMPLER(samplerName) SamplerState samplerName

#define TEXTURECUBE_SHADOW_PARAM(textureName, samplerName) textureName, samplerName
#define TEXTURECUBE_ARRAY_SHADOW_PARAM(textureName, samplerName) textureName, samplerName
#define SAMPLE_TEXTURE2D(textureName, samplerName, coord2) textureName.Sample(samplerName, coord2)
#define SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod) textureName.SampleLevel(samplerName, coord2, lod)
#define SAMPLE_TEXTURE2D_BIAS(textureName, samplerName, coord2, bias) textureName.SampleBias(samplerName, coord2, bias)
#define SAMPLE_TEXTURE2D_GRAD(textureName, samplerName, coord2, ddx, ddy) textureName.SampleGrad(samplerName, coord2, ddx, ddy)
#define SAMPLE_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Sample(samplerName, float3(coord2, index))
#define SAMPLE_TEXTURE2D_ARRAY_LOD(textureName, samplerName, coord2, index, lod) textureName.SampleLevel(samplerName, float3(coord2, index), lod)
#define SAMPLE_TEXTURE2D_ARRAY_BIAS(textureName, samplerName, coord2, index, bias) textureName.SampleBias(samplerName, float3(coord2, index), bias)
#define SAMPLE_TEXTURECUBE(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3)
#define SAMPLE_TEXTURECUBE_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod)
#define SAMPLE_TEXTURECUBE_BIAS(textureName, samplerName, coord3, bias) textureName.SampleBias(samplerName, coord3, bias)
#define SAMPLE_TEXTURE2D(textureName, samplerName, coord2) textureName.Sample(samplerName, coord2)
#define SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod) textureName.SampleLevel(samplerName, coord2, lod)
#define SAMPLE_TEXTURE2D_BIAS(textureName, samplerName, coord2, bias) textureName.SampleBias(samplerName, coord2, bias)
#define SAMPLE_TEXTURE2D_GRAD(textureName, samplerName, coord2, ddx, ddy) textureName.SampleGrad(samplerName, coord2, ddx, ddy)
#define SAMPLE_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Sample(samplerName, float3(coord2, index))
#define SAMPLE_TEXTURE2D_ARRAY_LOD(textureName, samplerName, coord2, index, lod) textureName.SampleLevel(samplerName, float3(coord2, index), lod)
#define SAMPLE_TEXTURE2D_ARRAY_BIAS(textureName, samplerName, coord2, index, bias) textureName.SampleBias(samplerName, float3(coord2, index), bias)
#define SAMPLE_TEXTURE2D_ARRAY_GRAD(textureName, samplerName, coord2, index, dpdx, dpdy) textureName.SampleGrad(samplerName, float3(coord2, index), dpdx, dpdy)
#define SAMPLE_TEXTURECUBE(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3)
#define SAMPLE_TEXTURECUBE_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod)
#define SAMPLE_TEXTURECUBE_BIAS(textureName, samplerName, coord3, bias) textureName.SampleBias(samplerName, coord3, bias)
#ifdef UNITY_NO_CUBEMAP_ARRAY
#define SAMPLE_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURECUBE_ARRAY)

#define GATHER_TEXTURECUBE(textureName, samplerName, coord3) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_TEXTURECUBE)
#define GATHER_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_TEXTURECUBE_ARRAY)
#endif

41
com.unity.render-pipelines.core/CoreRP/ShaderLibrary/API/Metal.hlsl


#define TEXTURECUBE_ARRAY_SHADOW(textureName) TEXTURECUBE_ARRAY(textureName)
#define RW_TEXTURE2D(type, textureName) RWTexture2D<type> textureName
#define RW_TEXTURE2D_ARRAY(type, textureName) RWTexture2DArray<type> textureName
#define RW_TEXTURE3D(type, textureName) RWTexture3D<type> textureName
#define SAMPLER(samplerName) SamplerState samplerName

#define TEXTURECUBE_SHADOW_PARAM(textureName, samplerName) textureName, samplerName
#define TEXTURECUBE_ARRAY_SHADOW_PARAM(textureName, samplerName) textureName, samplerName
#define SAMPLE_TEXTURE2D(textureName, samplerName, coord2) textureName.Sample(samplerName, coord2)
#define SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod) textureName.SampleLevel(samplerName, coord2, lod)
#define SAMPLE_TEXTURE2D_BIAS(textureName, samplerName, coord2, bias) textureName.SampleBias(samplerName, coord2, bias)
#define SAMPLE_TEXTURE2D_GRAD(textureName, samplerName, coord2, dpdx, dpdy) textureName.SampleGrad(samplerName, coord2, dpdx, dpdy)
#define SAMPLE_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Sample(samplerName, float3(coord2, index))
#define SAMPLE_TEXTURE2D_ARRAY_LOD(textureName, samplerName, coord2, index, lod) textureName.SampleLevel(samplerName, float3(coord2, index), lod)
#define SAMPLE_TEXTURE2D_ARRAY_BIAS(textureName, samplerName, coord2, index, bias) textureName.SampleBias(samplerName, float3(coord2, index), bias)
#define SAMPLE_TEXTURECUBE(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3)
#define SAMPLE_TEXTURECUBE_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod)
#define SAMPLE_TEXTURECUBE_BIAS(textureName, samplerName, coord3, bias) textureName.SampleBias(samplerName, coord3, bias)
#define SAMPLE_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Sample(samplerName, float4(coord3, index))
#define SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, lod) textureName.SampleLevel(samplerName, float4(coord3, index), lod)
#define SAMPLE_TEXTURECUBE_ARRAY_BIAS(textureName, samplerName, coord3, index, bias) textureName.SampleBias(samplerName, float4(coord3, index), bias)
#define SAMPLE_TEXTURE3D(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3)
#define SAMPLE_TEXTURE3D_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod)
#define SAMPLE_TEXTURE2D(textureName, samplerName, coord2) textureName.Sample(samplerName, coord2)
#define SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod) textureName.SampleLevel(samplerName, coord2, lod)
#define SAMPLE_TEXTURE2D_BIAS(textureName, samplerName, coord2, bias) textureName.SampleBias(samplerName, coord2, bias)
#define SAMPLE_TEXTURE2D_GRAD(textureName, samplerName, coord2, dpdx, dpdy) textureName.SampleGrad(samplerName, coord2, dpdx, dpdy)
#define SAMPLE_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Sample(samplerName, float3(coord2, index))
#define SAMPLE_TEXTURE2D_ARRAY_LOD(textureName, samplerName, coord2, index, lod) textureName.SampleLevel(samplerName, float3(coord2, index), lod)
#define SAMPLE_TEXTURE2D_ARRAY_BIAS(textureName, samplerName, coord2, index, bias) textureName.SampleBias(samplerName, float3(coord2, index), bias)
#define SAMPLE_TEXTURE2D_ARRAY_GRAD(textureName, samplerName, coord2, index, dpdx, dpdy) textureName.SampleGrad(samplerName, float3(coord2, index), dpdx, dpdy)
#define SAMPLE_TEXTURECUBE(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3)
#define SAMPLE_TEXTURECUBE_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod)
#define SAMPLE_TEXTURECUBE_BIAS(textureName, samplerName, coord3, bias) textureName.SampleBias(samplerName, coord3, bias)
#define SAMPLE_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Sample(samplerName, float4(coord3, index))
#define SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, lod) textureName.SampleLevel(samplerName, float4(coord3, index), lod)
#define SAMPLE_TEXTURECUBE_ARRAY_BIAS(textureName, samplerName, coord3, index, bias) textureName.SampleBias(samplerName, float4(coord3, index), bias)
#define SAMPLE_TEXTURE3D(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3)
#define SAMPLE_TEXTURE3D_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod)
#define SAMPLE_TEXTURE2D_SHADOW(textureName, samplerName, coord3) textureName.SampleCmpLevelZero(samplerName, (coord3).xy, (coord3).z)
#define SAMPLE_TEXTURE2D_ARRAY_SHADOW(textureName, samplerName, coord3, index) textureName.SampleCmpLevelZero(samplerName, float3((coord3).xy, index), (coord3).z)

#define LOAD_TEXTURE3D(textureName, unCoord3) textureName.Load(int4(unCoord3, 0))
#define LOAD_TEXTURE3D_LOD(textureName, unCoord3, lod) textureName.Load(int4(unCoord3, lod))
#define PLATFORM_SUPPORT_GATHER
#define GATHER_RED_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherRed(samplerName, coord2)
#define GATHER_GREEN_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherGreen(samplerName, coord2)
#define GATHER_BLUE_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherBlue(samplerName, coord2)
#define GATHER_RED_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherRed(samplerName, coord2)
#define GATHER_GREEN_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherGreen(samplerName, coord2)
#define GATHER_BLUE_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherBlue(samplerName, coord2)
#define GATHER_ALPHA_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherAlpha(samplerName, coord2)

44
com.unity.render-pipelines.core/CoreRP/ShaderLibrary/API/PSSL.hlsl


#define TEXTURECUBE_ARRAY_SHADOW(textureName) TEXTURECUBE_ARRAY(textureName)
#define RW_TEXTURE2D(type, textureName) RW_Texture2D<type> textureName
#define RW_TEXTURE2D_ARRAY(type, textureName) RW_Texture2D_Array<type> textureName
#define RW_TEXTURE3D(type, textureName) RW_Texture3D<type> textureName
#define SAMPLER(samplerName) SamplerState samplerName

#define TEXTURECUBE_SHADOW_PARAM(textureName, samplerName) textureName, samplerName
#define TEXTURECUBE_ARRAY_SHADOW_PARAM(textureName, samplerName) textureName, samplerName
#define SAMPLE_TEXTURE2D(textureName, samplerName, coord2) textureName.Sample(samplerName, coord2)
#define SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod) textureName.SampleLevel(samplerName, coord2, lod)
#define SAMPLE_TEXTURE2D_BIAS(textureName, samplerName, coord2, bias) textureName.SampleBias(samplerName, coord2, bias)
#define SAMPLE_TEXTURE2D_GRAD(textureName, samplerName, coord2, dpdx, dpdy) textureName.SampleGrad(samplerName, coord2, dpdx, dpdy)
#define SAMPLE_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Sample(samplerName, float3(coord2, index))
#define SAMPLE_TEXTURE2D_ARRAY_LOD(textureName, samplerName, coord2, index, lod) textureName.SampleLevel(samplerName, float3(coord2, index), lod)
#define SAMPLE_TEXTURE2D_ARRAY_BIAS(textureName, samplerName, coord2, index, bias) textureName.SampleBias(samplerName, float3(coord2, index), bias)
#define SAMPLE_TEXTURECUBE(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3)
#define SAMPLE_TEXTURECUBE_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod)
#define SAMPLE_TEXTURECUBE_BIAS(textureName, samplerName, coord3, bias) textureName.SampleBias(samplerName, coord3, bias)
#define SAMPLE_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Sample(samplerName, float4(coord3, index))
#define SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, lod) textureName.SampleLevel(samplerName, float4(coord3, index), lod)
#define SAMPLE_TEXTURECUBE_ARRAY_BIAS(textureName, samplerName, coord3, index, bias) textureName.SampleBias(samplerName, float4(coord3, index), bias)
#define SAMPLE_TEXTURE3D(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3)
#define SAMPLE_TEXTURE3D_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod)
#define SAMPLE_TEXTURE2D(textureName, samplerName, coord2) textureName.Sample(samplerName, coord2)
#define SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod) textureName.SampleLevel(samplerName, coord2, lod)
#define SAMPLE_TEXTURE2D_BIAS(textureName, samplerName, coord2, bias) textureName.SampleBias(samplerName, coord2, bias)
#define SAMPLE_TEXTURE2D_GRAD(textureName, samplerName, coord2, dpdx, dpdy) textureName.SampleGrad(samplerName, coord2, dpdx, dpdy)
#define SAMPLE_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Sample(samplerName, float3(coord2, index))
#define SAMPLE_TEXTURE2D_ARRAY_LOD(textureName, samplerName, coord2, index, lod) textureName.SampleLevel(samplerName, float3(coord2, index), lod)
#define SAMPLE_TEXTURE2D_ARRAY_BIAS(textureName, samplerName, coord2, index, bias) textureName.SampleBias(samplerName, float3(coord2, index), bias)
#define SAMPLE_TEXTURE2D_ARRAY_GRAD(textureName, samplerName, coord2, index, dpdx, dpdy) textureName.SampleGrad(samplerName, float3(coord2, index), dpdx, dpdy)
#define SAMPLE_TEXTURECUBE(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3)
#define SAMPLE_TEXTURECUBE_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod)
#define SAMPLE_TEXTURECUBE_BIAS(textureName, samplerName, coord3, bias) textureName.SampleBias(samplerName, coord3, bias)
#define SAMPLE_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Sample(samplerName, float4(coord3, index))
#define SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, lod) textureName.SampleLevel(samplerName, float4(coord3, index), lod)
#define SAMPLE_TEXTURECUBE_ARRAY_BIAS(textureName, samplerName, coord3, index, bias) textureName.SampleBias(samplerName, float4(coord3, index), bias)
#define SAMPLE_TEXTURE3D(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3)
#define SAMPLE_TEXTURE3D_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod)
#define SAMPLE_TEXTURE2D_SHADOW(textureName, samplerName, coord3) textureName.SampleCmpLevelZero(samplerName, (coord3).xy, (coord3).z)
#define SAMPLE_TEXTURE2D_ARRAY_SHADOW(textureName, samplerName, coord3, index) textureName.SampleCmpLevelZero(samplerName, float3((coord3).xy, index), (coord3).z)

#define LOAD_TEXTURE3D_LOD(textureName, unCoord3, lod) textureName.Load(int4(unCoord3, lod))
#define PLATFORM_SUPPORT_GATHER
#define GATHER_TEXTURE2D(textureName, samplerName, coord2, offset) textureName.Gather(samplerName, coord2, offset)
#define GATHER_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Gather(samplerName, float3(coord2, index), offset)
#define GATHER_TEXTURE2D(textureName, samplerName, coord2) textureName.Gather(samplerName, coord2)
#define GATHER_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Gather(samplerName, float3(coord2, index))
#define GATHER_RED_TEXTURE2D(textureName, samplerName, coord2, offset) textureName.GatherRed(samplerName, coord2, offset)
#define GATHER_GREEN_TEXTURE2D(textureName, samplerName, coord2, offset) textureName.GatherGreen(samplerName, coord2, offset)
#define GATHER_BLUE_TEXTURE2D(textureName, samplerName, coord2, offset) textureName.GatherBlue(samplerName, coord2, offset)
#define GATHER_RED_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherRed(samplerName, coord2)
#define GATHER_GREEN_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherGreen(samplerName, coord2)
#define GATHER_BLUE_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherBlue(samplerName, coord2)
#define GATHER_ALPHA_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherAlpha(samplerName, coord2)

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

正在加载...
取消
保存