scripts
This commit is contained in:
@@ -0,0 +1,758 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace UnityStandardAssets.CinematicEffects
|
||||
{
|
||||
// Token: 0x02000080 RID: 128
|
||||
[ExecuteInEditMode]
|
||||
[RequireComponent(typeof(Camera))]
|
||||
[AddComponentMenu("Image Effects/Rendering/Screen Space Reflection")]
|
||||
[ImageEffectAllowedInSceneView]
|
||||
public class ScreenSpaceReflection : MonoBehaviour
|
||||
{
|
||||
// Token: 0x17000059 RID: 89
|
||||
// (get) Token: 0x06000185 RID: 389 RVA: 0x000108B7 File Offset: 0x0000ECB7
|
||||
public Shader shader
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this.m_Shader == null)
|
||||
{
|
||||
this.m_Shader = Shader.Find("Hidden/ScreenSpaceReflection");
|
||||
}
|
||||
return this.m_Shader;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x1700005A RID: 90
|
||||
// (get) Token: 0x06000186 RID: 390 RVA: 0x000108E0 File Offset: 0x0000ECE0
|
||||
public Material material
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this.m_Material == null)
|
||||
{
|
||||
this.m_Material = ImageEffectHelper.CheckShaderAndCreateMaterial(this.shader);
|
||||
}
|
||||
return this.m_Material;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06000187 RID: 391 RVA: 0x0001090A File Offset: 0x0000ED0A
|
||||
private void OnEnable()
|
||||
{
|
||||
if (!ImageEffectHelper.IsSupported(this.shader, false, true, this))
|
||||
{
|
||||
base.enabled = false;
|
||||
return;
|
||||
}
|
||||
base.GetComponent<Camera>().depthTextureMode |= DepthTextureMode.Depth;
|
||||
}
|
||||
|
||||
// Token: 0x06000188 RID: 392 RVA: 0x0001093C File Offset: 0x0000ED3C
|
||||
private void OnDisable()
|
||||
{
|
||||
if (this.m_Material)
|
||||
{
|
||||
global::UnityEngine.Object.DestroyImmediate(this.m_Material);
|
||||
}
|
||||
if (this.m_PreviousDepthBuffer)
|
||||
{
|
||||
global::UnityEngine.Object.DestroyImmediate(this.m_PreviousDepthBuffer);
|
||||
}
|
||||
if (this.m_PreviousHitBuffer)
|
||||
{
|
||||
global::UnityEngine.Object.DestroyImmediate(this.m_PreviousHitBuffer);
|
||||
}
|
||||
if (this.m_PreviousReflectionBuffer)
|
||||
{
|
||||
global::UnityEngine.Object.DestroyImmediate(this.m_PreviousReflectionBuffer);
|
||||
}
|
||||
this.m_Material = null;
|
||||
this.m_PreviousDepthBuffer = null;
|
||||
this.m_PreviousHitBuffer = null;
|
||||
this.m_PreviousReflectionBuffer = null;
|
||||
}
|
||||
|
||||
// Token: 0x06000189 RID: 393 RVA: 0x000109D4 File Offset: 0x0000EDD4
|
||||
private void PreparePreviousBuffers(int w, int h)
|
||||
{
|
||||
if (this.m_PreviousDepthBuffer != null && (this.m_PreviousDepthBuffer.width != w || this.m_PreviousDepthBuffer.height != h))
|
||||
{
|
||||
global::UnityEngine.Object.DestroyImmediate(this.m_PreviousDepthBuffer);
|
||||
global::UnityEngine.Object.DestroyImmediate(this.m_PreviousHitBuffer);
|
||||
global::UnityEngine.Object.DestroyImmediate(this.m_PreviousReflectionBuffer);
|
||||
this.m_PreviousDepthBuffer = null;
|
||||
this.m_PreviousHitBuffer = null;
|
||||
this.m_PreviousReflectionBuffer = null;
|
||||
}
|
||||
if (this.m_PreviousDepthBuffer == null)
|
||||
{
|
||||
this.m_PreviousDepthBuffer = new RenderTexture(w, h, 0, RenderTextureFormat.RFloat);
|
||||
this.m_PreviousHitBuffer = new RenderTexture(w, h, 0, RenderTextureFormat.ARGBHalf);
|
||||
this.m_PreviousReflectionBuffer = new RenderTexture(w, h, 0, RenderTextureFormat.ARGBHalf);
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x0600018A RID: 394 RVA: 0x00010A8C File Offset: 0x0000EE8C
|
||||
[ImageEffectOpaque]
|
||||
public void OnRenderImage(RenderTexture source, RenderTexture destination)
|
||||
{
|
||||
if (this.material == null)
|
||||
{
|
||||
Graphics.Blit(source, destination);
|
||||
return;
|
||||
}
|
||||
if (this.m_HasInformationFromPreviousFrame)
|
||||
{
|
||||
this.m_HasInformationFromPreviousFrame = this.m_PreviousDepthBuffer != null && source.width == this.m_PreviousDepthBuffer.width && source.height == this.m_PreviousDepthBuffer.height;
|
||||
}
|
||||
bool flag = this.m_HasInformationFromPreviousFrame && (double)this.settings.advancedSettings.temporalFilterStrength > 0.0;
|
||||
this.m_HasInformationFromPreviousFrame = false;
|
||||
if (Camera.current.actualRenderingPath != RenderingPath.DeferredShading)
|
||||
{
|
||||
Graphics.Blit(source, destination);
|
||||
return;
|
||||
}
|
||||
int num = source.width;
|
||||
int num2 = source.height;
|
||||
RenderTexture temporaryRenderTexture = this.m_RTU.GetTemporaryRenderTexture(num, num2, 0, RenderTextureFormat.ARGB32, FilterMode.Bilinear);
|
||||
temporaryRenderTexture.filterMode = FilterMode.Point;
|
||||
Graphics.Blit(source, temporaryRenderTexture, this.material, 12);
|
||||
this.material.SetTexture("_NormalAndRoughnessTexture", temporaryRenderTexture);
|
||||
float num3 = (float)source.width;
|
||||
float num4 = (float)source.height;
|
||||
Vector2 vector = new Vector2(num3 / (float)num, num4 / (float)num2);
|
||||
int num5 = ((this.settings.advancedSettings.resolution != ScreenSpaceReflection.SSRResolution.FullResolution) ? 2 : 1);
|
||||
num /= num5;
|
||||
num2 /= num5;
|
||||
this.material.SetVector("_SourceToTempUV", new Vector4(vector.x, vector.y, 1f / vector.x, 1f / vector.y));
|
||||
Matrix4x4 projectionMatrix = base.GetComponent<Camera>().projectionMatrix;
|
||||
Vector4 vector2 = new Vector4(-2f / (num3 * projectionMatrix[0]), -2f / (num4 * projectionMatrix[5]), (1f - projectionMatrix[2]) / projectionMatrix[0], (1f + projectionMatrix[6]) / projectionMatrix[5]);
|
||||
float num6 = num3 / (-2f * (float)Math.Tan((double)base.GetComponent<Camera>().fieldOfView / 180.0 * 3.141592653589793 * 0.5));
|
||||
this.material.SetFloat("_PixelsPerMeterAtOneMeter", num6);
|
||||
float num7 = num3 / 2f;
|
||||
float num8 = num4 / 2f;
|
||||
Matrix4x4 matrix4x = default(Matrix4x4);
|
||||
matrix4x.SetRow(0, new Vector4(num7, 0f, 0f, num7));
|
||||
matrix4x.SetRow(1, new Vector4(0f, num8, 0f, num8));
|
||||
matrix4x.SetRow(2, new Vector4(0f, 0f, 1f, 0f));
|
||||
matrix4x.SetRow(3, new Vector4(0f, 0f, 0f, 1f));
|
||||
Matrix4x4 matrix4x2 = matrix4x * projectionMatrix;
|
||||
this.material.SetVector("_ScreenSize", new Vector2(num3, num4));
|
||||
this.material.SetVector("_ReflectionBufferSize", new Vector2((float)num, (float)num2));
|
||||
Vector2 vector3 = new Vector2((float)(1.0 / (double)num3), (float)(1.0 / (double)num4));
|
||||
Matrix4x4 worldToCameraMatrix = base.GetComponent<Camera>().worldToCameraMatrix;
|
||||
Matrix4x4 inverse = base.GetComponent<Camera>().worldToCameraMatrix.inverse;
|
||||
this.material.SetVector("_InvScreenSize", vector3);
|
||||
this.material.SetVector("_ProjInfo", vector2);
|
||||
this.material.SetMatrix("_ProjectToPixelMatrix", matrix4x2);
|
||||
this.material.SetMatrix("_WorldToCameraMatrix", worldToCameraMatrix);
|
||||
this.material.SetMatrix("_CameraToWorldMatrix", inverse);
|
||||
this.material.SetInt("_EnableRefine", (!this.settings.advancedSettings.reduceBanding) ? 0 : 1);
|
||||
this.material.SetInt("_AdditiveReflection", (!this.settings.basicSettings.additiveReflection) ? 0 : 1);
|
||||
this.material.SetInt("_ImproveCorners", (!this.settings.advancedSettings.improveCorners) ? 0 : 1);
|
||||
this.material.SetFloat("_ScreenEdgeFading", this.settings.basicSettings.screenEdgeFading);
|
||||
this.material.SetFloat("_MipBias", this.mipBias);
|
||||
this.material.SetInt("_UseOcclusion", (!this.useOcclusion) ? 0 : 1);
|
||||
this.material.SetInt("_BilateralUpsampling", (!this.settings.advancedSettings.bilateralUpsample) ? 0 : 1);
|
||||
this.material.SetInt("_FallbackToSky", (!this.fallbackToSky) ? 0 : 1);
|
||||
this.material.SetInt("_TreatBackfaceHitAsMiss", (!this.settings.advancedSettings.treatBackfaceHitAsMiss) ? 0 : 1);
|
||||
this.material.SetInt("_AllowBackwardsRays", (!this.settings.advancedSettings.allowBackwardsRays) ? 0 : 1);
|
||||
this.material.SetInt("_TraceEverywhere", (!this.settings.advancedSettings.traceEverywhere) ? 0 : 1);
|
||||
float farClipPlane = base.GetComponent<Camera>().farClipPlane;
|
||||
float nearClipPlane = base.GetComponent<Camera>().nearClipPlane;
|
||||
Vector3 vector4 = ((!float.IsPositiveInfinity(farClipPlane)) ? new Vector3(nearClipPlane * farClipPlane, nearClipPlane - farClipPlane, farClipPlane) : new Vector3(nearClipPlane, -1f, 1f));
|
||||
this.material.SetVector("_CameraClipInfo", vector4);
|
||||
this.material.SetFloat("_MaxRayTraceDistance", this.settings.basicSettings.maxDistance);
|
||||
this.material.SetFloat("_FadeDistance", this.settings.basicSettings.fadeDistance);
|
||||
this.material.SetFloat("_LayerThickness", this.settings.reflectionSettings.widthModifier);
|
||||
RenderTextureFormat renderTextureFormat = ((!this.settings.basicSettings.enableHDR) ? RenderTextureFormat.ARGB32 : RenderTextureFormat.ARGBHalf);
|
||||
RenderTexture[] array = new RenderTexture[5];
|
||||
for (int i = 0; i < 5; i++)
|
||||
{
|
||||
if (this.fullResolutionFiltering)
|
||||
{
|
||||
array[i] = this.m_RTU.GetTemporaryRenderTexture(num, num2, 0, renderTextureFormat, FilterMode.Bilinear);
|
||||
}
|
||||
else
|
||||
{
|
||||
array[i] = this.m_RTU.GetTemporaryRenderTexture(num >> i, num2 >> i, 0, renderTextureFormat, FilterMode.Bilinear);
|
||||
}
|
||||
array[i].filterMode = ((!this.settings.advancedSettings.bilateralUpsample) ? FilterMode.Bilinear : FilterMode.Point);
|
||||
}
|
||||
this.material.SetInt("_EnableSSR", 1);
|
||||
this.material.SetInt("_DebugMode", (int)this.settings.debugSettings.debugMode);
|
||||
this.material.SetInt("_TraceBehindObjects", (!this.settings.advancedSettings.traceBehindObjects) ? 0 : 1);
|
||||
this.material.SetInt("_MaxSteps", this.settings.reflectionSettings.maxSteps);
|
||||
RenderTexture temporaryRenderTexture2 = this.m_RTU.GetTemporaryRenderTexture(num, num2, 0, RenderTextureFormat.ARGBHalf, FilterMode.Bilinear);
|
||||
int num9 = Mathf.Clamp(this.settings.reflectionSettings.rayStepSize, 0, 4);
|
||||
Graphics.Blit(source, temporaryRenderTexture2, this.material, num9);
|
||||
this.material.SetTexture("_HitPointTexture", temporaryRenderTexture2);
|
||||
Graphics.Blit(source, array[0], this.material, 11);
|
||||
this.material.SetTexture("_ReflectionTexture0", array[0]);
|
||||
this.material.SetInt("_FullResolutionFiltering", (!this.fullResolutionFiltering) ? 0 : 1);
|
||||
this.material.SetFloat("_MaxRoughness", 1f - this.settings.reflectionSettings.smoothFallbackThreshold);
|
||||
this.material.SetFloat("_RoughnessFalloffRange", this.settings.reflectionSettings.smoothFallbackDistance);
|
||||
this.material.SetFloat("_SSRMultiplier", this.settings.basicSettings.reflectionMultiplier);
|
||||
RenderTexture[] array2 = new RenderTexture[5];
|
||||
if (this.settings.advancedSettings.bilateralUpsample && this.useEdgeDetector)
|
||||
{
|
||||
array2[0] = this.m_RTU.GetTemporaryRenderTexture(num, num2, 0, RenderTextureFormat.ARGBHalf, FilterMode.Bilinear);
|
||||
Graphics.Blit(source, array2[0], this.material, 9);
|
||||
for (int j = 1; j < 5; j++)
|
||||
{
|
||||
array2[j] = this.m_RTU.GetTemporaryRenderTexture(num >> j, num2 >> j, 0, RenderTextureFormat.ARGBHalf, FilterMode.Bilinear);
|
||||
this.material.SetInt("_LastMip", j - 1);
|
||||
Graphics.Blit(array2[j - 1], array2[j], this.material, 10);
|
||||
}
|
||||
}
|
||||
if (this.settings.advancedSettings.highQualitySharpReflections)
|
||||
{
|
||||
RenderTexture temporaryRenderTexture3 = this.m_RTU.GetTemporaryRenderTexture(array[0].width, array[0].height, 0, array[0].format, FilterMode.Bilinear);
|
||||
temporaryRenderTexture3.filterMode = array[0].filterMode;
|
||||
array[0].filterMode = FilterMode.Bilinear;
|
||||
Graphics.Blit(array[0], temporaryRenderTexture3, this.material, 16);
|
||||
this.m_RTU.ReleaseTemporaryRenderTexture(array[0]);
|
||||
array[0] = temporaryRenderTexture3;
|
||||
this.material.SetTexture("_ReflectionTexture0", array[0]);
|
||||
}
|
||||
for (int k = 1; k < 5; k++)
|
||||
{
|
||||
RenderTexture renderTexture = array[k - 1];
|
||||
RenderTexture renderTexture2;
|
||||
if (this.fullResolutionFiltering)
|
||||
{
|
||||
renderTexture2 = this.m_RTU.GetTemporaryRenderTexture(num, num2, 0, renderTextureFormat, FilterMode.Bilinear);
|
||||
}
|
||||
else
|
||||
{
|
||||
int num10 = k;
|
||||
renderTexture2 = this.m_RTU.GetTemporaryRenderTexture(num >> num10, num2 >> k - 1, 0, renderTextureFormat, FilterMode.Bilinear);
|
||||
}
|
||||
for (int l = 0; l < ((!this.fullResolutionFiltering) ? 1 : (k * k)); l++)
|
||||
{
|
||||
this.material.SetVector("_Axis", new Vector4(1f, 0f, 0f, 0f));
|
||||
this.material.SetFloat("_CurrentMipLevel", (float)k - 1f);
|
||||
Graphics.Blit(renderTexture, renderTexture2, this.material, 6);
|
||||
this.material.SetVector("_Axis", new Vector4(0f, 1f, 0f, 0f));
|
||||
renderTexture = array[k];
|
||||
Graphics.Blit(renderTexture2, renderTexture, this.material, 6);
|
||||
}
|
||||
this.material.SetTexture("_ReflectionTexture" + k, array[k]);
|
||||
this.m_RTU.ReleaseTemporaryRenderTexture(renderTexture2);
|
||||
}
|
||||
if (this.settings.advancedSettings.bilateralUpsample && this.useEdgeDetector)
|
||||
{
|
||||
for (int m = 0; m < 5; m++)
|
||||
{
|
||||
this.material.SetTexture("_EdgeTexture" + m, array2[m]);
|
||||
}
|
||||
}
|
||||
this.material.SetInt("_UseEdgeDetector", (!this.useEdgeDetector) ? 0 : 1);
|
||||
RenderTexture temporaryRenderTexture4 = this.m_RTU.GetTemporaryRenderTexture(source.width, source.height, 0, RenderTextureFormat.RHalf, FilterMode.Bilinear);
|
||||
if (this.computeAverageRayDistance)
|
||||
{
|
||||
Graphics.Blit(source, temporaryRenderTexture4, this.material, 15);
|
||||
}
|
||||
this.material.SetInt("_UseAverageRayDistance", (!this.computeAverageRayDistance) ? 0 : 1);
|
||||
this.material.SetTexture("_AverageRayDistanceBuffer", temporaryRenderTexture4);
|
||||
bool flag2 = this.settings.advancedSettings.resolution == ScreenSpaceReflection.SSRResolution.HalfTraceFullResolve;
|
||||
RenderTexture temporaryRenderTexture5 = this.m_RTU.GetTemporaryRenderTexture((!flag2) ? num : source.width, (!flag2) ? num2 : source.height, 0, renderTextureFormat, FilterMode.Bilinear);
|
||||
this.material.SetFloat("_FresnelFade", this.settings.reflectionSettings.fresnelFade);
|
||||
this.material.SetFloat("_FresnelFadePower", this.settings.reflectionSettings.fresnelFadePower);
|
||||
this.material.SetFloat("_DistanceBlur", this.settings.reflectionSettings.distanceBlur);
|
||||
this.material.SetInt("_HalfResolution", (this.settings.advancedSettings.resolution == ScreenSpaceReflection.SSRResolution.FullResolution) ? 0 : 1);
|
||||
this.material.SetInt("_HighlightSuppression", (!this.settings.advancedSettings.highlightSuppression) ? 0 : 1);
|
||||
Graphics.Blit(array[0], temporaryRenderTexture5, this.material, 7);
|
||||
this.material.SetTexture("_FinalReflectionTexture", temporaryRenderTexture5);
|
||||
RenderTexture temporaryRenderTexture6 = this.m_RTU.GetTemporaryRenderTexture((!flag2) ? num : source.width, (!flag2) ? num2 : source.height, 0, renderTextureFormat, FilterMode.Bilinear);
|
||||
if (flag)
|
||||
{
|
||||
this.material.SetInt("_UseTemporalConfidence", (!this.settings.advancedSettings.useTemporalConfidence) ? 0 : 1);
|
||||
this.material.SetFloat("_TemporalAlpha", this.settings.advancedSettings.temporalFilterStrength);
|
||||
this.material.SetMatrix("_CurrentCameraToPreviousCamera", this.m_PreviousWorldToCameraMatrix * inverse);
|
||||
this.material.SetTexture("_PreviousReflectionTexture", this.m_PreviousReflectionBuffer);
|
||||
this.material.SetTexture("_PreviousCSZBuffer", this.m_PreviousDepthBuffer);
|
||||
Graphics.Blit(source, temporaryRenderTexture6, this.material, 14);
|
||||
this.material.SetTexture("_FinalReflectionTexture", temporaryRenderTexture6);
|
||||
}
|
||||
if ((double)this.settings.advancedSettings.temporalFilterStrength > 0.0)
|
||||
{
|
||||
this.m_PreviousWorldToCameraMatrix = worldToCameraMatrix;
|
||||
this.PreparePreviousBuffers(source.width, source.height);
|
||||
Graphics.Blit(source, this.m_PreviousDepthBuffer, this.material, 13);
|
||||
Graphics.Blit(temporaryRenderTexture2, this.m_PreviousHitBuffer);
|
||||
Graphics.Blit((!flag) ? temporaryRenderTexture5 : temporaryRenderTexture6, this.m_PreviousReflectionBuffer);
|
||||
this.m_HasInformationFromPreviousFrame = true;
|
||||
}
|
||||
Graphics.Blit(source, destination, this.material, 5);
|
||||
this.m_RTU.ReleaseAllTemporaryRenderTextures();
|
||||
}
|
||||
|
||||
// Token: 0x04000322 RID: 802
|
||||
[SerializeField]
|
||||
public ScreenSpaceReflection.SSRSettings settings = ScreenSpaceReflection.SSRSettings.defaultSettings;
|
||||
|
||||
// Token: 0x04000323 RID: 803
|
||||
[Tooltip("Enable to try and bypass expensive bilateral upsampling away from edges. There is a slight performance hit for generating the edge buffers, but a potentially high performance savings from bypassing bilateral upsampling where it is unneeded. Test on your target platforms to see if performance improves.")]
|
||||
private bool useEdgeDetector;
|
||||
|
||||
// Token: 0x04000324 RID: 804
|
||||
[Range(-4f, 4f)]
|
||||
private float mipBias;
|
||||
|
||||
// Token: 0x04000325 RID: 805
|
||||
private bool useOcclusion = true;
|
||||
|
||||
// Token: 0x04000326 RID: 806
|
||||
private bool fullResolutionFiltering;
|
||||
|
||||
// Token: 0x04000327 RID: 807
|
||||
private bool fallbackToSky;
|
||||
|
||||
// Token: 0x04000328 RID: 808
|
||||
private bool computeAverageRayDistance;
|
||||
|
||||
// Token: 0x04000329 RID: 809
|
||||
private bool m_HasInformationFromPreviousFrame;
|
||||
|
||||
// Token: 0x0400032A RID: 810
|
||||
private Matrix4x4 m_PreviousWorldToCameraMatrix;
|
||||
|
||||
// Token: 0x0400032B RID: 811
|
||||
private RenderTexture m_PreviousDepthBuffer;
|
||||
|
||||
// Token: 0x0400032C RID: 812
|
||||
private RenderTexture m_PreviousHitBuffer;
|
||||
|
||||
// Token: 0x0400032D RID: 813
|
||||
private RenderTexture m_PreviousReflectionBuffer;
|
||||
|
||||
// Token: 0x0400032E RID: 814
|
||||
[NonSerialized]
|
||||
private RenderTextureUtility m_RTU = new RenderTextureUtility();
|
||||
|
||||
// Token: 0x0400032F RID: 815
|
||||
[SerializeField]
|
||||
private Shader m_Shader;
|
||||
|
||||
// Token: 0x04000330 RID: 816
|
||||
private Material m_Material;
|
||||
|
||||
// Token: 0x02000081 RID: 129
|
||||
public enum SSRDebugMode
|
||||
{
|
||||
// Token: 0x04000332 RID: 818
|
||||
None,
|
||||
// Token: 0x04000333 RID: 819
|
||||
IncomingRadiance,
|
||||
// Token: 0x04000334 RID: 820
|
||||
SSRResult,
|
||||
// Token: 0x04000335 RID: 821
|
||||
FinalGlossyTerm,
|
||||
// Token: 0x04000336 RID: 822
|
||||
SSRMask,
|
||||
// Token: 0x04000337 RID: 823
|
||||
Roughness,
|
||||
// Token: 0x04000338 RID: 824
|
||||
BaseColor,
|
||||
// Token: 0x04000339 RID: 825
|
||||
SpecColor,
|
||||
// Token: 0x0400033A RID: 826
|
||||
Reflectivity,
|
||||
// Token: 0x0400033B RID: 827
|
||||
ReflectionProbeOnly,
|
||||
// Token: 0x0400033C RID: 828
|
||||
ReflectionProbeMinusSSR,
|
||||
// Token: 0x0400033D RID: 829
|
||||
SSRMinusReflectionProbe,
|
||||
// Token: 0x0400033E RID: 830
|
||||
NoGlossy,
|
||||
// Token: 0x0400033F RID: 831
|
||||
NegativeNoGlossy,
|
||||
// Token: 0x04000340 RID: 832
|
||||
MipLevel
|
||||
}
|
||||
|
||||
// Token: 0x02000082 RID: 130
|
||||
public enum SSRResolution
|
||||
{
|
||||
// Token: 0x04000342 RID: 834
|
||||
FullResolution,
|
||||
// Token: 0x04000343 RID: 835
|
||||
HalfTraceFullResolve,
|
||||
// Token: 0x04000344 RID: 836
|
||||
HalfResolution
|
||||
}
|
||||
|
||||
// Token: 0x02000083 RID: 131
|
||||
[Serializable]
|
||||
public struct SSRSettings
|
||||
{
|
||||
// Token: 0x1700005B RID: 91
|
||||
// (get) Token: 0x0600018B RID: 395 RVA: 0x0001190D File Offset: 0x0000FD0D
|
||||
public static ScreenSpaceReflection.SSRSettings performanceSettings
|
||||
{
|
||||
get
|
||||
{
|
||||
return ScreenSpaceReflection.SSRSettings.s_Performance;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x1700005C RID: 92
|
||||
// (get) Token: 0x0600018C RID: 396 RVA: 0x00011914 File Offset: 0x0000FD14
|
||||
public static ScreenSpaceReflection.SSRSettings defaultSettings
|
||||
{
|
||||
get
|
||||
{
|
||||
return ScreenSpaceReflection.SSRSettings.s_Default;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x1700005D RID: 93
|
||||
// (get) Token: 0x0600018D RID: 397 RVA: 0x0001191B File Offset: 0x0000FD1B
|
||||
public static ScreenSpaceReflection.SSRSettings highQualitySettings
|
||||
{
|
||||
get
|
||||
{
|
||||
return ScreenSpaceReflection.SSRSettings.s_HighQuality;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x04000345 RID: 837
|
||||
[ScreenSpaceReflection.SSRSettings.LayoutAttribute]
|
||||
public ScreenSpaceReflection.BasicSettings basicSettings;
|
||||
|
||||
// Token: 0x04000346 RID: 838
|
||||
[ScreenSpaceReflection.SSRSettings.LayoutAttribute]
|
||||
public ScreenSpaceReflection.ReflectionSettings reflectionSettings;
|
||||
|
||||
// Token: 0x04000347 RID: 839
|
||||
[ScreenSpaceReflection.SSRSettings.LayoutAttribute]
|
||||
public ScreenSpaceReflection.AdvancedSettings advancedSettings;
|
||||
|
||||
// Token: 0x04000348 RID: 840
|
||||
[ScreenSpaceReflection.SSRSettings.LayoutAttribute]
|
||||
public ScreenSpaceReflection.DebugSettings debugSettings;
|
||||
|
||||
// Token: 0x04000349 RID: 841
|
||||
private static readonly ScreenSpaceReflection.SSRSettings s_Performance = new ScreenSpaceReflection.SSRSettings
|
||||
{
|
||||
basicSettings = new ScreenSpaceReflection.BasicSettings
|
||||
{
|
||||
screenEdgeFading = 0f,
|
||||
maxDistance = 10f,
|
||||
fadeDistance = 10f,
|
||||
reflectionMultiplier = 1f,
|
||||
enableHDR = false,
|
||||
additiveReflection = false
|
||||
},
|
||||
reflectionSettings = new ScreenSpaceReflection.ReflectionSettings
|
||||
{
|
||||
maxSteps = 64,
|
||||
rayStepSize = 4,
|
||||
widthModifier = 0.5f,
|
||||
smoothFallbackThreshold = 0.4f,
|
||||
distanceBlur = 1f,
|
||||
fresnelFade = 0.2f,
|
||||
fresnelFadePower = 2f,
|
||||
smoothFallbackDistance = 0.05f
|
||||
},
|
||||
advancedSettings = new ScreenSpaceReflection.AdvancedSettings
|
||||
{
|
||||
useTemporalConfidence = false,
|
||||
temporalFilterStrength = 0f,
|
||||
treatBackfaceHitAsMiss = false,
|
||||
allowBackwardsRays = false,
|
||||
traceBehindObjects = true,
|
||||
highQualitySharpReflections = false,
|
||||
traceEverywhere = false,
|
||||
resolution = ScreenSpaceReflection.SSRResolution.HalfResolution,
|
||||
bilateralUpsample = false,
|
||||
improveCorners = false,
|
||||
reduceBanding = false,
|
||||
highlightSuppression = false
|
||||
},
|
||||
debugSettings = new ScreenSpaceReflection.DebugSettings
|
||||
{
|
||||
debugMode = ScreenSpaceReflection.SSRDebugMode.None
|
||||
}
|
||||
};
|
||||
|
||||
// Token: 0x0400034A RID: 842
|
||||
private static readonly ScreenSpaceReflection.SSRSettings s_Default = new ScreenSpaceReflection.SSRSettings
|
||||
{
|
||||
basicSettings = new ScreenSpaceReflection.BasicSettings
|
||||
{
|
||||
screenEdgeFading = 0.03f,
|
||||
maxDistance = 100f,
|
||||
fadeDistance = 100f,
|
||||
reflectionMultiplier = 1f,
|
||||
enableHDR = true,
|
||||
additiveReflection = false
|
||||
},
|
||||
reflectionSettings = new ScreenSpaceReflection.ReflectionSettings
|
||||
{
|
||||
maxSteps = 128,
|
||||
rayStepSize = 3,
|
||||
widthModifier = 0.5f,
|
||||
smoothFallbackThreshold = 0.2f,
|
||||
distanceBlur = 1f,
|
||||
fresnelFade = 0.2f,
|
||||
fresnelFadePower = 2f,
|
||||
smoothFallbackDistance = 0.05f
|
||||
},
|
||||
advancedSettings = new ScreenSpaceReflection.AdvancedSettings
|
||||
{
|
||||
useTemporalConfidence = true,
|
||||
temporalFilterStrength = 0.7f,
|
||||
treatBackfaceHitAsMiss = false,
|
||||
allowBackwardsRays = false,
|
||||
traceBehindObjects = true,
|
||||
highQualitySharpReflections = true,
|
||||
traceEverywhere = true,
|
||||
resolution = ScreenSpaceReflection.SSRResolution.HalfTraceFullResolve,
|
||||
bilateralUpsample = true,
|
||||
improveCorners = true,
|
||||
reduceBanding = true,
|
||||
highlightSuppression = false
|
||||
},
|
||||
debugSettings = new ScreenSpaceReflection.DebugSettings
|
||||
{
|
||||
debugMode = ScreenSpaceReflection.SSRDebugMode.None
|
||||
}
|
||||
};
|
||||
|
||||
// Token: 0x0400034B RID: 843
|
||||
private static readonly ScreenSpaceReflection.SSRSettings s_HighQuality = new ScreenSpaceReflection.SSRSettings
|
||||
{
|
||||
basicSettings = new ScreenSpaceReflection.BasicSettings
|
||||
{
|
||||
screenEdgeFading = 0.03f,
|
||||
maxDistance = 100f,
|
||||
fadeDistance = 100f,
|
||||
reflectionMultiplier = 1f,
|
||||
enableHDR = true,
|
||||
additiveReflection = false
|
||||
},
|
||||
reflectionSettings = new ScreenSpaceReflection.ReflectionSettings
|
||||
{
|
||||
maxSteps = 512,
|
||||
rayStepSize = 1,
|
||||
widthModifier = 0.5f,
|
||||
smoothFallbackThreshold = 0.2f,
|
||||
distanceBlur = 1f,
|
||||
fresnelFade = 0.2f,
|
||||
fresnelFadePower = 2f,
|
||||
smoothFallbackDistance = 0.05f
|
||||
},
|
||||
advancedSettings = new ScreenSpaceReflection.AdvancedSettings
|
||||
{
|
||||
useTemporalConfidence = true,
|
||||
temporalFilterStrength = 0.7f,
|
||||
treatBackfaceHitAsMiss = false,
|
||||
allowBackwardsRays = false,
|
||||
traceBehindObjects = true,
|
||||
highQualitySharpReflections = true,
|
||||
traceEverywhere = true,
|
||||
resolution = ScreenSpaceReflection.SSRResolution.HalfTraceFullResolve,
|
||||
bilateralUpsample = true,
|
||||
improveCorners = true,
|
||||
reduceBanding = true,
|
||||
highlightSuppression = false
|
||||
},
|
||||
debugSettings = new ScreenSpaceReflection.DebugSettings
|
||||
{
|
||||
debugMode = ScreenSpaceReflection.SSRDebugMode.None
|
||||
}
|
||||
};
|
||||
|
||||
// Token: 0x02000084 RID: 132
|
||||
[AttributeUsage(AttributeTargets.Field)]
|
||||
public class LayoutAttribute : PropertyAttribute
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x02000085 RID: 133
|
||||
[Serializable]
|
||||
public struct BasicSettings
|
||||
{
|
||||
// Token: 0x0400034C RID: 844
|
||||
[Tooltip("Nonphysical multiplier for the SSR reflections. 1.0 is physically based.")]
|
||||
[Range(0f, 2f)]
|
||||
public float reflectionMultiplier;
|
||||
|
||||
// Token: 0x0400034D RID: 845
|
||||
[Tooltip("Maximum reflection distance in world units.")]
|
||||
[Range(0.5f, 1000f)]
|
||||
public float maxDistance;
|
||||
|
||||
// Token: 0x0400034E RID: 846
|
||||
[Tooltip("How far away from the maxDistance to begin fading SSR.")]
|
||||
[Range(0f, 1000f)]
|
||||
public float fadeDistance;
|
||||
|
||||
// Token: 0x0400034F RID: 847
|
||||
[Tooltip("Higher = fade out SSRR near the edge of the screen so that reflections don't pop under camera motion.")]
|
||||
[Range(0f, 1f)]
|
||||
public float screenEdgeFading;
|
||||
|
||||
// Token: 0x04000350 RID: 848
|
||||
[Tooltip("Enable for better reflections of very bright objects at a performance cost")]
|
||||
public bool enableHDR;
|
||||
|
||||
// Token: 0x04000351 RID: 849
|
||||
[Tooltip("Add reflections on top of existing ones. Not physically correct.")]
|
||||
public bool additiveReflection;
|
||||
}
|
||||
|
||||
// Token: 0x02000086 RID: 134
|
||||
[Serializable]
|
||||
public struct ReflectionSettings
|
||||
{
|
||||
// Token: 0x04000352 RID: 850
|
||||
[Tooltip("Max raytracing length.")]
|
||||
[Range(16f, 2048f)]
|
||||
public int maxSteps;
|
||||
|
||||
// Token: 0x04000353 RID: 851
|
||||
[Tooltip("Log base 2 of ray tracing coarse step size. Higher traces farther, lower gives better quality silhouettes.")]
|
||||
[Range(0f, 4f)]
|
||||
public int rayStepSize;
|
||||
|
||||
// Token: 0x04000354 RID: 852
|
||||
[Tooltip("Typical thickness of columns, walls, furniture, and other objects that reflection rays might pass behind.")]
|
||||
[Range(0.01f, 10f)]
|
||||
public float widthModifier;
|
||||
|
||||
// Token: 0x04000355 RID: 853
|
||||
[Tooltip("Increase if reflections flicker on very rough surfaces.")]
|
||||
[Range(0f, 1f)]
|
||||
public float smoothFallbackThreshold;
|
||||
|
||||
// Token: 0x04000356 RID: 854
|
||||
[Tooltip("Start falling back to non-SSR value solution at smoothFallbackThreshold - smoothFallbackDistance, with full fallback occuring at smoothFallbackThreshold.")]
|
||||
[Range(0f, 0.2f)]
|
||||
public float smoothFallbackDistance;
|
||||
|
||||
// Token: 0x04000357 RID: 855
|
||||
[Tooltip("Amplify Fresnel fade out. Increase if floor reflections look good close to the surface and bad farther 'under' the floor.")]
|
||||
[Range(0f, 1f)]
|
||||
public float fresnelFade;
|
||||
|
||||
// Token: 0x04000358 RID: 856
|
||||
[Tooltip("Higher values correspond to a faster Fresnel fade as the reflection changes from the grazing angle.")]
|
||||
[Range(0.1f, 10f)]
|
||||
public float fresnelFadePower;
|
||||
|
||||
// Token: 0x04000359 RID: 857
|
||||
[Tooltip("Controls how blurry reflections get as objects are further from the camera. 0 is constant blur no matter trace distance or distance from camera. 1 fully takes into account both factors.")]
|
||||
[Range(0f, 1f)]
|
||||
public float distanceBlur;
|
||||
}
|
||||
|
||||
// Token: 0x02000087 RID: 135
|
||||
[Serializable]
|
||||
public struct AdvancedSettings
|
||||
{
|
||||
// Token: 0x0400035A RID: 858
|
||||
[Range(0f, 0.99f)]
|
||||
[Tooltip("Increase to decrease flicker in scenes; decrease to prevent ghosting (especially in dynamic scenes). 0 gives maximum performance.")]
|
||||
public float temporalFilterStrength;
|
||||
|
||||
// Token: 0x0400035B RID: 859
|
||||
[Tooltip("Enable to limit ghosting from applying the temporal filter.")]
|
||||
public bool useTemporalConfidence;
|
||||
|
||||
// Token: 0x0400035C RID: 860
|
||||
[Tooltip("Enable to allow rays to pass behind objects. This can lead to more screen-space reflections, but the reflections are more likely to be wrong.")]
|
||||
public bool traceBehindObjects;
|
||||
|
||||
// Token: 0x0400035D RID: 861
|
||||
[Tooltip("Enable to increase quality of the sharpest reflections (through filtering), at a performance cost.")]
|
||||
public bool highQualitySharpReflections;
|
||||
|
||||
// Token: 0x0400035E RID: 862
|
||||
[Tooltip("Improves quality in scenes with varying smoothness, at a potential performance cost.")]
|
||||
public bool traceEverywhere;
|
||||
|
||||
// Token: 0x0400035F RID: 863
|
||||
[Tooltip("Enable to force more surfaces to use reflection probes if you see streaks on the sides of objects or bad reflections of their backs.")]
|
||||
public bool treatBackfaceHitAsMiss;
|
||||
|
||||
// Token: 0x04000360 RID: 864
|
||||
[Tooltip("Enable for a performance gain in scenes where most glossy objects are horizontal, like floors, water, and tables. Leave on for scenes with glossy vertical objects.")]
|
||||
public bool allowBackwardsRays;
|
||||
|
||||
// Token: 0x04000361 RID: 865
|
||||
[Tooltip("Improve visual fidelity of reflections on rough surfaces near corners in the scene, at the cost of a small amount of performance.")]
|
||||
public bool improveCorners;
|
||||
|
||||
// Token: 0x04000362 RID: 866
|
||||
[Tooltip("Half resolution SSRR is much faster, but less accurate. Quality can be reclaimed for some performance by doing the resolve at full resolution.")]
|
||||
public ScreenSpaceReflection.SSRResolution resolution;
|
||||
|
||||
// Token: 0x04000363 RID: 867
|
||||
[Tooltip("Drastically improves reflection reconstruction quality at the expense of some performance.")]
|
||||
public bool bilateralUpsample;
|
||||
|
||||
// Token: 0x04000364 RID: 868
|
||||
[Tooltip("Improve visual fidelity of mirror reflections at the cost of a small amount of performance.")]
|
||||
public bool reduceBanding;
|
||||
|
||||
// Token: 0x04000365 RID: 869
|
||||
[Tooltip("Enable to limit the effect a few bright pixels can have on rougher surfaces")]
|
||||
public bool highlightSuppression;
|
||||
}
|
||||
|
||||
// Token: 0x02000088 RID: 136
|
||||
[Serializable]
|
||||
public struct DebugSettings
|
||||
{
|
||||
// Token: 0x04000366 RID: 870
|
||||
[Tooltip("Various Debug Visualizations")]
|
||||
public ScreenSpaceReflection.SSRDebugMode debugMode;
|
||||
}
|
||||
|
||||
// Token: 0x02000089 RID: 137
|
||||
private enum PassIndex
|
||||
{
|
||||
// Token: 0x04000368 RID: 872
|
||||
RayTraceStep1,
|
||||
// Token: 0x04000369 RID: 873
|
||||
RayTraceStep2,
|
||||
// Token: 0x0400036A RID: 874
|
||||
RayTraceStep4,
|
||||
// Token: 0x0400036B RID: 875
|
||||
RayTraceStep8,
|
||||
// Token: 0x0400036C RID: 876
|
||||
RayTraceStep16,
|
||||
// Token: 0x0400036D RID: 877
|
||||
CompositeFinal,
|
||||
// Token: 0x0400036E RID: 878
|
||||
Blur,
|
||||
// Token: 0x0400036F RID: 879
|
||||
CompositeSSR,
|
||||
// Token: 0x04000370 RID: 880
|
||||
Blit,
|
||||
// Token: 0x04000371 RID: 881
|
||||
EdgeGeneration,
|
||||
// Token: 0x04000372 RID: 882
|
||||
MinMipGeneration,
|
||||
// Token: 0x04000373 RID: 883
|
||||
HitPointToReflections,
|
||||
// Token: 0x04000374 RID: 884
|
||||
BilateralKeyPack,
|
||||
// Token: 0x04000375 RID: 885
|
||||
BlitDepthAsCSZ,
|
||||
// Token: 0x04000376 RID: 886
|
||||
TemporalFilter,
|
||||
// Token: 0x04000377 RID: 887
|
||||
AverageRayDistanceGeneration,
|
||||
// Token: 0x04000378 RID: 888
|
||||
PoissonBlur
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user