sync
This commit is contained in:
parent
19aec25a3d
commit
91c7f57d09
@ -28,7 +28,7 @@ MonoBehaviour:
|
|||||||
m_SupportsHDR: 1
|
m_SupportsHDR: 1
|
||||||
m_HDRColorBufferPrecision: 0
|
m_HDRColorBufferPrecision: 0
|
||||||
m_MSAA: 1
|
m_MSAA: 1
|
||||||
m_RenderScale: 0.5
|
m_RenderScale: 0.58823526
|
||||||
m_UpscalingFilter: 0
|
m_UpscalingFilter: 0
|
||||||
m_FsrOverrideSharpness: 1
|
m_FsrOverrideSharpness: 1
|
||||||
m_FsrSharpness: 1
|
m_FsrSharpness: 1
|
||||||
@ -114,5 +114,5 @@ MonoBehaviour:
|
|||||||
m_PrefilterNativeRenderPass: 1
|
m_PrefilterNativeRenderPass: 1
|
||||||
m_ShaderVariantLogLevel: 0
|
m_ShaderVariantLogLevel: 0
|
||||||
m_ShadowCascades: 0
|
m_ShadowCascades: 0
|
||||||
superResolution: 16
|
superResolution: 5
|
||||||
vrsRate: 0
|
vrsRate: 0
|
||||||
|
|||||||
@ -26,7 +26,7 @@ MonoBehaviour:
|
|||||||
m_Script: {fileID: 11500000, guid: a00dddc5b3ea7fe45953ccbd49b58b94, type: 3}
|
m_Script: {fileID: 11500000, guid: a00dddc5b3ea7fe45953ccbd49b58b94, type: 3}
|
||||||
m_Name: GSR
|
m_Name: GSR
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
m_Active: 0
|
m_Active: 1
|
||||||
quality: 4
|
quality: 4
|
||||||
v1settings:
|
v1settings:
|
||||||
EnableEdgeDirection: 1
|
EnableEdgeDirection: 1
|
||||||
@ -35,12 +35,12 @@ MonoBehaviour:
|
|||||||
MipMapBias: -0.35
|
MipMapBias: -0.35
|
||||||
GSRV1Material: {fileID: 2100000, guid: d57e64d5723127243b429034bed82c7d, type: 2}
|
GSRV1Material: {fileID: 2100000, guid: d57e64d5723127243b429034bed82c7d, type: 2}
|
||||||
v2settings:
|
v2settings:
|
||||||
UseCompute2Pass: 1
|
UseCompute2Pass: 0
|
||||||
GSRV2Material: {fileID: 2100000, guid: faa906817c0647f42a0cec70faeb91c1, type: 2}
|
GSRV2Material: {fileID: 2100000, guid: faa906817c0647f42a0cec70faeb91c1, type: 2}
|
||||||
GSRV2ComputeShader: {fileID: 7200000, guid: 9a4e6ff1f9a33fa4ea1e9744e313e2fd, type: 3}
|
GSRV2ComputeShader: {fileID: 7200000, guid: 9a4e6ff1f9a33fa4ea1e9744e313e2fd, type: 3}
|
||||||
FiveSample: 0
|
FiveSample: 0
|
||||||
Exposure_co_rcp: 1
|
Exposure_co_rcp: 1
|
||||||
MipMapBias: -1.26
|
MipMapBias: -1.34
|
||||||
--- !u!114 &-2390300670611609275
|
--- !u!114 &-2390300670611609275
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@ -318,7 +318,7 @@ MonoBehaviour:
|
|||||||
m_Script: {fileID: 11500000, guid: b1643a5e9ea49724e8a7bc2c6f3713e1, type: 3}
|
m_Script: {fileID: 11500000, guid: b1643a5e9ea49724e8a7bc2c6f3713e1, type: 3}
|
||||||
m_Name: XESS
|
m_Name: XESS
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
m_Active: 1
|
m_Active: 0
|
||||||
xess1ConfigParam:
|
xess1ConfigParam:
|
||||||
OutputWidth: 2560
|
OutputWidth: 2560
|
||||||
OutputHeight: 1440
|
OutputHeight: 1440
|
||||||
@ -339,7 +339,7 @@ MonoBehaviour:
|
|||||||
MipMapBias: 0
|
MipMapBias: 0
|
||||||
antiGhosting: 0.1
|
antiGhosting: 0.1
|
||||||
sharpMaterial: {fileID: 2100000, guid: b356b97c3a610794582dd87ab85f4e98, type: 2}
|
sharpMaterial: {fileID: 2100000, guid: b356b97c3a610794582dd87ab85f4e98, type: 2}
|
||||||
sharpness: 0.493
|
sharpness: 1.652
|
||||||
sharpMipLevel: 0
|
sharpMipLevel: 0
|
||||||
--- !u!114 &6334271670068977784
|
--- !u!114 &6334271670068977784
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
|
|||||||
@ -1,23 +1,145 @@
|
|||||||
|
using System;
|
||||||
|
using UnityEngine;
|
||||||
using UnityEngine.Rendering;
|
using UnityEngine.Rendering;
|
||||||
using UnityEngine.Rendering.Universal;
|
using UnityEngine.Rendering.Universal;
|
||||||
namespace X.Rendering.Feature
|
namespace X.Rendering.Feature
|
||||||
{
|
{
|
||||||
|
enum FsrQuality
|
||||||
|
{
|
||||||
|
None,
|
||||||
|
NativeAA = 1,
|
||||||
|
Quality,
|
||||||
|
Balanced,
|
||||||
|
Performance,
|
||||||
|
UltraPerformance,
|
||||||
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// AMD FSR
|
/// AMD FSR
|
||||||
/// api 无关,显卡无关
|
/// api 无关,显卡无关
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class FSR : ScriptableRendererFeature
|
public class FSR : ScriptableRendererFeature, ISuperResolutionFeature
|
||||||
{
|
{
|
||||||
|
[SerializeField]
|
||||||
|
private FsrQuality quality;
|
||||||
|
|
||||||
|
FSRV1 fsr1;
|
||||||
|
enum FsrVer
|
||||||
|
{
|
||||||
|
FSRV1,
|
||||||
|
FSRV2,
|
||||||
|
FSRV3,
|
||||||
|
}
|
||||||
|
|
||||||
|
FsrVer fsrVer;
|
||||||
|
|
||||||
public override void AddRenderPasses(ScriptableRenderer renderer, ref RenderingData renderingData)
|
public override void AddRenderPasses(ScriptableRenderer renderer, ref RenderingData renderingData)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Create()
|
public override void Create()
|
||||||
{
|
{
|
||||||
|
fsr1 = new();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void DoSR(CommandBuffer cmd, RTHandle source, RTHandle destination, RTHandle motionVector, ref RenderingData renderingData)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public float GetRenderScale()
|
||||||
|
{
|
||||||
|
if (fsrVer == FsrVer.FSRV1)
|
||||||
|
{
|
||||||
|
switch (quality)
|
||||||
|
{
|
||||||
|
case FsrQuality.None:
|
||||||
|
case FsrQuality.NativeAA:
|
||||||
|
{
|
||||||
|
return 1.0f;
|
||||||
|
}
|
||||||
|
case FsrQuality.Quality:
|
||||||
|
{
|
||||||
|
return 1 / 1.3f;
|
||||||
|
}
|
||||||
|
case FsrQuality.Balanced:
|
||||||
|
{
|
||||||
|
return 1 / 1.5f;
|
||||||
|
}
|
||||||
|
case FsrQuality.Performance:
|
||||||
|
{
|
||||||
|
return 1 / 1.7f;
|
||||||
|
}
|
||||||
|
case FsrQuality.UltraPerformance:
|
||||||
|
{
|
||||||
|
return 1 / 2f;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (quality)
|
||||||
|
{
|
||||||
|
case FsrQuality.None:
|
||||||
|
case FsrQuality.NativeAA:
|
||||||
|
{
|
||||||
|
return 1.0f;
|
||||||
|
}
|
||||||
|
case FsrQuality.Quality:
|
||||||
|
{
|
||||||
|
return 1/ 1.5f;
|
||||||
|
}
|
||||||
|
case FsrQuality.Balanced:
|
||||||
|
{
|
||||||
|
return 1/ 1.7f;
|
||||||
|
}
|
||||||
|
case FsrQuality.Performance:
|
||||||
|
{
|
||||||
|
return 0.5f;
|
||||||
|
}
|
||||||
|
case FsrQuality.UltraPerformance:
|
||||||
|
{
|
||||||
|
return 1.0f / 3;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return 1.0f;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetSR(ESuperResolution resolution)
|
||||||
|
{
|
||||||
|
|
||||||
|
switch (resolution)
|
||||||
|
{
|
||||||
|
case ESuperResolution.FSR1:
|
||||||
|
{
|
||||||
|
SetActive(true);
|
||||||
|
fsrVer = FsrVer.FSRV1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case ESuperResolution.FSR2:
|
||||||
|
{
|
||||||
|
SetActive(true);
|
||||||
|
fsrVer = FsrVer.FSRV2;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case ESuperResolution.FSR3:
|
||||||
|
{
|
||||||
|
SetActive(true);
|
||||||
|
fsrVer = FsrVer.FSRV3;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
SetActive(false);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sealed class FSRV1
|
sealed class FSRV1 : IDisposable
|
||||||
{
|
{
|
||||||
|
// 抗锯齿输出,在tonemapping 后最好,在 Film grain, Chromatic aberration 等高频视觉后处理之前
|
||||||
|
public void Dispose()
|
||||||
|
{
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -218,6 +218,7 @@ namespace X.Rendering.Feature
|
|||||||
|
|
||||||
if (sharpPass)
|
if (sharpPass)
|
||||||
{
|
{
|
||||||
|
// XXX: opt 锐化可以放到后处理 uberpost 中(如果需要xess可以在 uberpost前执行)
|
||||||
sharpMaterial.SetInt("_BlitMipLevel", sharpMipLevel);
|
sharpMaterial.SetInt("_BlitMipLevel", sharpMipLevel);
|
||||||
sharpMaterial.SetFloat("_Sharpness", sharpness);
|
sharpMaterial.SetFloat("_Sharpness", sharpness);
|
||||||
sharpMaterial.SetTexture("_InputTexture", tempRT);
|
sharpMaterial.SetTexture("_InputTexture", tempRT);
|
||||||
|
|||||||
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 4ec9204b3ddeec44499400fca06ed2c0
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
Loading…
x
Reference in New Issue
Block a user