Class UniversalRenderPipeline
The main class for the Universal Render Pipeline (URP).
Inherited Members
Namespace: UnityEngine.Rendering.Universal
Assembly: Unity.RenderPipelines.Universal.Runtime.dll
Syntax
public sealed class UniversalRenderPipeline : RenderPipeline
Constructors
UniversalRenderPipeline(UniversalRenderPipelineAsset)
Creates a new UniversalRenderPipeline
instance.
Declaration
public UniversalRenderPipeline(UniversalRenderPipelineAsset asset)
Parameters
Type | Name | Description |
---|---|---|
UniversalRenderPipelineAsset | asset | The |
See Also
Fields
k_ShaderTagName
The shader tag used in the Universal Render Pipeline (URP)
Declaration
public const string k_ShaderTagName = "UniversalPipeline"
Field Value
Type | Description |
---|---|
string |
Properties
asset
Returns the current render pipeline asset for the current quality setting. If no render pipeline asset is assigned in QualitySettings, then returns the one assigned in GraphicsSettings.
Declaration
public static UniversalRenderPipelineAsset asset { get; }
Property Value
Type | Description |
---|---|
UniversalRenderPipelineAsset |
defaultSettings
The default Render Pipeline Global Settings.
Declaration
public override RenderPipelineGlobalSettings defaultSettings { get; }
Property Value
Type | Description |
---|---|
RenderPipelineGlobalSettings |
Overrides
maxNumIterationsEnclosingSphere
The max number of iterations allowed calculating enclosing sphere.
Declaration
public static int maxNumIterationsEnclosingSphere { get; }
Property Value
Type | Description |
---|---|
int |
maxPerObjectLights
The max number of lights that can be shaded per object (in the for loop in the shader).
Declaration
public static int maxPerObjectLights { get; }
Property Value
Type | Description |
---|---|
int |
maxRenderScale
The maximum value allowed for render scale.
Declaration
public static float maxRenderScale { get; }
Property Value
Type | Description |
---|---|
float |
maxShadowBias
The maximum amount of bias allowed for shadows.
Declaration
public static float maxShadowBias { get; }
Property Value
Type | Description |
---|---|
float |
maxVisibleAdditionalLights
The max number of additional lights that can can affect each GameObject.
Declaration
public static int maxVisibleAdditionalLights { get; }
Property Value
Type | Description |
---|---|
int |
minRenderScale
The minimum value allowed for render scale.
Declaration
public static float minRenderScale { get; }
Property Value
Type | Description |
---|---|
float |
Methods
Dispose(bool)
Declaration
protected override void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
bool | disposing |
Overrides
GetLightAttenuationAndSpotDirection(LightType, float, Matrix4x4, float, float?, out Vector4, out Vector4)
Calculates the attenuation for a given light and also direction for spot lights.
Declaration
public static void GetLightAttenuationAndSpotDirection(LightType lightType, float lightRange, Matrix4x4 lightLocalToWorldMatrix, float spotAngle, float? innerSpotAngle, out Vector4 lightAttenuation, out Vector4 lightSpotDir)
Parameters
Type | Name | Description |
---|---|---|
LightType | lightType | The type of light. |
float | lightRange | The range of the light. |
Matrix4x4 | lightLocalToWorldMatrix | The local to world light matrix. |
float | spotAngle | The spotlight angle. |
float? | innerSpotAngle | The spotlight inner angle. |
Vector4 | lightAttenuation | The light attenuation. |
Vector4 | lightSpotDir | The spot light direction. |
InitializeLightConstants_Common(NativeArray<VisibleLight>, int, out Vector4, out Vector4, out Vector4, out Vector4, out Vector4)
Initializes common light constants.
Declaration
public static void InitializeLightConstants_Common(NativeArray<VisibleLight> lights, int lightIndex, out Vector4 lightPos, out Vector4 lightColor, out Vector4 lightAttenuation, out Vector4 lightSpotDir, out Vector4 lightOcclusionProbeChannel)
Parameters
Type | Name | Description |
---|---|---|
NativeArray<VisibleLight> | lights | List of lights to iterate. |
int | lightIndex | The index of the light. |
Vector4 | lightPos | The position of the light. |
Vector4 | lightColor | The color of the light. |
Vector4 | lightAttenuation | The attenuation of the light. |
Vector4 | lightSpotDir | The direction of the light. |
Vector4 | lightOcclusionProbeChannel | The occlusion probe channel for the light. |
IsGameCamera(Camera)
Checks if a camera is a game camera.
Declaration
public static bool IsGameCamera(Camera camera)
Parameters
Type | Name | Description |
---|---|---|
Camera | camera | Camera to check state from. |
Returns
Type | Description |
---|---|
bool | true if given camera is a game camera, false otherwise. |
IsRenderRequestSupported<RequestData>(Camera, RequestData)
Check whether RenderRequest is supported
Declaration
protected override bool IsRenderRequestSupported<RequestData>(Camera camera, RequestData data)
Parameters
Type | Name | Description |
---|---|---|
Camera | camera | |
RequestData | data |
Returns
Type | Description |
---|---|
bool |
Type Parameters
Name | Description |
---|---|
RequestData |
Overrides
ProcessRenderRequests<RequestData>(ScriptableRenderContext, Camera, RequestData)
Process a render request
Declaration
protected override void ProcessRenderRequests<RequestData>(ScriptableRenderContext context, Camera camera, RequestData renderRequest)
Parameters
Type | Name | Description |
---|---|---|
ScriptableRenderContext | context | |
Camera | camera | |
RequestData | renderRequest |
Type Parameters
Name | Description |
---|---|
RequestData |
Overrides
Render(ScriptableRenderContext, List<Camera>)
Declaration
protected override void Render(ScriptableRenderContext renderContext, List<Camera> cameras)
Parameters
Type | Name | Description |
---|---|---|
ScriptableRenderContext | renderContext | |
List<Camera> | cameras |
Overrides
Render(ScriptableRenderContext, Camera[])
Declaration
protected override void Render(ScriptableRenderContext renderContext, Camera[] cameras)
Parameters
Type | Name | Description |
---|---|---|
ScriptableRenderContext | renderContext | |
Camera[] | cameras |
Overrides
ToString()
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string |