浏览代码

Revert to an earlier SRP package before the Shadergraph PR

/demo-work
André McGrail 5 年前
当前提交
875324db
共有 357 个文件被更改,包括 481 次插入821 次删除
  1. 1
      Packages/com.unity.render-pipelines.core/CHANGELOG.md
  2. 84
      Packages/com.unity.render-pipelines.core/Runtime/Utilities/CameraCaptureBridge.cs
  3. 2
      Packages/com.unity.render-pipelines.core/ShaderLibrary/Packing.hlsl
  4. 2
      Packages/com.unity.render-pipelines.core/package.json
  5. 4
      Packages/com.unity.render-pipelines.universal/CHANGELOG.md
  6. 4
      Packages/com.unity.render-pipelines.universal/Documentation~/Post-Processing-Channel-Mixer.md
  7. 6
      Packages/com.unity.render-pipelines.universal/Documentation~/Post-Processing-Color-Adjustments.md
  8. 4
      Packages/com.unity.render-pipelines.universal/Documentation~/Post-Processing-Color-Curves.md
  9. 6
      Packages/com.unity.render-pipelines.universal/Documentation~/Post-Processing-Film-Grain.md
  10. 4
      Packages/com.unity.render-pipelines.universal/Documentation~/Post-Processing-Lens-Distortion.md
  11. 10
      Packages/com.unity.render-pipelines.universal/Documentation~/Post-Processing-Lift-Gamma-Gain.md
  12. 4
      Packages/com.unity.render-pipelines.universal/Documentation~/Post-Processing-Panini-Projection.md
  13. 10
      Packages/com.unity.render-pipelines.universal/Documentation~/Post-Processing-Shadows-Midtones-Highlights.md
  14. 8
      Packages/com.unity.render-pipelines.universal/Documentation~/Post-Processing-Split-Toning.md
  15. 4
      Packages/com.unity.render-pipelines.universal/Documentation~/Post-Processing-White-Balance.md
  16. 34
      Packages/com.unity.render-pipelines.universal/Documentation~/TableOfContents.md
  17. 13
      Packages/com.unity.render-pipelines.universal/Documentation~/index.md
  18. 10
      Packages/com.unity.render-pipelines.universal/Documentation~/integration-with-post-processing.md
  19. 12
      Packages/com.unity.render-pipelines.universal/Documentation~/rendering-in-universalrp.md
  20. 9
      Packages/com.unity.render-pipelines.universal/Documentation~/shader-stripping.md
  21. 10
      Packages/com.unity.render-pipelines.universal/Documentation~/shaders-in-universalrp.md
  22. 14
      Packages/com.unity.render-pipelines.universal/Documentation~/shading-model.md
  23. 14
      Packages/com.unity.render-pipelines.universal/Documentation~/simple-lit-shader.md
  24. 10
      Packages/com.unity.render-pipelines.universal/Documentation~/speedtree.md
  25. 22
      Packages/com.unity.render-pipelines.universal/Documentation~/universalrp-asset.md
  26. 4
      Packages/com.unity.render-pipelines.universal/Documentation~/universalrp-builtin-feature-comparison.md
  27. 14
      Packages/com.unity.render-pipelines.universal/Documentation~/unlit-shader.md
  28. 8
      Packages/com.unity.render-pipelines.universal/Documentation~/upgrading-your-shaders.md
  29. 47
      Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/MasterNodes/SpriteLitMasterNode.cs
  30. 47
      Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/MasterNodes/SpriteUnlitMasterNode.cs
  31. 1
      Packages/com.unity.render-pipelines.universal/Editor/UniversalRenderPipelineLightEditor.cs
  32. 43
      Packages/com.unity.render-pipelines.universal/Runtime/Data/UniversalRenderPipelineAsset.cs
  33. 11
      Packages/com.unity.render-pipelines.universal/Runtime/ForwardRendererData.cs
  34. 18
      Packages/com.unity.render-pipelines.universal/ShaderLibrary/MetaInput.hlsl
  35. 22
      Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl
  36. 18
      Packages/com.unity.render-pipelines.universal/Shaders/LitMetaPass.hlsl
  37. 18
      Packages/com.unity.render-pipelines.universal/Shaders/SimpleLitMetaPass.hlsl
  38. 1
      Packages/com.unity.render-pipelines.universal/Shaders/Terrain/TerrainDetailLit.shader
  39. 9
      Packages/com.unity.render-pipelines.universal/Shaders/Terrain/TerrainLitPasses.hlsl
  40. 5
      Packages/com.unity.render-pipelines.universal/Tests/Runtime/RuntimeTests.cs
  41. 2
      Packages/com.unity.render-pipelines.universal/package.json
  42. 2
      Packages/com.unity.shadergraph/CHANGELOG.md
  43. 6
      Packages/com.unity.shadergraph/Editor/AssetCallbacks/CreateShaderGraph.cs
  44. 6
      Packages/com.unity.shadergraph/Editor/Data/Enumerations/Precision.cs
  45. 31
      Packages/com.unity.shadergraph/Editor/Data/Graphs/AbstractShaderProperty.cs
  46. 2
      Packages/com.unity.shadergraph/Editor/Data/Graphs/BitangentMaterialSlot.cs
  47. 1
      Packages/com.unity.shadergraph/Editor/Data/Graphs/BooleanMaterialSlot.cs
  48. 27
      Packages/com.unity.shadergraph/Editor/Data/Graphs/BooleanShaderProperty.cs
  49. 1
      Packages/com.unity.shadergraph/Editor/Data/Graphs/ColorMaterialSlot.cs
  50. 1
      Packages/com.unity.shadergraph/Editor/Data/Graphs/ColorRGBMaterialSlot.cs
  51. 26
      Packages/com.unity.shadergraph/Editor/Data/Graphs/ColorShaderProperty.cs
  52. 1
      Packages/com.unity.shadergraph/Editor/Data/Graphs/CubemapInputMaterialSlot.cs
  53. 41
      Packages/com.unity.shadergraph/Editor/Data/Graphs/CubemapShaderProperty.cs
  54. 1
      Packages/com.unity.shadergraph/Editor/Data/Graphs/DynamicMatrixMaterialSlot.cs
  55. 1
      Packages/com.unity.shadergraph/Editor/Data/Graphs/DynamicValueMaterialSlot.cs
  56. 1
      Packages/com.unity.shadergraph/Editor/Data/Graphs/DynamicVectorMaterialSlot.cs
  57. 2
      Packages/com.unity.shadergraph/Editor/Data/Graphs/GradientInputMaterialSlot.cs
  58. 28
      Packages/com.unity.shadergraph/Editor/Data/Graphs/GradientShaderProperty.cs
  59. 3
      Packages/com.unity.shadergraph/Editor/Data/Graphs/GraphData.cs
  60. 2
      Packages/com.unity.shadergraph/Editor/Data/Graphs/MaterialSlot.cs
  61. 1
      Packages/com.unity.shadergraph/Editor/Data/Graphs/Matrix2MaterialSlot.cs
  62. 13
      Packages/com.unity.shadergraph/Editor/Data/Graphs/Matrix2ShaderProperty.cs
  63. 1
      Packages/com.unity.shadergraph/Editor/Data/Graphs/Matrix3MaterialSlot.cs
  64. 13
      Packages/com.unity.shadergraph/Editor/Data/Graphs/Matrix3ShaderProperty.cs
  65. 1
      Packages/com.unity.shadergraph/Editor/Data/Graphs/Matrix4MaterialSlot.cs
  66. 11
      Packages/com.unity.shadergraph/Editor/Data/Graphs/Matrix4ShaderProperty.cs
  67. 11
      Packages/com.unity.shadergraph/Editor/Data/Graphs/MatrixShaderProperty.cs
  68. 1
      Packages/com.unity.shadergraph/Editor/Data/Graphs/NormalMaterialSlot.cs
  69. 1
      Packages/com.unity.shadergraph/Editor/Data/Graphs/PositionMaterialSlot.cs
  70. 1
      Packages/com.unity.shadergraph/Editor/Data/Graphs/PreviewProperty.cs
  71. 25
      Packages/com.unity.shadergraph/Editor/Data/Graphs/SamplerStateShaderProperty.cs
  72. 4
      Packages/com.unity.shadergraph/Editor/Data/Graphs/SerializableCubemap.cs
  73. 4
      Packages/com.unity.shadergraph/Editor/Data/Graphs/SerializableTexture.cs
  74. 4
      Packages/com.unity.shadergraph/Editor/Data/Graphs/SerializableTextureArray.cs
  75. 173
      Packages/com.unity.shadergraph/Editor/Data/Graphs/ShaderGraphRequirements.cs
  76. 22
      Packages/com.unity.shadergraph/Editor/Data/Graphs/ShaderInput.cs
  77. 22
      Packages/com.unity.shadergraph/Editor/Data/Graphs/ShaderKeyword.cs
  78. 1
      Packages/com.unity.shadergraph/Editor/Data/Graphs/SpaceMaterialSlot.cs
  79. 1
      Packages/com.unity.shadergraph/Editor/Data/Graphs/TangentMaterialSlot.cs
  80. 1
      Packages/com.unity.shadergraph/Editor/Data/Graphs/Texture2DArrayInputMaterialSlot.cs
  81. 44
      Packages/com.unity.shadergraph/Editor/Data/Graphs/Texture2DArrayShaderProperty.cs
  82. 7
      Packages/com.unity.shadergraph/Editor/Data/Graphs/Texture2DInputMaterialSlot.cs
  83. 1
      Packages/com.unity.shadergraph/Editor/Data/Graphs/Texture3DInputMaterialSlot.cs
  84. 41
      Packages/com.unity.shadergraph/Editor/Data/Graphs/Texture3DShaderProperty.cs
  85. 1
      Packages/com.unity.shadergraph/Editor/Data/Graphs/UVMaterialSlot.cs
  86. 1
      Packages/com.unity.shadergraph/Editor/Data/Graphs/Vector1MaterialSlot.cs
  87. 33
      Packages/com.unity.shadergraph/Editor/Data/Graphs/Vector1ShaderProperty.cs
  88. 1
      Packages/com.unity.shadergraph/Editor/Data/Graphs/Vector2MaterialSlot.cs
  89. 17
      Packages/com.unity.shadergraph/Editor/Data/Graphs/Vector2ShaderProperty.cs
  90. 1
      Packages/com.unity.shadergraph/Editor/Data/Graphs/Vector3MaterialSlot.cs
  91. 19
      Packages/com.unity.shadergraph/Editor/Data/Graphs/Vector3ShaderProperty.cs
  92. 1
      Packages/com.unity.shadergraph/Editor/Data/Graphs/Vector4MaterialSlot.cs
  93. 17
      Packages/com.unity.shadergraph/Editor/Data/Graphs/Vector4ShaderProperty.cs
  94. 14
      Packages/com.unity.shadergraph/Editor/Data/Graphs/VectorShaderProperty.cs
  95. 1
      Packages/com.unity.shadergraph/Editor/Data/Graphs/ViewDirectionMaterialSlot.cs
  96. 2
      Packages/com.unity.shadergraph/Editor/Data/Graphs/KeywordEntry.cs.meta
  97. 33
      Packages/com.unity.shadergraph/Editor/Data/Implementation/NodeUtils.cs
  98. 2
      Packages/com.unity.shadergraph/Editor/Data/Interfaces/IGeneratesBodyCode.cs
  99. 2
      Packages/com.unity.shadergraph/Editor/Data/Interfaces/IGeneratesFunction.cs
  100. 1
      Packages/com.unity.shadergraph/Editor/Data/Interfaces/IMayRequireBitangent.cs

1
Packages/com.unity.render-pipelines.core/CHANGELOG.md


### Changed
- Replaced usage of ENABLE_VR in XRGraphics.cs by a version define (ENABLE_VR_MODULE) based on the presence of the built-in VR module
- `ResourceReloader` now works on non-public fields.
- Removed `normalize` from `UnpackNormalRGB` to match `UnpackNormalAG`.
- Fixed shadow routines compilation errors when "real" type is a typedef on "half".
- Removed debug menu in non development build.

84
Packages/com.unity.render-pipelines.core/Runtime/Utilities/CameraCaptureBridge.cs


#if UNITY_EDITOR
#if USE_REFLECTION
using System.Reflection;
#else
using UnityEditor.Recorder;
#endif

public static class CameraCaptureBridge
{
#if USE_REFLECTION
private static FieldInfo m_Enabled;
private static MethodInfo m_GetActions;
static FieldInfo m_Enabled;
static MethodInfo m_GetActions;
private static Dictionary<Camera, HashSet<Action<RenderTargetIdentifier, CommandBuffer>>> actionDict =
new Dictionary<Camera, HashSet<Action<RenderTargetIdentifier, CommandBuffer>>>();
private static bool _enabled;
static CameraCaptureBridge()
{
#if USE_REFLECTION

const string useCameraCaptureCallbacksFieldName = "useCameraCaptureCallbacks";
var useCameraCaptureCallbacksField = optionsType.GetField(
useCameraCaptureCallbacksFieldName,
BindingFlags.Public | BindingFlags.Static);
useCameraCaptureCallbacksFieldName, BindingFlags.Public | BindingFlags.Static);
if (useCameraCaptureCallbacksField == null)
return;

const string getActionsMethodName = "GetActions";
var getActionsMethod = captureType.GetMethod(
getActionsMethodName,
BindingFlags.Public | BindingFlags.Static);
getActionsMethodName, BindingFlags.Public | BindingFlags.Static);
if (getActionsMethod == null)
return;

}
public static bool enabled
static public bool enabled
m_Enabled == null ? _enabled : (bool)m_Enabled.GetValue(null)
m_Enabled == null ? false : (bool)m_Enabled.GetValue(null)
_enabled
false
set
{
#if USE_REFLECTION

#endif
_enabled = value;
/// <summary>
/// Provides the set actions to the renderer to be triggered at the end of the render loop for camera capture
/// </summary>
/// <param name="camera">The camera to get actions for</param>
/// <returns>Enumeration of actions</returns>
public static IEnumerator<Action<RenderTargetIdentifier, CommandBuffer>> GetCaptureActions(Camera camera)
static public IEnumerator<Action<RenderTargetIdentifier, CommandBuffer> > GetCaptureActions(Camera camera)
return
if (m_GetActions != null)
{
var recorderActions = (m_GetActions.Invoke(null, new object[] { camera }) as IEnumerator<Action<RenderTargetIdentifier, CommandBuffer>>);
if (recorderActions != null)
return recorderActions;
}
m_GetActions == null ? null :
(m_GetActions.Invoke(null, new object [] { camera } ) as
IEnumerator<Action<RenderTargetIdentifier, CommandBuffer> >)
var recorderActions = UnityEditor.Recorder.Input.CameraCapture.GetActions(camera);
if (recorderActions != null)
return recorderActions;
UnityEditor.Recorder.Input.CameraCapture.GetActions(camera)
#else
null
if (!actionDict.TryGetValue(camera, out var actions))
return null;
return actions.GetEnumerator();
}
/// <summary>
/// Adds actions for camera capture
/// </summary>
/// <param name="camera">The camera to add actions for</param>
/// <param name="action">The action to add</param>
public static void AddCaptureAction(Camera camera, Action<RenderTargetIdentifier, CommandBuffer> action)
{
actionDict.TryGetValue(camera, out var actions);
if (actions == null)
{
actions = new HashSet<Action<RenderTargetIdentifier, CommandBuffer>>();
actionDict.Add(camera, actions);
}
actions.Add(action);
}
/// <summary>
/// Removes actions for camera capture
/// </summary>
/// <param name="camera">The camera to remove actions for</param>
/// <param name="action">The action to remove</param>
public static void RemoveCaptureAction(Camera camera, Action<RenderTargetIdentifier, CommandBuffer> action)
{
if (camera == null)
return;
if (actionDict.TryGetValue(camera, out var actions))
actions.Remove(action);
;
}
}
}

2
Packages/com.unity.render-pipelines.core/ShaderLibrary/Packing.hlsl


real3 normal;
normal.xyz = packedNormal.rgb * 2.0 - 1.0;
normal.xy *= scale;
return normal;
return normalize(normal);
}
real3 UnpackNormalRGBNoScale(real4 packedNormal)

2
Packages/com.unity.render-pipelines.core/package.json


"description": "Helper library for SRP that contains a new Shader Library, and utility functions that can be used to implement a custom SRP. This library is currently used by both the High Definition Render Pipeline and the Lightweight Render Pipeline.",
"version": "7.1.1",
"unity": "2019.3",
"unityRelease": "0b4",
"unityRelease": "0b3",
"displayName": "Core RP Library",
"dependencies": {
"com.unity.ugui" : "1.0.0"

4
Packages/com.unity.render-pipelines.universal/CHANGELOG.md


- Added CinemachineUniversalPixelPerfect, a Cinemachine Virtual Camera Extension that solves some compatibility issues between Cinemachine and Pixel Perfect Camera.
- Added an option that disables the depth/stencil buffer for the 2D Renderer.
- Added manipulation handles for the inner cone angle for spot lights.
- Added documentation for the built-in post-processing solution and Volumes framework (and removed incorrect mention of the PPv2 package).
### Changed
- Increased visible lights limit for the forward renderer. It now supports 256 visible lights except in mobile platforms. Mobile platforms support 32 visible lights.

- The renderer override on the Camera is now an enum that maps to the list of `ScriptableRendererData` on the Render Pipeline Asset.
- Pixel Perfect Camera now allows rendering to a render texture.
- Light2D GameObjects that you've created now have a default position with z equal to 0.
- Documentation: Changed the "Getting Started" section into "Install and Configure". Re-arranged the Table of Content.
### Fixed
- Fixed LightProbe occlusion contribution. [case 1146667](https://issuetracker.unity3d.com/product/unity/issues/guid/1146667/)

- Fixed an issue where selecting the same drop-down menu item twice would trigger a change event. [case 1158861](https://issuetracker.unity3d.com/issues/lwrp-additional-camera-data-script-component-appears-on-camera-after-manually-re-picking-use-pipeline-settings)
- Fixed an issue where selecting certain objects that use instancing materials would throw console warnings. [case 1127324](https://issuetracker.unity3d.com/issues/console-warning-is-being-spammed-when-having-lwrp-enabled-and-shader-with-gpu-instancing-present-in-the-scene)
- Fixed a GUID conflict with LWRP. [case 1179895](https://issuetracker.unity3d.com/product/unity/issues/guid/1179895/)
- Fixed an issue where the Terrain shader generated NaNs.
- Fixed and issue where stencil state on a `ForwardRendererData` was reset each time rendering happened.
## [7.0.1] - 2019-07-25
### Changed

4
Packages/com.unity.render-pipelines.universal/Documentation~/Post-Processing-Channel-Mixer.md


**Channel Mixer** uses the [Volume](Volumes.html) framework, so to enable and modify **Channel Mixer** properties, you must add a **Channel Mixer** override to a [Volume](Volumes.html) in your Scene. To add **Channel Mixer** to a Volume:
1. In the Scene or Hierarchy view, select a GameObject that contains a Volume component to view it in the Inspector.
2. In the Inspector, navigate to **Add Override > Post-processing** and click on **Channel Mixer**. URP now applies **Channel Mixer** to any Camera this Volume affects.
2. In the Inspector, navigate to **Add Override > Post-processing** and click on **Channel Mixer**. Universal RP now applies **Channel Mixer** to any Camera this Volume affects.
![](Images/Inspectors/ChannelMixer.png)
![](Images/Post-processingChannelMixer1.png)
### Output channels

6
Packages/com.unity.render-pipelines.universal/Documentation~/Post-Processing-Color-Adjustments.md


**Color Adjustments** uses the [Volume](Volumes.html) framework, so to enable and modify **Color Adjustments** properties, you must add a **Color Adjustments** override to a [Volume](Volumes.html) in your Scene. To add **Color Adjustments** to a Volume:
1. In the Scene or Hierarchy view, select a GameObject that contains a Volume component to view it in the Inspector.
2. In the Inspector, navigate to **Add Override > Post-processing** and click on **Color Adjustments**. URP now applies **Color Adjustments** to any Camera this Volume affects.
2. In the Inspector, navigate to **Add Override > Post-processing** and click on **Color Adjustments**. Universal RP now applies **Color Adjustments** to any Camera this Volume affects.
![](Images/Inspectors/ColorAdjustments.png)
![](Images/Post-processingColorAdjustments1.png)
| **Post Exposure** | Adjusts the overall exposure of the Scene in EV (not EV<sub>100</sub>). URP applies this after the HDR effect and before tonemapping, which means that it does not affect previous effects in the chain. |
| **Post Exposure** | Adjusts the overall exposure of the Scene in EV (not EV<sub>100</sub>). Universal RP applies this after the HDR effect and before tonemapping, which means that it does not affect previous effects in the chain. |
| **Contrast** | Use the slider to expand or shrink the overall range of tonal values. Larger positive values expand the tonal range and lower negative values shrink the tonal range. |
| **Color Filter** | Use the color picker to select which color the Color Adjustment effect should use to multiply the render and tint the result. |
| **Hue Shift** | Use the slider to shift the hue of all colors. |

4
Packages/com.unity.render-pipelines.universal/Documentation~/Post-Processing-Color-Curves.md


**Color Curves** uses the [Volume](Volumes.html) framework, so to enable and modify **Color Curves** properties, you must add a **Color Curves** override to a [Volume](Volumes.html) in your Scene. To add **Color Curves** to a Volume:
1. In the Scene or Hierarchy view, select a GameObject that contains a Volume component to view it in the Inspector.
2. In the Inspector, navigate to **Add Override > Post-processing** and click on **Color Curves**. URP now applies **Color Curves** to any Camera this Volume affects.
2. In the Inspector, navigate to **Add Override > Post-processing** and click on **Color Curves**. Universal RP now applies **Color Curves** to any Camera this Volume affects.
![](Images/Inspectors/ColorCurves.png)
![](Images/Post-processingColorCurves1.png)
| **Curve** | **Description** |
| -------------- | ------------------------------------------------------------ |

6
Packages/com.unity.render-pipelines.universal/Documentation~/Post-Processing-Film-Grain.md


**Film Grain** uses the [Volume](Volumes.html) framework, so to enable and modify **Film Grain** properties, you must add a **Film Grain** override to a [Volume](Volumes.html) in your Scene. To add **Film Grain** to a Volume:
1. In the Scene or Hierarchy view, select a GameObject that contains a Volume component to view it in the Inspector.
2. In the Inspector, navigate to **Add Override > Post-processing** and click on **Film Grain**. URP now applies **Film Grain** to any Camera this Volume affects.
2. In the Inspector, navigate to **Add Override > Post-processing** and click on **Film Grain**. Universal RP now applies **Film Grain** to any Camera this Volume affects.
![](Images/Inspectors/FilmGrain.png)
![](Images/Post-processingFilmGrain1.png)
| **Type** | Use the drop-down to select the type of grain to use. You can select from a list of presets that URP includes, or select **Custom** to provide your own grain Texture. |
| **Type** | Use the drop-down to select the type of grain to use. You can select from a list of presets that Universal RP includes, or select **Custom** to provide your own grain Texture. |
| **Texture** | Assign a Texture that this effect uses as a custom grain Texture.This property is only available when **Type** is set to **Custom**. |
| **Intensity** | Use the slider to set the strength of the Film Grain effect. |
| **Response** | Use the slider to set the noisiness response curve. The higher you set this value, the less noise there is in brighter areas. |

4
Packages/com.unity.render-pipelines.universal/Documentation~/Post-Processing-Lens-Distortion.md


**Lens Distortion** uses the [Volume](Volumes.html) framework, so to enable and modify **Lens Distortion** properties, you must add a **Lens Distortion** override to a [Volume](Volumes.html) in your Scene. To add **Lens Distortion** to a Volume:
1. In the Scene or Hierarchy view, select a GameObject that contains a Volume component to view it in the Inspector.
2. In the Inspector, navigate to **Add Override > Post-processing** and click on **Lens Distortion**. URP now applies **Lens Distortion** to any Camera this Volume affects.
2. In the Inspector, navigate to **Add Override > Post-processing** and click on **Lens Distortion**. Universal RP now applies **Lens Distortion** to any Camera this Volume affects.
![](Images/Inspectors/LensDistortion.png)
![](Images/Post-processingLensDistortion1.png)
| **Property** | **Description** |
| ---------------- | ------------------------------------------------------------ |

10
Packages/com.unity.render-pipelines.universal/Documentation~/Post-Processing-Lift-Gamma-Gain.md


**Lift Gamma Gain** uses the [Volume](Volumes.html) framework, so to enable and modify the lift, gamma, or gain of the render, you must add a **Lift Gamma Gain** override to a [Volume](Volumes.html) in your Scene. To add **Lift Gamma Gain** to a Volume:
1. In the Scene or Hierarchy view, select a GameObject that contains a Volume component to view it in the Inspector.
2. In the Inspector, navigate to **Add Override > Post-processing** and click on **Lift Gamma Gain**. URP now applies **Lift Gamma Gain** to any Camera this Volume affects.
2. In the Inspector, navigate to **Add Override > Post-processing** and click on **Lift Gamma Gain**. Universal RP now applies **Lift Gamma Gain** to any Camera this Volume affects.
![](Images/Inspectors/LiftGammaGain.png)
![](Images/Post-processingLiftGammaGain1.png)
| **Lift** | Use this to control the dark tones. This has a more exaggerated effect on shadows.<br>&#8226; Use the trackball to select which color URP should shift the hue of the dark tones to.<br/>&#8226;Use the slider to offset the color lightness of the trackball color. |
| **Gamma** | Use this to control the mid-range tones with a power function.<br/>&#8226; Use the trackball to select which color URP should use to shift the hue of the mid-tones to.<br/>&#8226; Use the slider to offset the color lightness of the trackball color. |
| **Gain** | Use this to increase the signal and make highlights brighter.<br/>&#8226; Use the trackball to select which color that URP uses to shift the hue of the highlights to.<br/>&#8226; Use the slider to offset the color lightness of the trackball color. |
| **Lift** | Use this to control the dark tones. This has a more exaggerated effect on shadows.<br>&#8226; Use the trackball to select which color Universal RP should shift the hue of the dark tones to.<br/>&#8226;Use the slider to offset the color lightness of the trackball color. |
| **Gamma** | Use this to control the mid-range tones with a power function.<br/>&#8226; Use the trackball to select which color Universal RP should use to shift the hue of the mid-tones to.<br/>&#8226; Use the slider to offset the color lightness of the trackball color. |
| **Gain** | Use this to increase the signal and make highlights brighter.<br/>&#8226; Use the trackball to select which color that Universal RP uses to shift the hue of the highlights to.<br/>&#8226; Use the slider to offset the color lightness of the trackball color. |

4
Packages/com.unity.render-pipelines.universal/Documentation~/Post-Processing-Panini-Projection.md


**Panini Projection** uses the [Volume](Volumes.html) framework, so to enable and modify **Panini Projection** properties, you must add a **Panini Projection** override to a [Volume](Volumes.html) in your Scene. To add **Panini Projection** to a Volume:
1. In the Scene or Hierarchy view, select a GameObject that contains a Volume component to view it in the Inspector.
2. In the Inspector, navigate to **Add Override > Post-processing** and click on **Panini Projection**. URP now applies **Panini Projection** to any Camera this Volume affects.
2. In the Inspector, navigate to **Add Override > Post-processing** and click on **Panini Projection**. Universal RP now applies **Panini Projection** to any Camera this Volume affects.
![](Images/Inspectors/PaniniProjection.png)
![](Images/Post-processingPaniniProjection1.png)
| **Property** | **Description** |
| --------------- | ------------------------------------------------------------ |

10
Packages/com.unity.render-pipelines.universal/Documentation~/Post-Processing-Shadows-Midtones-Highlights.md


**Shadows Midtones Highlights** uses the [Volume](Volumes.html) framework, so to enable and modify the shadows, midtones, or highlights of the render, you must add a **Shadows Midtones Highlights** override to a [Volume](Volumes.html) in your Scene. To add **Shadows Midtones Highlights** to a Volume:
1. In the Scene or Hierarchy view, select a GameObject that contains a Volume component to view it in the Inspector.
2. In the Inspector, navigate to **Add Override > Post-processing** and click on **Shadows Midtones Highlights**. URP now applies **Shadows Midtones Highlights** to any Camera this Volume affects.
2. In the Inspector, navigate to **Add Override > Post-processing** and click on **Shadows Midtones Highlights**. Universal RP now applies **Shadows Midtones Highlights** to any Camera this Volume affects.
![](Images/Inspectors/ShadowsMidtonesHighlights.png)
![](Images/Post-processingShadowsMidtonesHighlights1.png)
| **Shadows** | Use this to control the shadows.Use the trackball to select the color URP should shift the hue of the shadows to.Use the slider to offset the color lightness of the trackball color. |
| **Midtones** | Use this to control the midtones.Use the trackball to select the color URP should shift the hue of the midtones to.Use the slider to offset the color lightness of the trackball color. |
| **Highlights** | Use this to control the highlights.Use the trackball to select the color URP should shift the hue of the highlights to.Use the slider to offset the color lightness of the trackball color. |
| **Shadows** | Use this to control the shadows.Use the trackball to select the color Universal RP should shift the hue of the shadows to.Use the slider to offset the color lightness of the trackball color. |
| **Midtones** | Use this to control the midtones.Use the trackball to select the color Universal RP should shift the hue of the midtones to.Use the slider to offset the color lightness of the trackball color. |
| **Highlights** | Use this to control the highlights.Use the trackball to select the color Universal RP should shift the hue of the highlights to.Use the slider to offset the color lightness of the trackball color. |
### Graph view

8
Packages/com.unity.render-pipelines.universal/Documentation~/Post-Processing-Split-Toning.md


**Split Toning** uses the [Volume](Volumes.html) framework, so to enable and modify **Split Toning** properties, you must add a **Split Toning** override to a [Volume](Volumes.html) in your Scene. To add **Split Toning** to a Volume:
1. In the Scene or Hierarchy view, select a GameObject that contains a Volume component to view it in the Inspector.
2. In the Inspector, navigate to **Add Override > Post-processing** and click on **Split Toning**. URP now applies **Split Toning** to any Camera this Volume affects.
2. In the Inspector, navigate to **Add Override > Post-processing** and click on **Split Toning**. Universal RP now applies **Split Toning** to any Camera this Volume affects.
![](Images/Inspectors/SplitToning.png)
![](Images/Post-processingSplitToning1.png)
| **Shadows** | Use the color picker to select the color that URP uses for tinting shadows. |
| **Highlights** | Use the color picker to select the color that URP uses for tinting highlights. |
| **Shadows** | Use the color picker to select the color that Universal RP uses for tinting shadows. |
| **Highlights** | Use the color picker to select the color that Universal RP uses for tinting highlights. |
| **Balance** | Use the slider to set the balance between **Shadows** and **Highlights**. Lower values result in more pronounced shadow toning is compared to highlight toning. Higher values result in the opposite effect, with more pronounced highlight toning compared to shadow toning. |

4
Packages/com.unity.render-pipelines.universal/Documentation~/Post-Processing-White-Balance.md


**White Balance** uses the [Volume](Volumes.html) framework, so to enable and modify **White Balance** properties, you must add a **White Balance** override to a [Volume](Volumes.html) in your Scene. To add **White Balance** to a Volume:
1. In the Scene or Hierarchy view, select a GameObject that contains a Volume component to view it in the Inspector.
2. In the Inspector, navigate to **Add Override > Post-processing** and click on **White Balance**. URP now applies **White Balance** to any Camera this Volume affects.
2. In the Inspector, navigate to **Add Override > Post-processing** and click on **White Balance**. Universal RP now applies **White Balance** to any Camera this Volume affects.
![](Images/Inspectors/WhiteBalance.png)
![](Images/Post-processingWhiteBalance1.png)
| **Property** | **Description** |
| --------------- | ------------------------------------------------------------ |

34
Packages/com.unity.render-pipelines.universal/Documentation~/TableOfContents.md


* [Universal Render Pipeline](index.md)
* [About Universal RP](index.md)
* [Install and configure](InstallingAndConfiguringURP.md)
* [Create a Project from a Template](CreateNewProjectFromTemplate.md)
* [Install into a Project](InstallURPIntoAProject.md)
* [Getting started](getting-started-with-universalrp.md)
* [Creating a new Project](creating-a-new-project-with-universalrp.md)
* [Upgrading your existing Project](installing-universalrp-into-an-existing-project.md)
* [Configuring Universal RP for use](configuring-universalrp-for-use.md)
* [The Universal Render Pipeline Asset](universalrp-asset.md)
* [Rendering](rendering-in-universalrp.md)
* [Inside Universal RP](inside-universalrp.md)
* [The Universal RP Asset](universalrp-asset.md)
* [Shader stripping](shader-stripping.md)
* [Built-in/Universal RP comparison](universalrp-builtin-feature-comparison.md)
* [Shading Models in Universal RP](shading-model.md)
* [Rendering in Universal RP](rendering-in-universalrp.md)
* [Post-processing](integration-with-post-processing.md)
* [Volumes](Volumes.md)
* [Volume Profile](VolumeProfile.md)
* [Volume Overrides](VolumeOverrides.md)
* [Effect List](EffectList.md)
* [Post-processing in Universal RP](integration-with-post-processing.md)
* Effect List
* [Channel Mixer](Post-Processing-Channel-Mixer.md)
* [Color Adjustments](Post-Processing-Color-Adjustments.md)
* [Color Curves](Post-Processing-Color-Curves.md)

* [Motion Blur](Post-Processing-Motion-Blur.md)
* [Shaders and Materials](shaders-in-universalrp.md)
* [Shading Models](shading-model.md)
* [Shaders in Universal RP](shaders-in-universalrp.md)
* [Lit](lit-shader.md)
* [Simple Lit](simple-lit-shader.md)
* [Baked Lit](baked-lit-shader.md)

* [Particles Unlit](particles-unlit-shader.md)
* [Upgrading shaders from Built-in](upgrading-your-shaders.md)
* [Shader stripping](shader-stripping.md)
* [Upgrading shaders](upgrading-your-shaders.md)
* [2D in Universal RP](2d-index.md)
* [Introduction to Lights 2D](Lights-2D-intro.md)

* [Cinemachine Pixel Perfect extension](pixel-cinemachine.md)
* [Frequently asked questions (FAQ)](faq.md)
* [Feature Comparison with Built-in](universalrp-builtin-feature-comparison.md)

13
Packages/com.unity.render-pipelines.universal/Documentation~/index.md


![Universal Render Pipeline in action](Images/AssetShots/Beauty/Overview.png)
The Universal Render Pipeline (URP) is a prebuilt Scriptable Render Pipeline, made by Unity. The technology offers graphics that are scalable to mobile platforms, and you can also use it for higher-end consoles and PCs. You’re able to achieve quick rendering at a high quality without needing compute shader technology. URP uses simplified, physically based Lighting and Materials.
The Universal Render Pipeline (Universal RP) is a prebuilt Scriptable Render Pipeline, made by Unity. The technology offers graphics that are scalable to mobile platforms, and you can also use it for higher-end consoles and PCs. You’re able to achieve quick rendering at a high quality without needing compute shader technology. Universal RP uses simplified, physically based Lighting and Materials.
The URP uses single-pass forward rendering. Use this pipeline to get optimized real-time performance on several platforms.
The Universal RP uses single-pass forward rendering. Use this pipeline to get optimized real-time performance on several platforms.
The URP is supported on the following platforms:
The Universal RP is supported on the following platforms:
* Windows and UWP
* Mac and iOS
* Android

* WebGL
The Universal Render Pipeline is available via two templates: URP and URP-VR. The URP-VR comes with pre-enabled settings specifically for VR. The documentation for both render pipelines is the same. For any questions regarding URP-VR, see the URP documentation.
The Universal Render Pipeline is available via two templates: Universal RP and Universal RP-VR. The Universal RP-VR comes with pre-enabled settings specifically for VR. The documentation for both render pipelines is the same. For any questions regarding Universal RP-VR, see the Universal RP documentation.
**Note:** Built-in and custom Lit Shaders do not work with the Universal Render Pipeline. Instead, URP has a new set of standard Shaders. If you upgrade a Project from the Built-in render pipeline to URP, you can [upgrade Built-in Shaders to the URP ones](upgrading-your-shaders.md).
**Note:** Built-in and custom Lit Shaders do not work with the Universal Render Pipeline. Instead, Universal RP has a new set of standard shaders. If you upgrade a current Project to Universal RP, you can upgrade built-in shaders to the new ones.
**Note:** Projects made using URP are not compatible with the High Definition Render Pipeline or the Built-in Unity render¢pipeline. Before you start development, you must decide which render pipeline to use in your Project.
**Note:** Projects made using Universal RP are not compatible with the High Definition Render Pipeline or the built-in Unity rendering pipeline. Before you start development, you must decide which render pipeline to use in your Project.

10
Packages/com.unity.render-pipelines.universal/Documentation~/integration-with-post-processing.md


# Post-processing in the Universal Render Pipeline
The Universal Render Pipeline (URP) includes its own implementation of [post-processing](https://docs.unity3d.com/Manual/PostProcessingOverview.html), so you do not need to install any other package. URP is not compatible with the post-processing version 2 package.
The Universal Render Pipeline (Universal RP) includes its own implementation of [post-processing](https://docs.unity3d.com/Manual/PostProcessingOverview.html), so you do not need to install any other package. Universal RP is not compatible with the post-processing version 2 package.
The images below show a Scene with and without URP post-processing.
The images below show a Scene with and without Universal RP post-processing.
Without post-processing:

![](Images/AssetShots/Beauty/SceneWithPost.png)
## Post-processing in URP for mobile devices
## Post-processing in Universal RP for mobile devices
Post-processing effects can take up a lot of frame time. If you’re using URP for mobile devices, these effects are the most “mobile-friendly” by default:
Post-processing effects can take up a lot of frame time. If you’re using Universal RP for mobile devices, these effects are the most “mobile-friendly” by default:
- Bloom (with __High Quality Filtering__ disabled)
- Chromatic Aberration

**Note:** For anti-aliasing on mobile platforms, Unity recommends that you use FXAA.
## Post-processing in URP for VR
## Post-processing in Universal RP for VR
In VR apps and games, certain post-processing effects can cause nausea and disorientation. To reduce motion sickness in fast-paced or high-speed apps, use the Vignette effect for VR, and avoid the effects Lens Distortion, Chromatic Aberration, and Motion Blur for VR.

12
Packages/com.unity.render-pipelines.universal/Documentation~/rendering-in-universalrp.md


#Rendering in the Universal Render Pipeline
The Universal Render Pipeline (URP) renders Scenes using the:
The Universal Render Pipeline (Universal RP) renders Scenes using the:
- [Shading models](shading-model.md) for shaders shipped with URP
- [Shading models](shading-model.md) for shaders shipped with Universal RP
In the Forward renderer, URP implements a rendering loop that tells Unity how to render a frame.
In the Forward renderer, Universal RP implements a rendering loop that tells Unity how to render a frame.

When the [render pipeline is active in Graphics Settings](configuring-universalrp-for-use.md), Unity uses URP to render all Cameras in your Project, including game and Scene view cameras, Reflection Probes, and the preview windows in your Inspectors.
When the [render pipeline is active in Graphics Settings](configuring-universalrp-for-use.md), Unity uses Universal RP to render all Cameras in your Project, including game and Scene view cameras, Reflection Probes, and the preview windows in your Inspectors.
The URP renderer executes a Camera loop for each Camera, which performs the following steps:
The Universal RP renderer executes a Camera loop for each Camera, which performs the following steps:
1. Culls rendered objects in your Scene
2. Builds data for the renderer

| ---------------------------- | ------------------------------------------------------------ |
| __Setup Culling Parameters__ | Configures parameters that determine how the culling system culls Lights and shadows. You can override this part of the render pipeline with a custom renderer. |
| __Culling__ | Uses the culling parameters from the previous step to compute a list of visible renderers, shadow casters, and Lights that are visible to the Camera. Culling parameters and Camera [layer distances](https://docs.unity3d.com/ScriptReference/Camera-layerCullDistances.html) affect culling and rendering performance. |
| __Build Rendering Data__ | Catches information based on the culling output, quality settings from the [URP Asset](universalrp-asset.md), [Camera](camera.md), and the current running platform to build the `RenderingData`. The rendering data tells the renderer the amount of rendering work and quality required for the Camera and the currently chosen platform. |
| __Build Rendering Data__ | Catches information based on the culling output, quality settings from the [Universal RP Asset](universalrp-asset.md), [Camera](camera.md), and the current running platform to build the `RenderingData`. The rendering data tells the renderer the amount of rendering work and quality required for the Camera and the currently chosen platform. |
| __Setup Renderer__ | Builds a list of render passes, and queues them for execution according to the rendering data. You can override this part of the render pipeline with a custom renderer. |
| __Execute Renderer__ | Executes each render pass in the queue. The renderer outputs the Camera image to the framebuffer. |

9
Packages/com.unity.render-pipelines.universal/Documentation~/shader-stripping.md


# Shader Stripping
Unity compiles many Shader Variants from a single Shader source file. The number of Shader Variants depends on how many keywords you’ve included in the Shader. In the default Shaders, the Universal Render Pipeline (URP) uses a set of keywords for lighting and shadows. URP can exclude some Shader variants, depending on which features are active in the [URP Asset](universalrp-asset.md).
Unity compiles many Shader Variants from a single Shader source file. The number of Shader Variants depends on how many keywords you’ve included in the Shader. In the default Shaders, the Universal Render Pipeline (Universal RP) uses a set of keywords for lighting and shadows. Universal RP can exclude some Shader variants, depending on which features are active in the [Universal RP Asset](universalrp-asset.md).
When you disable [certain features](shader-stripping-keywords.md) in the URP Asset, the pipeline “strips” the related Shader variants from the build. Stripping your Shaders gives you smaller build sizes and shorter build times. This is useful if your project is never going to use certain features or keywords.
When you disable [certain features](shader-stripping-keywords.md) in the Universal RP Asset, the pipeline “strips” the related Shader variants from the build. Stripping your Shaders gives you smaller build sizes and shorter build times. This is useful if your project is never going to use certain features or keywords.
For example, you might have a project where you never use shadows for directional lights. Without Shader stripping, Shader variants with directional shadow support remain in the build. If you know you won't use these shadows at all, you can uncheck **Cast Shadows** in the URP Asset for main or additional direction lights. URP then strips these Shader Variants from the build.
For example, you might have a project where you never use shadows for directional lights. Without Shader stripping, Shader variants with directional shadow support remain in the build. If you know you won't use these shadows at all, you can uncheck **Cast Shadows** in the Universal RP Asset for main or additional direction lights. Universal RP then strips these Shader Variants from the build.
For more information about stripping Shader Variants in Unity, see [this blog post by Christophe Riccio](https://blogs.unity3d.com/2018/05/14/stripping-scriptable-shader-variants/).
For more information about stripping Shader Variants in Unity, see [this blog post by Christophe Riccio](https://blogs.unity3d.com/2018/05/14/stripping-scriptable-shader-variants/).

10
Packages/com.unity.render-pipelines.universal/Documentation~/shaders-in-universalrp.md


# Shaders and Materials
# Shaders in Universal RP
The Universal Render Pipeline uses a different shading approach than the Unity built-in Render Pipeline. As a result, built-in Lit and custom Lit Shaders do not work with the URP. Instead, URP has a new set of standard Shaders. URP provides the following Shaders for the most common use case scenarios:
The Universal Render Pipeline uses a different shading approach than the Unity built-in Render Pipeline. As a result, built-in Lit and custom Lit Shaders do not work with the Universal RP. Instead, Universal RP has a new set of standard Shaders. Universal RP provides the following Shaders for the most common use case scenarios:
- [Lit](lit-shader.md)
- [Simple Lit](simple-lit-shader.md)

- Autodesk Interactive Transparent
- Autodesk Interactive Masked
**Upgrade advice:** If you upgrade your current Project to URP, you can [upgrade](upgrading-your-shaders.md) built-in Shaders to the new ones. Unlit Shaders from the built-in render pipeline still work with URP.
**Upgrade advice:** If you upgrade your current Project to Universal RP, you can [upgrade](upgrading-your-shaders.md) built-in Shaders to the new ones. Unlit Shaders from the built-in render pipeline still work with Universal RP.
**Note:** Unlit Shaders from the Unity built-in render pipeline work in URP.
**Note:** Unlit Shaders from the Unity built-in render pipeline work in Universal RP.

For PBS, use the [Lit Shader](lit-shader.md). You can use it on all platforms. The Shader quality scales, depending on the platform, but keeps physically based rendering on all platforms. This gives you realistic graphics across hardware. The Unity [Standard Shader](<https://docs.unity3d.com/Manual/shader-StandardShader.html>) and the [Standard (Specular setup)](https://docs.unity3d.com/Manual/StandardShaderMetallicVsSpecular.html) Shaders both map to the Lit Shader in URP. For a list of Shader mappings, see [Shader mappings under Upgradring your Shaders.](upgrading-your-shaders.md#shaderMappings)
For PBS, use the [Lit Shader](lit-shader.md). You can use it on all platforms. The Shader quality scales, depending on the platform, but keeps physically based rendering on all platforms. This gives you realistic graphics across hardware. The Unity [Standard Shader](<https://docs.unity3d.com/Manual/shader-StandardShader.html>) and the [Standard (Specular setup)](https://docs.unity3d.com/Manual/StandardShaderMetallicVsSpecular.html) Shaders both map to the Lit Shader in Universal RP. For a list of Shader mappings, see [Shader mappings under Upgradring your Shaders.](upgrading-your-shaders.md#shaderMappings)
If you’re targeting less powerful devices, or just would like simpler shading, use the [Simple Lit Shader](simple-lit-shader.md), which is non-PBR.

14
Packages/com.unity.render-pipelines.universal/Documentation~/shading-model.md


# Shading models in Universal Render Pipeline
A shading model defines how a Material’s color varies depending on factors such as surface orientation, viewer direction, and lighting. Your choice of a shading model depends on the artistic direction and performance budget of your application. Universal Render Pipeline (URP) provides Shaders with the following shading models:
A shading model defines how a Material’s color varies depending on factors such as surface orientation, viewer direction, and lighting. Your choice of a shading model depends on the artistic direction and performance budget of your application. Universal Render Pipeline (Universal RP) provides Shaders with the following shading models:
- [Physically Based Shading](#physically-based-shading)
- [Simple Shading](#simple-shading)

This PBS model follows two principles:
_Energy conservation_ - Surfaces never reflect more light than the total incoming light. The only exception to this is when an object emits light. For example, a neon sign.
_Microgeometry_ - Surfaces have geometry at a microscopic level. Some objects have smooth microgeometry, which gives them a mirror-like appearance. Other objects have rough microgeometry, which makes them look more dull. In URP, you can mimic the level of smoothness of a rendered object’s surface.
_Microgeometry_ - Surfaces have geometry at a microscopic level. Some objects have smooth microgeometry, which gives them a mirror-like appearance. Other objects have rough microgeometry, which makes them look more dull. In Universal RP, you can mimic the level of smoothness of a rendered object’s surface.
When light hits a a rendered object's surface, part of the light is reflected and part is refracted. The reflected light is called _specular reflection_. This varies depending on the camera direction and the point at which the light hits a surface, also called the [angle of incidence](<https://en.wikipedia.org/wiki/Angle_of_incidence_(optics)>). In this shading model, the shape of specular highlight is approximated with a [GGX function](https://blogs.unity3d.com/2016/01/25/ggx-in-unity-5-3/).

The following URP Shaders use Physically Based Shading:
The following Universal RP Shaders use Physically Based Shading:
- [Lit](lit-shader.md)
- [Particles Lit](particles-lit-shader.md)

Light attenuation is only affected by the light intensity.
The following URP Shaders use Simple Shading:
The following Universal RP Shaders use Simple Shading:
- [Simple Lit](simple-lit-shader.md)
- [Particles Simple Lit](particles-simple-lit-shader.md)

The Baked Lit shading model doesn’t have real-time lighting. Materials can receive [baked lighting](https://docs.unity3d.com/Manual/LightMode-Baked.html) from either [lightmaps](https://docs.unity3d.com/Manual/Lightmapping.html) or [Light Probes](<https://docs.unity3d.com/Manual/LightProbes.html>). This adds some depth to your Scenes at a small performance cost. Games with this shading model can run on less powerful platforms.
The URP Baked Lit shader is the only shader that uses the Baked Lit shading model.
The Universal RP Baked Lit shader is the only shader that uses the Baked Lit shading model.
URP comes with some Shaders that are Unlit. This means that they have no directional lights and no baked lighting. Because there are no light calculations, these shaders compile faster than Shaders with lighting. If you know in advance that your GameObject or visual doesn’t need lighting, choose an Unlit shader to save calculation and build time in your final product.
Universal RP comes with some Shaders that are Unlit. This means that they have no directional lights and no baked lighting. Because there are no light calculations, these shaders compile faster than Shaders with lighting. If you know in advance that your GameObject or visual doesn’t need lighting, choose an Unlit shader to save calculation and build time in your final product.
The following URP Shaders have no lighting:
The following Universal RP Shaders have no lighting:
- [Unlit](unlit-shader.md)
- [Particles Unlit](particles-unlit-shader.md)

14
Packages/com.unity.render-pipelines.universal/Documentation~/simple-lit-shader.md


| Property | Description |
| ------------------ | ------------------------------------------------------------ |
| __Surface Type__ | Use this drop-down to apply an __Opaque__ or __Transparent__ surface type to the Material. This determines which render pass URP renders the material in. __Opaque__ surface types are always fully visible, regardless of what’s behind them. URP renders opaque Materials first. __Transparent__ surface types are affected by their background, and they can vary according to which type of transparent surface type you choose. URP renders transparent Materials in a separate pass after opaque objects. If you select __Transparent__, the __Blending Mode__ drop-down appears. |
| __Blending Mode__ | Use this drop-down to determine how URP calculates the color of each pixel of the transparent Material by blending the Material with the background pixels.<br/>__Alpha__ uses the Material’s alpha value to change how transparent an object is. 0 is fully transparent. 1 appears fully opaque, but the Material is still rendered during the Transparent render pass. This is useful for visuals that you want to be fully visible but to also fade over time, like clouds.<br/>__Premultiply__ applies a similar effect to the Material as __Alpha__, but preserves reflections and highlights, even when your surface is transparent. This means that only the reflected light is visible. For example, imagine transparent glass.<br/>__Additive__ adds an extra layer to the Material, on top of another surface. This is good for holograms. <br/>__Multiply__ multiplies the color of the Material with the color behind the surface. This creates a darker effect, like when you look through colored glass. |
| __Render Face__ | Use this drop-down to determine which sides of your geometry to render.<br/>__Front Face__ renders the front face of your geometry and [culls](https://docs.unity3d.com/Manual/SL-CullAndDepth.html) the back face. This is the default setting. <br/>__Back Face__ renders the front face of your geometry and culls the front face. <br/>__Both__ makes URP render both faces of the geometry. This is good for small, flat objects, like leaves, where you might want both sides visible. |
| __Alpha Clipping__ | Makes your Material act like a [Cutout](https://docs.unity3d.com/Manual/StandardShaderMaterialParameterRenderingMode.html) Shader. Use this to create a transparent effect with hard edges between the opaque and transparent areas. For example, to create blades of grass. To achieve this effect, URP does not render alpha values below the specified __Threshold__, which appears when you enable __Alpha Clipping__. You can set the __Threshold__ by moving the slider, which accepts values from 0 to 1. All values above your threshold are fully opaque, and all values below your threshold are invisible. For example, a threshold of 0.1 means that URP doesn't render alpha values below 0.1. The default value is 0.5. |
| __Surface Type__ | Use this drop-down to apply an __Opaque__ or __Transparent__ surface type to the Material. This determines which render pass Universal RP renders the material in. __Opaque__ surface types are always fully visible, regardless of what’s behind them. Universal RP renders opaque Materials first. __Transparent__ surface types are affected by their background, and they can vary according to which type of transparent surface type you choose. Universal RP renders transparent Materials in a separate pass after opaque objects. If you select __Transparent__, the __Blending Mode__ drop-down appears. |
| __Blending Mode__ | Use this drop-down to determine how Universal RP calculates the color of each pixel of the transparent Material by blending the Material with the background pixels.<br/>__Alpha__ uses the Material’s alpha value to change how transparent an object is. 0 is fully transparent. 1 appears fully opaque, but the Material is still rendered during the Transparent render pass. This is useful for visuals that you want to be fully visible but to also fade over time, like clouds.<br/>__Premultiply__ applies a similar effect to the Material as __Alpha__, but preserves reflections and highlights, even when your surface is transparent. This means that only the reflected light is visible. For example, imagine transparent glass.<br/>__Additive__ adds an extra layer to the Material, on top of another surface. This is good for holograms. <br/>__Multiply__ multiplies the color of the Material with the color behind the surface. This creates a darker effect, like when you look through colored glass. |
| __Render Face__ | Use this drop-down to determine which sides of your geometry to render.<br/>__Front Face__ renders the front face of your geometry and [culls](https://docs.unity3d.com/Manual/SL-CullAndDepth.html) the back face. This is the default setting. <br/>__Back Face__ renders the front face of your geometry and culls the front face. <br/>__Both__ makes Universal RP render both faces of the geometry. This is good for small, flat objects, like leaves, where you might want both sides visible. |
| __Alpha Clipping__ | Makes your Material act like a [Cutout](https://docs.unity3d.com/Manual/StandardShaderMaterialParameterRenderingMode.html) Shader. Use this to create a transparent effect with hard edges between the opaque and transparent areas. For example, to create blades of grass. To achieve this effect, Universal RP does not render alpha values below the specified __Threshold__, which appears when you enable __Alpha Clipping__. You can set the __Threshold__ by moving the slider, which accepts values from 0 to 1. All values above your threshold are fully opaque, and all values below your threshold are invisible. For example, a threshold of 0.1 means that Universal RP doesn't render alpha values below 0.1. The default value is 0.5. |

| __Base Map__ | Adds color to the surface, also known as the diffuse map. To assign a Texture to the __Base Map__ setting, click the object picker next to it. This opens the Asset Browser, where you can select from the Textures in your Project. Alternatively, you can use the [color picker](https://docs.unity3d.com/Manual/EditingValueProperties.html). The color next to the setting shows the tint on top of your assigned Texture. To assign another tint, you can click this color swatch. If you select __Transparent__ or __Alpha Clipping__ under __Surface Options__, your Material uses the Texture’s alpha channel or color. |
| __Specular Map__ | Controls the color of your specular highlights from direct lighting, for example [Directional, Point, and Spot lights](https://docs.unity3d.com/Manual/Lighting.html). To assign a Texture to the __Specular Map__ setting, click the object picker next to it. This opens the Asset Browser, where you can select from the textures in your Project. Alternatively, you can use the [color picker](https://docs.unity3d.com/Manual/EditingValueProperties.html). <br/>In __Source__, you can select a Texture in your Project to act as a source for the smoothness. By default, the source is the Alpha channel for this Texture. <br/>You can use the __Smoothness__ slider to control the spread of highlights on the surface. 0 gives a wide, rough highlight. 1 gives a small, sharp highlight like glass. Values in between produce semi-glossy looks. For example, 0.5 produces a plastic-like glossiness. |
| __Normal Map__ | Adds a normal map to the surface. With a [normal map](https://docs.unity3d.com/Manual/StandardShaderMaterialParameterNormalMap.html?), you can add surface details like bumps, scratches and grooves. To add the map, click the object picker next to it. The normal map picks up ambient lighting in the environment. |
| __Emission__ | Makes the surface look like it emits lights. When enabled, the __Emission Map__ and __Emission Color__ settings appear.<br/>To assign an __Emission Map__, click the object picture next to it. This opens the Asset Browser, where you can select from the textures in your Project.<br/>For __Emission Color__, you can choose the color picker](https://docs.unity3d.com/Manual/EditingValueProperties.html) to assign a tint on top of the color. This can be more than 100% white, which is useful for effects like lava, that shines brighter than white while still being another color.<br/>If you have not assigned an __Emission Map__, the __Emission__ setting only uses the tint you’ve assigned in __Emission Color__.<br/>If you do not enable __Emission__, URP sets the emission to black and does not calculate emission. |
| __Emission__ | Makes the surface look like it emits lights. When enabled, the __Emission Map__ and __Emission Color__ settings appear.<br/>To assign an __Emission Map__, click the object picture next to it. This opens the Asset Browser, where you can select from the textures in your Project.<br/>For __Emission Color__, you can choose the color picker](https://docs.unity3d.com/Manual/EditingValueProperties.html) to assign a tint on top of the color. This can be more than 100% white, which is useful for effects like lava, that shines brighter than white while still being another color.<br/>If you have not assigned an __Emission Map__, the __Emission__ setting only uses the tint you’ve assigned in __Emission Color__.<br/>If you do not enable __Emission__, Universal RP sets the emission to black and does not calculate emission. |
| __Tiling__ | A 2D multiplier value that scales the Texture to fit across a mesh according to the U and V axes. This is good for surfaces like floors and walls. The default value is 1, which means no scaling. Set a higher value to make the Texture repeat across your mesh. Set a lower value to stretch the Texture. Try different values until you reach your desired effect. |
| __Offset__ | The 2D offset that positions the Texture on the mesh. To adjust the position on your mesh, move the Texture across the U or V axes. |

| Property | Description |
| ------------------------- | ------------------------------------------------------------ |
| __Enable GPU Instancing__ | Makes URP render meshes with the same geometry and Material in one batch, when possible. This makes rendering faster. URP cannot render Meshes in one batch if they have different Materials or if the hardware does not support GPU instancing. |
| __Priority__ | Use this slider to determine the chronological rendering order for a Material. URP renders Materials with higher values first. You can use this to reduce overdraw on devices by making the pipeline render Materials in front of other Materials first, so it doesn't have to render overlapping areas twice. This works similarly to the [render queue](https://docs.unity3d.com/ScriptReference/Material-renderQueue.html) in the built-in Unity render pipeline. |
| __Enable GPU Instancing__ | Makes Universal RP render meshes with the same geometry and Material in one batch, when possible. This makes rendering faster. Universal RP cannot render Meshes in one batch if they have different Materials or if the hardware does not support GPU instancing. |
| __Priority__ | Use this slider to determine the chronological rendering order for a Material. Universal RP renders Materials with higher values first. You can use this to reduce overdraw on devices by making the pipeline render Materials in front of other Materials first, so it doesn't have to render overlapping areas twice. This works similarly to the [render queue](https://docs.unity3d.com/ScriptReference/Material-renderQueue.html) in the built-in Unity render pipeline. |

10
Packages/com.unity.render-pipelines.universal/Documentation~/speedtree.md


# SpeedTree Shaders
# SpeedTree Shaders in Universal RP
When you use SpeedTree Shaders in URP, keep the following in mind:
When you use SpeedTree Shaders in Universal RP, keep the following in mind:
* There is no Global Illumination on trees in URP.
* There is no Global Illumination on trees in Universal RP.
* Trees cannot receive shadows in URP.
* In URP, you can configure whether lights should be per vertex of per pixel in the [URP Asset](universalrp-asset.md).
* Trees cannot receive shadows in Universal RP.
* In Universal RP, you can configure whether lights should be per vertex of per pixel in the [Universal RP Asset](universalrp-asset.md).

22
Packages/com.unity.render-pipelines.universal/Documentation~/universalrp-asset.md


# Universal Render Pipeline Asset
To use the Universal Render Pipeline (URP), you have to [create a URP Asset and assign the asset in the Graphics settings](configuring-universalrp-for-use.md).
To use the Universal Render Pipeline (Universal RP), you have to [create a Universal RP Asset and assign the asset in the Graphics settings](configuring-universalrp-for-use.md).
The URP Asset controls several graphical features and quality settings for the Universal Render Pipeline. It is a scriptable object that inherits from ‘RenderPipelineAsset’. When you assign the asset in the Graphics settings, Unity switches from the built-in render pipeline to the URP. You can then adjust the corresponding settings directly in the URP, instead of looking for them elsewhere.
The Universal RP Asset controls several graphical features and quality settings for the Universal Render Pipeline. It is a scriptable object that inherits from ‘RenderPipelineAsset’. When you assign the asset in the Graphics settings, Unity switches from the built-in render pipeline to the Universal RP. You can then adjust the corresponding settings directly in the Universal RP, instead of looking for them elsewhere.
You can have multiple URP assets and switch between them. For example, you can have one with Shadows on and one with Shadows off. If you switch between the assets to see the effects, you don’t have to manually toggle the corresponding settings for shadows every time. You cannot, however, switch between HDRP/SRP and URP assets, as the
You can have multiple Universal RP assets and switch between them. For example, you can have one with Shadows on and one with Shadows off. If you switch between the assets to see the effects, you don’t have to manually toggle the corresponding settings for shadows every time. You cannot, however, switch between HDRP/SRP and Universal RP assets, as the
In the URP, you can configure settings for:
In the Universal RP, you can configure settings for:
- [__General__](#general)
- [__Quality__](#quality)

**Note:** If you have the experimental 2D Renderer enabled (menu: **Graphics Settings** > add the 2D Renderer Asset under **Scriptable Render Pipeline Settings**), some of the options related to 3D rendering in the URP Asset don't have any impact on your final app or game.
**Note:** If you have the experimental 2D Renderer enabled (menu: **Graphics Settings** > add the 2D Renderer Asset under **Scriptable Render Pipeline Settings**), some of the options related to 3D rendering in the Universal RP Asset don't have any impact on your final app or game.

| __Property__ | __Description__ |
| ----------------------- | ------------------------------------------------------------ |
| __Depth Texture__ | Enables URP to create a `_CameraDepthTexture`. URP then uses this [depth texture](https://docs.unity3d.com/Manual/SL-DepthTextures.html) by default for all Cameras in your Scene. You can override this for individual cameras in the [Camera Inspector](camera-inspector.md). |
| __Opaque Texture__ | Enable this to create a `_CameraOpaqueTexture` as default for all cameras in your Scene. This works like the [GrabPass](https://docs.unity3d.com/Manual/SL-GrabPass.html) in the built-in render pipeline. The __Opaque Texture__ provides a snapshot of the scene right before URP renders any transparent meshes. You can use this in transparent Shaders to create effects like frosted glass, water refraction, or heat waves. You can override this for individual cameras in the [Camera Inspector](camera-inspector.md). |
| __Depth Texture__ | Enables Universal RP to create a `_CameraDepthTexture`. Universal RP then uses this [depth texture](https://docs.unity3d.com/Manual/SL-DepthTextures.html) by default for all Cameras in your Scene. You can override this for individual cameras in the [Camera Inspector](camera-inspector.md). |
| __Opaque Texture__ | Enable this to create a `_CameraOpaqueTexture` as default for all cameras in your Scene. This works like the [GrabPass](https://docs.unity3d.com/Manual/SL-GrabPass.html) in the built-in render pipeline. The __Opaque Texture__ provides a snapshot of the scene right before Universal RP renders any transparent meshes. You can use this in transparent Shaders to create effects like frosted glass, water refraction, or heat waves. You can override this for individual cameras in the [Camera Inspector](camera-inspector.md). |
These settings control the quality level of the URP. This is where you can make performance better on lower-end hardware or make graphics look better on higher-end hardware.
These settings control the quality level of the Universal RP. This is where you can make performance better on lower-end hardware or make graphics look better on higher-end hardware.
**Tip:** If you want to have different settings for different hardware, you can configure these settings across multiple Universal Render Pipeline assets, and switch them out as needed.

| Property | Description |
| --------------------- | ------------------------------------------------------------ |
| __Main Light__ | These settings affect the main [Directional Light](https://docs.unity3d.com/Manual/Lighting.html) in your Scene. You can select this by assigning it as a [Sun Source](https://docs.unity3d.com/Manual/GlobalIllumination.html) in the Lighting Inspector. If you don’t assign a sun source, the URP treats the brightest directional light in the Scene as the main light. You can choose between [Pixel Lighting](https://docs.unity3d.com/Manual/LightPerformance.html) and _None_. If you choose None, URP doesn’t render a main light, even if you’ve set a sun source. |
| __Main Light__ | These settings affect the main [Directional Light](https://docs.unity3d.com/Manual/Lighting.html) in your Scene. You can select this by assigning it as a [Sun Source](https://docs.unity3d.com/Manual/GlobalIllumination.html) in the Lighting Inspector. If you don’t assign a sun source, the Universal RP treats the brightest directional light in the Scene as the main light. You can choose between [Pixel Lighting](https://docs.unity3d.com/Manual/LightPerformance.html) and _None_. If you choose None, Universal RP doesn’t render a main light, even if you’ve set a sun source. |
| __Cast Shadows__ | Check this box to make the main light cast shadows in your Scene. |
| __Shadow Resolution__ | This controls how large the shadow map texture for the main light is. High resolutions give sharper, more detailed shadows. If memory or rendering time is an issue, try a lower resolution. |
| __Additional Lights__ | Here, you can choose to have additional lights to supplement your main light. Choose between [Per Vertex](https://docs.unity3d.com/Manual/LightPerformance.html), [Per Pixel](https://docs.unity3d.com/Manual/LightPerformance.html), or __Disabled__. |

| Property | Description |
| ---------------- | ------------------------------------------------------------ |
| __Distance__ | This controls how far ahead of the camera objects cast shadows, in Unity units. After this distance, URP doesn’t render shadows. For example, the value 100 means that objects more than 100 meters away from the camera do not cast shadows. Use this in large, open worlds, where rendering shadows far away can consume lots of memory. Or use it in top-down games with limited view distance. |
| __Distance__ | This controls how far ahead of the camera objects cast shadows, in Unity units. After this distance, Universal RP doesn’t render shadows. For example, the value 100 means that objects more than 100 meters away from the camera do not cast shadows. Use this in large, open worlds, where rendering shadows far away can consume lots of memory. Or use it in top-down games with limited view distance. |
| __Cascades__ | Select the number of [cascades](https://docs.unity3d.com/Manual/DirLightShadows.html) for shadows. A high number of cascades gives you more detailed shadows nearer the camera.The options are: __None__, __Two Cascades__ and __Four Cascades__. If you’re experiencing performance issues, try lowering the amount of cascades. You can also configure the distance for shadows in the section below the setting. Further away from the camera, shadows become less detailed. |
| __Soft Shadows__ | If you have enabled shadows for either __Main Light__ or __Additional Light__, you can enable this to add a smoother filtering on the shadow maps. This gives you smooth edges on shadows. When enabled, the render pipeline performs a 5x5 Tent filter on desktop platforms and a 4 Tap filter on mobile devices. When disabled, the render pipeline samples the shadow once with default hardware filtering. If you disable this feature, you’ll get faster rendering, but sharper, possibly pixelated, shadow edges. |

| __Dynamic Batching__ | Enable [Dynamic Batching](https://docs.unity3d.com/Manual/DrawCallBatching.html), to make the render pipeline automatically batch small dynamic objects that share the same Material. This is useful for platforms and graphics APIs that do not support GPU instancing. If your targeted hardware does support GPU instancing, disable __Dynamic Batching__. You can change this at run time. |
| __Mixed Lighting__ | Enable [Mixed Lighting](https://docs.unity3d.com/Manual/LightMode-Mixed.html), to tell the pipeline to include mixed lighting shader variants in the build. |
| __Debug Level__ | Set the level of debug information that the render pipeline generates. The values are:<br />**Disabled**: Debugging is disabled. This is the default.<br />**Profiling**: Makes the render pipeline provide detailed information tags, which you can see in the FrameDebugger. |
| __Shader Variant Log Level__ | Set the level of information about Shader Stripping and Shader Variants you want to display when Unity finishes a build. Values are:<br /> **Disabled**: Unity doesn’t log anything.<br />**Only Universal**: Unity logs information for all of the [URP Shaders](shaders-in-universalrp.md).<br />**All**: Unity logs information for all Shaders in your build.<br /> You can see the information in Console panel when your build has finished. |
| __Shader Variant Log Level__ | Set the level of information about Shader Stripping and Shader Variants you want to display when Unity finishes a build. Values are:<br /> **Disabled**: Unity doesn’t log anything.<br />**Only Universal**: Unity logs information for all of the [Universal RP Shaders](shaders-in-universalrp.md).<br />**All**: Unity logs information for all Shaders in your build.<br /> You can see the information in Console panel when your build has finished. |

4
Packages/com.unity.render-pipelines.universal/Documentation~/universalrp-builtin-feature-comparison.md


# Feature comparison table
This table provides an overview of the current features supported in the Universal Render Pipeline (URP), compared to the Unity Built-in render pipeline.
This table provides an overview of the current features supported in the Universal Render Pipeline (Universal RP), compared to the Unity Built-in render pipeline.
**Note:** If a feature is marked __In research__, the URP team is still researching how and when to implement the feature. If a feature is marked as __Not supported__, it's because Unity is not planning to support it in any release.
**Note:** If a feature is marked __In research__, the Universal RP team is still researching how and when to implement the feature. If a feature is marked as __Not supported__, it's because Unity is not planning to support it in any release.
| Feature | Unity Built-in render pipeline | Universal Render Pipeline |

14
Packages/com.unity.render-pipelines.universal/Documentation~/unlit-shader.md


# Unlit Shader
Use this Shader for effects or unique objects in your visuals that don’t need lighting. Because there are no time-consuming lighting calculations or lookups, this Shader is optimal for lower-end hardware. The Unlit Shader uses the most simple [shading model](shading-model.md) in URP.
Use this Shader for effects or unique objects in your visuals that don’t need lighting. Because there are no time-consuming lighting calculations or lookups, this Shader is optimal for lower-end hardware. The Unlit Shader uses the most simple [shading model](shading-model.md) in Universal RP.
## Using the Unlit Shader in the Editor

| Property | Description |
| ------------------ | ------------------------------------------------------------ |
| __Surface Type__ | Use this drop-down to apply an __Opaque__ or __Transparent__ surface type to the Material. This determines which render pass URP renders the material in. __Opaque__ surface types are always fully visible, regardless of what’s behind them. URP renders opaque Materials first. __Transparent__ surface types are affected by their background, and they can vary according to which type of transparent surface type you choose. URP renders transparent Materials in a separate pass after opaque objects. If you select __Transparent__, the __Blending Mode__ drop-down appears. |
| __Blending Mode__ | Use this drop-down to determine how URP calculates the color of each pixel of the transparent Material by blending the Material with the background pixels.<br/>__Alpha__ uses the Material’s alpha value to change how transparent an object is. 0 is fully transparent. 1 appears fully opaque, but the Material is still rendered during the Transparent render pass. This is useful for visuals that you want to be fully visible but to also fade over time, like clouds.<br/>__Premultiply__ applies a similar effect to the Material as __Alpha__, but preserves reflections and highlights, even when your surface is transparent. This means that only the reflected light is visible. For example, imagine transparent glass.<br/>__Additive__ adds an extra layer to the Material, on top of another surface. This is good for holograms. <br/>__Multiply__ multiplies the color of the Material with the color behind the surface. This creates a darker effect, like when you view an through tinted glass. |
| __Render Face__ | Use this drop-down to determine which sides of your geometry to render.<br/>__Front Face__ renders the front face of your geometry and [culls](https://docs.unity3d.com/Manual/SL-CullAndDepth.html) the back face. This is the default setting. <br/>__Back Face__ renders the front face of your geometry and culls the front face. <br/>__Both__ makes URP render both faces of the geometry. This is good for small, flat objects, like leaves, where you might want both sides visible. |
| __Alpha Clipping__ | Makes your Material act like a [Cutout](https://docs.unity3d.com/Manual/StandardShaderMaterialParameterRenderingMode.html) Shader. Use this to create a transparent effect with hard edges between the opaque and transparent areas. For example, to create blades of grass. To achieve this effect, URP does not render alpha values below the specified __Threshold__, which appears when you enable __Alpha Clipping__. You can set the __Threshold__ by moving the slider, which accepts values from 0 to 1. All values above your threshold are fully opaque, and all values below your threshold are invisible. For example, a threshold of 0.1 means that URP doesn't render alpha values below 0.1. The default value is 0.5. |
| __Surface Type__ | Use this drop-down to apply an __Opaque__ or __Transparent__ surface type to the Material. This determines which render pass Universal RP renders the material in. __Opaque__ surface types are always fully visible, regardless of what’s behind them. Universal RP renders opaque Materials first. __Transparent__ surface types are affected by their background, and they can vary according to which type of transparent surface type you choose. Universal RP renders transparent Materials in a separate pass after opaque objects. If you select __Transparent__, the __Blending Mode__ drop-down appears. |
| __Blending Mode__ | Use this drop-down to determine how Universal RP calculates the color of each pixel of the transparent Material by blending the Material with the background pixels.<br/>__Alpha__ uses the Material’s alpha value to change how transparent an object is. 0 is fully transparent. 1 appears fully opaque, but the Material is still rendered during the Transparent render pass. This is useful for visuals that you want to be fully visible but to also fade over time, like clouds.<br/>__Premultiply__ applies a similar effect to the Material as __Alpha__, but preserves reflections and highlights, even when your surface is transparent. This means that only the reflected light is visible. For example, imagine transparent glass.<br/>__Additive__ adds an extra layer to the Material, on top of another surface. This is good for holograms. <br/>__Multiply__ multiplies the color of the Material with the color behind the surface. This creates a darker effect, like when you view an through tinted glass. |
| __Render Face__ | Use this drop-down to determine which sides of your geometry to render.<br/>__Front Face__ renders the front face of your geometry and [culls](https://docs.unity3d.com/Manual/SL-CullAndDepth.html) the back face. This is the default setting. <br/>__Back Face__ renders the front face of your geometry and culls the front face. <br/>__Both__ makes Universal RP render both faces of the geometry. This is good for small, flat objects, like leaves, where you might want both sides visible. |
| __Alpha Clipping__ | Makes your Material act like a [Cutout](https://docs.unity3d.com/Manual/StandardShaderMaterialParameterRenderingMode.html) Shader. Use this to create a transparent effect with hard edges between the opaque and transparent areas. For example, to create blades of grass. To achieve this effect, Universal RP does not render alpha values below the specified __Threshold__, which appears when you enable __Alpha Clipping__. You can set the __Threshold__ by moving the slider, which accepts values from 0 to 1. All values above your threshold are fully opaque, and all values below your threshold are invisible. For example, a threshold of 0.1 means that Universal RP doesn't render alpha values below 0.1. The default value is 0.5. |
### Surface Inputs

| Property | Description |
| ------------------------- | ------------------------------------------------------------ |
| __Enable GPU Instancing__ | Makes URP render meshes with the same geometry and Material in one batch, when possible. This makes rendering faster. URP cannot render Meshes in one batch if they have different Materials or if the hardware does not support GPU instancing. |
| __Priority__ | Use this slider to determine the chronological rendering order for a Material. URP renders Materials with higher values first. You can use this to reduce overdraw on devices by making the pipeline render Materials in front of other Materials first, so it doesn't have to render overlapping areas twice. This works similarly to the [render queue](https://docs.unity3d.com/ScriptReference/Material-renderQueue.html) in the built-in Unity render pipeline. |
| __Enable GPU Instancing__ | Makes Universal RP render meshes with the same geometry and Material in one batch, when possible. This makes rendering faster. Universal RP cannot render Meshes in one batch if they have different Materials or if the hardware does not support GPU instancing. |
| __Priority__ | Use this slider to determine the chronological rendering order for a Material. Universal RP renders Materials with higher values first. You can use this to reduce overdraw on devices by making the pipeline render Materials in front of other Materials first, so it doesn't have to render overlapping areas twice. This works similarly to the [render queue](https://docs.unity3d.com/ScriptReference/Material-renderQueue.html) in the built-in Unity render pipeline. |

8
Packages/com.unity.render-pipelines.universal/Documentation~/upgrading-your-shaders.md


# Upgrading your Shaders
# Upgrading your shaders
If your Project uses shaders from the built-in render pipeline, and you want to [switch your Project to use the Universal Render Pipeline instead](installing-universalrp-into-an-existing-project), you must convert those Shaders to the URP Shaders. This is because built-in Lit shaders are not compatible with URP Shaders. For an overview of the mapping between built-in shaders and URP Shaders, see [Shader mappings](#shader-mappings).
If your Project uses shaders from the built-in render pipeline, and you want to [switch your Project to use the Universal Render Pipeline instead](installing-universalrp-into-an-existing-project), you must convert those Shaders to the Universal RP Shaders. This is because built-in Lit shaders are not compatible with Universal RP Shaders. For an overview of the mapping between built-in shaders and Universal RP Shaders, see [Shader mappings](#shader-mappings).
2. According to your needs, select either __Upgrade Project Materials to URP Materials__ or __Upgrade Selected Materials to URP Materials__.
2. According to your needs, select either __Upgrade Project Materials to Universal RP Materials__ or __Upgrade Selected Materials to Universal RP Materials__.
**Note:** These changes cannot be undone. Backup your Project before you upgrade it.

## Shader mappings
The table below shows which URP shaders the Unity built-in shaders convert to when you run the shader upgrader.
The table below shows which Universal RP shaders the Unity built-in shaders convert to when you run the shader upgrader.
| Unity built-in shader | Universal Render Pipeline shader |
| ------------------------------------------------- | ------------------------------------------- |

47
Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/MasterNodes/SpriteLitMasterNode.cs


using UnityEditor.Graphing;
using UnityEngine;
using UnityEditor.ShaderGraph;
using UnityEditor.ShaderGraph.Internal;
namespace UnityEditor.Experimental.Rendering.Universal
{

class SpriteLitMasterNode : MasterNode<ISpriteLitSubShader>, IMayRequirePosition, IMayRequireNormal, IMayRequireTangent
class SpriteLitMasterNode : MasterNode<ISpriteLitSubShader>, IMayRequirePosition
public const string PositionName = "Vertex Position";
public const string NormalName = "Vertex Normal";
public const string TangentName = "Vertex Tangent";
public const string PositionName = "Position";
public const string ColorSlotName = "Color";
public const string MaskSlotName = "Mask";
public const string NormalSlotName = "Normal";

public const int MaskSlotId = 1;
public const int NormalSlotId = 2;
public const int VertNormalSlotId = 10;
public const int VertTangentSlotId = 11;
public SpriteLitMasterNode()
{

name = "Sprite Lit Master";
AddSlot(new PositionMaterialSlot(PositionSlotId, PositionName, PositionName, CoordinateSpace.Object, ShaderStageCapability.Vertex));
AddSlot(new NormalMaterialSlot(VertNormalSlotId, NormalName, NormalName, CoordinateSpace.Object, ShaderStageCapability.Vertex));
AddSlot(new TangentMaterialSlot(VertTangentSlotId, TangentName, TangentName, CoordinateSpace.Object, ShaderStageCapability.Vertex));
AddSlot(new ColorRGBAMaterialSlot(ColorSlotId, ColorSlotName, ColorSlotName, SlotType.Input, Color.white, ShaderStageCapability.Fragment));
AddSlot(new ColorRGBAMaterialSlot(MaskSlotId, MaskSlotName, MaskSlotName, SlotType.Input, Color.white, ShaderStageCapability.Fragment));
AddSlot(new Vector3MaterialSlot(NormalSlotId, NormalSlotName, NormalSlotName, SlotType.Input, new Vector3(0.0f, 0.0f, 1.0f), ShaderStageCapability.Fragment));

{
PositionSlotId,
VertNormalSlotId,
VertTangentSlotId,
ColorSlotId,
MaskSlotId,
NormalSlotId,

public NeededCoordinateSpace RequiresNormal(ShaderStageCapability stageCapability)
{
List<MaterialSlot> slots = new List<MaterialSlot>();
GetSlots(slots);
List<MaterialSlot> validSlots = new List<MaterialSlot>();
for (int i = 0; i < slots.Count; i++)
{
if (slots[i].stageCapability != ShaderStageCapability.All && slots[i].stageCapability != stageCapability)
continue;
validSlots.Add(slots[i]);
}
return validSlots.OfType<IMayRequireNormal>().Aggregate(NeededCoordinateSpace.None, (mask, node) => mask | node.RequiresNormal(stageCapability));
}
public NeededCoordinateSpace RequiresPosition(ShaderStageCapability stageCapability)
public NeededCoordinateSpace RequiresPosition(ShaderStageCapability stageCapability = ShaderStageCapability.All)
{
List<MaterialSlot> slots = new List<MaterialSlot>();
GetSlots(slots);

validSlots.Add(slots[i]);
}
return validSlots.OfType<IMayRequirePosition>().Aggregate(NeededCoordinateSpace.None, (mask, node) => mask | node.RequiresPosition(stageCapability));
}
public NeededCoordinateSpace RequiresTangent(ShaderStageCapability stageCapability)
{
List<MaterialSlot> slots = new List<MaterialSlot>();
GetSlots(slots);
List<MaterialSlot> validSlots = new List<MaterialSlot>();
for (int i = 0; i < slots.Count; i++)
{
if (slots[i].stageCapability != ShaderStageCapability.All && slots[i].stageCapability != stageCapability)
continue;
validSlots.Add(slots[i]);
}
return validSlots.OfType<IMayRequireTangent>().Aggregate(NeededCoordinateSpace.None, (mask, node) => mask | node.RequiresTangent(stageCapability));
}
}
}

47
Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/MasterNodes/SpriteUnlitMasterNode.cs


using UnityEngine;
using UnityEngine.UIElements;
using UnityEditor.ShaderGraph;
using UnityEditor.ShaderGraph.Internal;
namespace UnityEditor.Experimental.Rendering.Universal
{

class SpriteUnlitMasterNode : MasterNode<ISpriteUnlitSubShader>, IMayRequirePosition, IMayRequireNormal, IMayRequireTangent
class SpriteUnlitMasterNode : MasterNode<ISpriteUnlitSubShader>, IMayRequirePosition
public const string PositionName = "Vertex Position";
public const string NormalName = "Vertex Normal";
public const string TangentName = "Vertex Tangent";
public const string PositionName = "Position";
public const int VertNormalSlotId = 10;
public const int VertTangentSlotId = 11;
public SpriteUnlitMasterNode()
{

name = "Sprite Unlit Master";
AddSlot(new PositionMaterialSlot(PositionSlotId, PositionName, PositionName, CoordinateSpace.Object, ShaderStageCapability.Vertex));
AddSlot(new NormalMaterialSlot(VertNormalSlotId, NormalName, NormalName, CoordinateSpace.Object, ShaderStageCapability.Vertex));
AddSlot(new TangentMaterialSlot(VertTangentSlotId, TangentName, TangentName, CoordinateSpace.Object, ShaderStageCapability.Vertex));
AddSlot(new ColorRGBAMaterialSlot(ColorSlotId, ColorSlotName, ColorSlotName, SlotType.Input, Color.white, ShaderStageCapability.Fragment));
RemoveSlotsNameNotMatching(

VertNormalSlotId,
VertTangentSlotId,
public NeededCoordinateSpace RequiresNormal(ShaderStageCapability stageCapability)
{
List<MaterialSlot> slots = new List<MaterialSlot>();
GetSlots(slots);
List<MaterialSlot> validSlots = new List<MaterialSlot>();
for (int i = 0; i < slots.Count; i++)
{
if (slots[i].stageCapability != ShaderStageCapability.All && slots[i].stageCapability != stageCapability)
continue;
validSlots.Add(slots[i]);
}
return validSlots.OfType<IMayRequireNormal>().Aggregate(NeededCoordinateSpace.None, (mask, node) => mask | node.RequiresNormal(stageCapability));
}
public NeededCoordinateSpace RequiresPosition(ShaderStageCapability stageCapability)
public NeededCoordinateSpace RequiresPosition(ShaderStageCapability stageCapability = ShaderStageCapability.All)
{
List<MaterialSlot> slots = new List<MaterialSlot>();
GetSlots(slots);

validSlots.Add(slots[i]);
}
return validSlots.OfType<IMayRequirePosition>().Aggregate(NeededCoordinateSpace.None, (mask, node) => mask | node.RequiresPosition(stageCapability));
}
public NeededCoordinateSpace RequiresTangent(ShaderStageCapability stageCapability)
{
List<MaterialSlot> slots = new List<MaterialSlot>();
GetSlots(slots);
List<MaterialSlot> validSlots = new List<MaterialSlot>();
for (int i = 0; i < slots.Count; i++)
{
if (slots[i].stageCapability != ShaderStageCapability.All && slots[i].stageCapability != stageCapability)
continue;
validSlots.Add(slots[i]);
}
return validSlots.OfType<IMayRequireTangent>().Aggregate(NeededCoordinateSpace.None, (mask, node) => mask | node.RequiresTangent(stageCapability));
}
}
}

1
Packages/com.unity.render-pipelines.universal/Editor/UniversalRenderPipelineLightEditor.cs


void DrawSpotAngle()
{
EditorGUILayout.Slider(settings.spotAngle, 1f, 179f, s_Styles.SpotAngle);
settings.DrawInnerAndOuterSpotAngle();
}

43
Packages/com.unity.render-pipelines.universal/Runtime/Data/UniversalRenderPipelineAsset.cs


// Default values set when a new UniversalRenderPipeline asset is created
[SerializeField] int k_AssetVersion = 5;
[SerializeField] int k_AssetPreviousVersion = 5;
bool m_NeedsUpgrade;
// Deprecated settings for upgrading sakes
[SerializeField] RendererType m_RendererType = RendererType.ForwardRenderer;

// If no data we can't create pipeline instance
if (m_RendererDataList[0] == null)
{
// If previous version and current version are miss-matched then we are waiting for the upgrader to kick in
if(k_AssetPreviousVersion != k_AssetVersion)
// Could be upgrading for the first time
if (m_NeedsUpgrade)
{
UpgradeAsset(this);
}
else
{
Debug.LogError(
$"Default Renderer is missing, make sure there is a Renderer assigned as the default on the current Universal RP asset:{UniversalRenderPipeline.asset.name}",
this);
Debug.LogError(
$"Default Renderer is missing, make sure there is a Renderer assigned as the default on the current Universal RP asset:{UniversalRenderPipeline.asset.name}",
this);
return null;
}
}
if(m_Renderers == null || m_Renderers.Length < m_RendererDataList.Length)

public void OnAfterDeserialize()
{
k_AssetPreviousVersion = k_AssetVersion;
k_AssetPreviousVersion = k_AssetVersion;
m_NeedsUpgrade = true;
}
if (k_AssetVersion < 4)

m_AdditionalLightsPerObjectLimit = m_MaxPixelLights;
m_MainLightShadowmapResolution = m_ShadowAtlasResolution;
k_AssetPreviousVersion = k_AssetVersion;
m_NeedsUpgrade = true;
}
if (k_AssetVersion < 5)

m_RendererDataList[0] = m_RendererData;
}
k_AssetPreviousVersion = k_AssetVersion;
m_NeedsUpgrade = true;
if (k_AssetPreviousVersion != k_AssetVersion)
{
EditorApplication.delayCall += () => UpgradeAsset(this);
}
if(m_NeedsUpgrade)
EditorApplication.delayCall = () => UpgradeAsset(this);
#if UNITY_EDITOR
#if UNITY_EDITOR
if(asset.k_AssetPreviousVersion < 5)
{
if (asset.m_RendererType == RendererType.ForwardRenderer)

asset.k_AssetPreviousVersion = 5;
}
asset.m_NeedsUpgrade = false;
#endif
#endif
float ValidateShadowBias(float value)
{

11
Packages/com.unity.render-pipelines.universal/Runtime/ForwardRendererData.cs


[SerializeField] LayerMask m_OpaqueLayerMask = -1;
[SerializeField] LayerMask m_TransparentLayerMask = -1;
[SerializeField] StencilStateData m_DefaultStencilState = new StencilStateData();
[SerializeField] StencilStateData m_DefaultStencilState = null;
m_DefaultStencilState = new StencilStateData();
ResourceReloader.ReloadAllNullIn(this, UniversalRenderPipelineAsset.packagePath);
ResourceReloader.ReloadAllNullIn(postProcessData, UniversalRenderPipelineAsset.packagePath);
if (!Application.isPlaying)
{
ResourceReloader.ReloadAllNullIn(this, UniversalRenderPipelineAsset.packagePath);
ResourceReloader.ReloadAllNullIn(postProcessData, UniversalRenderPipelineAsset.packagePath);
}
#endif
return new ForwardRenderer(this);
}

18
Packages/com.unity.render-pipelines.universal/ShaderLibrary/MetaInput.hlsl


half3 SpecularColor;
};
struct Attributes
{
float4 positionOS : POSITION;
float3 normalOS : NORMAL;
float2 uv0 : TEXCOORD0;
float2 uv1 : TEXCOORD1;
float2 uv2 : TEXCOORD2;
#ifdef _TANGENT_TO_WORLD
float4 tangentOS : TANGENT;
#endif
};
struct Varyings
{
float4 positionCS : SV_POSITION;
float2 uv : TEXCOORD0;
};
float4 MetaVertexPosition(float4 positionOS, float2 uv1, float2 uv2, float4 uv1ST, float4 uv2ST)
{
if (unity_MetaVertexControl.x)

22
Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl


density = ComputeFogFactor(TransformObjectToHClip(position).z);
}
// This function assumes the bitangent flip is encoded in tangentWS.w
float3x3 BuildTangentToWorld(float4 tangentWS, float3 normalWS)
{
// tangentWS must not be normalized (mikkts requirement)
// Normalize normalWS vector but keep the renormFactor to apply it to bitangent and tangent
float3 unnormalizedNormalWS = normalWS;
float renormFactor = 1.0 / length(unnormalizedNormalWS);
// bitangent on the fly option in xnormal to reduce vertex shader outputs.
// this is the mikktspace transformation (must use unnormalized attributes)
float3x3 tangentToWorld = CreateTangentToWorld(unnormalizedNormalWS, tangentWS.xyz, tangentWS.w > 0.0 ? 1.0 : -1.0);
// surface gradient based formulation requires a unit length initial normal. We can maintain compliance with mikkts
// by uniformly scaling all 3 vectors since normalization of the perturbed normal will cancel it.
tangentToWorld[0] = tangentToWorld[0] * renormFactor;
tangentToWorld[1] = tangentToWorld[1] * renormFactor;
tangentToWorld[2] = tangentToWorld[2] * renormFactor; // normalizes the interpolated vertex normal
return tangentToWorld;
}
// Always include Shader Graph version
// Always include last to avoid double macros
#include "Packages/com.unity.shadergraph/ShaderGraphLibrary/Functions.hlsl"

18
Packages/com.unity.render-pipelines.universal/Shaders/LitMetaPass.hlsl


#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/MetaInput.hlsl"
struct Attributes
{
float4 positionOS : POSITION;
float3 normalOS : NORMAL;
float2 uv0 : TEXCOORD0;
float2 uv1 : TEXCOORD1;
float2 uv2 : TEXCOORD2;
#ifdef _TANGENT_TO_WORLD
float4 tangentOS : TANGENT;
#endif
};
struct Varyings
{
float4 positionCS : SV_POSITION;
float2 uv : TEXCOORD0;
};
Varyings UniversalVertexMeta(Attributes input)
{
Varyings output;

18
Packages/com.unity.render-pipelines.universal/Shaders/SimpleLitMetaPass.hlsl


#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/MetaInput.hlsl"
struct Attributes
{
float4 positionOS : POSITION;
float3 normalOS : NORMAL;
float2 uv0 : TEXCOORD0;
float2 uv1 : TEXCOORD1;
float2 uv2 : TEXCOORD2;
#ifdef _TANGENT_TO_WORLD
float4 tangentOS : TANGENT;
#endif
};
struct Varyings
{
float4 positionCS : SV_POSITION;
float2 uv : TEXCOORD0;
};
Varyings UniversalVertexMeta(Attributes input)
{
Varyings output;

1
Packages/com.unity.render-pipelines.universal/Shaders/Terrain/TerrainDetailLit.shader


// -------------------------------------
// Unity defined keywords
#pragma multi_compile _ DIRLIGHTMAP_COMBINED
#pragma multi_compile _ LIGHTMAP_ON
#pragma multi_compile_fog

9
Packages/com.unity.render-pipelines.universal/Shaders/Terrain/TerrainLitPasses.hlsl


nrm += splatControl.g * UnpackNormalScale(SAMPLE_TEXTURE2D(_Normal1, sampler_Normal0, uvSplat01.zw), _NormalScale1);
nrm += splatControl.b * UnpackNormalScale(SAMPLE_TEXTURE2D(_Normal2, sampler_Normal0, uvSplat23.xy), _NormalScale2);
nrm += splatControl.a * UnpackNormalScale(SAMPLE_TEXTURE2D(_Normal3, sampler_Normal0, uvSplat23.zw), _NormalScale3);
// avoid risk of NaN when normalizing.
#if HAS_HALF
nrm.z += 0.01h;
#else
nrm.z += 1e-5f;
#endif
nrm.z += 1e-5f; // avoid risk of NaN when normalizing.
mixedNormal = normalize(nrm.xyz);
#endif
}

5
Packages/com.unity.render-pipelines.universal/Tests/Runtime/RuntimeTests.cs


void AssetCheck()
{
//Assert.IsNotNull(currentAsset, "Render Pipeline Asset is Null");
// Temp fix, test passes if project isnt setup for Universal RP
if(currentAsset == null)
Assert.Pass("Render Pipeline Asset is Null, test pass by default");
Assert.IsNotNull(currentAsset, "Render Pipeline Asset is Null");
Assert.AreEqual(currentAsset.GetType(), typeof(UniversalRenderPipelineAsset),
"Pipeline Asset is not Universal RP");

2
Packages/com.unity.render-pipelines.universal/package.json


"description": "The Universal Render Pipeline is a prebuilt Scriptable Render Pipeline, made by Unity. The technology offers graphics that are scalable to mobile platforms, and you can also use it for higher-end consoles and PCs. You’re able to achieve quick rendering at a high quality without needing compute shader technology. The Universal Render Pipeline uses simplified, physically based Lighting and Materials. The Universal Render Pipeline uses single-pass forward rendering. Use this pipeline to get optimized real-time performance on several platforms.",
"version": "7.1.1",
"unity": "2019.3",
"unityRelease": "0b4",
"unityRelease": "0b3",
"displayName": "Universal RP",
"dependencies": {
"com.unity.render-pipelines.core": "7.1.1",

2
Packages/com.unity.shadergraph/CHANGELOG.md


### Fixed
- The Shader Graph preview no longer breaks when you create new PBR Graphs.
- Fixed an issue where deleting a group and a property at the same time would cause an error.
- Fixed the epsilon that the Hue Node uses to avoid NaN on platforms that support half precision.
- Emission nodes no longer produce errors when you use them in Sub Graphs.
- Exposure nodes no longer produce errors when you use them in Sub Graphs.
- Unlit master nodes no longer define unnecessary properties in the Universal Render Pipeline.

- When you use Keywords, PBR and Unlit master nodes no longer produce errors.
## [7.0.1] - 2019-07-25
### Changed

6
Packages/com.unity.shadergraph/Editor/AssetCallbacks/CreateShaderGraph.cs


{
GraphUtil.CreateNewGraph(new PBRMasterNode());
}
[MenuItem("Assets/Create/Shader/VFX Shader Graph", false, 208)]
public static void CreateVfxShaderGraph()
{
GraphUtil.CreateNewGraph(new VfxMasterNode());
}
}
}

6
Packages/com.unity.shadergraph/Editor/Data/Enumerations/Precision.cs


namespace UnityEditor.ShaderGraph.Internal
namespace UnityEditor.ShaderGraph
enum Precision
public enum Precision
{
Inherit,
Float,

public enum ConcretePrecision
{
{
Float,
Half,
}

31
Packages/com.unity.shadergraph/Editor/Data/Graphs/AbstractShaderProperty.cs


using System;
using UnityEditor.Graphing;
namespace UnityEditor.ShaderGraph.Internal
namespace UnityEditor.ShaderGraph
public abstract class AbstractShaderProperty : ShaderInput
abstract class AbstractShaderProperty : ShaderInput
internal override ConcreteSlotValueType concreteShaderValueType => propertyType.ToConcreteShaderValueType();
public override ConcreteSlotValueType concreteShaderValueType => propertyType.ToConcreteShaderValueType();
[SerializeField]
private bool m_GPUInstanced = false;

ConcretePrecision m_ConcretePrecision = ConcretePrecision.Float;
internal Precision precision
public Precision precision
{
get => m_Precision;
set => m_Precision = value;

internal void ValidateConcretePrecision(ConcretePrecision graphPrecision)
public void ValidateConcretePrecision(ConcretePrecision graphPrecision)
internal abstract bool isBatchable { get; }
public abstract bool isBatchable { get; }
[SerializeField]
bool m_Hidden = false;

set => m_Hidden = value;
}
internal string hideTagString => hidden ? "[HideInInspector]" : "";
public string hideTagString => hidden ? "[HideInInspector]" : "";
internal virtual string GetPropertyBlockString()
public virtual string GetPropertyBlockString()
internal virtual string GetPropertyDeclarationString(string delimiter = ";")
public virtual string GetPropertyDeclarationString(string delimiter = ";")
internal virtual string GetPropertyAsArgumentString()
public virtual string GetPropertyAsArgumentString()
internal abstract AbstractMaterialNode ToConcreteNode();
internal abstract PreviewProperty GetPreviewMaterialProperty();
internal virtual bool isGpuInstanceable => false;
public abstract AbstractMaterialNode ToConcreteNode();
public abstract PreviewProperty GetPreviewMaterialProperty();
public virtual bool isGpuInstanceable => false;
public abstract class AbstractShaderProperty<T> : AbstractShaderProperty
abstract class AbstractShaderProperty<T> : AbstractShaderProperty
{
[SerializeField]
T m_Value;

2
Packages/com.unity.shadergraph/Editor/Data/Graphs/BitangentMaterialSlot.cs


using System;
using UnityEditor.ShaderGraph.Drawing.Slots;
using UnityEditor.ShaderGraph.Internal;
using UnityEngine.UIElements;
namespace UnityEditor.ShaderGraph

1
Packages/com.unity.shadergraph/Editor/Data/Graphs/BooleanMaterialSlot.cs


using System.Collections.Generic;
using UnityEditor.Graphing;
using UnityEditor.ShaderGraph.Drawing.Slots;
using UnityEditor.ShaderGraph.Internal;
using UnityEngine;
using UnityEngine.UIElements;

27
Packages/com.unity.shadergraph/Editor/Data/Graphs/BooleanShaderProperty.cs


using UnityEditor.ShaderGraph.Drawing.Controls;
using UnityEngine;
namespace UnityEditor.ShaderGraph.Internal
namespace UnityEditor.ShaderGraph
[FormerName("UnityEditor.ShaderGraph.BooleanShaderProperty")]
public sealed class BooleanShaderProperty : AbstractShaderProperty<bool>
class BooleanShaderProperty : AbstractShaderProperty<bool>
internal BooleanShaderProperty()
public BooleanShaderProperty()
internal override bool isBatchable => true;
internal override bool isExposable => true;
internal override bool isRenamable => true;
internal override string GetPropertyBlockString()
public override bool isBatchable => true;
public override bool isExposable => true;
public override bool isRenamable => true;
public override string GetPropertyBlockString()
internal override AbstractMaterialNode ToConcreteNode()
public override AbstractMaterialNode ToConcreteNode()
internal override PreviewProperty GetPreviewMaterialProperty()
public override PreviewProperty GetPreviewMaterialProperty()
{
return new PreviewProperty(propertyType)
{

}
internal override ShaderInput Copy()
public override ShaderInput Copy()
{
return new BooleanShaderProperty()
{

1
Packages/com.unity.shadergraph/Editor/Data/Graphs/ColorMaterialSlot.cs


using System.Collections.Generic;
using UnityEditor.Graphing;
using UnityEditor.ShaderGraph.Drawing.Slots;
using UnityEditor.ShaderGraph.Internal;
using UnityEngine;
using UnityEngine.UIElements;

1
Packages/com.unity.shadergraph/Editor/Data/Graphs/ColorRGBMaterialSlot.cs


using System.Collections.Generic;
using UnityEditor.Graphing;
using UnityEditor.ShaderGraph.Drawing.Slots;
using UnityEditor.ShaderGraph.Internal;
using UnityEngine;
using UnityEngine.UIElements;

26
Packages/com.unity.shadergraph/Editor/Data/Graphs/ColorShaderProperty.cs


using UnityEditor.Graphing;
using UnityEngine;
namespace UnityEditor.ShaderGraph.Internal
namespace UnityEditor.ShaderGraph
[FormerName("UnityEditor.ShaderGraph.ColorShaderProperty")]
public sealed class ColorShaderProperty : AbstractShaderProperty<Color>
class ColorShaderProperty : AbstractShaderProperty<Color>
internal ColorShaderProperty()
public ColorShaderProperty()
{
displayName = "Color";
}

internal override bool isBatchable => true;
internal override bool isExposable => true;
internal override bool isRenamable => true;
internal override bool isGpuInstanceable => true;
internal string hdrTagString => colorMode == ColorMode.HDR ? "[HDR]" : "";
public override bool isBatchable => true;
public override bool isExposable => true;
public override bool isRenamable => true;
public override bool isGpuInstanceable => true;
public string hdrTagString => colorMode == ColorMode.HDR ? "[HDR]" : "";
internal override string GetPropertyBlockString()
public override string GetPropertyBlockString()
{
return $"{hideTagString}{hdrTagString}{referenceName}(\"{displayName}\", Color) = ({NodeUtils.FloatToShaderValue(value.r)}, {NodeUtils.FloatToShaderValue(value.g)}, {NodeUtils.FloatToShaderValue(value.b)}, {NodeUtils.FloatToShaderValue(value.a)})";
}

set => m_ColorMode = value;
}
internal override AbstractMaterialNode ToConcreteNode()
public override AbstractMaterialNode ToConcreteNode()
internal override PreviewProperty GetPreviewMaterialProperty()
public override PreviewProperty GetPreviewMaterialProperty()
{
return new PreviewProperty(propertyType)
{

}
internal override ShaderInput Copy()
public override ShaderInput Copy()
{
return new ColorShaderProperty()
{

1
Packages/com.unity.shadergraph/Editor/Data/Graphs/CubemapInputMaterialSlot.cs


using System.Collections.Generic;
using UnityEditor.Graphing;
using UnityEditor.ShaderGraph.Drawing.Slots;
using UnityEditor.ShaderGraph.Internal;
using UnityEngine;
using UnityEngine.UIElements;

41
Packages/com.unity.shadergraph/Editor/Data/Graphs/CubemapShaderProperty.cs


using UnityEditor.Graphing;
using UnityEngine;
namespace UnityEditor.ShaderGraph.Internal
namespace UnityEditor.ShaderGraph
[FormerName("UnityEditor.ShaderGraph.CubemapShaderProperty")]
public sealed class CubemapShaderProperty : AbstractShaderProperty<SerializableCubemap>
class CubemapShaderProperty : AbstractShaderProperty<SerializableCubemap>
internal CubemapShaderProperty()
public CubemapShaderProperty()
internal override bool isBatchable => false;
internal override bool isExposable => true;
internal override bool isRenamable => true;
public override bool isBatchable => false;
public override bool isExposable => true;
public override bool isRenamable => true;
public string modifiableTagString => modifiable ? "" : "[NonModifiableTextureData]";
internal string modifiableTagString => modifiable ? "" : "[NonModifiableTextureData]";
internal override string GetPropertyBlockString()
public override string GetPropertyBlockString()
internal override string GetPropertyDeclarationString(string delimiter = ";")
public override string GetPropertyDeclarationString(string delimiter = ";")
internal override string GetPropertyAsArgumentString()
public override string GetPropertyAsArgumentString()
internal bool modifiable
public bool modifiable
internal override AbstractMaterialNode ToConcreteNode()
public override AbstractMaterialNode ToConcreteNode()
internal override PreviewProperty GetPreviewMaterialProperty()
public override PreviewProperty GetPreviewMaterialProperty()
{
return new PreviewProperty(propertyType)
{

}
internal override ShaderInput Copy()
public override ShaderInput Copy()
{
return new CubemapShaderProperty()
{

1
Packages/com.unity.shadergraph/Editor/Data/Graphs/DynamicMatrixMaterialSlot.cs


using System;
using UnityEditor.Graphing;
using UnityEditor.ShaderGraph.Drawing.Slots;
using UnityEditor.ShaderGraph.Internal;
using UnityEngine;
using UnityEngine.UIElements;

1
Packages/com.unity.shadergraph/Editor/Data/Graphs/DynamicValueMaterialSlot.cs


using System.Linq;
using UnityEditor.Graphing;
using UnityEditor.ShaderGraph.Drawing.Slots;
using UnityEditor.ShaderGraph.Internal;
using UnityEngine;
using UnityEngine.UIElements;

1
Packages/com.unity.shadergraph/Editor/Data/Graphs/DynamicVectorMaterialSlot.cs


using System.Linq;
using UnityEditor.Graphing;
using UnityEditor.ShaderGraph.Drawing.Slots;
using UnityEditor.ShaderGraph.Internal;
using UnityEngine;
using UnityEngine.UIElements;

2
Packages/com.unity.shadergraph/Editor/Data/Graphs/GradientInputMaterialSlot.cs


using System.Collections.Generic;
using UnityEditor.Graphing;
using UnityEditor.ShaderGraph.Drawing.Slots;
using UnityEditor.ShaderGraph.Internal;
namespace UnityEditor.ShaderGraph
{

28
Packages/com.unity.shadergraph/Editor/Data/Graphs/GradientShaderProperty.cs


using UnityEditor.ShaderGraph.Drawing.Controls;
using UnityEngine;
using UnityEditor.Graphing;
using UnityEditor.ShaderGraph.Internal;
namespace UnityEditor.ShaderGraph
{

displayName = "Gradient";
value = new Gradient();
}
internal override bool isBatchable => false;
internal override bool isExposable => false;
internal override bool isRenamable => true;
internal override string GetPropertyDeclarationString(string delimiter = ";")
public override bool isBatchable => false;
public override bool isExposable => false;
public override bool isRenamable => true;
public override string GetPropertyDeclarationString(string delimiter = ";")
{
ShaderStringBuilder s = new ShaderStringBuilder();
s.AppendLine("Gradient {0}_Definition()", referenceName);

s.AppendLine(alphas[i]);
s.AppendLine("return g;", true);
}
s.AppendIndentation();
s.Append("#define {0} {0}_Definition()", referenceName);
s.AppendLine("#define {0} {0}_Definition()", referenceName);
internal override string GetPropertyAsArgumentString()
public override string GetPropertyAsArgumentString()
internal override AbstractMaterialNode ToConcreteNode()
public override AbstractMaterialNode ToConcreteNode()
internal override PreviewProperty GetPreviewMaterialProperty()
public override PreviewProperty GetPreviewMaterialProperty()
{
return new PreviewProperty(propertyType)
{

}
internal override ShaderInput Copy()
public override ShaderInput Copy()
{
return new GradientShaderProperty
{

3
Packages/com.unity.shadergraph/Editor/Data/Graphs/GraphData.cs


using UnityEditor.Graphing;
using UnityEditor.Graphing.Util;
using UnityEditor.Rendering;
using UnityEditor.ShaderGraph.Internal;
using Edge = UnityEditor.Graphing.Edge;
namespace UnityEditor.ShaderGraph

{
if (string.IsNullOrEmpty(newName))
return;
string name = newName.Trim();
if (string.IsNullOrEmpty(name))
return;

2
Packages/com.unity.shadergraph/Editor/Data/Graphs/MaterialSlot.cs


using System.Runtime.CompilerServices;
using UnityEngine;
using UnityEditor.Graphing;
using UnityEditor.ShaderGraph.Internal;
using UnityEngine.UIElements;
namespace UnityEditor.ShaderGraph

1
Packages/com.unity.shadergraph/Editor/Data/Graphs/Matrix2MaterialSlot.cs


using System.Collections.Generic;
using UnityEditor.Graphing;
using UnityEditor.ShaderGraph.Drawing.Slots;
using UnityEditor.ShaderGraph.Internal;
using UnityEngine;
using UnityEngine.UIElements;

13
Packages/com.unity.shadergraph/Editor/Data/Graphs/Matrix2ShaderProperty.cs


using System;
using UnityEditor.Graphing;
using UnityEditor.ShaderGraph.Internal;
using UnityEngine;
namespace UnityEditor.ShaderGraph

displayName = "Matrix2x2";
value = Matrix4x4.identity;
}
internal override string GetPropertyAsArgumentString()
public override string GetPropertyAsArgumentString()
internal override AbstractMaterialNode ToConcreteNode()
public override AbstractMaterialNode ToConcreteNode()
{
return new Matrix2Node
{

}
internal override PreviewProperty GetPreviewMaterialProperty()
public override PreviewProperty GetPreviewMaterialProperty()
{
return new PreviewProperty(propertyType)
{

}
internal override ShaderInput Copy()
public override ShaderInput Copy()
{
return new Matrix2ShaderProperty()
{

1
Packages/com.unity.shadergraph/Editor/Data/Graphs/Matrix3MaterialSlot.cs


using System.Collections.Generic;
using UnityEditor.Graphing;
using UnityEditor.ShaderGraph.Drawing.Slots;
using UnityEditor.ShaderGraph.Internal;
using UnityEngine;
using UnityEngine.UIElements;

13
Packages/com.unity.shadergraph/Editor/Data/Graphs/Matrix3ShaderProperty.cs


using System;
using UnityEngine;
using UnityEditor.Graphing;
using UnityEditor.ShaderGraph.Internal;
namespace UnityEditor.ShaderGraph
{

displayName = "Matrix3x3";
value = Matrix4x4.identity;
}
internal override string GetPropertyAsArgumentString()
public override string GetPropertyAsArgumentString()
internal override AbstractMaterialNode ToConcreteNode()
public override AbstractMaterialNode ToConcreteNode()
{
return new Matrix3Node
{

};
}
internal override PreviewProperty GetPreviewMaterialProperty()
public override PreviewProperty GetPreviewMaterialProperty()
{
return new PreviewProperty(propertyType)
{

}
internal override ShaderInput Copy()
public override ShaderInput Copy()
{
return new Matrix3ShaderProperty()
{

1
Packages/com.unity.shadergraph/Editor/Data/Graphs/Matrix4MaterialSlot.cs


using System.Collections.Generic;
using UnityEditor.Graphing;
using UnityEditor.ShaderGraph.Drawing.Slots;
using UnityEditor.ShaderGraph.Internal;
using UnityEngine;
using UnityEngine.UIElements;

11
Packages/com.unity.shadergraph/Editor/Data/Graphs/Matrix4ShaderProperty.cs


using System;
using UnityEngine;
using UnityEditor.Graphing;
using UnityEditor.ShaderGraph.Internal;
namespace UnityEditor.ShaderGraph
{

displayName = "Matrix4x4";
value = Matrix4x4.identity;
}
internal override bool isGpuInstanceable => true;
public override bool isGpuInstanceable => true;
internal override AbstractMaterialNode ToConcreteNode()
public override AbstractMaterialNode ToConcreteNode()
{
return new Matrix4Node
{

};
}
internal override PreviewProperty GetPreviewMaterialProperty()
public override PreviewProperty GetPreviewMaterialProperty()
{
return new PreviewProperty(propertyType)
{

}
internal override ShaderInput Copy()
public override ShaderInput Copy()
{
return new Matrix4ShaderProperty()
{

11
Packages/com.unity.shadergraph/Editor/Data/Graphs/MatrixShaderProperty.cs


using System;
using UnityEditor.ShaderGraph.Internal;
using UnityEngine;
namespace UnityEditor.ShaderGraph

{
internal override bool isBatchable => true;
internal override bool isExposable => false;
internal override bool isRenamable => true;
internal override string GetPropertyDeclarationString(string delimiter = ";")
public override bool isBatchable => true;
public override bool isExposable => false;
public override bool isRenamable => true;
public override string GetPropertyDeclarationString(string delimiter = ";")
{
return $"{concretePrecision.ToShaderString()}4x4 {referenceName}{delimiter}";
}

1
Packages/com.unity.shadergraph/Editor/Data/Graphs/NormalMaterialSlot.cs


using System;
using UnityEditor.ShaderGraph.Drawing.Slots;
using UnityEditor.ShaderGraph.Internal;
using UnityEngine.UIElements;
namespace UnityEditor.ShaderGraph

1
Packages/com.unity.shadergraph/Editor/Data/Graphs/PositionMaterialSlot.cs


using System;
using UnityEditor.ShaderGraph.Drawing.Slots;
using UnityEditor.ShaderGraph.Internal;
using UnityEngine.UIElements;
namespace UnityEditor.ShaderGraph

1
Packages/com.unity.shadergraph/Editor/Data/Graphs/PreviewProperty.cs


using System;
using System.Runtime.InteropServices;
using UnityEngine;
using UnityEditor.ShaderGraph.Internal;
namespace UnityEditor.ShaderGraph
{

25
Packages/com.unity.shadergraph/Editor/Data/Graphs/SamplerStateShaderProperty.cs


using System;
using UnityEditor.Graphing;
using UnityEditor.ShaderGraph.Internal;
using UnityEngine;
namespace UnityEditor.ShaderGraph

}
public override PropertyType propertyType => PropertyType.SamplerState;
internal override bool isBatchable => false;
internal override bool isExposable => false;
internal override bool isRenamable => false;
public override bool isBatchable => false;
public override bool isExposable => false;
public override bool isRenamable => false;
public override TextureSamplerState value
{

base.value = value;
}
}
internal override string GetPropertyDeclarationString(string delimiter = ";")
public override string GetPropertyDeclarationString(string delimiter = ";")
internal override string GetPropertyAsArgumentString()
public override string GetPropertyAsArgumentString()
internal override AbstractMaterialNode ToConcreteNode()
public override AbstractMaterialNode ToConcreteNode()
return new SamplerStateNode()
return new SamplerStateNode()
{
filter = value.filter,
wrap = value.wrap

internal override PreviewProperty GetPreviewMaterialProperty()
public override PreviewProperty GetPreviewMaterialProperty()
internal override ShaderInput Copy()
public override ShaderInput Copy()
{
return new SamplerStateShaderProperty()
{

4
Packages/com.unity.shadergraph/Editor/Data/Graphs/SerializableCubemap.cs


using System;
using UnityEngine;
namespace UnityEditor.ShaderGraph.Internal
namespace UnityEditor.ShaderGraph
public sealed class SerializableCubemap : ISerializationCallbackReceiver
class SerializableCubemap : ISerializationCallbackReceiver
{
[SerializeField]
string m_SerializedCubemap;

4
Packages/com.unity.shadergraph/Editor/Data/Graphs/SerializableTexture.cs


using System;
using UnityEngine;
namespace UnityEditor.ShaderGraph.Internal
namespace UnityEditor.ShaderGraph
public sealed class SerializableTexture : ISerializationCallbackReceiver
class SerializableTexture : ISerializationCallbackReceiver
{
[SerializeField]
string m_SerializedTexture;

4
Packages/com.unity.shadergraph/Editor/Data/Graphs/SerializableTextureArray.cs


using System;
using UnityEngine;
namespace UnityEditor.ShaderGraph.Internal
namespace UnityEditor.ShaderGraph
public sealed class SerializableTextureArray : ISerializationCallbackReceiver
class SerializableTextureArray : ISerializationCallbackReceiver
{
[SerializeField]
string m_SerializedTexture;

173
Packages/com.unity.shadergraph/Editor/Data/Graphs/ShaderGraphRequirements.cs


using System;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
namespace UnityEditor.ShaderGraph.Internal
namespace UnityEditor.ShaderGraph
public struct ShaderGraphRequirements
struct ShaderGraphRequirements
[SerializeField] NeededCoordinateSpace m_RequiresNormal;
[SerializeField] NeededCoordinateSpace m_RequiresBitangent;
[SerializeField] NeededCoordinateSpace m_RequiresTangent;
[SerializeField] NeededCoordinateSpace m_RequiresViewDir;
[SerializeField] NeededCoordinateSpace m_RequiresPosition;
[SerializeField] bool m_RequiresScreenPosition;
[SerializeField] bool m_RequiresVertexColor;
[SerializeField] bool m_RequiresFaceSign;
[SerializeField] List<UVChannel> m_RequiresMeshUVs;
[SerializeField] bool m_RequiresDepthTexture;
[SerializeField] bool m_RequiresCameraOpaqueTexture;
[SerializeField] bool m_RequiresTime;
public NeededCoordinateSpace requiresNormal;
public NeededCoordinateSpace requiresBitangent;
public NeededCoordinateSpace requiresTangent;
public NeededCoordinateSpace requiresViewDir;
public NeededCoordinateSpace requiresPosition;
public bool requiresScreenPosition;
public bool requiresVertexColor;
public bool requiresFaceSign;
public List<UVChannel> requiresMeshUVs;
public bool requiresDepthTexture;
public bool requiresCameraOpaqueTexture;
public bool requiresTime;
internal static ShaderGraphRequirements none
public static ShaderGraphRequirements none
m_RequiresMeshUVs = new List<UVChannel>()
requiresMeshUVs = new List<UVChannel>()
public NeededCoordinateSpace requiresNormal
public bool NeedsTangentSpace()
get { return m_RequiresNormal; }
internal set { m_RequiresNormal = value; }
}
public NeededCoordinateSpace requiresBitangent
{
get { return m_RequiresBitangent; }
internal set { m_RequiresBitangent = value; }
}
public NeededCoordinateSpace requiresTangent
{
get { return m_RequiresTangent; }
internal set { m_RequiresTangent = value; }
}
public NeededCoordinateSpace requiresViewDir
{
get { return m_RequiresViewDir; }
internal set { m_RequiresViewDir = value; }
}
public NeededCoordinateSpace requiresPosition
{
get { return m_RequiresPosition; }
internal set { m_RequiresPosition = value; }
}
public bool requiresScreenPosition
{
get { return m_RequiresScreenPosition; }
internal set { m_RequiresScreenPosition = value; }
}
public bool requiresVertexColor
{
get { return m_RequiresVertexColor; }
internal set { m_RequiresVertexColor = value; }
}
public bool requiresFaceSign
{
get { return m_RequiresFaceSign; }
internal set { m_RequiresFaceSign = value; }
}
public List<UVChannel> requiresMeshUVs
{
get { return m_RequiresMeshUVs; }
internal set { m_RequiresMeshUVs = value; }
}
public bool requiresDepthTexture
{
get { return m_RequiresDepthTexture; }
internal set { m_RequiresDepthTexture = value; }
}
public bool requiresCameraOpaqueTexture
{
get { return m_RequiresCameraOpaqueTexture; }
internal set { m_RequiresCameraOpaqueTexture = value; }
}
public bool requiresTime
{
get { return m_RequiresTime; }
internal set { m_RequiresTime = value; }
}
internal bool NeedsTangentSpace()
{
var compoundSpaces = m_RequiresBitangent | m_RequiresNormal | m_RequiresPosition
| m_RequiresTangent | m_RequiresViewDir | m_RequiresPosition
| m_RequiresNormal;
var compoundSpaces = requiresBitangent | requiresNormal | requiresPosition
| requiresTangent | requiresViewDir | requiresPosition
| requiresNormal;
internal ShaderGraphRequirements Union(ShaderGraphRequirements other)
public ShaderGraphRequirements Union(ShaderGraphRequirements other)
newReqs.m_RequiresNormal = other.m_RequiresNormal | m_RequiresNormal;
newReqs.m_RequiresTangent = other.m_RequiresTangent | m_RequiresTangent;
newReqs.m_RequiresBitangent = other.m_RequiresBitangent | m_RequiresBitangent;
newReqs.m_RequiresViewDir = other.m_RequiresViewDir | m_RequiresViewDir;
newReqs.m_RequiresPosition = other.m_RequiresPosition | m_RequiresPosition;
newReqs.m_RequiresScreenPosition = other.m_RequiresScreenPosition | m_RequiresScreenPosition;
newReqs.m_RequiresVertexColor = other.m_RequiresVertexColor | m_RequiresVertexColor;
newReqs.m_RequiresFaceSign = other.m_RequiresFaceSign | m_RequiresFaceSign;
newReqs.m_RequiresDepthTexture = other.m_RequiresDepthTexture | m_RequiresDepthTexture;
newReqs.m_RequiresCameraOpaqueTexture = other.m_RequiresCameraOpaqueTexture | m_RequiresCameraOpaqueTexture;
newReqs.m_RequiresTime = other.m_RequiresTime | m_RequiresTime;
newReqs.requiresNormal = other.requiresNormal | requiresNormal;
newReqs.requiresTangent = other.requiresTangent | requiresTangent;
newReqs.requiresBitangent = other.requiresBitangent | requiresBitangent;
newReqs.requiresViewDir = other.requiresViewDir | requiresViewDir;
newReqs.requiresPosition = other.requiresPosition | requiresPosition;
newReqs.requiresScreenPosition = other.requiresScreenPosition | requiresScreenPosition;
newReqs.requiresVertexColor = other.requiresVertexColor | requiresVertexColor;
newReqs.requiresFaceSign = other.requiresFaceSign | requiresFaceSign;
newReqs.requiresDepthTexture = other.requiresDepthTexture | requiresDepthTexture;
newReqs.requiresCameraOpaqueTexture = other.requiresCameraOpaqueTexture | requiresCameraOpaqueTexture;
newReqs.requiresTime = other.requiresTime | requiresTime;
newReqs.m_RequiresMeshUVs = new List<UVChannel>();
if (m_RequiresMeshUVs != null)
newReqs.m_RequiresMeshUVs.AddRange(m_RequiresMeshUVs);
if (other.m_RequiresMeshUVs != null)
newReqs.m_RequiresMeshUVs.AddRange(other.m_RequiresMeshUVs);
newReqs.requiresMeshUVs = new List<UVChannel>();
if (requiresMeshUVs != null)
newReqs.requiresMeshUVs.AddRange(requiresMeshUVs);
if (other.requiresMeshUVs != null)
newReqs.requiresMeshUVs.AddRange(other.requiresMeshUVs);
internal static ShaderGraphRequirements FromNodes<T>(List<T> nodes, ShaderStageCapability stageCapability = ShaderStageCapability.All, bool includeIntermediateSpaces = true)
public static ShaderGraphRequirements FromNodes<T>(List<T> nodes, ShaderStageCapability stageCapability = ShaderStageCapability.All, bool includeIntermediateSpaces = true)
where T : AbstractMaterialNode
{
NeededCoordinateSpace requiresNormal = nodes.OfType<IMayRequireNormal>().Aggregate(NeededCoordinateSpace.None, (mask, node) => mask | node.RequiresNormal(stageCapability));

var reqs = new ShaderGraphRequirements()
{
m_RequiresNormal = requiresNormal,
m_RequiresBitangent = requiresBitangent,
m_RequiresTangent = requiresTangent,
m_RequiresViewDir = requiresViewDir,
m_RequiresPosition = requiresPosition,
m_RequiresScreenPosition = requiresScreenPosition,
m_RequiresVertexColor = requiresVertexColor,
m_RequiresFaceSign = requiresFaceSign,
m_RequiresMeshUVs = meshUV,
m_RequiresDepthTexture = requiresDepthTexture,
m_RequiresCameraOpaqueTexture = requiresCameraOpaqueTexture,
m_RequiresTime = requiresTime
requiresNormal = requiresNormal,
requiresBitangent = requiresBitangent,
requiresTangent = requiresTangent,
requiresViewDir = requiresViewDir,
requiresPosition = requiresPosition,
requiresScreenPosition = requiresScreenPosition,
requiresVertexColor = requiresVertexColor,
requiresFaceSign = requiresFaceSign,
requiresMeshUVs = meshUV,
requiresDepthTexture = requiresDepthTexture,
requiresCameraOpaqueTexture = requiresCameraOpaqueTexture,
requiresTime = requiresTime
};
return reqs;

22
Packages/com.unity.shadergraph/Editor/Data/Graphs/ShaderInput.cs


using System;
using System;
namespace UnityEditor.ShaderGraph.Internal
namespace UnityEditor.ShaderGraph
public abstract class ShaderInput
abstract class ShaderInput
internal Guid guid => m_Guid.guid;
public Guid guid => m_Guid.guid;
[SerializeField]
string m_Name;

[SerializeField]
string m_OverrideReferenceName;
internal string overrideReferenceName
public string overrideReferenceName
{
get => m_OverrideReferenceName;
set => m_OverrideReferenceName = value;

bool m_GeneratePropertyBlock = true;
internal bool generatePropertyBlock
public bool generatePropertyBlock
internal abstract ConcreteSlotValueType concreteShaderValueType { get; }
internal abstract bool isExposable { get; }
internal abstract bool isRenamable { get; }
public abstract ConcreteSlotValueType concreteShaderValueType { get; }
public abstract bool isExposable { get; }
public abstract bool isRenamable { get; }
internal abstract ShaderInput Copy();
public abstract ShaderInput Copy();
}
}

22
Packages/com.unity.shadergraph/Editor/Data/Graphs/ShaderKeyword.cs


using System;
using System;
using UnityEditor.ShaderGraph.Internal;
namespace UnityEditor.ShaderGraph
{

public static ShaderKeyword Create(KeywordDescriptor descriptor)
{
if(descriptor.entries != null)
{
for(int i = 0; i < descriptor.entries.Length; i++)
{
if(descriptor.entries[i].id == -1)
descriptor.entries[i].id = i + 1;
}
}
return new ShaderKeyword()
{
m_IsExposable = false,

keywordDefinition = descriptor.definition,
keywordScope = descriptor.scope,
value = descriptor.value,
entries = descriptor.entries.ToList(),
entries = descriptor.entries
};
}

[SerializeField]
private bool m_IsExposable = true;
internal override bool isExposable => m_IsExposable
public override bool isExposable => m_IsExposable
internal override bool isRenamable => isEditable;
public override bool isRenamable => isEditable;
internal override ConcreteSlotValueType concreteShaderValueType => keywordType.ToConcreteSlotValueType();
public override ConcreteSlotValueType concreteShaderValueType => keywordType.ToConcreteSlotValueType();
public override string GetDefaultReferenceName()
{

}
}
internal override ShaderInput Copy()
public override ShaderInput Copy()
{
// Keywords copy reference name
// This is because keywords are copied between graphs

1
Packages/com.unity.shadergraph/Editor/Data/Graphs/SpaceMaterialSlot.cs


using System;
using UnityEditor.Graphing;
using UnityEditor.ShaderGraph.Internal;
using UnityEngine;
namespace UnityEditor.ShaderGraph

1
Packages/com.unity.shadergraph/Editor/Data/Graphs/TangentMaterialSlot.cs


using System;
using UnityEditor.ShaderGraph.Drawing.Slots;
using UnityEditor.ShaderGraph.Internal;
using UnityEngine.UIElements;
namespace UnityEditor.ShaderGraph

1
Packages/com.unity.shadergraph/Editor/Data/Graphs/Texture2DArrayInputMaterialSlot.cs


using System.Collections.Generic;
using UnityEditor.Graphing;
using UnityEditor.ShaderGraph.Drawing.Slots;
using UnityEditor.ShaderGraph.Internal;
using UnityEngine;
using UnityEngine.UIElements;

44
Packages/com.unity.shadergraph/Editor/Data/Graphs/Texture2DArrayShaderProperty.cs


using System;
using System.Text;
using UnityEditor.Graphing;
namespace UnityEditor.ShaderGraph.Internal
namespace UnityEditor.ShaderGraph
[FormerName("UnityEditor.ShaderGraph.Texture2DArrayShaderProperty")]
public sealed class Texture2DArrayShaderProperty : AbstractShaderProperty<SerializableTextureArray>
class Texture2DArrayShaderProperty : AbstractShaderProperty<SerializableTextureArray>
internal Texture2DArrayShaderProperty()
public Texture2DArrayShaderProperty()
internal override bool isBatchable => false;
internal override bool isExposable => true;
internal override bool isRenamable => true;
internal string modifiableTagString => modifiable ? "" : "[NonModifiableTextureData]";
public override bool isBatchable => false;
public override bool isExposable => true;
public override bool isRenamable => true;
public string modifiableTagString => modifiable ? "" : "[NonModifiableTextureData]";
internal override string GetPropertyBlockString()
public override string GetPropertyBlockString()
internal override string GetPropertyDeclarationString(string delimiter = ";")
public override string GetPropertyDeclarationString(string delimiter = ";")
internal override string GetPropertyAsArgumentString()
public override string GetPropertyAsArgumentString()
internal bool modifiable
public bool modifiable
internal override AbstractMaterialNode ToConcreteNode()
public override AbstractMaterialNode ToConcreteNode()
internal override PreviewProperty GetPreviewMaterialProperty()
public override PreviewProperty GetPreviewMaterialProperty()
{
return new PreviewProperty(propertyType)
{

}
internal override ShaderInput Copy()
public override ShaderInput Copy()
{
return new Texture2DArrayShaderProperty()
{

7
Packages/com.unity.shadergraph/Editor/Data/Graphs/Texture2DInputMaterialSlot.cs


using System.Collections.Generic;
using UnityEditor.Graphing;
using UnityEditor.ShaderGraph.Drawing.Slots;
using UnityEditor.ShaderGraph.Internal;
using UnityEngine;
using UnityEngine.UIElements;

private SerializableTexture m_Texture = new SerializableTexture();
[SerializeField]
private Texture2DShaderProperty.DefaultType m_DefaultType = Texture2DShaderProperty.DefaultType.White;
private TextureShaderProperty.DefaultType m_DefaultType = TextureShaderProperty.DefaultType.White;
public Texture texture
{

public Texture2DShaderProperty.DefaultType defaultType
public TextureShaderProperty.DefaultType defaultType
{
get { return m_DefaultType; }
set { m_DefaultType = value; }

if (matOwner == null)
throw new Exception(string.Format("Slot {0} either has no owner, or the owner is not a {1}", this, typeof(AbstractMaterialNode)));
var prop = new Texture2DShaderProperty();
var prop = new TextureShaderProperty();
prop.overrideReferenceName = matOwner.GetVariableNameForSlot(id);
prop.modifiable = false;
prop.generatePropertyBlock = true;

1
Packages/com.unity.shadergraph/Editor/Data/Graphs/Texture3DInputMaterialSlot.cs


using System.Collections.Generic;
using UnityEditor.Graphing;
using UnityEditor.ShaderGraph.Drawing.Slots;
using UnityEditor.ShaderGraph.Internal;
using UnityEngine;
using UnityEngine.UIElements;

41
Packages/com.unity.shadergraph/Editor/Data/Graphs/Texture3DShaderProperty.cs


using System;
using System.Text;
using UnityEditor.Graphing;
namespace UnityEditor.ShaderGraph.Internal
namespace UnityEditor.ShaderGraph
[FormerName("UnityEditor.ShaderGraph.Texture3DShaderProperty")]
public sealed class Texture3DShaderProperty : AbstractShaderProperty<SerializableTexture>
class Texture3DShaderProperty : AbstractShaderProperty<SerializableTexture>
internal Texture3DShaderProperty()
public Texture3DShaderProperty()
public override bool isBatchable => false;
public override bool isExposable => true;
public override bool isRenamable => true;
public string modifiableTagString => modifiable ? "" : "[NonModifiableTextureData]";
internal override bool isBatchable => false;
internal override bool isExposable => true;
internal override bool isRenamable => true;
internal string modifiableTagString => modifiable ? "" : "[NonModifiableTextureData]";
internal override string GetPropertyBlockString()
public override string GetPropertyBlockString()
internal override string GetPropertyDeclarationString(string delimiter = ";")
public override string GetPropertyDeclarationString(string delimiter = ";")
internal override string GetPropertyAsArgumentString()
public override string GetPropertyAsArgumentString()
[SerializeField]
bool m_Modifiable = true;

set => m_Modifiable = value;
}
internal override AbstractMaterialNode ToConcreteNode()
public override AbstractMaterialNode ToConcreteNode()
internal override PreviewProperty GetPreviewMaterialProperty()
public override PreviewProperty GetPreviewMaterialProperty()
{
return new PreviewProperty(propertyType)
{

}
internal override ShaderInput Copy()
public override ShaderInput Copy()
{
return new Texture3DShaderProperty()
{

1
Packages/com.unity.shadergraph/Editor/Data/Graphs/UVMaterialSlot.cs


using System;
using UnityEditor.Graphing;
using UnityEditor.ShaderGraph.Drawing.Slots;
using UnityEditor.ShaderGraph.Internal;
using UnityEngine;
using UnityEngine.UIElements;

1
Packages/com.unity.shadergraph/Editor/Data/Graphs/Vector1MaterialSlot.cs


using System.Collections.Generic;
using UnityEditor.Graphing;
using UnityEditor.ShaderGraph.Drawing.Slots;
using UnityEditor.ShaderGraph.Internal;
using UnityEngine;
using UnityEngine.UIElements;

33
Packages/com.unity.shadergraph/Editor/Data/Graphs/Vector1ShaderProperty.cs


using UnityEditor.Graphing;
using UnityEngine;
namespace UnityEditor.ShaderGraph.Internal
namespace UnityEditor.ShaderGraph
enum FloatType { Default, Slider, Integer, Enum }
public enum EnumType { Enum, CSharpEnum, KeywordEnum, }
[FormerName("UnityEditor.ShaderGraph.Vector1ShaderProperty")]
public sealed class Vector1ShaderProperty : AbstractShaderProperty<float>
class Vector1ShaderProperty : AbstractShaderProperty<float>
internal Vector1ShaderProperty()
public Vector1ShaderProperty()
{
displayName = "Vector1";
}

internal override bool isBatchable => true;
internal override bool isExposable => true;
internal override bool isRenamable => true;
internal override bool isGpuInstanceable => true;
public override bool isBatchable => true;
public override bool isExposable => true;
public override bool isRenamable => true;
public override bool isGpuInstanceable => true;
string enumTagString
{
get

}
}
internal override string GetPropertyBlockString()
public override string GetPropertyBlockString()
{
switch(floatType)
{

set => m_EnumValues = value;
}
internal override AbstractMaterialNode ToConcreteNode()
public override AbstractMaterialNode ToConcreteNode()
{
switch (m_FloatType)
{

}
}
internal override PreviewProperty GetPreviewMaterialProperty()
public override PreviewProperty GetPreviewMaterialProperty()
{
return new PreviewProperty(propertyType)
{

}
internal override ShaderInput Copy()
public override ShaderInput Copy()
{
return new Vector1ShaderProperty()
{

};
}
}
public enum FloatType { Default, Slider, Integer, Enum }
public enum EnumType { Enum, CSharpEnum, KeywordEnum, }
}

1
Packages/com.unity.shadergraph/Editor/Data/Graphs/Vector2MaterialSlot.cs


using System.Collections.Generic;
using UnityEditor.Graphing;
using UnityEditor.ShaderGraph.Drawing.Slots;
using UnityEditor.ShaderGraph.Internal;
using UnityEngine;
using UnityEngine.UIElements;

17
Packages/com.unity.shadergraph/Editor/Data/Graphs/Vector2ShaderProperty.cs


using UnityEditor.Graphing;
using UnityEngine;
namespace UnityEditor.ShaderGraph.Internal
namespace UnityEditor.ShaderGraph
[FormerName("UnityEditor.ShaderGraph.Vector2ShaderProperty")]
public sealed class Vector2ShaderProperty : VectorShaderProperty
class Vector2ShaderProperty : VectorShaderProperty
internal Vector2ShaderProperty()
public Vector2ShaderProperty()
internal override AbstractMaterialNode ToConcreteNode()
public override AbstractMaterialNode ToConcreteNode()
{
var node = new Vector2Node();
node.FindInputSlot<Vector1MaterialSlot>(Vector2Node.InputSlotXId).value = value.x;

internal override PreviewProperty GetPreviewMaterialProperty()
public override PreviewProperty GetPreviewMaterialProperty()
{
return new PreviewProperty(propertyType)
{

}
internal override ShaderInput Copy()
public override ShaderInput Copy()
{
return new Vector2ShaderProperty()
{

1
Packages/com.unity.shadergraph/Editor/Data/Graphs/Vector3MaterialSlot.cs


using System.Collections.Generic;
using UnityEditor.Graphing;
using UnityEditor.ShaderGraph.Drawing.Slots;
using UnityEditor.ShaderGraph.Internal;
using UnityEngine;
using UnityEngine.UIElements;

19
Packages/com.unity.shadergraph/Editor/Data/Graphs/Vector3ShaderProperty.cs


using UnityEditor.Graphing;
using UnityEngine;
namespace UnityEditor.ShaderGraph.Internal
namespace UnityEditor.ShaderGraph
[FormerName("UnityEditor.ShaderGraph.Vector3ShaderProperty")]
public sealed class Vector3ShaderProperty : VectorShaderProperty
class Vector3ShaderProperty : VectorShaderProperty
internal Vector3ShaderProperty()
public Vector3ShaderProperty()
internal override AbstractMaterialNode ToConcreteNode()
public override AbstractMaterialNode ToConcreteNode()
{
var node = new Vector3Node();
node.FindInputSlot<Vector1MaterialSlot>(Vector3Node.InputSlotXId).value = value.x;

}
internal override PreviewProperty GetPreviewMaterialProperty()
public override PreviewProperty GetPreviewMaterialProperty()
{
return new PreviewProperty(propertyType)
{

}
internal override ShaderInput Copy()
public override ShaderInput Copy()
{
return new Vector3ShaderProperty()
{

1
Packages/com.unity.shadergraph/Editor/Data/Graphs/Vector4MaterialSlot.cs


using System.Collections.Generic;
using UnityEditor.Graphing;
using UnityEditor.ShaderGraph.Drawing.Slots;
using UnityEditor.ShaderGraph.Internal;
using UnityEngine;
using UnityEngine.UIElements;

17
Packages/com.unity.shadergraph/Editor/Data/Graphs/Vector4ShaderProperty.cs


using UnityEditor.Graphing;
using UnityEngine;
namespace UnityEditor.ShaderGraph.Internal
namespace UnityEditor.ShaderGraph
[FormerName("UnityEditor.ShaderGraph.Vector4ShaderProperty")]
public sealed class Vector4ShaderProperty : VectorShaderProperty
class Vector4ShaderProperty : VectorShaderProperty
internal Vector4ShaderProperty()
public Vector4ShaderProperty()
internal override bool isGpuInstanceable => true;
public override bool isGpuInstanceable => true;
internal override AbstractMaterialNode ToConcreteNode()
public override AbstractMaterialNode ToConcreteNode()
{
var node = new Vector4Node();
node.FindInputSlot<Vector1MaterialSlot>(Vector4Node.InputSlotXId).value = value.x;

return node;
}
internal override PreviewProperty GetPreviewMaterialProperty()
public override PreviewProperty GetPreviewMaterialProperty()
{
return new PreviewProperty(propertyType)
{

}
internal override ShaderInput Copy()
public override ShaderInput Copy()
{
return new Vector4ShaderProperty()
{

14
Packages/com.unity.shadergraph/Editor/Data/Graphs/VectorShaderProperty.cs


using UnityEditor.Graphing;
using UnityEngine;
namespace UnityEditor.ShaderGraph.Internal
namespace UnityEditor.ShaderGraph
public abstract class VectorShaderProperty : AbstractShaderProperty<Vector4>
abstract class VectorShaderProperty : AbstractShaderProperty<Vector4>
internal override bool isBatchable => true;
internal override bool isExposable => true;
internal override bool isRenamable => true;
internal override string GetPropertyBlockString()
public override bool isBatchable => true;
public override bool isExposable => true;
public override bool isRenamable => true;
public override string GetPropertyBlockString()
{
return $"{hideTagString}{referenceName}(\"{displayName}\", Vector) = ({NodeUtils.FloatToShaderValue(value.x)}, {NodeUtils.FloatToShaderValue(value.y)}, {NodeUtils.FloatToShaderValue(value.z)}, {NodeUtils.FloatToShaderValue(value.w)})";
}

1
Packages/com.unity.shadergraph/Editor/Data/Graphs/ViewDirectionMaterialSlot.cs


using System;
using UnityEditor.ShaderGraph.Drawing.Slots;
using UnityEditor.ShaderGraph.Internal;
using UnityEngine.UIElements;
namespace UnityEditor.ShaderGraph

2
Packages/com.unity.shadergraph/Editor/Data/Graphs/KeywordEntry.cs.meta


fileFormatVersion: 2
guid: 63a7cfa9798c44c73adc75d485d666d9
guid: b1a1d5162a1876c40acc12fe9fa1aeb0
MonoImporter:
externalObjects: {}
serializedVersion: 2

33
Packages/com.unity.shadergraph/Editor/Data/Implementation/NodeUtils.cs


using System.Linq;
using System.Text;
using UnityEditor.ShaderGraph;
using UnityEditor.ShaderGraph.Drawing;
using UnityEngine;
namespace UnityEditor.Graphing

if (includeSelf == IncludeSelf.Include)
nodeList.Add(node);
}
public static void CollectNodeSet(HashSet<AbstractMaterialNode> nodeSet, MaterialSlot slot)
{
var node = slot.owner;
var graph = node.owner;
foreach (var edge in graph.GetEdges(node.GetSlotReference(slot.id)))
{
var outputNode = graph.GetNodeFromGuid(edge.outputSlot.nodeGuid);
if (outputNode != null)
{
CollectNodeSet(nodeSet, outputNode);
}
}
}
public static void CollectNodeSet(HashSet<AbstractMaterialNode> nodeSet, AbstractMaterialNode node)
{
if (!nodeSet.Add(node))
{
return;
}
using (var slotsHandle = ListPool<MaterialSlot>.GetDisposable())
{
var slots = slotsHandle.value;
node.GetInputSlots(slots);
foreach (var slot in slots)
{
CollectNodeSet(nodeSet, slot);
}
}
}
public static void CollectNodesNodeFeedsInto(List<AbstractMaterialNode> nodeList, AbstractMaterialNode node, IncludeSelf includeSelf = IncludeSelf.Include)

2
Packages/com.unity.shadergraph/Editor/Data/Interfaces/IGeneratesBodyCode.cs


{
interface IGeneratesBodyCode
{
void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode generationMode);
void GenerateNodeCode(ShaderStringBuilder sb, GraphContext graphContext, GenerationMode generationMode);
}
}

2
Packages/com.unity.shadergraph/Editor/Data/Interfaces/IGeneratesFunction.cs


{
interface IGeneratesFunction
{
void GenerateNodeFunction(FunctionRegistry registry, GenerationMode generationMode);
void GenerateNodeFunction(FunctionRegistry registry, GraphContext graphContext, GenerationMode generationMode);
}
}

1
Packages/com.unity.shadergraph/Editor/Data/Interfaces/IMayRequireBitangent.cs


using UnityEditor.Graphing;
using UnityEditor.ShaderGraph.Internal;
namespace UnityEditor.ShaderGraph
{

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

正在加载...
取消
保存