xess add antighost

This commit is contained in:
StarBeats 2024-12-26 15:09:43 +08:00
parent f8df0f0005
commit cc3a42a7a1
30 changed files with 135 additions and 134 deletions

View File

@ -25,7 +25,7 @@ public class Test : MonoBehaviour
private void Update() private void Update()
{ {
transform?.Rotate(new Vector3(0, 0.5f, 0)); transform?.Rotate(new Vector3(0, 0.1f, 0));
} }
private void OnGUI() private void OnGUI()

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: Xnwd4ymoVn5T21JNkRdz/wbaTps3w3Z40N+XT4ognLZgPi/O+54tq4M= guid: a8f562490b8d41b47a6b21e2f514d782
MonoImporter: MonoImporter:
externalObjects: {} externalObjects: {}
serializedVersion: 2 serializedVersion: 2

View File

@ -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.75 m_RenderScale: 0.3335938
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: 12 superResolution: 16
vrsRate: 0 vrsRate: 0

View File

@ -102,7 +102,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: f5759a0bb27e83b4ab2925ac09c35710, type: 3} m_Script: {fileID: 11500000, guid: f5759a0bb27e83b4ab2925ac09c35710, type: 3}
m_Name: DLSS m_Name: DLSS
m_EditorClassIdentifier: m_EditorClassIdentifier:
m_Active: 1 m_Active: 0
quality: 1 quality: 1
useOptimalSetting: 1 useOptimalSetting: 1
sharpness: 0.126 sharpness: 0.126
@ -318,25 +318,26 @@ 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: 0 m_Active: 1
xess1ConfigParam: xess1ConfigParam:
OutputWidth: 0 OutputWidth: 2560
OutputHeight: 0 OutputHeight: 1440
Quality: 0 Quality: 103
UseHiResMotionVectors: 0 UseHiResMotionVectors: 0
UseJitteredMotionVectors: 0 UseJitteredMotionVectors: 0
UseMotionVectorsInNDC: 0 UseMotionVectorsInNDC: 1
UseExposureTexture: 0 UseExposureTexture: 0
UseResponsiveMask: 0 UseResponsiveMask: 0
UseAutoExposure: 0 UseAutoExposure: 0
EnableProfiling: 0 EnableProfiling: 0
InvertedDepth: 0 InvertedDepth: 1
VelocityScaleX: 0 VelocityScaleX: 1
VelocityScaleY: 0 VelocityScaleY: 1
JitterScaleX: 0 JitterScaleX: 1
JitterScaleY: 0 JitterScaleY: 1
ExposureScale: 0 ExposureScale: 1
MipMapBias: 0 MipMapBias: -2.13
antiGhosting: 0.385
--- !u!114 &6334271670068977784 --- !u!114 &6334271670068977784
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0

View File

@ -1,27 +0,0 @@
fileFormatVersion: 2
guid: aa3cdfd7567ede4499cc98b29a53314c
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
Any:
second:
enabled: 1
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: a5171d7af8fd96541abc84cf8775397e
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -49,10 +49,10 @@ namespace X.Rendering.Feature
public float ExposureScale; public float ExposureScale;
[Range(-5,5)]
public float MipMapBias;
}; };
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
unsafe struct Xess1ExecParam unsafe struct Xess1ExecParam
{ {
@ -73,6 +73,11 @@ namespace X.Rendering.Feature
[SerializeField] [SerializeField]
Xess1ConfigParam xess1ConfigParam; Xess1ConfigParam xess1ConfigParam;
[Range(-5, 5)]
public float MipMapBias;
[Range(0, 1)]
public float antiGhosting;
private bool needTurnOnXess = false; private bool needTurnOnXess = false;
private bool needTurnOffXess = false; private bool needTurnOffXess = false;
@ -153,8 +158,9 @@ namespace X.Rendering.Feature
} }
SuperResolutionParamSets.Instance.Set<bool>("NeedJitter", true); SuperResolutionParamSets.Instance.Set<bool>("NeedJitter", true);
SuperResolutionParamSets.Instance.Set<float>("MipmapBias", xess1ConfigParam.MipMapBias); SuperResolutionParamSets.Instance.Set<float>("MipmapBias", MipMapBias);
SuperResolutionParamSets.Instance.Set<float>("JitterScale", xess1ConfigParam.JitterScaleX); SuperResolutionParamSets.Instance.Set<float>("JitterScale", xess1ConfigParam.JitterScaleX);
SuperResolutionParamSets.Instance.Set<float>("AntiGhosting", antiGhosting);
var jitter = TemporalAA.CurrentJitter; var jitter = TemporalAA.CurrentJitter;

View File

@ -341,7 +341,17 @@ namespace UnityEngine.Rendering.Universal
// instability in Unity's shadow maps, so we avoid index 0. // instability in Unity's shadow maps, so we avoid index 0.
float jitterX = HaltonSequence.Get((frameIndex & 1023) + 1, 2) - 0.5f; float jitterX = HaltonSequence.Get((frameIndex & 1023) + 1, 2) - 0.5f;
float jitterY = HaltonSequence.Get((frameIndex & 1023) + 1, 3) - 0.5f; float jitterY = HaltonSequence.Get((frameIndex & 1023) + 1, 3) - 0.5f;
float antiGhosting = 0;
SuperResolutionParamSets.Instance.Get<float>("AntiGhosting", ref antiGhosting);
if (antiGhosting > 0.0f)
{
jitterX += Random.Range(-0.1f * antiGhosting, 0.1f * antiGhosting);
jitterY += Random.Range(-0.1f * antiGhosting, 0.1f * antiGhosting);
jitterX = Mathf.Clamp(jitterX, -0.5f, 0.5f);
jitterY = Mathf.Clamp(jitterY, -0.5f, 0.5f);
}
return new Vector2(jitterX, jitterY); return new Vector2(jitterX, jitterY);
} }

View File

@ -15,10 +15,10 @@ EditorUserSettings:
value: 5b00515154055e035459547042705a44154f1e2c2e2e7f677e7d4567e1b9376d value: 5b00515154055e035459547042705a44154f1e2c2e2e7f677e7d4567e1b9376d
flags: 0 flags: 0
RecentlyUsedSceneGuid-3: RecentlyUsedSceneGuid-3:
value: 57050d5004060d590f56087046700f4445164c7e7a7824312e7c4e6bb0e1376d value: 5a57555407545f0b5e0f5f764277594914161e2b787977692b714e64e4b2363b
flags: 0 flags: 0
RecentlyUsedSceneGuid-4: RecentlyUsedSceneGuid-4:
value: 5a57555407545f0b5e0f5f764277594914161e2b787977692b714e64e4b2363b value: 57050d5004060d590f56087046700f4445164c7e7a7824312e7c4e6bb0e1376d
flags: 0 flags: 0
vcSharedLogLevel: vcSharedLogLevel:
value: 0d5e400f0650 value: 0d5e400f0650