Skip to content

Cleaun shader config for shadow #917

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,6 @@

namespace UnityEngine.Rendering.HighDefinition
{
[GenerateHLSL(PackingRules.Exact)]
public enum HDShadowFilteringQuality
{
Low = 0,
Medium = 1,
High = 2,
}

[GenerateHLSL(PackingRules.Exact)]
public enum ProbeVolumesEvaluationModes
{
Expand Down Expand Up @@ -68,9 +60,6 @@ public enum ShaderOptions

AreaLights = 1,

[System.Obsolete("Deferred shadow can now assume any value, so this field is not used anymore.")]
DeferredShadowFiltering = HDShadowFilteringQuality.Medium,

BarnDoor = 0
};

Expand All @@ -91,7 +80,5 @@ public class ShaderConfig
public static ProbeVolumesEncodingModes s_ProbeVolumesEncodingMode = (ProbeVolumesEncodingModes)ShaderOptions.ProbeVolumesEncodingMode;
public static int s_AreaLights = (int)ShaderOptions.AreaLights;
public static int s_BarnDoor = (int)ShaderOptions.BarnDoor;
[System.Obsolete("Deferred shadow can now assume any value, so this field is not used anymore.")]
public static HDShadowFilteringQuality s_DeferredShadowFiltering = (HDShadowFilteringQuality)ShaderOptions.DeferredShadowFiltering;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ HDRP now stores OnEnable and OnDemand shadows in a separate atlas and more API i

The shader function `SampleShadow_PCSS` now requires you to pass in an additional float2 parameter which contains the shadow atlas resolution in x and the inverse of the atlas resolution in y.

## Shader config file

From Unity 2020.2, due to the change of shadow map, the enum HDShadowFilteringQuality have been moved to HDShadowManager.cs and the variables ShaderConfig.s_DeferredShadowFiltering as well as the option ShaderOptions.DeferredShadowFiltering have been removed from the code as they have no impact anymore.


## Shader code

From Unity 2020.2, HDRP uses a new structure to output information from the LightLoop. It now uses a custom LightLoop struct instead of the `float3 diffuseLighting`, `float3 specularLighting` pair. This is to allow HDRP to export more information from the LightLoop in the future without breaking the API.
Expand Down Expand Up @@ -88,4 +93,4 @@ With:

```
protected override void Execute(CustomPassContext ctx) { ... }
```
```
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@

namespace UnityEngine.Rendering.HighDefinition
{
/// <summary>
/// Shadow Filtering Quality
/// </summary>
public enum HDShadowFilteringQuality
{
Low = 0,
Medium = 1,
High = 2,
}

enum ShadowMapType
{
CascadedDirectional,
Expand Down