diff --git a/com.unity.postprocessing/PostProcessing/Editor/Decorators/TrackballDecorator.cs b/com.unity.postprocessing/PostProcessing/Editor/Decorators/TrackballDecorator.cs index c60d58e93d9..beb49d64642 100644 --- a/com.unity.postprocessing/PostProcessing/Editor/Decorators/TrackballDecorator.cs +++ b/com.unity.postprocessing/PostProcessing/Editor/Decorators/TrackballDecorator.cs @@ -72,11 +72,11 @@ void DrawWheel(ref Vector4 value, bool overrideState, TrackballAttribute attr) s_Material = new Material(Shader.Find("Hidden/PostProcessing/Editor/Trackball")) { hideFlags = HideFlags.HideAndDontSave }; // Wheel texture - #if UNITY_2018_1_OR_NEWER +#if UNITY_2018_1_OR_NEWER const RenderTextureReadWrite kReadWrite = RenderTextureReadWrite.sRGB; - #else +#else const RenderTextureReadWrite kReadWrite = RenderTextureReadWrite.Linear; - #endif +#endif var oldRT = RenderTexture.active; var rt = RenderTexture.GetTemporary((int)(size * scale), (int)(size * scale), 0, RenderTextureFormat.ARGB32, kReadWrite); @@ -118,11 +118,14 @@ void DrawWheel(ref Vector4 value, bool overrideState, TrackballAttribute attr) switch (attr.mode) { - case TrackballAttribute.Mode.Lift: displayValue = ColorUtilities.ColorToLift(value); + case TrackballAttribute.Mode.Lift: + displayValue = ColorUtilities.ColorToLift(value); break; - case TrackballAttribute.Mode.Gamma: displayValue = ColorUtilities.ColorToInverseGamma(value); + case TrackballAttribute.Mode.Gamma: + displayValue = ColorUtilities.ColorToInverseGamma(value); break; - case TrackballAttribute.Mode.Gain: displayValue = ColorUtilities.ColorToGain(value); + case TrackballAttribute.Mode.Gain: + displayValue = ColorUtilities.ColorToGain(value); break; } diff --git a/com.unity.postprocessing/PostProcessing/Editor/Effects/ColorGradingEditor.cs b/com.unity.postprocessing/PostProcessing/Editor/Effects/ColorGradingEditor.cs index 7b49b7dd378..9215c938dea 100644 --- a/com.unity.postprocessing/PostProcessing/Editor/Effects/ColorGradingEditor.cs +++ b/com.unity.postprocessing/PostProcessing/Editor/Effects/ColorGradingEditor.cs @@ -579,21 +579,29 @@ void DoCurvesGUI(bool hdr) { switch (curveEditingId) { - case 0: m_RawMasterCurve.animationCurveValue = AnimationCurve.Linear(0f, 0f, 1f, 1f); + case 0: + m_RawMasterCurve.animationCurveValue = AnimationCurve.Linear(0f, 0f, 1f, 1f); break; - case 1: m_RawRedCurve.animationCurveValue = AnimationCurve.Linear(0f, 0f, 1f, 1f); + case 1: + m_RawRedCurve.animationCurveValue = AnimationCurve.Linear(0f, 0f, 1f, 1f); break; - case 2: m_RawGreenCurve.animationCurveValue = AnimationCurve.Linear(0f, 0f, 1f, 1f); + case 2: + m_RawGreenCurve.animationCurveValue = AnimationCurve.Linear(0f, 0f, 1f, 1f); break; - case 3: m_RawBlueCurve.animationCurveValue = AnimationCurve.Linear(0f, 0f, 1f, 1f); + case 3: + m_RawBlueCurve.animationCurveValue = AnimationCurve.Linear(0f, 0f, 1f, 1f); break; - case 4: m_RawHueVsHueCurve.animationCurveValue = new AnimationCurve(); + case 4: + m_RawHueVsHueCurve.animationCurveValue = new AnimationCurve(); break; - case 5: m_RawHueVsSatCurve.animationCurveValue = new AnimationCurve(); + case 5: + m_RawHueVsSatCurve.animationCurveValue = new AnimationCurve(); break; - case 6: m_RawSatVsSatCurve.animationCurveValue = new AnimationCurve(); + case 6: + m_RawSatVsSatCurve.animationCurveValue = new AnimationCurve(); break; - case 7: m_RawLumVsSatCurve.animationCurveValue = new AnimationCurve(); + case 7: + m_RawLumVsSatCurve.animationCurveValue = new AnimationCurve(); break; } } @@ -694,11 +702,11 @@ void DrawBackgroundTexture(Rect rect, int pass) float scale = EditorGUIUtility.pixelsPerPoint; - #if UNITY_2018_1_OR_NEWER +#if UNITY_2018_1_OR_NEWER const RenderTextureReadWrite kReadWrite = RenderTextureReadWrite.sRGB; - #else +#else const RenderTextureReadWrite kReadWrite = RenderTextureReadWrite.Linear; - #endif +#endif var oldRt = RenderTexture.active; var rt = RenderTexture.GetTemporary(Mathf.CeilToInt(rect.width * scale), Mathf.CeilToInt(rect.height * scale), 0, RenderTextureFormat.ARGB32, kReadWrite); diff --git a/com.unity.postprocessing/PostProcessing/Editor/PostProcessLayerEditor.cs b/com.unity.postprocessing/PostProcessing/Editor/PostProcessLayerEditor.cs index ba4b885b8f1..db2158c79e4 100644 --- a/com.unity.postprocessing/PostProcessing/Editor/PostProcessLayerEditor.cs +++ b/com.unity.postprocessing/PostProcessing/Editor/PostProcessLayerEditor.cs @@ -38,9 +38,9 @@ sealed class PostProcessLayerEditor : BaseEditor Dictionary m_CustomLists; - #if UNITY_2017_3_OR_NEWER +#if UNITY_2017_3_OR_NEWER Camera m_TargetCameraComponent; - #endif +#endif static GUIContent[] s_AntialiasingMethodNames = { @@ -80,9 +80,9 @@ void OnEnable() m_ShowToolkit = serializedObject.FindProperty("m_ShowToolkit"); m_ShowCustomSorter = serializedObject.FindProperty("m_ShowCustomSorter"); - #if UNITY_2017_3_OR_NEWER +#if UNITY_2017_3_OR_NEWER m_TargetCameraComponent = m_Target.GetComponent(); - #endif +#endif } void OnDisable() @@ -161,14 +161,14 @@ void DoAntialiasing() if (m_AntialiasingMode.intValue == (int)PostProcessLayer.Antialiasing.TemporalAntialiasing) { - #if !UNITY_2017_3_OR_NEWER +#if !UNITY_2017_3_OR_NEWER if (RuntimeUtilities.isSinglePassStereoSelected) EditorGUILayout.HelpBox("TAA requires Unity 2017.3+ for Single-pass stereo rendering support.", MessageType.Warning); - #endif - #if UNITY_2017_3_OR_NEWER +#endif +#if UNITY_2017_3_OR_NEWER if (m_TargetCameraComponent != null && m_TargetCameraComponent.allowDynamicResolution) EditorGUILayout.HelpBox("TAA is not supported with Dynamic Resolution.", MessageType.Warning); - #endif +#endif EditorGUILayout.PropertyField(m_TaaJitterSpread); EditorGUILayout.PropertyField(m_TaaStationaryBlending); diff --git a/com.unity.postprocessing/PostProcessing/Editor/Utils/CurveEditor.cs b/com.unity.postprocessing/PostProcessing/Editor/Utils/CurveEditor.cs index 0e771e26dc5..72fac1d539e 100644 --- a/com.unity.postprocessing/PostProcessing/Editor/Utils/CurveEditor.cs +++ b/com.unity.postprocessing/PostProcessing/Editor/Utils/CurveEditor.cs @@ -148,7 +148,7 @@ internal MenuAction(SerializedProperty curve, Vector3 position) public CurveEditor() : this(Settings.defaultSettings) - {} + { } public CurveEditor(Settings settings) { diff --git a/com.unity.postprocessing/PostProcessing/Editor/Utils/GlobalSettings.cs b/com.unity.postprocessing/PostProcessing/Editor/Utils/GlobalSettings.cs index 9f789c48fb6..69406975f46 100644 --- a/com.unity.postprocessing/PostProcessing/Editor/Utils/GlobalSettings.cs +++ b/com.unity.postprocessing/PostProcessing/Editor/Utils/GlobalSettings.cs @@ -8,9 +8,9 @@ static class GlobalSettings static class Keys { internal const string trackballSensitivity = "PostProcessing.Trackball.Sensitivity"; - internal const string volumeGizmoColor = "PostProcessing.Volume.GizmoColor"; - internal const string currentChannelMixer = "PostProcessing.ChannelMixer.CurrentChannel"; - internal const string currentCurve = "PostProcessing.Curve.Current"; + internal const string volumeGizmoColor = "PostProcessing.Volume.GizmoColor"; + internal const string currentChannelMixer = "PostProcessing.ChannelMixer.CurrentChannel"; + internal const string currentCurve = "PostProcessing.Curve.Current"; } static bool m_Loaded = false; @@ -48,7 +48,7 @@ static GlobalSettings() Load(); } - #if UNITY_2018_3_OR_NEWER +#if UNITY_2018_3_OR_NEWER [SettingsProvider] static SettingsProvider PreferenceGUI() { @@ -58,14 +58,14 @@ static SettingsProvider PreferenceGUI() }; } - #else +#else [PreferenceItem("Post-processing")] static void PreferenceGUI() { OpenGUI(); } - #endif +#endif static void OpenGUI() { @@ -75,15 +75,15 @@ static void OpenGUI() EditorGUILayout.Space(); trackballSensitivity = EditorGUILayout.Slider("Trackballs Sensitivity", trackballSensitivity, 0.05f, 1f); - volumeGizmoColor = EditorGUILayout.ColorField("Volume Gizmo Color", volumeGizmoColor); + volumeGizmoColor = EditorGUILayout.ColorField("Volume Gizmo Color", volumeGizmoColor); } static void Load() { m_TrackballSensitivity = EditorPrefs.GetFloat(Keys.trackballSensitivity, 0.2f); - m_VolumeGizmoColor = GetColor(Keys.volumeGizmoColor, new Color(0.2f, 0.8f, 0.1f, 0.5f)); - m_CurrentChannelMixer = EditorPrefs.GetInt(Keys.currentChannelMixer, 0); - m_CurrentCurve = EditorPrefs.GetInt(Keys.currentCurve, 0); + m_VolumeGizmoColor = GetColor(Keys.volumeGizmoColor, new Color(0.2f, 0.8f, 0.1f, 0.5f)); + m_CurrentChannelMixer = EditorPrefs.GetInt(Keys.currentChannelMixer, 0); + m_CurrentCurve = EditorPrefs.GetInt(Keys.currentCurve, 0); m_Loaded = true; } diff --git a/com.unity.postprocessing/PostProcessing/Runtime/Effects/AmbientOcclusion.cs b/com.unity.postprocessing/PostProcessing/Runtime/Effects/AmbientOcclusion.cs index 93f83cc17a6..b9cec0ce4c8 100644 --- a/com.unity.postprocessing/PostProcessing/Runtime/Effects/AmbientOcclusion.cs +++ b/com.unity.postprocessing/PostProcessing/Runtime/Effects/AmbientOcclusion.cs @@ -56,13 +56,13 @@ public enum AmbientOcclusionQuality /// A volume parameter holding a value. /// [Serializable] - public sealed class AmbientOcclusionModeParameter : ParameterOverride {} + public sealed class AmbientOcclusionModeParameter : ParameterOverride { } /// /// A volume parameter holding a value. /// [Serializable] - public sealed class AmbientOcclusionQualityParameter : ParameterOverride {} + public sealed class AmbientOcclusionQualityParameter : ParameterOverride { } /// /// This class holds settings for the Ambient Occlusion effect. diff --git a/com.unity.postprocessing/PostProcessing/Runtime/Effects/AutoExposure.cs b/com.unity.postprocessing/PostProcessing/Runtime/Effects/AutoExposure.cs index acec1d4c5de..79b869665a2 100644 --- a/com.unity.postprocessing/PostProcessing/Runtime/Effects/AutoExposure.cs +++ b/com.unity.postprocessing/PostProcessing/Runtime/Effects/AutoExposure.cs @@ -22,7 +22,7 @@ public enum EyeAdaptation /// A volume parameter holding a value. /// [Serializable] - public sealed class EyeAdaptationParameter : ParameterOverride {} + public sealed class EyeAdaptationParameter : ParameterOverride { } /// /// This class holds settings for the Auto Exposure effect. diff --git a/com.unity.postprocessing/PostProcessing/Runtime/Effects/Bloom.cs b/com.unity.postprocessing/PostProcessing/Runtime/Effects/Bloom.cs index 3643ff10813..8f230f40d1a 100644 --- a/com.unity.postprocessing/PostProcessing/Runtime/Effects/Bloom.cs +++ b/com.unity.postprocessing/PostProcessing/Runtime/Effects/Bloom.cs @@ -150,7 +150,7 @@ public override void Render(PostProcessRenderContext context) // Negative anamorphic ratio values distort vertically - positive is horizontal float ratio = Mathf.Clamp(settings.anamorphicRatio, -1, 1); float rw = ratio < 0 ? -ratio : 0f; - float rh = ratio > 0 ? ratio : 0f; + float rh = ratio > 0 ? ratio : 0f; // Do bloom on a half-res buffer, full-res doesn't bring much and kills performances on // fillrate limited platforms diff --git a/com.unity.postprocessing/PostProcessing/Runtime/Effects/ColorGrading.cs b/com.unity.postprocessing/PostProcessing/Runtime/Effects/ColorGrading.cs index 34f378b13e4..c58a62604cc 100644 --- a/com.unity.postprocessing/PostProcessing/Runtime/Effects/ColorGrading.cs +++ b/com.unity.postprocessing/PostProcessing/Runtime/Effects/ColorGrading.cs @@ -64,13 +64,13 @@ public enum Tonemapper /// A volume parameter holding a value. /// [Serializable] - public sealed class GradingModeParameter : ParameterOverride {} + public sealed class GradingModeParameter : ParameterOverride { } /// /// A volume parameter holding a value. /// [Serializable] - public sealed class TonemapperParameter : ParameterOverride {} + public sealed class TonemapperParameter : ParameterOverride { } /// /// This class holds settings for the Color Grading effect. @@ -328,7 +328,7 @@ public sealed class ColorGrading : PostProcessEffectSettings /// /// This is only used when working with . /// - public SplineParameter masterCurve = new SplineParameter { value = new Spline(new AnimationCurve(new Keyframe(0f, 0f, 1f, 1f), new Keyframe(1f, 1f, 1f, 1f)), 0f, false, new Vector2(0f, 1f)) }; + public SplineParameter masterCurve = new SplineParameter { value = new Spline(new AnimationCurve(new Keyframe(0f, 0f, 1f, 1f), new Keyframe(1f, 1f, 1f, 1f)), 0f, false, new Vector2(0f, 1f)) }; /// /// Remaps the red channel. @@ -336,7 +336,7 @@ public sealed class ColorGrading : PostProcessEffectSettings /// /// This is only used when working with . /// - public SplineParameter redCurve = new SplineParameter { value = new Spline(new AnimationCurve(new Keyframe(0f, 0f, 1f, 1f), new Keyframe(1f, 1f, 1f, 1f)), 0f, false, new Vector2(0f, 1f)) }; + public SplineParameter redCurve = new SplineParameter { value = new Spline(new AnimationCurve(new Keyframe(0f, 0f, 1f, 1f), new Keyframe(1f, 1f, 1f, 1f)), 0f, false, new Vector2(0f, 1f)) }; /// /// Remaps the green channel/ @@ -344,7 +344,7 @@ public sealed class ColorGrading : PostProcessEffectSettings /// /// This is only used when working with . /// - public SplineParameter greenCurve = new SplineParameter { value = new Spline(new AnimationCurve(new Keyframe(0f, 0f, 1f, 1f), new Keyframe(1f, 1f, 1f, 1f)), 0f, false, new Vector2(0f, 1f)) }; + public SplineParameter greenCurve = new SplineParameter { value = new Spline(new AnimationCurve(new Keyframe(0f, 0f, 1f, 1f), new Keyframe(1f, 1f, 1f, 1f)), 0f, false, new Vector2(0f, 1f)) }; /// /// Remaps the blue channel. @@ -352,7 +352,7 @@ public sealed class ColorGrading : PostProcessEffectSettings /// /// This is only used when working with . /// - public SplineParameter blueCurve = new SplineParameter { value = new Spline(new AnimationCurve(new Keyframe(0f, 0f, 1f, 1f), new Keyframe(1f, 1f, 1f, 1f)), 0f, false, new Vector2(0f, 1f)) }; + public SplineParameter blueCurve = new SplineParameter { value = new Spline(new AnimationCurve(new Keyframe(0f, 0f, 1f, 1f), new Keyframe(1f, 1f, 1f, 1f)), 0f, false, new Vector2(0f, 1f)) }; /// /// Remaps the hue according to the current hue. @@ -467,13 +467,17 @@ void RenderHDRPipeline3D(PostProcessRenderContext context) switch (settings.tonemapper.value) { - case Tonemapper.None: kernel = compute.FindKernel("KGenLut3D_NoTonemap"); + case Tonemapper.None: + kernel = compute.FindKernel("KGenLut3D_NoTonemap"); break; - case Tonemapper.Neutral: kernel = compute.FindKernel("KGenLut3D_NeutralTonemap"); + case Tonemapper.Neutral: + kernel = compute.FindKernel("KGenLut3D_NeutralTonemap"); break; - case Tonemapper.ACES: kernel = compute.FindKernel("KGenLut3D_AcesTonemap"); + case Tonemapper.ACES: + kernel = compute.FindKernel("KGenLut3D_AcesTonemap"); break; - case Tonemapper.Custom: kernel = compute.FindKernel("KGenLut3D_CustomTonemap"); + case Tonemapper.Custom: + kernel = compute.FindKernel("KGenLut3D_CustomTonemap"); break; } diff --git a/com.unity.postprocessing/PostProcessing/Runtime/Effects/DepthOfField.cs b/com.unity.postprocessing/PostProcessing/Runtime/Effects/DepthOfField.cs index d0b808d55f1..396107ce3cd 100644 --- a/com.unity.postprocessing/PostProcessing/Runtime/Effects/DepthOfField.cs +++ b/com.unity.postprocessing/PostProcessing/Runtime/Effects/DepthOfField.cs @@ -32,7 +32,7 @@ public enum KernelSize /// A volume parameter holding a value. /// [Serializable] - public sealed class KernelSizeParameter : ParameterOverride {} + public sealed class KernelSizeParameter : ParameterOverride { } /// /// This class holds settings for the Depth of Field effect. diff --git a/com.unity.postprocessing/PostProcessing/Runtime/Effects/Dithering.cs b/com.unity.postprocessing/PostProcessing/Runtime/Effects/Dithering.cs index 07633fc3f0f..f4618fed7f7 100644 --- a/com.unity.postprocessing/PostProcessing/Runtime/Effects/Dithering.cs +++ b/com.unity.postprocessing/PostProcessing/Runtime/Effects/Dithering.cs @@ -15,17 +15,17 @@ internal void Render(PostProcessRenderContext context) var blueNoise = context.resources.blueNoise64; Assert.IsTrue(blueNoise != null && blueNoise.Length > 0); - #if POSTFX_DEBUG_STATIC_DITHERING // Used by QA for automated testing +#if POSTFX_DEBUG_STATIC_DITHERING // Used by QA for automated testing m_NoiseTextureIndex = 0; float rndOffsetX = 0f; float rndOffsetY = 0f; - #else +#else if (++m_NoiseTextureIndex >= blueNoise.Length) m_NoiseTextureIndex = 0; float rndOffsetX = (float)m_Random.NextDouble(); float rndOffsetY = (float)m_Random.NextDouble(); - #endif +#endif var noiseTex = blueNoise[m_NoiseTextureIndex]; var uberSheet = context.uberSheet; diff --git a/com.unity.postprocessing/PostProcessing/Runtime/Effects/Grain.cs b/com.unity.postprocessing/PostProcessing/Runtime/Effects/Grain.cs index 72a5eb91b23..edd6593ca48 100644 --- a/com.unity.postprocessing/PostProcessing/Runtime/Effects/Grain.cs +++ b/com.unity.postprocessing/PostProcessing/Runtime/Effects/Grain.cs @@ -46,7 +46,7 @@ public override bool IsEnabledAndSupported(PostProcessRenderContext context) } #if POSTFX_DEBUG_STATIC_GRAIN - #pragma warning disable 414 +#pragma warning disable 414 #endif [UnityEngine.Scripting.Preserve] internal sealed class GrainRenderer : PostProcessEffectRenderer @@ -122,6 +122,6 @@ public override void Release() } #if POSTFX_DEBUG_STATIC_GRAIN - #pragma warning restore 414 +#pragma warning restore 414 #endif } diff --git a/com.unity.postprocessing/PostProcessing/Runtime/Effects/MotionBlur.cs b/com.unity.postprocessing/PostProcessing/Runtime/Effects/MotionBlur.cs index 09a1840f380..64b02e242d1 100644 --- a/com.unity.postprocessing/PostProcessing/Runtime/Effects/MotionBlur.cs +++ b/com.unity.postprocessing/PostProcessing/Runtime/Effects/MotionBlur.cs @@ -31,11 +31,11 @@ public override bool IsEnabledAndSupported(PostProcessRenderContext context) { return enabled.value && shutterAngle.value > 0f - #if UNITY_EDITOR +#if UNITY_EDITOR // Don't render motion blur preview when the editor is not playing as it can in some // cases results in ugly artifacts (i.e. when resizing the game view). && Application.isPlaying - #endif +#endif && SystemInfo.supportsMotionVectors && RenderTextureFormat.RGHalf.IsSupported() && !context.stereoActive; diff --git a/com.unity.postprocessing/PostProcessing/Runtime/Effects/MultiScaleVO.cs b/com.unity.postprocessing/PostProcessing/Runtime/Effects/MultiScaleVO.cs index 7eb4ffdeb7f..2bb4a31e84c 100644 --- a/com.unity.postprocessing/PostProcessing/Runtime/Effects/MultiScaleVO.cs +++ b/com.unity.postprocessing/PostProcessing/Runtime/Effects/MultiScaleVO.cs @@ -164,7 +164,7 @@ public void GenerateAOMap(CommandBuffer cmd, Camera camera, RenderTargetIdentifi for (int i = 1; i < 7; i++) { int div = 1 << i; - m_ScaledWidths[i] = (m_ScaledWidths[0] + (div - 1)) / div; + m_ScaledWidths[i] = (m_ScaledWidths[0] + (div - 1)) / div; m_ScaledHeights[i] = (m_ScaledHeights[0] + (div - 1)) / div; } @@ -180,10 +180,10 @@ public void GenerateAOMap(CommandBuffer cmd, Camera camera, RenderTargetIdentifi PushRenderCommands(cmd, ShaderIDs.TiledDepth3, ShaderIDs.Occlusion3, GetSizeArray(MipLevel.L5), tanHalfFovH, isMSAA); PushRenderCommands(cmd, ShaderIDs.TiledDepth4, ShaderIDs.Occlusion4, GetSizeArray(MipLevel.L6), tanHalfFovH, isMSAA); - PushUpsampleCommands(cmd, ShaderIDs.LowDepth4, ShaderIDs.Occlusion4, ShaderIDs.LowDepth3, ShaderIDs.Occlusion3, ShaderIDs.Combined3, GetSize(MipLevel.L4), GetSize(MipLevel.L3), isMSAA); - PushUpsampleCommands(cmd, ShaderIDs.LowDepth3, ShaderIDs.Combined3, ShaderIDs.LowDepth2, ShaderIDs.Occlusion2, ShaderIDs.Combined2, GetSize(MipLevel.L3), GetSize(MipLevel.L2), isMSAA); - PushUpsampleCommands(cmd, ShaderIDs.LowDepth2, ShaderIDs.Combined2, ShaderIDs.LowDepth1, ShaderIDs.Occlusion1, ShaderIDs.Combined1, GetSize(MipLevel.L2), GetSize(MipLevel.L1), isMSAA); - PushUpsampleCommands(cmd, ShaderIDs.LowDepth1, ShaderIDs.Combined1, ShaderIDs.LinearDepth, null, destination, GetSize(MipLevel.L1), GetSize(MipLevel.Original), isMSAA, invert); + PushUpsampleCommands(cmd, ShaderIDs.LowDepth4, ShaderIDs.Occlusion4, ShaderIDs.LowDepth3, ShaderIDs.Occlusion3, ShaderIDs.Combined3, GetSize(MipLevel.L4), GetSize(MipLevel.L3), isMSAA); + PushUpsampleCommands(cmd, ShaderIDs.LowDepth3, ShaderIDs.Combined3, ShaderIDs.LowDepth2, ShaderIDs.Occlusion2, ShaderIDs.Combined2, GetSize(MipLevel.L3), GetSize(MipLevel.L2), isMSAA); + PushUpsampleCommands(cmd, ShaderIDs.LowDepth2, ShaderIDs.Combined2, ShaderIDs.LowDepth1, ShaderIDs.Occlusion1, ShaderIDs.Combined1, GetSize(MipLevel.L2), GetSize(MipLevel.L1), isMSAA); + PushUpsampleCommands(cmd, ShaderIDs.LowDepth1, ShaderIDs.Combined1, ShaderIDs.LinearDepth, null, destination, GetSize(MipLevel.L1), GetSize(MipLevel.Original), isMSAA, invert); // Cleanup PushReleaseCommands(cmd); diff --git a/com.unity.postprocessing/PostProcessing/Runtime/Effects/ScreenSpaceReflections.cs b/com.unity.postprocessing/PostProcessing/Runtime/Effects/ScreenSpaceReflections.cs index a1177bc71c8..35b4174d666 100644 --- a/com.unity.postprocessing/PostProcessing/Runtime/Effects/ScreenSpaceReflections.cs +++ b/com.unity.postprocessing/PostProcessing/Runtime/Effects/ScreenSpaceReflections.cs @@ -74,13 +74,13 @@ public enum ScreenSpaceReflectionResolution /// A volume parameter holding a value. /// [Serializable] - public sealed class ScreenSpaceReflectionPresetParameter : ParameterOverride {} + public sealed class ScreenSpaceReflectionPresetParameter : ParameterOverride { } /// /// A volume parameter holding a value. /// [Serializable] - public sealed class ScreenSpaceReflectionResolutionParameter : ParameterOverride {} + public sealed class ScreenSpaceReflectionResolutionParameter : ParameterOverride { } /// /// This class holds settings for the Screen-space Reflections effect. diff --git a/com.unity.postprocessing/PostProcessing/Runtime/Effects/Vignette.cs b/com.unity.postprocessing/PostProcessing/Runtime/Effects/Vignette.cs index 3b2cafa3b15..48e5c78de82 100644 --- a/com.unity.postprocessing/PostProcessing/Runtime/Effects/Vignette.cs +++ b/com.unity.postprocessing/PostProcessing/Runtime/Effects/Vignette.cs @@ -22,7 +22,7 @@ public enum VignetteMode /// A volume parameter holding a value. /// [Serializable] - public sealed class VignetteModeParameter : ParameterOverride {} + public sealed class VignetteModeParameter : ParameterOverride { } /// /// This class holds settings for the Vignette effect. @@ -94,7 +94,7 @@ public override bool IsEnabledAndSupported(PostProcessRenderContext context) { return enabled.value && ((mode.value == VignetteMode.Classic && intensity.value > 0f) - || (mode.value == VignetteMode.Masked && opacity.value > 0f && mask.value != null)); + || (mode.value == VignetteMode.Masked && opacity.value > 0f && mask.value != null)); } } diff --git a/com.unity.postprocessing/PostProcessing/Runtime/ParameterOverride.cs b/com.unity.postprocessing/PostProcessing/Runtime/ParameterOverride.cs index fd06a41c41e..6a3558acc51 100644 --- a/com.unity.postprocessing/PostProcessing/Runtime/ParameterOverride.cs +++ b/com.unity.postprocessing/PostProcessing/Runtime/ParameterOverride.cs @@ -28,7 +28,7 @@ public abstract class ParameterOverride /// The value stored in this parameter public T GetValue() { - return ((ParameterOverride) this).value; + return ((ParameterOverride)this).value; } /// @@ -242,7 +242,7 @@ public override void Interp(int from, int to, float t) /// A that holds a bool value. /// [Serializable] - public sealed class BoolParameter : ParameterOverride {} + public sealed class BoolParameter : ParameterOverride { } /// /// A that holds a value. diff --git a/com.unity.postprocessing/PostProcessing/Runtime/Utils/ColorUtilities.cs b/com.unity.postprocessing/PostProcessing/Runtime/Utils/ColorUtilities.cs index 9ea508d8b7e..5a97975b82c 100644 --- a/com.unity.postprocessing/PostProcessing/Runtime/Utils/ColorUtilities.cs +++ b/com.unity.postprocessing/PostProcessing/Runtime/Utils/ColorUtilities.cs @@ -160,7 +160,7 @@ public static uint ToHex(Color c) { return ((uint)(c.a * 255) << 24) | ((uint)(c.r * 255) << 16) - | ((uint)(c.g * 255) << 8) + | ((uint)(c.g * 255) << 8) | ((uint)(c.b * 255)); } @@ -173,7 +173,7 @@ public static Color ToRGBA(uint hex) { return new Color( ((hex >> 16) & 0xff) / 255f, // r - ((hex >> 8) & 0xff) / 255f, // g + ((hex >> 8) & 0xff) / 255f, // g ((hex) & 0xff) / 255f, // b ((hex >> 24) & 0xff) / 255f // a ); diff --git a/com.unity.postprocessing/PostProcessing/Runtime/Utils/LogHistogram.cs b/com.unity.postprocessing/PostProcessing/Runtime/Utils/LogHistogram.cs index 3e36a5d1001..abf2ce96f54 100644 --- a/com.unity.postprocessing/PostProcessing/Runtime/Utils/LogHistogram.cs +++ b/com.unity.postprocessing/PostProcessing/Runtime/Utils/LogHistogram.cs @@ -3,7 +3,7 @@ namespace UnityEngine.Rendering.PostProcessing internal sealed class LogHistogram { public const int rangeMin = -9; // ev - public const int rangeMax = 9; // ev + public const int rangeMax = 9; // ev // Don't forget to update 'ExposureHistogram.hlsl' if you change these values ! const int k_Bins = 128; diff --git a/com.unity.postprocessing/PostProcessing/Runtime/Utils/RuntimeUtilities.cs b/com.unity.postprocessing/PostProcessing/Runtime/Utils/RuntimeUtilities.cs index b1bb5dd2243..753c5f24fd7 100644 --- a/com.unity.postprocessing/PostProcessing/Runtime/Utils/RuntimeUtilities.cs +++ b/com.unity.postprocessing/PostProcessing/Runtime/Utils/RuntimeUtilities.cs @@ -411,11 +411,11 @@ internal static void UpdateResources(PostProcessResources resources) /// public static void SetRenderTargetWithLoadStoreAction(this CommandBuffer cmd, RenderTargetIdentifier rt, RenderBufferLoadAction loadAction, RenderBufferStoreAction storeAction) { - #if UNITY_2018_2_OR_NEWER +#if UNITY_2018_2_OR_NEWER cmd.SetRenderTarget(rt, loadAction, storeAction); - #else +#else cmd.SetRenderTarget(rt); - #endif +#endif } /// @@ -434,11 +434,11 @@ public static void SetRenderTargetWithLoadStoreAction(this CommandBuffer cmd, Re RenderBufferLoadAction loadAction, RenderBufferStoreAction storeAction, RenderBufferLoadAction depthLoadAction, RenderBufferStoreAction depthStoreAction) { - #if UNITY_2018_2_OR_NEWER +#if UNITY_2018_2_OR_NEWER cmd.SetRenderTarget(rt, loadAction, storeAction, depthLoadAction, depthStoreAction); - #else +#else cmd.SetRenderTarget(rt); - #endif +#endif } /// @@ -455,11 +455,11 @@ public static void SetRenderTargetWithLoadStoreAction(this CommandBuffer cmd, RenderTargetIdentifier color, RenderBufferLoadAction colorLoadAction, RenderBufferStoreAction colorStoreAction, RenderTargetIdentifier depth, RenderBufferLoadAction depthLoadAction, RenderBufferStoreAction depthStoreAction) { - #if UNITY_2018_2_OR_NEWER +#if UNITY_2018_2_OR_NEWER cmd.SetRenderTarget(color, colorLoadAction, colorStoreAction, depth, depthLoadAction, depthStoreAction); - #else +#else cmd.SetRenderTarget(color, depth); - #endif +#endif } /// @@ -500,13 +500,13 @@ public static void BlitFullscreenTriangle(this CommandBuffer cmd, RenderTargetId public static void BlitFullscreenTriangle(this CommandBuffer cmd, RenderTargetIdentifier source, RenderTargetIdentifier destination, PropertySheet propertySheet, int pass, RenderBufferLoadAction loadAction, Rect? viewport = null, bool preserveDepth = false) { cmd.SetGlobalTexture(ShaderIDs.MainTex, source); - #if UNITY_2018_2_OR_NEWER +#if UNITY_2018_2_OR_NEWER bool clear = (loadAction == LoadAction.Clear); if (clear) loadAction = LoadAction.DontCare; - #else +#else bool clear = false; - #endif +#endif if (viewport != null) loadAction = LoadAction.Load; @@ -534,9 +534,9 @@ public static void BlitFullscreenTriangle(this CommandBuffer cmd, RenderTargetId /// Should the depth buffer be preserved? public static void BlitFullscreenTriangle(this CommandBuffer cmd, RenderTargetIdentifier source, RenderTargetIdentifier destination, PropertySheet propertySheet, int pass, bool clear = false, Rect? viewport = null, bool preserveDepth = false) { - #if UNITY_2018_2_OR_NEWER +#if UNITY_2018_2_OR_NEWER cmd.BlitFullscreenTriangle(source, destination, propertySheet, pass, clear ? LoadAction.Clear : LoadAction.DontCare, viewport, preserveDepth); - #else +#else cmd.SetGlobalTexture(ShaderIDs.MainTex, source); var loadAction = viewport == null ? LoadAction.DontCare : LoadAction.Load; cmd.SetRenderTargetWithLoadStoreAction(destination, loadAction, StoreAction.Store, preserveDepth ? LoadAction.Load : loadAction, StoreAction.Store); @@ -548,7 +548,7 @@ public static void BlitFullscreenTriangle(this CommandBuffer cmd, RenderTargetId cmd.ClearRenderTarget(true, true, Color.clear); cmd.DrawMesh(fullscreenTriangle, Matrix4x4.identity, propertySheet.material, 0, pass, propertySheet.properties); - #endif +#endif } /// @@ -699,10 +699,10 @@ public static void BlitFullscreenTriangle(this CommandBuffer cmd, RenderTargetId /// The destination render target public static void BuiltinBlit(this CommandBuffer cmd, Rendering.RenderTargetIdentifier source, RenderTargetIdentifier destination) { - #if UNITY_2018_2_OR_NEWER +#if UNITY_2018_2_OR_NEWER cmd.SetRenderTarget(destination, RenderBufferLoadAction.DontCare, RenderBufferStoreAction.Store); destination = BuiltinRenderTextureType.CurrentActive; - #endif +#endif cmd.Blit(source, destination); } @@ -716,10 +716,10 @@ public static void BuiltinBlit(this CommandBuffer cmd, Rendering.RenderTargetIde /// The pass from the material to use public static void BuiltinBlit(this CommandBuffer cmd, Rendering.RenderTargetIdentifier source, RenderTargetIdentifier destination, Material mat, int pass = 0) { - #if UNITY_2018_2_OR_NEWER +#if UNITY_2018_2_OR_NEWER cmd.SetRenderTarget(destination, RenderBufferLoadAction.DontCare, RenderBufferStoreAction.Store); destination = BuiltinRenderTextureType.CurrentActive; - #endif +#endif cmd.Blit(source, destination, mat, pass); } @@ -1155,7 +1155,7 @@ public static IEnumerable GetAllAssemblyTypes() { innerTypes = t.GetTypes(); } - catch {} + catch { } return innerTypes; }); } diff --git a/com.unity.postprocessing/PostProcessing/Runtime/Utils/ShaderIDs.cs b/com.unity.postprocessing/PostProcessing/Runtime/Utils/ShaderIDs.cs index cf4d93aa12c..9797b2efc0a 100644 --- a/com.unity.postprocessing/PostProcessing/Runtime/Utils/ShaderIDs.cs +++ b/com.unity.postprocessing/PostProcessing/Runtime/Utils/ShaderIDs.cs @@ -5,155 +5,155 @@ namespace UnityEngine.Rendering.PostProcessing // point. static class ShaderIDs { - internal static readonly int MainTex = Shader.PropertyToID("_MainTex"); - - internal static readonly int Jitter = Shader.PropertyToID("_Jitter"); - internal static readonly int Sharpness = Shader.PropertyToID("_Sharpness"); - internal static readonly int FinalBlendParameters = Shader.PropertyToID("_FinalBlendParameters"); - internal static readonly int HistoryTex = Shader.PropertyToID("_HistoryTex"); - - internal static readonly int SMAA_Flip = Shader.PropertyToID("_SMAA_Flip"); - internal static readonly int SMAA_Flop = Shader.PropertyToID("_SMAA_Flop"); - - internal static readonly int AOParams = Shader.PropertyToID("_AOParams"); - internal static readonly int AOColor = Shader.PropertyToID("_AOColor"); - internal static readonly int OcclusionTexture1 = Shader.PropertyToID("_OcclusionTexture1"); - internal static readonly int OcclusionTexture2 = Shader.PropertyToID("_OcclusionTexture2"); - internal static readonly int SAOcclusionTexture = Shader.PropertyToID("_SAOcclusionTexture"); - internal static readonly int MSVOcclusionTexture = Shader.PropertyToID("_MSVOcclusionTexture"); - internal static readonly int DepthCopy = Shader.PropertyToID("DepthCopy"); - internal static readonly int LinearDepth = Shader.PropertyToID("LinearDepth"); - internal static readonly int LowDepth1 = Shader.PropertyToID("LowDepth1"); - internal static readonly int LowDepth2 = Shader.PropertyToID("LowDepth2"); - internal static readonly int LowDepth3 = Shader.PropertyToID("LowDepth3"); - internal static readonly int LowDepth4 = Shader.PropertyToID("LowDepth4"); - internal static readonly int TiledDepth1 = Shader.PropertyToID("TiledDepth1"); - internal static readonly int TiledDepth2 = Shader.PropertyToID("TiledDepth2"); - internal static readonly int TiledDepth3 = Shader.PropertyToID("TiledDepth3"); - internal static readonly int TiledDepth4 = Shader.PropertyToID("TiledDepth4"); - internal static readonly int Occlusion1 = Shader.PropertyToID("Occlusion1"); - internal static readonly int Occlusion2 = Shader.PropertyToID("Occlusion2"); - internal static readonly int Occlusion3 = Shader.PropertyToID("Occlusion3"); - internal static readonly int Occlusion4 = Shader.PropertyToID("Occlusion4"); - internal static readonly int Combined1 = Shader.PropertyToID("Combined1"); - internal static readonly int Combined2 = Shader.PropertyToID("Combined2"); - internal static readonly int Combined3 = Shader.PropertyToID("Combined3"); - - internal static readonly int SSRResolveTemp = Shader.PropertyToID("_SSRResolveTemp"); - internal static readonly int Noise = Shader.PropertyToID("_Noise"); - internal static readonly int Test = Shader.PropertyToID("_Test"); - internal static readonly int Resolve = Shader.PropertyToID("_Resolve"); - internal static readonly int History = Shader.PropertyToID("_History"); - internal static readonly int ViewMatrix = Shader.PropertyToID("_ViewMatrix"); - internal static readonly int InverseViewMatrix = Shader.PropertyToID("_InverseViewMatrix"); - internal static readonly int InverseProjectionMatrix = Shader.PropertyToID("_InverseProjectionMatrix"); - internal static readonly int ScreenSpaceProjectionMatrix = Shader.PropertyToID("_ScreenSpaceProjectionMatrix"); - internal static readonly int Params2 = Shader.PropertyToID("_Params2"); - - internal static readonly int FogColor = Shader.PropertyToID("_FogColor"); - internal static readonly int FogParams = Shader.PropertyToID("_FogParams"); - - internal static readonly int VelocityScale = Shader.PropertyToID("_VelocityScale"); - internal static readonly int MaxBlurRadius = Shader.PropertyToID("_MaxBlurRadius"); - internal static readonly int RcpMaxBlurRadius = Shader.PropertyToID("_RcpMaxBlurRadius"); - internal static readonly int VelocityTex = Shader.PropertyToID("_VelocityTex"); - internal static readonly int Tile2RT = Shader.PropertyToID("_Tile2RT"); - internal static readonly int Tile4RT = Shader.PropertyToID("_Tile4RT"); - internal static readonly int Tile8RT = Shader.PropertyToID("_Tile8RT"); - internal static readonly int TileMaxOffs = Shader.PropertyToID("_TileMaxOffs"); - internal static readonly int TileMaxLoop = Shader.PropertyToID("_TileMaxLoop"); - internal static readonly int TileVRT = Shader.PropertyToID("_TileVRT"); - internal static readonly int NeighborMaxTex = Shader.PropertyToID("_NeighborMaxTex"); - internal static readonly int LoopCount = Shader.PropertyToID("_LoopCount"); - - internal static readonly int DepthOfFieldTemp = Shader.PropertyToID("_DepthOfFieldTemp"); - internal static readonly int DepthOfFieldTex = Shader.PropertyToID("_DepthOfFieldTex"); - internal static readonly int Distance = Shader.PropertyToID("_Distance"); - internal static readonly int LensCoeff = Shader.PropertyToID("_LensCoeff"); - internal static readonly int MaxCoC = Shader.PropertyToID("_MaxCoC"); - internal static readonly int RcpMaxCoC = Shader.PropertyToID("_RcpMaxCoC"); - internal static readonly int RcpAspect = Shader.PropertyToID("_RcpAspect"); - internal static readonly int CoCTex = Shader.PropertyToID("_CoCTex"); - internal static readonly int TaaParams = Shader.PropertyToID("_TaaParams"); - - internal static readonly int AutoExposureTex = Shader.PropertyToID("_AutoExposureTex"); - internal static readonly int HistogramBuffer = Shader.PropertyToID("_HistogramBuffer"); - internal static readonly int Params = Shader.PropertyToID("_Params"); - internal static readonly int ScaleOffsetRes = Shader.PropertyToID("_ScaleOffsetRes"); - - internal static readonly int BloomTex = Shader.PropertyToID("_BloomTex"); - internal static readonly int SampleScale = Shader.PropertyToID("_SampleScale"); - internal static readonly int Threshold = Shader.PropertyToID("_Threshold"); - internal static readonly int ColorIntensity = Shader.PropertyToID("_ColorIntensity"); - internal static readonly int Bloom_DirtTex = Shader.PropertyToID("_Bloom_DirtTex"); - internal static readonly int Bloom_Settings = Shader.PropertyToID("_Bloom_Settings"); - internal static readonly int Bloom_Color = Shader.PropertyToID("_Bloom_Color"); - internal static readonly int Bloom_DirtTileOffset = Shader.PropertyToID("_Bloom_DirtTileOffset"); - - internal static readonly int ChromaticAberration_Amount = Shader.PropertyToID("_ChromaticAberration_Amount"); + internal static readonly int MainTex = Shader.PropertyToID("_MainTex"); + + internal static readonly int Jitter = Shader.PropertyToID("_Jitter"); + internal static readonly int Sharpness = Shader.PropertyToID("_Sharpness"); + internal static readonly int FinalBlendParameters = Shader.PropertyToID("_FinalBlendParameters"); + internal static readonly int HistoryTex = Shader.PropertyToID("_HistoryTex"); + + internal static readonly int SMAA_Flip = Shader.PropertyToID("_SMAA_Flip"); + internal static readonly int SMAA_Flop = Shader.PropertyToID("_SMAA_Flop"); + + internal static readonly int AOParams = Shader.PropertyToID("_AOParams"); + internal static readonly int AOColor = Shader.PropertyToID("_AOColor"); + internal static readonly int OcclusionTexture1 = Shader.PropertyToID("_OcclusionTexture1"); + internal static readonly int OcclusionTexture2 = Shader.PropertyToID("_OcclusionTexture2"); + internal static readonly int SAOcclusionTexture = Shader.PropertyToID("_SAOcclusionTexture"); + internal static readonly int MSVOcclusionTexture = Shader.PropertyToID("_MSVOcclusionTexture"); + internal static readonly int DepthCopy = Shader.PropertyToID("DepthCopy"); + internal static readonly int LinearDepth = Shader.PropertyToID("LinearDepth"); + internal static readonly int LowDepth1 = Shader.PropertyToID("LowDepth1"); + internal static readonly int LowDepth2 = Shader.PropertyToID("LowDepth2"); + internal static readonly int LowDepth3 = Shader.PropertyToID("LowDepth3"); + internal static readonly int LowDepth4 = Shader.PropertyToID("LowDepth4"); + internal static readonly int TiledDepth1 = Shader.PropertyToID("TiledDepth1"); + internal static readonly int TiledDepth2 = Shader.PropertyToID("TiledDepth2"); + internal static readonly int TiledDepth3 = Shader.PropertyToID("TiledDepth3"); + internal static readonly int TiledDepth4 = Shader.PropertyToID("TiledDepth4"); + internal static readonly int Occlusion1 = Shader.PropertyToID("Occlusion1"); + internal static readonly int Occlusion2 = Shader.PropertyToID("Occlusion2"); + internal static readonly int Occlusion3 = Shader.PropertyToID("Occlusion3"); + internal static readonly int Occlusion4 = Shader.PropertyToID("Occlusion4"); + internal static readonly int Combined1 = Shader.PropertyToID("Combined1"); + internal static readonly int Combined2 = Shader.PropertyToID("Combined2"); + internal static readonly int Combined3 = Shader.PropertyToID("Combined3"); + + internal static readonly int SSRResolveTemp = Shader.PropertyToID("_SSRResolveTemp"); + internal static readonly int Noise = Shader.PropertyToID("_Noise"); + internal static readonly int Test = Shader.PropertyToID("_Test"); + internal static readonly int Resolve = Shader.PropertyToID("_Resolve"); + internal static readonly int History = Shader.PropertyToID("_History"); + internal static readonly int ViewMatrix = Shader.PropertyToID("_ViewMatrix"); + internal static readonly int InverseViewMatrix = Shader.PropertyToID("_InverseViewMatrix"); + internal static readonly int InverseProjectionMatrix = Shader.PropertyToID("_InverseProjectionMatrix"); + internal static readonly int ScreenSpaceProjectionMatrix = Shader.PropertyToID("_ScreenSpaceProjectionMatrix"); + internal static readonly int Params2 = Shader.PropertyToID("_Params2"); + + internal static readonly int FogColor = Shader.PropertyToID("_FogColor"); + internal static readonly int FogParams = Shader.PropertyToID("_FogParams"); + + internal static readonly int VelocityScale = Shader.PropertyToID("_VelocityScale"); + internal static readonly int MaxBlurRadius = Shader.PropertyToID("_MaxBlurRadius"); + internal static readonly int RcpMaxBlurRadius = Shader.PropertyToID("_RcpMaxBlurRadius"); + internal static readonly int VelocityTex = Shader.PropertyToID("_VelocityTex"); + internal static readonly int Tile2RT = Shader.PropertyToID("_Tile2RT"); + internal static readonly int Tile4RT = Shader.PropertyToID("_Tile4RT"); + internal static readonly int Tile8RT = Shader.PropertyToID("_Tile8RT"); + internal static readonly int TileMaxOffs = Shader.PropertyToID("_TileMaxOffs"); + internal static readonly int TileMaxLoop = Shader.PropertyToID("_TileMaxLoop"); + internal static readonly int TileVRT = Shader.PropertyToID("_TileVRT"); + internal static readonly int NeighborMaxTex = Shader.PropertyToID("_NeighborMaxTex"); + internal static readonly int LoopCount = Shader.PropertyToID("_LoopCount"); + + internal static readonly int DepthOfFieldTemp = Shader.PropertyToID("_DepthOfFieldTemp"); + internal static readonly int DepthOfFieldTex = Shader.PropertyToID("_DepthOfFieldTex"); + internal static readonly int Distance = Shader.PropertyToID("_Distance"); + internal static readonly int LensCoeff = Shader.PropertyToID("_LensCoeff"); + internal static readonly int MaxCoC = Shader.PropertyToID("_MaxCoC"); + internal static readonly int RcpMaxCoC = Shader.PropertyToID("_RcpMaxCoC"); + internal static readonly int RcpAspect = Shader.PropertyToID("_RcpAspect"); + internal static readonly int CoCTex = Shader.PropertyToID("_CoCTex"); + internal static readonly int TaaParams = Shader.PropertyToID("_TaaParams"); + + internal static readonly int AutoExposureTex = Shader.PropertyToID("_AutoExposureTex"); + internal static readonly int HistogramBuffer = Shader.PropertyToID("_HistogramBuffer"); + internal static readonly int Params = Shader.PropertyToID("_Params"); + internal static readonly int ScaleOffsetRes = Shader.PropertyToID("_ScaleOffsetRes"); + + internal static readonly int BloomTex = Shader.PropertyToID("_BloomTex"); + internal static readonly int SampleScale = Shader.PropertyToID("_SampleScale"); + internal static readonly int Threshold = Shader.PropertyToID("_Threshold"); + internal static readonly int ColorIntensity = Shader.PropertyToID("_ColorIntensity"); + internal static readonly int Bloom_DirtTex = Shader.PropertyToID("_Bloom_DirtTex"); + internal static readonly int Bloom_Settings = Shader.PropertyToID("_Bloom_Settings"); + internal static readonly int Bloom_Color = Shader.PropertyToID("_Bloom_Color"); + internal static readonly int Bloom_DirtTileOffset = Shader.PropertyToID("_Bloom_DirtTileOffset"); + + internal static readonly int ChromaticAberration_Amount = Shader.PropertyToID("_ChromaticAberration_Amount"); internal static readonly int ChromaticAberration_SpectralLut = Shader.PropertyToID("_ChromaticAberration_SpectralLut"); - internal static readonly int Distortion_CenterScale = Shader.PropertyToID("_Distortion_CenterScale"); - internal static readonly int Distortion_Amount = Shader.PropertyToID("_Distortion_Amount"); - - internal static readonly int Lut2D = Shader.PropertyToID("_Lut2D"); - internal static readonly int Lut3D = Shader.PropertyToID("_Lut3D"); - internal static readonly int Lut3D_Params = Shader.PropertyToID("_Lut3D_Params"); - internal static readonly int Lut2D_Params = Shader.PropertyToID("_Lut2D_Params"); - internal static readonly int UserLut2D_Params = Shader.PropertyToID("_UserLut2D_Params"); - internal static readonly int PostExposure = Shader.PropertyToID("_PostExposure"); - internal static readonly int ColorBalance = Shader.PropertyToID("_ColorBalance"); - internal static readonly int ColorFilter = Shader.PropertyToID("_ColorFilter"); - internal static readonly int HueSatCon = Shader.PropertyToID("_HueSatCon"); - internal static readonly int Brightness = Shader.PropertyToID("_Brightness"); - internal static readonly int ChannelMixerRed = Shader.PropertyToID("_ChannelMixerRed"); - internal static readonly int ChannelMixerGreen = Shader.PropertyToID("_ChannelMixerGreen"); - internal static readonly int ChannelMixerBlue = Shader.PropertyToID("_ChannelMixerBlue"); - internal static readonly int Lift = Shader.PropertyToID("_Lift"); - internal static readonly int InvGamma = Shader.PropertyToID("_InvGamma"); - internal static readonly int Gain = Shader.PropertyToID("_Gain"); - internal static readonly int Curves = Shader.PropertyToID("_Curves"); - internal static readonly int CustomToneCurve = Shader.PropertyToID("_CustomToneCurve"); - internal static readonly int ToeSegmentA = Shader.PropertyToID("_ToeSegmentA"); - internal static readonly int ToeSegmentB = Shader.PropertyToID("_ToeSegmentB"); - internal static readonly int MidSegmentA = Shader.PropertyToID("_MidSegmentA"); - internal static readonly int MidSegmentB = Shader.PropertyToID("_MidSegmentB"); - internal static readonly int ShoSegmentA = Shader.PropertyToID("_ShoSegmentA"); - internal static readonly int ShoSegmentB = Shader.PropertyToID("_ShoSegmentB"); - - internal static readonly int Vignette_Color = Shader.PropertyToID("_Vignette_Color"); - internal static readonly int Vignette_Center = Shader.PropertyToID("_Vignette_Center"); - internal static readonly int Vignette_Settings = Shader.PropertyToID("_Vignette_Settings"); - internal static readonly int Vignette_Mask = Shader.PropertyToID("_Vignette_Mask"); - internal static readonly int Vignette_Opacity = Shader.PropertyToID("_Vignette_Opacity"); - internal static readonly int Vignette_Mode = Shader.PropertyToID("_Vignette_Mode"); - - internal static readonly int Grain_Params1 = Shader.PropertyToID("_Grain_Params1"); - internal static readonly int Grain_Params2 = Shader.PropertyToID("_Grain_Params2"); - internal static readonly int GrainTex = Shader.PropertyToID("_GrainTex"); - internal static readonly int Phase = Shader.PropertyToID("_Phase"); - internal static readonly int GrainNoiseParameters = Shader.PropertyToID("_NoiseParameters"); - - internal static readonly int LumaInAlpha = Shader.PropertyToID("_LumaInAlpha"); - - internal static readonly int DitheringTex = Shader.PropertyToID("_DitheringTex"); - internal static readonly int Dithering_Coords = Shader.PropertyToID("_Dithering_Coords"); - - internal static readonly int From = Shader.PropertyToID("_From"); - internal static readonly int To = Shader.PropertyToID("_To"); - internal static readonly int Interp = Shader.PropertyToID("_Interp"); - internal static readonly int TargetColor = Shader.PropertyToID("_TargetColor"); - - internal static readonly int HalfResFinalCopy = Shader.PropertyToID("_HalfResFinalCopy"); - internal static readonly int WaveformSource = Shader.PropertyToID("_WaveformSource"); - internal static readonly int WaveformBuffer = Shader.PropertyToID("_WaveformBuffer"); - internal static readonly int VectorscopeBuffer = Shader.PropertyToID("_VectorscopeBuffer"); - - internal static readonly int RenderViewportScaleFactor = Shader.PropertyToID("_RenderViewportScaleFactor"); - - internal static readonly int UVTransform = Shader.PropertyToID("_UVTransform"); - internal static readonly int DepthSlice = Shader.PropertyToID("_DepthSlice"); - internal static readonly int UVScaleOffset = Shader.PropertyToID("_UVScaleOffset"); - internal static readonly int PosScaleOffset = Shader.PropertyToID("_PosScaleOffset"); + internal static readonly int Distortion_CenterScale = Shader.PropertyToID("_Distortion_CenterScale"); + internal static readonly int Distortion_Amount = Shader.PropertyToID("_Distortion_Amount"); + + internal static readonly int Lut2D = Shader.PropertyToID("_Lut2D"); + internal static readonly int Lut3D = Shader.PropertyToID("_Lut3D"); + internal static readonly int Lut3D_Params = Shader.PropertyToID("_Lut3D_Params"); + internal static readonly int Lut2D_Params = Shader.PropertyToID("_Lut2D_Params"); + internal static readonly int UserLut2D_Params = Shader.PropertyToID("_UserLut2D_Params"); + internal static readonly int PostExposure = Shader.PropertyToID("_PostExposure"); + internal static readonly int ColorBalance = Shader.PropertyToID("_ColorBalance"); + internal static readonly int ColorFilter = Shader.PropertyToID("_ColorFilter"); + internal static readonly int HueSatCon = Shader.PropertyToID("_HueSatCon"); + internal static readonly int Brightness = Shader.PropertyToID("_Brightness"); + internal static readonly int ChannelMixerRed = Shader.PropertyToID("_ChannelMixerRed"); + internal static readonly int ChannelMixerGreen = Shader.PropertyToID("_ChannelMixerGreen"); + internal static readonly int ChannelMixerBlue = Shader.PropertyToID("_ChannelMixerBlue"); + internal static readonly int Lift = Shader.PropertyToID("_Lift"); + internal static readonly int InvGamma = Shader.PropertyToID("_InvGamma"); + internal static readonly int Gain = Shader.PropertyToID("_Gain"); + internal static readonly int Curves = Shader.PropertyToID("_Curves"); + internal static readonly int CustomToneCurve = Shader.PropertyToID("_CustomToneCurve"); + internal static readonly int ToeSegmentA = Shader.PropertyToID("_ToeSegmentA"); + internal static readonly int ToeSegmentB = Shader.PropertyToID("_ToeSegmentB"); + internal static readonly int MidSegmentA = Shader.PropertyToID("_MidSegmentA"); + internal static readonly int MidSegmentB = Shader.PropertyToID("_MidSegmentB"); + internal static readonly int ShoSegmentA = Shader.PropertyToID("_ShoSegmentA"); + internal static readonly int ShoSegmentB = Shader.PropertyToID("_ShoSegmentB"); + + internal static readonly int Vignette_Color = Shader.PropertyToID("_Vignette_Color"); + internal static readonly int Vignette_Center = Shader.PropertyToID("_Vignette_Center"); + internal static readonly int Vignette_Settings = Shader.PropertyToID("_Vignette_Settings"); + internal static readonly int Vignette_Mask = Shader.PropertyToID("_Vignette_Mask"); + internal static readonly int Vignette_Opacity = Shader.PropertyToID("_Vignette_Opacity"); + internal static readonly int Vignette_Mode = Shader.PropertyToID("_Vignette_Mode"); + + internal static readonly int Grain_Params1 = Shader.PropertyToID("_Grain_Params1"); + internal static readonly int Grain_Params2 = Shader.PropertyToID("_Grain_Params2"); + internal static readonly int GrainTex = Shader.PropertyToID("_GrainTex"); + internal static readonly int Phase = Shader.PropertyToID("_Phase"); + internal static readonly int GrainNoiseParameters = Shader.PropertyToID("_NoiseParameters"); + + internal static readonly int LumaInAlpha = Shader.PropertyToID("_LumaInAlpha"); + + internal static readonly int DitheringTex = Shader.PropertyToID("_DitheringTex"); + internal static readonly int Dithering_Coords = Shader.PropertyToID("_Dithering_Coords"); + + internal static readonly int From = Shader.PropertyToID("_From"); + internal static readonly int To = Shader.PropertyToID("_To"); + internal static readonly int Interp = Shader.PropertyToID("_Interp"); + internal static readonly int TargetColor = Shader.PropertyToID("_TargetColor"); + + internal static readonly int HalfResFinalCopy = Shader.PropertyToID("_HalfResFinalCopy"); + internal static readonly int WaveformSource = Shader.PropertyToID("_WaveformSource"); + internal static readonly int WaveformBuffer = Shader.PropertyToID("_WaveformBuffer"); + internal static readonly int VectorscopeBuffer = Shader.PropertyToID("_VectorscopeBuffer"); + + internal static readonly int RenderViewportScaleFactor = Shader.PropertyToID("_RenderViewportScaleFactor"); + + internal static readonly int UVTransform = Shader.PropertyToID("_UVTransform"); + internal static readonly int DepthSlice = Shader.PropertyToID("_DepthSlice"); + internal static readonly int UVScaleOffset = Shader.PropertyToID("_UVScaleOffset"); + internal static readonly int PosScaleOffset = Shader.PropertyToID("_PosScaleOffset"); } } diff --git a/com.unity.render-pipelines.core/Editor/CoreEditorDrawers.cs b/com.unity.render-pipelines.core/Editor/CoreEditorDrawers.cs index 559646ddd24..2f08c336505 100644 --- a/com.unity.render-pipelines.core/Editor/CoreEditorDrawers.cs +++ b/com.unity.render-pipelines.core/Editor/CoreEditorDrawers.cs @@ -74,7 +74,7 @@ public interface IDrawer public static readonly IDrawer space = Group((data, owner) => EditorGUILayout.Space()); /// Use it when IDrawer required but no operation should be done - public static readonly IDrawer noop = Group((data, owner) => {}); + public static readonly IDrawer noop = Group((data, owner) => { }); /// /// Conditioned drawer that will only be drawn if its enabler function is null or return true diff --git a/com.unity.render-pipelines.core/Editor/CoreEditorUtils.cs b/com.unity.render-pipelines.core/Editor/CoreEditorUtils.cs index 91ccbffe92f..db02353cc59 100644 --- a/com.unity.render-pipelines.core/Editor/CoreEditorUtils.cs +++ b/com.unity.render-pipelines.core/Editor/CoreEditorUtils.cs @@ -550,7 +550,7 @@ public static bool DrawHeaderToggle(GUIContent title, SerializedProperty group, // Context menu var menuIcon = CoreEditorStyles.paneOptionsIcon; - var menuRect = new Rect(labelRect.xMax + 3f + 16 + 5 , labelRect.y + 1f, menuIcon.width, menuIcon.height); + var menuRect = new Rect(labelRect.xMax + 3f + 16 + 5, labelRect.y + 1f, menuIcon.width, menuIcon.height); if (contextAction != null) GUI.DrawTexture(menuRect, menuIcon); diff --git a/com.unity.render-pipelines.core/Editor/Debugging/DebugState.cs b/com.unity.render-pipelines.core/Editor/Debugging/DebugState.cs index f70b0162df5..88e67e0bbbd 100644 --- a/com.unity.render-pipelines.core/Editor/Debugging/DebugState.cs +++ b/com.unity.render-pipelines.core/Editor/Debugging/DebugState.cs @@ -132,53 +132,53 @@ public DebugStateAttribute(params Type[] types) /// Boolean Debug State. /// [Serializable, DebugState(typeof(DebugUI.BoolField), typeof(DebugUI.Foldout), typeof(DebugUI.HistoryBoolField))] - public sealed class DebugStateBool : DebugState {} + public sealed class DebugStateBool : DebugState { } /// /// Integer Debug State. /// [Serializable, DebugState(typeof(DebugUI.IntField), typeof(DebugUI.EnumField), typeof(DebugUI.HistoryEnumField))] - public sealed class DebugStateInt : DebugState {} + public sealed class DebugStateInt : DebugState { } /// /// Flags Debug State. /// [Serializable, DebugState(typeof(DebugUI.BitField))] - public sealed class DebugStateFlags : DebugState {} + public sealed class DebugStateFlags : DebugState { } /// /// Unsigned Integer Debug State. /// [Serializable, DebugState(typeof(DebugUI.UIntField))] - public sealed class DebugStateUInt : DebugState {} + public sealed class DebugStateUInt : DebugState { } /// /// Float Debug State. /// [Serializable, DebugState(typeof(DebugUI.FloatField))] - public sealed class DebugStateFloat : DebugState {} + public sealed class DebugStateFloat : DebugState { } /// /// Color Debug State. /// [Serializable, DebugState(typeof(DebugUI.ColorField))] - public sealed class DebugStateColor : DebugState {} + public sealed class DebugStateColor : DebugState { } /// /// Vector2 Debug State. /// [Serializable, DebugState(typeof(DebugUI.Vector2Field))] - public sealed class DebugStateVector2 : DebugState {} + public sealed class DebugStateVector2 : DebugState { } /// /// Vector3 Debug State. /// [Serializable, DebugState(typeof(DebugUI.Vector3Field))] - public sealed class DebugStateVector3 : DebugState {} + public sealed class DebugStateVector3 : DebugState { } /// /// Vector4 Debug State. /// [Serializable, DebugState(typeof(DebugUI.Vector4Field))] - public sealed class DebugStateVector4 : DebugState {} + public sealed class DebugStateVector4 : DebugState { } } diff --git a/com.unity.render-pipelines.core/Editor/Debugging/DebugUIDrawer.cs b/com.unity.render-pipelines.core/Editor/Debugging/DebugUIDrawer.cs index 38845ceeda3..5565fa53b3b 100644 --- a/com.unity.render-pipelines.core/Editor/Debugging/DebugUIDrawer.cs +++ b/com.unity.render-pipelines.core/Editor/Debugging/DebugUIDrawer.cs @@ -52,7 +52,7 @@ protected T Cast(object o) /// Widget that is going to be rendered. /// Debug State associated with the Debug Item. public virtual void Begin(DebugUI.Widget widget, DebugState state) - {} + { } /// /// Implement this to execute UI rendering. @@ -71,7 +71,7 @@ public virtual bool OnGUI(DebugUI.Widget widget, DebugState state) /// Widget that is going to be rendered. /// Debug State associated with the Debug Item. public virtual void End(DebugUI.Widget widget, DebugState state) - {} + { } /// /// Applies a value to the widget and the Debug State of the Debug Item. diff --git a/com.unity.render-pipelines.core/Editor/Debugging/DebugWindow.cs b/com.unity.render-pipelines.core/Editor/Debugging/DebugWindow.cs index 5e3f33744b7..6af17324a44 100644 --- a/com.unity.render-pipelines.core/Editor/Debugging/DebugWindow.cs +++ b/com.unity.render-pipelines.core/Editor/Debugging/DebugWindow.cs @@ -11,10 +11,10 @@ namespace UnityEditor.Rendering { - #pragma warning disable 414 +#pragma warning disable 414 [Serializable] - sealed class WidgetStateDictionary : SerializedDictionary {} + sealed class WidgetStateDictionary : SerializedDictionary { } sealed class DebugWindowSettings : ScriptableObject { @@ -580,5 +580,5 @@ public Styles() } } - #pragma warning restore 414 +#pragma warning restore 414 } diff --git a/com.unity.render-pipelines.core/Editor/EditorPrefBoolFlags.cs b/com.unity.render-pipelines.core/Editor/EditorPrefBoolFlags.cs index 740301ef597..b3d4133ad36 100644 --- a/com.unity.render-pipelines.core/Editor/EditorPrefBoolFlags.cs +++ b/com.unity.render-pipelines.core/Editor/EditorPrefBoolFlags.cs @@ -52,7 +52,7 @@ public void SetFlag(T f, bool v) /// The EditorPrefBoolFlags /// The value /// A EditorPrefBoolFlags with OR operator performed - public static EditorPrefBoolFlags operator|(EditorPrefBoolFlags l, T r) + public static EditorPrefBoolFlags operator |(EditorPrefBoolFlags l, T r) { l.rawValue |= (uint)(int)(object)r; return l; @@ -62,7 +62,7 @@ public void SetFlag(T f, bool v) /// The EditorPrefBoolFlags /// The value /// A EditorPrefBoolFlags with AND operator performed - public static EditorPrefBoolFlags operator&(EditorPrefBoolFlags l, T r) + public static EditorPrefBoolFlags operator &(EditorPrefBoolFlags l, T r) { l.rawValue &= (uint)(int)(object)r; return l; @@ -72,7 +72,7 @@ public void SetFlag(T f, bool v) /// The EditorPrefBoolFlags /// The value /// A EditorPrefBoolFlags with XOR operator performed - public static EditorPrefBoolFlags operator^(EditorPrefBoolFlags l, T r) + public static EditorPrefBoolFlags operator ^(EditorPrefBoolFlags l, T r) { l.rawValue ^= (uint)(int)(object)r; return l; diff --git a/com.unity.render-pipelines.core/Editor/InspectorCurveEditor.cs b/com.unity.render-pipelines.core/Editor/InspectorCurveEditor.cs index 0dc98d97393..d0ea92e9f5e 100644 --- a/com.unity.render-pipelines.core/Editor/InspectorCurveEditor.cs +++ b/com.unity.render-pipelines.core/Editor/InspectorCurveEditor.cs @@ -238,7 +238,7 @@ internal MenuAction(SerializedProperty curve, Vector3 position) /// /// public InspectorCurveEditor() - : this(Settings.defaultSettings) {} + : this(Settings.defaultSettings) { } /// /// Creates a curve editor with the given settings. diff --git a/com.unity.render-pipelines.core/Editor/Lighting/CoreLightEditorUtilities.cs b/com.unity.render-pipelines.core/Editor/Lighting/CoreLightEditorUtilities.cs index 67dd0950b16..1feb37ca587 100644 --- a/com.unity.render-pipelines.core/Editor/Lighting/CoreLightEditorUtilities.cs +++ b/com.unity.render-pipelines.core/Editor/Lighting/CoreLightEditorUtilities.cs @@ -97,9 +97,9 @@ static void DrawPointHandlesAndLabels(Light light) var firstControl = GUIUtility.GetControlID(s_PointLightHandle.GetHashCode(), FocusType.Passive) - 6; // BoxBoundsHandle allocates 6 control IDs if (Event.current.type != EventType.Repaint) return; -// var firstControl = GUIUtility.GetControlID(k_RadiusHandleHash, FocusType.Passive) - 6; -// if (Event.current.type != EventType.Repaint) -// return; + // var firstControl = GUIUtility.GetControlID(k_RadiusHandleHash, FocusType.Passive) - 6; + // if (Event.current.type != EventType.Repaint) + // return; // Adding label ///////////////////////////////////// Vector3 labelPosition = Vector3.zero; @@ -312,7 +312,7 @@ static void DrawHandleLabel(Vector3 handlePosition, string labelText, float offs { Vector3 labelPosition = Vector3.zero; - var style = new GUIStyle {normal = {background = Texture2D.whiteTexture}}; + var style = new GUIStyle { normal = { background = Texture2D.whiteTexture } }; GUI.color = new Color(0.82f, 0.82f, 0.82f, 1); labelPosition = handlePosition + Handles.inverseMatrix.MultiplyVector(Vector3.up) * HandleUtility.GetHandleSize(handlePosition) * offsetFromHandle; diff --git a/com.unity.render-pipelines.core/Editor/LookDev/ComparisonGizmoController.cs b/com.unity.render-pipelines.core/Editor/LookDev/ComparisonGizmoController.cs index 9955fd6e923..9d8a9b56ab9 100644 --- a/com.unity.render-pipelines.core/Editor/LookDev/ComparisonGizmoController.cs +++ b/com.unity.render-pipelines.core/Editor/LookDev/ComparisonGizmoController.cs @@ -129,11 +129,11 @@ void OnMouseDrag(MouseMoveEvent evt) switch (m_Selected) { - case Selected.PlaneSeparator: OnDragPlaneSeparator(evt); break; + case Selected.PlaneSeparator: OnDragPlaneSeparator(evt); break; case Selected.NodeFirstView: - case Selected.NodeSecondView: OnDragPlaneNodeExtremity(evt); break; - case Selected.Fader: OnDragFader(evt); break; - default: throw new ArgumentException("Unknown kind of Selected"); + case Selected.NodeSecondView: OnDragPlaneNodeExtremity(evt); break; + case Selected.Fader: OnDragFader(evt); break; + default: throw new ArgumentException("Unknown kind of Selected"); } } diff --git a/com.unity.render-pipelines.core/Editor/LookDev/DisplayWindow.DebugSidePanel.cs b/com.unity.render-pipelines.core/Editor/LookDev/DisplayWindow.DebugSidePanel.cs index 85f0a4d00b4..e44bc8e292c 100644 --- a/com.unity.render-pipelines.core/Editor/LookDev/DisplayWindow.DebugSidePanel.cs +++ b/com.unity.render-pipelines.core/Editor/LookDev/DisplayWindow.DebugSidePanel.cs @@ -99,9 +99,9 @@ void ReadValueFromSourcesWithoutNotify(K element, Func fro class MultipleDifferentValue : TextElement { - public new class UxmlFactory : UxmlFactory {} + public new class UxmlFactory : UxmlFactory { } - public new class UxmlTraits : TextElement.UxmlTraits {} + public new class UxmlTraits : TextElement.UxmlTraits { } public new static readonly string ussClassName = "unity-multipledifferentevalue"; @@ -159,12 +159,12 @@ public override void SetValueWithoutNotify(bool newValue) public override bool value { get => inMultipleValueState ? default : base.value; - set - { - if (inMultipleValueState) - inMultipleValueState = false; - base.value = value; - } + set + { + if (inMultipleValueState) + inMultipleValueState = false; + base.value = value; + } } } @@ -211,13 +211,13 @@ public override void SetValueWithoutNotify(string newValue) public override string value { get => inMultipleValueState ? default : base.value; - set - { - //when actively changing in the drop down, quit mixed value state - if (inMultipleValueState) - inMultipleValueState = false; - base.value = value; - } + set + { + //when actively changing in the drop down, quit mixed value state + if (inMultipleValueState) + inMultipleValueState = false; + base.value = value; + } } } diff --git a/com.unity.render-pipelines.core/Editor/LookDev/DisplayWindow.EnvironmentLibrarySidePanel.cs b/com.unity.render-pipelines.core/Editor/LookDev/DisplayWindow.EnvironmentLibrarySidePanel.cs index 4cf26c45afe..07909f487ad 100644 --- a/com.unity.render-pipelines.core/Editor/LookDev/DisplayWindow.EnvironmentLibrarySidePanel.cs +++ b/com.unity.render-pipelines.core/Editor/LookDev/DisplayWindow.EnvironmentLibrarySidePanel.cs @@ -130,7 +130,7 @@ void CreateEnvironment() }; #else m_EnvironmentList.onItemChosen += obj => - EditorGUIUtility.PingObject(LookDev.currentContext.environmentLibrary ? [(int)obj]); + EditorGUIUtility.PingObject(LookDev.currentContext.environmentLibrary?[(int)obj]); #endif m_NoEnvironmentList = new Label(Style.k_DragAndDropLibrary); m_NoEnvironmentList.style.flexGrow = 1; @@ -217,10 +217,10 @@ void CreateEnvironment() environmentListCreationToolbar.Add(m_LibraryField); environmentListCreationToolbar.Add(new ToolbarButton(() => EnvironmentLibraryCreator.CreateAndAssignTo(m_LibraryField)) - { - text = "New", - tooltip = "Create a new EnvironmentLibrary" - }); + { + text = "New", + tooltip = "Create a new EnvironmentLibrary" + }); m_EnvironmentContainer.Add(listContainer); m_EnvironmentContainer.Add(m_NoEnvironmentList); @@ -305,7 +305,7 @@ DraggingContext StartDragging(VisualElement item, Vector2 worldPosition) void EndDragging(DraggingContext context, Vector2 mouseWorldPosition) { - Environment environment = LookDev.currentContext.environmentLibrary ? [context.draggedIndex]; + Environment environment = LookDev.currentContext.environmentLibrary?[context.draggedIndex]; if (environment == null) return; diff --git a/com.unity.render-pipelines.core/Editor/LookDev/DisplayWindow.cs b/com.unity.render-pipelines.core/Editor/LookDev/DisplayWindow.cs index ee8c36705a2..fdf1e6b82f8 100644 --- a/com.unity.render-pipelines.core/Editor/LookDev/DisplayWindow.cs +++ b/com.unity.render-pipelines.core/Editor/LookDev/DisplayWindow.cs @@ -54,19 +54,19 @@ static partial class Style internal static readonly GUIContent k_WindowTitleAndIcon = EditorGUIUtility.TrTextContentWithIcon("Look Dev", CoreEditorUtils.LoadIcon(k_IconFolder, "LookDev", forceLowRes: true)); - internal static readonly (Texture2D icon, string tooltip)k_Layout1Icon = + internal static readonly (Texture2D icon, string tooltip) k_Layout1Icon = (CoreEditorUtils.LoadIcon(Style.k_IconFolder, "Layout1", forceLowRes: true), "First view"); - internal static readonly (Texture2D icon, string tooltip)k_Layout2Icon = + internal static readonly (Texture2D icon, string tooltip) k_Layout2Icon = (CoreEditorUtils.LoadIcon(Style.k_IconFolder, "Layout2", forceLowRes: true), "Second view"); - internal static readonly (Texture2D icon, string tooltip)k_LayoutVerticalIcon = + internal static readonly (Texture2D icon, string tooltip) k_LayoutVerticalIcon = (CoreEditorUtils.LoadIcon(Style.k_IconFolder, "LayoutVertical", forceLowRes: true), "Both views split vertically"); - internal static readonly (Texture2D icon, string tooltip)k_LayoutHorizontalIcon = + internal static readonly (Texture2D icon, string tooltip) k_LayoutHorizontalIcon = (CoreEditorUtils.LoadIcon(Style.k_IconFolder, "LayoutHorizontal", forceLowRes: true), "Both views split horizontally"); - internal static readonly (Texture2D icon, string tooltip)k_LayoutStackIcon = + internal static readonly (Texture2D icon, string tooltip) k_LayoutStackIcon = (CoreEditorUtils.LoadIcon(Style.k_IconFolder, "LayoutCustom", forceLowRes: true), "Both views stacked"); diff --git a/com.unity.render-pipelines.core/Editor/LookDev/Environment.cs b/com.unity.render-pipelines.core/Editor/LookDev/Environment.cs index 9ab965699db..7b711ab4e05 100644 --- a/com.unity.render-pipelines.core/Editor/LookDev/Environment.cs +++ b/com.unity.render-pipelines.core/Editor/LookDev/Environment.cs @@ -122,11 +122,11 @@ internal void CopyTo(Environment other) /// Editor version of the datas public UnityEngine.Rendering.LookDev.Sky sky => new UnityEngine.Rendering.LookDev.Sky() - { - cubemap = cubemap, - longitudeOffset = rotation, - exposure = exposure - }; + { + cubemap = cubemap, + longitudeOffset = rotation, + exposure = exposure + }; internal static Environment GetTemporaryEnvironmentForCubemap(Cubemap cubemap) { @@ -152,7 +152,7 @@ class EnvironmentEditor : Editor public sealed override VisualElement CreateInspectorGUI() => null; // Don't use ImGUI - public sealed override void OnInspectorGUI() {} + public sealed override void OnInspectorGUI() { } //but make preview in Project window override public Texture2D RenderStaticPreview(string assetPath, UnityEngine.Object[] subAssets, int width, int height) @@ -196,7 +196,7 @@ static Material cubeToLatlongMaterial public Environment target => environment; - public EnvironmentElement() => Create(withPreview : true); + public EnvironmentElement() => Create(withPreview: true); public EnvironmentElement(bool withPreview, Action OnChangeCallback = null) { this.OnChangeCallback = OnChangeCallback; diff --git a/com.unity.render-pipelines.core/Editor/LookDev/EnvironmentLibrary.cs b/com.unity.render-pipelines.core/Editor/LookDev/EnvironmentLibrary.cs index 3e84f031b20..7e5007c7acd 100644 --- a/com.unity.render-pipelines.core/Editor/LookDev/EnvironmentLibrary.cs +++ b/com.unity.render-pipelines.core/Editor/LookDev/EnvironmentLibrary.cs @@ -153,7 +153,7 @@ void Update() } // Don't use ImGUI - public sealed override void OnInspectorGUI() {} + public sealed override void OnInspectorGUI() { } } class EnvironmentLibraryCreator : ProjectWindowCallback.EndNameEditAction diff --git a/com.unity.render-pipelines.core/Editor/LookDev/ToolbarRadio.cs b/com.unity.render-pipelines.core/Editor/LookDev/ToolbarRadio.cs index c218c24c004..cfd19d55c1c 100644 --- a/com.unity.render-pipelines.core/Editor/LookDev/ToolbarRadio.cs +++ b/com.unity.render-pipelines.core/Editor/LookDev/ToolbarRadio.cs @@ -7,8 +7,8 @@ namespace UnityEditor.Rendering.LookDev { class ToolbarRadio : UIElements.Toolbar, INotifyValueChanged { - public new class UxmlFactory : UxmlFactory {} - public new class UxmlTraits : Button.UxmlTraits {} + public new class UxmlFactory : UxmlFactory { } + public new class UxmlTraits : Button.UxmlTraits { } List radios = new List(); @@ -43,7 +43,7 @@ public int value } } - public ToolbarRadio() : this(null, false) {} + public ToolbarRadio() : this(null, false) { } public ToolbarRadio(string label = null, bool canDeselectAll = false) { diff --git a/com.unity.render-pipelines.core/Editor/RenderGraph/RenderGraphViewer.cs b/com.unity.render-pipelines.core/Editor/RenderGraph/RenderGraphViewer.cs index 69deb154187..9c802db062f 100644 --- a/com.unity.render-pipelines.core/Editor/RenderGraph/RenderGraphViewer.cs +++ b/com.unity.render-pipelines.core/Editor/RenderGraph/RenderGraphViewer.cs @@ -23,7 +23,7 @@ public CellElement(int idxStart, int idxEnd) style.borderBottomLeftRadius = style.borderTopLeftRadius = style.borderBottomRightRadius = style.borderTopRightRadius = 5; style.borderBottomWidth = style.borderTopWidth = style.borderLeftWidth = style.borderRightWidth = 1f; style.borderBottomColor = style.borderTopColor = style.borderLeftColor = style.borderRightColor = new Color(0f, 0f, 0f, 1f); - style.backgroundColor = (Color) new Color32(88, 88, 88, 255); + style.backgroundColor = (Color)new Color32(88, 88, 88, 255); style.height = kResourceHeight; style.left = idxStart * kRenderPassWidth; style.width = (idxEnd - idxStart + 1) * kRenderPassWidth; @@ -219,7 +219,7 @@ void MouseLeaveResourceCallback(MouseLeaveEvent evt, (int index, int resourceTyp var resource = m_CurrentRenderGraph.GetDebugData().resourceLists[info.resourceType][info.index]; UpdatePassColor(info, m_OriginalPassColor, m_OriginalPassColor); - UpdateResourceLabelColor(info, resource.imported ? m_ImportedResourceColor : m_OriginalResourceColor);; + UpdateResourceLabelColor(info, resource.imported ? m_ImportedResourceColor : m_OriginalResourceColor); ; } VisualElement CreateRenderPass(string name, int index, bool culled) diff --git a/com.unity.render-pipelines.core/Editor/Volume/VolumeComponentEditor.cs b/com.unity.render-pipelines.core/Editor/Volume/VolumeComponentEditor.cs index 12d4c41bb92..b8d86cb1991 100644 --- a/com.unity.render-pipelines.core/Editor/Volume/VolumeComponentEditor.cs +++ b/com.unity.render-pipelines.core/Editor/Volume/VolumeComponentEditor.cs @@ -249,19 +249,20 @@ public virtual void OnEnable() GetFields(target, fields); m_Parameters = fields - .Select(t => { - var name = ""; - var order = 0; - var attr = (DisplayInfoAttribute[])t.Item1.GetCustomAttributes(typeof(DisplayInfoAttribute), true); - if (attr.Length != 0) + .Select(t => { - name = attr[0].name; - order = attr[0].order; - } + var name = ""; + var order = 0; + var attr = (DisplayInfoAttribute[])t.Item1.GetCustomAttributes(typeof(DisplayInfoAttribute), true); + if (attr.Length != 0) + { + name = attr[0].name; + order = attr[0].order; + } - var parameter = new SerializedDataParameter(t.Item2); - return (new GUIContent(name), order, parameter); - }) + var parameter = new SerializedDataParameter(t.Item2); + return (new GUIContent(name), order, parameter); + }) .OrderBy(t => t.order) .ToList(); } diff --git a/com.unity.render-pipelines.core/Editor/Volume/VolumeComponentProvider.cs b/com.unity.render-pipelines.core/Editor/Volume/VolumeComponentProvider.cs index 661d923896a..146cd9ee05c 100644 --- a/com.unity.render-pipelines.core/Editor/Volume/VolumeComponentProvider.cs +++ b/com.unity.render-pipelines.core/Editor/Volume/VolumeComponentProvider.cs @@ -26,7 +26,7 @@ public VolumeComponentElement(int level, string label, Type type) class PathNode : IComparable { - public List nodes = new List(); + public List nodes = new List(); public string name; public Type type; diff --git a/com.unity.render-pipelines.core/Runtime/Camera/CameraSwitcher.cs b/com.unity.render-pipelines.core/Runtime/Camera/CameraSwitcher.cs index 8f8772bec44..7742e6dc2c7 100644 --- a/com.unity.render-pipelines.core/Runtime/Camera/CameraSwitcher.cs +++ b/com.unity.render-pipelines.core/Runtime/Camera/CameraSwitcher.cs @@ -19,8 +19,8 @@ public class CameraSwitcher : MonoBehaviour private Quaternion m_OriginalCameraRotation; private Camera m_CurrentCamera = null; - GUIContent[] m_CameraNames = null; - int[] m_CameraIndices = null; + GUIContent[] m_CameraNames = null; + int[] m_CameraIndices = null; DebugUI.EnumField m_DebugEntry; diff --git a/com.unity.render-pipelines.core/Runtime/Camera/FreeCamera.cs b/com.unity.render-pipelines.core/Runtime/Camera/FreeCamera.cs index 59dd13d2e3c..7a5afe019cd 100644 --- a/com.unity.render-pipelines.core/Runtime/Camera/FreeCamera.cs +++ b/com.unity.render-pipelines.core/Runtime/Camera/FreeCamera.cs @@ -1,5 +1,5 @@ #if ENABLE_INPUT_SYSTEM && ENABLE_INPUT_SYSTEM_PACKAGE - #define USE_INPUT_SYSTEM +#define USE_INPUT_SYSTEM using UnityEngine.InputSystem; #endif diff --git a/com.unity.render-pipelines.core/Runtime/Common/CommonStructs.cs b/com.unity.render-pipelines.core/Runtime/Common/CommonStructs.cs index 2b38f5f79e4..430024a7173 100644 --- a/com.unity.render-pipelines.core/Runtime/Common/CommonStructs.cs +++ b/com.unity.render-pipelines.core/Runtime/Common/CommonStructs.cs @@ -9,7 +9,7 @@ namespace UnityEngine.Rendering public enum ClearFlag { /// Don't clear. - None = 0, + None = 0, /// Clear the color buffer. Color = 1, /// Clear the depth buffer. diff --git a/com.unity.render-pipelines.core/Runtime/Common/CoreUnsafeUtils.cs b/com.unity.render-pipelines.core/Runtime/Common/CoreUnsafeUtils.cs index e2bb6be8c0f..293d41bbdc5 100644 --- a/com.unity.render-pipelines.core/Runtime/Common/CoreUnsafeUtils.cs +++ b/com.unity.render-pipelines.core/Runtime/Common/CoreUnsafeUtils.cs @@ -158,8 +158,8 @@ public static void CopyTo(this T[] list, void* dest, int count) /// Left boundary. public static unsafe void QuickSort(uint[] arr, int left, int right) { - fixed(uint* ptr = arr) - CoreUnsafeUtils.QuickSort(ptr, left, right); + fixed (uint* ptr = arr) + CoreUnsafeUtils.QuickSort(ptr, left, right); } /// diff --git a/com.unity.render-pipelines.core/Runtime/Common/DynamicResolutionHandler.cs b/com.unity.render-pipelines.core/Runtime/Common/DynamicResolutionHandler.cs index f6723f5fce9..b3055bbf719 100644 --- a/com.unity.render-pipelines.core/Runtime/Common/DynamicResolutionHandler.cs +++ b/com.unity.render-pipelines.core/Runtime/Common/DynamicResolutionHandler.cs @@ -31,7 +31,7 @@ public enum DynamicResScalePolicyType /// public class DynamicResolutionHandler { - private bool m_Enabled; + private bool m_Enabled; private float m_MinScreenFraction; private float m_MaxScreenFraction; private float m_CurrentFraction; @@ -348,7 +348,7 @@ public bool SoftwareDynamicResIsEnabled() /// True: Hardware dynamic resolution is enabled public bool HardwareDynamicResIsEnabled() { - return !m_ForceSoftwareFallback && m_CurrentCameraRequest && m_Enabled && type == DynamicResolutionType.Hardware; + return !m_ForceSoftwareFallback && m_CurrentCameraRequest && m_Enabled && type == DynamicResolutionType.Hardware; } /// diff --git a/com.unity.render-pipelines.core/Runtime/Common/ListBuffer.cs b/com.unity.render-pipelines.core/Runtime/Common/ListBuffer.cs index d43c91544b9..08ee20e7b31 100644 --- a/com.unity.render-pipelines.core/Runtime/Common/ListBuffer.cs +++ b/com.unity.render-pipelines.core/Runtime/Common/ListBuffer.cs @@ -99,7 +99,7 @@ public bool TryAdd(in T value) /// The number of item to copy. public unsafe void CopyTo(T* dstBuffer, int startDstIndex, int copyCount) { - UnsafeUtility.MemCpy(dstBuffer + startDstIndex, m_BufferPtr, + UnsafeUtility.MemCpy(dstBuffer + startDstIndex, m_BufferPtr, UnsafeUtility.SizeOf() * copyCount); } diff --git a/com.unity.render-pipelines.core/Runtime/Common/ObservableList.cs b/com.unity.render-pipelines.core/Runtime/Common/ObservableList.cs index b656630d820..cd05e1afd01 100644 --- a/com.unity.render-pipelines.core/Runtime/Common/ObservableList.cs +++ b/com.unity.render-pipelines.core/Runtime/Common/ObservableList.cs @@ -92,7 +92,7 @@ public bool IsReadOnly /// Default Constructor. /// public ObservableList() - : this(0) {} + : this(0) { } /// /// Constructor. diff --git a/com.unity.render-pipelines.core/Runtime/Common/XRGraphics.cs b/com.unity.render-pipelines.core/Runtime/Common/XRGraphics.cs index 6c88186449e..3424740e0b0 100644 --- a/com.unity.render-pipelines.core/Runtime/Common/XRGraphics.cs +++ b/com.unity.render-pipelines.core/Runtime/Common/XRGraphics.cs @@ -74,11 +74,11 @@ public static bool tryEnable { get { - #if UNITY_2020_1_OR_NEWER +#if UNITY_2020_1_OR_NEWER return false; - #else +#else return UnityEditorInternal.VR.VREditor.GetVREnabledOnTargetGroup(BuildPipeline.GetBuildTargetGroup(EditorUserBuildSettings.activeBuildTarget)); - #endif +#endif } } #endif diff --git a/com.unity.render-pipelines.core/Runtime/Debugging/DebugManager.Actions.cs b/com.unity.render-pipelines.core/Runtime/Debugging/DebugManager.Actions.cs index 8207f1bfa42..2e1e422b8e4 100644 --- a/com.unity.render-pipelines.core/Runtime/Debugging/DebugManager.Actions.cs +++ b/com.unity.render-pipelines.core/Runtime/Debugging/DebugManager.Actions.cs @@ -1,5 +1,5 @@ #if ENABLE_INPUT_SYSTEM && ENABLE_INPUT_SYSTEM_PACKAGE - #define USE_INPUT_SYSTEM +#define USE_INPUT_SYSTEM using UnityEngine.InputSystem; using UnityEngine.InputSystem.Controls; #endif @@ -30,17 +30,17 @@ enum DebugActionRepeatMode public sealed partial class DebugManager { - const string kEnableDebugBtn1 = "Enable Debug Button 1"; - const string kEnableDebugBtn2 = "Enable Debug Button 2"; + const string kEnableDebugBtn1 = "Enable Debug Button 1"; + const string kEnableDebugBtn2 = "Enable Debug Button 2"; const string kDebugPreviousBtn = "Debug Previous"; - const string kDebugNextBtn = "Debug Next"; - const string kValidateBtn = "Debug Validate"; - const string kPersistentBtn = "Debug Persistent"; - const string kDPadVertical = "Debug Vertical"; - const string kDPadHorizontal = "Debug Horizontal"; - const string kMultiplierBtn = "Debug Multiplier"; - const string kResetBtn = "Debug Reset"; - const string kEnableDebug = "Enable Debug"; + const string kDebugNextBtn = "Debug Next"; + const string kValidateBtn = "Debug Validate"; + const string kPersistentBtn = "Debug Persistent"; + const string kDPadVertical = "Debug Vertical"; + const string kDPadHorizontal = "Debug Horizontal"; + const string kMultiplierBtn = "Debug Multiplier"; + const string kResetBtn = "Debug Reset"; + const string kEnableDebug = "Enable Debug"; DebugActionDesc[] m_DebugActions; DebugActionState[] m_DebugActionStates; @@ -159,7 +159,7 @@ void SampleAction(int actionIndex) var desc = m_DebugActions[actionIndex]; var state = m_DebugActionStates[actionIndex]; -// Disable all input events if we're using the new input system + // Disable all input events if we're using the new input system #if USE_INPUT_SYSTEM if (state.runningAction == false) { diff --git a/com.unity.render-pipelines.core/Runtime/Debugging/DebugManager.cs b/com.unity.render-pipelines.core/Runtime/Debugging/DebugManager.cs index 9a902473b96..5d4c88f8023 100644 --- a/com.unity.render-pipelines.core/Runtime/Debugging/DebugManager.cs +++ b/com.unity.render-pipelines.core/Runtime/Debugging/DebugManager.cs @@ -56,11 +56,11 @@ public ReadOnlyCollection panels /// /// Callback called when the runtime UI changed. /// - public event Action onDisplayRuntimeUIChanged = delegate {}; + public event Action onDisplayRuntimeUIChanged = delegate { }; /// /// Callback called when the debug window is dirty. /// - public event Action onSetDirty = delegate {}; + public event Action onSetDirty = delegate { }; event Action resetData; diff --git a/com.unity.render-pipelines.core/Runtime/Debugging/DebugShapes.cs b/com.unity.render-pipelines.core/Runtime/Debugging/DebugShapes.cs index e1407069f33..c3c97dc0f76 100644 --- a/com.unity.render-pipelines.core/Runtime/Debugging/DebugShapes.cs +++ b/com.unity.render-pipelines.core/Runtime/Debugging/DebugShapes.cs @@ -248,7 +248,7 @@ void BuildCone(ref Mesh outputMesh, float height, float topRadius, float bottomR } // Top cap - vertices[vert++] = new Vector3(0f, 0f , height); + vertices[vert++] = new Vector3(0f, 0f, height); while (vert <= nbSides * 2 + 1) { float rad = (float)(vert - nbSides - 1) / nbSides * _2pi; diff --git a/com.unity.render-pipelines.core/Runtime/Debugging/DebugUI.Containers.cs b/com.unity.render-pipelines.core/Runtime/Debugging/DebugUI.Containers.cs index d5727cb2b6e..ce2aad6b1bd 100644 --- a/com.unity.render-pipelines.core/Runtime/Debugging/DebugUI.Containers.cs +++ b/com.unity.render-pipelines.core/Runtime/Debugging/DebugUI.Containers.cs @@ -133,7 +133,7 @@ public class Foldout : Container, IValueField /// /// Constructor. /// - public Foldout() : base() {} + public Foldout() : base() { } /// /// Constructor. /// diff --git a/com.unity.render-pipelines.core/Runtime/Debugging/DebugUI.Fields.cs b/com.unity.render-pipelines.core/Runtime/Debugging/DebugUI.Fields.cs index 064c491ac81..d2005a63f8a 100644 --- a/com.unity.render-pipelines.core/Runtime/Debugging/DebugUI.Fields.cs +++ b/com.unity.render-pipelines.core/Runtime/Debugging/DebugUI.Fields.cs @@ -98,7 +98,7 @@ public void SetValue(T value) /// /// Boolean field. /// - public class BoolField : Field {} + public class BoolField : Field { } /// /// Boolean field with history. /// diff --git a/com.unity.render-pipelines.core/Runtime/Debugging/DebugUI.Panel.cs b/com.unity.render-pipelines.core/Runtime/Debugging/DebugUI.Panel.cs index cca384696ce..aacb2402369 100644 --- a/com.unity.render-pipelines.core/Runtime/Debugging/DebugUI.Panel.cs +++ b/com.unity.render-pipelines.core/Runtime/Debugging/DebugUI.Panel.cs @@ -52,7 +52,7 @@ public class Panel : IContainer, IComparable /// /// Callback used when the panel is set dirty. /// - public event Action onSetDirty = delegate {}; + public event Action onSetDirty = delegate { }; /// /// Constructor. diff --git a/com.unity.render-pipelines.core/Runtime/Debugging/DebugUI.cs b/com.unity.render-pipelines.core/Runtime/Debugging/DebugUI.cs index 0ec67ab0630..5a8bf66a64f 100644 --- a/com.unity.render-pipelines.core/Runtime/Debugging/DebugUI.cs +++ b/com.unity.render-pipelines.core/Runtime/Debugging/DebugUI.cs @@ -17,11 +17,11 @@ public enum Flags /// /// None. /// - None = 0, + None = 0, /// /// This widget is Editor only. /// - EditorOnly = 1 << 1, + EditorOnly = 1 << 1, /// /// This widget is Runtime only. /// diff --git a/com.unity.render-pipelines.core/Runtime/Debugging/MousePositionDebug.cs b/com.unity.render-pipelines.core/Runtime/Debugging/MousePositionDebug.cs index 18704267d1a..04618935380 100644 --- a/com.unity.render-pipelines.core/Runtime/Debugging/MousePositionDebug.cs +++ b/com.unity.render-pipelines.core/Runtime/Debugging/MousePositionDebug.cs @@ -1,5 +1,5 @@ #if ENABLE_INPUT_SYSTEM && ENABLE_INPUT_SYSTEM_PACKAGE - #define USE_INPUT_SYSTEM +#define USE_INPUT_SYSTEM using UnityEngine.InputSystem; using UnityEngine.InputSystem.Controls; #endif diff --git a/com.unity.render-pipelines.core/Runtime/Debugging/Prefabs/Scripts/DebugUIHandlerWidget.cs b/com.unity.render-pipelines.core/Runtime/Debugging/Prefabs/Scripts/DebugUIHandlerWidget.cs index ebf03dcc3c0..4d78428f16e 100644 --- a/com.unity.render-pipelines.core/Runtime/Debugging/Prefabs/Scripts/DebugUIHandlerWidget.cs +++ b/com.unity.render-pipelines.core/Runtime/Debugging/Prefabs/Scripts/DebugUIHandlerWidget.cs @@ -40,7 +40,7 @@ public class DebugUIHandlerWidget : MonoBehaviour /// /// OnEnable implementation. /// - protected virtual void OnEnable() {} + protected virtual void OnEnable() { } internal virtual void SetWidget(DebugUI.Widget widget) { @@ -83,24 +83,24 @@ public virtual bool OnSelection(bool fromNext, DebugUIHandlerWidget previous) /// /// OnDeselection implementation. /// - public virtual void OnDeselection() {} + public virtual void OnDeselection() { } /// /// OnAction implementation. /// - public virtual void OnAction() {} + public virtual void OnAction() { } /// /// OnIncrement implementation. /// /// True if incrementing fast. - public virtual void OnIncrement(bool fast) {} + public virtual void OnIncrement(bool fast) { } /// /// OnDecrement implementation. /// /// Trye if decrementing fast. - public virtual void OnDecrement(bool fast) {} + public virtual void OnDecrement(bool fast) { } /// /// Previous implementation. diff --git a/com.unity.render-pipelines.core/Runtime/Debugging/ProfilingScope.cs b/com.unity.render-pipelines.core/Runtime/Debugging/ProfilingScope.cs index 91b85ed7ca0..3303250e4ee 100644 --- a/com.unity.render-pipelines.core/Runtime/Debugging/ProfilingScope.cs +++ b/com.unity.render-pipelines.core/Runtime/Debugging/ProfilingScope.cs @@ -214,7 +214,7 @@ public bool enableRecording public int inlineCpuSampleCount => 0; #endif // Keep the constructor private - ProfilingSampler() {} + ProfilingSampler() { } } #if DEVELOPMENT_BUILD || UNITY_EDITOR diff --git a/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraph.cs b/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraph.cs index 405830387e9..4b04af59342 100644 --- a/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraph.cs +++ b/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraph.cs @@ -25,13 +25,13 @@ public enum DepthAccess public class RenderGraphContext { ///Scriptable Render Context used for rendering. - public ScriptableRenderContext renderContext; + public ScriptableRenderContext renderContext; ///Command Buffer used for rendering. - public CommandBuffer cmd; + public CommandBuffer cmd; ///Render Graph pooll used for temporary data. - public RenderGraphObjectPool renderGraphPool; + public RenderGraphObjectPool renderGraphPool; ///Render Graph default resources. - public RenderGraphDefaultResources defaultResources; + public RenderGraphDefaultResources defaultResources; } /// @@ -70,9 +70,9 @@ public void RegisterDebug(string name) action = () => { logFrameInformation = true; - #if UNITY_EDITOR +#if UNITY_EDITOR UnityEditor.SceneView.RepaintAll(); - #endif +#endif } }); list.Add(new DebugUI.Button @@ -81,9 +81,9 @@ public void RegisterDebug(string name) action = () => { logResources = true; - #if UNITY_EDITOR +#if UNITY_EDITOR UnityEditor.SceneView.RepaintAll(); - #endif +#endif } }); @@ -159,9 +159,9 @@ public class RenderGraph internal struct CompiledResourceInfo { - public List producers; - public List consumers; - public int refCount; + public List producers; + public List consumers; + public int refCount; public void Reset() { @@ -179,19 +179,19 @@ public void Reset() [DebuggerDisplay("RenderPass: {pass.name} (Index:{pass.index} Async:{enableAsyncCompute})")] internal struct CompiledPassInfo { - public RenderGraphPass pass; - public List[] resourceCreateList; - public List[] resourceReleaseList; - public int refCount; - public bool culled; - public bool hasSideEffect; - public int syncToPassIndex; // Index of the pass that needs to be waited for. - public int syncFromPassIndex; // Smaller pass index that waits for this pass. - public bool needGraphicsFence; - public GraphicsFence fence; + public RenderGraphPass pass; + public List[] resourceCreateList; + public List[] resourceReleaseList; + public int refCount; + public bool culled; + public bool hasSideEffect; + public int syncToPassIndex; // Index of the pass that needs to be waited for. + public int syncFromPassIndex; // Smaller pass index that waits for this pass. + public bool needGraphicsFence; + public GraphicsFence fence; - public bool enableAsyncCompute; - public bool allowPassCulling { get { return pass.allowPassCulling; } } + public bool enableAsyncCompute; + public bool allowPassCulling { get { return pass.allowPassCulling; } } #if DEVELOPMENT_BUILD || UNITY_EDITOR // This members are only here to ease debugging. @@ -248,32 +248,32 @@ public void Reset(RenderGraphPass pass) } } - RenderGraphResourceRegistry m_Resources; - RenderGraphObjectPool m_RenderGraphPool = new RenderGraphObjectPool(); - List m_RenderPasses = new List(64); - List m_RendererLists = new List(32); - RenderGraphDebugParams m_DebugParameters = new RenderGraphDebugParams(); - RenderGraphLogger m_Logger = new RenderGraphLogger(); - RenderGraphDefaultResources m_DefaultResources = new RenderGraphDefaultResources(); - Dictionary m_DefaultProfilingSamplers = new Dictionary(); - bool m_ExecutionExceptionWasRaised; - RenderGraphContext m_RenderGraphContext = new RenderGraphContext(); - CommandBuffer m_PreviousCommandBuffer; - int m_CurrentImmediatePassIndex; - List[] m_ImmediateModeResourceList = new List[(int)RenderGraphResourceType.Count]; + RenderGraphResourceRegistry m_Resources; + RenderGraphObjectPool m_RenderGraphPool = new RenderGraphObjectPool(); + List m_RenderPasses = new List(64); + List m_RendererLists = new List(32); + RenderGraphDebugParams m_DebugParameters = new RenderGraphDebugParams(); + RenderGraphLogger m_Logger = new RenderGraphLogger(); + RenderGraphDefaultResources m_DefaultResources = new RenderGraphDefaultResources(); + Dictionary m_DefaultProfilingSamplers = new Dictionary(); + bool m_ExecutionExceptionWasRaised; + RenderGraphContext m_RenderGraphContext = new RenderGraphContext(); + CommandBuffer m_PreviousCommandBuffer; + int m_CurrentImmediatePassIndex; + List[] m_ImmediateModeResourceList = new List[(int)RenderGraphResourceType.Count]; // Compiled Render Graph info. - DynamicArray[] m_CompiledResourcesInfos = new DynamicArray[(int)RenderGraphResourceType.Count]; - DynamicArray m_CompiledPassInfos = new DynamicArray(); - Stack m_CullingStack = new Stack(); + DynamicArray[] m_CompiledResourcesInfos = new DynamicArray[(int)RenderGraphResourceType.Count]; + DynamicArray m_CompiledPassInfos = new DynamicArray(); + Stack m_CullingStack = new Stack(); - int m_ExecutionCount; - int m_CurrentFrameIndex; - bool m_HasRenderGraphBegun; - RenderGraphDebugData m_RenderGraphDebugData = new RenderGraphDebugData(); + int m_ExecutionCount; + int m_CurrentFrameIndex; + bool m_HasRenderGraphBegun; + RenderGraphDebugData m_RenderGraphDebugData = new RenderGraphDebugData(); // Global list of living render graphs - static List s_RegisteredGraphs = new List(); + static List s_RegisteredGraphs = new List(); #region Public Interface /// Name of the Render Graph. @@ -657,7 +657,7 @@ public void EndProfilingSampler(ProfilingSampler sampler) #endregion #region Internal Interface - internal static List GetRegisteredRenderGraphs() + internal static List GetRegisteredRenderGraphs() { return s_RegisteredGraphs; } diff --git a/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraphBuilder.cs b/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraphBuilder.cs index 1c6bd482766..72c18a200da 100644 --- a/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraphBuilder.cs +++ b/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraphBuilder.cs @@ -9,10 +9,10 @@ namespace UnityEngine.Experimental.Rendering.RenderGraphModule /// public struct RenderGraphBuilder : IDisposable { - RenderGraphPass m_RenderPass; + RenderGraphPass m_RenderPass; RenderGraphResourceRegistry m_Resources; - RenderGraph m_RenderGraph; - bool m_Disposed; + RenderGraph m_RenderGraph; + bool m_Disposed; #region Public Interface /// diff --git a/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraphLogger.cs b/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraphLogger.cs index df946c91743..985410ca05a 100644 --- a/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraphLogger.cs +++ b/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraphLogger.cs @@ -5,9 +5,9 @@ namespace UnityEngine.Experimental.Rendering.RenderGraphModule { struct RenderGraphLogIndent : IDisposable { - int m_Indentation; - RenderGraphLogger m_Logger; - bool m_Disposed; + int m_Indentation; + RenderGraphLogger m_Logger; + bool m_Disposed; public RenderGraphLogIndent(RenderGraphLogger logger, int indentation = 1) { @@ -41,8 +41,8 @@ void Dispose(bool disposing) class RenderGraphLogger { - StringBuilder m_Builder = new StringBuilder(); - int m_CurrentIndentation; + StringBuilder m_Builder = new StringBuilder(); + int m_CurrentIndentation; public void Initialize() { diff --git a/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraphObjectPool.cs b/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraphObjectPool.cs index c30f3911517..a9456f82ffa 100644 --- a/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraphObjectPool.cs +++ b/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraphObjectPool.cs @@ -28,11 +28,11 @@ public void Release(T value) public static SharedObjectPool sharedPool => s_Instance.Value; } - Dictionary<(Type, int), Stack> m_ArrayPool = new Dictionary<(Type, int), Stack>(); - List<(object, (Type, int))> m_AllocatedArrays = new List<(object, (Type, int))>(); - List m_AllocatedMaterialPropertyBlocks = new List(); + Dictionary<(Type, int), Stack> m_ArrayPool = new Dictionary<(Type, int), Stack>(); + List<(object, (Type, int))> m_AllocatedArrays = new List<(object, (Type, int))>(); + List m_AllocatedMaterialPropertyBlocks = new List(); - internal RenderGraphObjectPool() {} + internal RenderGraphObjectPool() { } /// /// Allocate a temporary typed array of a specific size. diff --git a/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraphPass.cs b/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraphPass.cs index 5ad920a3bb8..d173231169c 100644 --- a/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraphPass.cs +++ b/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraphPass.cs @@ -9,23 +9,23 @@ namespace UnityEngine.Experimental.Rendering.RenderGraphModule abstract class RenderGraphPass { public RenderFunc GetExecuteDelegate() - where PassData : class, new() => ((RenderGraphPass) this).renderFunc; + where PassData : class, new() => ((RenderGraphPass)this).renderFunc; public abstract void Execute(RenderGraphContext renderGraphContext); public abstract void Release(RenderGraphObjectPool pool); public abstract bool HasRenderFunc(); - public string name { get; protected set; } - public int index { get; protected set; } + public string name { get; protected set; } + public int index { get; protected set; } public ProfilingSampler customSampler { get; protected set; } - public bool enableAsyncCompute { get; protected set; } - public bool allowPassCulling { get; protected set; } - - public TextureHandle depthBuffer { get; protected set; } - public TextureHandle[] colorBuffers { get; protected set; } = new TextureHandle[RenderGraph.kMaxMRTCount]; - public int colorBufferMaxIndex { get; protected set; } = -1; - public int refCount { get; protected set; } - public bool generateDebugData { get; protected set; } + public bool enableAsyncCompute { get; protected set; } + public bool allowPassCulling { get; protected set; } + + public TextureHandle depthBuffer { get; protected set; } + public TextureHandle[] colorBuffers { get; protected set; } = new TextureHandle[RenderGraph.kMaxMRTCount]; + public int colorBufferMaxIndex { get; protected set; } = -1; + public int refCount { get; protected set; } + public bool generateDebugData { get; protected set; } public List[] resourceReadLists = new List[(int)RenderGraphResourceType.Count]; public List[] resourceWriteLists = new List[(int)RenderGraphResourceType.Count]; diff --git a/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraphResourcePool.cs b/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraphResourcePool.cs index cf34b338fa0..3d8fbe94693 100644 --- a/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraphResourcePool.cs +++ b/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraphResourcePool.cs @@ -14,7 +14,7 @@ abstract class IRenderGraphResourcePool abstract class RenderGraphResourcePool : IRenderGraphResourcePool where Type : class { // Dictionary tracks resources by hash and stores resources with same hash in a List (list instead of a stack because we need to be able to remove stale allocations, potentially in the middle of the stack). - protected Dictionary> m_ResourcePool = new Dictionary>(); + protected Dictionary> m_ResourcePool = new Dictionary>(); // This list allows us to determine if all resources were correctly released in the frame. // This is useful to warn in case of user error or avoid leaks when a render graph execution errors occurs for example. diff --git a/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraphResourceRegistry.cs b/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraphResourceRegistry.cs index 4da25542104..7dcbf736d40 100644 --- a/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraphResourceRegistry.cs +++ b/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraphResourceRegistry.cs @@ -33,11 +33,11 @@ internal static RenderGraphResourceRegistry current class RenderGraphResourcesData { - public DynamicArray resourceArray = new DynamicArray(); - public int sharedResourcesCount; - public IRenderGraphResourcePool pool; - public ResourceCallback createResourceCallback; - public ResourceCallback releaseResourceCallback; + public DynamicArray resourceArray = new DynamicArray(); + public int sharedResourcesCount; + public IRenderGraphResourcePool pool; + public ResourceCallback createResourceCallback; + public ResourceCallback releaseResourceCallback; public void Clear(bool onException, int frameIndex) { @@ -80,14 +80,14 @@ public int AddNewRenderGraphResource(out ResType outRes, bool pooledRes } } - RenderGraphResourcesData[] m_RenderGraphResources = new RenderGraphResourcesData[(int)RenderGraphResourceType.Count]; - DynamicArray m_RendererListResources = new DynamicArray(); - RenderGraphDebugParams m_RenderGraphDebug; - RenderGraphLogger m_Logger; - int m_CurrentFrameIndex; - int m_ExecutionCount; + RenderGraphResourcesData[] m_RenderGraphResources = new RenderGraphResourcesData[(int)RenderGraphResourceType.Count]; + DynamicArray m_RendererListResources = new DynamicArray(); + RenderGraphDebugParams m_RenderGraphDebug; + RenderGraphLogger m_Logger; + int m_CurrentFrameIndex; + int m_ExecutionCount; - RTHandle m_CurrentBackbuffer; + RTHandle m_CurrentBackbuffer; #region Internal Interface internal RTHandle GetTexture(in TextureHandle handle) diff --git a/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraphResources.cs b/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraphResources.cs index 755b8f407d2..d081b4245a1 100644 --- a/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraphResources.cs +++ b/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraphResources.cs @@ -107,12 +107,12 @@ public virtual bool NeedsFallBack() return requestFallBack && writeCount == 0; } - public virtual void CreatePooledGraphicsResource() {} - public virtual void CreateGraphicsResource(string name = "") {} - public virtual void ReleasePooledGraphicsResource(int frameIndex) {} - public virtual void ReleaseGraphicsResource() {} - public virtual void LogCreation(RenderGraphLogger logger) {} - public virtual void LogRelease(RenderGraphLogger logger) {} + public virtual void CreatePooledGraphicsResource() { } + public virtual void CreateGraphicsResource(string name = "") { } + public virtual void ReleasePooledGraphicsResource(int frameIndex) { } + public virtual void ReleaseGraphicsResource() { } + public virtual void LogCreation(RenderGraphLogger logger) { } + public virtual void LogRelease(RenderGraphLogger logger) { } } [DebuggerDisplay("Resource ({GetType().Name}:{GetName()})")] diff --git a/com.unity.render-pipelines.core/Runtime/RendererList/RendererList.cs b/com.unity.render-pipelines.core/Runtime/RendererList/RendererList.cs index 9b45bdfa210..9cff642d0f3 100644 --- a/com.unity.render-pipelines.core/Runtime/RendererList/RendererList.cs +++ b/com.unity.render-pipelines.core/Runtime/RendererList/RendererList.cs @@ -20,23 +20,23 @@ public struct RendererList /// /// True if the renderer list is valid. /// - public bool isValid { get; private set; } + public bool isValid { get; private set; } /// /// CullingResults associated with the renderer list. /// - public CullingResults cullingResult; + public CullingResults cullingResult; /// /// DrawingSettings associated with the renderer list. /// - public DrawingSettings drawSettings; + public DrawingSettings drawSettings; /// /// FilteringSettings associated with the renderer list. /// - public FilteringSettings filteringSettings; + public FilteringSettings filteringSettings; /// /// Optional RenderStateBlock associated with the renderer list. /// - public RenderStateBlock? stateBlock; + public RenderStateBlock? stateBlock; /// /// Creates a new renderer list. diff --git a/com.unity.render-pipelines.core/Runtime/Textures/RTHandle.cs b/com.unity.render-pipelines.core/Runtime/Textures/RTHandle.cs index d9b3ea7fc5f..2bdd99a7290 100644 --- a/com.unity.render-pipelines.core/Runtime/Textures/RTHandle.cs +++ b/com.unity.render-pipelines.core/Runtime/Textures/RTHandle.cs @@ -10,14 +10,14 @@ namespace UnityEngine.Rendering /// public class RTHandle { - internal RTHandleSystem m_Owner; - internal RenderTexture m_RT; - internal Texture m_ExternalTexture; - internal RenderTargetIdentifier m_NameID; - internal bool m_EnableMSAA = false; - internal bool m_EnableRandomWrite = false; - internal bool m_EnableHWDynamicScale = false; - internal string m_Name; + internal RTHandleSystem m_Owner; + internal RenderTexture m_RT; + internal Texture m_ExternalTexture; + internal RenderTargetIdentifier m_NameID; + internal bool m_EnableMSAA = false; + internal bool m_EnableRandomWrite = false; + internal bool m_EnableHWDynamicScale = false; + internal string m_Name; /// /// Scale factor applied to the RTHandle reference size. @@ -28,15 +28,15 @@ public class RTHandle /// /// Returns true if the RTHandle uses automatic scaling. /// - public bool useScaling { get; internal set; } + public bool useScaling { get; internal set; } /// /// Reference size of the RTHandle System associated with the RTHandle /// - public Vector2Int referenceSize {get; internal set; } + public Vector2Int referenceSize { get; internal set; } /// /// Current properties of the RTHandle System /// - public RTHandleProperties rtHandleProperties { get { return m_Owner.rtHandleProperties; } } + public RTHandleProperties rtHandleProperties { get { return m_Owner.rtHandleProperties; } } /// /// RenderTexture associated with the RTHandle /// @@ -103,7 +103,7 @@ public static implicit operator RenderTexture(RTHandle handle) internal void SetRenderTexture(RenderTexture rt) { - m_RT = rt; + m_RT = rt; m_ExternalTexture = null; m_NameID = new RenderTargetIdentifier(rt); } diff --git a/com.unity.render-pipelines.core/Runtime/Textures/RTHandleSystem.cs b/com.unity.render-pipelines.core/Runtime/Textures/RTHandleSystem.cs index 48ff4f94a95..2de8ced06ca 100644 --- a/com.unity.render-pipelines.core/Runtime/Textures/RTHandleSystem.cs +++ b/com.unity.render-pipelines.core/Runtime/Textures/RTHandleSystem.cs @@ -52,13 +52,13 @@ internal enum ResizeMode } // Parameters for auto-scaled Render Textures - bool m_HardwareDynamicResRequested = false; - bool m_ScaledRTSupportsMSAA = false; - MSAASamples m_ScaledRTCurrentMSAASamples = MSAASamples.None; - HashSet m_AutoSizedRTs; - RTHandle[] m_AutoSizedRTsArray; // For fast iteration - HashSet m_ResizeOnDemandRTs; - RTHandleProperties m_RTHandleProperties; + bool m_HardwareDynamicResRequested = false; + bool m_ScaledRTSupportsMSAA = false; + MSAASamples m_ScaledRTCurrentMSAASamples = MSAASamples.None; + HashSet m_AutoSizedRTs; + RTHandle[] m_AutoSizedRTsArray; // For fast iteration + HashSet m_ResizeOnDemandRTs; + RTHandleProperties m_RTHandleProperties; /// /// Current properties of the RTHandle System. diff --git a/com.unity.render-pipelines.core/Runtime/Textures/TextureXR.cs b/com.unity.render-pipelines.core/Runtime/Textures/TextureXR.cs index eb84a243ed9..ae1028affce 100644 --- a/com.unity.render-pipelines.core/Runtime/Textures/TextureXR.cs +++ b/com.unity.render-pipelines.core/Runtime/Textures/TextureXR.cs @@ -62,42 +62,42 @@ public static TextureDimension dimension } // Need to keep both the Texture and the RTHandle in order to be able to track lifetime properly. - static Texture m_BlackUIntTexture2DArray; - static Texture m_BlackUIntTexture; - static RTHandle m_BlackUIntTexture2DArrayRTH; - static RTHandle m_BlackUIntTextureRTH; + static Texture m_BlackUIntTexture2DArray; + static Texture m_BlackUIntTexture; + static RTHandle m_BlackUIntTexture2DArrayRTH; + static RTHandle m_BlackUIntTextureRTH; /// /// Default black unsigned integer texture. /// /// The default black unsigned integer texture. - public static RTHandle GetBlackUIntTexture() { return useTexArray ? m_BlackUIntTexture2DArrayRTH : m_BlackUIntTextureRTH; } + public static RTHandle GetBlackUIntTexture() { return useTexArray ? m_BlackUIntTexture2DArrayRTH : m_BlackUIntTextureRTH; } - static Texture2DArray m_ClearTexture2DArray; - static Texture2D m_ClearTexture; - static RTHandle m_ClearTexture2DArrayRTH; - static RTHandle m_ClearTextureRTH; + static Texture2DArray m_ClearTexture2DArray; + static Texture2D m_ClearTexture; + static RTHandle m_ClearTexture2DArrayRTH; + static RTHandle m_ClearTextureRTH; /// /// Default clear color (0, 0, 0, 1) texture. /// /// The default clear color texture. public static RTHandle GetClearTexture() { return useTexArray ? m_ClearTexture2DArrayRTH : m_ClearTextureRTH; } - static Texture2DArray m_MagentaTexture2DArray; - static Texture2D m_MagentaTexture; - static RTHandle m_MagentaTexture2DArrayRTH; - static RTHandle m_MagentaTextureRTH; + static Texture2DArray m_MagentaTexture2DArray; + static Texture2D m_MagentaTexture; + static RTHandle m_MagentaTexture2DArrayRTH; + static RTHandle m_MagentaTextureRTH; /// /// Default magenta texture. /// /// The default magenta texture. public static RTHandle GetMagentaTexture() { return useTexArray ? m_MagentaTexture2DArrayRTH : m_MagentaTextureRTH; } - static Texture2D m_BlackTexture; - static Texture3D m_BlackTexture3D; - static Texture2DArray m_BlackTexture2DArray; - static RTHandle m_BlackTexture2DArrayRTH; - static RTHandle m_BlackTextureRTH; - static RTHandle m_BlackTexture3DRTH; + static Texture2D m_BlackTexture; + static Texture3D m_BlackTexture3D; + static Texture2DArray m_BlackTexture2DArray; + static RTHandle m_BlackTexture2DArrayRTH; + static RTHandle m_BlackTextureRTH; + static RTHandle m_BlackTexture3DRTH; /// /// Default black texture. /// @@ -114,9 +114,9 @@ public static TextureDimension dimension /// The default black texture 3D. public static RTHandle GetBlackTexture3D() { return m_BlackTexture3DRTH; } - static Texture2DArray m_WhiteTexture2DArray; - static RTHandle m_WhiteTexture2DArrayRTH; - static RTHandle m_WhiteTextureRTH; + static Texture2DArray m_WhiteTexture2DArray; + static RTHandle m_WhiteTexture2DArrayRTH; + static RTHandle m_WhiteTextureRTH; /// /// Default white texture. /// diff --git a/com.unity.render-pipelines.core/Runtime/Utilities/BitArray.cs b/com.unity.render-pipelines.core/Runtime/Utilities/BitArray.cs index 0632f5972d2..cf40bf7fb46 100644 --- a/com.unity.render-pipelines.core/Runtime/Utilities/BitArray.cs +++ b/com.unity.render-pipelines.core/Runtime/Utilities/BitArray.cs @@ -104,21 +104,21 @@ public BitArray8(IEnumerable bitIndexTrue) /// /// Bit array with which to do the operation. /// The resulting bit array. - public static BitArray8 operator~(BitArray8 a) => new BitArray8((byte)~a.data); + public static BitArray8 operator ~(BitArray8 a) => new BitArray8((byte)~a.data); /// /// Bit-wise Or operator /// /// First bit array. /// Second bit array. /// The resulting bit array. - public static BitArray8 operator|(BitArray8 a, BitArray8 b) => new BitArray8((byte)(a.data | b.data)); + public static BitArray8 operator |(BitArray8 a, BitArray8 b) => new BitArray8((byte)(a.data | b.data)); /// /// Bit-wise And operator /// /// First bit array. /// Second bit array. /// The resulting bit array. - public static BitArray8 operator&(BitArray8 a, BitArray8 b) => new BitArray8((byte)(a.data & b.data)); + public static BitArray8 operator &(BitArray8 a, BitArray8 b) => new BitArray8((byte)(a.data & b.data)); /// /// Bit-wise And @@ -144,14 +144,14 @@ public BitArray8(IEnumerable bitIndexTrue) /// First bit array. /// Second bit array. /// True if both bit arrays are equals. - public static bool operator==(BitArray8 a, BitArray8 b) => a.data == b.data; + public static bool operator ==(BitArray8 a, BitArray8 b) => a.data == b.data; /// /// Inequality operator. /// /// First bit array. /// Second bit array. /// True if the bit arrays are not equals. - public static bool operator!=(BitArray8 a, BitArray8 b) => a.data != b.data; + public static bool operator !=(BitArray8 a, BitArray8 b) => a.data != b.data; /// /// Equality operator. /// @@ -223,21 +223,21 @@ public BitArray16(IEnumerable bitIndexTrue) /// /// Bit array with which to do the operation. /// The resulting bit array. - public static BitArray16 operator~(BitArray16 a) => new BitArray16((ushort)~a.data); + public static BitArray16 operator ~(BitArray16 a) => new BitArray16((ushort)~a.data); /// /// Bit-wise Or operator /// /// First bit array. /// Second bit array. /// The resulting bit array. - public static BitArray16 operator|(BitArray16 a, BitArray16 b) => new BitArray16((ushort)(a.data | b.data)); + public static BitArray16 operator |(BitArray16 a, BitArray16 b) => new BitArray16((ushort)(a.data | b.data)); /// /// Bit-wise And operator /// /// First bit array. /// Second bit array. /// The resulting bit array. - public static BitArray16 operator&(BitArray16 a, BitArray16 b) => new BitArray16((ushort)(a.data & b.data)); + public static BitArray16 operator &(BitArray16 a, BitArray16 b) => new BitArray16((ushort)(a.data & b.data)); /// /// Bit-wise And @@ -263,14 +263,14 @@ public BitArray16(IEnumerable bitIndexTrue) /// First bit array. /// Second bit array. /// True if both bit arrays are equals. - public static bool operator==(BitArray16 a, BitArray16 b) => a.data == b.data; + public static bool operator ==(BitArray16 a, BitArray16 b) => a.data == b.data; /// /// Inequality operator. /// /// First bit array. /// Second bit array. /// True if the bit arrays are not equals. - public static bool operator!=(BitArray16 a, BitArray16 b) => a.data != b.data; + public static bool operator !=(BitArray16 a, BitArray16 b) => a.data != b.data; /// /// Equality operator. /// @@ -361,21 +361,21 @@ public BitArray32(IEnumerable bitIndexTrue) /// /// Bit array with which to do the operation. /// The resulting bit array. - public static BitArray32 operator~(BitArray32 a) => new BitArray32(~a.data); + public static BitArray32 operator ~(BitArray32 a) => new BitArray32(~a.data); /// /// Bit-wise Or operator /// /// First bit array. /// Second bit array. /// The resulting bit array. - public static BitArray32 operator|(BitArray32 a, BitArray32 b) => new BitArray32(a.data | b.data); + public static BitArray32 operator |(BitArray32 a, BitArray32 b) => new BitArray32(a.data | b.data); /// /// Bit-wise And operator /// /// First bit array. /// Second bit array. /// The resulting bit array. - public static BitArray32 operator&(BitArray32 a, BitArray32 b) => new BitArray32(a.data & b.data); + public static BitArray32 operator &(BitArray32 a, BitArray32 b) => new BitArray32(a.data & b.data); /// /// Equality operator. @@ -383,14 +383,14 @@ public BitArray32(IEnumerable bitIndexTrue) /// First bit array. /// Second bit array. /// True if both bit arrays are equals. - public static bool operator==(BitArray32 a, BitArray32 b) => a.data == b.data; + public static bool operator ==(BitArray32 a, BitArray32 b) => a.data == b.data; /// /// Inequality operator. /// /// First bit array. /// Second bit array. /// True if the bit arrays are not equals. - public static bool operator!=(BitArray32 a, BitArray32 b) => a.data != b.data; + public static bool operator !=(BitArray32 a, BitArray32 b) => a.data != b.data; /// /// Equality operator. /// @@ -462,21 +462,21 @@ public BitArray64(IEnumerable bitIndexTrue) /// /// Bit array with which to do the operation. /// The resulting bit array. - public static BitArray64 operator~(BitArray64 a) => new BitArray64(~a.data); + public static BitArray64 operator ~(BitArray64 a) => new BitArray64(~a.data); /// /// Bit-wise Or operator /// /// First bit array. /// Second bit array. /// The resulting bit array. - public static BitArray64 operator|(BitArray64 a, BitArray64 b) => new BitArray64(a.data | b.data); + public static BitArray64 operator |(BitArray64 a, BitArray64 b) => new BitArray64(a.data | b.data); /// /// Bit-wise And operator /// /// First bit array. /// Second bit array. /// The resulting bit array. - public static BitArray64 operator&(BitArray64 a, BitArray64 b) => new BitArray64(a.data & b.data); + public static BitArray64 operator &(BitArray64 a, BitArray64 b) => new BitArray64(a.data & b.data); /// /// Bit-wise And @@ -502,14 +502,14 @@ public BitArray64(IEnumerable bitIndexTrue) /// First bit array. /// Second bit array. /// True if both bit arrays are equals. - public static bool operator==(BitArray64 a, BitArray64 b) => a.data == b.data; + public static bool operator ==(BitArray64 a, BitArray64 b) => a.data == b.data; /// /// Inequality operator. /// /// First bit array. /// Second bit array. /// True if the bit arrays are not equals. - public static bool operator!=(BitArray64 a, BitArray64 b) => a.data != b.data; + public static bool operator !=(BitArray64 a, BitArray64 b) => a.data != b.data; /// /// Equality operator. /// @@ -593,21 +593,21 @@ public BitArray128(IEnumerable bitIndexTrue) /// /// First bit array. /// The resulting bit array. - public static BitArray128 operator~(BitArray128 a) => new BitArray128(~a.data1, ~a.data2); + public static BitArray128 operator ~(BitArray128 a) => new BitArray128(~a.data1, ~a.data2); /// /// Bit-wise Or operator /// /// First bit array. /// Second bit array. /// The resulting bit array. - public static BitArray128 operator|(BitArray128 a, BitArray128 b) => new BitArray128(a.data1 | b.data1, a.data2 | b.data2); + public static BitArray128 operator |(BitArray128 a, BitArray128 b) => new BitArray128(a.data1 | b.data1, a.data2 | b.data2); /// /// Bit-wise And operator /// /// First bit array. /// Second bit array. /// The resulting bit array. - public static BitArray128 operator&(BitArray128 a, BitArray128 b) => new BitArray128(a.data1 & b.data1, a.data2 & b.data2); + public static BitArray128 operator &(BitArray128 a, BitArray128 b) => new BitArray128(a.data1 & b.data1, a.data2 & b.data2); /// /// Bit-wise And @@ -633,14 +633,14 @@ public BitArray128(IEnumerable bitIndexTrue) /// First bit array. /// Second bit array. /// True if both bit arrays are equals. - public static bool operator==(BitArray128 a, BitArray128 b) => a.data1 == b.data1 && a.data2 == b.data2; + public static bool operator ==(BitArray128 a, BitArray128 b) => a.data1 == b.data1 && a.data2 == b.data2; /// /// Inequality operator. /// /// First bit array. /// Second bit array. /// True if the bit arrays are not equals. - public static bool operator!=(BitArray128 a, BitArray128 b) => a.data1 != b.data1 || a.data2 != b.data2; + public static bool operator !=(BitArray128 a, BitArray128 b) => a.data1 != b.data1 || a.data2 != b.data2; /// /// Equality operator. /// @@ -743,21 +743,21 @@ public BitArray256(IEnumerable bitIndexTrue) /// /// Bit array with which to do the operation. /// The resulting bit array. - public static BitArray256 operator~(BitArray256 a) => new BitArray256(~a.data1, ~a.data2, ~a.data3, ~a.data4); + public static BitArray256 operator ~(BitArray256 a) => new BitArray256(~a.data1, ~a.data2, ~a.data3, ~a.data4); /// /// Bit-wise Or operator /// /// First bit array. /// Second bit array. /// The resulting bit array. - public static BitArray256 operator|(BitArray256 a, BitArray256 b) => new BitArray256(a.data1 | b.data1, a.data2 | b.data2, a.data3 | b.data3, a.data4 | b.data4); + public static BitArray256 operator |(BitArray256 a, BitArray256 b) => new BitArray256(a.data1 | b.data1, a.data2 | b.data2, a.data3 | b.data3, a.data4 | b.data4); /// /// Bit-wise And operator /// /// First bit array. /// Second bit array. /// The resulting bit array. - public static BitArray256 operator&(BitArray256 a, BitArray256 b) => new BitArray256(a.data1 & b.data1, a.data2 & b.data2, a.data3 & b.data3, a.data4 & b.data4); + public static BitArray256 operator &(BitArray256 a, BitArray256 b) => new BitArray256(a.data1 & b.data1, a.data2 & b.data2, a.data3 & b.data3, a.data4 & b.data4); /// /// Bit-wise And @@ -783,14 +783,14 @@ public BitArray256(IEnumerable bitIndexTrue) /// First bit array. /// Second bit array. /// True if both bit arrays are equals. - public static bool operator==(BitArray256 a, BitArray256 b) => a.data1 == b.data1 && a.data2 == b.data2 && a.data3 == b.data3 && a.data4 == b.data4; + public static bool operator ==(BitArray256 a, BitArray256 b) => a.data1 == b.data1 && a.data2 == b.data2 && a.data3 == b.data3 && a.data4 == b.data4; /// /// Inequality operator. /// /// First bit array. /// Second bit array. /// True if the bit arrays are not equals. - public static bool operator!=(BitArray256 a, BitArray256 b) => a.data1 != b.data1 || a.data2 != b.data2 || a.data3 != b.data3 || a.data4 != b.data4; + public static bool operator !=(BitArray256 a, BitArray256 b) => a.data1 != b.data1 || a.data2 != b.data2 || a.data3 != b.data3 || a.data4 != b.data4; /// /// Equality operator. /// diff --git a/com.unity.render-pipelines.core/Runtime/Utilities/ColorUtils.cs b/com.unity.render-pipelines.core/Runtime/Utilities/ColorUtils.cs index 0512031e645..93cb78aa346 100644 --- a/com.unity.render-pipelines.core/Runtime/Utilities/ColorUtils.cs +++ b/com.unity.render-pipelines.core/Runtime/Utilities/ColorUtils.cs @@ -51,9 +51,9 @@ public static Vector3 CIExyToLMS(float x, float y) float X = Y * x / y; float Z = Y * (1f - x - y) / y; - float L = 0.7328f * X + 0.4296f * Y - 0.1624f * Z; + float L = 0.7328f * X + 0.4296f * Y - 0.1624f * Z; float M = -0.7036f * X + 1.6975f * Y + 0.0061f * Z; - float S = 0.0030f * X + 0.0136f * Y + 0.9834f * Z; + float S = 0.0030f * X + 0.0136f * Y + 0.9834f * Z; return new Vector3(L, M, S); } @@ -298,6 +298,6 @@ public static float ComputeEV100FromAvgLuminance(float avgLuminance) /// /// A 32-bit hexadecimal value. /// A color value. - public static Color ToRGBA(uint hex) => new Color(((hex >> 16) & 0xff) / 255f, ((hex >> 8) & 0xff) / 255f, (hex & 0xff) / 255f, ((hex >> 24) & 0xff) / 255f); + public static Color ToRGBA(uint hex) => new Color(((hex >> 16) & 0xff) / 255f, ((hex >> 8) & 0xff) / 255f, (hex & 0xff) / 255f, ((hex >> 24) & 0xff) / 255f); } } diff --git a/com.unity.render-pipelines.core/Runtime/Utilities/CoreUtils.cs b/com.unity.render-pipelines.core/Runtime/Utilities/CoreUtils.cs index 1eccbba74c2..b54b99cc1d1 100644 --- a/com.unity.render-pipelines.core/Runtime/Utilities/CoreUtils.cs +++ b/com.unity.render-pipelines.core/Runtime/Utilities/CoreUtils.cs @@ -955,7 +955,7 @@ public static IEnumerable GetAllAssemblyTypes() { innerTypes = t.GetTypes(); } - catch {} + catch { } return innerTypes; }); } @@ -1038,7 +1038,7 @@ public static bool ArePostProcessesEnabled(Camera camera) { bool enabled = true; - #if UNITY_EDITOR +#if UNITY_EDITOR if (camera.cameraType == CameraType.SceneView) { enabled = false; @@ -1058,7 +1058,7 @@ public static bool ArePostProcessesEnabled(Camera camera) } } } - #endif +#endif return enabled; } @@ -1072,7 +1072,7 @@ public static bool AreAnimatedMaterialsEnabled(Camera camera) { bool animateMaterials = true; - #if UNITY_EDITOR +#if UNITY_EDITOR animateMaterials = Application.isPlaying; // For Game and VR views; Reflection views pass the parent camera if (camera.cameraType == CameraType.SceneView) @@ -1083,11 +1083,11 @@ public static bool AreAnimatedMaterialsEnabled(Camera camera) for (int i = 0; i < UnityEditor.SceneView.sceneViews.Count; i++) // Using a foreach on an ArrayList generates garbage ... { var sv = UnityEditor.SceneView.sceneViews[i] as UnityEditor.SceneView; - #if UNITY_2020_2_OR_NEWER +#if UNITY_2020_2_OR_NEWER if (sv.camera == camera && sv.sceneViewState.alwaysRefreshEnabled) - #else +#else if (sv.camera == camera && sv.sceneViewState.materialUpdateEnabled) - #endif +#endif { animateMaterials = true; break; @@ -1117,7 +1117,7 @@ public static bool AreAnimatedMaterialsEnabled(Camera camera) // which simply amounts to a recursive call, and then the story repeats itself. // // TLDR: we need to know the caller and its status/properties to make decisions. - #endif +#endif return animateMaterials; } diff --git a/com.unity.render-pipelines.core/Runtime/Utilities/ResourceReloader.cs b/com.unity.render-pipelines.core/Runtime/Utilities/ResourceReloader.cs index f74440bdd67..f51f5a23511 100644 --- a/com.unity.render-pipelines.core/Runtime/Utilities/ResourceReloader.cs +++ b/com.unity.render-pipelines.core/Runtime/Utilities/ResourceReloader.cs @@ -305,7 +305,7 @@ public ReloadAttribute(string[] paths, Package package = Package.Root) /// The lookup method public ReloadAttribute(string path, Package package = Package.Root) : this(new[] { path }, package) - {} + { } /// /// Creates a new for an array using automatic path name @@ -336,5 +336,5 @@ public ReloadAttribute(string pathFormat, int rangeMin, int rangeMax, /// [AttributeUsage(AttributeTargets.Class)] public sealed class ReloadGroupAttribute : Attribute - {} + { } } diff --git a/com.unity.render-pipelines.core/Runtime/Utilities/TextureCurve.cs b/com.unity.render-pipelines.core/Runtime/Utilities/TextureCurve.cs index f78bccd2ebc..4ab193c71f2 100644 --- a/com.unity.render-pipelines.core/Runtime/Utilities/TextureCurve.cs +++ b/com.unity.render-pipelines.core/Runtime/Utilities/TextureCurve.cs @@ -58,7 +58,7 @@ public class TextureCurve : IDisposable /// Should the curve automatically loop in the given ? /// The boundaries of the curve. public TextureCurve(AnimationCurve baseCurve, float zeroValue, bool loop, in Vector2 bounds) - : this(baseCurve.keys, zeroValue, loop, bounds) {} + : this(baseCurve.keys, zeroValue, loop, bounds) { } /// /// Creates a new from an arbitrary number of keyframes. @@ -80,13 +80,13 @@ public TextureCurve(Keyframe[] keys, float zeroValue, bool loop, in Vector2 boun /// /// Finalizer. /// - ~TextureCurve() {} + ~TextureCurve() { } /// /// Cleans up the internal texture resource. /// [Obsolete("Please use Release() instead.")] - public void Dispose() {} + public void Dispose() { } /// /// Releases the internal texture resource. @@ -250,7 +250,7 @@ public class TextureCurveParameter : VolumeParameter /// The initial value to store in the parameter. /// The initial override state for the parameter. public TextureCurveParameter(TextureCurve value, bool overrideState = false) - : base(value, overrideState) {} + : base(value, overrideState) { } /// /// Release implementation. diff --git a/com.unity.render-pipelines.core/Runtime/Volume/VolumeManager.cs b/com.unity.render-pipelines.core/Runtime/Volume/VolumeManager.cs index 821a8afa1fc..7b85ce99f08 100644 --- a/com.unity.render-pipelines.core/Runtime/Volume/VolumeManager.cs +++ b/com.unity.render-pipelines.core/Runtime/Volume/VolumeManager.cs @@ -483,11 +483,11 @@ public struct VolumeIsolationScope : IDisposable /// Constructs a scope in which a Camera filters a Volume. /// /// Unused parameter. - public VolumeIsolationScope(bool unused) {} + public VolumeIsolationScope(bool unused) { } /// /// Stops the Camera from filtering a Volume. /// - void IDisposable.Dispose() {} + void IDisposable.Dispose() { } } } diff --git a/com.unity.render-pipelines.core/Runtime/Volume/VolumeParameter.cs b/com.unity.render-pipelines.core/Runtime/Volume/VolumeParameter.cs index 9ad262e62ca..44d583c9dd4 100644 --- a/com.unity.render-pipelines.core/Runtime/Volume/VolumeParameter.cs +++ b/com.unity.render-pipelines.core/Runtime/Volume/VolumeParameter.cs @@ -58,7 +58,7 @@ public virtual bool overrideState /// public T GetValue() { - return ((VolumeParameter) this).value; + return ((VolumeParameter)this).value; } /// @@ -107,7 +107,7 @@ public static bool IsObjectParameter(Type type) /// /// Override this method to free all allocated resources /// - public virtual void Release() {} + public virtual void Release() { } } /// @@ -253,7 +253,7 @@ public override int GetHashCode() /// The first value in a . /// The second value. /// true if both values are equal, false otherwise. - public static bool operator==(VolumeParameter lhs, T rhs) => lhs != null && !ReferenceEquals(lhs.value, null) && lhs.value.Equals(rhs); + public static bool operator ==(VolumeParameter lhs, T rhs) => lhs != null && !ReferenceEquals(lhs.value, null) && lhs.value.Equals(rhs); /// /// Compares the value store in a parameter with another value of the same type. @@ -261,7 +261,7 @@ public override int GetHashCode() /// The first value in a . /// The second value. /// false if both values are equal, true otherwise - public static bool operator!=(VolumeParameter lhs, T rhs) => !(lhs == rhs); + public static bool operator !=(VolumeParameter lhs, T rhs) => !(lhs == rhs); /// /// Checks if this parameter is equal to another. @@ -329,7 +329,7 @@ public class BoolParameter : VolumeParameter /// The initial value to store in the parameter /// The initial override state for the parameter public BoolParameter(bool value, bool overrideState = false) - : base(value, overrideState) {} + : base(value, overrideState) { } } /// @@ -344,7 +344,7 @@ public class LayerMaskParameter : VolumeParameter /// The initial value to store in the parameter. /// The initial override state for the parameter. public LayerMaskParameter(LayerMask value, bool overrideState = false) - : base(value, overrideState) {} + : base(value, overrideState) { } } /// @@ -366,7 +366,7 @@ public class IntParameter : VolumeParameter /// The initial value to store in the parameter. /// The initial override state for the parameter. public IntParameter(int value, bool overrideState = false) - : base(value, overrideState) {} + : base(value, overrideState) { } /// /// Interpolates between two int values. @@ -401,7 +401,7 @@ public class NoInterpIntParameter : VolumeParameter /// The initial value to store in the parameter. /// The initial override state for the parameter. public NoInterpIntParameter(int value, bool overrideState = false) - : base(value, overrideState) {} + : base(value, overrideState) { } } /// @@ -703,7 +703,7 @@ public class FloatParameter : VolumeParameter /// The initial value to store in the parameter /// The initial override state for the parameter public FloatParameter(float value, bool overrideState = false) - : base(value, overrideState) {} + : base(value, overrideState) { } /// /// Interpolates between two float values. @@ -738,7 +738,7 @@ public class NoInterpFloatParameter : VolumeParameter /// The initial value to store in the parameter /// The initial override state for the parameter. public NoInterpFloatParameter(float value, bool overrideState = false) - : base(value, overrideState) {} + : base(value, overrideState) { } } /// @@ -1183,7 +1183,7 @@ public class ColorParameter : VolumeParameter /// The initial value to store in the parameter. /// The initial override state for the parameter. public ColorParameter(Color value, bool overrideState = false) - : base(value, overrideState) {} + : base(value, overrideState) { } /// /// Creates a new instance. @@ -1252,7 +1252,7 @@ public class NoInterpColorParameter : VolumeParameter /// The initial value to store in the parameter. /// The initial override state for the parameter. public NoInterpColorParameter(Color value, bool overrideState = false) - : base(value, overrideState) {} + : base(value, overrideState) { } /// /// Creates a new instance. @@ -1285,7 +1285,7 @@ public class Vector2Parameter : VolumeParameter /// The initial value to store in the parameter. /// The initial override state for the parameter. public Vector2Parameter(Vector2 value, bool overrideState = false) - : base(value, overrideState) {} + : base(value, overrideState) { } /// /// Interpolates between two Vector2 values. @@ -1313,7 +1313,7 @@ public class NoInterpVector2Parameter : VolumeParameter /// The initial value to store in the parameter. /// The initial override state for the parameter. public NoInterpVector2Parameter(Vector2 value, bool overrideState = false) - : base(value, overrideState) {} + : base(value, overrideState) { } } /// @@ -1329,7 +1329,7 @@ public class Vector3Parameter : VolumeParameter /// The initial value to store in the parameter. /// The initial override state for the parameter. public Vector3Parameter(Vector3 value, bool overrideState = false) - : base(value, overrideState) {} + : base(value, overrideState) { } /// /// Interpolates between two Vector3 values. @@ -1358,7 +1358,7 @@ public class NoInterpVector3Parameter : VolumeParameter /// The initial value to store in the parameter. /// The initial override state for the parameter. public NoInterpVector3Parameter(Vector3 value, bool overrideState = false) - : base(value, overrideState) {} + : base(value, overrideState) { } } /// @@ -1374,7 +1374,7 @@ public class Vector4Parameter : VolumeParameter /// The initial value to store in the parameter. /// The initial override state for the parameter. public Vector4Parameter(Vector4 value, bool overrideState = false) - : base(value, overrideState) {} + : base(value, overrideState) { } /// /// Interpolates between two Vector4 values. @@ -1404,7 +1404,7 @@ public class NoInterpVector4Parameter : VolumeParameter /// The initial value to store in the parameter. /// The initial override state for the parameter. public NoInterpVector4Parameter(Vector4 value, bool overrideState = false) - : base(value, overrideState) {} + : base(value, overrideState) { } } /// @@ -1419,7 +1419,7 @@ public class TextureParameter : VolumeParameter /// The initial value to store in the parameter. /// The initial override state for the parameter. public TextureParameter(Texture value, bool overrideState = false) - : base(value, overrideState) {} + : base(value, overrideState) { } // TODO: Texture interpolation } @@ -1436,7 +1436,7 @@ public class NoInterpTextureParameter : VolumeParameter /// The initial value to store in the parameter. /// The initial override state for the parameter. public NoInterpTextureParameter(Texture value, bool overrideState = false) - : base(value, overrideState) {} + : base(value, overrideState) { } } /// @@ -1451,7 +1451,7 @@ public class RenderTextureParameter : VolumeParameter /// The initial value to store in the parameter. /// The initial override state for the parameter. public RenderTextureParameter(RenderTexture value, bool overrideState = false) - : base(value, overrideState) {} + : base(value, overrideState) { } // TODO: RenderTexture interpolation } @@ -1468,7 +1468,7 @@ public class NoInterpRenderTextureParameter : VolumeParameter /// The initial value to store in the parameter. /// The initial override state for the parameter. public NoInterpRenderTextureParameter(RenderTexture value, bool overrideState = false) - : base(value, overrideState) {} + : base(value, overrideState) { } } /// @@ -1483,7 +1483,7 @@ public class CubemapParameter : VolumeParameter /// The initial value to store in the parameter. /// The initial override state for the parameter. public CubemapParameter(Texture value, bool overrideState = false) - : base(value, overrideState) {} + : base(value, overrideState) { } // TODO: Cubemap interpolation } @@ -1499,7 +1499,7 @@ public class NoInterpCubemapParameter : VolumeParameter /// The initial value to store in the parameter. /// The initial override state for the parameter. public NoInterpCubemapParameter(Cubemap value, bool overrideState = false) - : base(value, overrideState) {} + : base(value, overrideState) { } } /// @@ -1592,7 +1592,7 @@ public class AnimationCurveParameter : VolumeParameter /// The initial value to be stored in the parameter /// The initial override state for the parameter public AnimationCurveParameter(AnimationCurve value, bool overrideState = false) - : base(value, overrideState) {} + : base(value, overrideState) { } // TODO: Curve interpolation } diff --git a/com.unity.render-pipelines.core/Tests/Editor/BitArrayTests.cs b/com.unity.render-pipelines.core/Tests/Editor/BitArrayTests.cs index 12785a2e68b..d6d0cda17d9 100644 --- a/com.unity.render-pipelines.core/Tests/Editor/BitArrayTests.cs +++ b/com.unity.render-pipelines.core/Tests/Editor/BitArrayTests.cs @@ -17,13 +17,13 @@ class BitArrayTests static readonly uint[] aIndexes = new uint[] { 300, 200, 198, 100, 98, 60, 58, 30, 28, 10, 8, 4, 2, 0, 0 }; //double 0 entry to test double entry static readonly uint[] bIndexes = new uint[] { 300, 200, 199, 100, 99, 60, 59, 30, 29, 10, 9, 8, 5, 1, 0 }; static readonly uint[] getSetTestedIndexes = new uint[] { 201, 200, 101, 100, 61, 60, 31, 30, 11, 10, 1, 0 }; // on a, odd value are false, even true - const string aHumanized = "00000000.00000000.00000000.00000000.00000000.00000000.00000001.01000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00010100.00000000.00000000.00000000.00000000.00010100.00000000.00000000.00000000.01010000.00000000.00000101.00010101"; - const string bHumanized = "00000000.00000000.00000000.00000000.00000000.00000000.00000001.10000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00011000.00000000.00000000.00000000.00000000.00011000.00000000.00000000.00000000.01100000.00000000.00000111.00100011"; - const string aAndBHumanized = "00000000.00000000.00000000.00000000.00000000.00000000.00000001.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00010000.00000000.00000000.00000000.00000000.00010000.00000000.00000000.00000000.01000000.00000000.00000101.00000001"; - const string aOrBHumanized = "00000000.00000000.00000000.00000000.00000000.00000000.00000001.11000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00011100.00000000.00000000.00000000.00000000.00011100.00000000.00000000.00000000.01110000.00000000.00000111.00110111"; - const string notAHumanized = "11111111.11111111.11111111.11111111.11111111.11111111.11111110.10111111.11111111.11111111.11111111.11111111.11111111.11111111.11111111.11111111.11111111.11111111.11111111.11101011.11111111.11111111.11111111.11111111.11101011.11111111.11111111.11111111.10101111.11111111.11111010.11101010"; - const string zeroHumanized = "00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000"; - const string maxHumanized = "11111111.11111111.11111111.11111111.11111111.11111111.11111111.11111111.11111111.11111111.11111111.11111111.11111111.11111111.11111111.11111111.11111111.11111111.11111111.11111111.11111111.11111111.11111111.11111111.11111111.11111111.11111111.11111111.11111111.11111111.11111111.11111111"; + const string aHumanized = "00000000.00000000.00000000.00000000.00000000.00000000.00000001.01000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00010100.00000000.00000000.00000000.00000000.00010100.00000000.00000000.00000000.01010000.00000000.00000101.00010101"; + const string bHumanized = "00000000.00000000.00000000.00000000.00000000.00000000.00000001.10000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00011000.00000000.00000000.00000000.00000000.00011000.00000000.00000000.00000000.01100000.00000000.00000111.00100011"; + const string aAndBHumanized = "00000000.00000000.00000000.00000000.00000000.00000000.00000001.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00010000.00000000.00000000.00000000.00000000.00010000.00000000.00000000.00000000.01000000.00000000.00000101.00000001"; + const string aOrBHumanized = "00000000.00000000.00000000.00000000.00000000.00000000.00000001.11000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00011100.00000000.00000000.00000000.00000000.00011100.00000000.00000000.00000000.01110000.00000000.00000111.00110111"; + const string notAHumanized = "11111111.11111111.11111111.11111111.11111111.11111111.11111110.10111111.11111111.11111111.11111111.11111111.11111111.11111111.11111111.11111111.11111111.11111111.11111111.11101011.11111111.11111111.11111111.11111111.11101011.11111111.11111111.11111111.10101111.11111111.11111010.11101010"; + const string zeroHumanized = "00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000"; + const string maxHumanized = "11111111.11111111.11111111.11111111.11111111.11111111.11111111.11111111.11111111.11111111.11111111.11111111.11111111.11111111.11111111.11111111.11111111.11111111.11111111.11111111.11111111.11111111.11111111.11111111.11111111.11111111.11111111.11111111.11111111.11111111.11111111.11111111"; [SetUp] public void SetUpBitArray() diff --git a/com.unity.render-pipelines.core/Tests/Editor/CoreUnsafeUtilsTests.cs b/com.unity.render-pipelines.core/Tests/Editor/CoreUnsafeUtilsTests.cs index accde5f90d1..a005bd253be 100644 --- a/com.unity.render-pipelines.core/Tests/Editor/CoreUnsafeUtilsTests.cs +++ b/com.unity.render-pipelines.core/Tests/Editor/CoreUnsafeUtilsTests.cs @@ -27,8 +27,8 @@ public override bool Equals(object obj) public override int GetHashCode() { - fixed(float* fptr = &floatValue) - return intValue ^ *(int*)fptr; + fixed (float* fptr = &floatValue) + return intValue ^ *(int*)fptr; } } diff --git a/com.unity.render-pipelines.core/Tests/Editor/RenderGraphTests.cs b/com.unity.render-pipelines.core/Tests/Editor/RenderGraphTests.cs index b02b863b884..73158d511a3 100644 --- a/com.unity.render-pipelines.core/Tests/Editor/RenderGraphTests.cs +++ b/com.unity.render-pipelines.core/Tests/Editor/RenderGraphTests.cs @@ -27,7 +27,7 @@ public void WriteToBackBufferNotCulled() using (var builder = m_RenderGraph.AddRenderPass("TestPass0", out var passData)) { builder.WriteTexture(m_RenderGraph.ImportBackbuffer(0)); - builder.SetRenderFunc((RenderGraphTestPassData data, RenderGraphContext context) => {}); + builder.SetRenderFunc((RenderGraphTestPassData data, RenderGraphContext context) => { }); } m_RenderGraph.CompileRenderGraph(); @@ -44,7 +44,7 @@ public void NoWriteToBackBufferCulled() using (var builder = m_RenderGraph.AddRenderPass("TestPass0", out var passData)) { builder.WriteTexture(m_RenderGraph.CreateTexture(new TextureDesc(Vector2.one) { colorFormat = GraphicsFormat.R8G8B8A8_UNorm })); - builder.SetRenderFunc((RenderGraphTestPassData data, RenderGraphContext context) => {}); + builder.SetRenderFunc((RenderGraphTestPassData data, RenderGraphContext context) => { }); } m_RenderGraph.CompileRenderGraph(); @@ -61,7 +61,7 @@ public void WriteToImportedTextureNotCulled() using (var builder = m_RenderGraph.AddRenderPass("TestPass0", out var passData)) { builder.WriteTexture(m_RenderGraph.ImportTexture(null)); - builder.SetRenderFunc((RenderGraphTestPassData data, RenderGraphContext context) => {}); + builder.SetRenderFunc((RenderGraphTestPassData data, RenderGraphContext context) => { }); } m_RenderGraph.CompileRenderGraph(); @@ -77,7 +77,7 @@ public void WriteToImportedComputeBufferNotCulled() using (var builder = m_RenderGraph.AddRenderPass("TestPass0", out var passData)) { builder.WriteComputeBuffer(m_RenderGraph.ImportComputeBuffer(null)); - builder.SetRenderFunc((RenderGraphTestPassData data, RenderGraphContext context) => {}); + builder.SetRenderFunc((RenderGraphTestPassData data, RenderGraphContext context) => { }); } m_RenderGraph.CompileRenderGraph(); @@ -171,7 +171,7 @@ public void PassWriteResourcePartialNotReadAfterNotCulled() using (var builder = m_RenderGraph.AddRenderPass("TestPass0", out var passData)) { texture0 = builder.WriteTexture(m_RenderGraph.CreateTexture(new TextureDesc(Vector2.one) { colorFormat = GraphicsFormat.R8G8B8A8_UNorm })); - builder.SetRenderFunc((RenderGraphTestPassData data, RenderGraphContext context) => {}); + builder.SetRenderFunc((RenderGraphTestPassData data, RenderGraphContext context) => { }); } TextureHandle texture1; @@ -179,7 +179,7 @@ public void PassWriteResourcePartialNotReadAfterNotCulled() { builder.ReadTexture(texture0); texture1 = builder.WriteTexture(m_RenderGraph.CreateTexture(new TextureDesc(Vector2.one) { colorFormat = GraphicsFormat.R8G8B8A8_UNorm })); - builder.SetRenderFunc((RenderGraphTestPassData data, RenderGraphContext context) => {}); + builder.SetRenderFunc((RenderGraphTestPassData data, RenderGraphContext context) => { }); } // This pass writes to texture0 which is used so will not be culled out. @@ -189,14 +189,14 @@ public void PassWriteResourcePartialNotReadAfterNotCulled() { builder.WriteTexture(texture0); builder.WriteTexture(texture1); - builder.SetRenderFunc((RenderGraphTestPassData data, RenderGraphContext context) => {}); + builder.SetRenderFunc((RenderGraphTestPassData data, RenderGraphContext context) => { }); } using (var builder = m_RenderGraph.AddRenderPass("TestPass3", out var passData)) { builder.ReadTexture(texture1); builder.WriteTexture(m_RenderGraph.ImportBackbuffer(0)); // Needed for the passes to not be culled - builder.SetRenderFunc((RenderGraphTestPassData data, RenderGraphContext context) => {}); + builder.SetRenderFunc((RenderGraphTestPassData data, RenderGraphContext context) => { }); } m_RenderGraph.CompileRenderGraph(); @@ -216,7 +216,7 @@ public void PassDisallowCullingNotCulled() using (var builder = m_RenderGraph.AddRenderPass("TestPass0", out var passData)) { builder.AllowPassCulling(false); - builder.SetRenderFunc((RenderGraphTestPassData data, RenderGraphContext context) => {}); + builder.SetRenderFunc((RenderGraphTestPassData data, RenderGraphContext context) => { }); } m_RenderGraph.CompileRenderGraph(); @@ -235,14 +235,14 @@ public void PartialUnusedProductNotCulled() { texture = builder.WriteTexture(m_RenderGraph.CreateTexture(new TextureDesc(Vector2.one) { colorFormat = GraphicsFormat.R8G8B8A8_UNorm })); builder.WriteTexture(m_RenderGraph.CreateTexture(new TextureDesc(Vector2.one) { colorFormat = GraphicsFormat.R8G8B8A8_UNorm })); - builder.SetRenderFunc((RenderGraphTestPassData data, RenderGraphContext context) => {}); + builder.SetRenderFunc((RenderGraphTestPassData data, RenderGraphContext context) => { }); } using (var builder = m_RenderGraph.AddRenderPass("TestPass1", out var passData)) { builder.ReadTexture(texture); builder.WriteTexture(m_RenderGraph.ImportBackbuffer(0)); - builder.SetRenderFunc((RenderGraphTestPassData data, RenderGraphContext context) => {}); + builder.SetRenderFunc((RenderGraphTestPassData data, RenderGraphContext context) => { }); } m_RenderGraph.CompileRenderGraph(); @@ -261,7 +261,7 @@ public void SimpleCreateReleaseTexture() using (var builder = m_RenderGraph.AddRenderPass("TestPass0", out var passData)) { texture = builder.WriteTexture(m_RenderGraph.CreateTexture(new TextureDesc(Vector2.one) { colorFormat = GraphicsFormat.R8G8B8A8_UNorm })); - builder.SetRenderFunc((RenderGraphTestPassData data, RenderGraphContext context) => {}); + builder.SetRenderFunc((RenderGraphTestPassData data, RenderGraphContext context) => { }); } // Add dummy passes @@ -269,7 +269,7 @@ public void SimpleCreateReleaseTexture() { using (var builder = m_RenderGraph.AddRenderPass("TestPass1", out var passData)) { - builder.SetRenderFunc((RenderGraphTestPassData data, RenderGraphContext context) => {}); + builder.SetRenderFunc((RenderGraphTestPassData data, RenderGraphContext context) => { }); } } @@ -277,7 +277,7 @@ public void SimpleCreateReleaseTexture() { builder.ReadTexture(texture); builder.WriteTexture(m_RenderGraph.ImportBackbuffer(0)); // Needed for the passes to not be culled - builder.SetRenderFunc((RenderGraphTestPassData data, RenderGraphContext context) => {}); + builder.SetRenderFunc((RenderGraphTestPassData data, RenderGraphContext context) => { }); } m_RenderGraph.CompileRenderGraph(); @@ -297,14 +297,14 @@ public void UseTransientOutsidePassRaiseException() using (var builder = m_RenderGraph.AddRenderPass("TestPass0", out var passData)) { texture = builder.CreateTransientTexture(new TextureDesc(Vector2.one) { colorFormat = GraphicsFormat.R8G8B8A8_UNorm }); - builder.SetRenderFunc((RenderGraphTestPassData data, RenderGraphContext context) => {}); + builder.SetRenderFunc((RenderGraphTestPassData data, RenderGraphContext context) => { }); } using (var builder = m_RenderGraph.AddRenderPass("TestPass1", out var passData)) { builder.ReadTexture(texture); // This is illegal (transient resource was created in previous pass) builder.WriteTexture(m_RenderGraph.ImportBackbuffer(0)); // Needed for the passes to not be culled - builder.SetRenderFunc((RenderGraphTestPassData data, RenderGraphContext context) => {}); + builder.SetRenderFunc((RenderGraphTestPassData data, RenderGraphContext context) => { }); } m_RenderGraph.CompileRenderGraph(); @@ -319,7 +319,7 @@ public void TransientCreateReleaseInSamePass() { texture = builder.CreateTransientTexture(new TextureDesc(Vector2.one) { colorFormat = GraphicsFormat.R8G8B8A8_UNorm }); builder.WriteTexture(m_RenderGraph.ImportBackbuffer(0)); // Needed for the passes to not be culled - builder.SetRenderFunc((RenderGraphTestPassData data, RenderGraphContext context) => {}); + builder.SetRenderFunc((RenderGraphTestPassData data, RenderGraphContext context) => { }); } m_RenderGraph.CompileRenderGraph(); @@ -345,7 +345,7 @@ public void AsyncPassReleaseTextureOnGraphicsPipe() texture0 = builder.WriteTexture(m_RenderGraph.CreateTexture(new TextureDesc(Vector2.one) { colorFormat = GraphicsFormat.R8G8B8A8_UNorm })); texture1 = builder.WriteTexture(m_RenderGraph.CreateTexture(new TextureDesc(Vector2.one) { colorFormat = GraphicsFormat.R8G8B8A8_UNorm })); builder.EnableAsyncCompute(true); - builder.SetRenderFunc((RenderGraphTestPassData data, RenderGraphContext context) => {}); + builder.SetRenderFunc((RenderGraphTestPassData data, RenderGraphContext context) => { }); } // Second pass creates a transient texture => Create/Release should happen in this pass but we want to delay the release until the first graphics pipe pass that sync with async queue. @@ -354,7 +354,7 @@ public void AsyncPassReleaseTextureOnGraphicsPipe() texture2 = builder.CreateTransientTexture(new TextureDesc(Vector2.one) { colorFormat = GraphicsFormat.R8G8B8A8_UNorm }); builder.WriteTexture(texture0); builder.EnableAsyncCompute(true); - builder.SetRenderFunc((RenderGraphTestPassData data, RenderGraphContext context) => {}); + builder.SetRenderFunc((RenderGraphTestPassData data, RenderGraphContext context) => { }); } // This pass is the last to read texture0 => Release should happen in this pass but we want to delay the release until the first graphics pipe pass that sync with async queue. @@ -363,7 +363,7 @@ public void AsyncPassReleaseTextureOnGraphicsPipe() texture0 = builder.ReadTexture(texture0); builder.WriteTexture(texture1); builder.EnableAsyncCompute(true); - builder.SetRenderFunc((RenderGraphTestPassData data, RenderGraphContext context) => {}); + builder.SetRenderFunc((RenderGraphTestPassData data, RenderGraphContext context) => { }); } // Just here to add "padding" to the number of passes to ensure resources are not released right at the first sync pass. @@ -371,7 +371,7 @@ public void AsyncPassReleaseTextureOnGraphicsPipe() { texture3 = builder.WriteTexture(m_RenderGraph.CreateTexture(new TextureDesc(Vector2.one) { colorFormat = GraphicsFormat.R8G8B8A8_UNorm })); builder.EnableAsyncCompute(false); - builder.SetRenderFunc((RenderGraphTestPassData data, RenderGraphContext context) => {}); + builder.SetRenderFunc((RenderGraphTestPassData data, RenderGraphContext context) => { }); } // Pass prior to synchronization should be where textures are released. @@ -379,7 +379,7 @@ public void AsyncPassReleaseTextureOnGraphicsPipe() { builder.WriteTexture(texture3); builder.EnableAsyncCompute(false); - builder.SetRenderFunc((RenderGraphTestPassData data, RenderGraphContext context) => {}); + builder.SetRenderFunc((RenderGraphTestPassData data, RenderGraphContext context) => { }); } // Graphics pass that reads texture1. This will request a sync with compute pipe. The previous pass should be the one releasing async textures. @@ -389,7 +389,7 @@ public void AsyncPassReleaseTextureOnGraphicsPipe() builder.ReadTexture(texture3); builder.WriteTexture(m_RenderGraph.ImportBackbuffer(0)); // Needed for the passes to not be culled builder.EnableAsyncCompute(false); - builder.SetRenderFunc((RenderGraphTestPassData data, RenderGraphContext context) => {}); + builder.SetRenderFunc((RenderGraphTestPassData data, RenderGraphContext context) => { }); } m_RenderGraph.CompileRenderGraph(); @@ -407,14 +407,14 @@ public void TransientResourceNotCulled() using (var builder = m_RenderGraph.AddRenderPass("TestPass0", out var passData)) { texture0 = builder.WriteTexture(m_RenderGraph.CreateTexture(new TextureDesc(Vector2.one) { colorFormat = GraphicsFormat.R8G8B8A8_UNorm })); - builder.SetRenderFunc((RenderGraphTestPassData data, RenderGraphContext context) => {}); + builder.SetRenderFunc((RenderGraphTestPassData data, RenderGraphContext context) => { }); } using (var builder = m_RenderGraph.AddRenderPass("TestPass1", out var passData)) { builder.CreateTransientTexture(new TextureDesc(Vector2.one) { colorFormat = GraphicsFormat.R8G8B8A8_UNorm }); builder.WriteTexture(texture0); - builder.SetRenderFunc((RenderGraphTestPassData data, RenderGraphContext context) => {}); + builder.SetRenderFunc((RenderGraphTestPassData data, RenderGraphContext context) => { }); } // Graphics pass that reads texture1. This will request a sync with compute pipe. The previous pass should be the one releasing async textures. @@ -423,7 +423,7 @@ public void TransientResourceNotCulled() builder.ReadTexture(texture0); builder.WriteTexture(m_RenderGraph.ImportBackbuffer(0)); // Needed for the passes to not be culled builder.EnableAsyncCompute(false); - builder.SetRenderFunc((RenderGraphTestPassData data, RenderGraphContext context) => {}); + builder.SetRenderFunc((RenderGraphTestPassData data, RenderGraphContext context) => { }); } m_RenderGraph.CompileRenderGraph(); @@ -440,21 +440,21 @@ public void AsyncPassWriteWaitOnGraphcisPipe() using (var builder = m_RenderGraph.AddRenderPass("TestPass0", out var passData)) { texture0 = builder.WriteTexture(m_RenderGraph.CreateTexture(new TextureDesc(Vector2.one) { colorFormat = GraphicsFormat.R8G8B8A8_UNorm })); - builder.SetRenderFunc((RenderGraphTestPassData data, RenderGraphContext context) => {}); + builder.SetRenderFunc((RenderGraphTestPassData data, RenderGraphContext context) => { }); } using (var builder = m_RenderGraph.AddRenderPass("Async_TestPass1", out var passData)) { texture0 = builder.WriteTexture(texture0); builder.EnableAsyncCompute(true); - builder.SetRenderFunc((RenderGraphTestPassData data, RenderGraphContext context) => {}); + builder.SetRenderFunc((RenderGraphTestPassData data, RenderGraphContext context) => { }); } using (var builder = m_RenderGraph.AddRenderPass("TestPass2", out var passData)) { builder.ReadTexture(texture0); builder.WriteTexture(m_RenderGraph.ImportBackbuffer(0)); // Needed for the passes to not be culled - builder.SetRenderFunc((RenderGraphTestPassData data, RenderGraphContext context) => {}); + builder.SetRenderFunc((RenderGraphTestPassData data, RenderGraphContext context) => { }); } m_RenderGraph.CompileRenderGraph(); @@ -473,7 +473,7 @@ public void AsyncPassReadWaitOnGraphcisPipe() using (var builder = m_RenderGraph.AddRenderPass("TestPass0", out var passData)) { texture0 = builder.WriteTexture(m_RenderGraph.CreateTexture(new TextureDesc(Vector2.one) { colorFormat = GraphicsFormat.R8G8B8A8_UNorm })); - builder.SetRenderFunc((RenderGraphTestPassData data, RenderGraphContext context) => {}); + builder.SetRenderFunc((RenderGraphTestPassData data, RenderGraphContext context) => { }); } using (var builder = m_RenderGraph.AddRenderPass("Async_TestPass1", out var passData)) @@ -481,14 +481,14 @@ public void AsyncPassReadWaitOnGraphcisPipe() builder.ReadTexture(texture0); texture1 = builder.WriteTexture(m_RenderGraph.CreateTexture(new TextureDesc(Vector2.one) { colorFormat = GraphicsFormat.R8G8B8A8_UNorm })); builder.EnableAsyncCompute(true); - builder.SetRenderFunc((RenderGraphTestPassData data, RenderGraphContext context) => {}); + builder.SetRenderFunc((RenderGraphTestPassData data, RenderGraphContext context) => { }); } using (var builder = m_RenderGraph.AddRenderPass("TestPass2", out var passData)) { builder.ReadTexture(texture1); builder.WriteTexture(m_RenderGraph.ImportBackbuffer(0)); // Needed for the passes to not be culled - builder.SetRenderFunc((RenderGraphTestPassData data, RenderGraphContext context) => {}); + builder.SetRenderFunc((RenderGraphTestPassData data, RenderGraphContext context) => { }); } m_RenderGraph.CompileRenderGraph(); @@ -507,14 +507,14 @@ public void GraphicsPassWriteWaitOnAsyncPipe() { texture0 = builder.WriteTexture(m_RenderGraph.CreateTexture(new TextureDesc(Vector2.one) { colorFormat = GraphicsFormat.R8G8B8A8_UNorm })); builder.EnableAsyncCompute(true); - builder.SetRenderFunc((RenderGraphTestPassData data, RenderGraphContext context) => {}); + builder.SetRenderFunc((RenderGraphTestPassData data, RenderGraphContext context) => { }); } using (var builder = m_RenderGraph.AddRenderPass("TestPass1", out var passData)) { builder.WriteTexture(texture0); builder.WriteTexture(m_RenderGraph.ImportBackbuffer(0)); // Needed for the passes to not be culled - builder.SetRenderFunc((RenderGraphTestPassData data, RenderGraphContext context) => {}); + builder.SetRenderFunc((RenderGraphTestPassData data, RenderGraphContext context) => { }); } m_RenderGraph.CompileRenderGraph(); @@ -532,14 +532,14 @@ public void GraphicsPassReadWaitOnAsyncPipe() { texture0 = builder.WriteTexture(m_RenderGraph.CreateTexture(new TextureDesc(Vector2.one) { colorFormat = GraphicsFormat.R8G8B8A8_UNorm })); builder.EnableAsyncCompute(true); - builder.SetRenderFunc((RenderGraphTestPassData data, RenderGraphContext context) => {}); + builder.SetRenderFunc((RenderGraphTestPassData data, RenderGraphContext context) => { }); } using (var builder = m_RenderGraph.AddRenderPass("TestPass1", out var passData)) { builder.ReadTexture(texture0); builder.WriteTexture(m_RenderGraph.ImportBackbuffer(0)); // Needed for the passes to not be culled - builder.SetRenderFunc((RenderGraphTestPassData data, RenderGraphContext context) => {}); + builder.SetRenderFunc((RenderGraphTestPassData data, RenderGraphContext context) => { }); } m_RenderGraph.CompileRenderGraph(); diff --git a/com.unity.render-pipelines.high-definition-config/Tests/Editor/ConfigurationTest.cs b/com.unity.render-pipelines.high-definition-config/Tests/Editor/ConfigurationTest.cs index d3ef5fdf2bb..e16ce312504 100644 --- a/com.unity.render-pipelines.high-definition-config/Tests/Editor/ConfigurationTest.cs +++ b/com.unity.render-pipelines.high-definition-config/Tests/Editor/ConfigurationTest.cs @@ -8,6 +8,6 @@ namespace UnityEngine.Rendering.HighDefinition.Test class ConfigurationTest { [Test] - public void ValidateConfiguration() {} + public void ValidateConfiguration() { } } } diff --git a/com.unity.render-pipelines.high-definition/Editor/AssetProcessors/HDIESImporterEditor.cs b/com.unity.render-pipelines.high-definition/Editor/AssetProcessors/HDIESImporterEditor.cs index 9997b04ebb6..92dabef4bca 100644 --- a/com.unity.render-pipelines.high-definition/Editor/AssetProcessors/HDIESImporterEditor.cs +++ b/com.unity.render-pipelines.high-definition/Editor/AssetProcessors/HDIESImporterEditor.cs @@ -111,19 +111,19 @@ protected override void Apply() public override bool HasPreviewGUI() { return iesImporterEditor.CommonHasPreviewGUI( - delegate(Camera camera) + delegate (Camera camera) { SetupRenderPipelinePreviewCamera(camera); }, - delegate(Light light) + delegate (Light light) { SetupRenderPipelinePreviewLight(light); }, - delegate(MeshRenderer wallRenderer) + delegate (MeshRenderer wallRenderer) { SetupRenderPipelinePreviewWallRenderer(wallRenderer); }, - delegate(MeshRenderer floorRenderer) + delegate (MeshRenderer floorRenderer) { SetupRenderPipelinePreviewFloorRenderer(floorRenderer); } @@ -147,7 +147,7 @@ public override GUIContent GetPreviewTitle() public override void OnPreviewGUI(Rect r, GUIStyle background) { iesImporterEditor.CommonOnPreviewGUI(r, background, target as IESImporter, - delegate(Light light, SerializedProperty useIESMaximumIntensityProp, SerializedProperty iesMaximumIntensityUnitProp, SerializedProperty iesMaximumIntensityProp) + delegate (Light light, SerializedProperty useIESMaximumIntensityProp, SerializedProperty iesMaximumIntensityUnitProp, SerializedProperty iesMaximumIntensityProp) { SetupRenderPipelinePreviewLightIntensity(light, useIESMaximumIntensityProp, iesMaximumIntensityUnitProp, iesMaximumIntensityProp); }); diff --git a/com.unity.render-pipelines.high-definition/Editor/BuildProcessors/HDRPPreprocessShaders.cs b/com.unity.render-pipelines.high-definition/Editor/BuildProcessors/HDRPPreprocessShaders.cs index 68f89d41550..f7a19c42905 100644 --- a/com.unity.render-pipelines.high-definition/Editor/BuildProcessors/HDRPPreprocessShaders.cs +++ b/com.unity.render-pipelines.high-definition/Editor/BuildProcessors/HDRPPreprocessShaders.cs @@ -16,7 +16,7 @@ class CommonShaderPreprocessor : BaseShaderPreprocessor { public override int Priority => 100; - public CommonShaderPreprocessor() {} + public CommonShaderPreprocessor() { } protected override bool DoShadersStripper(HDRenderPipelineAsset hdrpAsset, Shader shader, ShaderSnippetData snippet, ShaderCompilerData inputData) { diff --git a/com.unity.render-pipelines.high-definition/Editor/Lighting/DiffusionProfileOverrideEditor.cs b/com.unity.render-pipelines.high-definition/Editor/Lighting/DiffusionProfileOverrideEditor.cs index 0adb288ce13..08634f34fc9 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Lighting/DiffusionProfileOverrideEditor.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Lighting/DiffusionProfileOverrideEditor.cs @@ -14,9 +14,9 @@ namespace UnityEditor.Rendering.HighDefinition sealed class DiffusionProfileOverrideEditor : VolumeComponentEditor { SerializedDataParameter m_DiffusionProfiles; - Volume m_Volume; + Volume m_Volume; - DiffusionProfileSettingsListUI listUI = new DiffusionProfileSettingsListUI(); + DiffusionProfileSettingsListUI listUI = new DiffusionProfileSettingsListUI(); static GUIContent m_DiffusionProfileLabel = new GUIContent("Diffusion Profile List", "Diffusion Profile List from current HDRenderPipeline Asset"); diff --git a/com.unity.render-pipelines.high-definition/Editor/Lighting/HDLightExplorerExtension.cs b/com.unity.render-pipelines.high-definition/Editor/Lighting/HDLightExplorerExtension.cs index 27f04b9b5ac..674377ae57b 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Lighting/HDLightExplorerExtension.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Lighting/HDLightExplorerExtension.cs @@ -123,11 +123,11 @@ public override LightingExplorerTab[] GetContentTabs() protected virtual UnityEngine.Object[] GetHDLights() { - #if UNITY_2020_1_OR_NEWER +#if UNITY_2020_1_OR_NEWER var lights = Resources.FindObjectsOfTypeAll(); - #else +#else var lights = UnityEngine.Object.FindObjectsOfType(); - #endif +#endif foreach (Light light in lights) { @@ -145,11 +145,11 @@ protected virtual UnityEngine.Object[] GetHDLights() protected virtual UnityEngine.Object[] GetHDReflectionProbes() { - #if UNITY_2020_1_OR_NEWER +#if UNITY_2020_1_OR_NEWER var reflectionProbes = Resources.FindObjectsOfTypeAll(); - #else +#else var reflectionProbes = UnityEngine.Object.FindObjectsOfType(); - #endif +#endif foreach (ReflectionProbe probe in reflectionProbes) { @@ -161,20 +161,20 @@ protected virtual UnityEngine.Object[] GetHDReflectionProbes() protected virtual UnityEngine.Object[] GetPlanarReflections() { - #if UNITY_2020_1_OR_NEWER +#if UNITY_2020_1_OR_NEWER return Resources.FindObjectsOfTypeAll(); - #else +#else return UnityEngine.Object.FindObjectsOfType(); - #endif +#endif } protected virtual UnityEngine.Object[] GetVolumes() { - #if UNITY_2020_1_OR_NEWER +#if UNITY_2020_1_OR_NEWER var volumes = Resources.FindObjectsOfTypeAll(); - #else +#else var volumes = UnityEngine.Object.FindObjectsOfType(); - #endif +#endif foreach (var volume in volumes) { diff --git a/com.unity.render-pipelines.high-definition/Editor/Lighting/HDLightUI.cs b/com.unity.render-pipelines.high-definition/Editor/Lighting/HDLightUI.cs index 85e746c2097..94008145b04 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Lighting/HDLightUI.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Lighting/HDLightUI.cs @@ -443,12 +443,12 @@ static void DrawCelestialBodyContent(SerializedHDLight serialized, Editor owner) using (new EditorGUI.DisabledScope(!serialized.interactsWithSky.boolValue)) { EditorGUI.indentLevel++; - EditorGUILayout.PropertyField(serialized.flareSize, s_Styles.flareSize); - EditorGUILayout.PropertyField(serialized.flareFalloff, s_Styles.flareFalloff); - EditorGUILayout.PropertyField(serialized.flareTint, s_Styles.flareTint); + EditorGUILayout.PropertyField(serialized.flareSize, s_Styles.flareSize); + EditorGUILayout.PropertyField(serialized.flareFalloff, s_Styles.flareFalloff); + EditorGUILayout.PropertyField(serialized.flareTint, s_Styles.flareTint); EditorGUILayout.PropertyField(serialized.surfaceTexture, s_Styles.surfaceTexture); - EditorGUILayout.PropertyField(serialized.surfaceTint, s_Styles.surfaceTint); - EditorGUILayout.PropertyField(serialized.distance, s_Styles.distance); + EditorGUILayout.PropertyField(serialized.surfaceTint, s_Styles.surfaceTint); + EditorGUILayout.PropertyField(serialized.distance, s_Styles.distance); EditorGUI.indentLevel--; } } @@ -456,9 +456,9 @@ static void DrawCelestialBodyContent(SerializedHDLight serialized, Editor owner) if (EditorGUI.EndChangeCheck()) { // Clamp the value and also affect baked shadows. - serialized.flareSize.floatValue = Mathf.Clamp(serialized.flareSize.floatValue, 0, 90); - serialized.flareFalloff.floatValue = Mathf.Max(serialized.flareFalloff.floatValue, 0); - serialized.distance.floatValue = Mathf.Max(serialized.distance.floatValue, 0); + serialized.flareSize.floatValue = Mathf.Clamp(serialized.flareSize.floatValue, 0, 90); + serialized.flareFalloff.floatValue = Mathf.Max(serialized.flareFalloff.floatValue, 0); + serialized.distance.floatValue = Mathf.Max(serialized.distance.floatValue, 0); } } @@ -605,7 +605,7 @@ static void DrawLightIntensityGUILayout(SerializedHDLight serialized, Editor own labelRect.height += interlineOffset; //handling of prefab overrides in a parent label - GUIContent parentLabel = s_Styles.lightIntensity; + GUIContent parentLabel = s_Styles.lightIntensity; parentLabel = EditorGUI.BeginProperty(labelRect, parentLabel, serialized.lightUnit); parentLabel = EditorGUI.BeginProperty(labelRect, parentLabel, serialized.intensity); { @@ -688,7 +688,7 @@ static void DrawEmissionContent(SerializedHDLight serialized, Editor owner) unitRect.width = k_UnitWidth + .5f; EditorGUI.PropertyField(valueRect, serialized.settings.colorTemperature, s_Styles.empty); - EditorGUI.Popup(unitRect, 0, new[] {"Kelvin"}); + EditorGUI.Popup(unitRect, 0, new[] { "Kelvin" }); EditorGUI.indentLevel -= 1; } @@ -784,7 +784,7 @@ static void DrawEmissionContent(SerializedHDLight serialized, Editor owner) if (EditorGUI.EndChangeCheck()) { SerializedProperty pointTex = serialized.iesPoint; - SerializedProperty spotTex = serialized.iesSpot; + SerializedProperty spotTex = serialized.iesSpot; if (iesAsset == null) { pointTex.objectReferenceValue = null; @@ -846,7 +846,7 @@ static void ShowCookieTextureWarnings(Texture cookie, bool useBaking) { int oldIndentLevel = EditorGUI.indentLevel; EditorGUI.indentLevel = 0; - GUIStyle wordWrap = new GUIStyle(EditorStyles.miniLabel){ wordWrap = true}; + GUIStyle wordWrap = new GUIStyle(EditorStyles.miniLabel) { wordWrap = true }; EditorGUILayout.LabelField(s_Styles.cookieTextureTypeError, wordWrap); if (GUILayout.Button("Fix", GUILayout.ExpandHeight(true))) { diff --git a/com.unity.render-pipelines.high-definition/Editor/Lighting/LightUnit/LightUnitSlider.cs b/com.unity.render-pipelines.high-definition/Editor/Lighting/LightUnit/LightUnitSlider.cs index f6356a5c89b..bbeec7ae5c0 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Lighting/LightUnit/LightUnitSlider.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Lighting/LightUnit/LightUnitSlider.cs @@ -16,12 +16,12 @@ class LightUnitSlider static class SliderConfig { - public const float k_IconSeparator = 0; - public const float k_MarkerWidth = 2; - public const float k_MarkerHeight = 2; + public const float k_IconSeparator = 0; + public const float k_MarkerWidth = 2; + public const float k_MarkerHeight = 2; public const float k_MarkerTooltipScale = 4; - public const float k_ThumbTooltipSize = 10; - public const float k_KnobSize = 10; + public const float k_ThumbTooltipSize = 10; + public const float k_KnobSize = 10; } protected static class SliderStyles @@ -109,11 +109,11 @@ void ClampValue(ref float value, Vector2 range) => void DoSliderMarker(Rect rect, float position, float value, string tooltip) { - const float width = SliderConfig.k_MarkerWidth; + const float width = SliderConfig.k_MarkerWidth; const float height = SliderConfig.k_MarkerHeight; var markerRect = rect; - markerRect.width = width; + markerRect.width = width; markerRect.height = height; // Vertically align with slider. @@ -142,10 +142,10 @@ void DoSliderMarker(Rect rect, float position, float value, string tooltip) // Scale the marker tooltip for easier discovery const float markerTooltipRectScale = SliderConfig.k_MarkerTooltipScale; var markerTooltipRect = markerRect; - markerTooltipRect.width *= markerTooltipRectScale; + markerTooltipRect.width *= markerTooltipRectScale; markerTooltipRect.height *= markerTooltipRectScale; - markerTooltipRect.x -= (markerTooltipRect.width * 0.5f) - 1; - markerTooltipRect.y -= (markerTooltipRect.height * 0.5f) - 1; + markerTooltipRect.x -= (markerTooltipRect.width * 0.5f) - 1; + markerTooltipRect.y -= (markerTooltipRect.height * 0.5f) - 1; EditorGUI.LabelField(markerTooltipRect, GetLightUnitTooltip(tooltip, value, m_Descriptor.unitName)); } @@ -195,14 +195,14 @@ void DoThumbTooltip(Rect rect, float position, float value, string tooltip) const float halfSize = SliderConfig.k_ThumbTooltipSize * 0.5f; var thumbMarkerRect = rect; - thumbMarkerRect.width = size; + thumbMarkerRect.width = size; thumbMarkerRect.height = size; // Vertically align with slider thumbMarkerRect.y += halfSize - 1f; // Horizontally place tooltip on the wheel, - thumbMarkerRect.x = rect.x + (rect.width - size) * position; + thumbMarkerRect.x = rect.x + (rect.width - size) * position; EditorGUI.LabelField(thumbMarkerRect, GetLightUnitTooltip(tooltip, value, m_Descriptor.unitName)); } @@ -306,7 +306,7 @@ public PiecewiseLightUnitSlider(LightUnitSliderUIDescriptor descriptor) : base(d Piece piece; piece.domain = new Vector2(x0, x1); - piece.range = new Vector2(y0, y1); + piece.range = new Vector2(y0, y1); ComputeTransformationParameters(x0, x1, y0, y1, out piece.directM, out piece.directB); @@ -383,7 +383,7 @@ protected override void DoSlider(Rect rect, ref float value, Vector2 sliderRange /// class PunctualLightUnitSlider : PiecewiseLightUnitSlider { - public PunctualLightUnitSlider(LightUnitSliderUIDescriptor descriptor) : base(descriptor) {} + public PunctualLightUnitSlider(LightUnitSliderUIDescriptor descriptor) : base(descriptor) { } private SerializedHDLight m_Light; private Editor m_Editor; @@ -504,8 +504,8 @@ void PrepareExponentialConstraints(float lo, float mi, float hi) // If for any reason the constraints are changed, then the function must be refit and the new coefficients found. // Note that we can't re-use the original PowerSlider instead due to how it forces a text field, which we don't want in this case. m_ExponentialConstraints.x = -3935.53965427f; - m_ExponentialConstraints.y = 5435.53965427f; - m_ExponentialConstraints.z = 1.48240556f; + m_ExponentialConstraints.y = 5435.53965427f; + m_ExponentialConstraints.z = 1.48240556f; } protected float ValueToSlider(float x) => Mathf.Log((x - m_ExponentialConstraints.x) / m_ExponentialConstraints.y) / m_ExponentialConstraints.z; @@ -583,9 +583,9 @@ void SliderWithTextureNoTextField(Rect rect, ref float value, Vector2 range, Lig internal class LightUnitSliderUIDrawer { static PiecewiseLightUnitSlider k_DirectionalLightUnitSlider; - static PunctualLightUnitSlider k_PunctualLightUnitSlider; + static PunctualLightUnitSlider k_PunctualLightUnitSlider; static PiecewiseLightUnitSlider k_ExposureSlider; - static TemperatureSlider k_TemperatureSlider; + static TemperatureSlider k_TemperatureSlider; static LightUnitSliderUIDrawer() { diff --git a/com.unity.render-pipelines.high-definition/Editor/Lighting/LightUnit/LightUnitSliderSettings.cs b/com.unity.render-pipelines.high-definition/Editor/Lighting/LightUnit/LightUnitSliderSettings.cs index 196c1462a97..68900a06fe6 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Lighting/LightUnit/LightUnitSliderSettings.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Lighting/LightUnit/LightUnitSliderSettings.cs @@ -10,7 +10,7 @@ struct LightUnitSliderUIDescriptor public LightUnitSliderUIDescriptor(LightUnitSliderUIRange[] valueRanges, float[] sliderDistribution, string cautionTooltip, string unitName, bool hasMarkers = true, bool clampValue = false) : this(valueRanges, sliderDistribution, cautionTooltip, cautionTooltip, unitName, hasMarkers, clampValue) - {} + { } public LightUnitSliderUIDescriptor(LightUnitSliderUIRange[] valueRanges, float[] sliderDistribution, string belowRangeTooltip, string aboveRangeTooltip, string unitName, bool hasMarkers = true, bool clampValue = false) @@ -44,7 +44,7 @@ struct LightUnitSliderUIRange public LightUnitSliderUIRange(Texture2D icon, string tooltip, Vector2 value) // If no preset value provided, then by default it is the average of the value range. : this(icon, tooltip, value, 0.5f * (value.x + value.y)) - {} + { } public LightUnitSliderUIRange(Texture2D icon, string tooltip, Vector2 value, float presetValue) { @@ -67,8 +67,8 @@ public LightUnitSliderUIRange(Texture2D icon, string tooltip, Vector2 value, flo }; public GUIContent content; - public Vector2 value; - public float presetValue; + public Vector2 value; + public float presetValue; } static class LightUnitSliderDescriptors @@ -151,7 +151,7 @@ private static class LightUnitValueRanges private static class LightUnitSliderDistributions { // Warning: All of these values need to be kept in sync with their associated descriptor's set of value ranges. - public static readonly float[] LuxDistribution = {0.0f, 0.05f, 0.5f, 0.9f, 1.0f}; + public static readonly float[] LuxDistribution = { 0.0f, 0.05f, 0.5f, 0.9f, 1.0f }; private const float LumenStep = 1 / 4f; public static readonly float[] LumenDistribution = @@ -190,64 +190,64 @@ static Texture2D GetLightUnitIcon(string name) } // TODO: Move all light unit icons from the package into the built-in resources. - public static Texture2D BlueSky = GetLightUnitIcon("BlueSky"); - public static Texture2D ClearSky = GetLightUnitIcon("ClearSky"); - public static Texture2D Candlelight = GetLightUnitIcon("Candlelight"); - public static Texture2D DecorativeLight = GetLightUnitIcon("DecorativeLight"); - public static Texture2D DirectSunlight = GetLightUnitIcon("DirectSunlight"); - public static Texture2D ExteriorLight = GetLightUnitIcon("ExteriorLight"); + public static Texture2D BlueSky = GetLightUnitIcon("BlueSky"); + public static Texture2D ClearSky = GetLightUnitIcon("ClearSky"); + public static Texture2D Candlelight = GetLightUnitIcon("Candlelight"); + public static Texture2D DecorativeLight = GetLightUnitIcon("DecorativeLight"); + public static Texture2D DirectSunlight = GetLightUnitIcon("DirectSunlight"); + public static Texture2D ExteriorLight = GetLightUnitIcon("ExteriorLight"); public static Texture2D IntenseAreaLight = GetLightUnitIcon("IntenseAreaLight"); - public static Texture2D InteriorLight = GetLightUnitIcon("InteriorLight"); - public static Texture2D MediumAreaLight = GetLightUnitIcon("MediumAreaLight"); - public static Texture2D MoonlessNight = GetLightUnitIcon("MoonlessNight"); - public static Texture2D Moonlight = GetLightUnitIcon("Moonlight"); - public static Texture2D Overcast = GetLightUnitIcon("Overcast"); - public static Texture2D CloudySky = GetLightUnitIcon("CloudySky"); - public static Texture2D SoftAreaLight = GetLightUnitIcon("SoftAreaLight"); - public static Texture2D SunriseSunset = GetLightUnitIcon("SunriseSunset"); - public static Texture2D VeryBrightSun = GetLightUnitIcon("VeryBrightSun"); - public static Texture2D BrightSky = GetLightUnitIcon("BrightSky"); - public static Texture2D Shade = GetLightUnitIcon("Shade"); - public static Texture2D Fluorescent = GetLightUnitIcon("Fluorescent"); + public static Texture2D InteriorLight = GetLightUnitIcon("InteriorLight"); + public static Texture2D MediumAreaLight = GetLightUnitIcon("MediumAreaLight"); + public static Texture2D MoonlessNight = GetLightUnitIcon("MoonlessNight"); + public static Texture2D Moonlight = GetLightUnitIcon("Moonlight"); + public static Texture2D Overcast = GetLightUnitIcon("Overcast"); + public static Texture2D CloudySky = GetLightUnitIcon("CloudySky"); + public static Texture2D SoftAreaLight = GetLightUnitIcon("SoftAreaLight"); + public static Texture2D SunriseSunset = GetLightUnitIcon("SunriseSunset"); + public static Texture2D VeryBrightSun = GetLightUnitIcon("VeryBrightSun"); + public static Texture2D BrightSky = GetLightUnitIcon("BrightSky"); + public static Texture2D Shade = GetLightUnitIcon("Shade"); + public static Texture2D Fluorescent = GetLightUnitIcon("Fluorescent"); } private static class LightUnitTooltips { // Caution - public const string k_SunCaution = "Higher than Sunlight"; - public const string k_PunctualCaution = "Very high intensity light"; + public const string k_SunCaution = "Higher than Sunlight"; + public const string k_PunctualCaution = "Very high intensity light"; public const string k_ExposureBelowCaution = "Lower than a moonless scene"; public const string k_ExposureAboveCaution = "Higher than a sunlit scene"; - public const string k_TemperatureCaution = ""; + public const string k_TemperatureCaution = ""; // Lux / Directional - public const string k_LuxBrightSky = "High Sun"; - public const string k_LuxOvercastSky = "Cloudy"; - public const string k_LuxSunriseSunset = "Low Sun"; - public const string k_LuxMoonlight = "Moon"; + public const string k_LuxBrightSky = "High Sun"; + public const string k_LuxOvercastSky = "Cloudy"; + public const string k_LuxSunriseSunset = "Low Sun"; + public const string k_LuxMoonlight = "Moon"; // Punctual - public const string k_PunctualExterior = "Exterior"; - public const string k_PunctualInterior = "Interior"; + public const string k_PunctualExterior = "Exterior"; + public const string k_PunctualInterior = "Interior"; public const string k_PunctualDecorative = "Decorative"; - public const string k_PunctualCandle = "Candle"; + public const string k_PunctualCandle = "Candle"; // Exposure - public const string k_ExposureBrightSky = "Sunlit Scene"; - public const string k_ExposureOvercastSky = "Cloudy Scene"; + public const string k_ExposureBrightSky = "Sunlit Scene"; + public const string k_ExposureOvercastSky = "Cloudy Scene"; public const string k_ExposureSunriseSunset = "Low Sun Scene"; - public const string k_ExposureInterior = "Interior Scene"; - public const string k_ExposureMoonlitSky = "Moonlit Scene"; + public const string k_ExposureInterior = "Interior Scene"; + public const string k_ExposureMoonlitSky = "Moonlit Scene"; public const string k_ExposureMoonlessNight = "Moonless Scene"; // Temperature - public const string k_TemperatureBlueSky = "Blue Sky"; - public const string k_TemperatureShade = "Shade (Clear Sky)"; - public const string k_TemperatureCloudySky = "Cloudy Skylight"; + public const string k_TemperatureBlueSky = "Blue Sky"; + public const string k_TemperatureShade = "Shade (Clear Sky)"; + public const string k_TemperatureCloudySky = "Cloudy Skylight"; public const string k_TemperatureDirectSunlight = "Direct Sunlight"; - public const string k_TemperatureFluorescent = "Fluorescent Light"; - public const string k_TemperatureIncandescent = "Incandescent Light"; - public const string k_TemperatureCandle = "Candlelight"; + public const string k_TemperatureFluorescent = "Fluorescent Light"; + public const string k_TemperatureIncandescent = "Incandescent Light"; + public const string k_TemperatureCandle = "Candlelight"; } } } diff --git a/com.unity.render-pipelines.high-definition/Editor/Lighting/LightmappingHDRP.cs b/com.unity.render-pipelines.high-definition/Editor/Lighting/LightmappingHDRP.cs index 4b877aa9e8d..502b247eccb 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Lighting/LightmappingHDRP.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Lighting/LightmappingHDRP.cs @@ -99,7 +99,7 @@ public enum Mode /// Returns a with default values. public static TextureSize NewDefault() { - return new TextureSize {mode = Mode.UseProbeResolution}; + return new TextureSize { mode = Mode.UseProbeResolution }; } /// diff --git a/com.unity.render-pipelines.high-definition/Editor/Lighting/ProbeVolume/ProbeVolumeEditor.cs b/com.unity.render-pipelines.high-definition/Editor/Lighting/ProbeVolume/ProbeVolumeEditor.cs index 5a679717135..cb4f6b91323 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Lighting/ProbeVolume/ProbeVolumeEditor.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Lighting/ProbeVolume/ProbeVolumeEditor.cs @@ -153,7 +153,7 @@ protected void OnSceneGUI() probeVolume.parameters.size = shapeBox.size; Vector3 delta = probeVolume.transform.rotation * shapeBox.center - probeVolume.transform.position; - probeVolume.transform.position += delta;; + probeVolume.transform.position += delta; ; } } break; diff --git a/com.unity.render-pipelines.high-definition/Editor/Lighting/ProbeVolume/ProbeVolumeUI.Drawer.cs b/com.unity.render-pipelines.high-definition/Editor/Lighting/ProbeVolume/ProbeVolumeUI.Drawer.cs index a02dd5cc8e1..3b10c0a38b5 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Lighting/ProbeVolume/ProbeVolumeUI.Drawer.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Lighting/ProbeVolume/ProbeVolumeUI.Drawer.cs @@ -265,15 +265,15 @@ static void Drawer_VolumeContent(SerializedProbeVolume serialized, Editor owner) EditorGUI.BeginChangeCheck(); float distanceFadeStart = EditorGUILayout.FloatField(Styles.s_DistanceFadeStartLabel, serialized.distanceFadeStart.floatValue); - float distanceFadeEnd = EditorGUILayout.FloatField(Styles.s_DistanceFadeEndLabel, serialized.distanceFadeEnd.floatValue); + float distanceFadeEnd = EditorGUILayout.FloatField(Styles.s_DistanceFadeEndLabel, serialized.distanceFadeEnd.floatValue); if (EditorGUI.EndChangeCheck()) { distanceFadeStart = Mathf.Max(0, distanceFadeStart); - distanceFadeEnd = Mathf.Max(distanceFadeStart, distanceFadeEnd); + distanceFadeEnd = Mathf.Max(distanceFadeStart, distanceFadeEnd); serialized.distanceFadeStart.floatValue = distanceFadeStart; - serialized.distanceFadeEnd.floatValue = distanceFadeEnd; + serialized.distanceFadeEnd.floatValue = distanceFadeEnd; } } diff --git a/com.unity.render-pipelines.high-definition/Editor/Lighting/ProbeVolume/ProbeVolumeUI.Skin.cs b/com.unity.render-pipelines.high-definition/Editor/Lighting/ProbeVolume/ProbeVolumeUI.Skin.cs index 1a361ff7dfb..282f2cae58e 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Lighting/ProbeVolume/ProbeVolumeUI.Skin.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Lighting/ProbeVolume/ProbeVolumeUI.Skin.cs @@ -30,7 +30,7 @@ internal static class Styles internal static readonly GUIContent s_AdvancedModeContent = new GUIContent("Advanced", "Exposes advanced parameters."); internal static readonly GUIContent s_DistanceFadeStartLabel = new GUIContent("Distance Fade Start"); - internal static readonly GUIContent s_DistanceFadeEndLabel = new GUIContent("Distance Fade End"); + internal static readonly GUIContent s_DistanceFadeEndLabel = new GUIContent("Distance Fade End"); internal static readonly GUIContent s_ProbeSpacingModeLabel = new GUIContent("Probe Spacing Mode"); internal static readonly GUIContent s_ResolutionXLabel = new GUIContent("Resolution X", "Modify the resolution (number of probes in X)"); internal static readonly GUIContent s_ResolutionYLabel = new GUIContent("Resolution Y", "Modify the resolution (number of probes in Y)"); diff --git a/com.unity.render-pipelines.high-definition/Editor/Lighting/ProbeVolume/SerializedProbeVolume.cs b/com.unity.render-pipelines.high-definition/Editor/Lighting/ProbeVolume/SerializedProbeVolume.cs index 75e0735da2b..cc84bda9b4d 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Lighting/ProbeVolume/SerializedProbeVolume.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Lighting/ProbeVolume/SerializedProbeVolume.cs @@ -71,7 +71,7 @@ internal SerializedProbeVolume(SerializedObject serializedObject) advancedFade = probeVolumeParams.FindPropertyRelative("advancedFade"); distanceFadeStart = probeVolumeParams.FindPropertyRelative("distanceFadeStart"); - distanceFadeEnd = probeVolumeParams.FindPropertyRelative("distanceFadeEnd"); + distanceFadeEnd = probeVolumeParams.FindPropertyRelative("distanceFadeEnd"); backfaceTolerance = probeVolumeParams.FindPropertyRelative("backfaceTolerance"); dilationIterations = probeVolumeParams.FindPropertyRelative("dilationIterations"); diff --git a/com.unity.render-pipelines.high-definition/Editor/Lighting/Reflection/HDBakedReflectionSystem.cs b/com.unity.render-pipelines.high-definition/Editor/Lighting/Reflection/HDBakedReflectionSystem.cs index a90c253eb0c..dc6d4fd4040 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Lighting/Reflection/HDBakedReflectionSystem.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Lighting/Reflection/HDBakedReflectionSystem.cs @@ -179,7 +179,7 @@ IScriptableBakedReflectionSystemStageNotifier handle } else { - fixed(HDProbeBakedState* oldBakedStates = &m_HDProbeBakedStates[0]) + fixed (HDProbeBakedState* oldBakedStates = &m_HDProbeBakedStates[0]) { // == 3. == // Compare hashes between baked probe states and desired probe states @@ -351,7 +351,7 @@ IScriptableBakedReflectionSystemStageNotifier handle Array.Resize(ref m_HDProbeBakedStates, targetSize); if (targetSize > 0) { - fixed(HDProbeBakedState* bakedStates = &m_HDProbeBakedStates[0]) + fixed (HDProbeBakedState* bakedStates = &m_HDProbeBakedStates[0]) { UnsafeUtility.MemCpy( bakedStates, diff --git a/com.unity.render-pipelines.high-definition/Editor/Lighting/Reflection/HDProbeEditor.cs b/com.unity.render-pipelines.high-definition/Editor/Lighting/Reflection/HDProbeEditor.cs index 864f398b4f4..22c0ecca50b 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Lighting/Reflection/HDProbeEditor.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Lighting/Reflection/HDProbeEditor.cs @@ -111,8 +111,8 @@ protected virtual void Draw(TSerialized serialized, Editor owner) ).Draw(serialized, owner); } - protected virtual void DrawHandles(TSerialized serialized, Editor owner) {} - protected virtual void DrawAdditionalCaptureSettings(TSerialized serialiezed, Editor owner) {} + protected virtual void DrawHandles(TSerialized serialized, Editor owner) { } + protected virtual void DrawAdditionalCaptureSettings(TSerialized serialiezed, Editor owner) { } protected void OnSceneGUI() { diff --git a/com.unity.render-pipelines.high-definition/Editor/Lighting/Reflection/HDProbeUI.Drawers.cs b/com.unity.render-pipelines.high-definition/Editor/Lighting/Reflection/HDProbeUI.Drawers.cs index a4ab54ffce1..91debe5e5d8 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Lighting/Reflection/HDProbeUI.Drawers.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Lighting/Reflection/HDProbeUI.Drawers.cs @@ -36,12 +36,12 @@ internal interface IProbeUISettingsProvider } // Constants - const EditMode.SceneViewEditMode EditBaseShape = (EditMode.SceneViewEditMode) 100; - const EditMode.SceneViewEditMode EditInfluenceShape = (EditMode.SceneViewEditMode) 101; - const EditMode.SceneViewEditMode EditInfluenceNormalShape = (EditMode.SceneViewEditMode) 102; - const EditMode.SceneViewEditMode EditCapturePosition = (EditMode.SceneViewEditMode) 103; - const EditMode.SceneViewEditMode EditMirrorPosition = (EditMode.SceneViewEditMode) 104; - const EditMode.SceneViewEditMode EditMirrorRotation = (EditMode.SceneViewEditMode) 105; + const EditMode.SceneViewEditMode EditBaseShape = (EditMode.SceneViewEditMode)100; + const EditMode.SceneViewEditMode EditInfluenceShape = (EditMode.SceneViewEditMode)101; + const EditMode.SceneViewEditMode EditInfluenceNormalShape = (EditMode.SceneViewEditMode)102; + const EditMode.SceneViewEditMode EditCapturePosition = (EditMode.SceneViewEditMode)103; + const EditMode.SceneViewEditMode EditMirrorPosition = (EditMode.SceneViewEditMode)104; + const EditMode.SceneViewEditMode EditMirrorRotation = (EditMode.SceneViewEditMode)105; //Note: EditMode.SceneViewEditMode.ReflectionProbeOrigin is still used //by legacy reflection probe and have its own mecanism that we don't want @@ -182,11 +182,11 @@ public static void DrawPrimarySettings(SerializedHDProbe serialized, Editor owne { #endif - // Probe Mode - EditorGUILayout.IntPopup(serialized.probeSettings.mode, k_ModeContents, k_ModeValues, k_BakeTypeContent); + // Probe Mode + EditorGUILayout.IntPopup(serialized.probeSettings.mode, k_ModeContents, k_ModeValues, k_BakeTypeContent); #if !ENABLE_BAKED_PLANAR - } + } #endif diff --git a/com.unity.render-pipelines.high-definition/Editor/Lighting/Reflection/HDScreenSpaceReflectionEditor.cs b/com.unity.render-pipelines.high-definition/Editor/Lighting/Reflection/HDScreenSpaceReflectionEditor.cs index 075ab972199..ba9e14989b8 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Lighting/Reflection/HDScreenSpaceReflectionEditor.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Lighting/Reflection/HDScreenSpaceReflectionEditor.cs @@ -42,36 +42,36 @@ class HDScreenSpaceReflectionEditor : VolumeComponentWithQualityEditor public override void OnEnable() { var o = new PropertyFetcher(serializedObject); - m_Enable = Unpack(o.Find(x => x.enabled)); - m_UsedAlgorithm = Unpack(o.Find(x => x.usedAlgorithm)); - m_RayTracing = Unpack(o.Find(x => x.rayTracing)); + m_Enable = Unpack(o.Find(x => x.enabled)); + m_UsedAlgorithm = Unpack(o.Find(x => x.usedAlgorithm)); + m_RayTracing = Unpack(o.Find(x => x.rayTracing)); // Shared data - m_MinSmoothness = Unpack(o.Find(x => x.minSmoothness)); - m_SmoothnessFadeStart = Unpack(o.Find(x => x.smoothnessFadeStart)); - m_ReflectSky = Unpack(o.Find(x => x.reflectSky)); + m_MinSmoothness = Unpack(o.Find(x => x.minSmoothness)); + m_SmoothnessFadeStart = Unpack(o.Find(x => x.smoothnessFadeStart)); + m_ReflectSky = Unpack(o.Find(x => x.reflectSky)); // SSR Data - m_DepthBufferThickness = Unpack(o.Find(x => x.depthBufferThickness)); - m_RayMaxIterations = Unpack(o.Find(x => x.rayMaxIterations)); - m_ScreenFadeDistance = Unpack(o.Find(x => x.screenFadeDistance)); - m_AccumulationFactor = Unpack(o.Find(x => x.accumulationFactor)); + m_DepthBufferThickness = Unpack(o.Find(x => x.depthBufferThickness)); + m_RayMaxIterations = Unpack(o.Find(x => x.rayMaxIterations)); + m_ScreenFadeDistance = Unpack(o.Find(x => x.screenFadeDistance)); + m_AccumulationFactor = Unpack(o.Find(x => x.accumulationFactor)); // Generic ray tracing - m_LayerMask = Unpack(o.Find(x => x.layerMask)); - m_RayLength = Unpack(o.Find(x => x.rayLength)); - m_ClampValue = Unpack(o.Find(x => x.clampValue)); - m_Denoise = Unpack(o.Find(x => x.denoise)); - m_DenoiserRadius = Unpack(o.Find(x => x.denoiserRadius)); - m_AffectsSmoothSurfaces = Unpack(o.Find(x => x.affectSmoothSurfaces)); - m_Mode = Unpack(o.Find(x => x.mode)); + m_LayerMask = Unpack(o.Find(x => x.layerMask)); + m_RayLength = Unpack(o.Find(x => x.rayLength)); + m_ClampValue = Unpack(o.Find(x => x.clampValue)); + m_Denoise = Unpack(o.Find(x => x.denoise)); + m_DenoiserRadius = Unpack(o.Find(x => x.denoiserRadius)); + m_AffectsSmoothSurfaces = Unpack(o.Find(x => x.affectSmoothSurfaces)); + m_Mode = Unpack(o.Find(x => x.mode)); // Performance - m_FullResolution = Unpack(o.Find(x => x.fullResolution)); + m_FullResolution = Unpack(o.Find(x => x.fullResolution)); // Quality - m_SampleCount = Unpack(o.Find(x => x.sampleCount)); - m_BounceCount = Unpack(o.Find(x => x.bounceCount)); + m_SampleCount = Unpack(o.Find(x => x.sampleCount)); + m_BounceCount = Unpack(o.Find(x => x.bounceCount)); base.OnEnable(); } @@ -102,7 +102,7 @@ void RayTracingQualityModeGUI() { PropertyField(m_MinSmoothness, k_MinimumSmoothnessText); PropertyField(m_SmoothnessFadeStart, k_SmoothnessFadeStartText); - m_SmoothnessFadeStart.value.floatValue = Mathf.Max(m_MinSmoothness.value.floatValue, m_SmoothnessFadeStart.value.floatValue); + m_SmoothnessFadeStart.value.floatValue = Mathf.Max(m_MinSmoothness.value.floatValue, m_SmoothnessFadeStart.value.floatValue); PropertyField(m_RayLength, k_RayLengthText); PropertyField(m_ClampValue, k_ClampValueText); PropertyField(m_SampleCount, k_SampleCountText); @@ -125,7 +125,7 @@ void RayTracingPerformanceModeGUI() { PropertyField(m_MinSmoothness, k_MinimumSmoothnessText); PropertyField(m_SmoothnessFadeStart, k_SmoothnessFadeStartText); - m_SmoothnessFadeStart.value.floatValue = Mathf.Max(m_MinSmoothness.value.floatValue, m_SmoothnessFadeStart.value.floatValue); + m_SmoothnessFadeStart.value.floatValue = Mathf.Max(m_MinSmoothness.value.floatValue, m_SmoothnessFadeStart.value.floatValue); PropertyField(m_RayLength, k_RayLengthText); PropertyField(m_ClampValue, k_ClampValueText); PropertyField(m_FullResolution, k_FullResolutionText); @@ -206,7 +206,7 @@ public override void OnInspectorGUI() PropertyField(m_MinSmoothness, k_MinimumSmoothnessText); PropertyField(m_SmoothnessFadeStart, k_SmoothnessFadeStartText); PropertyField(m_ReflectSky, k_ReflectSkyText); - m_SmoothnessFadeStart.value.floatValue = Mathf.Max(m_MinSmoothness.value.floatValue, m_SmoothnessFadeStart.value.floatValue); + m_SmoothnessFadeStart.value.floatValue = Mathf.Max(m_MinSmoothness.value.floatValue, m_SmoothnessFadeStart.value.floatValue); PropertyField(m_ScreenFadeDistance, k_ScreenFaceDistanceText); PropertyField(m_DepthBufferThickness, k_DepthBufferThicknessText); diff --git a/com.unity.render-pipelines.high-definition/Editor/Lighting/Shadow/ShadowCascadeGUI.cs b/com.unity.render-pipelines.high-definition/Editor/Lighting/Shadow/ShadowCascadeGUI.cs index 60675a2addd..91468e26bab 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Lighting/Shadow/ShadowCascadeGUI.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Lighting/Shadow/ShadowCascadeGUI.cs @@ -280,7 +280,7 @@ static void HandleCascadeSliderGUI(ref float[] normalizedCascadePartitions, ref if (hotPartitionHandleIndex >= 0) { if (hotPartitionHandleIndex < 100) - s_DragCache = new DragCache(hotPartitionHandleIndex, normalizedCascadePartitions[hotPartitionHandleIndex], hotPartitionHandleIndex >= endPartitionBordersPercent.Length ? 0f : endPartitionBordersPercent[hotPartitionHandleIndex], currentEvent.mousePosition, isEndBlendArea: false); + s_DragCache = new DragCache(hotPartitionHandleIndex, normalizedCascadePartitions[hotPartitionHandleIndex], hotPartitionHandleIndex >= endPartitionBordersPercent.Length ? 0f : endPartitionBordersPercent[hotPartitionHandleIndex], currentEvent.mousePosition, isEndBlendArea: false); else { int endIndex = hotPartitionHandleIndex - 100; diff --git a/com.unity.render-pipelines.high-definition/Editor/Lighting/VolumetricLighting/DensityVolumeUI.Drawer.cs b/com.unity.render-pipelines.high-definition/Editor/Lighting/VolumetricLighting/DensityVolumeUI.Drawer.cs index 20f66d22017..b6ebde65e54 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Lighting/VolumetricLighting/DensityVolumeUI.Drawer.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Lighting/VolumetricLighting/DensityVolumeUI.Drawer.cs @@ -167,10 +167,10 @@ static void Drawer_VolumeContent(SerializedDensityVolume serialized, Editor owne if (EditorGUI.EndChangeCheck()) { float distanceFadeStart = Mathf.Max(0, serialized.distanceFadeStart.floatValue); - float distanceFadeEnd = Mathf.Max(distanceFadeStart, serialized.distanceFadeEnd.floatValue); + float distanceFadeEnd = Mathf.Max(distanceFadeStart, serialized.distanceFadeEnd.floatValue); serialized.distanceFadeStart.floatValue = distanceFadeStart; - serialized.distanceFadeEnd.floatValue = distanceFadeEnd; + serialized.distanceFadeEnd.floatValue = distanceFadeEnd; } } } diff --git a/com.unity.render-pipelines.high-definition/Editor/Lighting/VolumetricLighting/DensityVolumeUI.Skin.cs b/com.unity.render-pipelines.high-definition/Editor/Lighting/VolumetricLighting/DensityVolumeUI.Skin.cs index a9460538748..d5d09097620 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Lighting/VolumetricLighting/DensityVolumeUI.Skin.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Lighting/VolumetricLighting/DensityVolumeUI.Skin.cs @@ -26,7 +26,7 @@ internal static class Styles public static readonly GUIContent s_ManipulatonTypeContent = EditorGUIUtility.TrTextContent("Per Axis Control", "When checked, each face can be manipulated separatly. This also include fading options."); public static readonly GUIContent s_DistanceFadeStartLabel = new GUIContent("Distance Fade Start"); - public static readonly GUIContent s_DistanceFadeEndLabel = new GUIContent("Distance Fade End"); + public static readonly GUIContent s_DistanceFadeEndLabel = new GUIContent("Distance Fade End"); public static readonly Color k_GizmoColorBase = new Color(180 / 255f, 180 / 255f, 180 / 255f, 8 / 255f).gamma; diff --git a/com.unity.render-pipelines.high-definition/Editor/Lighting/VolumetricLighting/SerializedDensityVolume.cs b/com.unity.render-pipelines.high-definition/Editor/Lighting/VolumetricLighting/SerializedDensityVolume.cs index 11ebeae73c0..6c3c088ccc3 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Lighting/VolumetricLighting/SerializedDensityVolume.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Lighting/VolumetricLighting/SerializedDensityVolume.cs @@ -53,7 +53,7 @@ public SerializedDensityVolume(SerializedObject serializedObject) invertFade = densityParams.FindPropertyRelative("invertFade"); distanceFadeStart = densityParams.FindPropertyRelative("distanceFadeStart"); - distanceFadeEnd = densityParams.FindPropertyRelative("distanceFadeEnd"); + distanceFadeEnd = densityParams.FindPropertyRelative("distanceFadeEnd"); } public void Apply() diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/Decal/DecalProjectorEditor.cs b/com.unity.render-pipelines.high-definition/Editor/Material/Decal/DecalProjectorEditor.cs index bb7750b3313..e0ecf42cddc 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/Decal/DecalProjectorEditor.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/Decal/DecalProjectorEditor.cs @@ -502,7 +502,7 @@ void UpdateSizeOfOneTarget(DecalProjector currentTarget) if (float.IsNaN(saved[axe])) { float oldSize = currentTarget.m_Size[axe]; - saved[axe] = Mathf.Abs(oldSize) <= Mathf.Epsilon ? 0f : currentTarget.m_Offset[axe] / oldSize; + saved[axe] = Mathf.Abs(oldSize) <= Mathf.Epsilon ? 0f : currentTarget.m_Offset[axe] / oldSize; ratioSizePivotPositionSaved[currentTarget] = saved; } diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/Decal/ShaderGraph/CreateDecalShaderGraph.cs b/com.unity.render-pipelines.high-definition/Editor/Material/Decal/ShaderGraph/CreateDecalShaderGraph.cs index 32d2a92c6aa..74fb6fbb4cc 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/Decal/ShaderGraph/CreateDecalShaderGraph.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/Decal/ShaderGraph/CreateDecalShaderGraph.cs @@ -27,7 +27,7 @@ public static void CreateDecalGraph() BlockFields.SurfaceDescription.Emission, }; - GraphUtil.CreateNewGraphWithOutputs(new[] {target}, blockDescriptors); + GraphUtil.CreateNewGraphWithOutputs(new[] { target }, blockDescriptors); } } } diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/Decal/ShaderGraph/DecalSubTarget.cs b/com.unity.render-pipelines.high-definition/Editor/Material/Decal/ShaderGraph/DecalSubTarget.cs index dadf13148ee..fc00ab55a8d 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/Decal/ShaderGraph/DecalSubTarget.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/Decal/ShaderGraph/DecalSubTarget.cs @@ -21,7 +21,7 @@ sealed partial class DecalSubTarget : HDSubTarget, ILegacyTarget, IRequiresData< static readonly GUID kSubTargetSourceCodeGuid = new GUID("3ec927dfcb5d60e4883b2c224857b6c2"); // DecalSubTarget.cs protected override string templatePath => $"{HDUtils.GetHDRenderPipelinePath()}Editor/Material/Decal/ShaderGraph/DecalPass.template"; - protected override string[] templateMaterialDirectories => new string[] + protected override string[] templateMaterialDirectories => new string[] { $"{HDUtils.GetHDRenderPipelinePath()}Editor/Material/ShaderGraph/Templates/" }; @@ -78,26 +78,26 @@ protected override void CollectPassKeywords(ref PassDescriptor pass) } } - public static FieldDescriptor AffectsAlbedo = new FieldDescriptor(kMaterial, "AffectsAlbedo", ""); - public static FieldDescriptor AffectsNormal = new FieldDescriptor(kMaterial, "AffectsNormal", ""); - public static FieldDescriptor AffectsEmission = new FieldDescriptor(kMaterial, "AffectsEmission", ""); - public static FieldDescriptor AffectsMetal = new FieldDescriptor(kMaterial, "AffectsMetal", ""); - public static FieldDescriptor AffectsAO = new FieldDescriptor(kMaterial, "AffectsAO", ""); - public static FieldDescriptor AffectsSmoothness = new FieldDescriptor(kMaterial, "AffectsSmoothness", ""); - public static FieldDescriptor AffectsMaskMap = new FieldDescriptor(kMaterial, "AffectsMaskMap", ""); - public static FieldDescriptor DecalDefault = new FieldDescriptor(kMaterial, "DecalDefault", ""); + public static FieldDescriptor AffectsAlbedo = new FieldDescriptor(kMaterial, "AffectsAlbedo", ""); + public static FieldDescriptor AffectsNormal = new FieldDescriptor(kMaterial, "AffectsNormal", ""); + public static FieldDescriptor AffectsEmission = new FieldDescriptor(kMaterial, "AffectsEmission", ""); + public static FieldDescriptor AffectsMetal = new FieldDescriptor(kMaterial, "AffectsMetal", ""); + public static FieldDescriptor AffectsAO = new FieldDescriptor(kMaterial, "AffectsAO", ""); + public static FieldDescriptor AffectsSmoothness = new FieldDescriptor(kMaterial, "AffectsSmoothness", ""); + public static FieldDescriptor AffectsMaskMap = new FieldDescriptor(kMaterial, "AffectsMaskMap", ""); + public static FieldDescriptor DecalDefault = new FieldDescriptor(kMaterial, "DecalDefault", ""); public override void GetFields(ref TargetFieldContext context) { // Decal properties - context.AddField(AffectsAlbedo, decalData.affectsAlbedo); - context.AddField(AffectsNormal, decalData.affectsNormal); - context.AddField(AffectsEmission, decalData.affectsEmission); - context.AddField(AffectsMetal, decalData.affectsMetal); - context.AddField(AffectsAO, decalData.affectsAO); - context.AddField(AffectsSmoothness, decalData.affectsSmoothness); - context.AddField(AffectsMaskMap, decalData.affectsMaskmap); - context.AddField(DecalDefault, decalData.affectsAlbedo || decalData.affectsNormal || decalData.affectsMetal || + context.AddField(AffectsAlbedo, decalData.affectsAlbedo); + context.AddField(AffectsNormal, decalData.affectsNormal); + context.AddField(AffectsEmission, decalData.affectsEmission); + context.AddField(AffectsMetal, decalData.affectsMetal); + context.AddField(AffectsAO, decalData.affectsAO); + context.AddField(AffectsSmoothness, decalData.affectsSmoothness); + context.AddField(AffectsMaskMap, decalData.affectsMaskmap); + context.AddField(DecalDefault, decalData.affectsAlbedo || decalData.affectsNormal || decalData.affectsMetal || decalData.affectsAO || decalData.affectsSmoothness); context.AddField(Fields.LodCrossFade, decalData.supportLodCrossFade); } @@ -142,7 +142,7 @@ public override void CollectShaderProperties(PropertyCollector collector, Genera floatType = FloatType.Enum, value = (int)DecalMeshDepthBiasType.DepthBias, enumNames = { "Depth Bias", "View Bias" }, - enumValues = { (int)DecalMeshDepthBiasType.DepthBias, (int)DecalMeshDepthBiasType.ViewBias}, + enumValues = { (int)DecalMeshDepthBiasType.DepthBias, (int)DecalMeshDepthBiasType.ViewBias }, hidden = true }); diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/DiffusionProfile/DiffusionProfileMaterialUI.cs b/com.unity.render-pipelines.high-definition/Editor/Material/DiffusionProfile/DiffusionProfileMaterialUI.cs index 0afea6a1e6d..d57926e9d2a 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/DiffusionProfile/DiffusionProfileMaterialUI.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/DiffusionProfile/DiffusionProfileMaterialUI.cs @@ -8,11 +8,12 @@ namespace UnityEditor.Rendering.HighDefinition { static class DiffusionProfileMaterialUI { - static GUIContent diffusionProfileNotInHDRPAsset = new GUIContent("Make sure this Diffusion Profile is referenced in either a Diffusion Profile Override or the HDRP Default Settings. If the Diffusion Profile is not referenced in either, HDRP cannot use it. To add a reference to the Diffusion Profile in the HDRP Default Settings, press Fix.", EditorGUIUtility.IconContent("console.infoicon").image); + static GUIContent diffusionProfileNotInHDRPAsset = new GUIContent("Make sure this Diffusion Profile is referenced in either a Diffusion Profile Override or the HDRP Default Settings. If the Diffusion Profile is not referenced in either, HDRP cannot use it. To add a reference to the Diffusion Profile in the HDRP Default Settings, press Fix.", EditorGUIUtility.IconContent("console.infoicon").image); public static bool IsSupported(MaterialEditor materialEditor) { - return !materialEditor.targets.Any(o => { + return !materialEditor.targets.Any(o => + { Material m = o as Material; return !m.HasProperty("_DiffusionProfileAsset") || !m.HasProperty("_DiffusionProfileHash"); }); @@ -30,7 +31,7 @@ public static void OnGUI(MaterialEditor materialEditor, MaterialProperty diffusi if (EditorGUI.EndChangeCheck()) { Vector4 newGuid = Vector4.zero; - float hash = 0; + float hash = 0; if (diffusionProfile != null) { diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/DiffusionProfile/DiffusionProfileSettingsEditor.Styles.cs b/com.unity.render-pipelines.high-definition/Editor/Material/DiffusionProfile/DiffusionProfileSettingsEditor.Styles.cs index bb4fac4865a..a0eeae896fd 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/DiffusionProfile/DiffusionProfileSettingsEditor.Styles.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/DiffusionProfile/DiffusionProfileSettingsEditor.Styles.cs @@ -6,33 +6,33 @@ sealed partial class DiffusionProfileSettingsEditor { sealed class Styles { - public readonly GUIContent profilePreview0 = new GUIContent("Diffusion Profile Preview"); - public readonly GUIContent profilePreview1 = new GUIContent("Shows the fraction of light scattered from the source (center)."); - public readonly GUIContent profilePreview2 = new GUIContent("The distance to the boundary of the image corresponds to the Max Radius."); - public readonly GUIContent profilePreview3 = new GUIContent("Note that the intensity of pixels around the center may be clipped."); - public readonly GUIContent transmittancePreview0 = new GUIContent("Transmittance Preview"); - public readonly GUIContent transmittancePreview1 = new GUIContent("Shows the fraction of light passing through the object for thickness values from the remap."); - public readonly GUIContent transmittancePreview2 = new GUIContent("Can be viewed as a cross section of a slab of material illuminated by white light from the left."); - public readonly GUIContent profileScatteringDistance = new GUIContent("Scattering Distance", "Determines the shape of the profile, and the blur radius of the filter per color channel. Alpha is ignored."); - public readonly GUIContent profileTransmissionTint = new GUIContent("Transmission tint", "Color which tints transmitted light. Alpha is ignored."); - public readonly GUIContent profileMaxRadius = new GUIContent("Max Radius", "Effective radius of the filter (in millimeters). The blur is energy-preserving, so a wide filter results in a large area with small contributions of individual samples. Reducing the distance increases the sharpness of the result."); - public readonly GUIContent texturingMode = new GUIContent("Texturing Mode", "Specifies when the diffuse texture should be applied."); - public readonly GUIContent[] texturingModeOptions = new GUIContent[2] + public readonly GUIContent profilePreview0 = new GUIContent("Diffusion Profile Preview"); + public readonly GUIContent profilePreview1 = new GUIContent("Shows the fraction of light scattered from the source (center)."); + public readonly GUIContent profilePreview2 = new GUIContent("The distance to the boundary of the image corresponds to the Max Radius."); + public readonly GUIContent profilePreview3 = new GUIContent("Note that the intensity of pixels around the center may be clipped."); + public readonly GUIContent transmittancePreview0 = new GUIContent("Transmittance Preview"); + public readonly GUIContent transmittancePreview1 = new GUIContent("Shows the fraction of light passing through the object for thickness values from the remap."); + public readonly GUIContent transmittancePreview2 = new GUIContent("Can be viewed as a cross section of a slab of material illuminated by white light from the left."); + public readonly GUIContent profileScatteringDistance = new GUIContent("Scattering Distance", "Determines the shape of the profile, and the blur radius of the filter per color channel. Alpha is ignored."); + public readonly GUIContent profileTransmissionTint = new GUIContent("Transmission tint", "Color which tints transmitted light. Alpha is ignored."); + public readonly GUIContent profileMaxRadius = new GUIContent("Max Radius", "Effective radius of the filter (in millimeters). The blur is energy-preserving, so a wide filter results in a large area with small contributions of individual samples. Reducing the distance increases the sharpness of the result."); + public readonly GUIContent texturingMode = new GUIContent("Texturing Mode", "Specifies when the diffuse texture should be applied."); + public readonly GUIContent[] texturingModeOptions = new GUIContent[2] { new GUIContent("Pre- and post-scatter", "HDRP performs texturing during both the lighting and the subsurface scattering passes. This blurs the diffuse texture. Choose this mode if your diffuse texture contains little to no subsurface scattering lighting."), new GUIContent("Post-scatter", "HDRP performs texturing only during the subsurface scattering pass. Preserves the sharpness of the diffuse texture. Choose this mode if your diffuse texture contains subsurface scattering lighting (for example a photo of skin).") }; - public readonly GUIContent profileTransmissionMode = new GUIContent("Transmission Mode", "Configures the simulation of light passing through thin objects. Depends on the thickness value (which HDRP applies in the normal direction)."); + public readonly GUIContent profileTransmissionMode = new GUIContent("Transmission Mode", "Configures the simulation of light passing through thin objects. Depends on the thickness value (which HDRP applies in the normal direction)."); public readonly GUIContent[] transmissionModeOptions = new GUIContent[2] { new GUIContent("Thick Object", "Choose this mode for thick objects. For performance reasons, transmitted light ignores occlusion (shadows)."), new GUIContent("Thin Object", "Choose this mode for thin objects, such as paper or leaves. Transmitted light reuses the shadowing state of the surface.") }; - public readonly GUIContent profileMinMaxThickness = new GUIContent("Thickness Remap Values (Min-Max)", "Shows the values of the thickness remap below (in millimeters)."); - public readonly GUIContent profileThicknessRemap = new GUIContent("Thickness Remap (Min-Max)", "Remaps the thickness parameter from [0, 1] to the desired range (in millimeters)."); - public readonly GUIContent profileWorldScale = new GUIContent("World Scale", "Size of the world unit in meters."); - public readonly GUIContent profileIor = new GUIContent("Index of Refraction", "Select the index of refraction for this Diffusion Profile. For reference, skin is 1.4 and most materials are between 1.3 and 1.5."); - public readonly GUIStyle centeredMiniBoldLabel = new GUIStyle(GUI.skin.label); + public readonly GUIContent profileMinMaxThickness = new GUIContent("Thickness Remap Values (Min-Max)", "Shows the values of the thickness remap below (in millimeters)."); + public readonly GUIContent profileThicknessRemap = new GUIContent("Thickness Remap (Min-Max)", "Remaps the thickness parameter from [0, 1] to the desired range (in millimeters)."); + public readonly GUIContent profileWorldScale = new GUIContent("World Scale", "Size of the world unit in meters."); + public readonly GUIContent profileIor = new GUIContent("Index of Refraction", "Select the index of refraction for this Diffusion Profile. For reference, skin is 1.4 and most materials are between 1.3 and 1.5."); + public readonly GUIStyle centeredMiniBoldLabel = new GUIStyle(GUI.skin.label); public readonly GUIContent SubsurfaceScatteringLabel = new GUIContent("Subsurface Scattering only"); public readonly GUIContent TransmissionLabel = new GUIContent("Transmission only"); @@ -41,7 +41,7 @@ sealed class Styles public Styles() { centeredMiniBoldLabel.alignment = TextAnchor.MiddleCenter; - centeredMiniBoldLabel.fontSize = 10; + centeredMiniBoldLabel.fontSize = 10; centeredMiniBoldLabel.fontStyle = FontStyle.Bold; } } diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/DiffusionProfile/DiffusionProfileSettingsEditor.cs b/com.unity.render-pipelines.high-definition/Editor/Material/DiffusionProfile/DiffusionProfileSettingsEditor.cs index d3893fa1a17..51c95e53510 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/DiffusionProfile/DiffusionProfileSettingsEditor.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/DiffusionProfile/DiffusionProfileSettingsEditor.cs @@ -27,7 +27,7 @@ sealed class Profile internal Profile() { - profileRT = new RenderTexture(256, 256, 0, RenderTextureFormat.DefaultHDR); + profileRT = new RenderTexture(256, 256, 0, RenderTextureFormat.DefaultHDR); transmittanceRT = new RenderTexture(16, 256, 0, RenderTextureFormat.DefaultHDR); } @@ -48,7 +48,7 @@ protected override void OnEnable() base.OnEnable(); // These shaders don't need to be reference by RenderPipelineResource as they are not use at runtime - m_ProfileMaterial = CoreUtils.CreateEngineMaterial("Hidden/HDRP/DrawDiffusionProfile"); + m_ProfileMaterial = CoreUtils.CreateEngineMaterial("Hidden/HDRP/DrawDiffusionProfile"); m_TransmittanceMaterial = CoreUtils.CreateEngineMaterial("Hidden/HDRP/DrawTransmittanceGraph"); var serializedProfile = properties.Find(x => x.profile); @@ -153,9 +153,9 @@ void RenderPreview(Profile profile) { var obj = profile.objReference; float r = obj.filterRadius; - var S = obj.shapeParam; + var S = obj.shapeParam; - m_ProfileMaterial.SetFloat(HDShaderIDs._MaxRadius, r); + m_ProfileMaterial.SetFloat(HDShaderIDs._MaxRadius, r); m_ProfileMaterial.SetVector(HDShaderIDs._ShapeParam, S); // Draw the profile. @@ -167,9 +167,9 @@ void RenderPreview(Profile profile) EditorGUILayout.LabelField(s_Styles.transmittancePreview2, EditorStyles.centeredGreyMiniLabel); EditorGUILayout.Space(); - m_TransmittanceMaterial.SetVector(HDShaderIDs._ShapeParam, S); + m_TransmittanceMaterial.SetVector(HDShaderIDs._ShapeParam, S); m_TransmittanceMaterial.SetVector(HDShaderIDs._TransmissionTint, obj.transmissionTint); - m_TransmittanceMaterial.SetVector(HDShaderIDs._ThicknessRemap, obj.thicknessRemap); + m_TransmittanceMaterial.SetVector(HDShaderIDs._ThicknessRemap, obj.thicknessRemap); // Draw the transmittance graph. EditorGUI.DrawPreviewTexture(GUILayoutUtility.GetRect(16f, 16f), profile.transmittanceRT, m_TransmittanceMaterial, ScaleMode.ScaleToFit, 16f); diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/Eye/ShaderGraph/CreateEyeShaderGraph.cs b/com.unity.render-pipelines.high-definition/Editor/Material/Eye/ShaderGraph/CreateEyeShaderGraph.cs index e30afa82d3d..b994ca39317 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/Eye/ShaderGraph/CreateEyeShaderGraph.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/Eye/ShaderGraph/CreateEyeShaderGraph.cs @@ -27,7 +27,7 @@ public static void CreateEyeGraph() BlockFields.SurfaceDescription.Alpha, }; - GraphUtil.CreateNewGraphWithOutputs(new[] {target}, blockDescriptors); + GraphUtil.CreateNewGraphWithOutputs(new[] { target }, blockDescriptors); } } } diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/Eye/ShaderGraph/EyeSubTarget.cs b/com.unity.render-pipelines.high-definition/Editor/Material/Eye/ShaderGraph/EyeSubTarget.cs index 6574a8f33f3..3fb3c4ee8cc 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/Eye/ShaderGraph/EyeSubTarget.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/Eye/ShaderGraph/EyeSubTarget.cs @@ -48,8 +48,8 @@ public EyeData eyeData set => m_EyeData = value; } - public static FieldDescriptor Eye = new FieldDescriptor(kMaterial, "Eye", "_MATERIAL_FEATURE_EYE 1"); - public static FieldDescriptor EyeCinematic = new FieldDescriptor(kMaterial, "EyeCinematic", "_MATERIAL_FEATURE_EYE_CINEMATIC 1"); + public static FieldDescriptor Eye = new FieldDescriptor(kMaterial, "Eye", "_MATERIAL_FEATURE_EYE 1"); + public static FieldDescriptor EyeCinematic = new FieldDescriptor(kMaterial, "EyeCinematic", "_MATERIAL_FEATURE_EYE_CINEMATIC 1"); protected override SubShaderDescriptor GetRaytracingSubShaderDescriptor() { @@ -66,9 +66,9 @@ public override void GetFields(ref TargetFieldContext context) base.GetFields(ref context); // Eye specific properties - context.AddField(Eye, eyeData.materialType == EyeData.MaterialType.Eye); - context.AddField(EyeCinematic, eyeData.materialType == EyeData.MaterialType.EyeCinematic); - context.AddField(SubsurfaceScattering, eyeData.subsurfaceScattering && systemData.surfaceType != SurfaceType.Transparent); + context.AddField(Eye, eyeData.materialType == EyeData.MaterialType.Eye); + context.AddField(EyeCinematic, eyeData.materialType == EyeData.MaterialType.EyeCinematic); + context.AddField(SubsurfaceScattering, eyeData.subsurfaceScattering && systemData.surfaceType != SurfaceType.Transparent); context.AddField(SpecularAA, lightingData.specularAA && context.pass.validPixelBlocks.Contains(HDBlockFields.SurfaceDescription.SpecularAAThreshold) && @@ -80,14 +80,14 @@ public override void GetActiveBlocks(ref TargetActiveBlockContext context) base.GetActiveBlocks(ref context); // Eye specific blocks - context.AddBlock(HDBlockFields.SurfaceDescription.IrisNormalOS, eyeData.irisNormal && lightingData.normalDropOffSpace == NormalDropOffSpace.Object); - context.AddBlock(HDBlockFields.SurfaceDescription.IrisNormalTS, eyeData.irisNormal && lightingData.normalDropOffSpace == NormalDropOffSpace.Tangent); - context.AddBlock(HDBlockFields.SurfaceDescription.IrisNormalWS, eyeData.irisNormal && lightingData.normalDropOffSpace == NormalDropOffSpace.World); + context.AddBlock(HDBlockFields.SurfaceDescription.IrisNormalOS, eyeData.irisNormal && lightingData.normalDropOffSpace == NormalDropOffSpace.Object); + context.AddBlock(HDBlockFields.SurfaceDescription.IrisNormalTS, eyeData.irisNormal && lightingData.normalDropOffSpace == NormalDropOffSpace.Tangent); + context.AddBlock(HDBlockFields.SurfaceDescription.IrisNormalWS, eyeData.irisNormal && lightingData.normalDropOffSpace == NormalDropOffSpace.World); context.AddBlock(HDBlockFields.SurfaceDescription.IOR); context.AddBlock(HDBlockFields.SurfaceDescription.Mask); - context.AddBlock(HDBlockFields.SurfaceDescription.DiffusionProfileHash, eyeData.subsurfaceScattering); - context.AddBlock(HDBlockFields.SurfaceDescription.SubsurfaceMask, eyeData.subsurfaceScattering); + context.AddBlock(HDBlockFields.SurfaceDescription.DiffusionProfileHash, eyeData.subsurfaceScattering); + context.AddBlock(HDBlockFields.SurfaceDescription.SubsurfaceMask, eyeData.subsurfaceScattering); } protected override void AddInspectorPropertyBlocks(SubTargetPropertiesGUI blockList) diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/Fabric/ShaderGraph/CreateFabricShaderGraph.cs b/com.unity.render-pipelines.high-definition/Editor/Material/Fabric/ShaderGraph/CreateFabricShaderGraph.cs index 028c2ce8250..a48f887b282 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/Fabric/ShaderGraph/CreateFabricShaderGraph.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/Fabric/ShaderGraph/CreateFabricShaderGraph.cs @@ -26,7 +26,7 @@ public static void CreateFabricGraph() BlockFields.SurfaceDescription.Alpha, }; - GraphUtil.CreateNewGraphWithOutputs(new[] {target}, blockDescriptors); + GraphUtil.CreateNewGraphWithOutputs(new[] { target }, blockDescriptors); } } } diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/Fabric/ShaderGraph/FabricSubTarget.cs b/com.unity.render-pipelines.high-definition/Editor/Material/Fabric/ShaderGraph/FabricSubTarget.cs index f0c7d572b16..cf5844b8a88 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/Fabric/ShaderGraph/FabricSubTarget.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/Fabric/ShaderGraph/FabricSubTarget.cs @@ -48,8 +48,8 @@ public FabricData fabricData set => m_FabricData = value; } - public static FieldDescriptor CottonWool = new FieldDescriptor(kMaterial, "CottonWool", "_MATERIAL_FEATURE_COTTON_WOOL 1"); - public static FieldDescriptor Silk = new FieldDescriptor(kMaterial, "Silk", "_MATERIAL_FEATURE_SILK 1"); + public static FieldDescriptor CottonWool = new FieldDescriptor(kMaterial, "CottonWool", "_MATERIAL_FEATURE_COTTON_WOOL 1"); + public static FieldDescriptor Silk = new FieldDescriptor(kMaterial, "Silk", "_MATERIAL_FEATURE_SILK 1"); protected override SubShaderDescriptor GetRaytracingSubShaderDescriptor() { @@ -66,11 +66,11 @@ public override void GetFields(ref TargetFieldContext context) base.GetFields(ref context); // Fabric specific properties - context.AddField(CottonWool, fabricData.materialType == FabricData.MaterialType.CottonWool); - context.AddField(Silk, fabricData.materialType == FabricData.MaterialType.Silk); - context.AddField(SubsurfaceScattering, fabricData.subsurfaceScattering && systemData.surfaceType != SurfaceType.Transparent); - context.AddField(Transmission, fabricData.transmission); - context.AddField(EnergyConservingSpecular, fabricData.energyConservingSpecular); + context.AddField(CottonWool, fabricData.materialType == FabricData.MaterialType.CottonWool); + context.AddField(Silk, fabricData.materialType == FabricData.MaterialType.Silk); + context.AddField(SubsurfaceScattering, fabricData.subsurfaceScattering && systemData.surfaceType != SurfaceType.Transparent); + context.AddField(Transmission, fabricData.transmission); + context.AddField(EnergyConservingSpecular, fabricData.energyConservingSpecular); context.AddField(SpecularAA, lightingData.specularAA && context.pass.validPixelBlocks.Contains(HDBlockFields.SurfaceDescription.SpecularAAThreshold) && @@ -84,8 +84,8 @@ public override void GetActiveBlocks(ref TargetActiveBlockContext context) // Fabric specific blocks context.AddBlock(BlockFields.SurfaceDescription.Specular); context.AddBlock(HDBlockFields.SurfaceDescription.DiffusionProfileHash, fabricData.subsurfaceScattering || fabricData.transmission); - context.AddBlock(HDBlockFields.SurfaceDescription.SubsurfaceMask, fabricData.subsurfaceScattering); - context.AddBlock(HDBlockFields.SurfaceDescription.Thickness, fabricData.transmission); + context.AddBlock(HDBlockFields.SurfaceDescription.SubsurfaceMask, fabricData.subsurfaceScattering); + context.AddBlock(HDBlockFields.SurfaceDescription.Thickness, fabricData.transmission); // Fabric Silk if (fabricData.materialType == FabricData.MaterialType.Silk) diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/Hair/ShaderGraph/CreateHairShaderGraph.cs b/com.unity.render-pipelines.high-definition/Editor/Material/Hair/ShaderGraph/CreateHairShaderGraph.cs index f9cece74c18..e417d398954 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/Hair/ShaderGraph/CreateHairShaderGraph.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/Hair/ShaderGraph/CreateHairShaderGraph.cs @@ -33,7 +33,7 @@ public static void CreateHairGraph() BlockFields.SurfaceDescription.Emission, }; - GraphUtil.CreateNewGraphWithOutputs(new[] {target}, blockDescriptors); + GraphUtil.CreateNewGraphWithOutputs(new[] { target }, blockDescriptors); } } } diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/Hair/ShaderGraph/HairSubTarget.cs b/com.unity.render-pipelines.high-definition/Editor/Material/Hair/ShaderGraph/HairSubTarget.cs index 872264269ff..526389258a0 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/Hair/ShaderGraph/HairSubTarget.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/Hair/ShaderGraph/HairSubTarget.cs @@ -48,11 +48,11 @@ public HairData hairData set => m_HairData = value; } - public static FieldDescriptor KajiyaKay = new FieldDescriptor(kMaterial, "KajiyaKay", "_MATERIAL_FEATURE_HAIR_KAJIYA_KAY 1"); + public static FieldDescriptor KajiyaKay = new FieldDescriptor(kMaterial, "KajiyaKay", "_MATERIAL_FEATURE_HAIR_KAJIYA_KAY 1"); public static FieldDescriptor RimTransmissionIntensity = new FieldDescriptor(string.Empty, "RimTransmissionIntensity", "_RIM_TRANSMISSION_INTENSITY 1"); - public static FieldDescriptor HairStrandDirection = new FieldDescriptor(string.Empty, "HairStrandDirection", "_HAIR_STRAND_DIRECTION 1"); - public static FieldDescriptor UseLightFacingNormal = new FieldDescriptor(string.Empty, "UseLightFacingNormal", "_USE_LIGHT_FACING_NORMAL 1"); - public static FieldDescriptor Transmittance = new FieldDescriptor(string.Empty, "Transmittance", "_TRANSMITTANCE 1"); + public static FieldDescriptor HairStrandDirection = new FieldDescriptor(string.Empty, "HairStrandDirection", "_HAIR_STRAND_DIRECTION 1"); + public static FieldDescriptor UseLightFacingNormal = new FieldDescriptor(string.Empty, "UseLightFacingNormal", "_USE_LIGHT_FACING_NORMAL 1"); + public static FieldDescriptor Transmittance = new FieldDescriptor(string.Empty, "Transmittance", "_TRANSMITTANCE 1"); public override void GetFields(ref TargetFieldContext context) { @@ -60,14 +60,14 @@ public override void GetFields(ref TargetFieldContext context) var descs = context.blocks.Select(x => x.descriptor); // Hair specific properties: - context.AddField(KajiyaKay, hairData.materialType == HairData.MaterialType.KajiyaKay); - context.AddField(HairStrandDirection, descs.Contains(HDBlockFields.SurfaceDescription.HairStrandDirection) && context.pass.validPixelBlocks.Contains(HDBlockFields.SurfaceDescription.HairStrandDirection)); - context.AddField(RimTransmissionIntensity, descs.Contains(HDBlockFields.SurfaceDescription.RimTransmissionIntensity) && context.pass.validPixelBlocks.Contains(HDBlockFields.SurfaceDescription.RimTransmissionIntensity)); - context.AddField(UseLightFacingNormal, hairData.useLightFacingNormal); - context.AddField(Transmittance, descs.Contains(HDBlockFields.SurfaceDescription.Transmittance) && context.pass.validPixelBlocks.Contains(HDBlockFields.SurfaceDescription.Transmittance)); + context.AddField(KajiyaKay, hairData.materialType == HairData.MaterialType.KajiyaKay); + context.AddField(HairStrandDirection, descs.Contains(HDBlockFields.SurfaceDescription.HairStrandDirection) && context.pass.validPixelBlocks.Contains(HDBlockFields.SurfaceDescription.HairStrandDirection)); + context.AddField(RimTransmissionIntensity, descs.Contains(HDBlockFields.SurfaceDescription.RimTransmissionIntensity) && context.pass.validPixelBlocks.Contains(HDBlockFields.SurfaceDescription.RimTransmissionIntensity)); + context.AddField(UseLightFacingNormal, hairData.useLightFacingNormal); + context.AddField(Transmittance, descs.Contains(HDBlockFields.SurfaceDescription.Transmittance) && context.pass.validPixelBlocks.Contains(HDBlockFields.SurfaceDescription.Transmittance)); // Misc - context.AddField(SpecularAA, lightingData.specularAA && + context.AddField(SpecularAA, lightingData.specularAA && context.pass.validPixelBlocks.Contains(HDBlockFields.SurfaceDescription.SpecularAAThreshold) && context.pass.validPixelBlocks.Contains(HDBlockFields.SurfaceDescription.SpecularAAScreenSpaceVariance)); } diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/LayeredLit/LayeredLitGUI.cs b/com.unity.render-pipelines.high-definition/Editor/Material/LayeredLit/LayeredLitGUI.cs index 59a75bf55ce..28f7f318466 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/LayeredLit/LayeredLitGUI.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/LayeredLit/LayeredLitGUI.cs @@ -87,7 +87,7 @@ static public void SetupLayersMappingKeywords(Material material) // Blend mask UVBaseMapping UVBlendMaskMapping = (UVBaseMapping)material.GetFloat(kUVBlendMask); CoreUtils.SetKeyword(material, "_LAYER_MAPPING_PLANAR_BLENDMASK", UVBlendMaskMapping == UVBaseMapping.Planar); - CoreUtils.SetKeyword(material, "_LAYER_MAPPING_TRIPLANAR_BLENDMASK", UVBlendMaskMapping == UVBaseMapping.Triplanar); + CoreUtils.SetKeyword(material, "_LAYER_MAPPING_TRIPLANAR_BLENDMASK", UVBlendMaskMapping == UVBaseMapping.Triplanar); int numLayer = (int)material.GetFloat(kLayerCount); diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/Lit/BaseLitGUI.cs b/com.unity.render-pipelines.high-definition/Editor/Material/Lit/BaseLitGUI.cs index fa7e6603464..5e82d808f6e 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/Lit/BaseLitGUI.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/Lit/BaseLitGUI.cs @@ -27,7 +27,7 @@ abstract class BaseLitGUI // SSR protected MaterialProperty receivesSSR = null; - protected virtual void UpdateDisplacement() {} + protected virtual void UpdateDisplacement() { } // All Setup Keyword functions must be static. It allow to create script to automatically update the shaders with a script if code change static public void SetupBaseLitKeywords(Material material) diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/Lit/LitShaderPreprocessor.cs b/com.unity.render-pipelines.high-definition/Editor/Material/Lit/LitShaderPreprocessor.cs index 8580096c824..acd1599cc1e 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/Lit/LitShaderPreprocessor.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/Lit/LitShaderPreprocessor.cs @@ -13,7 +13,7 @@ class LitShaderPreprocessor : BaseShaderPreprocessor public override int Priority => 50; - public LitShaderPreprocessor() {} + public LitShaderPreprocessor() { } protected override bool DoShadersStripper(HDRenderPipelineAsset hdrpAsset, Shader shader, ShaderSnippetData snippet, ShaderCompilerData inputData) { diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/Lit/ShaderGraph/CreateHDLitShaderGraph.cs b/com.unity.render-pipelines.high-definition/Editor/Material/Lit/ShaderGraph/CreateHDLitShaderGraph.cs index 4e9adbaaa55..d06fa7b0284 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/Lit/ShaderGraph/CreateHDLitShaderGraph.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/Lit/ShaderGraph/CreateHDLitShaderGraph.cs @@ -26,7 +26,7 @@ public static void CreateHDLitGraph() BlockFields.SurfaceDescription.Alpha, }; - GraphUtil.CreateNewGraphWithOutputs(new[] {target}, blockDescriptors); + GraphUtil.CreateNewGraphWithOutputs(new[] { target }, blockDescriptors); } } } diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/Lit/ShaderGraph/HDLitSubTarget.cs b/com.unity.render-pipelines.high-definition/Editor/Material/Lit/ShaderGraph/HDLitSubTarget.cs index 4e7bd6c8287..17aae40c016 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/Lit/ShaderGraph/HDLitSubTarget.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/Lit/ShaderGraph/HDLitSubTarget.cs @@ -78,13 +78,13 @@ protected override SubShaderDescriptor GetRaytracingSubShaderDescriptor() return descriptor; } - public static FieldDescriptor ClearCoat = new FieldDescriptor(kMaterial, "ClearCoat", "_MATERIAL_FEATURE_CLEAR_COAT"); - public static FieldDescriptor Translucent = new FieldDescriptor(kMaterial, "Translucent", "_MATERIAL_FEATURE_TRANSLUCENT 1"); - public static FieldDescriptor Standard = new FieldDescriptor(kMaterial, "Standard", "_MATERIAL_FEATURE_TRANSMISSION 1"); - public static FieldDescriptor SpecularColor = new FieldDescriptor(kMaterial, "SpecularColor", "_MATERIAL_FEATURE_TRANSMISSION 1"); + public static FieldDescriptor ClearCoat = new FieldDescriptor(kMaterial, "ClearCoat", "_MATERIAL_FEATURE_CLEAR_COAT"); + public static FieldDescriptor Translucent = new FieldDescriptor(kMaterial, "Translucent", "_MATERIAL_FEATURE_TRANSLUCENT 1"); + public static FieldDescriptor Standard = new FieldDescriptor(kMaterial, "Standard", "_MATERIAL_FEATURE_TRANSMISSION 1"); + public static FieldDescriptor SpecularColor = new FieldDescriptor(kMaterial, "SpecularColor", "_MATERIAL_FEATURE_TRANSMISSION 1"); // Refraction - public static FieldDescriptor Refraction = new FieldDescriptor(string.Empty, "Refraction", ""); + public static FieldDescriptor Refraction = new FieldDescriptor(string.Empty, "Refraction", ""); public static KeywordDescriptor RefractionKeyword = new KeywordDescriptor() { displayName = "Refraction Model", @@ -110,26 +110,26 @@ public override void GetFields(ref TargetFieldContext context) bool hasRefraction = (systemData.surfaceType == SurfaceType.Transparent && litData.refractionModel != ScreenSpaceRefraction.RefractionModel.None); // Lit specific properties - context.AddField(DotsProperties, context.hasDotsProperties); + context.AddField(DotsProperties, context.hasDotsProperties); // Material - context.AddField(Anisotropy, litData.materialType == HDLitData.MaterialType.Anisotropy); - context.AddField(Iridescence, litData.materialType == HDLitData.MaterialType.Iridescence); - context.AddField(SpecularColor, litData.materialType == HDLitData.MaterialType.SpecularColor); - context.AddField(Standard, litData.materialType == HDLitData.MaterialType.Standard); - context.AddField(SubsurfaceScattering, litData.materialType == HDLitData.MaterialType.SubsurfaceScattering && systemData.surfaceType != SurfaceType.Transparent); - context.AddField(Transmission, (litData.materialType == HDLitData.MaterialType.SubsurfaceScattering && litData.sssTransmission) || + context.AddField(Anisotropy, litData.materialType == HDLitData.MaterialType.Anisotropy); + context.AddField(Iridescence, litData.materialType == HDLitData.MaterialType.Iridescence); + context.AddField(SpecularColor, litData.materialType == HDLitData.MaterialType.SpecularColor); + context.AddField(Standard, litData.materialType == HDLitData.MaterialType.Standard); + context.AddField(SubsurfaceScattering, litData.materialType == HDLitData.MaterialType.SubsurfaceScattering && systemData.surfaceType != SurfaceType.Transparent); + context.AddField(Transmission, (litData.materialType == HDLitData.MaterialType.SubsurfaceScattering && litData.sssTransmission) || (litData.materialType == HDLitData.MaterialType.Translucent)); - context.AddField(Translucent, litData.materialType == HDLitData.MaterialType.Translucent); + context.AddField(Translucent, litData.materialType == HDLitData.MaterialType.Translucent); // Refraction - context.AddField(Refraction, hasRefraction); + context.AddField(Refraction, hasRefraction); // Misc - context.AddField(EnergyConservingSpecular, litData.energyConservingSpecular); - context.AddField(CoatMask, descs.Contains(BlockFields.SurfaceDescription.CoatMask) && context.pass.validPixelBlocks.Contains(BlockFields.SurfaceDescription.CoatMask) && litData.clearCoat); - context.AddField(ClearCoat, litData.clearCoat); // Enable clear coat material feature - context.AddField(RayTracing, litData.rayTracing); + context.AddField(EnergyConservingSpecular, litData.energyConservingSpecular); + context.AddField(CoatMask, descs.Contains(BlockFields.SurfaceDescription.CoatMask) && context.pass.validPixelBlocks.Contains(BlockFields.SurfaceDescription.CoatMask) && litData.clearCoat); + context.AddField(ClearCoat, litData.clearCoat); // Enable clear coat material feature + context.AddField(RayTracing, litData.rayTracing); context.AddField(SpecularAA, lightingData.specularAA && context.pass.validPixelBlocks.Contains(HDBlockFields.SurfaceDescription.SpecularAAThreshold) && @@ -145,12 +145,12 @@ public override void GetActiveBlocks(ref TargetActiveBlockContext context) base.GetActiveBlocks(ref context); // Common - context.AddBlock(BlockFields.SurfaceDescription.CoatMask, litData.clearCoat); + context.AddBlock(BlockFields.SurfaceDescription.CoatMask, litData.clearCoat); // Refraction - context.AddBlock(HDBlockFields.SurfaceDescription.RefractionIndex, hasRefraction); - context.AddBlock(HDBlockFields.SurfaceDescription.RefractionColor, hasRefraction); - context.AddBlock(HDBlockFields.SurfaceDescription.RefractionDistance, hasRefraction); + context.AddBlock(HDBlockFields.SurfaceDescription.RefractionIndex, hasRefraction); + context.AddBlock(HDBlockFields.SurfaceDescription.RefractionColor, hasRefraction); + context.AddBlock(HDBlockFields.SurfaceDescription.RefractionDistance, hasRefraction); // Material @@ -168,16 +168,16 @@ public override void GetActiveBlocks(ref TargetActiveBlockContext context) break; } - context.AddBlock(tangentBlock, litData.materialType == HDLitData.MaterialType.Anisotropy); - context.AddBlock(HDBlockFields.SurfaceDescription.Anisotropy, litData.materialType == HDLitData.MaterialType.Anisotropy); - context.AddBlock(HDBlockFields.SurfaceDescription.SubsurfaceMask, litData.materialType == HDLitData.MaterialType.SubsurfaceScattering); - context.AddBlock(HDBlockFields.SurfaceDescription.Thickness, ((litData.materialType == HDLitData.MaterialType.SubsurfaceScattering || litData.materialType == HDLitData.MaterialType.Translucent) && + context.AddBlock(tangentBlock, litData.materialType == HDLitData.MaterialType.Anisotropy); + context.AddBlock(HDBlockFields.SurfaceDescription.Anisotropy, litData.materialType == HDLitData.MaterialType.Anisotropy); + context.AddBlock(HDBlockFields.SurfaceDescription.SubsurfaceMask, litData.materialType == HDLitData.MaterialType.SubsurfaceScattering); + context.AddBlock(HDBlockFields.SurfaceDescription.Thickness, ((litData.materialType == HDLitData.MaterialType.SubsurfaceScattering || litData.materialType == HDLitData.MaterialType.Translucent) && (litData.sssTransmission || litData.materialType == HDLitData.MaterialType.Translucent)) || hasRefraction); context.AddBlock(HDBlockFields.SurfaceDescription.DiffusionProfileHash, litData.materialType == HDLitData.MaterialType.SubsurfaceScattering || litData.materialType == HDLitData.MaterialType.Translucent); - context.AddBlock(HDBlockFields.SurfaceDescription.IridescenceMask, litData.materialType == HDLitData.MaterialType.Iridescence); + context.AddBlock(HDBlockFields.SurfaceDescription.IridescenceMask, litData.materialType == HDLitData.MaterialType.Iridescence); context.AddBlock(HDBlockFields.SurfaceDescription.IridescenceThickness, litData.materialType == HDLitData.MaterialType.Iridescence); - context.AddBlock(BlockFields.SurfaceDescription.Specular, litData.materialType == HDLitData.MaterialType.SpecularColor); - context.AddBlock(BlockFields.SurfaceDescription.Metallic, litData.materialType == HDLitData.MaterialType.Standard || + context.AddBlock(BlockFields.SurfaceDescription.Specular, litData.materialType == HDLitData.MaterialType.SpecularColor); + context.AddBlock(BlockFields.SurfaceDescription.Metallic, litData.materialType == HDLitData.MaterialType.Standard || litData.materialType == HDLitData.MaterialType.Anisotropy || litData.materialType == HDLitData.MaterialType.Iridescence); } diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/AdvancedOptionsPropertyBlock.cs b/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/AdvancedOptionsPropertyBlock.cs index 085eae5c979..5c8b04d3b27 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/AdvancedOptionsPropertyBlock.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/AdvancedOptionsPropertyBlock.cs @@ -19,11 +19,11 @@ class AdvancedOptionsPropertyBlock : SubTargetPropertyBlock [Flags] public enum Features { - None = 0, - SpecularOcclusion = 1 << 0, + None = 0, + SpecularOcclusion = 1 << 0, - StackLit = All ^ SpecularOcclusion, - All = ~0 + StackLit = All ^ SpecularOcclusion, + All = ~0 } class Styles diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/DiffusionProfilePropertyDrawer.cs b/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/DiffusionProfilePropertyDrawer.cs index 139891def2e..85b33937d67 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/DiffusionProfilePropertyDrawer.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/DiffusionProfilePropertyDrawer.cs @@ -22,7 +22,7 @@ internal VisualElement CreateGUI( out VisualElement propertyColorField, int indentLevel = 0) { - var objectField = new ObjectField { value = fieldToDraw, objectType = typeof(DiffusionProfileSettings)}; + var objectField = new ObjectField { value = fieldToDraw, objectType = typeof(DiffusionProfileSettings) }; if (valueChangedCallback != null) { @@ -43,7 +43,7 @@ public VisualElement DrawProperty(PropertyInfo propertyInfo, object actualObject { return this.CreateGUI( // Use the setter from the provided property as the callback - newValue => propertyInfo.GetSetMethod(true).Invoke(actualObject, new object[] {newValue}), + newValue => propertyInfo.GetSetMethod(true).Invoke(actualObject, new object[] { newValue }), (DiffusionProfileSettings)propertyInfo.GetValue(actualObject), attribute.labelName, out var propertyVisualElement); diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/DiffusionProfileShaderProperty.cs b/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/DiffusionProfileShaderProperty.cs index 786279c3416..fe317828423 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/DiffusionProfileShaderProperty.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/DiffusionProfileShaderProperty.cs @@ -99,7 +99,8 @@ void IShaderPropertyDrawer.HandlePropertyField(PropertySheet propertySheet, PreC var diffusionProfileDrawer = new DiffusionProfilePropertyDrawer(); propertySheet.Add(diffusionProfileDrawer.CreateGUI( - newValue => { + newValue => + { preChangeValueCallback("Changed Diffusion Profile"); value = newValue; postChangeValueCallback(true); diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/HDFields.cs b/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/HDFields.cs index a09d56efd07..3f3acf026c7 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/HDFields.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/HDFields.cs @@ -16,51 +16,51 @@ static class HDFields #region Fields // Material - public static FieldDescriptor Anisotropy = new FieldDescriptor(kMaterial, "Anisotropy", "_MATERIAL_FEATURE_TRANSMISSION 1"); - public static FieldDescriptor Iridescence = new FieldDescriptor(kMaterial, "Iridescence", "_MATERIAL_FEATURE_TRANSMISSION 1"); - public static FieldDescriptor SubsurfaceScattering = new FieldDescriptor(kMaterial, "SubsurfaceScattering", "_MATERIAL_FEATURE_SUBSURFACE_SCATTERING 1"); - public static FieldDescriptor Transmission = new FieldDescriptor(kMaterial, "Transmission", "_MATERIAL_FEATURE_TRANSMISSION 1"); + public static FieldDescriptor Anisotropy = new FieldDescriptor(kMaterial, "Anisotropy", "_MATERIAL_FEATURE_TRANSMISSION 1"); + public static FieldDescriptor Iridescence = new FieldDescriptor(kMaterial, "Iridescence", "_MATERIAL_FEATURE_TRANSMISSION 1"); + public static FieldDescriptor SubsurfaceScattering = new FieldDescriptor(kMaterial, "SubsurfaceScattering", "_MATERIAL_FEATURE_SUBSURFACE_SCATTERING 1"); + public static FieldDescriptor Transmission = new FieldDescriptor(kMaterial, "Transmission", "_MATERIAL_FEATURE_TRANSMISSION 1"); // Dots - public static FieldDescriptor DotsInstancing = new FieldDescriptor(kDots, "Instancing", ""); - public static FieldDescriptor DotsProperties = new FieldDescriptor(kDots, "Properties", ""); + public static FieldDescriptor DotsInstancing = new FieldDescriptor(kDots, "Instancing", ""); + public static FieldDescriptor DotsProperties = new FieldDescriptor(kDots, "Properties", ""); // Specular public static FieldDescriptor EnergyConservingSpecular = new FieldDescriptor(kSpecular, "EnergyConserving", "_ENERGY_CONSERVING_SPECULAR 1"); - public static FieldDescriptor SpecularAA = new FieldDescriptor(kSpecular, "AA", "_ENABLE_GEOMETRIC_SPECULAR_AA 1"); + public static FieldDescriptor SpecularAA = new FieldDescriptor(kSpecular, "AA", "_ENABLE_GEOMETRIC_SPECULAR_AA 1"); // Double Sided - public static FieldDescriptor DoubleSided = new FieldDescriptor(string.Empty, "DoubleSided", ""); - public static FieldDescriptor DoubleSidedFlip = new FieldDescriptor(kDoubleSided, "Flip", ""); - public static FieldDescriptor DoubleSidedMirror = new FieldDescriptor(kDoubleSided, "Mirror", ""); + public static FieldDescriptor DoubleSided = new FieldDescriptor(string.Empty, "DoubleSided", ""); + public static FieldDescriptor DoubleSidedFlip = new FieldDescriptor(kDoubleSided, "Flip", ""); + public static FieldDescriptor DoubleSidedMirror = new FieldDescriptor(kDoubleSided, "Mirror", ""); // Distortion - public static FieldDescriptor DistortionDepthTest = new FieldDescriptor(kDistortion, "DepthTest", ""); - public static FieldDescriptor DistortionAdd = new FieldDescriptor(kDistortion, "Add", ""); - public static FieldDescriptor DistortionMultiply = new FieldDescriptor(kDistortion, "Multiply", ""); - public static FieldDescriptor DistortionReplace = new FieldDescriptor(kDistortion, "Replace", ""); - public static FieldDescriptor TransparentDistortion = new FieldDescriptor(kDistortion, "TransparentDistortion", ""); + public static FieldDescriptor DistortionDepthTest = new FieldDescriptor(kDistortion, "DepthTest", ""); + public static FieldDescriptor DistortionAdd = new FieldDescriptor(kDistortion, "Add", ""); + public static FieldDescriptor DistortionMultiply = new FieldDescriptor(kDistortion, "Multiply", ""); + public static FieldDescriptor DistortionReplace = new FieldDescriptor(kDistortion, "Replace", ""); + public static FieldDescriptor TransparentDistortion = new FieldDescriptor(kDistortion, "TransparentDistortion", ""); // Specular Occlusion - public static FieldDescriptor SpecularOcclusion = new FieldDescriptor(string.Empty, "SpecularOcclusion", "_ENABLESPECULAROCCLUSION"); + public static FieldDescriptor SpecularOcclusion = new FieldDescriptor(string.Empty, "SpecularOcclusion", "_ENABLESPECULAROCCLUSION"); public static FieldDescriptor SpecularOcclusionFromAO = new FieldDescriptor(string.Empty, "SpecularOcclusionFromAO", "_SPECULAR_OCCLUSION_FROM_AO 1"); public static FieldDescriptor SpecularOcclusionFromAOBentNormal = new FieldDescriptor(string.Empty, "SpecularOcclusionFromAOBentNormal", "_SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL 1"); public static FieldDescriptor SpecularOcclusionCustom = new FieldDescriptor(string.Empty, "SpecularOcclusionCustom", "_SPECULAR_OCCLUSION_CUSTOM 1"); // Misc - public static FieldDescriptor DoAlphaTestShadow = new FieldDescriptor(string.Empty, "DoAlphaTestShadow", "_DO_ALPHA_TEST_SHADOW 1"); - public static FieldDescriptor DoAlphaTestPrepass = new FieldDescriptor(string.Empty, "DoAlphaTestPrepass", "_DO_ALPHA_TEST_PREPASS 1"); - public static FieldDescriptor BentNormal = new FieldDescriptor(string.Empty, "BentNormal", "_BENT_NORMAL 1"); - public static FieldDescriptor AmbientOcclusion = new FieldDescriptor(string.Empty, "AmbientOcclusion", "_AMBIENT_OCCLUSION 1"); - public static FieldDescriptor CoatMask = new FieldDescriptor(string.Empty, "CoatMask", "_COAT_MASK 1"); - public static FieldDescriptor LightingGI = new FieldDescriptor(string.Empty, "LightingGI", "_LIGHTING_GI 1"); - public static FieldDescriptor BackLightingGI = new FieldDescriptor(string.Empty, "BackLightingGI", "_BACK_LIGHTING_GI 1"); - public static FieldDescriptor DepthOffset = new FieldDescriptor(string.Empty, "DepthOffset", "_DEPTH_OFFSET 1"); - public static FieldDescriptor TransparentBackFace = new FieldDescriptor(string.Empty, "TransparentBackFace", string.Empty); + public static FieldDescriptor DoAlphaTestShadow = new FieldDescriptor(string.Empty, "DoAlphaTestShadow", "_DO_ALPHA_TEST_SHADOW 1"); + public static FieldDescriptor DoAlphaTestPrepass = new FieldDescriptor(string.Empty, "DoAlphaTestPrepass", "_DO_ALPHA_TEST_PREPASS 1"); + public static FieldDescriptor BentNormal = new FieldDescriptor(string.Empty, "BentNormal", "_BENT_NORMAL 1"); + public static FieldDescriptor AmbientOcclusion = new FieldDescriptor(string.Empty, "AmbientOcclusion", "_AMBIENT_OCCLUSION 1"); + public static FieldDescriptor CoatMask = new FieldDescriptor(string.Empty, "CoatMask", "_COAT_MASK 1"); + public static FieldDescriptor LightingGI = new FieldDescriptor(string.Empty, "LightingGI", "_LIGHTING_GI 1"); + public static FieldDescriptor BackLightingGI = new FieldDescriptor(string.Empty, "BackLightingGI", "_BACK_LIGHTING_GI 1"); + public static FieldDescriptor DepthOffset = new FieldDescriptor(string.Empty, "DepthOffset", "_DEPTH_OFFSET 1"); + public static FieldDescriptor TransparentBackFace = new FieldDescriptor(string.Empty, "TransparentBackFace", string.Empty); public static FieldDescriptor TransparentDepthPrePass = new FieldDescriptor(string.Empty, "TransparentDepthPrePass", string.Empty); public static FieldDescriptor TransparentDepthPostPass = new FieldDescriptor(string.Empty, "TransparentDepthPostPass", string.Empty); - public static FieldDescriptor RayTracing = new FieldDescriptor(string.Empty, "RayTracing", string.Empty); - public static FieldDescriptor Unlit = new FieldDescriptor(string.Empty, "Unlit", string.Empty); + public static FieldDescriptor RayTracing = new FieldDescriptor(string.Empty, "RayTracing", string.Empty); + public static FieldDescriptor Unlit = new FieldDescriptor(string.Empty, "Unlit", string.Empty); #endregion } diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/HDShaderPasses.cs b/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/HDShaderPasses.cs index e41f8be32e6..b109df7b5d3 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/HDShaderPasses.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/HDShaderPasses.cs @@ -163,7 +163,7 @@ static public PassDescriptor GenerateShadowCaster(bool supportLighting) lightMode = "ShadowCaster", useInPreview = false, - validPixelBlocks = new BlockFieldDescriptor[] + validPixelBlocks = new BlockFieldDescriptor[] { BlockFields.SurfaceDescription.Alpha, BlockFields.SurfaceDescription.AlphaClipThreshold, @@ -1255,13 +1255,13 @@ IncludeCollection GenerateIncludes() public static class Defines { // Shadows - public static DefineCollection shadowLow = new DefineCollection { {CoreKeywordDescriptors.Shadow, 0} }; - public static DefineCollection shadowMedium = new DefineCollection { {CoreKeywordDescriptors.Shadow, 1} }; - public static DefineCollection shadowHigh = new DefineCollection { {CoreKeywordDescriptors.Shadow, 2} }; + public static DefineCollection shadowLow = new DefineCollection { { CoreKeywordDescriptors.Shadow, 0 } }; + public static DefineCollection shadowMedium = new DefineCollection { { CoreKeywordDescriptors.Shadow, 1 } }; + public static DefineCollection shadowHigh = new DefineCollection { { CoreKeywordDescriptors.Shadow, 2 } }; // Raytracing Quality - public static DefineCollection raytracingDefault = new DefineCollection { { RayTracingQualityNode.GetRayTracingQualityKeyword(), 0} }; - public static DefineCollection raytracingRaytraced = new DefineCollection { { RayTracingQualityNode.GetRayTracingQualityKeyword(), 1} }; + public static DefineCollection raytracingDefault = new DefineCollection { { RayTracingQualityNode.GetRayTracingQualityKeyword(), 0 } }; + public static DefineCollection raytracingRaytraced = new DefineCollection { { RayTracingQualityNode.GetRayTracingQualityKeyword(), 1 } }; } #endregion diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/HDSubShaderUtilities.cs b/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/HDSubShaderUtilities.cs index b00fcce6ecb..a3fb6c52d4a 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/HDSubShaderUtilities.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/HDSubShaderUtilities.cs @@ -154,8 +154,8 @@ public static void AddBlendingStatesShaderProperties( overrideReferenceName = kTransparentCullMode, floatType = FloatType.Enum, value = (int)transparentCullMode, - enumNames = {"Front", "Back"}, - enumValues = {(int)TransparentCullMode.Front, (int)TransparentCullMode.Back}, + enumNames = { "Front", "Back" }, + enumValues = { (int)TransparentCullMode.Front, (int)TransparentCullMode.Back }, hidden = true, overrideHLSLDeclaration = true, hlslDeclarationOverride = HLSLDeclaration.DoNotDeclare, @@ -202,7 +202,7 @@ public static void AddDoubleSidedProperty(PropertyCollector collector, DoubleSid collector.AddToggleProperty("_DoubleSidedEnable", mode != DoubleSidedMode.Disabled); collector.AddShaderProperty(new Vector1ShaderProperty { - enumNames = {"Flip", "Mirror", "None"}, // values will be 0, 1 and 2 + enumNames = { "Flip", "Mirror", "None" }, // values will be 0, 1 and 2 floatType = FloatType.Enum, overrideReferenceName = "_DoubleSidedNormalMode", hidden = true, diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/HDSubTarget.cs b/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/HDSubTarget.cs index 0819d926422..997655ce26f 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/HDSubTarget.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/HDSubTarget.cs @@ -186,13 +186,13 @@ protected SubShaderDescriptor PostProcessSubShader(SubShaderDescriptor subShader return subShaderDescriptor; } - protected virtual void CollectPassKeywords(ref PassDescriptor pass) {} + protected virtual void CollectPassKeywords(ref PassDescriptor pass) { } public override void GetFields(ref TargetFieldContext context) { // Common properties between all HD master nodes // Dots - context.AddField(HDFields.DotsInstancing, systemData.dotsInstancing); + context.AddField(HDFields.DotsInstancing, systemData.dotsInstancing); } protected abstract IEnumerable EnumerateSubShaders(); diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/HDTarget.cs b/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/HDTarget.cs index 625aab317bb..409071ae58b 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/HDTarget.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/HDTarget.cs @@ -116,7 +116,7 @@ public override void GetFields(ref TargetFieldContext context) { var descs = context.blocks.Select(x => x.descriptor); // Stages - context.AddField(Fields.GraphVertex, descs.Contains(BlockFields.VertexDescription.Position) || + context.AddField(Fields.GraphVertex, descs.Contains(BlockFields.VertexDescription.Position) || descs.Contains(BlockFields.VertexDescription.Normal) || descs.Contains(BlockFields.VertexDescription.Tangent)); context.AddField(Fields.GraphPixel); @@ -170,7 +170,7 @@ public override void GetPropertiesGUI(ref TargetPropertyGUIContext context, Acti m_CustomEditorGUI = m_CustomGUIField.value; onChange(); }); - context.AddProperty("Custom Editor GUI", m_CustomGUIField, (evt) => {}); + context.AddProperty("Custom Editor GUI", m_CustomGUIField, (evt) => { }); context.globalIndentLevel--; } diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/LightingSubTarget.cs b/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/LightingSubTarget.cs index 0e52763992d..3d3918ac015 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/LightingSubTarget.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/LightingSubTarget.cs @@ -82,19 +82,19 @@ public override void GetFields(ref TargetFieldContext context) var descs = context.blocks.Select(x => x.descriptor); // Misc - context.AddField(LightingGI, descs.Contains(HDBlockFields.SurfaceDescription.BakedGI) && context.pass.validPixelBlocks.Contains(HDBlockFields.SurfaceDescription.BakedGI)); - context.AddField(BackLightingGI, descs.Contains(HDBlockFields.SurfaceDescription.BakedBackGI) && context.pass.validPixelBlocks.Contains(HDBlockFields.SurfaceDescription.BakedBackGI)); - context.AddField(BentNormal, descs.Contains(HDBlockFields.SurfaceDescription.BentNormal) && context.connectedBlocks.Contains(HDBlockFields.SurfaceDescription.BentNormal) && context.pass.validPixelBlocks.Contains(HDBlockFields.SurfaceDescription.BentNormal)); - context.AddField(HDFields.AmbientOcclusion, context.blocks.Contains((BlockFields.SurfaceDescription.Occlusion, false)) && context.pass.validPixelBlocks.Contains(BlockFields.SurfaceDescription.Occlusion)); + context.AddField(LightingGI, descs.Contains(HDBlockFields.SurfaceDescription.BakedGI) && context.pass.validPixelBlocks.Contains(HDBlockFields.SurfaceDescription.BakedGI)); + context.AddField(BackLightingGI, descs.Contains(HDBlockFields.SurfaceDescription.BakedBackGI) && context.pass.validPixelBlocks.Contains(HDBlockFields.SurfaceDescription.BakedBackGI)); + context.AddField(BentNormal, descs.Contains(HDBlockFields.SurfaceDescription.BentNormal) && context.connectedBlocks.Contains(HDBlockFields.SurfaceDescription.BentNormal) && context.pass.validPixelBlocks.Contains(HDBlockFields.SurfaceDescription.BentNormal)); + context.AddField(HDFields.AmbientOcclusion, context.blocks.Contains((BlockFields.SurfaceDescription.Occlusion, false)) && context.pass.validPixelBlocks.Contains(BlockFields.SurfaceDescription.Occlusion)); // Specular Occlusion Fields - context.AddField(SpecularOcclusionFromAO, lightingData.specularOcclusionMode == SpecularOcclusionMode.FromAO); - context.AddField(SpecularOcclusionFromAOBentNormal, lightingData.specularOcclusionMode == SpecularOcclusionMode.FromAOAndBentNormal); - context.AddField(SpecularOcclusionCustom, lightingData.specularOcclusionMode == SpecularOcclusionMode.Custom); + context.AddField(SpecularOcclusionFromAO, lightingData.specularOcclusionMode == SpecularOcclusionMode.FromAO); + context.AddField(SpecularOcclusionFromAOBentNormal, lightingData.specularOcclusionMode == SpecularOcclusionMode.FromAOAndBentNormal); + context.AddField(SpecularOcclusionCustom, lightingData.specularOcclusionMode == SpecularOcclusionMode.Custom); // Double Sided - context.AddField(DoubleSidedFlip, systemData.doubleSidedMode == DoubleSidedMode.FlippedNormals && context.pass.referenceName != "SHADERPASS_MOTION_VECTORS"); - context.AddField(DoubleSidedMirror, systemData.doubleSidedMode == DoubleSidedMode.MirroredNormals && context.pass.referenceName != "SHADERPASS_MOTION_VECTORS"); + context.AddField(DoubleSidedFlip, systemData.doubleSidedMode == DoubleSidedMode.FlippedNormals && context.pass.referenceName != "SHADERPASS_MOTION_VECTORS"); + context.AddField(DoubleSidedMirror, systemData.doubleSidedMode == DoubleSidedMode.MirroredNormals && context.pass.referenceName != "SHADERPASS_MOTION_VECTORS"); } protected override void CollectPassKeywords(ref PassDescriptor pass) @@ -146,19 +146,19 @@ public override void GetActiveBlocks(ref TargetActiveBlockContext context) // Specular AA context.AddBlock(HDBlockFields.SurfaceDescription.SpecularAAScreenSpaceVariance, lightingData.specularAA); - context.AddBlock(HDBlockFields.SurfaceDescription.SpecularAAThreshold, lightingData.specularAA); + context.AddBlock(HDBlockFields.SurfaceDescription.SpecularAAThreshold, lightingData.specularAA); // Baked GI - context.AddBlock(HDBlockFields.SurfaceDescription.BakedGI, lightingData.overrideBakedGI); - context.AddBlock(HDBlockFields.SurfaceDescription.BakedBackGI, lightingData.overrideBakedGI); + context.AddBlock(HDBlockFields.SurfaceDescription.BakedGI, lightingData.overrideBakedGI); + context.AddBlock(HDBlockFields.SurfaceDescription.BakedBackGI, lightingData.overrideBakedGI); // Misc - context.AddBlock(HDBlockFields.SurfaceDescription.SpecularOcclusion, lightingData.specularOcclusionMode == SpecularOcclusionMode.Custom); + context.AddBlock(HDBlockFields.SurfaceDescription.SpecularOcclusion, lightingData.specularOcclusionMode == SpecularOcclusionMode.Custom); // Normal dropoff space - context.AddBlock(BlockFields.SurfaceDescription.NormalOS, lightingData.normalDropOffSpace == NormalDropOffSpace.Object); - context.AddBlock(BlockFields.SurfaceDescription.NormalTS, lightingData.normalDropOffSpace == NormalDropOffSpace.Tangent); - context.AddBlock(BlockFields.SurfaceDescription.NormalWS, lightingData.normalDropOffSpace == NormalDropOffSpace.World); + context.AddBlock(BlockFields.SurfaceDescription.NormalOS, lightingData.normalDropOffSpace == NormalDropOffSpace.Object); + context.AddBlock(BlockFields.SurfaceDescription.NormalTS, lightingData.normalDropOffSpace == NormalDropOffSpace.Tangent); + context.AddBlock(BlockFields.SurfaceDescription.NormalWS, lightingData.normalDropOffSpace == NormalDropOffSpace.World); } public override void CollectShaderProperties(PropertyCollector collector, GenerationMode generationMode) diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/Nodes/DiffusionProfileNode.cs b/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/Nodes/DiffusionProfileNode.cs index 24e4f04c0b3..41227d40ea9 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/Nodes/DiffusionProfileNode.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/Nodes/DiffusionProfileNode.cs @@ -34,14 +34,14 @@ public DiffusionProfileNode() private class DiffusionProfileSerializer { [SerializeField] - public DiffusionProfileSettings diffusionProfileAsset; + public DiffusionProfileSettings diffusionProfileAsset; } [SerializeField] string m_SerializedDiffusionProfile; [NonSerialized] - DiffusionProfileSettings m_DiffusionProfileAsset; + DiffusionProfileSettings m_DiffusionProfileAsset; //Hide name to be consistent with Texture2DAsset node [ObjectControl("")] diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/Nodes/EmissionNode.cs b/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/Nodes/EmissionNode.cs index f11cc99b204..5d32142da17 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/Nodes/EmissionNode.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/Nodes/EmissionNode.cs @@ -43,10 +43,10 @@ EmissiveIntensityUnit intensityUnit } [SerializeField] - bool m_NormalizeColor; + bool m_NormalizeColor; [ToggleControl("Normalize Color")] - ToggleData normalizeColor + ToggleData normalizeColor { get { return new ToggleData(m_NormalizeColor); } set @@ -67,8 +67,8 @@ ToggleData normalizeColor public override bool hasPreview { get { return false; } } - ColorRGBMaterialSlot ldrColorSlot; - Vector1MaterialSlot intensitySlot; + ColorRGBMaterialSlot ldrColorSlot; + Vector1MaterialSlot intensitySlot; public sealed override void UpdateNodeAfterDeserialization() { @@ -80,7 +80,7 @@ public sealed override void UpdateNodeAfterDeserialization() AddSlot(new Vector1MaterialSlot(kEmissionExposureWeightInputSlotId, kEmissionExpositionWeightInputSlotName, kEmissionExpositionWeightInputSlotName, SlotType.Input, 1)); // Output slot:kEmissionOutputSlotName - AddSlot(new ColorRGBMaterialSlot(kEmissionOutputSlotId, kEmissionOutputSlotName, kEmissionOutputSlotName , SlotType.Output, Color.black, ColorMode.HDR)); + AddSlot(new ColorRGBMaterialSlot(kEmissionOutputSlotId, kEmissionOutputSlotName, kEmissionOutputSlotName, SlotType.Output, Color.black, ColorMode.HDR)); RemoveSlotsNameNotMatching(new[] { diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/Nodes/ExposureNode.cs b/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/Nodes/ExposureNode.cs index 78bfa340e17..8febdec5409 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/Nodes/ExposureNode.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/Nodes/ExposureNode.cs @@ -39,7 +39,7 @@ public ExposureNode() public override string documentationURL => Documentation.GetPageLink("SGNode-Exposure"); [SerializeField] - ExposureType m_ExposureType; + ExposureType m_ExposureType; [EnumControl("Type")] public ExposureType exposureType { @@ -58,7 +58,7 @@ public ExposureType exposureType public sealed override void UpdateNodeAfterDeserialization() { - AddSlot(new ColorRGBMaterialSlot(kExposureOutputSlotId, kExposureOutputSlotName, kExposureOutputSlotName , SlotType.Output, Color.black, ColorMode.Default)); + AddSlot(new ColorRGBMaterialSlot(kExposureOutputSlotId, kExposureOutputSlotName, kExposureOutputSlotName, SlotType.Output, Color.black, ColorMode.Default)); RemoveSlotsNameNotMatching(new[] { diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/Nodes/HDSceneColorNode.cs b/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/Nodes/HDSceneColorNode.cs index 9b81f9c09b0..29bc8bd133e 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/Nodes/HDSceneColorNode.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/Nodes/HDSceneColorNode.cs @@ -23,9 +23,9 @@ public HDSceneColorNode() public override string documentationURL => Documentation.GetPageLink("SGNode-HD-Scene-Color"); [SerializeField] - bool m_Exposure; + bool m_Exposure; [ToggleControl] - public ToggleData exposure + public ToggleData exposure { get => new ToggleData(m_Exposure); set @@ -49,7 +49,7 @@ public sealed override void UpdateNodeAfterDeserialization() { AddSlot(new ScreenPositionMaterialSlot(kUvInputSlotId, kUvInputSlotName, kUvInputSlotName, ScreenSpaceType.Default)); AddSlot(new Vector1MaterialSlot(kLodInputSlotId, kLodInputSlotName, kLodInputSlotName, SlotType.Input, 0, ShaderStageCapability.Fragment)); - AddSlot(new ColorRGBMaterialSlot(kColorOutputSlotId, kColorOutputSlotName, kColorOutputSlotName , SlotType.Output, Color.black, ColorMode.HDR)); + AddSlot(new ColorRGBMaterialSlot(kColorOutputSlotId, kColorOutputSlotName, kColorOutputSlotName, SlotType.Output, Color.black, ColorMode.HDR)); RemoveSlotsNameNotMatching(new[] { diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/Slots/DefaultMaterialSlot.cs b/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/Slots/DefaultMaterialSlot.cs index 807b2b07503..e5d112756db 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/Slots/DefaultMaterialSlot.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/Slots/DefaultMaterialSlot.cs @@ -10,12 +10,12 @@ namespace UnityEditor.ShaderGraph class DefaultMaterialSlot : Vector3MaterialSlot { public DefaultMaterialSlot() - {} + { } public DefaultMaterialSlot(int slotId, string displayName, string shaderOutputName, ShaderStageCapability stageCapability = ShaderStageCapability.All, bool hidden = false) : base(slotId, displayName, shaderOutputName, SlotType.Input, Vector3.zero, stageCapability, hidden: hidden) - {} + { } public override VisualElement InstantiateControl() { diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/Slots/DiffusionProfileInputMaterialSlot.cs b/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/Slots/DiffusionProfileInputMaterialSlot.cs index 305c7ae4dd6..23019577fbd 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/Slots/DiffusionProfileInputMaterialSlot.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/Slots/DiffusionProfileInputMaterialSlot.cs @@ -26,7 +26,7 @@ class DiffusionProfileInputMaterialSlot : Vector1MaterialSlot, IHasDependencies private class DiffusionProfileSerializer { [SerializeField] - public DiffusionProfileSettings diffusionProfileAsset = null; + public DiffusionProfileSettings diffusionProfileAsset = null; } [SerializeField] diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/SubTargetPropertyBlock.cs b/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/SubTargetPropertyBlock.cs index 8b06165ecb5..639047bdfbb 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/SubTargetPropertyBlock.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/SubTargetPropertyBlock.cs @@ -54,7 +54,8 @@ protected void AddProperty(GUIContent displayName, Func getter, Acti if (elem != null) { - context.AddProperty(displayName.text, indentLevel, elem, (evt) => { + context.AddProperty(displayName.text, indentLevel, elem, (evt) => + { if (Equals(getter(), evt.newValue)) return; @@ -65,7 +66,8 @@ protected void AddProperty(GUIContent displayName, Func getter, Acti } else { - context.AddProperty(displayName.text, indentLevel, elemEnum, (evt) => { + context.AddProperty(displayName.text, indentLevel, elemEnum, (evt) => + { if (Equals(getter(), evt.newValue)) return; @@ -81,13 +83,15 @@ protected void AddFoldout(string text, Func getter, Action setter) protected void AddFoldout(GUIContent content, Func getter, Action setter) { - var foldout = new Foldout() { + var foldout = new Foldout() + { value = getter(), text = content.text, tooltip = content.tooltip }; - foldout.RegisterValueChangedCallback((evt) => { + foldout.RegisterValueChangedCallback((evt) => + { setter(evt.newValue); onChange(); }); diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/SurfaceOptionPropertyBlock.cs b/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/SurfaceOptionPropertyBlock.cs index 738720cb50f..69d44d35188 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/SurfaceOptionPropertyBlock.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/SurfaceOptionPropertyBlock.cs @@ -17,12 +17,12 @@ class SurfaceOptionPropertyBlock : SubTargetPropertyBlock [Flags] public enum Features { - None = 0, - ShowDoubleSidedNormal = 1 << 0, - All = ~0, + None = 0, + ShowDoubleSidedNormal = 1 << 0, + All = ~0, - Unlit = Lit ^ ShowDoubleSidedNormal, // hide double sided normal for unlit - Lit = All, + Unlit = Lit ^ ShowDoubleSidedNormal, // hide double sided normal for unlit + Lit = All, } class Styles @@ -40,7 +40,8 @@ class Styles protected override void CreatePropertyGUI() { - AddProperty(surfaceTypeText, () => systemData.surfaceType, (newValue) => { + AddProperty(surfaceTypeText, () => systemData.surfaceType, (newValue) => + { systemData.surfaceType = newValue; systemData.TryChangeRenderingPass(systemData.renderQueueType); }); diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/SurfaceSubTarget.cs b/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/SurfaceSubTarget.cs index 550cfd1f963..ca6c51b2463 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/SurfaceSubTarget.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/SurfaceSubTarget.cs @@ -200,20 +200,20 @@ public override void GetFields(ref TargetFieldContext context) // All the DoAlphaXXX field drive the generation of which code to use for alpha test in the template // Regular alpha test is only done if artist haven't ask to use the specific alpha test shadow one - bool isShadowPass = (context.pass.lightMode == "ShadowCaster") || (context.pass.lightMode == "VisibilityDXR"); - bool isTransparentDepthPrepass = context.pass.lightMode == "TransparentDepthPrepass"; + bool isShadowPass = (context.pass.lightMode == "ShadowCaster") || (context.pass.lightMode == "VisibilityDXR"); + bool isTransparentDepthPrepass = context.pass.lightMode == "TransparentDepthPrepass"; // Shadow use the specific alpha test only if user have ask to override it - context.AddField(HDFields.DoAlphaTestShadow, systemData.alphaTest && builtinData.alphaTestShadow && isShadowPass && + context.AddField(HDFields.DoAlphaTestShadow, systemData.alphaTest && builtinData.alphaTestShadow && isShadowPass && context.pass.validPixelBlocks.Contains(HDBlockFields.SurfaceDescription.AlphaClipThresholdShadow)); // Pre/post pass always use the specific alpha test provided for those pass - context.AddField(HDFields.DoAlphaTestPrepass, systemData.alphaTest && builtinData.transparentDepthPrepass && isTransparentDepthPrepass && + context.AddField(HDFields.DoAlphaTestPrepass, systemData.alphaTest && builtinData.transparentDepthPrepass && isTransparentDepthPrepass && context.pass.validPixelBlocks.Contains(HDBlockFields.SurfaceDescription.AlphaClipThresholdDepthPrepass)); // Features & Misc - context.AddField(Fields.LodCrossFade, builtinData.supportLodCrossFade); - context.AddField(Fields.AlphaToMask, systemData.alphaTest); - context.AddField(HDFields.TransparentBackFace, builtinData.backThenFrontRendering); + context.AddField(Fields.LodCrossFade, builtinData.supportLodCrossFade); + context.AddField(Fields.AlphaToMask, systemData.alphaTest); + context.AddField(HDFields.TransparentBackFace, builtinData.backThenFrontRendering); context.AddField(HDFields.TransparentDepthPrePass, builtinData.transparentDepthPrepass); context.AddField(HDFields.TransparentDepthPostPass, builtinData.transparentDepthPostpass); @@ -227,11 +227,11 @@ public override void GetFields(ref TargetFieldContext context) protected void AddDistortionFields(ref TargetFieldContext context) { // Distortion - context.AddField(HDFields.DistortionDepthTest, builtinData.distortionDepthTest); - context.AddField(HDFields.DistortionAdd, builtinData.distortionMode == DistortionMode.Add); - context.AddField(HDFields.DistortionMultiply, builtinData.distortionMode == DistortionMode.Multiply); - context.AddField(HDFields.DistortionReplace, builtinData.distortionMode == DistortionMode.Replace); - context.AddField(HDFields.TransparentDistortion, systemData.surfaceType != SurfaceType.Opaque && builtinData.distortion); + context.AddField(HDFields.DistortionDepthTest, builtinData.distortionDepthTest); + context.AddField(HDFields.DistortionAdd, builtinData.distortionMode == DistortionMode.Add); + context.AddField(HDFields.DistortionMultiply, builtinData.distortionMode == DistortionMode.Multiply); + context.AddField(HDFields.DistortionReplace, builtinData.distortionMode == DistortionMode.Replace); + context.AddField(HDFields.TransparentDistortion, systemData.surfaceType != SurfaceType.Opaque && builtinData.distortion); } public override void GetActiveBlocks(ref TargetActiveBlockContext context) @@ -262,8 +262,8 @@ public override void GetActiveBlocks(ref TargetActiveBlockContext context) protected void AddDistortionBlocks(ref TargetActiveBlockContext context) { - context.AddBlock(HDBlockFields.SurfaceDescription.Distortion, systemData.surfaceType == SurfaceType.Transparent && builtinData.distortion); - context.AddBlock(HDBlockFields.SurfaceDescription.DistortionBlur, systemData.surfaceType == SurfaceType.Transparent && builtinData.distortion); + context.AddBlock(HDBlockFields.SurfaceDescription.Distortion, systemData.surfaceType == SurfaceType.Transparent && builtinData.distortion); + context.AddBlock(HDBlockFields.SurfaceDescription.DistortionBlur, systemData.surfaceType == SurfaceType.Transparent && builtinData.distortion); } public override void GetPropertiesGUI(ref TargetPropertyGUIContext context, Action onChange, Action registerUndo) diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/Views/DiffusionProfileSlotControlView.cs b/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/Views/DiffusionProfileSlotControlView.cs index a86374d5772..9c781085f8a 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/Views/DiffusionProfileSlotControlView.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/Views/DiffusionProfileSlotControlView.cs @@ -12,7 +12,7 @@ class DiffusionProfileSlotControlView : VisualElement { DiffusionProfileInputMaterialSlot m_Slot; - ObjectField diffusionProfileField; + ObjectField diffusionProfileField; public DiffusionProfileSlotControlView(DiffusionProfileInputMaterialSlot slot) { diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/StackLit/ShaderGraph/CreateStackLitShaderGraph.cs b/com.unity.render-pipelines.high-definition/Editor/Material/StackLit/ShaderGraph/CreateStackLitShaderGraph.cs index 93c2d0263ad..65f76fd34e0 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/StackLit/ShaderGraph/CreateStackLitShaderGraph.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/StackLit/ShaderGraph/CreateStackLitShaderGraph.cs @@ -28,7 +28,7 @@ public static void CreateStackLitGraph() BlockFields.SurfaceDescription.Alpha, }; - GraphUtil.CreateNewGraphWithOutputs(new[] {target}, blockDescriptors); + GraphUtil.CreateNewGraphWithOutputs(new[] { target }, blockDescriptors); } } } diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/StackLit/ShaderGraph/StackLitSubTarget.cs b/com.unity.render-pipelines.high-definition/Editor/Material/StackLit/ShaderGraph/StackLitSubTarget.cs index b7417d5d0a1..b638a899288 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/StackLit/ShaderGraph/StackLitSubTarget.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/StackLit/ShaderGraph/StackLitSubTarget.cs @@ -63,18 +63,18 @@ public StackLitData stackLitData const string kBaseParametrization = "BaseParametrization"; // Material - public static FieldDescriptor Coat = new FieldDescriptor(kMaterial, "Coat", "_MATERIAL_FEATURE_COAT"); - public static FieldDescriptor DualSpecularLobe = new FieldDescriptor(kMaterial, "DualSpecularLobe", "_MATERIAL_FEATURE_DUAL_SPECULAR_LOBE"); - public static FieldDescriptor CoatNormal = new FieldDescriptor(kMaterial, "CoatNormal", "_MATERIAL_FEATURE_COAT_NORMALMAP"); + public static FieldDescriptor Coat = new FieldDescriptor(kMaterial, "Coat", "_MATERIAL_FEATURE_COAT"); + public static FieldDescriptor DualSpecularLobe = new FieldDescriptor(kMaterial, "DualSpecularLobe", "_MATERIAL_FEATURE_DUAL_SPECULAR_LOBE"); + public static FieldDescriptor CoatNormal = new FieldDescriptor(kMaterial, "CoatNormal", "_MATERIAL_FEATURE_COAT_NORMALMAP"); // Advanced public static FieldDescriptor AnisotropyForAreaLights = new FieldDescriptor(string.Empty, "AnisotropyForAreaLights", "_ANISOTROPY_FOR_AREA_LIGHTS"); - public static FieldDescriptor RecomputeStackPerLight = new FieldDescriptor(string.Empty, "RecomputeStackPerLight", "_VLAYERED_RECOMPUTE_PERLIGHT"); + public static FieldDescriptor RecomputeStackPerLight = new FieldDescriptor(string.Empty, "RecomputeStackPerLight", "_VLAYERED_RECOMPUTE_PERLIGHT"); public static FieldDescriptor HonorPerLightMinRoughness = new FieldDescriptor(string.Empty, "HonorPerLightMinRoughness", "_STACK_LIT_HONORS_LIGHT_MIN_ROUGHNESS"); public static FieldDescriptor ShadeBaseUsingRefractedAngles = new FieldDescriptor(string.Empty, "ShadeBaseUsingRefractedAngles", "_VLAYERED_USE_REFRACTED_ANGLES_FOR_BASE"); - public static FieldDescriptor StackLitDebug = new FieldDescriptor(string.Empty, "StackLitDebug", "_STACKLIT_DEBUG"); + public static FieldDescriptor StackLitDebug = new FieldDescriptor(string.Empty, "StackLitDebug", "_STACKLIT_DEBUG"); public static FieldDescriptor CapHazinessIfNotMetallic = new FieldDescriptor(string.Empty, "CapHazinessIfNotMetallic", ""); - public static FieldDescriptor GeometricSpecularAA = new FieldDescriptor(kSpecular, "GeometricAA", "_ENABLE_GEOMETRIC_SPECULAR_AA 1"); + public static FieldDescriptor GeometricSpecularAA = new FieldDescriptor(kSpecular, "GeometricAA", "_ENABLE_GEOMETRIC_SPECULAR_AA 1"); // Screen Space Specular Occlusion Base Mode public static FieldDescriptor SSSpecularOcclusionBaseModeOff = new FieldDescriptor(kSSSpecularOcclusionBaseMode, "Off", "_SCREENSPACE_SPECULAROCCLUSION_METHOD SPECULAR_OCCLUSION_DISABLED"); @@ -112,10 +112,10 @@ public StackLitData stackLitData public static FieldDescriptor SpecularOcclusionConeFixupMethodBoostAndTilt = new FieldDescriptor(kSpecularOcclusionConeFixupMethod, "BoostAndTilt", "_BENT_VISIBILITY_FIXUP_FLAGS (BENT_VISIBILITY_FIXUP_FLAGS_BOOST_BSDF_ROUGHNESS|BENT_VISIBILITY_FIXUP_FLAGS_TILT_BENTNORMAL_TO_GEOM)"); // Dual Specular Lobe Parametrization - public static FieldDescriptor HazyGloss = new FieldDescriptor(kDualSpecularLobeParametrization, "HazyGloss", "_MATERIAL_FEATURE_HAZY_GLOSS"); + public static FieldDescriptor HazyGloss = new FieldDescriptor(kDualSpecularLobeParametrization, "HazyGloss", "_MATERIAL_FEATURE_HAZY_GLOSS"); // Base Parametrization - public static FieldDescriptor BaseParamSpecularColor = new FieldDescriptor(kBaseParametrization, "SpecularColor", "_MATERIAL_FEATURE_SPECULAR_COLOR"); + public static FieldDescriptor BaseParamSpecularColor = new FieldDescriptor(kBaseParametrization, "SpecularColor", "_MATERIAL_FEATURE_SPECULAR_COLOR"); protected override SubShaderDescriptor GetRaytracingSubShaderDescriptor() { @@ -135,39 +135,39 @@ public override void GetFields(ref TargetFieldContext context) // StackLit specific properties // Material - context.AddField(Anisotropy, stackLitData.anisotropy); - context.AddField(Coat, stackLitData.coat); - context.AddField(CoatMask, stackLitData.coat && context.pass.validPixelBlocks.Contains(BlockFields.SurfaceDescription.CoatMask) && + context.AddField(Anisotropy, stackLitData.anisotropy); + context.AddField(Coat, stackLitData.coat); + context.AddField(CoatMask, stackLitData.coat && context.pass.validPixelBlocks.Contains(BlockFields.SurfaceDescription.CoatMask) && descs.Contains(BlockFields.SurfaceDescription.CoatMask)); // context.AddField(CoatMaskZero, coat.isOn && pass.pixelBlocks.Contains(CoatMaskSlotId) && // FindSlot(CoatMaskSlotId).value == 0.0f), // context.AddField(CoatMaskOne, coat.isOn && pass.pixelBlocks.Contains(CoatMaskSlotId) && // FindSlot(CoatMaskSlotId).value == 1.0f), - context.AddField(CoatNormal, stackLitData.coatNormal + context.AddField(CoatNormal, stackLitData.coatNormal && (context.pass.validPixelBlocks.Contains(HDBlockFields.SurfaceDescription.CoatNormalOS) || context.pass.validPixelBlocks.Contains(HDBlockFields.SurfaceDescription.CoatNormalTS) || context.pass.validPixelBlocks.Contains(HDBlockFields.SurfaceDescription.CoatNormalWS))); - context.AddField(Iridescence, stackLitData.iridescence); - context.AddField(SubsurfaceScattering, stackLitData.subsurfaceScattering && systemData.surfaceType != SurfaceType.Transparent); - context.AddField(Transmission, stackLitData.transmission); - context.AddField(DualSpecularLobe, stackLitData.dualSpecularLobe); + context.AddField(Iridescence, stackLitData.iridescence); + context.AddField(SubsurfaceScattering, stackLitData.subsurfaceScattering && systemData.surfaceType != SurfaceType.Transparent); + context.AddField(Transmission, stackLitData.transmission); + context.AddField(DualSpecularLobe, stackLitData.dualSpecularLobe); // Base Parametrization // Even though we can just always transfer the present (check with $SurfaceDescription.*) fields like specularcolor // and metallic, we still need to know the baseParametrization in the template to translate into the // _MATERIAL_FEATURE_SPECULAR_COLOR define: - context.AddField(BaseParamSpecularColor, stackLitData.baseParametrization == StackLit.BaseParametrization.SpecularColor); + context.AddField(BaseParamSpecularColor, stackLitData.baseParametrization == StackLit.BaseParametrization.SpecularColor); // Dual Specular Lobe Parametrization - context.AddField(HazyGloss, stackLitData.dualSpecularLobe && + context.AddField(HazyGloss, stackLitData.dualSpecularLobe && stackLitData.dualSpecularLobeParametrization == StackLit.DualSpecularLobeParametrization.HazyGloss); // Misc - context.AddField(EnergyConservingSpecular, stackLitData.energyConservingSpecular); + context.AddField(EnergyConservingSpecular, stackLitData.energyConservingSpecular); // Option for baseParametrization == Metallic && DualSpecularLobeParametrization == HazyGloss: // Again we assume masternode has HazyGlossMaxDielectricF0 which should always be the case // if capHazinessWrtMetallic.isOn. - context.AddField(CapHazinessIfNotMetallic, stackLitData.dualSpecularLobe && + context.AddField(CapHazinessIfNotMetallic, stackLitData.dualSpecularLobe && stackLitData.dualSpecularLobeParametrization == StackLit.DualSpecularLobeParametrization.HazyGloss && stackLitData.capHazinessWrtMetallic && stackLitData.baseParametrization == StackLit.BaseParametrization.BaseMetallic && context.pass.validPixelBlocks.Contains(HDBlockFields.SurfaceDescription.HazyGlossMaxDielectricF0)); @@ -188,21 +188,21 @@ public override void GetFields(ref TargetFieldContext context) // // (Note we can achieve the same results in the template on just single predicates by making defines out of them, // and using #if defined() && etc) - context.AddField(GeometricSpecularAA, lightingData.specularAA && + context.AddField(GeometricSpecularAA, lightingData.specularAA && context.pass.validPixelBlocks.Contains(HDBlockFields.SurfaceDescription.SpecularAAScreenSpaceVariance) && context.pass.validPixelBlocks.Contains(HDBlockFields.SurfaceDescription.SpecularAAThreshold)); - context.AddField(SpecularAA, lightingData.specularAA && + context.AddField(SpecularAA, lightingData.specularAA && context.pass.validPixelBlocks.Contains(HDBlockFields.SurfaceDescription.SpecularAAScreenSpaceVariance) && context.pass.validPixelBlocks.Contains(HDBlockFields.SurfaceDescription.SpecularAAThreshold)); - context.AddField(SpecularOcclusion, stackLitData.screenSpaceSpecularOcclusionBaseMode != StackLitData.SpecularOcclusionBaseMode.Off || + context.AddField(SpecularOcclusion, stackLitData.screenSpaceSpecularOcclusionBaseMode != StackLitData.SpecularOcclusionBaseMode.Off || stackLitData.dataBasedSpecularOcclusionBaseMode != StackLitData.SpecularOcclusionBaseMode.Off); // Advanced - context.AddField(AnisotropyForAreaLights, stackLitData.anisotropyForAreaLights); - context.AddField(RecomputeStackPerLight, stackLitData.recomputeStackPerLight); - context.AddField(HonorPerLightMinRoughness, stackLitData.honorPerLightMinRoughness); + context.AddField(AnisotropyForAreaLights, stackLitData.anisotropyForAreaLights); + context.AddField(RecomputeStackPerLight, stackLitData.recomputeStackPerLight); + context.AddField(HonorPerLightMinRoughness, stackLitData.honorPerLightMinRoughness); context.AddField(ShadeBaseUsingRefractedAngles, stackLitData.shadeBaseUsingRefractedAngles); - context.AddField(StackLitDebug, stackLitData.debug); + context.AddField(StackLitDebug, stackLitData.debug); // Screen Space Specular Occlusion Base Mode context.AddField(SSSpecularOcclusionBaseModeOff, stackLitData.screenSpaceSpecularOcclusionBaseMode == StackLitData.SpecularOcclusionBaseMode.Off); @@ -274,22 +274,22 @@ public override void GetActiveBlocks(ref TargetActiveBlockContext context) } context.AddBlock(tangentBlock); - context.AddBlock(HDBlockFields.SurfaceDescription.Anisotropy, stackLitData.anisotropy); - context.AddBlock(HDBlockFields.SurfaceDescription.SubsurfaceMask, stackLitData.subsurfaceScattering); - context.AddBlock(HDBlockFields.SurfaceDescription.Thickness, stackLitData.transmission); + context.AddBlock(HDBlockFields.SurfaceDescription.Anisotropy, stackLitData.anisotropy); + context.AddBlock(HDBlockFields.SurfaceDescription.SubsurfaceMask, stackLitData.subsurfaceScattering); + context.AddBlock(HDBlockFields.SurfaceDescription.Thickness, stackLitData.transmission); context.AddBlock(HDBlockFields.SurfaceDescription.DiffusionProfileHash, stackLitData.subsurfaceScattering || stackLitData.transmission); // Base Metallic - context.AddBlock(BlockFields.SurfaceDescription.Metallic, stackLitData.baseParametrization == StackLit.BaseParametrization.BaseMetallic); - context.AddBlock(HDBlockFields.SurfaceDescription.DielectricIor, stackLitData.baseParametrization == StackLit.BaseParametrization.BaseMetallic); + context.AddBlock(BlockFields.SurfaceDescription.Metallic, stackLitData.baseParametrization == StackLit.BaseParametrization.BaseMetallic); + context.AddBlock(HDBlockFields.SurfaceDescription.DielectricIor, stackLitData.baseParametrization == StackLit.BaseParametrization.BaseMetallic); // Base Specular - context.AddBlock(BlockFields.SurfaceDescription.Specular, stackLitData.baseParametrization == StackLit.BaseParametrization.SpecularColor); + context.AddBlock(BlockFields.SurfaceDescription.Specular, stackLitData.baseParametrization == StackLit.BaseParametrization.SpecularColor); // Specular Occlusion // for custom (external) SO replacing data based SO (which normally comes from some func of DataBasedSOMode(dataAO, optional bent normal)) // TODO: we would ideally need one value per lobe - context.AddBlock(HDBlockFields.SurfaceDescription.SpecularOcclusion, DataBasedSpecularOcclusionIsCustom()); + context.AddBlock(HDBlockFields.SurfaceDescription.SpecularOcclusion, DataBasedSpecularOcclusionIsCustom()); context.AddBlock(HDBlockFields.SurfaceDescription.SOFixupVisibilityRatioThreshold, SpecularOcclusionUsesBentNormal(stackLitData) && stackLitData.specularOcclusionConeFixupMethod != StackLitData.SpecularOcclusionConeFixupMethod.Off); context.AddBlock(HDBlockFields.SurfaceDescription.SOFixupStrengthFactor, SpecularOcclusionUsesBentNormal(stackLitData) && @@ -298,27 +298,27 @@ public override void GetActiveBlocks(ref TargetActiveBlockContext context) stackLitData.specularOcclusionConeFixupMethod != StackLitData.SpecularOcclusionConeFixupMethod.Off); // Coat - context.AddBlock(BlockFields.SurfaceDescription.CoatSmoothness, stackLitData.coat); - context.AddBlock(HDBlockFields.SurfaceDescription.CoatIor, stackLitData.coat); - context.AddBlock(HDBlockFields.SurfaceDescription.CoatThickness, stackLitData.coat); - context.AddBlock(HDBlockFields.SurfaceDescription.CoatExtinction, stackLitData.coat); - context.AddBlock(HDBlockFields.SurfaceDescription.CoatNormalOS, stackLitData.coat && stackLitData.coatNormal && lightingData.normalDropOffSpace == NormalDropOffSpace.Object); - context.AddBlock(HDBlockFields.SurfaceDescription.CoatNormalTS, stackLitData.coat && stackLitData.coatNormal && lightingData.normalDropOffSpace == NormalDropOffSpace.Tangent); - context.AddBlock(HDBlockFields.SurfaceDescription.CoatNormalWS, stackLitData.coat && stackLitData.coatNormal && lightingData.normalDropOffSpace == NormalDropOffSpace.World); - context.AddBlock(BlockFields.SurfaceDescription.CoatMask, stackLitData.coat); + context.AddBlock(BlockFields.SurfaceDescription.CoatSmoothness, stackLitData.coat); + context.AddBlock(HDBlockFields.SurfaceDescription.CoatIor, stackLitData.coat); + context.AddBlock(HDBlockFields.SurfaceDescription.CoatThickness, stackLitData.coat); + context.AddBlock(HDBlockFields.SurfaceDescription.CoatExtinction, stackLitData.coat); + context.AddBlock(HDBlockFields.SurfaceDescription.CoatNormalOS, stackLitData.coat && stackLitData.coatNormal && lightingData.normalDropOffSpace == NormalDropOffSpace.Object); + context.AddBlock(HDBlockFields.SurfaceDescription.CoatNormalTS, stackLitData.coat && stackLitData.coatNormal && lightingData.normalDropOffSpace == NormalDropOffSpace.Tangent); + context.AddBlock(HDBlockFields.SurfaceDescription.CoatNormalWS, stackLitData.coat && stackLitData.coatNormal && lightingData.normalDropOffSpace == NormalDropOffSpace.World); + context.AddBlock(BlockFields.SurfaceDescription.CoatMask, stackLitData.coat); // Dual Specular Lobe - context.AddBlock(HDBlockFields.SurfaceDescription.SmoothnessB, stackLitData.dualSpecularLobe && stackLitData.dualSpecularLobeParametrization == StackLit.DualSpecularLobeParametrization.Direct); - context.AddBlock(HDBlockFields.SurfaceDescription.LobeMix, stackLitData.dualSpecularLobe && stackLitData.dualSpecularLobeParametrization == StackLit.DualSpecularLobeParametrization.Direct); + context.AddBlock(HDBlockFields.SurfaceDescription.SmoothnessB, stackLitData.dualSpecularLobe && stackLitData.dualSpecularLobeParametrization == StackLit.DualSpecularLobeParametrization.Direct); + context.AddBlock(HDBlockFields.SurfaceDescription.LobeMix, stackLitData.dualSpecularLobe && stackLitData.dualSpecularLobeParametrization == StackLit.DualSpecularLobeParametrization.Direct); - context.AddBlock(HDBlockFields.SurfaceDescription.Haziness, stackLitData.dualSpecularLobe && stackLitData.dualSpecularLobeParametrization == StackLit.DualSpecularLobeParametrization.HazyGloss); - context.AddBlock(HDBlockFields.SurfaceDescription.HazeExtent, stackLitData.dualSpecularLobe && stackLitData.dualSpecularLobeParametrization == StackLit.DualSpecularLobeParametrization.HazyGloss); + context.AddBlock(HDBlockFields.SurfaceDescription.Haziness, stackLitData.dualSpecularLobe && stackLitData.dualSpecularLobeParametrization == StackLit.DualSpecularLobeParametrization.HazyGloss); + context.AddBlock(HDBlockFields.SurfaceDescription.HazeExtent, stackLitData.dualSpecularLobe && stackLitData.dualSpecularLobeParametrization == StackLit.DualSpecularLobeParametrization.HazyGloss); context.AddBlock(HDBlockFields.SurfaceDescription.HazyGlossMaxDielectricF0, stackLitData.dualSpecularLobe && stackLitData.dualSpecularLobeParametrization == StackLit.DualSpecularLobeParametrization.HazyGloss && stackLitData.capHazinessWrtMetallic && stackLitData.baseParametrization == StackLit.BaseParametrization.BaseMetallic); - context.AddBlock(HDBlockFields.SurfaceDescription.AnisotropyB, stackLitData.dualSpecularLobe && stackLitData.anisotropy); + context.AddBlock(HDBlockFields.SurfaceDescription.AnisotropyB, stackLitData.dualSpecularLobe && stackLitData.anisotropy); // Iridescence - context.AddBlock(HDBlockFields.SurfaceDescription.IridescenceMask, stackLitData.iridescence); + context.AddBlock(HDBlockFields.SurfaceDescription.IridescenceMask, stackLitData.iridescence); context.AddBlock(HDBlockFields.SurfaceDescription.IridescenceThickness, stackLitData.iridescence); context.AddBlock(HDBlockFields.SurfaceDescription.IridescenceCoatFixupTIR, stackLitData.iridescence && stackLitData.coat); context.AddBlock(HDBlockFields.SurfaceDescription.IridescenceCoatFixupTIRClamp, stackLitData.iridescence && stackLitData.coat); diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/TerrainLit/TerrainLitGUI.cs b/com.unity.render-pipelines.high-definition/Editor/Material/TerrainLit/TerrainLitGUI.cs index 83d625d689f..c233bcaddcd 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/TerrainLit/TerrainLitGUI.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/TerrainLit/TerrainLitGUI.cs @@ -19,7 +19,7 @@ class TerrainLitGUI : HDShaderGUI, ITerrainLayerCustomUI [Flags] enum Expandable { - Terrain = 1 << 0, + Terrain = 1 << 0, } MaterialUIBlockList uiBlocks = new MaterialUIBlockList diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/AdvancedOptionsUIBlock.cs b/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/AdvancedOptionsUIBlock.cs index 26edb418c6c..17fd16971de 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/AdvancedOptionsUIBlock.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/AdvancedOptionsUIBlock.cs @@ -19,23 +19,23 @@ public class AdvancedOptionsUIBlock : MaterialUIBlock public enum Features { /// Hide all the fields in the block. - None = 0, + None = 0, /// Display the instancing field. - Instancing = 1 << 0, + Instancing = 1 << 0, /// Display the specular occlusion field. - SpecularOcclusion = 1 << 1, + SpecularOcclusion = 1 << 1, /// Display the add precomputed velocity field. - AddPrecomputedVelocity = 1 << 2, + AddPrecomputedVelocity = 1 << 2, /// Display the double sided GI field. - DoubleSidedGI = 1 << 3, + DoubleSidedGI = 1 << 3, /// Display the emission GI field. - EmissionGI = 1 << 4, + EmissionGI = 1 << 4, /// Display the motion vector field. - MotionVector = 1 << 5, + MotionVector = 1 << 5, /// Display the fields for Lit shaders. - StandardLit = Instancing | SpecularOcclusion | AddPrecomputedVelocity, + StandardLit = Instancing | SpecularOcclusion | AddPrecomputedVelocity, /// Display all the field. - All = ~0 + All = ~0 } internal class Styles @@ -53,8 +53,8 @@ internal class Styles const string kSpecularOcclusionMode = "_SpecularOcclusionMode"; const string kAddPrecomputedVelocity = HDMaterialProperties.kAddPrecomputedVelocity; - ExpandableBit m_ExpandableBit; - Features m_Features; + ExpandableBit m_ExpandableBit; + Features m_Features; /// /// Constructs the AdvancedOptionsUIBlock based on the parameters. diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/AxfMainSurfaceInputsUIBlock.cs b/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/AxfMainSurfaceInputsUIBlock.cs index 02221e98fa8..0986cb194a4 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/AxfMainSurfaceInputsUIBlock.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/AxfMainSurfaceInputsUIBlock.cs @@ -24,7 +24,7 @@ public class Styles public static GUIContent rayTracingTexFilteringScaleText = new GUIContent("Texture Filtering In Raytracing", "Texture filtering works differently in raytracing. To help with aliasing you can adjust this from 0 (no filtering) to 1 (maximum filtering)"); } - static readonly string[] MappingModeNames = Enum.GetNames(typeof(AxFMappingMode)); + static readonly string[] MappingModeNames = Enum.GetNames(typeof(AxFMappingMode)); static string m_MappingModeText = "_MappingMode"; MaterialProperty m_MappingMode = null; @@ -41,7 +41,7 @@ public class Styles static string m_RayTracingTexFilteringScaleText = "_RayTracingTexFilteringScale"; MaterialProperty m_RayTracingTexFilteringScale = null; - ExpandableBit m_ExpandableBit; + ExpandableBit m_ExpandableBit; public AxfMainSurfaceInputsUIBlock(ExpandableBit expandableBit) { diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/AxfSurfaceInputsUIBlock.cs b/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/AxfSurfaceInputsUIBlock.cs index ed881a8e033..557ab1b953b 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/AxfSurfaceInputsUIBlock.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/AxfSurfaceInputsUIBlock.cs @@ -16,187 +16,187 @@ public class Styles { public const string header = "Advanced Surface Inputs"; - public static GUIContent mapsTilingOffsetText = new GUIContent("Tiling and Offset for Map", "XY scales, ZW offsets"); + public static GUIContent mapsTilingOffsetText = new GUIContent("Tiling and Offset for Map", "XY scales, ZW offsets"); ///////////////////////////////////////////////////////////////////////////////////////////////// // SVBRDF Parameters - public static GUIContent diffuseColorMapText = new GUIContent("Diffuse Color"); - public static GUIContent specularColorMapText = new GUIContent("Specular Color"); - public static GUIContent specularLobeMapText = new GUIContent("Specular Lobe", "Represents the lobe roughnesses"); - public static GUIContent specularLobeMapScaleText = new GUIContent("Specular Lobe Scale", "Multiplying scale for specular lobe"); - public static GUIContent fresnelMapText = new GUIContent("Fresnel", "Fresnel0 map"); - public static GUIContent normalMapText = new GUIContent("Normal"); + public static GUIContent diffuseColorMapText = new GUIContent("Diffuse Color"); + public static GUIContent specularColorMapText = new GUIContent("Specular Color"); + public static GUIContent specularLobeMapText = new GUIContent("Specular Lobe", "Represents the lobe roughnesses"); + public static GUIContent specularLobeMapScaleText = new GUIContent("Specular Lobe Scale", "Multiplying scale for specular lobe"); + public static GUIContent fresnelMapText = new GUIContent("Fresnel", "Fresnel0 map"); + public static GUIContent normalMapText = new GUIContent("Normal"); // Alpha - public static GUIContent alphaMapText = new GUIContent("Alpha"); + public static GUIContent alphaMapText = new GUIContent("Alpha"); // Displacement - public static GUIContent heightMapText = new GUIContent("Height"); + public static GUIContent heightMapText = new GUIContent("Height"); // Anisotropy - public static GUIContent anisoRotationMapText = new GUIContent("Anisotropy Angle"); + public static GUIContent anisoRotationMapText = new GUIContent("Anisotropy Angle"); ///////////////////////////////////////////////////////////////////////////////////////////////// // Car Paint Parameters - public static GUIContent BRDFColorMapText = new GUIContent("BRDF Color", "Angle varying measured color modulation table"); - public static GUIContent BRDFColorMapScaleText = new GUIContent("BRDF Color Scale", "Multiplying factor for color fetched from BRDFColor table"); - public static GUIContent BRDFColorMapUVScaleText = new GUIContent("BRDF Color Map UV scale restriction", "Restrict valid domain of BRDFColor table"); + public static GUIContent BRDFColorMapText = new GUIContent("BRDF Color", "Angle varying measured color modulation table"); + public static GUIContent BRDFColorMapScaleText = new GUIContent("BRDF Color Scale", "Multiplying factor for color fetched from BRDFColor table"); + public static GUIContent BRDFColorMapUVScaleText = new GUIContent("BRDF Color Map UV scale restriction", "Restrict valid domain of BRDFColor table"); - public static GUIContent BTFFlakesMapText = new GUIContent("BTF Flakes Texture2DArray", "Flake slices distributed in angular space"); - public static GUIContent BTFFlakesMapScaleText = new GUIContent("BTF Flakes Scale", "Multiplying factor for the flake intensity"); - public static GUIContent BTFFlakesTilingText = new GUIContent("BTF Flakes Tiling and Offset", "X,Y scales for tiling control, Z,W for offsets"); + public static GUIContent BTFFlakesMapText = new GUIContent("BTF Flakes Texture2DArray", "Flake slices distributed in angular space"); + public static GUIContent BTFFlakesMapScaleText = new GUIContent("BTF Flakes Scale", "Multiplying factor for the flake intensity"); + public static GUIContent BTFFlakesTilingText = new GUIContent("BTF Flakes Tiling and Offset", "X,Y scales for tiling control, Z,W for offsets"); - public static GUIContent thetaFI_sliceLUTMapText = new GUIContent("ThetaFI Slice LUT", "First angular dimension indirection for flake slice number"); + public static GUIContent thetaFI_sliceLUTMapText = new GUIContent("ThetaFI Slice LUT", "First angular dimension indirection for flake slice number"); - public static GUIContent CarPaintFixedColorThetaHForIndirectLightText = new GUIContent("BRDFColor ThetaH For Indirect Light", "Select a fixed angle between normal and half-vector for indirect lighting, when this angle is unknown, to be used for the BRDF color table: " + public static GUIContent CarPaintFixedColorThetaHForIndirectLightText = new GUIContent("BRDFColor ThetaH For Indirect Light", "Select a fixed angle between normal and half-vector for indirect lighting, when this angle is unknown, to be used for the BRDF color table: " + "The value is an angle from 0 to PI/2." + "eg this will select a hue column in the BRDF color table for indirect reflection probes and raytraced indirect light"); - public static GUIContent CarPaintFixedFlakesThetaHForIndirectLightText = new GUIContent("Flakes ThetaH For Indirect Light", "Select a fixed angle between normal and half-vector for indirect lighting, when this angle is unknown, to be used for the flakes: " + public static GUIContent CarPaintFixedFlakesThetaHForIndirectLightText = new GUIContent("Flakes ThetaH For Indirect Light", "Select a fixed angle between normal and half-vector for indirect lighting, when this angle is unknown, to be used for the flakes: " + "A value between 0 and 1 selects an angle from 0 to PI/2. " + "This allows one to control visibility of flakes lit from indirect lighting more precisely when lit by reflection probes and raytraced indirect light"); - public static GUIContent CarPaintIORText = new GUIContent("Clearcoat IOR"); + public static GUIContent CarPaintIORText = new GUIContent("Clearcoat IOR"); - public static GUIContent CarPaintCTDiffuseText = new GUIContent("Diffuse coeff"); - public static GUIContent CarPaintLobeCountText = new GUIContent("CT Lobes count"); - public static GUIContent CarPaintCTF0sText = new GUIContent("CT Lobes F0s", "Fresnel0 values of 3 lobes stored in x, y and z"); - public static GUIContent CarPaintCTCoeffsText = new GUIContent("CT Lobes coeffs", "Weight multipliers for 3 lobes stored in x, y and z"); - public static GUIContent CarPaintCTSpreadsText = new GUIContent("CT Lobes spreads", "Roughnesses for 3 lobes stored in x, y and z"); + public static GUIContent CarPaintCTDiffuseText = new GUIContent("Diffuse coeff"); + public static GUIContent CarPaintLobeCountText = new GUIContent("CT Lobes count"); + public static GUIContent CarPaintCTF0sText = new GUIContent("CT Lobes F0s", "Fresnel0 values of 3 lobes stored in x, y and z"); + public static GUIContent CarPaintCTCoeffsText = new GUIContent("CT Lobes coeffs", "Weight multipliers for 3 lobes stored in x, y and z"); + public static GUIContent CarPaintCTSpreadsText = new GUIContent("CT Lobes spreads", "Roughnesses for 3 lobes stored in x, y and z"); ///////////////////////////////////////////////////////////////////////////////////////////////// // Generic // Clearcoat - public static GUIContent clearcoatColorMapText = new GUIContent("Clearcoat Color"); - public static GUIContent clearcoatNormalMapText = new GUIContent("Clearcoat Normal"); - public static GUIContent clearcoatNormalMapTilingText = new GUIContent("Clearcoat Normal Tiling and Offset"); - public static GUIContent clearcoatIORMapText = new GUIContent("Clearcoat IOR"); + public static GUIContent clearcoatColorMapText = new GUIContent("Clearcoat Color"); + public static GUIContent clearcoatNormalMapText = new GUIContent("Clearcoat Normal"); + public static GUIContent clearcoatNormalMapTilingText = new GUIContent("Clearcoat Normal Tiling and Offset"); + public static GUIContent clearcoatIORMapText = new GUIContent("Clearcoat IOR"); } - static readonly string[] AxfBrdfTypeNames = Enum.GetNames(typeof(AxfBrdfType)); - static readonly string[] SvbrdfDiffuseTypeNames = Enum.GetNames(typeof(SvbrdfDiffuseType)); - static readonly string[] SvbrdfSpecularTypeNames = Enum.GetNames(typeof(SvbrdfSpecularType)); - static readonly string[] SvbrdfSpecularVariantWardNames = Enum.GetNames(typeof(SvbrdfSpecularVariantWard)); - static readonly string[] SvbrdfSpecularVariantBlinnNames = Enum.GetNames(typeof(SvbrdfSpecularVariantBlinn)); - static readonly string[] SvbrdfFresnelVariantNames = Enum.GetNames(typeof(SvbrdfFresnelVariant)); + static readonly string[] AxfBrdfTypeNames = Enum.GetNames(typeof(AxfBrdfType)); + static readonly string[] SvbrdfDiffuseTypeNames = Enum.GetNames(typeof(SvbrdfDiffuseType)); + static readonly string[] SvbrdfSpecularTypeNames = Enum.GetNames(typeof(SvbrdfSpecularType)); + static readonly string[] SvbrdfSpecularVariantWardNames = Enum.GetNames(typeof(SvbrdfSpecularVariantWard)); + static readonly string[] SvbrdfSpecularVariantBlinnNames = Enum.GetNames(typeof(SvbrdfSpecularVariantBlinn)); + static readonly string[] SvbrdfFresnelVariantNames = Enum.GetNames(typeof(SvbrdfFresnelVariant)); ///////////////////////////////////////////////////////////////////////////////////////////////// // Generic Parameters - MaterialProperty m_DiffuseColorMapST = null; - MaterialProperty m_SpecularColorMapST = null; - MaterialProperty m_NormalMapST = null; - MaterialProperty m_SpecularLobeMapST = null; - MaterialProperty m_AlphaMapST = null; - MaterialProperty m_FresnelMapST = null; - MaterialProperty m_AnisoRotationMapST = null; - MaterialProperty m_HeightMapST = null; - MaterialProperty m_ClearcoatColorMapST = null; - MaterialProperty m_ClearcoatNormalMapST = null; - MaterialProperty m_ClearcoatIORMapST = null; - MaterialProperty m_CarPaint2_BTFFlakeMapST = null; + MaterialProperty m_DiffuseColorMapST = null; + MaterialProperty m_SpecularColorMapST = null; + MaterialProperty m_NormalMapST = null; + MaterialProperty m_SpecularLobeMapST = null; + MaterialProperty m_AlphaMapST = null; + MaterialProperty m_FresnelMapST = null; + MaterialProperty m_AnisoRotationMapST = null; + MaterialProperty m_HeightMapST = null; + MaterialProperty m_ClearcoatColorMapST = null; + MaterialProperty m_ClearcoatNormalMapST = null; + MaterialProperty m_ClearcoatIORMapST = null; + MaterialProperty m_CarPaint2_BTFFlakeMapST = null; - static string tilingOffsetPropNameSuffix = "_SO"; + static string tilingOffsetPropNameSuffix = "_SO"; - static string m_AxF_BRDFTypeText = "_AxF_BRDFType"; - MaterialProperty m_AxF_BRDFType = null; + static string m_AxF_BRDFTypeText = "_AxF_BRDFType"; + MaterialProperty m_AxF_BRDFType = null; - static string m_FlagsText = "_Flags"; - MaterialProperty m_Flags; + static string m_FlagsText = "_Flags"; + MaterialProperty m_Flags; ///////////////////////////////////////////////////////////////////////////////////////////////// // SVBRDF Parameters - static string m_SVBRDF_BRDFTypeText = "_SVBRDF_BRDFType"; - MaterialProperty m_SVBRDF_BRDFType; - static string m_SVBRDF_BRDFVariantsText = "_SVBRDF_BRDFVariants"; - MaterialProperty m_SVBRDF_BRDFVariants; - static string m_SVBRDF_HeightMapMaxMMText = "_SVBRDF_HeightMapMaxMM"; - MaterialProperty m_SVBRDF_HeightMapMaxMM; + static string m_SVBRDF_BRDFTypeText = "_SVBRDF_BRDFType"; + MaterialProperty m_SVBRDF_BRDFType; + static string m_SVBRDF_BRDFVariantsText = "_SVBRDF_BRDFVariants"; + MaterialProperty m_SVBRDF_BRDFVariants; + static string m_SVBRDF_HeightMapMaxMMText = "_SVBRDF_HeightMapMaxMM"; + MaterialProperty m_SVBRDF_HeightMapMaxMM; // Regular maps - static string m_DiffuseColorMapText = "_SVBRDF_DiffuseColorMap"; - MaterialProperty m_DiffuseColorMap = null; - static string m_SpecularColorMapText = "_SVBRDF_SpecularColorMap"; - MaterialProperty m_SpecularColorMap = null; + static string m_DiffuseColorMapText = "_SVBRDF_DiffuseColorMap"; + MaterialProperty m_DiffuseColorMap = null; + static string m_SpecularColorMapText = "_SVBRDF_SpecularColorMap"; + MaterialProperty m_SpecularColorMap = null; - static string m_SpecularLobeMapText = "_SVBRDF_SpecularLobeMap"; - MaterialProperty m_SpecularLobeMap = null; - static string m_SpecularLobeMapScaleText = "_SVBRDF_SpecularLobeMapScale"; - MaterialProperty m_SpecularLobeMapScale; + static string m_SpecularLobeMapText = "_SVBRDF_SpecularLobeMap"; + MaterialProperty m_SpecularLobeMap = null; + static string m_SpecularLobeMapScaleText = "_SVBRDF_SpecularLobeMapScale"; + MaterialProperty m_SpecularLobeMapScale; - static string m_FresnelMapText = "_SVBRDF_FresnelMap"; - MaterialProperty m_FresnelMap = null; - static string m_NormalMapText = "_SVBRDF_NormalMap"; - MaterialProperty m_NormalMap = null; + static string m_FresnelMapText = "_SVBRDF_FresnelMap"; + MaterialProperty m_FresnelMap = null; + static string m_NormalMapText = "_SVBRDF_NormalMap"; + MaterialProperty m_NormalMap = null; // Alpha - static string m_AlphaMapText = "_SVBRDF_AlphaMap"; - MaterialProperty m_AlphaMap = null; + static string m_AlphaMapText = "_SVBRDF_AlphaMap"; + MaterialProperty m_AlphaMap = null; // Displacement - static string m_HeightMapText = "_SVBRDF_HeightMap"; - MaterialProperty m_HeightMap = null; + static string m_HeightMapText = "_SVBRDF_HeightMap"; + MaterialProperty m_HeightMap = null; // Anisotropy - static string m_AnisoRotationMapText = "_SVBRDF_AnisoRotationMap"; - MaterialProperty m_AnisoRotationMap = null; + static string m_AnisoRotationMapText = "_SVBRDF_AnisoRotationMap"; + MaterialProperty m_AnisoRotationMap = null; ///////////////////////////////////////////////////////////////////////////////////////////////// // Car Paint Parameters - static string m_CarPaint2_BRDFColorMapText = "_CarPaint2_BRDFColorMap"; - MaterialProperty m_CarPaint2_BRDFColorMap = null; - - static string m_CarPaint2_BRDFColorMapScaleText = "_CarPaint2_BRDFColorMapScale"; - MaterialProperty m_CarPaint2_BRDFColorMapScale; - - static string m_CarPaint2_BRDFColorMapUVScaleText = "_CarPaint2_BRDFColorMapUVScale"; - MaterialProperty m_CarPaint2_BRDFColorMapUVScale; - - static string m_CarPaint2_BTFFlakeMapText = "_CarPaint2_BTFFlakeMap"; - MaterialProperty m_CarPaint2_BTFFlakeMap = null; - - static string m_CarPaint2_BTFFlakeMapScaleText = "_CarPaint2_BTFFlakeMapScale"; - MaterialProperty m_CarPaint2_BTFFlakeMapScale; - - static string m_CarPaint2_FlakeThetaFISliceLUTMapText = "_CarPaint2_FlakeThetaFISliceLUTMap"; - MaterialProperty m_CarPaint2_FlakeThetaFISliceLUTMap; - - static string m_CarPaint2_FlakeMaxThetaIText = "_CarPaint2_FlakeMaxThetaI"; - MaterialProperty m_CarPaint2_FlakeMaxThetaI; - static string m_CarPaint2_FlakeNumThetaFText = "_CarPaint2_FlakeNumThetaF"; - MaterialProperty m_CarPaint2_FlakeNumThetaF; - static string m_CarPaint2_FlakeNumThetaIText = "_CarPaint2_FlakeNumThetaI"; - MaterialProperty m_CarPaint2_FlakeNumThetaI; - - static string m_CarPaint2_FixedColorThetaHForIndirectLightText = "_CarPaint2_FixedColorThetaHForIndirectLight"; - MaterialProperty m_CarPaint2_FixedColorThetaHForIndirectLight; - static string m_CarPaint2_FixedFlakesThetaHForIndirectLightText = "_CarPaint2_FixedFlakesThetaHForIndirectLight"; - MaterialProperty m_CarPaint2_FixedFlakesThetaHForIndirectLight; - - static string m_CarPaint2_ClearcoatIORText = "_CarPaint2_ClearcoatIOR"; - MaterialProperty m_CarPaint2_ClearcoatIOR; - - static string m_CarPaint2_CTDiffuseText = "_CarPaint2_CTDiffuse"; - MaterialProperty m_CarPaint2_CTDiffuse; - static string m_CarPaint2_LobeCountText = "_CarPaint2_LobeCount"; - MaterialProperty m_CarPaint2_LobeCount; - static string m_CarPaint2_CTF0sText = "_CarPaint2_CTF0s"; - MaterialProperty m_CarPaint2_CTF0s; - static string m_CarPaint2_CTCoeffsText = "_CarPaint2_CTCoeffs"; - MaterialProperty m_CarPaint2_CTCoeffs; - static string m_CarPaint2_CTSpreadsText = "_CarPaint2_CTSpreads"; - MaterialProperty m_CarPaint2_CTSpreads; + static string m_CarPaint2_BRDFColorMapText = "_CarPaint2_BRDFColorMap"; + MaterialProperty m_CarPaint2_BRDFColorMap = null; + + static string m_CarPaint2_BRDFColorMapScaleText = "_CarPaint2_BRDFColorMapScale"; + MaterialProperty m_CarPaint2_BRDFColorMapScale; + + static string m_CarPaint2_BRDFColorMapUVScaleText = "_CarPaint2_BRDFColorMapUVScale"; + MaterialProperty m_CarPaint2_BRDFColorMapUVScale; + + static string m_CarPaint2_BTFFlakeMapText = "_CarPaint2_BTFFlakeMap"; + MaterialProperty m_CarPaint2_BTFFlakeMap = null; + + static string m_CarPaint2_BTFFlakeMapScaleText = "_CarPaint2_BTFFlakeMapScale"; + MaterialProperty m_CarPaint2_BTFFlakeMapScale; + + static string m_CarPaint2_FlakeThetaFISliceLUTMapText = "_CarPaint2_FlakeThetaFISliceLUTMap"; + MaterialProperty m_CarPaint2_FlakeThetaFISliceLUTMap; + + static string m_CarPaint2_FlakeMaxThetaIText = "_CarPaint2_FlakeMaxThetaI"; + MaterialProperty m_CarPaint2_FlakeMaxThetaI; + static string m_CarPaint2_FlakeNumThetaFText = "_CarPaint2_FlakeNumThetaF"; + MaterialProperty m_CarPaint2_FlakeNumThetaF; + static string m_CarPaint2_FlakeNumThetaIText = "_CarPaint2_FlakeNumThetaI"; + MaterialProperty m_CarPaint2_FlakeNumThetaI; + + static string m_CarPaint2_FixedColorThetaHForIndirectLightText = "_CarPaint2_FixedColorThetaHForIndirectLight"; + MaterialProperty m_CarPaint2_FixedColorThetaHForIndirectLight; + static string m_CarPaint2_FixedFlakesThetaHForIndirectLightText = "_CarPaint2_FixedFlakesThetaHForIndirectLight"; + MaterialProperty m_CarPaint2_FixedFlakesThetaHForIndirectLight; + + static string m_CarPaint2_ClearcoatIORText = "_CarPaint2_ClearcoatIOR"; + MaterialProperty m_CarPaint2_ClearcoatIOR; + + static string m_CarPaint2_CTDiffuseText = "_CarPaint2_CTDiffuse"; + MaterialProperty m_CarPaint2_CTDiffuse; + static string m_CarPaint2_LobeCountText = "_CarPaint2_LobeCount"; + MaterialProperty m_CarPaint2_LobeCount; + static string m_CarPaint2_CTF0sText = "_CarPaint2_CTF0s"; + MaterialProperty m_CarPaint2_CTF0s; + static string m_CarPaint2_CTCoeffsText = "_CarPaint2_CTCoeffs"; + MaterialProperty m_CarPaint2_CTCoeffs; + static string m_CarPaint2_CTSpreadsText = "_CarPaint2_CTSpreads"; + MaterialProperty m_CarPaint2_CTSpreads; ///////////////////////////////////////////////////////////////////////////////////////////////// // Clearcoat - static string m_ClearcoatColorMapText = "_SVBRDF_ClearcoatColorMap"; - MaterialProperty m_ClearcoatColorMap = null; - static string m_ClearcoatNormalMapText = "_ClearcoatNormalMap"; - MaterialProperty m_ClearcoatNormalMap = null; - static string m_ClearcoatIORMapText = "_SVBRDF_ClearcoatIORMap"; - MaterialProperty m_ClearcoatIORMap = null; + static string m_ClearcoatColorMapText = "_SVBRDF_ClearcoatColorMap"; + MaterialProperty m_ClearcoatColorMap = null; + static string m_ClearcoatNormalMapText = "_ClearcoatNormalMap"; + MaterialProperty m_ClearcoatNormalMap = null; + static string m_ClearcoatIORMapText = "_SVBRDF_ClearcoatIORMap"; + MaterialProperty m_ClearcoatIORMap = null; - ExpandableBit m_ExpandableBit; + ExpandableBit m_ExpandableBit; public AxfSurfaceInputsUIBlock(ExpandableBit expandableBit) { @@ -304,12 +304,12 @@ public static void ExtractFlags(uint flags, out bool anisotropy, out bool clearcoat, out bool clearcoatRefraction, out bool useHeightMap, out bool brdfColorDiagonalClamp, out bool honorMinRoughness) { - anisotropy = (flags & (uint)AxF.FeatureFlags.AxfAnisotropy) != 0; - clearcoat = (flags & (uint)AxF.FeatureFlags.AxfClearCoat) != 0; - clearcoatRefraction = (flags & (uint)AxF.FeatureFlags.AxfClearCoatRefraction) != 0; - useHeightMap = (flags & (uint)AxF.FeatureFlags.AxfUseHeightMap) != 0; + anisotropy = (flags & (uint)AxF.FeatureFlags.AxfAnisotropy) != 0; + clearcoat = (flags & (uint)AxF.FeatureFlags.AxfClearCoat) != 0; + clearcoatRefraction = (flags & (uint)AxF.FeatureFlags.AxfClearCoatRefraction) != 0; + useHeightMap = (flags & (uint)AxF.FeatureFlags.AxfUseHeightMap) != 0; brdfColorDiagonalClamp = (flags & (uint)AxF.FeatureFlags.AxfBRDFColorDiagonalClamp) != 0; - honorMinRoughness = (flags & (uint)AxF.FeatureFlags.AxfHonorMinRoughness) != 0; + honorMinRoughness = (flags & (uint)AxF.FeatureFlags.AxfHonorMinRoughness) != 0; } public static void DrawRightJustifiedHeader(string header) @@ -342,8 +342,8 @@ void DrawAxfSurfaceOptionsGUI() // Read as compact flags //uint flags = (uint)m_Flags.floatValue; - uint BRDFType = (uint)m_SVBRDF_BRDFType.floatValue; - uint BRDFVariants = (uint)m_SVBRDF_BRDFVariants.floatValue; + uint BRDFType = (uint)m_SVBRDF_BRDFType.floatValue; + uint BRDFVariants = (uint)m_SVBRDF_BRDFVariants.floatValue; SvbrdfDiffuseType diffuseType = (SvbrdfDiffuseType)(BRDFType & 0x1); SvbrdfSpecularType specularType = (SvbrdfSpecularType)((BRDFType >> 1) & 0x7); diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/DecalSortingInputsUIBlock.cs b/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/DecalSortingInputsUIBlock.cs index d92bafabc7c..8f6bdc16ee6 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/DecalSortingInputsUIBlock.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/DecalSortingInputsUIBlock.cs @@ -24,7 +24,7 @@ internal class Styles public static GUIContent drawOrderText = new GUIContent("Draw Order", "Controls the draw order of Decal Projectors. HDRP draws decals with lower values first."); } - ExpandableBit m_ExpandableBit; + ExpandableBit m_ExpandableBit; MaterialProperty decalMeshBiasType = new MaterialProperty(); const string kDecalMeshBiasType = "_DecalMeshBiasType"; diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/DecalSurfaceInputsUIBlock.cs b/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/DecalSurfaceInputsUIBlock.cs index 871c781e6f7..594eea46eac 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/DecalSurfaceInputsUIBlock.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/DecalSurfaceInputsUIBlock.cs @@ -41,7 +41,7 @@ internal class Styles public static GUIContent maskMapText = new GUIContent("Mask Map", "Specifies the Mask Map for this Material - Metal(R), Ambient Occlusion(G), Opacity(B), Smoothness(A)"); } - ExpandableBit m_ExpandableBit; + ExpandableBit m_ExpandableBit; enum BlendSource { @@ -50,7 +50,7 @@ enum BlendSource } string[] blendSourceNames = Enum.GetNames(typeof(BlendSource)); - string[] blendSourceNamesNoMap = new string[] { "BaseColorMapAlpha" , "Mask Opacity" }; + string[] blendSourceNamesNoMap = new string[] { "BaseColorMapAlpha", "Mask Opacity" }; string[] blendModeNames = Enum.GetNames(typeof(BlendMode)); diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/DecalSurfaceOptionsUIBlock.cs b/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/DecalSurfaceOptionsUIBlock.cs index 79ead151777..6109f6205ae 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/DecalSurfaceOptionsUIBlock.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/DecalSurfaceOptionsUIBlock.cs @@ -26,7 +26,7 @@ internal class Styles public static GUIContent supportLodCrossFadeText = new GUIContent("Support LOD CrossFade", "When enabled, this decal material supports LOD Cross fade if use on a Mesh."); } - ExpandableBit m_ExpandableBit; + ExpandableBit m_ExpandableBit; MaterialProperty affectsAlbedo = new MaterialProperty(); MaterialProperty affectsNormal = new MaterialProperty(); diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/DetailInputsUIBlock.cs b/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/DetailInputsUIBlock.cs index 2b8b25fb916..4b00f3462b3 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/DetailInputsUIBlock.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/DetailInputsUIBlock.cs @@ -20,11 +20,11 @@ public class DetailInputsUIBlock : MaterialUIBlock public enum Features { /// Displays the standard detail inputs UI. - None = 0, + None = 0, /// Replaces the header by a sub-header. This is useful for layered material UI - SubHeader = 1 << 1, + SubHeader = 1 << 1, /// Display the standard Detail Inputs UI. - All = ~0 ^ SubHeader // By default we don't want to have a sub-header + All = ~0 ^ SubHeader // By default we don't want to have a sub-header } internal class Styles @@ -60,13 +60,13 @@ internal class Styles MaterialProperty displacementMode = null; const string kDisplacementMode = "_DisplacementMode"; - ExpandableBit m_ExpandableBit; - Features m_Features; - int m_LayerIndex; - int m_LayerCount; - Color m_DotColor; + ExpandableBit m_ExpandableBit; + Features m_Features; + int m_LayerIndex; + int m_LayerCount; + Color m_DotColor; - bool isLayeredLit => m_LayerCount > 1; + bool isLayeredLit => m_LayerCount > 1; /// /// Constructs a DetailInputsUIBlock base on the parameters. diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/EmissionUIBlock.cs b/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/EmissionUIBlock.cs index 41e60915d24..960a10cd1c7 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/EmissionUIBlock.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/EmissionUIBlock.cs @@ -19,13 +19,13 @@ public class EmissionUIBlock : MaterialUIBlock public enum Features { /// Shows the minimal emission fields. - None = 0, + None = 0, /// Shows the enable emission for GI field. EnableEmissionForGI = 1 << 0, /// Shows the multiply with base field. - MultiplyWithBase = 1 << 1, + MultiplyWithBase = 1 << 1, /// Shows all the fields. - All = ~0 + All = ~0 } static Func GetLightingSettingsOrDefaultsFallback; @@ -78,8 +78,8 @@ internal class Styles MaterialProperty albedoAffectEmissive = null; const string kAlbedoAffectEmissive = "_AlbedoAffectEmissive"; - ExpandableBit m_ExpandableBit; - Features m_Features; + ExpandableBit m_ExpandableBit; + Features m_Features; /// /// Constructs an EmissionUIBlock based on the parameters. diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/LayerListUIBlock.cs b/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/LayerListUIBlock.cs index ff91945e624..f419dd73b93 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/LayerListUIBlock.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/LayerListUIBlock.cs @@ -34,10 +34,10 @@ internal class Styles MaterialProperty layerCount = null; - ExpandableBit m_ExpandableBit; - bool[] m_WithUV = new bool[kMaxLayerCount]; - Material[] m_MaterialLayers = new Material[kMaxLayerCount]; - AssetImporter m_MaterialImporter; + ExpandableBit m_ExpandableBit; + bool[] m_WithUV = new bool[kMaxLayerCount]; + Material[] m_MaterialLayers = new Material[kMaxLayerCount]; + AssetImporter m_MaterialImporter; int numLayer { @@ -104,8 +104,8 @@ public override void OnGUI() void DrawLayerListGUI() { - bool layersChanged = false; - var oldLabelWidth = EditorGUIUtility.labelWidth; + bool layersChanged = false; + var oldLabelWidth = EditorGUIUtility.labelWidth; // TODO: does not work with multi-selection Material material = materials[0]; diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/LayeringOptionsUIBlock.cs b/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/LayeringOptionsUIBlock.cs index 729a4afb5b9..0436a7f6390 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/LayeringOptionsUIBlock.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/LayeringOptionsUIBlock.cs @@ -38,8 +38,8 @@ internal static class Styles MaterialProperty useMainLayerInfluence = null; const string kkUseMainLayerInfluence = "_UseMainLayerInfluence"; - ExpandableBit m_ExpandableBit; - int m_LayerIndex; + ExpandableBit m_ExpandableBit; + int m_LayerIndex; // Density/opacity mode MaterialProperty[] opacityAsDensity = new MaterialProperty[kMaxLayerCount]; diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/LightingShaderGraphGUI.cs b/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/LightingShaderGraphGUI.cs index 23ef2496b6a..d40ed3d4e81 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/LightingShaderGraphGUI.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/LightingShaderGraphGUI.cs @@ -12,7 +12,7 @@ namespace UnityEditor.Rendering.HighDefinition public class LightingShaderGraphGUI : HDShaderGUI { // For surface option shader graph we only want all unlit features but alpha clip and back then front rendering - const SurfaceOptionUIBlock.Features surfaceOptionFeatures = SurfaceOptionUIBlock.Features.Lit + const SurfaceOptionUIBlock.Features surfaceOptionFeatures = SurfaceOptionUIBlock.Features.Lit | SurfaceOptionUIBlock.Features.ShowDepthOffsetOnly; MaterialUIBlockList m_UIBlocks = new MaterialUIBlockList diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/LitSurfaceInputsUIBlock.cs b/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/LitSurfaceInputsUIBlock.cs index 5feaad0d192..0f6d170bbc0 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/LitSurfaceInputsUIBlock.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/LitSurfaceInputsUIBlock.cs @@ -20,19 +20,19 @@ public class LitSurfaceInputsUIBlock : MaterialUIBlock public enum Features { /// Minimal Lit Surface Inputs fields. - None = 0, + None = 0, /// Displays Coat Mask fields. - CoatMask = 1 << 0, + CoatMask = 1 << 0, /// Displays the height Map fields. - HeightMap = 1 << 1, + HeightMap = 1 << 1, /// Displays the layer Options fields. - LayerOptions = 1 << 2, + LayerOptions = 1 << 2, /// Displays the foldout header as a SubHeader. - SubHeader = 1 << 3, + SubHeader = 1 << 3, /// Displays the default surface inputs. - Standard = 1 << 4, + Standard = 1 << 4, /// Displays everything with a header. - All = ~0 ^ SubHeader // By default we don't want a sub-header + All = ~0 ^ SubHeader // By default we don't want a sub-header } internal class Styles @@ -221,7 +221,7 @@ internal class Styles const string kIridescenceThicknessRemap = "_IridescenceThicknessRemap"; // Material ID - MaterialProperty materialID = null; + MaterialProperty materialID = null; MaterialProperty transmissionEnable = null; const string kTransmissionEnable = "_TransmissionEnable"; @@ -257,14 +257,14 @@ internal class Styles MaterialProperty heightTransition = null; const string kHeightTransition = "_HeightTransition"; - ExpandableBit m_ExpandableBit; - Features m_Features; - int m_LayerCount; - int m_LayerIndex; - bool m_UseHeightBasedBlend; - Color m_DotColor; + ExpandableBit m_ExpandableBit; + Features m_Features; + int m_LayerCount; + int m_LayerIndex; + bool m_UseHeightBasedBlend; + Color m_DotColor; - bool isLayeredLit => m_LayerCount > 1; + bool isLayeredLit => m_LayerCount > 1; /// /// Constructs a LitSurfaceInputsUIBlock based on the parameters. @@ -520,7 +520,7 @@ void DrawSurfaceInputsGUI() // UI only updates intermediate values, this will update the values actually used by the shader. if (EditorGUI.EndChangeCheck()) { - SurfaceOptionUIBlock surfaceOption; + SurfaceOptionUIBlock surfaceOption; // Fetch the surface option block which contains the function to update the displacement datas if (m_LayerCount == 1) diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/MaterialUIBlock.cs b/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/MaterialUIBlock.cs index 1e5b80496d3..4cefc3dbc06 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/MaterialUIBlock.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/MaterialUIBlock.cs @@ -12,14 +12,14 @@ namespace UnityEditor.Rendering.HighDefinition public abstract class MaterialUIBlock { /// The current material editor. - protected MaterialEditor materialEditor; + protected MaterialEditor materialEditor; /// The list of selected materials to edit. - protected Material[] materials; + protected Material[] materials; /// The list of available properties in the selected materials. - protected MaterialProperty[] properties; + protected MaterialProperty[] properties; /// Parent of the UI block. - protected MaterialUIBlockList parent; + protected MaterialUIBlockList parent; /// Bit index used to store a foldout state in the editor preferences. [Flags] @@ -133,7 +133,7 @@ public enum ExpandableBit : uint User19 = 1 << 30, } - internal void Initialize(MaterialEditor materialEditor, MaterialProperty[] properties, MaterialUIBlockList parent) + internal void Initialize(MaterialEditor materialEditor, MaterialProperty[] properties, MaterialUIBlockList parent) { this.materialEditor = materialEditor; this.parent = parent; @@ -143,7 +143,7 @@ internal void Initialize(MaterialEditor materialEditor, MaterialProperty materialEditor.InitExpandableState(); } - internal void UpdateMaterialProperties(MaterialProperty[] properties) + internal void UpdateMaterialProperties(MaterialProperty[] properties) { this.properties = properties; LoadMaterialProperties(); @@ -183,7 +183,7 @@ protected MaterialProperty[] FindPropertyLayered(string propertyName, int layerC // If the layerCount is 1, then it means that the property we're fetching is not from a layered material // thus it doesn't have a prefix - string[] prefixes = (layerCount > 1) ? new[] {"0", "1", "2", "3"} : new[] {""}; + string[] prefixes = (layerCount > 1) ? new[] { "0", "1", "2", "3" } : new[] { "" }; for (int i = 0; i < layerCount; i++) { diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/MaterialUIBlockList.cs b/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/MaterialUIBlockList.cs index a7df1e24779..5fcc0e3245c 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/MaterialUIBlockList.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/MaterialUIBlockList.cs @@ -18,14 +18,14 @@ namespace UnityEditor.Rendering.HighDefinition public class MaterialUIBlockList : List { [System.NonSerialized] - bool m_Initialized = false; + bool m_Initialized = false; - Material[] m_Materials; + Material[] m_Materials; /// /// Parent of the ui block list, in case of nesting (Layered Lit material) /// - public MaterialUIBlockList parent; + public MaterialUIBlockList parent; /// /// List of materials currently selected in the inspector @@ -41,7 +41,7 @@ public class MaterialUIBlockList : List /// /// Construct a ui block list /// - public MaterialUIBlockList() : this(null) {} + public MaterialUIBlockList() : this(null) { } /// /// Render the list of ui blocks diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/ShaderGraphUIBlock.cs b/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/ShaderGraphUIBlock.cs index 46b79c7f88a..6cdf5853de0 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/ShaderGraphUIBlock.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/ShaderGraphUIBlock.cs @@ -38,8 +38,8 @@ internal static class Styles public const string header = "Exposed Properties"; } - ExpandableBit m_ExpandableBit; - Features m_Features; + ExpandableBit m_ExpandableBit; + Features m_Features; /// /// Constructs a ShaderGraphUIBlock based on the parameters. @@ -55,7 +55,7 @@ public ShaderGraphUIBlock(ExpandableBit expandableBit = ExpandableBit.ShaderGrap /// /// Loads the material properties for the block. /// - public override void LoadMaterialProperties() {} + public override void LoadMaterialProperties() { } /// /// Renders the properties in the block. @@ -161,13 +161,13 @@ protected void DrawShadowMatteToggle() uint uValue = HDShadowUtils.Asuint(value); uint filter = uValue & mantissa; - bool shadowFilterPoint = (filter & (uint)LightFeatureFlags.Punctual) != 0; - bool shadowFilterDir = (filter & (uint)LightFeatureFlags.Directional) != 0; - bool shadowFilterRect = (filter & (uint)LightFeatureFlags.Area) != 0; + bool shadowFilterPoint = (filter & (uint)LightFeatureFlags.Punctual) != 0; + bool shadowFilterDir = (filter & (uint)LightFeatureFlags.Directional) != 0; + bool shadowFilterRect = (filter & (uint)LightFeatureFlags.Area) != 0; uint finalFlag = 0x00000000; - finalFlag |= EditorGUILayout.Toggle("Point/Spot Shadow", shadowFilterPoint) ? (uint)LightFeatureFlags.Punctual : 0x00000000u; - finalFlag |= EditorGUILayout.Toggle("Directional Shadow", shadowFilterDir) ? (uint)LightFeatureFlags.Directional : 0x00000000u; - finalFlag |= EditorGUILayout.Toggle("Area Shadow", shadowFilterRect) ? (uint)LightFeatureFlags.Area : 0x00000000u; + finalFlag |= EditorGUILayout.Toggle("Point/Spot Shadow", shadowFilterPoint) ? (uint)LightFeatureFlags.Punctual : 0x00000000u; + finalFlag |= EditorGUILayout.Toggle("Directional Shadow", shadowFilterDir) ? (uint)LightFeatureFlags.Directional : 0x00000000u; + finalFlag |= EditorGUILayout.Toggle("Area Shadow", shadowFilterRect) ? (uint)LightFeatureFlags.Area : 0x00000000u; finalFlag &= mantissa; finalFlag |= exponent; diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/SurfaceOptionUIBlock.cs b/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/SurfaceOptionUIBlock.cs index ef6e2e06be5..39983fff60e 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/SurfaceOptionUIBlock.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/SurfaceOptionUIBlock.cs @@ -23,43 +23,43 @@ public class SurfaceOptionUIBlock : MaterialUIBlock public enum Features { /// Displays the minimum surface option fields. - None = 0, + None = 0, /// Displays the surface field. - Surface = 1 << 0, + Surface = 1 << 0, /// Displays the blend mode field. - BlendMode = 1 << 1, + BlendMode = 1 << 1, /// Displays the double sided field. - DoubleSided = 1 << 2, + DoubleSided = 1 << 2, /// Displays the alpha cutoff field. - AlphaCutoff = 1 << 3, + AlphaCutoff = 1 << 3, /// Displays the alpha cutoff threshold field. - AlphaCutoffThreshold = 1 << 4, + AlphaCutoffThreshold = 1 << 4, /// Displays the alpha cutoff shadow treshold field. - AlphaCutoffShadowThreshold = 1 << 5, + AlphaCutoffShadowThreshold = 1 << 5, /// Displays the double sided normal mode field. - DoubleSidedNormalMode = 1 << 6, + DoubleSidedNormalMode = 1 << 6, /// Displays the back then front rendering field. - BackThenFrontRendering = 1 << 7, + BackThenFrontRendering = 1 << 7, /// Displays the receive ssr field. - ReceiveSSR = 1 << 8, + ReceiveSSR = 1 << 8, /// Displays the receive decal field. - ReceiveDecal = 1 << 9, + ReceiveDecal = 1 << 9, /// Displays the show after post process field. - ShowAfterPostProcessPass = 1 << 10, + ShowAfterPostProcessPass = 1 << 10, /// Displays the alpha to mask field. - AlphaToMask = 1 << 11, + AlphaToMask = 1 << 11, /// Displays the show pre pass and post pass fields. - ShowPrePassAndPostPass = 1 << 12, + ShowPrePassAndPostPass = 1 << 12, /// Displays the depth offset field. - ShowDepthOffsetOnly = 1 << 13, + ShowDepthOffsetOnly = 1 << 13, /// Displays the preserve specular lighting field. - PreserveSpecularLighting = 1 << 14, + PreserveSpecularLighting = 1 << 14, /// Displays all the Unlit Surface Option fields. - Unlit = Surface | BlendMode | DoubleSided | AlphaCutoff | AlphaCutoffThreshold | AlphaCutoffShadowThreshold | AlphaToMask | BackThenFrontRendering | ShowAfterPostProcessPass | ShowPrePassAndPostPass | ShowDepthOffsetOnly, + Unlit = Surface | BlendMode | DoubleSided | AlphaCutoff | AlphaCutoffThreshold | AlphaCutoffShadowThreshold | AlphaToMask | BackThenFrontRendering | ShowAfterPostProcessPass | ShowPrePassAndPostPass | ShowDepthOffsetOnly, /// Displays all the Lit Surface Option fields field. - Lit = All ^ SurfaceOptionUIBlock.Features.ShowAfterPostProcessPass ^ ShowDepthOffsetOnly, // Lit can't be display in after postprocess pass + Lit = All ^ SurfaceOptionUIBlock.Features.ShowAfterPostProcessPass ^ ShowDepthOffsetOnly, // Lit can't be display in after postprocess pass /// Displays all the fields. - All = ~0, + All = ~0, } internal static class Styles @@ -175,7 +175,7 @@ internal static class Styles // Lit properties MaterialProperty doubleSidedNormalMode = null; const string kDoubleSidedNormalMode = "_DoubleSidedNormalMode"; - MaterialProperty materialID = null; + MaterialProperty materialID = null; MaterialProperty supportDecals = null; const string kSupportDecals = "_SupportDecals"; MaterialProperty enableGeometricSpecularAA = null; @@ -291,9 +291,9 @@ SurfaceType surfaceTypeValue List m_RenderingPassNames = new List(); List m_RenderingPassValues = new List(); - ExpandableBit m_ExpandableBit; - Features m_Features; - int m_LayerCount; + ExpandableBit m_ExpandableBit; + Features m_Features; + int m_LayerCount; /// /// Constructs a SurfaceOptionUIBlock based on the parameters. @@ -373,7 +373,7 @@ public override void LoadMaterialProperties() ppdMaxSamples = FindProperty(kPpdMaxSamples); ppdLodThreshold = FindProperty(kPpdLodThreshold); ppdPrimitiveLength = FindProperty(kPpdPrimitiveLength); - ppdPrimitiveWidth = FindProperty(kPpdPrimitiveWidth); + ppdPrimitiveWidth = FindProperty(kPpdPrimitiveWidth); invPrimScale = FindProperty(kInvPrimScale); // tessellation specific, silent if not found diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/TransparencyUIBlock.cs b/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/TransparencyUIBlock.cs index 62ad10f40fe..354e8d37100 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/TransparencyUIBlock.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/TransparencyUIBlock.cs @@ -20,13 +20,13 @@ public class TransparencyUIBlock : MaterialUIBlock public enum Features { /// Hides all the fields. - None = 0, + None = 0, /// Displays the distortion fields. - Distortion = 1 << 0, + Distortion = 1 << 0, /// Displays the refraction fields. - Refraction = 1 << 1, + Refraction = 1 << 1, /// Displays all the fields. - All = ~0 + All = ~0 } internal class Styles @@ -34,8 +34,8 @@ internal class Styles public const string header = "Transparency Inputs"; } - ExpandableBit m_ExpandableBit; - Features m_Features; + ExpandableBit m_ExpandableBit; + Features m_Features; MaterialUIBlockList m_TransparencyBlocks; /// @@ -58,7 +58,7 @@ public TransparencyUIBlock(ExpandableBit expandableBit, Features features = Feat /// /// Loads the material properties for the block. /// - public override void LoadMaterialProperties() {} + public override void LoadMaterialProperties() { } /// /// Renders the properties in the block. diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/UnlitSurfaceInputsUIBlock.cs b/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/UnlitSurfaceInputsUIBlock.cs index 277579fc650..e6c532bce74 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/UnlitSurfaceInputsUIBlock.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/UnlitSurfaceInputsUIBlock.cs @@ -17,7 +17,7 @@ internal class Styles public static GUIContent colorText = new GUIContent("Color", " Albedo (RGB) and Transparency (A)."); } - ExpandableBit m_ExpandableBit; + ExpandableBit m_ExpandableBit; MaterialProperty color = null; const string kColor = "_UnlitColor"; diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/Unlit/ShaderGraph/CreateHDUnlitShaderGraph.cs b/com.unity.render-pipelines.high-definition/Editor/Material/Unlit/ShaderGraph/CreateHDUnlitShaderGraph.cs index 6de5dafdc3a..9c401fe8d26 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/Unlit/ShaderGraph/CreateHDUnlitShaderGraph.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/Unlit/ShaderGraph/CreateHDUnlitShaderGraph.cs @@ -21,7 +21,7 @@ public static void CreateHDUnlitGraph() BlockFields.SurfaceDescription.Alpha, }; - GraphUtil.CreateNewGraphWithOutputs(new[] {target}, blockDescriptors); + GraphUtil.CreateNewGraphWithOutputs(new[] { target }, blockDescriptors); } } } diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/Unlit/ShaderGraph/HDUnlitSubTarget.cs b/com.unity.render-pipelines.high-definition/Editor/Material/Unlit/ShaderGraph/HDUnlitSubTarget.cs index c5d9d6c17c9..c868f8fcdfa 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/Unlit/ShaderGraph/HDUnlitSubTarget.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/Unlit/ShaderGraph/HDUnlitSubTarget.cs @@ -53,7 +53,7 @@ public HDUnlitData unlitData set => m_UnlitData = value; } - public static FieldDescriptor EnableShadowMatte = new FieldDescriptor(string.Empty, "EnableShadowMatte", "_ENABLE_SHADOW_MATTE"); + public static FieldDescriptor EnableShadowMatte = new FieldDescriptor(string.Empty, "EnableShadowMatte", "_ENABLE_SHADOW_MATTE"); protected override SubShaderDescriptor GetSubShaderDescriptor() { diff --git a/com.unity.render-pipelines.high-definition/Editor/PostProcessing/ChannelMixerEditor.cs b/com.unity.render-pipelines.high-definition/Editor/PostProcessing/ChannelMixerEditor.cs index 2578aaabe00..6a131c892d5 100644 --- a/com.unity.render-pipelines.high-definition/Editor/PostProcessing/ChannelMixerEditor.cs +++ b/com.unity.render-pipelines.high-definition/Editor/PostProcessing/ChannelMixerEditor.cs @@ -22,16 +22,16 @@ public override void OnEnable() { var o = new PropertyFetcher(serializedObject); - m_RedOutRedIn = Unpack(o.Find(x => x.redOutRedIn)); - m_RedOutGreenIn = Unpack(o.Find(x => x.redOutGreenIn)); - m_RedOutBlueIn = Unpack(o.Find(x => x.redOutBlueIn)); - m_GreenOutRedIn = Unpack(o.Find(x => x.greenOutRedIn)); - m_GreenOutGreenIn = Unpack(o.Find(x => x.greenOutGreenIn)); - m_GreenOutBlueIn = Unpack(o.Find(x => x.greenOutBlueIn)); - m_BlueOutRedIn = Unpack(o.Find(x => x.blueOutRedIn)); - m_BlueOutGreenIn = Unpack(o.Find(x => x.blueOutGreenIn)); - m_BlueOutBlueIn = Unpack(o.Find(x => x.blueOutBlueIn)); - m_SelectedChannel = o.Find("m_SelectedChannel"); + m_RedOutRedIn = Unpack(o.Find(x => x.redOutRedIn)); + m_RedOutGreenIn = Unpack(o.Find(x => x.redOutGreenIn)); + m_RedOutBlueIn = Unpack(o.Find(x => x.redOutBlueIn)); + m_GreenOutRedIn = Unpack(o.Find(x => x.greenOutRedIn)); + m_GreenOutGreenIn = Unpack(o.Find(x => x.greenOutGreenIn)); + m_GreenOutBlueIn = Unpack(o.Find(x => x.greenOutBlueIn)); + m_BlueOutRedIn = Unpack(o.Find(x => x.blueOutRedIn)); + m_BlueOutGreenIn = Unpack(o.Find(x => x.blueOutGreenIn)); + m_BlueOutBlueIn = Unpack(o.Find(x => x.blueOutBlueIn)); + m_SelectedChannel = o.Find("m_SelectedChannel"); } public override void OnInspectorGUI() diff --git a/com.unity.render-pipelines.high-definition/Editor/PostProcessing/ColorCurvesEditor.cs b/com.unity.render-pipelines.high-definition/Editor/PostProcessing/ColorCurvesEditor.cs index 3e5e215d006..55d3ce94c27 100644 --- a/com.unity.render-pipelines.high-definition/Editor/PostProcessing/ColorCurvesEditor.cs +++ b/com.unity.render-pipelines.high-definition/Editor/PostProcessing/ColorCurvesEditor.cs @@ -57,9 +57,9 @@ public override void OnEnable() var o = new PropertyFetcher(serializedObject); m_Master = Unpack(o.Find(x => x.master)); - m_Red = Unpack(o.Find(x => x.red)); - m_Green = Unpack(o.Find(x => x.green)); - m_Blue = Unpack(o.Find(x => x.blue)); + m_Red = Unpack(o.Find(x => x.red)); + m_Green = Unpack(o.Find(x => x.green)); + m_Blue = Unpack(o.Find(x => x.blue)); m_HueVsHue = Unpack(o.Find(x => x.hueVsHue)); m_HueVsSat = Unpack(o.Find(x => x.hueVsSat)); @@ -67,9 +67,9 @@ public override void OnEnable() m_LumVsSat = Unpack(o.Find(x => x.lumVsSat)); m_RawMaster = o.Find("master.m_Value.m_Curve"); - m_RawRed = o.Find("red.m_Value.m_Curve"); - m_RawGreen = o.Find("green.m_Value.m_Curve"); - m_RawBlue = o.Find("blue.m_Value.m_Curve"); + m_RawRed = o.Find("red.m_Value.m_Curve"); + m_RawGreen = o.Find("green.m_Value.m_Curve"); + m_RawBlue = o.Find("blue.m_Value.m_Curve"); m_RawHueVsHue = o.Find("hueVsHue.m_Value.m_Curve"); m_RawHueVsSat = o.Find("hueVsSat.m_Value.m_Curve"); @@ -82,14 +82,14 @@ public override void OnEnable() m_CurveEditor = new InspectorCurveEditor(); m_CurveDict = new Dictionary(); - SetupCurve(m_RawMaster, new Color(1f, 1f, 1f), 2, false); - SetupCurve(m_RawRed, new Color(1f, 0f, 0f), 2, false); - SetupCurve(m_RawGreen, new Color(0f, 1f, 0f), 2, false); - SetupCurve(m_RawBlue, new Color(0f, 0.5f, 1f), 2, false); - SetupCurve(m_RawHueVsHue, new Color(1f, 1f, 1f), 0, true); - SetupCurve(m_RawHueVsSat, new Color(1f, 1f, 1f), 0, true); - SetupCurve(m_RawSatVsSat, new Color(1f, 1f, 1f), 0, false); - SetupCurve(m_RawLumVsSat, new Color(1f, 1f, 1f), 0, false); + SetupCurve(m_RawMaster, new Color(1f, 1f, 1f), 2, false); + SetupCurve(m_RawRed, new Color(1f, 0f, 0f), 2, false); + SetupCurve(m_RawGreen, new Color(0f, 1f, 0f), 2, false); + SetupCurve(m_RawBlue, new Color(0f, 0.5f, 1f), 2, false); + SetupCurve(m_RawHueVsHue, new Color(1f, 1f, 1f), 0, true); + SetupCurve(m_RawHueVsSat, new Color(1f, 1f, 1f), 0, true); + SetupCurve(m_RawSatVsSat, new Color(1f, 1f, 1f), 0, false); + SetupCurve(m_RawLumVsSat, new Color(1f, 1f, 1f), 0, false); } void SetupCurve(SerializedProperty prop, Color color, uint minPointCount, bool loop) @@ -266,10 +266,10 @@ public override void OnInspectorGUI() switch (curveEditingId) { - case 0: m_RawMaster.animationCurveValue = AnimationCurve.Linear(0f, 0f, 1f, 1f); break; - case 1: m_RawRed.animationCurveValue = AnimationCurve.Linear(0f, 0f, 1f, 1f); break; - case 2: m_RawGreen.animationCurveValue = AnimationCurve.Linear(0f, 0f, 1f, 1f); break; - case 3: m_RawBlue.animationCurveValue = AnimationCurve.Linear(0f, 0f, 1f, 1f); break; + case 0: m_RawMaster.animationCurveValue = AnimationCurve.Linear(0f, 0f, 1f, 1f); break; + case 1: m_RawRed.animationCurveValue = AnimationCurve.Linear(0f, 0f, 1f, 1f); break; + case 2: m_RawGreen.animationCurveValue = AnimationCurve.Linear(0f, 0f, 1f, 1f); break; + case 3: m_RawBlue.animationCurveValue = AnimationCurve.Linear(0f, 0f, 1f, 1f); break; case 4: m_RawHueVsHue.animationCurveValue = new AnimationCurve(); break; case 5: m_RawHueVsSat.animationCurveValue = new AnimationCurve(); break; case 6: m_RawSatVsSat.animationCurveValue = new AnimationCurve(); break; diff --git a/com.unity.render-pipelines.high-definition/Editor/PostProcessing/LiftGammaGainEditor.cs b/com.unity.render-pipelines.high-definition/Editor/PostProcessing/LiftGammaGainEditor.cs index b3aad8e6c3e..65dc51de650 100644 --- a/com.unity.render-pipelines.high-definition/Editor/PostProcessing/LiftGammaGainEditor.cs +++ b/com.unity.render-pipelines.high-definition/Editor/PostProcessing/LiftGammaGainEditor.cs @@ -17,9 +17,9 @@ public override void OnEnable() { var o = new PropertyFetcher(serializedObject); - m_Lift = Unpack(o.Find(x => x.lift)); + m_Lift = Unpack(o.Find(x => x.lift)); m_Gamma = Unpack(o.Find(x => x.gamma)); - m_Gain = Unpack(o.Find(x => x.gain)); + m_Gain = Unpack(o.Find(x => x.gain)); } public override void OnInspectorGUI() diff --git a/com.unity.render-pipelines.high-definition/Editor/PostProcessing/ShadowsMidtonesHighlightsEditor.cs b/com.unity.render-pipelines.high-definition/Editor/PostProcessing/ShadowsMidtonesHighlightsEditor.cs index 60993dc42a7..778eaeca516 100644 --- a/com.unity.render-pipelines.high-definition/Editor/PostProcessing/ShadowsMidtonesHighlightsEditor.cs +++ b/com.unity.render-pipelines.high-definition/Editor/PostProcessing/ShadowsMidtonesHighlightsEditor.cs @@ -28,13 +28,13 @@ public override void OnEnable() { var o = new PropertyFetcher(serializedObject); - m_Shadows = Unpack(o.Find(x => x.shadows)); - m_Midtones = Unpack(o.Find(x => x.midtones)); - m_Highlights = Unpack(o.Find(x => x.highlights)); - m_ShadowsStart = Unpack(o.Find(x => x.shadowsStart)); - m_ShadowsEnd = Unpack(o.Find(x => x.shadowsEnd)); + m_Shadows = Unpack(o.Find(x => x.shadows)); + m_Midtones = Unpack(o.Find(x => x.midtones)); + m_Highlights = Unpack(o.Find(x => x.highlights)); + m_ShadowsStart = Unpack(o.Find(x => x.shadowsStart)); + m_ShadowsEnd = Unpack(o.Find(x => x.shadowsEnd)); m_HighlightsStart = Unpack(o.Find(x => x.highlightsStart)); - m_HighlightsEnd = Unpack(o.Find(x => x.highlightsEnd)); + m_HighlightsEnd = Unpack(o.Find(x => x.highlightsEnd)); m_Material = new Material(Shader.Find("Hidden/HD PostProcessing/Editor/Shadows Midtones Highlights Curve")); } diff --git a/com.unity.render-pipelines.high-definition/Editor/PostProcessing/TonemappingEditor.cs b/com.unity.render-pipelines.high-definition/Editor/PostProcessing/TonemappingEditor.cs index 8746b0294e6..0b64d3637f3 100644 --- a/com.unity.render-pipelines.high-definition/Editor/PostProcessing/TonemappingEditor.cs +++ b/com.unity.render-pipelines.high-definition/Editor/PostProcessing/TonemappingEditor.cs @@ -29,15 +29,15 @@ public override void OnEnable() { var o = new PropertyFetcher(serializedObject); - m_Mode = Unpack(o.Find(x => x.mode)); - m_ToeStrength = Unpack(o.Find(x => x.toeStrength)); - m_ToeLength = Unpack(o.Find(x => x.toeLength)); + m_Mode = Unpack(o.Find(x => x.mode)); + m_ToeStrength = Unpack(o.Find(x => x.toeStrength)); + m_ToeLength = Unpack(o.Find(x => x.toeLength)); m_ShoulderStrength = Unpack(o.Find(x => x.shoulderStrength)); - m_ShoulderLength = Unpack(o.Find(x => x.shoulderLength)); - m_ShoulderAngle = Unpack(o.Find(x => x.shoulderAngle)); - m_Gamma = Unpack(o.Find(x => x.gamma)); - m_LutTexture = Unpack(o.Find(x => x.lutTexture)); - m_LutContribution = Unpack(o.Find(x => x.lutContribution)); + m_ShoulderLength = Unpack(o.Find(x => x.shoulderLength)); + m_ShoulderAngle = Unpack(o.Find(x => x.shoulderAngle)); + m_Gamma = Unpack(o.Find(x => x.gamma)); + m_LutTexture = Unpack(o.Find(x => x.lutTexture)); + m_LutContribution = Unpack(o.Find(x => x.lutContribution)); m_Material = new Material(Shader.Find("Hidden/HD PostProcessing/Editor/Custom Tonemapper Curve")); } diff --git a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Camera/HDCameraUI.Drawers.cs b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Camera/HDCameraUI.Drawers.cs index 464aede76d6..169f0c79d52 100644 --- a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Camera/HDCameraUI.Drawers.cs +++ b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Camera/HDCameraUI.Drawers.cs @@ -476,7 +476,7 @@ static void Drawer_PhysicalCamera(SerializedHDCamera p, Editor owner) p.aperture.floatValue = Mathf.Clamp(float.Parse(newAperture), HDPhysicalCamera.kMinAperture, HDPhysicalCamera.kMaxAperture); } catch - {} + { } } EditorGUILayout.EndHorizontal(); diff --git a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/CustomPass/CustomPassDrawer.cs b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/CustomPass/CustomPassDrawer.cs index 223129ffcf8..4c2641acde5 100644 --- a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/CustomPass/CustomPassDrawer.cs +++ b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/CustomPass/CustomPassDrawer.cs @@ -34,17 +34,17 @@ class Styles public enum PassUIFlag { /// Hides all the default UI fields. - None = 0x00, + None = 0x00, /// Shows the name field. - Name = 0x01, + Name = 0x01, /// Shows the target color buffer field. - TargetColorBuffer = 0x02, + TargetColorBuffer = 0x02, /// Shows the target depth buffer field. - TargetDepthBuffer = 0x04, + TargetDepthBuffer = 0x04, /// Shows the clear flags field. - ClearFlags = 0x08, + ClearFlags = 0x08, /// Shows all the default UI fields. - All = ~0, + All = ~0, } /// @@ -55,15 +55,15 @@ public enum PassUIFlag bool firstTime = true; // Serialized Properties - SerializedProperty m_Name; - SerializedProperty m_Enabled; - SerializedProperty m_TargetColorBuffer; - SerializedProperty m_TargetDepthBuffer; - SerializedProperty m_ClearFlags; - SerializedProperty m_PassFoldout; - List m_CustomPassUserProperties = new List(); - CustomPass m_CustomPass; - Type m_PassType => m_CustomPass.GetType(); + SerializedProperty m_Name; + SerializedProperty m_Enabled; + SerializedProperty m_TargetColorBuffer; + SerializedProperty m_TargetDepthBuffer; + SerializedProperty m_ClearFlags; + SerializedProperty m_PassFoldout; + List m_CustomPassUserProperties = new List(); + CustomPass m_CustomPass; + Type m_PassType => m_CustomPass.GetType(); void FetchProperties(SerializedProperty property) { @@ -114,7 +114,7 @@ void InitInternal(SerializedProperty customPass) /// Use this function to initialize the local SerializedProperty you will use in your pass. /// /// Your custom pass instance represented as a SerializedProperty - protected virtual void Initialize(SerializedProperty customPass) {} + protected virtual void Initialize(SerializedProperty customPass) { } internal void SetPass(CustomPass pass) => m_CustomPass = pass; diff --git a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/CustomPass/CustomPassVolumeEditor.cs b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/CustomPass/CustomPassVolumeEditor.cs index 1297d2f2509..22bd6d11869 100644 --- a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/CustomPass/CustomPassVolumeEditor.cs +++ b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/CustomPass/CustomPassVolumeEditor.cs @@ -13,13 +13,13 @@ namespace UnityEditor.Rendering.HighDefinition [CustomEditor(typeof(CustomPassVolume))] sealed class CustomPassVolumeEditor : Editor { - ReorderableList m_CustomPassList; - string m_ListName; - CustomPassVolume m_Volume; - MaterialEditor[] m_MaterialEditors = new MaterialEditor[0]; - int m_CustomPassMaterialsHash; + ReorderableList m_CustomPassList; + string m_ListName; + CustomPassVolume m_Volume; + MaterialEditor[] m_MaterialEditors = new MaterialEditor[0]; + int m_CustomPassMaterialsHash; - const string k_DefaultListName = "Custom Passes"; + const string k_DefaultListName = "Custom Passes"; static class Styles { @@ -32,15 +32,15 @@ static class Styles class SerializedPassVolume { - public SerializedProperty isGlobal; - public SerializedProperty fadeRadius; - public SerializedProperty customPasses; - public SerializedProperty injectionPoint; - public SerializedProperty priority; + public SerializedProperty isGlobal; + public SerializedProperty fadeRadius; + public SerializedProperty customPasses; + public SerializedProperty injectionPoint; + public SerializedProperty priority; } - SerializedPassVolume m_SerializedPassVolume; + SerializedPassVolume m_SerializedPassVolume; void OnEnable() { @@ -171,7 +171,7 @@ void DrawCustomPassReorderableList() } } - float customPassListHeight = m_CustomPassList.GetHeight(); + float customPassListHeight = m_CustomPassList.GetHeight(); var customPassRect = EditorGUILayout.GetControlRect(false, customPassListHeight); EditorGUI.BeginProperty(customPassRect, GUIContent.none, m_SerializedPassVolume.customPasses); { @@ -186,11 +186,13 @@ void CreateReorderableList(SerializedProperty passList) { m_CustomPassList = new ReorderableList(passList.serializedObject, passList); - m_CustomPassList.drawHeaderCallback = (rect) => { + m_CustomPassList.drawHeaderCallback = (rect) => + { EditorGUI.LabelField(rect, k_DefaultListName, EditorStyles.largeLabel); }; - m_CustomPassList.drawElementCallback = (rect, index, active, focused) => { + m_CustomPassList.drawElementCallback = (rect, index, active, focused) => + { EditorGUI.BeginChangeCheck(); passList.serializedObject.ApplyModifiedProperties(); @@ -216,7 +218,8 @@ void CreateReorderableList(SerializedProperty passList) return EditorGUI.GetPropertyHeight(customPass, null); }; - m_CustomPassList.onAddCallback += (list) => { + m_CustomPassList.onAddCallback += (list) => + { Undo.RegisterCompleteObjectUndo(target, "Add custom pass"); var menu = new GenericMenu(); @@ -225,7 +228,8 @@ void CreateReorderableList(SerializedProperty passList) if (customPassType.IsAbstract) continue; - menu.AddItem(new GUIContent(customPassType.Name), false, () => { + menu.AddItem(new GUIContent(customPassType.Name), false, () => + { passList.serializedObject.ApplyModifiedProperties(); m_Volume.AddPassOfType(customPassType); UpdateMaterialEditors(); diff --git a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/CustomPass/DrawRenderersCustomPassDrawer.cs b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/CustomPass/DrawRenderersCustomPassDrawer.cs index d730f4ce136..8fafe24f654 100644 --- a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/CustomPass/DrawRenderersCustomPassDrawer.cs +++ b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/CustomPass/DrawRenderersCustomPassDrawer.cs @@ -64,30 +64,30 @@ private class Styles private int m_MaterialLines = 2; // Foldouts - SerializedProperty m_FilterFoldout; - SerializedProperty m_RendererFoldout; - SerializedProperty m_PassFoldout; - SerializedProperty m_TargetDepthBuffer; + SerializedProperty m_FilterFoldout; + SerializedProperty m_RendererFoldout; + SerializedProperty m_PassFoldout; + SerializedProperty m_TargetDepthBuffer; // Filter - SerializedProperty m_RenderQueue; - SerializedProperty m_LayerMask; - SerializedProperty m_ShaderPasses; + SerializedProperty m_RenderQueue; + SerializedProperty m_LayerMask; + SerializedProperty m_ShaderPasses; // Render - SerializedProperty m_OverrideMaterial; - SerializedProperty m_OverrideMaterialPassName; - SerializedProperty m_SortingCriteria; - SerializedProperty m_ShaderPass; + SerializedProperty m_OverrideMaterial; + SerializedProperty m_OverrideMaterialPassName; + SerializedProperty m_SortingCriteria; + SerializedProperty m_ShaderPass; // Override depth state - SerializedProperty m_OverrideDepthState; - SerializedProperty m_DepthCompareFunction; - SerializedProperty m_DepthWrite; + SerializedProperty m_OverrideDepthState; + SerializedProperty m_DepthCompareFunction; + SerializedProperty m_DepthWrite; - ReorderableList m_ShaderPassesList; + ReorderableList m_ShaderPassesList; - CustomPassVolume m_Volume; + CustomPassVolume m_Volume; bool customDepthIsNone => (CustomPass.TargetBuffer)m_TargetDepthBuffer.intValue == CustomPass.TargetBuffer.None; @@ -130,7 +130,8 @@ protected override void Initialize(SerializedProperty customPass) EditorGUIUtility.labelWidth = labelWidth; }; - m_ShaderPassesList.drawHeaderCallback = (Rect testHeaderRect) => { + m_ShaderPassesList.drawHeaderCallback = (Rect testHeaderRect) => + { EditorGUI.LabelField(testHeaderRect, Styles.shaderPassFilter); }; } diff --git a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/CustomPass/FullScreenCustomPassDrawer.cs b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/CustomPass/FullScreenCustomPassDrawer.cs index eec8cb355e2..a2efdafa29b 100644 --- a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/CustomPass/FullScreenCustomPassDrawer.cs +++ b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/CustomPass/FullScreenCustomPassDrawer.cs @@ -28,10 +28,10 @@ private class Styles } // Fullscreen pass - SerializedProperty m_FullScreenPassMaterial; - SerializedProperty m_MaterialPassName; - SerializedProperty m_FetchColorBuffer; - SerializedProperty m_TargetColorBuffer; + SerializedProperty m_FullScreenPassMaterial; + SerializedProperty m_MaterialPassName; + SerializedProperty m_FetchColorBuffer; + SerializedProperty m_TargetColorBuffer; CustomPass.TargetBuffer targetColorBuffer => (CustomPass.TargetBuffer)m_TargetColorBuffer.intValue; diff --git a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/HDEditorCLI.cs b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/HDEditorCLI.cs index e3804a96bc8..b845a6327d7 100644 --- a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/HDEditorCLI.cs +++ b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/HDEditorCLI.cs @@ -65,7 +65,7 @@ static CommandLineAction ParseCommandLine(string[] args) { action.operation = (CommandLineOperation)Enum.Parse(typeof(CommandLineOperation), args[i]); } - catch (Exception e) { Debug.Log(e.ToString()); } + catch (Exception e) { Debug.Log(e.ToString()); } } break; } diff --git a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/HDEditorUtils.cs b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/HDEditorUtils.cs index 15d312b3cd4..04113855b52 100644 --- a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/HDEditorUtils.cs +++ b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/HDEditorUtils.cs @@ -380,7 +380,7 @@ public static string GetEnumName(this SerializedProperty property) [MethodImpl(MethodImplOptions.AggressiveInlining)] public static void SetEnumValue(this SerializedProperty property, T value) where T : Enum - // intValue actually is the value underlying beside the enum + // intValue actually is the value underlying beside the enum => SetEnumValue_Internal(property, value); /// diff --git a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/HDRenderPipelineMenuItems.cs b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/HDRenderPipelineMenuItems.cs index 504fe447aed..cfd36c4eaad 100644 --- a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/HDRenderPipelineMenuItems.cs +++ b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/HDRenderPipelineMenuItems.cs @@ -162,7 +162,7 @@ public override void Action(int instanceId, string pathName, string resourceFile PostCreateAssetWork(newAsset); } - protected virtual void PostCreateAssetWork(TAssetType asset) {} + protected virtual void PostCreateAssetWork(TAssetType asset) { } } class DoCreateNewAssetDiffusionProfileSettings : DoCreateNewAsset diff --git a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Raytracing/RayTracingShaderPreprocessor.cs b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Raytracing/RayTracingShaderPreprocessor.cs index 83cef8e78eb..045a1760130 100644 --- a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Raytracing/RayTracingShaderPreprocessor.cs +++ b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Raytracing/RayTracingShaderPreprocessor.cs @@ -5,7 +5,7 @@ namespace UnityEditor.Rendering.HighDefinition { class RayTracingShaderPreprocessor : BaseShaderPreprocessor { - public RayTracingShaderPreprocessor() {} + public RayTracingShaderPreprocessor() { } protected override bool DoShadersStripper(HDRenderPipelineAsset hdrpAsset, Shader shader, ShaderSnippetData snippet, ShaderCompilerData inputData) { diff --git a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/ScalableSettingLevelParameterEditor.cs b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/ScalableSettingLevelParameterEditor.cs index 40babae8afa..de006eccc07 100644 --- a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/ScalableSettingLevelParameterEditor.cs +++ b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/ScalableSettingLevelParameterEditor.cs @@ -14,7 +14,7 @@ public override bool OnGUI(SerializedDataParameter parameter, GUIContent title) return false; var o = parameter.GetObjectRef(); - var(level, useOverride) = o.levelAndOverride; + var (level, useOverride) = o.levelAndOverride; var rect = GUILayoutUtility.GetRect(0, float.Epsilon, 0, EditorGUIUtility.singleLineHeight); // Magic number for padding diff --git a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/DefaultSettingsPanel.cs b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/DefaultSettingsPanel.cs index 532e4816082..10c88b46093 100644 --- a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/DefaultSettingsPanel.cs +++ b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/DefaultSettingsPanel.cs @@ -170,7 +170,8 @@ void InitList(ref ReorderableList reorderableList, List customPostProces foreach (var kp in ppVolumeTypeInjectionPoints) { if (kp.Value == injectionPoint && !customPostProcessTypes.Contains(kp.Key.AssemblyQualifiedName)) - menu.AddItem(new GUIContent(kp.Key.ToString()), false, () => { + menu.AddItem(new GUIContent(kp.Key.ToString()), false, () => + { Undo.RegisterCompleteObjectUndo(hdrpAsset, $"Added {kp.Key.ToString()} Custom Post Process"); customPostProcessTypes.Add(kp.Key.AssemblyQualifiedName); }); diff --git a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/DiffusionProfileSettingsListUI.cs b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/DiffusionProfileSettingsListUI.cs index ebaf17cf3b1..6f0edb2aee5 100644 --- a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/DiffusionProfileSettingsListUI.cs +++ b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/DiffusionProfileSettingsListUI.cs @@ -9,12 +9,12 @@ namespace UnityEditor.Rendering.HighDefinition { class DiffusionProfileSettingsListUI { - ReorderableList m_DiffusionProfileList; - SerializedProperty m_Property; - string m_ListName; + ReorderableList m_DiffusionProfileList; + SerializedProperty m_Property; + string m_ListName; - const string k_DefaultListName = "Diffusion Profile List"; - const string k_MultiEditionUnsupported = "Diffusion Profile List: Multi-edition is not supported"; + const string k_DefaultListName = "Diffusion Profile List"; + const string k_MultiEditionUnsupported = "Diffusion Profile List: Multi-edition is not supported"; public DiffusionProfileSettingsListUI(string listName = k_DefaultListName) @@ -40,24 +40,27 @@ public void OnGUI(SerializedProperty parameter) EditorGUILayout.EndVertical(); } - public Action drawElement; + public Action drawElement; void CreateReorderableList(SerializedProperty parameter) { m_Property = parameter; m_DiffusionProfileList = new ReorderableList(parameter.serializedObject, parameter, true, true, true, true); - m_DiffusionProfileList.drawHeaderCallback = (rect) => { + m_DiffusionProfileList.drawHeaderCallback = (rect) => + { EditorGUI.LabelField(rect, m_ListName); }; - m_DiffusionProfileList.drawElementCallback = (rect, index, active, focused) => { + m_DiffusionProfileList.drawElementCallback = (rect, index, active, focused) => + { rect.height = EditorGUIUtility.singleLineHeight; if (drawElement != null) drawElement(parameter.GetArrayElementAtIndex(index), rect, index); }; - m_DiffusionProfileList.onAddCallback = (l) => { + m_DiffusionProfileList.onAddCallback = (l) => + { if (parameter.arraySize >= DiffusionProfileConstants.DIFFUSION_PROFILE_COUNT - 1) { Debug.LogError("Limit of 15 diffusion profiles reached."); diff --git a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/FrameSettingsUI.Drawers.cs b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/FrameSettingsUI.Drawers.cs index 30ad7a11050..497c762a638 100644 --- a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/FrameSettingsUI.Drawers.cs +++ b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/FrameSettingsUI.Drawers.cs @@ -110,7 +110,7 @@ internal static CED.IDrawer InspectorInnerbox(bool withOverride = true) => CED.G if (hdrpSettings.supportRayTracing) { bool rtEffectUseAsync = (serialized.IsEnabled(FrameSettingsField.SSRAsync) ?? false) || (serialized.IsEnabled(FrameSettingsField.SSAOAsync) ?? false) - //|| (serialized.IsEnabled(FrameSettingsField.ContactShadowsAsync) ?? false) // Contact shadow async is not visible in the UI for now and defaults to true. + //|| (serialized.IsEnabled(FrameSettingsField.ContactShadowsAsync) ?? false) // Contact shadow async is not visible in the UI for now and defaults to true. ; if (rtEffectUseAsync) EditorGUILayout.HelpBox("Asynchronous execution of Raytracing effects is not supported. Asynchronous Execution will be forced to false for them", MessageType.Warning); @@ -307,7 +307,7 @@ static void Drawer_SectionLightingSettings(SerializedFrameSettings serialized, E FrameSettingsField.SssQualityMode, overridedDefaultValue: SssQualityMode.FromQualitySettings, customGetter: () => serialized.sssQualityMode.GetEnumValue(), - customSetter: v => serialized.sssQualityMode.SetEnumValue((SssQualityMode)v), + customSetter: v => serialized.sssQualityMode.SetEnumValue((SssQualityMode)v), overrideable: () => hdrpSettings.supportSubsurfaceScattering && (serialized.IsEnabled(FrameSettingsField.SubsurfaceScattering) ?? false), ignoreDependencies: true, @@ -315,8 +315,8 @@ static void Drawer_SectionLightingSettings(SerializedFrameSettings serialized, E ); area.AmmendInfo(FrameSettingsField.SssQualityLevel, overridedDefaultValue: ScalableLevel3ForFrameSettingsUIOnly.Low, - customGetter: () => (ScalableLevel3ForFrameSettingsUIOnly)serialized.sssQualityLevel.intValue, // 3 levels - customSetter: v => serialized.sssQualityLevel.intValue = Math.Max(0, Math.Min((int)v, 2)), // Levels 0-2 + customGetter: () => (ScalableLevel3ForFrameSettingsUIOnly)serialized.sssQualityLevel.intValue, // 3 levels + customSetter: v => serialized.sssQualityLevel.intValue = Math.Max(0, Math.Min((int)v, 2)), // Levels 0-2 overrideable: () => hdrpSettings.supportSubsurfaceScattering && (serialized.IsEnabled(FrameSettingsField.SubsurfaceScattering) ?? false) && (serialized.sssQualityMode.GetEnumValue() == SssQualityMode.FromQualitySettings), @@ -325,8 +325,8 @@ static void Drawer_SectionLightingSettings(SerializedFrameSettings serialized, E ); area.AmmendInfo(FrameSettingsField.SssCustomSampleBudget, overridedDefaultValue: (int)DefaultSssSampleBudgetForQualityLevel.Low, - customGetter: () => serialized.sssCustomSampleBudget.intValue, - customSetter: v => serialized.sssCustomSampleBudget.intValue = Math.Max(1, Math.Min((int)v, (int)DefaultSssSampleBudgetForQualityLevel.Max)), + customGetter: () => serialized.sssCustomSampleBudget.intValue, + customSetter: v => serialized.sssCustomSampleBudget.intValue = Math.Max(1, Math.Min((int)v, (int)DefaultSssSampleBudgetForQualityLevel.Max)), overrideable: () => hdrpSettings.supportSubsurfaceScattering && (serialized.IsEnabled(FrameSettingsField.SubsurfaceScattering) ?? false) && (serialized.sssQualityMode.GetEnumValue() != SssQualityMode.FromQualitySettings), diff --git a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/OverridableFrameSettingsArea.cs b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/OverridableFrameSettingsArea.cs index 43a566f3cb2..a306c39a253 100644 --- a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/OverridableFrameSettingsArea.cs +++ b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/OverridableFrameSettingsArea.cs @@ -375,6 +375,6 @@ class FrameSettingsNotFoundInGroupException : Exception { public FrameSettingsNotFoundInGroupException(string message) : base(message) - {} + { } } } diff --git a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/SerializedDynamicResolutionSettings.cs b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/SerializedDynamicResolutionSettings.cs index 2f712bbd835..1e81169de5b 100644 --- a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/SerializedDynamicResolutionSettings.cs +++ b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/SerializedDynamicResolutionSettings.cs @@ -19,13 +19,13 @@ public SerializedDynamicResolutionSettings(SerializedProperty root) { this.root = root; - enabled = root.Find((GlobalDynamicResolutionSettings s) => s.enabled); - maxPercentage = root.Find((GlobalDynamicResolutionSettings s) => s.maxPercentage); - minPercentage = root.Find((GlobalDynamicResolutionSettings s) => s.minPercentage); - dynamicResType = root.Find((GlobalDynamicResolutionSettings s) => s.dynResType); + enabled = root.Find((GlobalDynamicResolutionSettings s) => s.enabled); + maxPercentage = root.Find((GlobalDynamicResolutionSettings s) => s.maxPercentage); + minPercentage = root.Find((GlobalDynamicResolutionSettings s) => s.minPercentage); + dynamicResType = root.Find((GlobalDynamicResolutionSettings s) => s.dynResType); softwareUpsamplingFilter = root.Find((GlobalDynamicResolutionSettings s) => s.upsampleFilter); - forcePercentage = root.Find((GlobalDynamicResolutionSettings s) => s.forceResolution); - forcedPercentage = root.Find((GlobalDynamicResolutionSettings s) => s.forcedPercentage); + forcePercentage = root.Find((GlobalDynamicResolutionSettings s) => s.forceResolution); + forcedPercentage = root.Find((GlobalDynamicResolutionSettings s) => s.forcedPercentage); } } } diff --git a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/SerializedFrameSettings.cs b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/SerializedFrameSettings.cs index 2793aae3d0f..d247d300413 100644 --- a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/SerializedFrameSettings.cs +++ b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/SerializedFrameSettings.cs @@ -86,21 +86,21 @@ ref FrameSettings GetData(Object obj) public SerializedFrameSettings(SerializedProperty rootData, SerializedProperty rootOverrides) { - m_RootData = rootData; + m_RootData = rootData; m_RootOverrides = rootOverrides; - m_BitDatas = rootData.FindPropertyRelative("bitDatas").ToSerializeBitArray128(); - m_BitOverrides = rootOverrides?.FindPropertyRelative("mask").ToSerializeBitArray128(); //rootOverride can be null in case of hdrpAsset defaults + m_BitDatas = rootData.FindPropertyRelative("bitDatas").ToSerializeBitArray128(); + m_BitOverrides = rootOverrides?.FindPropertyRelative("mask").ToSerializeBitArray128(); //rootOverride can be null in case of hdrpAsset defaults - sssQualityMode = rootData.FindPropertyRelative("sssQualityMode"); - sssQualityLevel = rootData.FindPropertyRelative("sssQualityLevel"); - sssCustomSampleBudget = rootData.FindPropertyRelative("sssCustomSampleBudget"); - lodBias = rootData.FindPropertyRelative("lodBias"); - lodBiasMode = rootData.FindPropertyRelative("lodBiasMode"); - lodBiasQualityLevel = rootData.FindPropertyRelative("lodBiasQualityLevel"); - maximumLODLevel = rootData.FindPropertyRelative("maximumLODLevel"); - maximumLODLevelMode = rootData.FindPropertyRelative("maximumLODLevelMode"); + sssQualityMode = rootData.FindPropertyRelative("sssQualityMode"); + sssQualityLevel = rootData.FindPropertyRelative("sssQualityLevel"); + sssCustomSampleBudget = rootData.FindPropertyRelative("sssCustomSampleBudget"); + lodBias = rootData.FindPropertyRelative("lodBias"); + lodBiasMode = rootData.FindPropertyRelative("lodBiasMode"); + lodBiasQualityLevel = rootData.FindPropertyRelative("lodBiasQualityLevel"); + maximumLODLevel = rootData.FindPropertyRelative("maximumLODLevel"); + maximumLODLevelMode = rootData.FindPropertyRelative("maximumLODLevelMode"); maximumLODLevelQualityLevel = rootData.FindPropertyRelative("maximumLODLevelQualityLevel"); - materialQuality = rootData.Find((FrameSettings s) => s.materialQuality); + materialQuality = rootData.Find((FrameSettings s) => s.materialQuality); } public struct TitleDrawingScope : IDisposable diff --git a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/SerializedLowResTransparencySettings.cs b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/SerializedLowResTransparencySettings.cs index 8e56c06d8e6..16e6812c09f 100644 --- a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/SerializedLowResTransparencySettings.cs +++ b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/SerializedLowResTransparencySettings.cs @@ -15,9 +15,9 @@ public SerializedLowResTransparencySettings(SerializedProperty root) { this.root = root; - enabled = root.Find((GlobalLowResolutionTransparencySettings s) => s.enabled); - checkerboardDepthBuffer = root.Find((GlobalLowResolutionTransparencySettings s) => s.checkerboardDepthBuffer); - upsampleType = root.Find((GlobalLowResolutionTransparencySettings s) => s.upsampleType); + enabled = root.Find((GlobalLowResolutionTransparencySettings s) => s.enabled); + checkerboardDepthBuffer = root.Find((GlobalLowResolutionTransparencySettings s) => s.checkerboardDepthBuffer); + upsampleType = root.Find((GlobalLowResolutionTransparencySettings s) => s.upsampleType); } } } diff --git a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/SerializedPostProcessingQualitySettings.cs b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/SerializedPostProcessingQualitySettings.cs index 06d60591e59..b4aa4f86e8c 100644 --- a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/SerializedPostProcessingQualitySettings.cs +++ b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/SerializedPostProcessingQualitySettings.cs @@ -32,24 +32,24 @@ public SerializedPostProcessingQualitySettings(SerializedProperty root) this.root = root; // DoF - NearBlurSampleCount = root.Find((GlobalPostProcessingQualitySettings s) => s.NearBlurSampleCount); - NearBlurMaxRadius = root.Find((GlobalPostProcessingQualitySettings s) => s.NearBlurMaxRadius); - FarBlurSampleCount = root.Find((GlobalPostProcessingQualitySettings s) => s.FarBlurSampleCount); - FarBlurMaxRadius = root.Find((GlobalPostProcessingQualitySettings s) => s.FarBlurMaxRadius); - DoFResolution = root.Find((GlobalPostProcessingQualitySettings s) => s.DoFResolution); - DoFHighFilteringQuality = root.Find((GlobalPostProcessingQualitySettings s) => s.DoFHighQualityFiltering); - DoFPhysicallyBased = root.Find((GlobalPostProcessingQualitySettings s) => s.DoFPhysicallyBased); + NearBlurSampleCount = root.Find((GlobalPostProcessingQualitySettings s) => s.NearBlurSampleCount); + NearBlurMaxRadius = root.Find((GlobalPostProcessingQualitySettings s) => s.NearBlurMaxRadius); + FarBlurSampleCount = root.Find((GlobalPostProcessingQualitySettings s) => s.FarBlurSampleCount); + FarBlurMaxRadius = root.Find((GlobalPostProcessingQualitySettings s) => s.FarBlurMaxRadius); + DoFResolution = root.Find((GlobalPostProcessingQualitySettings s) => s.DoFResolution); + DoFHighFilteringQuality = root.Find((GlobalPostProcessingQualitySettings s) => s.DoFHighQualityFiltering); + DoFPhysicallyBased = root.Find((GlobalPostProcessingQualitySettings s) => s.DoFPhysicallyBased); // Motion Blur - MotionBlurSampleCount = root.Find((GlobalPostProcessingQualitySettings s) => s.MotionBlurSampleCount); + MotionBlurSampleCount = root.Find((GlobalPostProcessingQualitySettings s) => s.MotionBlurSampleCount); // Bloom - BloomRes = root.Find((GlobalPostProcessingQualitySettings s) => s.BloomRes); - BloomHighFilteringQuality = root.Find((GlobalPostProcessingQualitySettings s) => s.BloomHighQualityFiltering); + BloomRes = root.Find((GlobalPostProcessingQualitySettings s) => s.BloomRes); + BloomHighFilteringQuality = root.Find((GlobalPostProcessingQualitySettings s) => s.BloomHighQualityFiltering); BloomHighPrefilteringQuality = root.Find((GlobalPostProcessingQualitySettings s) => s.BloomHighQualityPrefiltering); // Chromatic Aberration - ChromaticAbMaxSamples = root.Find((GlobalPostProcessingQualitySettings s) => s.ChromaticAberrationMaxSamples); + ChromaticAbMaxSamples = root.Find((GlobalPostProcessingQualitySettings s) => s.ChromaticAberrationMaxSamples); } } } diff --git a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/SerializedRenderPipelineSettings.cs b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/SerializedRenderPipelineSettings.cs index c53ee8030f9..00ef0fada9d 100644 --- a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/SerializedRenderPipelineSettings.cs +++ b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/SerializedRenderPipelineSettings.cs @@ -84,66 +84,66 @@ class SerializedRenderPipelineSettings public SerializedScalableSetting lodBias; public SerializedScalableSetting maximumLODLevel; - #pragma warning disable 618 // Type or member is obsolete +#pragma warning disable 618 // Type or member is obsolete [FormerlySerializedAs("enableUltraQualitySSS"), FormerlySerializedAs("increaseSssSampleCount"), Obsolete("For data migration")] SerializedProperty m_ObsoleteincreaseSssSampleCount; - #pragma warning restore 618 +#pragma warning restore 618 public SerializedRenderPipelineSettings(SerializedProperty root) { this.root = root; - supportShadowMask = root.Find((RenderPipelineSettings s) => s.supportShadowMask); - supportSSR = root.Find((RenderPipelineSettings s) => s.supportSSR); - supportSSRTransparent = root.Find((RenderPipelineSettings s) => s.supportSSRTransparent); - supportSSAO = root.Find((RenderPipelineSettings s) => s.supportSSAO); - supportSSGI = root.Find((RenderPipelineSettings s) => s.supportSSGI); - supportSubsurfaceScattering = root.Find((RenderPipelineSettings s) => s.supportSubsurfaceScattering); - sssSampleBudget = new SerializedScalableSetting(root.Find((RenderPipelineSettings s) => s.sssSampleBudget)); - supportVolumetrics = root.Find((RenderPipelineSettings s) => s.supportVolumetrics); - supportLightLayers = root.Find((RenderPipelineSettings s) => s.supportLightLayers); - lightLayerName0 = root.Find((RenderPipelineSettings s) => s.lightLayerName0); - lightLayerName1 = root.Find((RenderPipelineSettings s) => s.lightLayerName1); - lightLayerName2 = root.Find((RenderPipelineSettings s) => s.lightLayerName2); - lightLayerName3 = root.Find((RenderPipelineSettings s) => s.lightLayerName3); - lightLayerName4 = root.Find((RenderPipelineSettings s) => s.lightLayerName4); - lightLayerName5 = root.Find((RenderPipelineSettings s) => s.lightLayerName5); - lightLayerName6 = root.Find((RenderPipelineSettings s) => s.lightLayerName6); - lightLayerName7 = root.Find((RenderPipelineSettings s) => s.lightLayerName7); - colorBufferFormat = root.Find((RenderPipelineSettings s) => s.colorBufferFormat); - customBufferFormat = root.Find((RenderPipelineSettings s) => s.customBufferFormat); - supportCustomPass = root.Find((RenderPipelineSettings s) => s.supportCustomPass); - supportedLitShaderMode = root.Find((RenderPipelineSettings s) => s.supportedLitShaderMode); - planarReflectionResolution = new SerializedScalableSetting(root.Find((RenderPipelineSettings s) => s.planarReflectionResolution)); - - supportDecals = root.Find((RenderPipelineSettings s) => s.supportDecals); - supportDecalLayers = root.Find((RenderPipelineSettings s) => s.supportDecalLayers); - decalLayerName0 = root.Find((RenderPipelineSettings s) => s.decalLayerName0); - decalLayerName1 = root.Find((RenderPipelineSettings s) => s.decalLayerName1); - decalLayerName2 = root.Find((RenderPipelineSettings s) => s.decalLayerName2); - decalLayerName3 = root.Find((RenderPipelineSettings s) => s.decalLayerName3); - decalLayerName4 = root.Find((RenderPipelineSettings s) => s.decalLayerName4); - decalLayerName5 = root.Find((RenderPipelineSettings s) => s.decalLayerName5); - decalLayerName6 = root.Find((RenderPipelineSettings s) => s.decalLayerName6); - decalLayerName7 = root.Find((RenderPipelineSettings s) => s.decalLayerName7); - MSAASampleCount = root.Find((RenderPipelineSettings s) => s.msaaSampleCount); - supportMotionVectors = root.Find((RenderPipelineSettings s) => s.supportMotionVectors); - supportRuntimeDebugDisplay = root.Find((RenderPipelineSettings s) => s.supportRuntimeDebugDisplay); - supportRuntimeAOVAPI = root.Find((RenderPipelineSettings s) => s.supportRuntimeAOVAPI); - supportDitheringCrossFade = root.Find((RenderPipelineSettings s) => s.supportDitheringCrossFade); - supportTerrainHole = root.Find((RenderPipelineSettings s) => s.supportTerrainHole); - supportDistortion = root.Find((RenderPipelineSettings s) => s.supportDistortion); - supportTransparentBackface = root.Find((RenderPipelineSettings s) => s.supportTransparentBackface); - supportTransparentDepthPrepass = root.Find((RenderPipelineSettings s) => s.supportTransparentDepthPrepass); + supportShadowMask = root.Find((RenderPipelineSettings s) => s.supportShadowMask); + supportSSR = root.Find((RenderPipelineSettings s) => s.supportSSR); + supportSSRTransparent = root.Find((RenderPipelineSettings s) => s.supportSSRTransparent); + supportSSAO = root.Find((RenderPipelineSettings s) => s.supportSSAO); + supportSSGI = root.Find((RenderPipelineSettings s) => s.supportSSGI); + supportSubsurfaceScattering = root.Find((RenderPipelineSettings s) => s.supportSubsurfaceScattering); + sssSampleBudget = new SerializedScalableSetting(root.Find((RenderPipelineSettings s) => s.sssSampleBudget)); + supportVolumetrics = root.Find((RenderPipelineSettings s) => s.supportVolumetrics); + supportLightLayers = root.Find((RenderPipelineSettings s) => s.supportLightLayers); + lightLayerName0 = root.Find((RenderPipelineSettings s) => s.lightLayerName0); + lightLayerName1 = root.Find((RenderPipelineSettings s) => s.lightLayerName1); + lightLayerName2 = root.Find((RenderPipelineSettings s) => s.lightLayerName2); + lightLayerName3 = root.Find((RenderPipelineSettings s) => s.lightLayerName3); + lightLayerName4 = root.Find((RenderPipelineSettings s) => s.lightLayerName4); + lightLayerName5 = root.Find((RenderPipelineSettings s) => s.lightLayerName5); + lightLayerName6 = root.Find((RenderPipelineSettings s) => s.lightLayerName6); + lightLayerName7 = root.Find((RenderPipelineSettings s) => s.lightLayerName7); + colorBufferFormat = root.Find((RenderPipelineSettings s) => s.colorBufferFormat); + customBufferFormat = root.Find((RenderPipelineSettings s) => s.customBufferFormat); + supportCustomPass = root.Find((RenderPipelineSettings s) => s.supportCustomPass); + supportedLitShaderMode = root.Find((RenderPipelineSettings s) => s.supportedLitShaderMode); + planarReflectionResolution = new SerializedScalableSetting(root.Find((RenderPipelineSettings s) => s.planarReflectionResolution)); + + supportDecals = root.Find((RenderPipelineSettings s) => s.supportDecals); + supportDecalLayers = root.Find((RenderPipelineSettings s) => s.supportDecalLayers); + decalLayerName0 = root.Find((RenderPipelineSettings s) => s.decalLayerName0); + decalLayerName1 = root.Find((RenderPipelineSettings s) => s.decalLayerName1); + decalLayerName2 = root.Find((RenderPipelineSettings s) => s.decalLayerName2); + decalLayerName3 = root.Find((RenderPipelineSettings s) => s.decalLayerName3); + decalLayerName4 = root.Find((RenderPipelineSettings s) => s.decalLayerName4); + decalLayerName5 = root.Find((RenderPipelineSettings s) => s.decalLayerName5); + decalLayerName6 = root.Find((RenderPipelineSettings s) => s.decalLayerName6); + decalLayerName7 = root.Find((RenderPipelineSettings s) => s.decalLayerName7); + MSAASampleCount = root.Find((RenderPipelineSettings s) => s.msaaSampleCount); + supportMotionVectors = root.Find((RenderPipelineSettings s) => s.supportMotionVectors); + supportRuntimeDebugDisplay = root.Find((RenderPipelineSettings s) => s.supportRuntimeDebugDisplay); + supportRuntimeAOVAPI = root.Find((RenderPipelineSettings s) => s.supportRuntimeAOVAPI); + supportDitheringCrossFade = root.Find((RenderPipelineSettings s) => s.supportDitheringCrossFade); + supportTerrainHole = root.Find((RenderPipelineSettings s) => s.supportTerrainHole); + supportDistortion = root.Find((RenderPipelineSettings s) => s.supportDistortion); + supportTransparentBackface = root.Find((RenderPipelineSettings s) => s.supportTransparentBackface); + supportTransparentDepthPrepass = root.Find((RenderPipelineSettings s) => s.supportTransparentDepthPrepass); supportTransparentDepthPostpass = root.Find((RenderPipelineSettings s) => s.supportTransparentDepthPostpass); - supportProbeVolume = root.Find((RenderPipelineSettings s) => s.supportProbeVolume); + supportProbeVolume = root.Find((RenderPipelineSettings s) => s.supportProbeVolume); - supportRayTracing = root.Find((RenderPipelineSettings s) => s.supportRayTracing); - supportedRayTracingMode = root.Find((RenderPipelineSettings s) => s.supportedRayTracingMode); + supportRayTracing = root.Find((RenderPipelineSettings s) => s.supportRayTracing); + supportedRayTracingMode = root.Find((RenderPipelineSettings s) => s.supportedRayTracingMode); lightLoopSettings = new SerializedGlobalLightLoopSettings(root.Find((RenderPipelineSettings s) => s.lightLoopSettings)); hdShadowInitParams = new SerializedHDShadowInitParameters(root.Find((RenderPipelineSettings s) => s.hdShadowInitParams)); - decalSettings = new SerializedGlobalDecalSettings(root.Find((RenderPipelineSettings s) => s.decalSettings)); + decalSettings = new SerializedGlobalDecalSettings(root.Find((RenderPipelineSettings s) => s.decalSettings)); postProcessSettings = new SerializedGlobalPostProcessSettings(root.Find((RenderPipelineSettings s) => s.postProcessSettings)); dynamicResolutionSettings = new SerializedDynamicResolutionSettings(root.Find((RenderPipelineSettings s) => s.dynamicResolutionSettings)); lowresTransparentSettings = new SerializedLowResTransparencySettings(root.Find((RenderPipelineSettings s) => s.lowresTransparentSettings)); @@ -156,9 +156,9 @@ public SerializedRenderPipelineSettings(SerializedProperty root) maximumLODLevel = new SerializedScalableSetting(root.Find((RenderPipelineSettings s) => s.maximumLODLevel)); lightingQualitySettings = new SerializedLightingQualitySettings(root.Find((RenderPipelineSettings s) => s.lightingQualitySettings)); - #pragma warning disable 618 // Type or member is obsolete +#pragma warning disable 618 // Type or member is obsolete m_ObsoleteincreaseSssSampleCount = root.Find((RenderPipelineSettings s) => s.m_ObsoleteincreaseSssSampleCount); - #pragma warning restore 618 +#pragma warning restore 618 } } } diff --git a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/SerializedScalableSettingValue.cs b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/SerializedScalableSettingValue.cs index ae321567a87..ce8ed81c4a7 100644 --- a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/SerializedScalableSettingValue.cs +++ b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/SerializedScalableSettingValue.cs @@ -210,7 +210,7 @@ ScalableSettingSchema schema EditorGUI.BeginProperty(levelRect, label, self.useOverride); { EditorGUI.BeginChangeCheck(); - var(level, useOverride) = LevelFieldGUI( + var (level, useOverride) = LevelFieldGUI( levelRect, GUIContent.none, schema, diff --git a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/VirtualTexturingSettingsUI.cs b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/VirtualTexturingSettingsUI.cs index 70ba0b28791..6e28e8ae530 100644 --- a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/VirtualTexturingSettingsUI.cs +++ b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/VirtualTexturingSettingsUI.cs @@ -65,7 +65,7 @@ GPUCacheSettingSRP[] GetGPUCacheSizeOverrideArrayFromProperty(SerializedProperty { SerializedProperty settingProperty = property.GetArrayElementAtIndex(i); settings.Add(new GPUCacheSettingSRP() - { format = (GraphicsFormat)settingProperty.FindPropertyRelative("format").intValue, sizeInMegaBytes = (uint)settingProperty.FindPropertyRelative("sizeInMegaBytes").intValue }); + { format = (GraphicsFormat)settingProperty.FindPropertyRelative("format").intValue, sizeInMegaBytes = (uint)settingProperty.FindPropertyRelative("sizeInMegaBytes").intValue }); } return settings.ToArray(); diff --git a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/VolumeComponentWithQualityEditor.cs b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/VolumeComponentWithQualityEditor.cs index 46d63a2591b..b908537351e 100644 --- a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/VolumeComponentWithQualityEditor.cs +++ b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/VolumeComponentWithQualityEditor.cs @@ -18,7 +18,7 @@ internal class QualitySettingsBlob { private struct QualitySetting { - public bool state; + public bool state; public object value; } @@ -230,7 +230,7 @@ protected void CopySetting(ref SerializedDataParameter setting, T value) wher /// /// This function should be overriden by a volume component to load preset settings from RenderPipelineSettings /// - public virtual void LoadSettingsFromQualityPreset(RenderPipelineSettings settings, int level) {} + public virtual void LoadSettingsFromQualityPreset(RenderPipelineSettings settings, int level) { } /// /// This function should be overriden by a volume component to return an opaque object (binary blob) with the custom quality settings currently in use. @@ -240,7 +240,7 @@ public virtual void LoadSettingsFromQualityPreset(RenderPipelineSettings setting /// /// This function should be overriden by a volume component to load a custom preset setting from an opaque binary blob (as returned from SaveCustomQualitySettingsAsObject) /// - public virtual void LoadSettingsFromObject(QualitySettingsBlob settings) {} + public virtual void LoadSettingsFromObject(QualitySettingsBlob settings) { } /// /// This function should be overriden by a volume component to enable the quality setting functionality only in certain cases. diff --git a/com.unity.render-pipelines.high-definition/Editor/SceneTemplates/HDRPBasicDxrScenePipeline.cs b/com.unity.render-pipelines.high-definition/Editor/SceneTemplates/HDRPBasicDxrScenePipeline.cs index 822100f53c3..4f76a63ad00 100644 --- a/com.unity.render-pipelines.high-definition/Editor/SceneTemplates/HDRPBasicDxrScenePipeline.cs +++ b/com.unity.render-pipelines.high-definition/Editor/SceneTemplates/HDRPBasicDxrScenePipeline.cs @@ -7,10 +7,10 @@ namespace UnityEditor.Rendering.HighDefinition class HDRPBasicDxrScenePipeline : ISceneTemplatePipeline { void ISceneTemplatePipeline.AfterTemplateInstantiation(SceneTemplateAsset sceneTemplateAsset, Scene scene, bool isAdditive, string sceneName) - {} + { } void ISceneTemplatePipeline.BeforeTemplateInstantiation(SceneTemplateAsset sceneTemplateAsset, bool isAdditive, string sceneName) - {} + { } bool ISceneTemplatePipeline.IsValidTemplateForInstantiation(SceneTemplateAsset sceneTemplateAsset) { diff --git a/com.unity.render-pipelines.high-definition/Editor/SceneTemplates/HDRPBasicScenePipeline.cs b/com.unity.render-pipelines.high-definition/Editor/SceneTemplates/HDRPBasicScenePipeline.cs index f535dc31ef8..7ff45f0bb5e 100644 --- a/com.unity.render-pipelines.high-definition/Editor/SceneTemplates/HDRPBasicScenePipeline.cs +++ b/com.unity.render-pipelines.high-definition/Editor/SceneTemplates/HDRPBasicScenePipeline.cs @@ -7,10 +7,10 @@ namespace UnityEditor.Rendering.HighDefinition class HDRPBasicScenePipeline : ISceneTemplatePipeline { void ISceneTemplatePipeline.AfterTemplateInstantiation(SceneTemplateAsset sceneTemplateAsset, Scene scene, bool isAdditive, string sceneName) - {} + { } void ISceneTemplatePipeline.BeforeTemplateInstantiation(SceneTemplateAsset sceneTemplateAsset, bool isAdditive, string sceneName) - {} + { } bool ISceneTemplatePipeline.IsValidTemplateForInstantiation(SceneTemplateAsset sceneTemplateAsset) { diff --git a/com.unity.render-pipelines.high-definition/Editor/Sky/HDRISky/HDRISkyEditor.cs b/com.unity.render-pipelines.high-definition/Editor/Sky/HDRISky/HDRISkyEditor.cs index dc87d92ce5c..44919c648f0 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Sky/HDRISky/HDRISkyEditor.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Sky/HDRISky/HDRISkyEditor.cs @@ -35,8 +35,8 @@ class HDRISkyEditor SerializedDataParameter m_RectLightShadow; SerializedDataParameter m_ShadowTint; - GUIContent[] m_DistortionModes = { new GUIContent("Procedural"), new GUIContent("Flowmap") }; - int[] m_DistortionModeValues = { 1, 0 }; + GUIContent[] m_DistortionModes = { new GUIContent("Procedural"), new GUIContent("Flowmap") }; + int[] m_DistortionModeValues = { 1, 0 }; RTHandle m_IntensityTexture; Material m_IntegrateHDRISkyMaterial; // Compute the HDRI sky intensity in lux for the skybox @@ -52,30 +52,30 @@ public override void OnEnable() m_CommonUIElementsMask = 0xFFFFFFFF & ~(uint)(SkySettingsUIElement.IncludeSunInBaking); var o = new PropertyFetcher(serializedObject); - m_hdriSky = Unpack(o.Find(x => x.hdriSky)); - m_UpperHemisphereLuxValue = Unpack(o.Find(x => x.upperHemisphereLuxValue)); - m_UpperHemisphereLuxColor = Unpack(o.Find(x => x.upperHemisphereLuxColor)); - - m_EnableCloudMotion = Unpack(o.Find(x => x.enableDistortion)); - m_Procedural = Unpack(o.Find(x => x.procedural)); - m_Flowmap = Unpack(o.Find(x => x.flowmap)); - m_UpperHemisphereOnly = Unpack(o.Find(x => x.upperHemisphereOnly)); - m_ScrollDirection = Unpack(o.Find(x => x.scrollDirection)); - m_ScrollSpeed = Unpack(o.Find(x => x.scrollSpeed)); - - m_EnableBackplate = Unpack(o.Find(x => x.enableBackplate)); - m_BackplateType = Unpack(o.Find(x => x.backplateType)); - m_GroundLevel = Unpack(o.Find(x => x.groundLevel)); - m_Scale = Unpack(o.Find(x => x.scale)); - m_ProjectionDistance = Unpack(o.Find(x => x.projectionDistance)); - m_PlateRotation = Unpack(o.Find(x => x.plateRotation)); - m_PlateTexRotation = Unpack(o.Find(x => x.plateTexRotation)); - m_PlateTexOffset = Unpack(o.Find(x => x.plateTexOffset)); - m_BlendAmount = Unpack(o.Find(x => x.blendAmount)); - m_PointLightShadow = Unpack(o.Find(x => x.pointLightShadow)); - m_DirLightShadow = Unpack(o.Find(x => x.dirLightShadow)); - m_RectLightShadow = Unpack(o.Find(x => x.rectLightShadow)); - m_ShadowTint = Unpack(o.Find(x => x.shadowTint)); + m_hdriSky = Unpack(o.Find(x => x.hdriSky)); + m_UpperHemisphereLuxValue = Unpack(o.Find(x => x.upperHemisphereLuxValue)); + m_UpperHemisphereLuxColor = Unpack(o.Find(x => x.upperHemisphereLuxColor)); + + m_EnableCloudMotion = Unpack(o.Find(x => x.enableDistortion)); + m_Procedural = Unpack(o.Find(x => x.procedural)); + m_Flowmap = Unpack(o.Find(x => x.flowmap)); + m_UpperHemisphereOnly = Unpack(o.Find(x => x.upperHemisphereOnly)); + m_ScrollDirection = Unpack(o.Find(x => x.scrollDirection)); + m_ScrollSpeed = Unpack(o.Find(x => x.scrollSpeed)); + + m_EnableBackplate = Unpack(o.Find(x => x.enableBackplate)); + m_BackplateType = Unpack(o.Find(x => x.backplateType)); + m_GroundLevel = Unpack(o.Find(x => x.groundLevel)); + m_Scale = Unpack(o.Find(x => x.scale)); + m_ProjectionDistance = Unpack(o.Find(x => x.projectionDistance)); + m_PlateRotation = Unpack(o.Find(x => x.plateRotation)); + m_PlateTexRotation = Unpack(o.Find(x => x.plateTexRotation)); + m_PlateTexOffset = Unpack(o.Find(x => x.plateTexOffset)); + m_BlendAmount = Unpack(o.Find(x => x.blendAmount)); + m_PointLightShadow = Unpack(o.Find(x => x.pointLightShadow)); + m_DirLightShadow = Unpack(o.Find(x => x.dirLightShadow)); + m_RectLightShadow = Unpack(o.Find(x => x.rectLightShadow)); + m_ShadowTint = Unpack(o.Find(x => x.shadowTint)); m_IntensityTexture = RTHandles.Alloc(1, 1, colorFormat: GraphicsFormat.R32G32B32A32_SFloat); var hdrp = HDRenderPipeline.defaultAsset; diff --git a/com.unity.render-pipelines.high-definition/Editor/Sky/PhysicallyBasedSky/PhysicallyBasedSkyEditor.cs b/com.unity.render-pipelines.high-definition/Editor/Sky/PhysicallyBasedSky/PhysicallyBasedSkyEditor.cs index d7163aa5fb8..4edcde0aadc 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Sky/PhysicallyBasedSky/PhysicallyBasedSkyEditor.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Sky/PhysicallyBasedSky/PhysicallyBasedSkyEditor.cs @@ -43,10 +43,10 @@ class PhysicallyBasedSkyEditor : SkySettingsEditor SerializedDataParameter m_NumberOfBounces; - GUIContent m_ModelTypeLabel = new GUIContent("Type", "Specifies a preset to simplify the interface."); + GUIContent m_ModelTypeLabel = new GUIContent("Type", "Specifies a preset to simplify the interface."); - GUIContent[] m_ModelTypes = { new GUIContent("Earth (Simple)"), new GUIContent("Earth (Advanced)"), new GUIContent("Custom Planet") }; - int[] m_ModelTypeValues = { (int)PhysicallyBasedSkyModel.EarthSimple, (int)PhysicallyBasedSkyModel.EarthAdvanced, (int)PhysicallyBasedSkyModel.Custom }; + GUIContent[] m_ModelTypes = { new GUIContent("Earth (Simple)"), new GUIContent("Earth (Advanced)"), new GUIContent("Custom Planet") }; + int[] m_ModelTypeValues = { (int)PhysicallyBasedSkyModel.EarthSimple, (int)PhysicallyBasedSkyModel.EarthAdvanced, (int)PhysicallyBasedSkyModel.Custom }; public override void OnEnable() { @@ -58,40 +58,40 @@ public override void OnEnable() var o = new PropertyFetcher(serializedObject); - m_Type = Unpack(o.Find(x => x.type)); - m_SphericalMode = Unpack(o.Find(x => x.sphericalMode)); - m_SeaLevel = Unpack(o.Find(x => x.seaLevel)); - m_PlanetaryRadius = Unpack(o.Find(x => x.planetaryRadius)); - m_PlanetCenterPosition = Unpack(o.Find(x => x.planetCenterPosition)); - m_PlanetRotation = Unpack(o.Find(x => x.planetRotation)); - m_GroundColorTexture = Unpack(o.Find(x => x.groundColorTexture)); - m_GroundTint = Unpack(o.Find(x => x.groundTint)); - m_GroundEmissionTexture = Unpack(o.Find(x => x.groundEmissionTexture)); + m_Type = Unpack(o.Find(x => x.type)); + m_SphericalMode = Unpack(o.Find(x => x.sphericalMode)); + m_SeaLevel = Unpack(o.Find(x => x.seaLevel)); + m_PlanetaryRadius = Unpack(o.Find(x => x.planetaryRadius)); + m_PlanetCenterPosition = Unpack(o.Find(x => x.planetCenterPosition)); + m_PlanetRotation = Unpack(o.Find(x => x.planetRotation)); + m_GroundColorTexture = Unpack(o.Find(x => x.groundColorTexture)); + m_GroundTint = Unpack(o.Find(x => x.groundTint)); + m_GroundEmissionTexture = Unpack(o.Find(x => x.groundEmissionTexture)); m_GroundEmissionMultiplier = Unpack(o.Find(x => x.groundEmissionMultiplier)); - m_SpaceRotation = Unpack(o.Find(x => x.spaceRotation)); - m_SpaceEmissionTexture = Unpack(o.Find(x => x.spaceEmissionTexture)); - m_SpaceEmissionMultiplier = Unpack(o.Find(x => x.spaceEmissionMultiplier)); - - m_AirMaximumAltitude = Unpack(o.Find(x => x.airMaximumAltitude)); - m_AirDensityR = Unpack(o.Find(x => x.airDensityR)); - m_AirDensityG = Unpack(o.Find(x => x.airDensityG)); - m_AirDensityB = Unpack(o.Find(x => x.airDensityB)); - m_AirTint = Unpack(o.Find(x => x.airTint)); - - m_AerosolMaximumAltitude = Unpack(o.Find(x => x.aerosolMaximumAltitude)); - m_AerosolDensity = Unpack(o.Find(x => x.aerosolDensity)); - m_AerosolTint = Unpack(o.Find(x => x.aerosolTint)); - m_AerosolAnisotropy = Unpack(o.Find(x => x.aerosolAnisotropy)); - - m_ColorSaturation = Unpack(o.Find(x => x.colorSaturation)); - m_AlphaSaturation = Unpack(o.Find(x => x.alphaSaturation)); - m_AlphaMultiplier = Unpack(o.Find(x => x.alphaMultiplier)); - m_HorizonTint = Unpack(o.Find(x => x.horizonTint)); - m_ZenithTint = Unpack(o.Find(x => x.zenithTint)); - m_HorizonZenithShift = Unpack(o.Find(x => x.horizonZenithShift)); - - m_NumberOfBounces = Unpack(o.Find(x => x.numberOfBounces)); + m_SpaceRotation = Unpack(o.Find(x => x.spaceRotation)); + m_SpaceEmissionTexture = Unpack(o.Find(x => x.spaceEmissionTexture)); + m_SpaceEmissionMultiplier = Unpack(o.Find(x => x.spaceEmissionMultiplier)); + + m_AirMaximumAltitude = Unpack(o.Find(x => x.airMaximumAltitude)); + m_AirDensityR = Unpack(o.Find(x => x.airDensityR)); + m_AirDensityG = Unpack(o.Find(x => x.airDensityG)); + m_AirDensityB = Unpack(o.Find(x => x.airDensityB)); + m_AirTint = Unpack(o.Find(x => x.airTint)); + + m_AerosolMaximumAltitude = Unpack(o.Find(x => x.aerosolMaximumAltitude)); + m_AerosolDensity = Unpack(o.Find(x => x.aerosolDensity)); + m_AerosolTint = Unpack(o.Find(x => x.aerosolTint)); + m_AerosolAnisotropy = Unpack(o.Find(x => x.aerosolAnisotropy)); + + m_ColorSaturation = Unpack(o.Find(x => x.colorSaturation)); + m_AlphaSaturation = Unpack(o.Find(x => x.alphaSaturation)); + m_AlphaMultiplier = Unpack(o.Find(x => x.alphaMultiplier)); + m_HorizonTint = Unpack(o.Find(x => x.horizonTint)); + m_ZenithTint = Unpack(o.Find(x => x.zenithTint)); + m_HorizonZenithShift = Unpack(o.Find(x => x.horizonZenithShift)); + + m_NumberOfBounces = Unpack(o.Find(x => x.numberOfBounces)); } public override void OnInspectorGUI() diff --git a/com.unity.render-pipelines.high-definition/Editor/Sky/SkySettingsEditor.cs b/com.unity.render-pipelines.high-definition/Editor/Sky/SkySettingsEditor.cs index ec85a3d67d6..3690fd6aa27 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Sky/SkySettingsEditor.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Sky/SkySettingsEditor.cs @@ -45,10 +45,10 @@ protected enum SkySettingsUIElement /// protected bool m_EnableLuxIntensityMode = false; - GUIContent[] m_IntensityModes = { new GUIContent("Exposure"), new GUIContent("Multiplier"), new GUIContent("Lux") }; - int[] m_IntensityModeValues = { (int)SkyIntensityMode.Exposure, (int)SkyIntensityMode.Multiplier, (int)SkyIntensityMode.Lux }; - GUIContent[] m_IntensityModesNoLux = { new GUIContent("Exposure"), new GUIContent("Multiplier") }; - int[] m_IntensityModeValuesNoLux = { (int)SkyIntensityMode.Exposure, (int)SkyIntensityMode.Multiplier }; + GUIContent[] m_IntensityModes = { new GUIContent("Exposure"), new GUIContent("Multiplier"), new GUIContent("Lux") }; + int[] m_IntensityModeValues = { (int)SkyIntensityMode.Exposure, (int)SkyIntensityMode.Multiplier, (int)SkyIntensityMode.Lux }; + GUIContent[] m_IntensityModesNoLux = { new GUIContent("Exposure"), new GUIContent("Multiplier") }; + int[] m_IntensityModeValuesNoLux = { (int)SkyIntensityMode.Exposure, (int)SkyIntensityMode.Multiplier }; /// /// OnEnable implementation. diff --git a/com.unity.render-pipelines.high-definition/Editor/Upgraders/UpgradeStandardShaderMaterials.cs b/com.unity.render-pipelines.high-definition/Editor/Upgraders/UpgradeStandardShaderMaterials.cs index 94eef1fd9eb..22c824fa381 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Upgraders/UpgradeStandardShaderMaterials.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Upgraders/UpgradeStandardShaderMaterials.cs @@ -42,7 +42,7 @@ internal static void UpgradeMaterialsSelection() static void UpgradeSceneTerrainsToHighDefinitionTerrains(MenuCommand menuCommand) { var LegacyDefaultTerrainMat = AssetDatabase.GetBuiltinExtraResource("Default-Terrain-Standard.mat"); - var HDRPTerrainMat = AssetDatabase.LoadAssetAtPath("Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipelineResources/Material/DefaultHDTerrainMaterial.mat"); + var HDRPTerrainMat = AssetDatabase.LoadAssetAtPath("Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipelineResources/Material/DefaultHDTerrainMaterial.mat"); var terrainArray = UnityEngine.GameObject.FindObjectsOfType(); if (terrainArray.Length == 0) diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXAbstractDistortionOutput.cs b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXAbstractDistortionOutput.cs index 6693d98c78a..f3c4f464ade 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXAbstractDistortionOutput.cs +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXAbstractDistortionOutput.cs @@ -9,7 +9,7 @@ namespace UnityEditor.VFX { abstract class VFXAbstractDistortionOutput : VFXAbstractParticleOutput { - public VFXAbstractDistortionOutput(bool strip = false) : base(strip) {} + public VFXAbstractDistortionOutput(bool strip = false) : base(strip) { } public enum DistortionMode { diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXAbstractParticleHDRPLitOutput.cs b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXAbstractParticleHDRPLitOutput.cs index 04418c633d5..5abb95c4d15 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXAbstractParticleHDRPLitOutput.cs +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXAbstractParticleHDRPLitOutput.cs @@ -92,9 +92,9 @@ public enum BaseColorMapMode [VFXSetting(VFXSettingAttribute.VisibleFlags.InInspector), SerializeField, Tooltip("When enabled, particles can be affected by environment light set in the global volume profile.")] protected bool enableEnvLight = true; - protected VFXAbstractParticleHDRPLitOutput(bool strip = false) : base(strip) {} + protected VFXAbstractParticleHDRPLitOutput(bool strip = false) : base(strip) { } - protected virtual bool allowTextures { get { return GetOrRefreshShaderGraphObject() == null; }} + protected virtual bool allowTextures { get { return GetOrRefreshShaderGraphObject() == null; } } public class HDRPLitInputProperties { diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDistortionMeshOutput.cs b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDistortionMeshOutput.cs index 2efdd5207fc..69a046f147a 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDistortionMeshOutput.cs +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDistortionMeshOutput.cs @@ -12,7 +12,7 @@ class VFXDistortionMeshOutput : VFXAbstractDistortionOutput public override string codeGeneratorTemplate { get { return RenderPipeTemplate("VFXParticleDistortionMesh"); } } public override VFXTaskType taskType { get { return VFXTaskType.ParticleMeshOutput; } } public override bool supportsUV { get { return true; } } - public override CullMode defaultCullMode { get { return CullMode.Back; } } + public override CullMode defaultCullMode { get { return CullMode.Back; } } public override IEnumerable attributes { diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDistortionPlanarPrimitiveOutput.cs b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDistortionPlanarPrimitiveOutput.cs index ade45285ec6..eaf73b13f35 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDistortionPlanarPrimitiveOutput.cs +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDistortionPlanarPrimitiveOutput.cs @@ -14,7 +14,7 @@ class VFXDistortionPlanarPrimitiveOutput : VFXAbstractDistortionOutput //[VFXSetting] // tmp dont expose as settings atm public bool useGeometryShader = false; - public override string name { get { return "Output Particle Distortion " + primitiveType.ToString();; } } + public override string name { get { return "Output Particle Distortion " + primitiveType.ToString(); ; } } public override string codeGeneratorTemplate { get { return RenderPipeTemplate("VFXParticleDistortionPlanarPrimitive"); } } public override VFXTaskType taskType { diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDistortionQuadStripOutput.cs b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDistortionQuadStripOutput.cs index f20280723ae..1f74fb70ab5 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDistortionQuadStripOutput.cs +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDistortionQuadStripOutput.cs @@ -17,7 +17,7 @@ class VFXDistortionQuadStripOutput : VFXAbstractDistortionOutput [VFXSetting(VFXSettingAttribute.VisibleFlags.InInspector), SerializeField, Tooltip("When enabled, the axisZ attribute is used to orient the strip instead of facing the Camera.")] private bool UseCustomZAxis = false; - VFXDistortionQuadStripOutput() : base(true) {} + VFXDistortionQuadStripOutput() : base(true) { } public override string name { get { return "Output Strip Distortion Quad"; } } public override string codeGeneratorTemplate { get { return RenderPipeTemplate("VFXParticleDistortionPlanarPrimitive"); } } diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXLitQuadStripOutput.cs b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXLitQuadStripOutput.cs index d603285fb27..a508057b28a 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXLitQuadStripOutput.cs +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXLitQuadStripOutput.cs @@ -8,7 +8,7 @@ namespace UnityEditor.VFX [VFXInfo(experimental = true)] class VFXLitQuadStripOutput : VFXAbstractParticleHDRPLitOutput { - protected VFXLitQuadStripOutput() : base(true) {} // strips + protected VFXLitQuadStripOutput() : base(true) { } // strips public override string name { get { return "Output ParticleStrip Lit Quad"; } } public override string codeGeneratorTemplate { get { return RenderPipeTemplate("VFXParticleLitPlanarPrimitive"); } } diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/VFXHDRPBinder.cs b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/VFXHDRPBinder.cs index f3545274799..588581298f1 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/VFXHDRPBinder.cs +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/VFXHDRPBinder.cs @@ -8,11 +8,11 @@ namespace UnityEditor.VFX.HDRP { class VFXHDRPBinder : VFXSRPBinder { - public override string templatePath { get { return "Packages/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders"; } } - public override string runtimePath { get { return "Packages/com.unity.render-pipelines.high-definition/Runtime/VFXGraph/Shaders"; } } + public override string templatePath { get { return "Packages/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders"; } } + public override string runtimePath { get { return "Packages/com.unity.render-pipelines.high-definition/Runtime/VFXGraph/Shaders"; } } - public override string SRPAssetTypeStr { get { return typeof(HDRenderPipelineAsset).Name; } } - public override Type SRPOutputDataType { get { return typeof(VFXHDRPSubOutput); } } + public override string SRPAssetTypeStr { get { return typeof(HDRenderPipelineAsset).Name; } } + public override Type SRPOutputDataType { get { return typeof(VFXHDRPSubOutput); } } public override void SetupMaterial(Material mat) { @@ -21,7 +21,7 @@ public override void SetupMaterial(Material mat) HDShaderUtils.ResetMaterialKeywords(mat); } catch (ArgumentException) // Silently catch the 'Unknown shader' in case of non HDRP shaders - {} + { } } } } diff --git a/com.unity.render-pipelines.high-definition/Editor/Wizard/HDWizard.UIElement.cs b/com.unity.render-pipelines.high-definition/Editor/Wizard/HDWizard.UIElement.cs index 5dad79d8f25..d54293e3c4e 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Wizard/HDWizard.UIElement.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Wizard/HDWizard.UIElement.cs @@ -164,8 +164,8 @@ void CreateOrLoad(Action onCancel, Action onObjectChanged) class ToolbarRadio : UIElements.Toolbar, INotifyValueChanged { - public new class UxmlFactory : UxmlFactory {} - public new class UxmlTraits : Button.UxmlTraits {} + public new class UxmlFactory : UxmlFactory { } + public new class UxmlTraits : Button.UxmlTraits { } List radios = new List(); @@ -228,7 +228,7 @@ public void AddRadios((string label, string tooltip)[] tabs) { radios[radioLength - 1].RemoveFromClassList("LastRadio"); } - foreach (var(label, tooltip) in tabs) + foreach (var (label, tooltip) in tabs) AddRadio(label, tooltip); radios[radioLength - 1].AddToClassList("LastRadio"); @@ -302,7 +302,7 @@ public virtual void CheckUpdate() class HiddableUpdatableContainer : VisualElementUpdatable { - public HiddableUpdatableContainer(Func tester, bool haveFixer = false) : base(tester, haveFixer) {} + public HiddableUpdatableContainer(Func tester, bool haveFixer = false) : base(tester, haveFixer) { } public override void CheckUpdate() { @@ -513,7 +513,7 @@ public override void CheckUpdate() } protected override void UpdateDisplay(bool statusOK, bool haveFixer) - {} + { } } #endregion diff --git a/com.unity.render-pipelines.high-definition/Runtime/Compositor/CompositionLayer.cs b/com.unity.render-pipelines.high-definition/Runtime/Compositor/CompositionLayer.cs index eb6f8325536..9762e12a2d6 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Compositor/CompositionLayer.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Compositor/CompositionLayer.cs @@ -193,11 +193,11 @@ static float EnumToScale(ResolutionScale scale) static T AddComponent(GameObject go) where T : Component { - #if UNITY_EDITOR +#if UNITY_EDITOR return UnityEditor.Undo.AddComponent(go); - #else +#else return go.AddComponent(); - #endif +#endif } public int pixelWidth diff --git a/com.unity.render-pipelines.high-definition/Runtime/Core/Textures/TextureCache.cs b/com.unity.render-pipelines.high-definition/Runtime/Core/Textures/TextureCache.cs index 2b9006d999e..24103870e8c 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Core/Textures/TextureCache.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Core/Textures/TextureCache.cs @@ -96,7 +96,7 @@ protected bool AllocTextureArray(int numTextures) // Function that allows us to do the mapping between a texture value and an identifier public uint GetTextureHash(Texture texture) { - uint textureHash = texture.updateCount; + uint textureHash = texture.updateCount; // For baked probes in the editor we need to factor in the actual hash of texture because we can't increment the update count of a texture that's baked on the disk. // This code leaks logic from reflection probe baking into the texture cache which is not good... TODO: Find a way to do that outside of the texture cache. #if UNITY_EDITOR @@ -123,7 +123,7 @@ public int ReserveSlice(Texture texture, out bool needUpdate) if (m_LocatorInSliceDictionnary.TryGetValue(texId, out sliceIndex)) { // Compute the new hash of the texture - var textureHash = GetTextureHash(texture); + var textureHash = GetTextureHash(texture); // We need to update the texture if the hash does not match the one in the slice needUpdate |= (m_SliceArray[sliceIndex].sliceEntryHash != textureHash); diff --git a/com.unity.render-pipelines.high-definition/Runtime/Core/Textures/TextureCache2D.cs b/com.unity.render-pipelines.high-definition/Runtime/Core/Textures/TextureCache2D.cs index 1f75e99841b..4b8306f74b4 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Core/Textures/TextureCache2D.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Core/Textures/TextureCache2D.cs @@ -28,7 +28,7 @@ override public bool IsCreated() protected override bool TransferToSlice(CommandBuffer cmd, int sliceIndex, Texture[] textureArray) { // Make sure the array is not null or empty and that the first texture is a render-texture or a texture2D - if (textureArray == null || textureArray.Length == 0 && (!(textureArray[0] is RenderTexture) && !(textureArray[0] is Texture2D))) + if (textureArray == null || textureArray.Length == 0 && (!(textureArray[0] is RenderTexture) && !(textureArray[0] is Texture2D))) { return false; } diff --git a/com.unity.render-pipelines.high-definition/Runtime/Core/Utilities/GeometryUtils.cs b/com.unity.render-pipelines.high-definition/Runtime/Core/Utilities/GeometryUtils.cs index 555eb2dc7a7..93ee100ef6c 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Core/Utilities/GeometryUtils.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Core/Utilities/GeometryUtils.cs @@ -71,11 +71,11 @@ struct OrientedBBox // 3 x float4 = 48 bytes. // TODO: pack the axes into 16-bit UNORM per channel, and consider a quaternionic representation. public Vector3 right; - public float extentX; + public float extentX; public Vector3 up; - public float extentY; + public float extentY; public Vector3 center; - public float extentZ; + public float extentZ; public Vector3 forward { get { return Vector3.Cross(up, right); } } @@ -108,7 +108,7 @@ public unsafe static bool Overlap(OrientedBBox obb, Frustum frustum, int numPlan for (int i = 0; overlap && i < numPlanes; i++) { Vector3 n = frustum.planes[i].normal; - float d = frustum.planes[i].distance; + float d = frustum.planes[i].distance; // Max projection of the half-diagonal onto the normal (always positive). float maxHalfDiagProj = obb.extentX * Mathf.Abs(Vector3.Dot(n, obb.right)) @@ -133,11 +133,11 @@ public unsafe static bool Overlap(OrientedBBox obb, Frustum frustum, int numPlan // We can exploit the symmetry of the box by only testing against 3 planes rather than 6. var planes = stackalloc Plane[3]; - planes[0].normal = obb.right; + planes[0].normal = obb.right; planes[0].distance = obb.extentX; - planes[1].normal = obb.up; + planes[1].normal = obb.up; planes[1].distance = obb.extentY; - planes[2].normal = obb.forward; + planes[2].normal = obb.forward; planes[2].distance = obb.extentZ; for (int i = 0; overlap && i < 3; i++) diff --git a/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.cs b/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.cs index ad688af6b0a..3aaece1f6c8 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.cs @@ -1426,7 +1426,7 @@ void RegisterLightingDebug() list.Add(container); } - list.Add(new DebugUI.BoolField { displayName = "Display Cookie Atlas", getter = () => data.lightingDebugSettings.displayCookieAtlas, setter = value => data.lightingDebugSettings.displayCookieAtlas = value, onValueChanged = RefreshLightingDebug}); + list.Add(new DebugUI.BoolField { displayName = "Display Cookie Atlas", getter = () => data.lightingDebugSettings.displayCookieAtlas, setter = value => data.lightingDebugSettings.displayCookieAtlas = value, onValueChanged = RefreshLightingDebug }); if (data.lightingDebugSettings.displayCookieAtlas) { list.Add(new DebugUI.Container @@ -1439,7 +1439,7 @@ void RegisterLightingDebug() }); } - list.Add(new DebugUI.BoolField { displayName = "Display Planar Reflection Atlas", getter = () => data.lightingDebugSettings.displayPlanarReflectionProbeAtlas, setter = value => data.lightingDebugSettings.displayPlanarReflectionProbeAtlas = value, onValueChanged = RefreshLightingDebug}); + list.Add(new DebugUI.BoolField { displayName = "Display Planar Reflection Atlas", getter = () => data.lightingDebugSettings.displayPlanarReflectionProbeAtlas, setter = value => data.lightingDebugSettings.displayPlanarReflectionProbeAtlas = value, onValueChanged = RefreshLightingDebug }); if (data.lightingDebugSettings.displayPlanarReflectionProbeAtlas) { list.Add(new DebugUI.Container @@ -1452,7 +1452,7 @@ void RegisterLightingDebug() }); } - list.Add(new DebugUI.FloatField { displayName = "Debug Overlay Screen Ratio", getter = () => data.debugOverlayRatio, setter = v => data.debugOverlayRatio = v, min = () => 0.1f, max = () => 1f}); + list.Add(new DebugUI.FloatField { displayName = "Debug Overlay Screen Ratio", getter = () => data.debugOverlayRatio, setter = v => data.debugOverlayRatio = v, min = () => 0.1f, max = () => 1f }); m_DebugLightingItems = list.ToArray(); var panel = DebugManager.instance.GetPanel(k_PanelLighting, true); @@ -1531,7 +1531,7 @@ DebugUI.Widget makeWidget(string name, VolumeParameter param) hdr = p.hdr, showAlpha = p.showAlpha, getter = () => p.value, - setter = _ => {} + setter = _ => { } }; } @@ -1542,7 +1542,7 @@ DebugUI.Widget makeWidget(string name, VolumeParameter param) { displayName = name, getter = () => p.value, - setter = _ => {} + setter = _ => { } }; } @@ -1560,7 +1560,8 @@ DebugUI.Widget makeWidget(string name, VolumeParameter param) return new DebugUI.Value() { displayName = name, - getter = () => { + getter = () => + { var value = property.GetValue(param); if (value == null || value.Equals(null)) return "None"; @@ -1574,7 +1575,8 @@ DebugUI.Widget makeWidget(string name, VolumeParameter param) return new DebugUI.Value() { displayName = name, - getter = () => { + getter = () => + { var value = property.GetValue(param); return value == null ? "None" : value.ToString(); } @@ -1628,7 +1630,8 @@ DebugUI.Widget makeWidget(string name, VolumeParameter param) row.children.Add(new DebugUI.Value() { displayName = volume.name + " (" + profile.name + ")", - getter = () => { + getter = () => + { var scope = volume.isGlobal ? "Global" : "Local"; var weight = data.volumeDebugSettings.GetVolumeWeight(volume); return scope + " (" + (weight * 100f) + "%)"; @@ -1773,7 +1776,7 @@ void RegisterRenderingDebug() } }); - widgetList.Add(new DebugUI.BoolField { displayName = "False Color Mode", getter = () => data.falseColorDebugSettings.falseColor, setter = value => data.falseColorDebugSettings.falseColor = value, onValueChanged = RefreshRenderingDebug }); + widgetList.Add(new DebugUI.BoolField { displayName = "False Color Mode", getter = () => data.falseColorDebugSettings.falseColor, setter = value => data.falseColorDebugSettings.falseColor = value, onValueChanged = RefreshRenderingDebug }); if (data.falseColorDebugSettings.falseColor) { widgetList.Add(new DebugUI.Container @@ -1961,7 +1964,7 @@ internal void UpdateCameraFreezeOptions() internal bool DebugHideSky(HDCamera hdCamera) { return (IsMatcapViewEnabled(hdCamera) || - GetDebugLightingMode() == DebugLightingMode.DiffuseLighting || + GetDebugLightingMode() == DebugLightingMode.DiffuseLighting || GetDebugLightingMode() == DebugLightingMode.SpecularLighting || GetDebugLightingMode() == DebugLightingMode.DirectDiffuseLighting || GetDebugLightingMode() == DebugLightingMode.DirectSpecularLighting || diff --git a/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugLightVolumes.cs b/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugLightVolumes.cs index 0bfa8fc0447..4d994f98497 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugLightVolumes.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugLightVolumes.cs @@ -52,15 +52,15 @@ public void ReleaseData() public struct RenderLightVolumesParameters { - public HDCamera hdCamera; - public CullingResults cullResults; - public Material debugLightVolumeMaterial; - public ComputeShader debugLightVolumeCS; - public int debugLightVolumeKernel; - public int maxDebugLightCount; - public float borderRadius; - public Texture2D colorGradientTexture; - public bool lightOverlapEnabled; + public HDCamera hdCamera; + public CullingResults cullResults; + public Material debugLightVolumeMaterial; + public ComputeShader debugLightVolumeCS; + public int debugLightVolumeKernel; + public int maxDebugLightCount; + public float borderRadius; + public Texture2D colorGradientTexture; + public bool lightOverlapEnabled; } public RenderLightVolumesParameters PrepareLightVolumeParameters(HDCamera hdCamera, LightingDebugSettings lightDebugSettings, CullingResults cullResults) @@ -82,15 +82,15 @@ public RenderLightVolumesParameters PrepareLightVolumeParameters(HDCamera hdCame return parameters; } - public static void RenderLightVolumes(CommandBuffer cmd, + public static void RenderLightVolumes(CommandBuffer cmd, in RenderLightVolumesParameters parameters, - RenderTargetIdentifier[] accumulationMRT, // [0] = m_LightCountBuffer, [1] m_ColorAccumulationBuffer - RTHandle lightCountBuffer, - RTHandle colorAccumulationBuffer, - RTHandle debugLightVolumesTexture, - RTHandle depthBuffer, - RTHandle destination, - MaterialPropertyBlock mpb) + RenderTargetIdentifier[] accumulationMRT, // [0] = m_LightCountBuffer, [1] m_ColorAccumulationBuffer + RTHandle lightCountBuffer, + RTHandle colorAccumulationBuffer, + RTHandle debugLightVolumesTexture, + RTHandle depthBuffer, + RTHandle destination, + MaterialPropertyBlock mpb) { if (parameters.lightOverlapEnabled) { diff --git a/com.unity.render-pipelines.high-definition/Runtime/Debug/LightingDebug.cs b/com.unity.render-pipelines.high-definition/Runtime/Debug/LightingDebug.cs index aa9a7385892..12c1a759f41 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Debug/LightingDebug.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Debug/LightingDebug.cs @@ -249,19 +249,19 @@ public bool IsDebugDisplayEnabled() /// Current Light Filtering. public DebugLightFilterMode debugLightFilterMode = DebugLightFilterMode.None; /// Current Full Screen Lighting debug mode. - public DebugLightingMode debugLightingMode = DebugLightingMode.None; + public DebugLightingMode debugLightingMode = DebugLightingMode.None; /// True if light layers visualization is enabled. - public bool debugLightLayers = false; + public bool debugLightLayers = false; /// Current Light Layers Filtering mode. - public DebugLightLayersMask debugLightLayersFilterMask = (DebugLightLayersMask)(-1); // Select Everything by default + public DebugLightLayersMask debugLightLayersFilterMask = (DebugLightLayersMask)(-1); // Select Everything by default /// True if light layers visualization uses light layers of the selected light. - public bool debugSelectionLightLayers = false; + public bool debugSelectionLightLayers = false; /// True if light layers visualization uses shadow layers of the selected light. - public bool debugSelectionShadowLayers = false; + public bool debugSelectionShadowLayers = false; /// Rendering Layers Debug Colors. - public Vector4[] debugRenderingLayersColors = GetDefaultRenderingLayersColorPalette(); + public Vector4[] debugRenderingLayersColors = GetDefaultRenderingLayersColorPalette(); /// Current Shadow Maps debug mode. - public ShadowMapDebugMode shadowDebugMode = ShadowMapDebugMode.None; + public ShadowMapDebugMode shadowDebugMode = ShadowMapDebugMode.None; /// Current Probe Volume Debug Mode. [SerializeField] internal ProbeVolumeDebugMode probeVolumeDebugMode = ProbeVolumeDebugMode.None; /// Current Probe Volume Atlas Slicing Mode. @@ -271,95 +271,95 @@ public bool IsDebugDisplayEnabled() /// The maximum display threshold for atlas slices. [SerializeField] internal float probeVolumeMaxValue = 1.0f; /// True if Shadow Map debug mode should be displayed for the currently selected light. - public bool shadowDebugUseSelection = false; + public bool shadowDebugUseSelection = false; /// Index in the list of currently visible lights of the shadow map to display. - public uint shadowMapIndex = 0; + public uint shadowMapIndex = 0; /// Shadow Map debug display visual remapping minimum value. - public float shadowMinValue = 0.0f; + public float shadowMinValue = 0.0f; /// Shadow Map debug display visual remapping maximum value. - public float shadowMaxValue = 1.0f; + public float shadowMaxValue = 1.0f; /// Use this value to force a rescale of all shadow atlases. - public float shadowResolutionScaleFactor = 1.0f; + public float shadowResolutionScaleFactor = 1.0f; /// Clear shadow atlases each frame. - public bool clearShadowAtlas = false; + public bool clearShadowAtlas = false; /// Override smoothness of the whole scene for lighting debug. - public bool overrideSmoothness = false; + public bool overrideSmoothness = false; /// Value used when overriding smoothness. - public float overrideSmoothnessValue = 0.5f; + public float overrideSmoothnessValue = 0.5f; /// Override albedo of the whole scene for lighting debug. - public bool overrideAlbedo = false; + public bool overrideAlbedo = false; /// Color used when overriding albedo. - public Color overrideAlbedoValue = new Color(0.5f, 0.5f, 0.5f); + public Color overrideAlbedoValue = new Color(0.5f, 0.5f, 0.5f); /// Override normal of the whole scene with object normals for lighting debug. - public bool overrideNormal = false; + public bool overrideNormal = false; /// Override ambient occlusion of the whole scene for lighting debug. - public bool overrideAmbientOcclusion = false; + public bool overrideAmbientOcclusion = false; /// Value used when overriding ambient occlusion. - public float overrideAmbientOcclusionValue = 1.0f; + public float overrideAmbientOcclusionValue = 1.0f; /// Override specular color of the whole scene for lighting debug. - public bool overrideSpecularColor = false; + public bool overrideSpecularColor = false; /// Color used when overriding specular color. - public Color overrideSpecularColorValue = new Color(1.0f, 1.0f, 1.0f); + public Color overrideSpecularColorValue = new Color(1.0f, 1.0f, 1.0f); /// Override emissive color of the whole scene for lighting debug. - public bool overrideEmissiveColor = false; + public bool overrideEmissiveColor = false; /// Color used when overriding emissive color. - public Color overrideEmissiveColorValue = new Color(1.0f, 1.0f, 1.0f); + public Color overrideEmissiveColorValue = new Color(1.0f, 1.0f, 1.0f); /// Display sky reflection cubemap as an overlay. - public bool displaySkyReflection = false; + public bool displaySkyReflection = false; /// Mip map of the displayed sky reflection. - public float skyReflectionMipmap = 0.0f; + public float skyReflectionMipmap = 0.0f; /// Display lights bounding volumes as a transparent overlay in the scene. - public bool displayLightVolumes = false; + public bool displayLightVolumes = false; /// Type of light bounding volumes to display. - public LightVolumeDebug lightVolumeDebugByCategory = LightVolumeDebug.Gradient; + public LightVolumeDebug lightVolumeDebugByCategory = LightVolumeDebug.Gradient; /// Maximum number of lights against which the light overdraw gradient is displayed. - public uint maxDebugLightCount = 24; + public uint maxDebugLightCount = 24; /// Exposure debug mode. - public ExposureDebugMode exposureDebugMode = ExposureDebugMode.None; + public ExposureDebugMode exposureDebugMode = ExposureDebugMode.None; /// Exposure compensation to apply on current scene exposure. - public float debugExposure = 0.0f; + public float debugExposure = 0.0f; /// Obsolete, please use the lens attenuation mode in HDRP Default Settings. [Obsolete("Please use the lens attenuation mode in HDRP Default Settings", true)] - public float debugLensAttenuation = 0.65f; + public float debugLensAttenuation = 0.65f; /// Whether to show tonemap curve in the histogram debug view or not. - public bool showTonemapCurveAlongHistogramView = true; + public bool showTonemapCurveAlongHistogramView = true; /// Whether to center the histogram debug view around the middle-grey point or not. - public bool centerHistogramAroundMiddleGrey = false; + public bool centerHistogramAroundMiddleGrey = false; /// Whether to show tonemap curve in the histogram debug view or not. - public bool displayFinalImageHistogramAsRGB = false; + public bool displayFinalImageHistogramAsRGB = false; /// Whether to show the only the mask in the picture in picture. If unchecked, the mask view is weighted by the scene color. - public bool displayMaskOnly = false; + public bool displayMaskOnly = false; /// Display the light cookies atlas. - public bool displayCookieAtlas = false; + public bool displayCookieAtlas = false; /// Display the light cookies cubemap array. - public bool displayCookieCubeArray = false; + public bool displayCookieCubeArray = false; /// Index of the light cubemap to display. - public uint cubeArraySliceIndex = 0; + public uint cubeArraySliceIndex = 0; /// Mip level of the cookie cubemap display. - public uint cookieAtlasMipLevel = 0; + public uint cookieAtlasMipLevel = 0; /// Clear cookie atlas each frame. - public bool clearCookieAtlas = false; + public bool clearCookieAtlas = false; /// Display the planar reflection atlas. - public bool displayPlanarReflectionProbeAtlas = false; + public bool displayPlanarReflectionProbeAtlas = false; /// Mip level of the planar reflection atlas display. - public uint planarReflectionProbeMipLevel = 0; + public uint planarReflectionProbeMipLevel = 0; /// Clear planar reflection atlas each frame. - public bool clearPlanarReflectionProbeAtlas = false; + public bool clearPlanarReflectionProbeAtlas = false; /// True if punctual lights should be displayed in the scene. - public bool showPunctualLight = true; + public bool showPunctualLight = true; /// True if directional lights should be displayed in the scene. - public bool showDirectionalLight = true; + public bool showDirectionalLight = true; /// True if area lights should be displayed in the scene. - public bool showAreaLight = true; + public bool showAreaLight = true; /// True if reflection probes lights should be displayed in the scene. - public bool showReflectionProbe = true; + public bool showReflectionProbe = true; /// Tile and Cluster debug mode. public TileClusterDebug tileClusterDebug = TileClusterDebug.None; diff --git a/com.unity.render-pipelines.high-definition/Runtime/Debug/MaterialDebug.cs b/com.unity.render-pipelines.high-definition/Runtime/Debug/MaterialDebug.cs index af61476f154..1c1fd1074d1 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Debug/MaterialDebug.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Debug/MaterialDebug.cs @@ -440,7 +440,7 @@ static void BuildDebugRepresentation() /// Color for displaying materials using a true metallic color. public Color materialValidateTrueMetalColor = new Color(1.0f, 1.0f, 0.0f); /// Enable display of materials using a true metallic value. - public bool materialValidateTrueMetal = false; + public bool materialValidateTrueMetal = false; /// /// Current Debug View Material. @@ -490,11 +490,11 @@ internal set // The index stored in this buffer could either be // - a gBufferIndex (always stored in _DebugViewMaterialArray[1] as only one supported) // - a property index which is different for each kind of material even if reflecting the same thing (see MaterialSharedProperty) - int[] m_DebugViewMaterial = new int[kDebugViewMaterialBufferLength + 1]; // No enum there because everything is generated from materials. - int m_DebugViewEngine = 0; // No enum there because everything is generated from BSDFData - DebugViewVarying m_DebugViewVarying = DebugViewVarying.None; - DebugViewProperties m_DebugViewProperties = DebugViewProperties.None; - int m_DebugViewGBuffer = 0; // Can't use GBuffer enum here because the values are actually split between this enum and values from Lit.BSDFData + int[] m_DebugViewMaterial = new int[kDebugViewMaterialBufferLength + 1]; // No enum there because everything is generated from materials. + int m_DebugViewEngine = 0; // No enum there because everything is generated from BSDFData + DebugViewVarying m_DebugViewVarying = DebugViewVarying.None; + DebugViewProperties m_DebugViewProperties = DebugViewProperties.None; + int m_DebugViewGBuffer = 0; // Can't use GBuffer enum here because the values are actually split between this enum and values from Lit.BSDFData internal int materialEnumIndex; @@ -616,7 +616,7 @@ public void SetDebugViewGBuffer(int value) /// True if Material debug is enabled. public bool IsDebugViewMaterialEnabled() { - int size = m_DebugViewMaterial ? [0] ?? 0; + int size = m_DebugViewMaterial?[0] ?? 0; bool enabled = false; for (int i = 1; i <= size; ++i) { diff --git a/com.unity.render-pipelines.high-definition/Runtime/Debug/RayCountManager.cs b/com.unity.render-pipelines.high-definition/Runtime/Debug/RayCountManager.cs index 5005ce6544b..c9842a91c8c 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Debug/RayCountManager.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Debug/RayCountManager.cs @@ -254,7 +254,7 @@ public uint GetRaysPerFrame(RayCountValues rayCountValue) } else { - while (m_RayCountReadbacks.Peek().done || m_RayCountReadbacks.Peek().hasError == true) + while (m_RayCountReadbacks.Peek().done || m_RayCountReadbacks.Peek().hasError == true) { // If this has an error, just skip it if (!m_RayCountReadbacks.Peek().hasError) diff --git a/com.unity.render-pipelines.high-definition/Runtime/Debug/VolumeDebug.cs b/com.unity.render-pipelines.high-definition/Runtime/Debug/VolumeDebug.cs index 4cd9bd370be..fa247596a98 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Debug/VolumeDebug.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Debug/VolumeDebug.cs @@ -110,7 +110,7 @@ public Vector3 selectedCameraPosition } /// Type of the current component to debug. - public Type selectedComponentType + public Type selectedComponentType { get { return componentTypes[selectedComponent - 1]; } set @@ -150,7 +150,7 @@ static public string ComponentDisplayName(Type component) return component.Name; } - internal static List cameras {get; private set; } = new List(); + internal static List cameras { get; private set; } = new List(); internal static void RegisterCamera(HDAdditionalCameraData camera) { @@ -251,7 +251,7 @@ public Volume[] GetVolumes() for (int j = 0; j < fields.Length; j++) { - var param = GetParameter(component, fields[j]);; + var param = GetParameter(component, fields[j]); ; states[i, j] = param.overrideState ? param : null; } } diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/AtmosphericScattering/AtmosphericScattering.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/AtmosphericScattering/AtmosphericScattering.cs index 3b17014f4ed..e3fd5c85d7e 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/AtmosphericScattering/AtmosphericScattering.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/AtmosphericScattering/AtmosphericScattering.cs @@ -7,21 +7,21 @@ namespace UnityEngine.Rendering.HighDefinition abstract class AtmosphericScattering : VolumeComponent { // Fog Color - public FogColorParameter colorMode = new FogColorParameter(FogColorMode.SkyColor); + public FogColorParameter colorMode = new FogColorParameter(FogColorMode.SkyColor); [Tooltip("Specifies the constant color of the fog.")] - public ColorParameter color = new ColorParameter(Color.grey, hdr: true, showAlpha: false, showEyeDropper: true); + public ColorParameter color = new ColorParameter(Color.grey, hdr: true, showAlpha: false, showEyeDropper: true); [Tooltip("Specifies the tint of the fog.")] - public ColorParameter tint = new ColorParameter(Color.white, hdr: true, showAlpha: false, showEyeDropper: true); + public ColorParameter tint = new ColorParameter(Color.white, hdr: true, showAlpha: false, showEyeDropper: true); [Tooltip("Controls the overall density of the fog. Acts as a global multiplier.")] public ClampedFloatParameter density = new ClampedFloatParameter(1.0f, 0.0f, 1.0f); [Tooltip("Sets the maximum fog distance HDRP uses when it shades the skybox or the Far Clipping Plane of the Camera.")] - public MinFloatParameter maxFogDistance = new MinFloatParameter(5000.0f, 0.0f); + public MinFloatParameter maxFogDistance = new MinFloatParameter(5000.0f, 0.0f); [Tooltip("Controls the maximum mip map HDRP uses for mip fog (0 is the lowest mip and 1 is the highest mip).")] public ClampedFloatParameter mipFogMaxMip = new ClampedFloatParameter(0.5f, 0.0f, 1.0f); [Tooltip("Sets the distance at which HDRP uses the minimum mip image of the blurred sky texture as the fog color.")] - public MinFloatParameter mipFogNear = new MinFloatParameter(0.0f, 0.0f); + public MinFloatParameter mipFogNear = new MinFloatParameter(0.0f, 0.0f); [Tooltip("Sets the distance at which HDRP uses the maximum mip image of the blurred sky texture as the fog color.")] - public MinFloatParameter mipFogFar = new MinFloatParameter(1000.0f, 0.0f); + public MinFloatParameter mipFogFar = new MinFloatParameter(1000.0f, 0.0f); internal abstract void PushShaderParameters(HDCamera hdCamera, CommandBuffer cmd); } diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/AtmosphericScattering/ExponentialFog.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/AtmosphericScattering/ExponentialFog.cs index 4e76fb8495a..1242138aa61 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/AtmosphericScattering/ExponentialFog.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/AtmosphericScattering/ExponentialFog.cs @@ -7,11 +7,11 @@ class ExponentialFog : AtmosphericScattering private readonly static int m_ExpFogParam = Shader.PropertyToID("_ExpFogParameters"); [Tooltip("Sets the distance from the Camera at which the fog reaches its maximum thickness.")] - public MinFloatParameter fogDistance = new MinFloatParameter(200.0f, 0.0f); + public MinFloatParameter fogDistance = new MinFloatParameter(200.0f, 0.0f); [Tooltip("Sets the height, in world space, at which HDRP begins to decrease the fog density from 1.0.")] - public FloatParameter fogBaseHeight = new FloatParameter(0.0f); + public FloatParameter fogBaseHeight = new FloatParameter(0.0f); [Tooltip("Controls the falloff of height fog attenuation, larger values result in sharper attenuation.")] - public ClampedFloatParameter fogHeightAttenuation = new ClampedFloatParameter(0.2f, 0.0f, 1.0f); + public ClampedFloatParameter fogHeightAttenuation = new ClampedFloatParameter(0.2f, 0.0f, 1.0f); internal override void PushShaderParameters(HDCamera hdCamera, CommandBuffer cmd) { diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/AtmosphericScattering/Fog.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/AtmosphericScattering/Fog.cs index 42825e703ab..b1764b704cf 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/AtmosphericScattering/Fog.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/AtmosphericScattering/Fog.cs @@ -218,7 +218,7 @@ void UpdateShaderVariablesGlobalCBFogParameters(ref ShaderVariablesGlobal cb, HD Color fogColor = (colorMode.value == FogColorMode.ConstantColor) ? color.value : tint.value; cb._FogColorMode = (float)colorMode.value; cb._FogColor = new Color(fogColor.r, fogColor.g, fogColor.b, 0.0f); - cb._MipFogParameters = new Vector4(mipFogNear.value, mipFogFar.value, mipFogMaxMip.value, 0.0f); + cb._MipFogParameters = new Vector4(mipFogNear.value, mipFogFar.value, mipFogMaxMip.value, 0.0f); DensityVolumeArtistParameters param = new DensityVolumeArtistParameters(albedo.value, meanFreePath.value, anisotropy.value); DensityVolumeEngineData data = param.ConvertToEngineData(); @@ -257,7 +257,7 @@ public enum FogColorMode sealed class FogTypeParameter : VolumeParameter { public FogTypeParameter(FogType value, bool overrideState = false) - : base(value, overrideState) {} + : base(value, overrideState) { } } /// @@ -272,7 +272,7 @@ public sealed class FogColorParameter : VolumeParameter /// Fog Color Parameter. /// Initial override state. public FogColorParameter(FogColorMode value, bool overrideState = false) - : base(value, overrideState) {} + : base(value, overrideState) { } } /// @@ -302,7 +302,7 @@ public sealed class FogControlParameter : VolumeParameter /// /// The initial value to store in the parameter. /// The initial override state for the parameter. - public FogControlParameter(FogControl value, bool overrideState = false) : base(value, overrideState) {} + public FogControlParameter(FogControl value, bool overrideState = false) : base(value, overrideState) { } } /// @@ -339,6 +339,6 @@ public sealed class FogDenoisingModeParameter : VolumeParameter /// The initial value to store in the parameter. /// The initial override state for the parameter. - public FogDenoisingModeParameter(FogDenoisingMode value, bool overrideState = false) : base(value, overrideState) {} + public FogDenoisingModeParameter(FogDenoisingMode value, bool overrideState = false) : base(value, overrideState) { } } } diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/AtmosphericScattering/VolumetricFog.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/AtmosphericScattering/VolumetricFog.cs index 20bf798f141..d8b8ce5bf50 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/AtmosphericScattering/VolumetricFog.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/AtmosphericScattering/VolumetricFog.cs @@ -4,13 +4,13 @@ namespace UnityEngine.Rendering.HighDefinition [VolumeComponentDeprecated()] class VolumetricFog : AtmosphericScattering { - public ColorParameter albedo = new ColorParameter(Color.white); - public MinFloatParameter meanFreePath = new MinFloatParameter(1000000.0f, 1.0f); - public FloatParameter baseHeight = new FloatParameter(0.0f); - public FloatParameter maximumHeight = new FloatParameter(10.0f); - public ClampedFloatParameter anisotropy = new ClampedFloatParameter(0.0f, -1.0f, 1.0f); + public ColorParameter albedo = new ColorParameter(Color.white); + public MinFloatParameter meanFreePath = new MinFloatParameter(1000000.0f, 1.0f); + public FloatParameter baseHeight = new FloatParameter(0.0f); + public FloatParameter maximumHeight = new FloatParameter(10.0f); + public ClampedFloatParameter anisotropy = new ClampedFloatParameter(0.0f, -1.0f, 1.0f); public ClampedFloatParameter globalLightProbeDimmer = new ClampedFloatParameter(1.0f, 0.0f, 1.0f); - public BoolParameter enableDistantFog = new BoolParameter(false); + public BoolParameter enableDistantFog = new BoolParameter(false); internal override void PushShaderParameters(HDCamera hdCamera, CommandBuffer cmd) { diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/DiffusionProfileOverride.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/DiffusionProfileOverride.cs index 0367d6dbc7d..addd4b7f7ba 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/DiffusionProfileOverride.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/DiffusionProfileOverride.cs @@ -15,6 +15,6 @@ sealed class DiffusionProfileOverride : VolumeComponent sealed class DiffusionProfileSettingsParameter : VolumeParameter { public DiffusionProfileSettingsParameter(DiffusionProfileSettings[] value, bool overrideState = true) - : base(value, overrideState) {} + : base(value, overrideState) { } } } diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/GlobalIlluminationUtils.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/GlobalIlluminationUtils.cs index 12c066160df..f2546f041de 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/GlobalIlluminationUtils.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/GlobalIlluminationUtils.cs @@ -16,7 +16,7 @@ public static bool LightDataGIExtract(Light light, ref LightDataGI lightDataGI) Cookie cookie; LightmapperUtils.Extract(light, out cookie); - lightDataGI.cookieID = cookie.instanceID; + lightDataGI.cookieID = cookie.instanceID; lightDataGI.cookieScale = cookie.scale; // TODO: Currently color temperature is not handled at runtime, need to expose useColorTemperature publicly @@ -63,10 +63,10 @@ public static bool LightDataGIExtract(Light light, ref LightDataGI lightDataGI) { // For HDRP we need to divide the analytic light color by PI (HDRP do explicit PI division for Lambert, but built in Unity and the GI don't for punctual lights) // We apply it on both direct and indirect are they are separated, seems that direct is no used if we used mixed mode with indirect or shadowmask bake. - lightDataGI.color.intensity /= Mathf.PI; + lightDataGI.color.intensity /= Mathf.PI; lightDataGI.indirectColor.intensity /= Mathf.PI; - directColor.intensity /= Mathf.PI; - indirectColor.intensity /= Mathf.PI; + directColor.intensity /= Mathf.PI; + indirectColor.intensity /= Mathf.PI; } switch (lightType) @@ -101,7 +101,7 @@ public static bool LightDataGIExtract(Light light, ref LightDataGI lightDataGI) #if UNITY_EDITOR spot.sphereRadius = light.shadows != LightShadows.None ? light.shadowRadius : 0.0f; #else - spot.sphereRadius = 0.0f; + spot.sphereRadius = 0.0f; #endif spot.position = light.transform.position; spot.orientation = light.transform.rotation; diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/IndirectLightingController.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/IndirectLightingController.cs index 7d6379cac26..e7ca7212754 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/IndirectLightingController.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/IndirectLightingController.cs @@ -57,7 +57,7 @@ public sealed class LightLayerEnumParameter : VolumeParameter /// Light Layer Enum parameter. /// Initial override value. public LightLayerEnumParameter(LightLayerEnum value, bool overrideState = false) - : base(value, overrideState) {} + : base(value, overrideState) { } } } } diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Light/HDAdditionalLightData.Types.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Light/HDAdditionalLightData.Types.cs index 08e68a80a89..e244e4165b7 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Light/HDAdditionalLightData.Types.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Light/HDAdditionalLightData.Types.cs @@ -386,8 +386,8 @@ public HDLightTypeAndShape GetLightTypeAndShape() { switch (type) { - case HDLightType.Directional: return HDLightTypeAndShape.Directional; - case HDLightType.Point: return HDLightTypeAndShape.Point; + case HDLightType.Directional: return HDLightTypeAndShape.Directional; + case HDLightType.Point: return HDLightTypeAndShape.Point; case HDLightType.Spot: switch (spotLightShape) { diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Light/HDAdditionalLightData.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Light/HDAdditionalLightData.cs index 2bce7a501e4..66ffa0ba23b 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Light/HDAdditionalLightData.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Light/HDAdditionalLightData.cs @@ -1112,7 +1112,7 @@ public uint GetShadowLayers() // Shadow Settings [SerializeField, FormerlySerializedAs("shadowNearPlane")] - float m_ShadowNearPlane = 0.1f; + float m_ShadowNearPlane = 0.1f; /// /// Controls the near plane distance of the shadows. /// @@ -1131,7 +1131,7 @@ public float shadowNearPlane // PCSS settings [Range(1, 64)] [SerializeField, FormerlySerializedAs("blockerSampleCount")] - int m_BlockerSampleCount = 24; + int m_BlockerSampleCount = 24; /// /// Controls the number of samples used to detect blockers for PCSS shadows. /// @@ -1149,7 +1149,7 @@ public int blockerSampleCount [Range(1, 64)] [SerializeField, FormerlySerializedAs("filterSampleCount")] - int m_FilterSampleCount = 16; + int m_FilterSampleCount = 16; /// /// Controls the number of samples used to filter for PCSS shadows. /// @@ -1266,7 +1266,8 @@ public Color color #endregion #region HDShadow Properties API (from AdditionalShadowData) - [SerializeField] private IntScalableSettingValue m_ShadowResolution = new IntScalableSettingValue + [SerializeField] + private IntScalableSettingValue m_ShadowResolution = new IntScalableSettingValue { @override = k_DefaultShadowResolution, useOverride = true, @@ -1674,11 +1675,11 @@ internal int shadowPrecision byte showAdditionalSettings = 0; #pragma warning restore 0414 - HDShadowRequest[] shadowRequests; - bool m_WillRenderShadowMap; - bool m_WillRenderScreenSpaceShadow; - bool m_WillRenderRayTracedShadow; - int[] m_ShadowRequestIndices; + HDShadowRequest[] shadowRequests; + bool m_WillRenderShadowMap; + bool m_WillRenderScreenSpaceShadow; + bool m_WillRenderRayTracedShadow; + int[] m_ShadowRequestIndices; // Data for cached shadow maps @@ -1689,7 +1690,7 @@ internal int shadowPrecision [System.NonSerialized] - Plane[] m_ShadowFrustumPlanes = new Plane[6]; + Plane[] m_ShadowFrustumPlanes = new Plane[6]; // temporary matrix that stores the previous light data (mainly used to discard history for ray traced screen space shadows) [System.NonSerialized] internal Matrix4x4 previousTransform = Matrix4x4.identity; @@ -2360,7 +2361,7 @@ void SetCommonShadowRequestSettings(HDShadowRequest shadowRequest, VisibleLight float halfAngleTan = Mathf.Tan(0.5f * Mathf.Deg2Rad * (softnessScale * m_AngularDiameter) / 2); softness = Mathf.Abs(halfAngleTan * frustumExtentZ / (2.0f * shadowRequest.splitData.cullingSphere.w)); float range = 2.0f * (1.0f / devProj.m22); - float rangeScale = Mathf.Abs(range) / 100.0f; + float rangeScale = Mathf.Abs(range) / 100.0f; shadowRequest.zBufferParam.x = rangeScale; } else @@ -2694,8 +2695,8 @@ public static void InitDefaultHDAdditionalLightData(HDAdditionalLightData lightD // We don't use the global settings of shadow mask by default light.lightShadowCasterMode = LightShadowCasterMode.Everything; - lightData.normalBias = 0.75f; - lightData.slopeBias = 0.5f; + lightData.normalBias = 0.75f; + lightData.slopeBias = 0.5f; // Enable filter/temperature mode by default for all light types lightData.useColorTemperature = true; @@ -2917,7 +2918,7 @@ internal void UpdateAreaLightEmissiveMesh(bool fromTimeLine = false) // m_Light.intensity is in luminance which is the value we need for emissive color Color value = legacyLight.color.linear * legacyLight.intensity; -// We don't have access to the color temperature in the player because it's a private member of the Light component + // We don't have access to the color temperature in the player because it's a private member of the Light component #if UNITY_EDITOR if (useColorTemperature) value *= Mathf.CorrelatedColorTemperatureToRGB(legacyLight.colorTemperature); @@ -3431,7 +3432,7 @@ void OnEnable() /// /// Deserialization callback /// - void ISerializationCallbackReceiver.OnAfterDeserialize() {} + void ISerializationCallbackReceiver.OnAfterDeserialize() { } /// /// Serialization callback diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightCookieManager.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightCookieManager.cs index d6a4af0af1a..1993f9cf0a2 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightCookieManager.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightCookieManager.cs @@ -44,9 +44,9 @@ class LightCookieManager // During the light loop, when reserving space for the cookies (first part of the light loop) the atlas // can run out of space, in this case, we set to true this flag which will trigger a re-layouting of the // atlas (sort entries by size and insert them again). - bool m_2DCookieAtlasNeedsLayouting = false; - bool m_NoMoreSpace = false; - readonly int cookieAtlasLastValidMip; + bool m_2DCookieAtlasNeedsLayouting = false; + bool m_NoMoreSpace = false; + readonly int cookieAtlasLastValidMip; readonly GraphicsFormat cookieFormat; public LightCookieManager(HDRenderPipelineAsset hdAsset, int maxCacheSize) @@ -252,7 +252,7 @@ public void LayoutIfNeeded() public Vector4 Fetch2DCookie(CommandBuffer cmd, Texture cookie, Texture ies) { - int width = (int)Mathf.Max(cookie.width, ies.height); + int width = (int)Mathf.Max(cookie.width, ies.height); int height = (int)Mathf.Max(cookie.width, ies.height); if (width < k_MinCookieSize || height < k_MinCookieSize) @@ -307,7 +307,7 @@ public Vector4 FetchAreaCookie(CommandBuffer cmd, Texture cookie) public Vector4 FetchAreaCookie(CommandBuffer cmd, Texture cookie, Texture ies) { - int width = (int)Mathf.Max(cookie.width, ies.height); + int width = (int)Mathf.Max(cookie.width, ies.height); int height = (int)Mathf.Max(cookie.width, ies.height); if (width < k_MinCookieSize || height < k_MinCookieSize) @@ -340,7 +340,7 @@ public void ReserveSpace(Texture cookieA, Texture cookieB) if (cookieA == null || cookieB == null) return; - int width = (int)Mathf.Max(cookieA.width, cookieB.height); + int width = (int)Mathf.Max(cookieA.width, cookieB.height); int height = (int)Mathf.Max(cookieA.width, cookieB.height); if (width < k_MinCookieSize || height < k_MinCookieSize) @@ -369,7 +369,7 @@ public void ReserveSpaceCube(Texture cookie) Debug.Assert(cookie.dimension == TextureDimension.Cube); - int projectionSize = 2 * cookie.width; + int projectionSize = 2 * cookie.width; if (projectionSize < k_MinCookieSize) return; @@ -385,7 +385,7 @@ public void ReserveSpaceCube(Texture cookieA, Texture cookieB) Debug.Assert(cookieA.dimension == TextureDimension.Cube && cookieB.dimension == TextureDimension.Cube); - int projectionSize = 2 * (int)Mathf.Max(cookieA.width, cookieB.width); + int projectionSize = 2 * (int)Mathf.Max(cookieA.width, cookieB.width); if (projectionSize < k_MinCookieSize) return; diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightDefinition.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightDefinition.cs index 40967976b88..bb6b45c8257 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightDefinition.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightDefinition.cs @@ -64,10 +64,10 @@ struct DirectionalLightData // Packing order depends on chronological access to avoid cache misses // Make sure to respect the 16-byte alignment public Vector3 positionRWS; - public uint lightLayers; + public uint lightLayers; - public float lightDimmer; - public float volumetricLightDimmer; // Replaces 'lightDimer' + public float lightDimmer; + public float volumetricLightDimmer; // Replaces 'lightDimer' public Vector3 forward; public CookieMode cookieMode; @@ -75,38 +75,38 @@ struct DirectionalLightData public Vector4 cookieScaleOffset; public Vector3 right; // Rescaled by (2 / shapeWidth) - public int shadowIndex; // -1 if unused (TODO: 16 bit) + public int shadowIndex; // -1 if unused (TODO: 16 bit) public Vector3 up; // Rescaled by (2 / shapeHeight) - public int contactShadowIndex; // -1 if unused (TODO: 16 bit) + public int contactShadowIndex; // -1 if unused (TODO: 16 bit) public Vector3 color; - public int contactShadowMask; // 0 if unused (TODO: 16 bit) + public int contactShadowMask; // 0 if unused (TODO: 16 bit) public Vector3 shadowTint; // Use to tint shadow color - public float shadowDimmer; + public float shadowDimmer; - public float volumetricShadowDimmer; // Replaces 'shadowDimmer' - public int nonLightMappedOnly; // Used with ShadowMask (TODO: use a bitfield) + public float volumetricShadowDimmer; // Replaces 'shadowDimmer' + public int nonLightMappedOnly; // Used with ShadowMask (TODO: use a bitfield) [SurfaceDataAttributes(precision = FieldPrecision.Real)] - public float minRoughness; // Hack - public int screenSpaceShadowIndex; // -1 if unused (TODO: 16 bit) + public float minRoughness; // Hack + public int screenSpaceShadowIndex; // -1 if unused (TODO: 16 bit) [SurfaceDataAttributes(precision = FieldPrecision.Real)] public Vector4 shadowMaskSelector; // Used with ShadowMask feature - public float diffuseDimmer; - public float specularDimmer; - public float penumbraTint; - public float isRayTracedContactShadow; + public float diffuseDimmer; + public float specularDimmer; + public float penumbraTint; + public float isRayTracedContactShadow; - public float distanceFromCamera; // -1 -> no sky interaction - public float angularDiameter; // Units: radians - public float flareFalloff; - public float __unused__; + public float distanceFromCamera; // -1 -> no sky interaction + public float angularDiameter; // Units: radians + public float flareFalloff; + public float __unused__; public Vector3 flareTint; - public float flareSize; // Units: radians + public float flareSize; // Units: radians public Vector3 surfaceTint; @@ -119,44 +119,44 @@ struct LightData // Packing order depends on chronological access to avoid cache misses // Make sure to respect the 16-byte alignment public Vector3 positionRWS; - public uint lightLayers; + public uint lightLayers; - public float lightDimmer; - public float volumetricLightDimmer; // Replaces 'lightDimer' + public float lightDimmer; + public float volumetricLightDimmer; // Replaces 'lightDimer' [SurfaceDataAttributes(precision = FieldPrecision.Real)] - public float angleScale; // Spot light + public float angleScale; // Spot light [SurfaceDataAttributes(precision = FieldPrecision.Real)] - public float angleOffset; // Spot light + public float angleOffset; // Spot light public Vector3 forward; - public float iesCut; // Spot light + public float iesCut; // Spot light public GPULightType lightType; // TODO: move this up? public Vector3 right; // If spot: rescaled by cot(outerHalfAngle); if projector: rescaled by (2 / shapeWidth) - public float penumbraTint; + public float penumbraTint; [SurfaceDataAttributes(precision = FieldPrecision.Real)] - public float range; + public float range; public CookieMode cookieMode; - public int shadowIndex; // -1 if unused (TODO: 16 bit) + public int shadowIndex; // -1 if unused (TODO: 16 bit) public Vector3 up; // If spot: rescaled by cot(outerHalfAngle); if projector: rescaled by (2 / shapeHeight) - public float rangeAttenuationScale; + public float rangeAttenuationScale; public Vector3 color; - public float rangeAttenuationBias; + public float rangeAttenuationBias; public Vector4 cookieScaleOffset; // coordinates of the cookie texture in the atlas public Vector3 shadowTint; // Use to tint shadow color - public float shadowDimmer; + public float shadowDimmer; - public float volumetricShadowDimmer; // Replaces 'shadowDimmer' - public int nonLightMappedOnly; // Used with ShadowMask feature (TODO: use a bitfield) + public float volumetricShadowDimmer; // Replaces 'shadowDimmer' + public int nonLightMappedOnly; // Used with ShadowMask feature (TODO: use a bitfield) [SurfaceDataAttributes(precision = FieldPrecision.Real)] - public float minRoughness; // This is use to give a small "area" to punctual light, as if we have a light with a radius. + public float minRoughness; // This is use to give a small "area" to punctual light, as if we have a light with a radius. // TODO: Instead of doing this, we should pack the ray traced shadow index into the tile cookie for instance - public int screenSpaceShadowIndex; // -1 if unused (TODO: 16 bit) + public int screenSpaceShadowIndex; // -1 if unused (TODO: 16 bit) [SurfaceDataAttributes(precision = FieldPrecision.Real)] public Vector4 shadowMaskSelector; // Used with ShadowMask feature @@ -164,14 +164,14 @@ struct LightData [SurfaceDataAttributes(precision = FieldPrecision.Real)] public Vector4 size; // Used by area (X = length or width, Y = height, Z = CosBarnDoorAngle, W = BarnDoorLength) and punctual lights (X = radius) - public int contactShadowMask; // negative if unused (TODO: 16 bit) - public float diffuseDimmer; - public float specularDimmer; - public float __unused__; + public int contactShadowMask; // negative if unused (TODO: 16 bit) + public float diffuseDimmer; + public float specularDimmer; + public float __unused__; public Vector2 padding; - public float isRayTracedContactShadow; - public float boxLightSafeExtent; + public float isRayTracedContactShadow; + public float boxLightSafeExtent; }; diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/GlobalLightLoopSettings.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/GlobalLightLoopSettings.cs index 0b1a09b1b08..c4dfdca3ad6 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/GlobalLightLoopSettings.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/GlobalLightLoopSettings.cs @@ -128,7 +128,7 @@ public struct GlobalLightLoopSettings cookieAtlasLastValidMip = 0, -// We must keep this value for migration purpose (when we create a new HDRP asset it is migrated to the last version) + // We must keep this value for migration purpose (when we create a new HDRP asset it is migrated to the last version) #pragma warning disable 618 // Type or member is obsolete cookieTexArraySize = 1, #pragma warning restore 618 diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/LightLoop.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/LightLoop.cs index 492bb8e4ee7..453c71c050e 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/LightLoop.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/LightLoop.cs @@ -39,9 +39,9 @@ public static VisibleLightAxisAndPosition GetAxisAndPosition(this VisibleLight v var matrix = value.localToWorldMatrix; VisibleLightAxisAndPosition output; output.Position = matrix.GetColumn(3); - output.Forward = matrix.GetColumn(2); - output.Up = matrix.GetColumn(1); - output.Right = matrix.GetColumn(0); + output.Forward = matrix.GetColumn(2); + output.Up = matrix.GetColumn(1); + output.Right = matrix.GetColumn(0); return output; } } @@ -75,15 +75,15 @@ internal enum LightCategory internal enum LightFeatureFlags { // Light bit mask must match LightDefinitions.s_LightFeatureMaskFlags value - Punctual = 1 << 12, - Area = 1 << 13, + Punctual = 1 << 12, + Area = 1 << 13, Directional = 1 << 14, - Env = 1 << 15, - Sky = 1 << 16, + Env = 1 << 15, + Sky = 1 << 16, SSRefraction = 1 << 17, SSReflection = 1 << 18, ProbeVolume = 1 << 19 - // If adding more light be sure to not overflow LightDefinitions.s_LightFeatureMaskFlags + // If adding more light be sure to not overflow LightDefinitions.s_LightFeatureMaskFlags } [GenerateHLSL] @@ -131,8 +131,8 @@ struct SFiniteLightBound public Vector3 boxAxisY; // Scaled by the extents (half-size) public Vector3 boxAxisZ; // Scaled by the extents (half-size) public Vector3 center; // Center of the bounds (box) in camera space - public float scaleXY; // Scale applied to the top of the box to turn it into a truncated pyramid (X = Y) - public float radius; // Circumscribed sphere for the bounds (box) + public float scaleXY; // Scale applied to the top of the box to turn it into a truncated pyramid (X = Y) + public float radius; // Circumscribed sphere for the bounds (box) }; [GenerateHLSL] @@ -226,78 +226,78 @@ public enum TileClusterCategoryDebug : int unsafe struct ShaderVariablesLightList { [HLSLArray(ShaderConfig.k_XRMaxViewsForCBuffer, typeof(Matrix4x4))] - public fixed float g_mInvScrProjectionArr[ShaderConfig.k_XRMaxViewsForCBuffer * 16]; + public fixed float g_mInvScrProjectionArr[ShaderConfig.k_XRMaxViewsForCBuffer * 16]; [HLSLArray(ShaderConfig.k_XRMaxViewsForCBuffer, typeof(Matrix4x4))] - public fixed float g_mScrProjectionArr[ShaderConfig.k_XRMaxViewsForCBuffer * 16]; + public fixed float g_mScrProjectionArr[ShaderConfig.k_XRMaxViewsForCBuffer * 16]; [HLSLArray(ShaderConfig.k_XRMaxViewsForCBuffer, typeof(Matrix4x4))] - public fixed float g_mInvProjectionArr[ShaderConfig.k_XRMaxViewsForCBuffer * 16]; + public fixed float g_mInvProjectionArr[ShaderConfig.k_XRMaxViewsForCBuffer * 16]; [HLSLArray(ShaderConfig.k_XRMaxViewsForCBuffer, typeof(Matrix4x4))] - public fixed float g_mProjectionArr[ShaderConfig.k_XRMaxViewsForCBuffer * 16]; + public fixed float g_mProjectionArr[ShaderConfig.k_XRMaxViewsForCBuffer * 16]; - public Vector4 g_screenSize; + public Vector4 g_screenSize; - public Vector2Int g_viDimensions; - public int g_iNrVisibLights; - public uint g_isOrthographic; + public Vector2Int g_viDimensions; + public int g_iNrVisibLights; + public uint g_isOrthographic; - public uint g_BaseFeatureFlags; - public int g_iNumSamplesMSAA; - public uint _EnvLightIndexShift; - public uint _DecalIndexShift; + public uint g_BaseFeatureFlags; + public int g_iNumSamplesMSAA; + public uint _EnvLightIndexShift; + public uint _DecalIndexShift; - public uint _DensityVolumeIndexShift; - public uint _ProbeVolumeIndexShift; - public uint _Pad0_SVLL; - public uint _Pad1_SVLL; + public uint _DensityVolumeIndexShift; + public uint _ProbeVolumeIndexShift; + public uint _Pad0_SVLL; + public uint _Pad1_SVLL; } internal struct ProcessedLightData { - public HDAdditionalLightData additionalLightData; - public HDLightType lightType; - public LightCategory lightCategory; - public GPULightType gpuLightType; - public LightVolumeType lightVolumeType; - public float distanceToCamera; - public float lightDistanceFade; - public float volumetricDistanceFade; - public bool isBakedShadowMask; + public HDAdditionalLightData additionalLightData; + public HDLightType lightType; + public LightCategory lightCategory; + public GPULightType gpuLightType; + public LightVolumeType lightVolumeType; + public float distanceToCamera; + public float lightDistanceFade; + public float volumetricDistanceFade; + public bool isBakedShadowMask; } internal struct ProcessedProbeData { - public HDProbe hdProbe; - public float weight; + public HDProbe hdProbe; + public float weight; } public partial class HDRenderPipeline { internal const int k_MaxCacheSize = 2000000000; //2 GigaByte internal const int k_MaxDirectionalLightsOnScreen = 512; - internal const int k_MaxPunctualLightsOnScreen = 2048; - internal const int k_MaxAreaLightsOnScreen = 1024; + internal const int k_MaxPunctualLightsOnScreen = 2048; + internal const int k_MaxAreaLightsOnScreen = 1024; internal const int k_MaxDecalsOnScreen = 2048; internal const int k_MaxLightsOnScreen = k_MaxDirectionalLightsOnScreen + k_MaxPunctualLightsOnScreen + k_MaxAreaLightsOnScreen + k_MaxEnvLightsOnScreen; internal const int k_MaxEnvLightsOnScreen = 1024; internal const int k_MaxLightsPerClusterCell = 24; internal static readonly Vector3 k_BoxCullingExtentThreshold = Vector3.one * 0.01f; - #if UNITY_SWITCH +#if UNITY_SWITCH static bool k_PreferFragment = true; - #else +#else static bool k_PreferFragment = false; - #endif - #if !UNITY_EDITOR && UNITY_SWITCH +#endif +#if !UNITY_EDITOR && UNITY_SWITCH const bool k_HasNativeQuadSupport = true; - #else +#else const bool k_HasNativeQuadSupport = false; - #endif +#endif - #if !UNITY_EDITOR && UNITY_SWITCH +#if !UNITY_EDITOR && UNITY_SWITCH const int k_ThreadGroupOptimalSize = 32; - #else +#else const int k_ThreadGroupOptimalSize = 64; - #endif +#endif int m_MaxDirectionalLightsOnScreen; int m_MaxPunctualLightsOnScreen; @@ -307,20 +307,20 @@ public partial class HDRenderPipeline int m_MaxEnvLightsOnScreen; int m_MaxPlanarReflectionOnScreen; - Texture2DArray m_DefaultTexture2DArray; - Cubemap m_DefaultTextureCube; + Texture2DArray m_DefaultTexture2DArray; + Cubemap m_DefaultTextureCube; internal class LightLoopTextureCaches { // Structure for cookies used by directional and spotlights - public LightCookieManager lightCookieManager { get; private set; } - public ReflectionProbeCache reflectionProbeCache { get; private set; } - public PlanarReflectionProbeCache reflectionPlanarProbeCache { get; private set; } - public List env2DCaptureVP { get; private set; } - public List env2DCaptureForward { get; private set; } - public List env2DAtlasScaleOffset {get; private set; } = new List(); + public LightCookieManager lightCookieManager { get; private set; } + public ReflectionProbeCache reflectionProbeCache { get; private set; } + public PlanarReflectionProbeCache reflectionPlanarProbeCache { get; private set; } + public List env2DCaptureVP { get; private set; } + public List env2DCaptureForward { get; private set; } + public List env2DAtlasScaleOffset { get; private set; } = new List(); - public void Initialize(HDRenderPipelineAsset hdrpAsset, RenderPipelineResources defaultResources, IBLFilterBSDF[] iBLFilterBSDFArray) + public void Initialize(HDRenderPipelineAsset hdrpAsset, RenderPipelineResources defaultResources, IBLFilterBSDF[] iBLFilterBSDFArray) { var lightLoopSettings = hdrpAsset.currentPlatformRenderPipelineSettings.lightLoopSettings; @@ -374,10 +374,10 @@ public void NewFrame() internal class LightLoopLightData { - public ComputeBuffer directionalLightData { get; private set; } - public ComputeBuffer lightData { get; private set; } - public ComputeBuffer envLightData { get; private set; } - public ComputeBuffer decalData { get; private set; } + public ComputeBuffer directionalLightData { get; private set; } + public ComputeBuffer lightData { get; private set; } + public ComputeBuffer envLightData { get; private set; } + public ComputeBuffer decalData { get; private set; } public void Initialize(int directionalCount, int punctualCount, int areaLightCount, int envLightCount, int decalCount) { @@ -872,7 +872,7 @@ void InitializeLightLoop(IBLFilterBSDF[] iBLFilterBSDFArray) // Setup shadow algorithms var shadowParams = asset.currentPlatformRenderPipelineSettings.hdShadowInitParams; - var shadowKeywords = new[] {"SHADOW_LOW", "SHADOW_MEDIUM", "SHADOW_HIGH"}; + var shadowKeywords = new[] { "SHADOW_LOW", "SHADOW_MEDIUM", "SHADOW_HIGH" }; foreach (var p in shadowKeywords) Shader.DisableKeyword(p); Shader.EnableKeyword(shadowKeywords[(int)shadowParams.shadowFilteringQuality]); @@ -1050,7 +1050,7 @@ static Vector3 ComputeAtmosphericOpticalDepth(PhysicallyBasedSky skySettings, fl { float R = skySettings.GetPlanetaryRadius(); - Vector2 H = new Vector2(skySettings.GetAirScaleHeight(), skySettings.GetAerosolScaleHeight()); + Vector2 H = new Vector2(skySettings.GetAirScaleHeight(), skySettings.GetAerosolScaleHeight()); Vector2 rcpH = new Vector2(Rcp(H.x), Rcp(H.y)); Vector2 z = r * rcpH; @@ -1078,11 +1078,11 @@ static Vector3 ComputeAtmosphericOpticalDepth(PhysicallyBasedSky skySettings, fl { // z_0 = n * r_0 = (n * r) * sin(theta) = z * sin(theta). // Ch(z, theta) = 2 * exp(z - z_0) * Ch(z_0, Pi/2) - Ch(z, Pi - theta). - Vector2 z_0 = z * sinTheta; - Vector2 b = new Vector2(Mathf.Exp(Z.x - z_0.x), Mathf.Exp(Z.x - z_0.x)); // Rescaling cancels out 'z' and adds 'Z' + Vector2 z_0 = z * sinTheta; + Vector2 b = new Vector2(Mathf.Exp(Z.x - z_0.x), Mathf.Exp(Z.x - z_0.x)); // Rescaling cancels out 'z' and adds 'Z' Vector2 a; - a.x = 2 * ChapmanHorizontal(z_0.x); - a.y = 2 * ChapmanHorizontal(z_0.y); + a.x = 2 * ChapmanHorizontal(z_0.x); + a.y = 2 * ChapmanHorizontal(z_0.y); Vector2 ch_2 = a * b; ch = ch_2 - ch; @@ -1090,8 +1090,8 @@ static Vector3 ComputeAtmosphericOpticalDepth(PhysicallyBasedSky skySettings, fl Vector2 optDepth = ch * H; - Vector3 airExtinction = skySettings.GetAirExtinctionCoefficient(); - float aerosolExtinction = skySettings.GetAerosolExtinctionCoefficient(); + Vector3 airExtinction = skySettings.GetAirExtinctionCoefficient(); + float aerosolExtinction = skySettings.GetAerosolExtinctionCoefficient(); return new Vector3(optDepth.x * airExtinction.x + optDepth.y * aerosolExtinction, optDepth.x * airExtinction.y + optDepth.y * aerosolExtinction, @@ -1139,8 +1139,8 @@ internal void GetDirectionalLightData(CommandBuffer cmd, HDCamera hdCamera, Visi // Light direction for directional is opposite to the forward direction lightData.forward = light.GetForward(); // Rescale for cookies and windowing. - lightData.right = light.GetRight() * 2 / Mathf.Max(additionalLightData.shapeWidth, 0.001f); - lightData.up = light.GetUp() * 2 / Mathf.Max(additionalLightData.shapeHeight, 0.001f); + lightData.right = light.GetRight() * 2 / Mathf.Max(additionalLightData.shapeWidth, 0.001f); + lightData.up = light.GetUp() * 2 / Mathf.Max(additionalLightData.shapeHeight, 0.001f); lightData.positionRWS = light.GetPosition(); lightData.color = GetLightColor(light); @@ -1148,9 +1148,9 @@ internal void GetDirectionalLightData(CommandBuffer cmd, HDCamera hdCamera, Visi // So we expect that all light with additionalData == HDUtils.s_DefaultHDAdditionalLightData are currently the one from the preview, light in scene MUST have additionalData lightData.color *= (HDUtils.s_DefaultHDAdditionalLightData == additionalLightData) ? Mathf.PI : 1.0f; - lightData.lightDimmer = additionalLightData.lightDimmer; - lightData.diffuseDimmer = additionalLightData.affectDiffuse ? additionalLightData.lightDimmer : 0; - lightData.specularDimmer = additionalLightData.affectSpecular ? additionalLightData.lightDimmer * hdCamera.frameSettings.specularGlobalDimmer : 0; + lightData.lightDimmer = additionalLightData.lightDimmer; + lightData.diffuseDimmer = additionalLightData.affectDiffuse ? additionalLightData.lightDimmer : 0; + lightData.specularDimmer = additionalLightData.affectSpecular ? additionalLightData.lightDimmer * hdCamera.frameSettings.specularGlobalDimmer : 0; lightData.volumetricLightDimmer = additionalLightData.volumetricDimmer; lightData.shadowIndex = -1; @@ -1176,7 +1176,7 @@ internal void GetDirectionalLightData(CommandBuffer cmd, HDCamera hdCamera, Visi lightData.surfaceTextureScaleOffset = m_TextureCaches.lightCookieManager.Fetch2DCookie(cmd, additionalLightData.surfaceTexture); } - lightData.shadowDimmer = additionalLightData.shadowDimmer; + lightData.shadowDimmer = additionalLightData.shadowDimmer; lightData.volumetricShadowDimmer = additionalLightData.volumetricShadowDimmer; GetContactShadowMask(additionalLightData, HDAdditionalLightData.ScalableSettings.UseContactShadow(m_Asset), hdCamera, isRasterization: true, ref lightData.contactShadowMask, ref lightData.isRayTracedContactShadow); @@ -1257,10 +1257,10 @@ internal void GetDirectionalLightData(CommandBuffer cmd, HDCamera hdCamera, Visi } lightData.angularDiameter = additionalLightData.angularDiameter * Mathf.Deg2Rad; - lightData.flareSize = Mathf.Max(additionalLightData.flareSize * Mathf.Deg2Rad, 5.960464478e-8f); - lightData.flareFalloff = additionalLightData.flareFalloff; - lightData.flareTint = (Vector3)(Vector4)additionalLightData.flareTint; - lightData.surfaceTint = (Vector3)(Vector4)additionalLightData.surfaceTint; + lightData.flareSize = Mathf.Max(additionalLightData.flareSize * Mathf.Deg2Rad, 5.960464478e-8f); + lightData.flareFalloff = additionalLightData.flareFalloff; + lightData.flareTint = (Vector3)(Vector4)additionalLightData.flareTint; + lightData.surfaceTint = (Vector3)(Vector4)additionalLightData.surfaceTint; // Fallback to the first non shadow casting directional light. m_CurrentSunLight = m_CurrentSunLight == null ? lightComponent : m_CurrentSunLight; @@ -1301,7 +1301,7 @@ internal void GetLightData(CommandBuffer cmd, HDCamera hdCamera, HDShadowSetting if (additionalLightData.applyRangeAttenuation) { lightData.rangeAttenuationScale = 1.0f / (light.range * light.range); - lightData.rangeAttenuationBias = 1.0f; + lightData.rangeAttenuationBias = 1.0f; if (lightData.lightType == GPULightType.Rectangle) { @@ -1316,9 +1316,9 @@ internal void GetLightData(CommandBuffer cmd, HDCamera hdCamera, HDShadowSetting // f(0) = huge -> b = huge. // f(1) = 0 -> huge - a^2 = 0 -> a = sqrt(huge). const float hugeValue = 16777216.0f; - const float sqrtHuge = 4096.0f; + const float sqrtHuge = 4096.0f; lightData.rangeAttenuationScale = sqrtHuge / (light.range * light.range); - lightData.rangeAttenuationBias = hugeValue; + lightData.rangeAttenuationBias = hugeValue; if (lightData.lightType == GPULightType.Rectangle) { @@ -1343,7 +1343,7 @@ internal void GetLightData(CommandBuffer cmd, HDCamera hdCamera, HDShadowSetting { // Rescale for cookies and windowing. lightData.right *= 2.0f / Mathf.Max(additionalLightData.shapeWidth, 0.001f); - lightData.up *= 2.0f / Mathf.Max(additionalLightData.shapeHeight, 0.001f); + lightData.up *= 2.0f / Mathf.Max(additionalLightData.shapeHeight, 0.001f); // If we have shadows, we need to shrink the valid range so that we don't leak light due to filtering going out of bounds. if (shadowIndex >= 0) @@ -1393,13 +1393,13 @@ internal void GetLightData(CommandBuffer cmd, HDCamera hdCamera, HDShadowSetting var cosSpotInnerHalfAngle = Mathf.Clamp(Mathf.Cos(spotAngle * 0.5f * innerConePercent * Mathf.Deg2Rad), 0.0f, 1.0f); // inner cone var val = Mathf.Max(0.0001f, (cosSpotInnerHalfAngle - cosSpotOuterHalfAngle)); - lightData.angleScale = 1.0f / val; + lightData.angleScale = 1.0f / val; lightData.angleOffset = -cosSpotOuterHalfAngle * lightData.angleScale; - lightData.iesCut = additionalLightData.spotIESCutoffPercent01; + lightData.iesCut = additionalLightData.spotIESCutoffPercent01; // Rescale for cookies and windowing. float cotOuterHalfAngle = cosSpotOuterHalfAngle / sinSpotOuterHalfAngle; - lightData.up *= cotOuterHalfAngle; + lightData.up *= cotOuterHalfAngle; lightData.right *= cotOuterHalfAngle; } else @@ -1421,9 +1421,9 @@ internal void GetLightData(CommandBuffer cmd, HDCamera hdCamera, HDShadowSetting lightData.size = new Vector4(additionalLightData.shapeWidth, additionalLightData.shapeHeight, Mathf.Cos(additionalLightData.barnDoorAngle * Mathf.PI / 180.0f), additionalLightData.barnDoorLength); } - lightData.lightDimmer = processedData.lightDistanceFade * (additionalLightData.lightDimmer); - lightData.diffuseDimmer = processedData.lightDistanceFade * (additionalLightData.affectDiffuse ? additionalLightData.lightDimmer : 0); - lightData.specularDimmer = processedData.lightDistanceFade * (additionalLightData.affectSpecular ? additionalLightData.lightDimmer * hdCamera.frameSettings.specularGlobalDimmer : 0); + lightData.lightDimmer = processedData.lightDistanceFade * (additionalLightData.lightDimmer); + lightData.diffuseDimmer = processedData.lightDistanceFade * (additionalLightData.affectDiffuse ? additionalLightData.lightDimmer : 0); + lightData.specularDimmer = processedData.lightDistanceFade * (additionalLightData.affectSpecular ? additionalLightData.lightDimmer * hdCamera.frameSettings.specularGlobalDimmer : 0); lightData.volumetricLightDimmer = Mathf.Min(processedData.volumetricDistanceFade, processedData.lightDistanceFade) * (additionalLightData.volumetricDimmer); lightData.cookieMode = CookieMode.None; @@ -1493,8 +1493,8 @@ internal void GetLightData(CommandBuffer cmd, HDCamera hdCamera, HDShadowSetting } } - float shadowDistanceFade = HDUtils.ComputeLinearDistanceFade(processedData.distanceToCamera, Mathf.Min(shadowSettings.maxShadowDistance.value, additionalLightData.shadowFadeDistance)); - lightData.shadowDimmer = shadowDistanceFade * additionalLightData.shadowDimmer; + float shadowDistanceFade = HDUtils.ComputeLinearDistanceFade(processedData.distanceToCamera, Mathf.Min(shadowSettings.maxShadowDistance.value, additionalLightData.shadowFadeDistance)); + lightData.shadowDimmer = shadowDistanceFade * additionalLightData.shadowDimmer; lightData.volumetricShadowDimmer = shadowDistanceFade * additionalLightData.volumetricShadowDimmer; GetContactShadowMask(additionalLightData, contactShadowsScalableSetting, hdCamera, isRasterization: isRasterization, ref lightData.contactShadowMask, ref lightData.isRayTracedContactShadow); @@ -1637,8 +1637,8 @@ void GetLightVolumeDataAndBound(LightCategory lightCategory, GPULightType gpuLig fAltDx *= range; fAltDy *= range; // Handle case of pyramid with this select (currently unused) - var altDist = Mathf.Sqrt(fAltDy * fAltDy + (true ? 1.0f : 2.0f) * fAltDx * fAltDx); - bound.radius = altDist > (0.5f * range) ? altDist : (0.5f * range); // will always pick fAltDist + var altDist = Mathf.Sqrt(fAltDy * fAltDy + (true ? 1.0f : 2.0f) * fAltDx * fAltDx); + bound.radius = altDist > (0.5f * range) ? altDist : (0.5f * range); // will always pick fAltDist bound.scaleXY = squeeze ? 0.01f : 1.0f; lightVolumeData.lightAxisX = vx; @@ -1662,8 +1662,8 @@ void GetLightVolumeDataAndBound(LightCategory lightCategory, GPULightType gpuLig bound.boxAxisX = vx * range; bound.boxAxisY = vy * range; bound.boxAxisZ = vz * range; - bound.scaleXY = 1.0f; - bound.radius = range; + bound.scaleXY = 1.0f; + bound.radius = range; // fill up ldata lightVolumeData.lightAxisX = vx; @@ -1676,17 +1676,17 @@ void GetLightVolumeDataAndBound(LightCategory lightCategory, GPULightType gpuLig else if (gpuLightType == GPULightType.Tube) { Vector3 dimensions = new Vector3(lightDimensions.x + 2 * range, 2 * range, 2 * range); // Omni-directional - Vector3 extents = 0.5f * dimensions; - Vector3 centerVS = positionVS; + Vector3 extents = 0.5f * dimensions; + Vector3 centerVS = positionVS; - bound.center = centerVS; + bound.center = centerVS; bound.boxAxisX = extents.x * xAxisVS; bound.boxAxisY = extents.y * yAxisVS; bound.boxAxisZ = extents.z * zAxisVS; - bound.radius = extents.x; - bound.scaleXY = 1.0f; + bound.radius = extents.x; + bound.scaleXY = 1.0f; - lightVolumeData.lightPos = centerVS; + lightVolumeData.lightPos = centerVS; lightVolumeData.lightAxisX = xAxisVS; lightVolumeData.lightAxisY = yAxisVS; lightVolumeData.lightAxisZ = zAxisVS; @@ -1696,19 +1696,19 @@ void GetLightVolumeDataAndBound(LightCategory lightCategory, GPULightType gpuLig else if (gpuLightType == GPULightType.Rectangle) { Vector3 dimensions = new Vector3(lightDimensions.x + 2 * range, lightDimensions.y + 2 * range, range); // One-sided - Vector3 extents = 0.5f * dimensions; - Vector3 centerVS = positionVS + extents.z * zAxisVS; + Vector3 extents = 0.5f * dimensions; + Vector3 centerVS = positionVS + extents.z * zAxisVS; float d = range + 0.5f * Mathf.Sqrt(lightDimensions.x * lightDimensions.x + lightDimensions.y * lightDimensions.y); - bound.center = centerVS; + bound.center = centerVS; bound.boxAxisX = extents.x * xAxisVS; bound.boxAxisY = extents.y * yAxisVS; bound.boxAxisZ = extents.z * zAxisVS; - bound.radius = Mathf.Sqrt(d * d + (0.5f * range) * (0.5f * range)); - bound.scaleXY = 1.0f; + bound.radius = Mathf.Sqrt(d * d + (0.5f * range) * (0.5f * range)); + bound.scaleXY = 1.0f; - lightVolumeData.lightPos = centerVS; + lightVolumeData.lightPos = centerVS; lightVolumeData.lightAxisX = xAxisVS; lightVolumeData.lightAxisY = yAxisVS; lightVolumeData.lightAxisZ = zAxisVS; @@ -1718,17 +1718,17 @@ void GetLightVolumeDataAndBound(LightCategory lightCategory, GPULightType gpuLig else if (gpuLightType == GPULightType.ProjectorBox) { Vector3 dimensions = new Vector3(lightDimensions.x, lightDimensions.y, range); // One-sided - Vector3 extents = 0.5f * dimensions; - Vector3 centerVS = positionVS + extents.z * zAxisVS; + Vector3 extents = 0.5f * dimensions; + Vector3 centerVS = positionVS + extents.z * zAxisVS; - bound.center = centerVS; + bound.center = centerVS; bound.boxAxisX = extents.x * xAxisVS; bound.boxAxisY = extents.y * yAxisVS; bound.boxAxisZ = extents.z * zAxisVS; - bound.radius = extents.magnitude; - bound.scaleXY = 1.0f; + bound.radius = extents.magnitude; + bound.scaleXY = 1.0f; - lightVolumeData.lightPos = centerVS; + lightVolumeData.lightPos = centerVS; lightVolumeData.lightAxisX = xAxisVS; lightVolumeData.lightAxisY = yAxisVS; lightVolumeData.lightAxisZ = zAxisVS; @@ -1959,8 +1959,8 @@ void GetEnvLightVolumeDataAndBound(HDProbe probe, LightVolumeType lightVolumeTyp bound.boxAxisX = influenceRightVS * influenceExtents.x; bound.boxAxisY = influenceUpVS * influenceExtents.x; bound.boxAxisZ = influenceForwardVS * influenceExtents.x; - bound.scaleXY = 1.0f; - bound.radius = influenceExtents.x; + bound.scaleXY = 1.0f; + bound.radius = influenceExtents.x; break; } case LightVolumeType.Box: @@ -1969,8 +1969,8 @@ void GetEnvLightVolumeDataAndBound(HDProbe probe, LightVolumeType lightVolumeTyp bound.boxAxisX = influenceExtents.x * influenceRightVS; bound.boxAxisY = influenceExtents.y * influenceUpVS; bound.boxAxisZ = influenceExtents.z * influenceForwardVS; - bound.scaleXY = 1.0f; - bound.radius = influenceExtents.magnitude; + bound.scaleXY = 1.0f; + bound.radius = influenceExtents.magnitude; // The culling system culls pixels that are further // than a threshold to the box influence extents. @@ -2004,29 +2004,29 @@ void CreateBoxVolumeDataAndBound(OrientedBBox obb, LightCategory category, Light // transform to camera space (becomes a left hand coordinate frame in Unity since Determinant(worldToView)<0) var positionVS = worldToView.MultiplyPoint(obb.center); - var rightVS = worldToView.MultiplyVector(obb.right); - var upVS = worldToView.MultiplyVector(obb.up); - var forwardVS = Vector3.Cross(upVS, rightVS); - var extents = new Vector3(extentConservativeX, extentConservativeY, extentConservativeZ); + var rightVS = worldToView.MultiplyVector(obb.right); + var upVS = worldToView.MultiplyVector(obb.up); + var forwardVS = Vector3.Cross(upVS, rightVS); + var extents = new Vector3(extentConservativeX, extentConservativeY, extentConservativeZ); - volumeData.lightVolume = (uint)LightVolumeType.Box; + volumeData.lightVolume = (uint)LightVolumeType.Box; volumeData.lightCategory = (uint)category; - volumeData.featureFlags = (uint)featureFlags; + volumeData.featureFlags = (uint)featureFlags; - bound.center = positionVS; + bound.center = positionVS; bound.boxAxisX = extentConservativeX * rightVS; bound.boxAxisY = extentConservativeY * upVS; bound.boxAxisZ = extentConservativeZ * forwardVS; - bound.radius = extentConservativeMagnitude; - bound.scaleXY = 1.0f; + bound.radius = extentConservativeMagnitude; + bound.scaleXY = 1.0f; // The culling system culls pixels that are further // than a threshold to the box influence extents. // So we use an arbitrary threshold here (k_BoxCullingExtentOffset) - volumeData.lightPos = positionVS; - volumeData.lightAxisX = rightVS; - volumeData.lightAxisY = upVS; - volumeData.lightAxisZ = forwardVS; + volumeData.lightPos = positionVS; + volumeData.lightAxisX = rightVS; + volumeData.lightAxisY = upVS; + volumeData.lightAxisZ = forwardVS; volumeData.boxInnerDist = extents - k_BoxCullingExtentThreshold; // We have no blend range, but the culling code needs a small EPS value for some reason??? volumeData.boxInvRange.Set(1.0f / k_BoxCullingExtentThreshold.x, 1.0f / k_BoxCullingExtentThreshold.y, 1.0f / k_BoxCullingExtentThreshold.z); } @@ -3170,10 +3170,10 @@ static bool DeferredUseComputeAsPixel(FrameSettings frameSettings) return frameSettings.IsEnabled(FrameSettingsField.DeferredTile) && (!frameSettings.IsEnabled(FrameSettingsField.ComputeLightEvaluation) || k_PreferFragment); } - unsafe BuildGPULightListParameters PrepareBuildGPULightListParameters(HDCamera hdCamera, - TileAndClusterData tileAndClusterData, - ref ShaderVariablesLightList constantBuffer, - int totalLightCount) + unsafe BuildGPULightListParameters PrepareBuildGPULightListParameters(HDCamera hdCamera, + TileAndClusterData tileAndClusterData, + ref ShaderVariablesLightList constantBuffer, + int totalLightCount) { BuildGPULightListParameters parameters = new BuildGPULightListParameters(); @@ -3361,8 +3361,8 @@ HDAdditionalLightData GetHDAdditionalLightData(Light light) struct LightLoopGlobalParameters { - public HDCamera hdCamera; - public TileAndClusterData tileAndClusterData; + public HDCamera hdCamera; + public TileAndClusterData tileAndClusterData; } unsafe void UpdateShaderVariablesGlobalLightLoop(ref ShaderVariablesGlobal cb, HDCamera hdCamera) @@ -3405,7 +3405,7 @@ unsafe void UpdateShaderVariablesGlobalLightLoop(ref ShaderVariablesGlobal cb, H // Tile/Cluster cb._NumTileFtplX = (uint)GetNumTileFtplX(hdCamera); cb._NumTileFtplY = (uint)GetNumTileFtplY(hdCamera); - cb.g_fClustScale = (float)(geomSeries / (hdCamera.camera.farClipPlane - hdCamera.camera.nearClipPlane));; + cb.g_fClustScale = (float)(geomSeries / (hdCamera.camera.farClipPlane - hdCamera.camera.nearClipPlane)); ; cb.g_fClustBase = k_ClustLogBase; cb.g_fNearPlane = hdCamera.camera.nearClipPlane; cb.g_fFarPlane = hdCamera.camera.farClipPlane; @@ -3473,23 +3473,23 @@ void GetContactShadowMask(HDAdditionalLightData hdAdditionalLightData, BoolScala struct ContactShadowsParameters { - public ComputeShader contactShadowsCS; - public int kernel; + public ComputeShader contactShadowsCS; + public int kernel; - public Vector4 params1; - public Vector4 params2; - public Vector4 params3; + public Vector4 params1; + public Vector4 params2; + public Vector4 params3; - public int numTilesX; - public int numTilesY; - public int viewCount; + public int numTilesX; + public int numTilesY; + public int viewCount; - public bool rayTracingEnabled; + public bool rayTracingEnabled; public RayTracingShader contactShadowsRTS; public RayTracingAccelerationStructure accelerationStructure; - public int actualWidth; - public int actualHeight; - public int depthTextureParameterName; + public int actualWidth; + public int actualHeight; + public int depthTextureParameterName; } ContactShadowsParameters PrepareContactShadowsParameters(HDCamera hdCamera, float firstMipOffsetY) @@ -3524,7 +3524,7 @@ ContactShadowsParameters PrepareContactShadowsParameters(HDCamera hdCamera, floa parameters.params1 = new Vector4(m_ContactShadows.length.value, m_ContactShadows.distanceScaleFactor.value, contactShadowFadeEnd, contactShadowOneOverFadeRange); parameters.params2 = new Vector4(firstMipOffsetY, contactShadowMinDist, contactShadowFadeIn, m_ContactShadows.rayBias.value * 0.01f); - parameters.params3 = new Vector4(m_ContactShadows.sampleCount, m_ContactShadows.thicknessScale.value * 10.0f , 0.0f, 0.0f); + parameters.params3 = new Vector4(m_ContactShadows.sampleCount, m_ContactShadows.thicknessScale.value * 10.0f, 0.0f, 0.0f); int deferredShadowTileSize = 8; // Must match ContactShadows.compute parameters.numTilesX = (hdCamera.actualWidth + (deferredShadowTileSize - 1)) / deferredShadowTileSize; @@ -3538,11 +3538,11 @@ ContactShadowsParameters PrepareContactShadowsParameters(HDCamera hdCamera, floa } static void RenderContactShadows(in ContactShadowsParameters parameters, - RTHandle contactShadowRT, - RTHandle depthTexture, - LightLoopLightData lightLoopLightData, - ComputeBuffer lightList, - CommandBuffer cmd) + RTHandle contactShadowRT, + RTHandle depthTexture, + LightLoopLightData lightLoopLightData, + ComputeBuffer lightList, + CommandBuffer cmd) { cmd.SetComputeVectorParam(parameters.contactShadowsCS, HDShaderIDs._ContactShadowParamsParameters, parameters.params1); cmd.SetComputeVectorParam(parameters.contactShadowsCS, HDShaderIDs._ContactShadowParamsParameters2, parameters.params2); @@ -3580,24 +3580,24 @@ static void RenderContactShadows(in ContactShadowsParameters parameters, struct DeferredLightingParameters { - public int numTilesX; - public int numTilesY; - public int numTiles; - public bool enableTile; - public bool outputSplitLighting; - public bool useComputeLightingEvaluation; - public bool enableFeatureVariants; - public bool enableShadowMasks; - public int numVariants; + public int numTilesX; + public int numTilesY; + public int numTiles; + public bool enableTile; + public bool outputSplitLighting; + public bool useComputeLightingEvaluation; + public bool enableFeatureVariants; + public bool enableShadowMasks; + public int numVariants; public DebugDisplaySettings debugDisplaySettings; // Compute Lighting - public ComputeShader deferredComputeShader; - public int viewCount; + public ComputeShader deferredComputeShader; + public int viewCount; // Full Screen Pixel (debug) - public Material splitLightingMat; - public Material regularLightingMat; + public Material splitLightingMat; + public Material regularLightingMat; } DeferredLightingParameters PrepareDeferredLightingParameters(HDCamera hdCamera, DebugDisplaySettings debugDisplaySettings) @@ -3806,14 +3806,14 @@ static void RenderPixelDeferredLighting(in DeferredLightingParameters parameters struct LightLoopDebugOverlayParameters { - public Material debugViewTilesMaterial; - public HDShadowManager shadowManager; - public int debugSelectedLightShadowIndex; - public int debugSelectedLightShadowCount; - public Material debugShadowMapMaterial; - public Material debugBlitMaterial; - public LightCookieManager cookieManager; - public PlanarReflectionProbeCache planarProbeCache; + public Material debugViewTilesMaterial; + public HDShadowManager shadowManager; + public int debugSelectedLightShadowIndex; + public int debugSelectedLightShadowCount; + public Material debugShadowMapMaterial; + public Material debugBlitMaterial; + public LightCookieManager cookieManager; + public PlanarReflectionProbeCache planarProbeCache; } LightLoopDebugOverlayParameters PrepareLightLoopDebugOverlayParameters() @@ -3832,13 +3832,13 @@ LightLoopDebugOverlayParameters PrepareLightLoopDebugOverlayParameters() return parameters; } - static void RenderLightLoopDebugOverlay(in DebugParameters debugParameters, - CommandBuffer cmd, - ComputeBuffer tileBuffer, - ComputeBuffer lightListBuffer, - ComputeBuffer perVoxelLightListBuffer, - ComputeBuffer dispatchIndirectBuffer, - RTHandle depthTexture) + static void RenderLightLoopDebugOverlay(in DebugParameters debugParameters, + CommandBuffer cmd, + ComputeBuffer tileBuffer, + ComputeBuffer lightListBuffer, + ComputeBuffer perVoxelLightListBuffer, + ComputeBuffer dispatchIndirectBuffer, + RTHandle depthTexture) { var hdCamera = debugParameters.hdCamera; var parameters = debugParameters.lightingOverlayParameters; diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/ProbeVolume/ProbeVolumeController.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/ProbeVolume/ProbeVolumeController.cs index 33b0c4b801c..1f5278e12ad 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/ProbeVolume/ProbeVolumeController.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/ProbeVolume/ProbeVolumeController.cs @@ -11,7 +11,7 @@ internal class ProbeVolumeController : VolumeComponent internal sealed class LeakMitigationModeParameter : VolumeParameter { public LeakMitigationModeParameter(LeakMitigationMode value, bool overrideState = false) - : base(value, overrideState) {} + : base(value, overrideState) { } } [SerializeField, Tooltip("Selects the heuristic used for mitigating light leaking and self-shadowing artifacts when sampling from the probe volumes.")] diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/ProbeVolume/ProbeVolumeLighting.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/ProbeVolume/ProbeVolumeLighting.cs index ad25be4d9da..05dd8d32f31 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/ProbeVolume/ProbeVolumeLighting.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/ProbeVolume/ProbeVolumeLighting.cs @@ -38,7 +38,7 @@ public static ProbeVolumeEngineData GetNeutralValues() data.rcpNegFaceFade = new Vector3(float.MaxValue, float.MaxValue, float.MaxValue); data.endTimesRcpDistFadeLen = 1; data.scale = Vector3.zero; - data.payloadIndex = -1; + data.payloadIndex = -1; data.bias = Vector3.zero; data.volumeBlendMode = 0; data.octahedralDepthScaleBias = Vector4.zero; @@ -161,9 +161,9 @@ void InitializeProbeVolumes() // This can go away if we add a global keyword for using / completely stripping probe volume code per camera. CreateProbeVolumeBuffersDefault(); - #if UNITY_EDITOR +#if UNITY_EDITOR UnityEditor.Lightmapping.lightingDataCleared += OnLightingDataCleared; - #endif +#endif } internal void CreateProbeVolumeBuffersDefault() @@ -246,11 +246,11 @@ internal void CreateProbeVolumeBuffers() width: s_ProbeVolumeAtlasResolution, height: s_ProbeVolumeAtlasResolution, slices: s_ProbeVolumeAtlasResolution * m_ProbeVolumeAtlasSHRTDepthSliceCount, - dimension: TextureDimension.Tex3D, - colorFormat: k_ProbeVolumeAtlasFormat, + dimension: TextureDimension.Tex3D, + colorFormat: k_ProbeVolumeAtlasFormat, enableRandomWrite: true, - useMipMap: false, - name: "ProbeVolumeAtlasSH" + useMipMap: false, + name: "ProbeVolumeAtlasSH" ); probeVolumeAtlas = new Texture3DAtlasDynamic(s_ProbeVolumeAtlasResolution, s_ProbeVolumeAtlasResolution, s_ProbeVolumeAtlasResolution, k_MaxVisibleProbeVolumeCount, m_ProbeVolumeAtlasSHRTHandle); @@ -311,9 +311,9 @@ void CleanupProbeVolumes() { DestroyProbeVolumeBuffers(); - #if UNITY_EDITOR +#if UNITY_EDITOR UnityEditor.Lightmapping.lightingDataCleared -= OnLightingDataCleared; - #endif +#endif } internal void OnLightingDataCleared() diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/ProbeVolume/ProbeVolumeManager.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/ProbeVolume/ProbeVolumeManager.cs index b437e2280b7..8df0b536e11 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/ProbeVolume/ProbeVolumeManager.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/ProbeVolume/ProbeVolumeManager.cs @@ -23,16 +23,16 @@ private ProbeVolumeManager() volumes = new List(); volumesSelected = new List(); - #if UNITY_EDITOR +#if UNITY_EDITOR SubscribeBakingAPI(); - #endif +#endif } ~ProbeVolumeManager() { - #if UNITY_EDITOR +#if UNITY_EDITOR UnsubscribeBakingAPI(); - #endif +#endif } internal List volumes = null; diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Reflection/HDAdditionalReflectionData.Migration.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Reflection/HDAdditionalReflectionData.Migration.cs index e6a3f705c30..81451096e00 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Reflection/HDAdditionalReflectionData.Migration.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Reflection/HDAdditionalReflectionData.Migration.cs @@ -124,7 +124,7 @@ static readonly MigrationDescription parameters during runtime. /// - public virtual void PrepareCulling() {} + public virtual void PrepareCulling() { } /// /// Requests that Unity renders this Reflection Probe during the next update. diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Reflection/HDRuntimeReflectionSystem.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Reflection/HDRuntimeReflectionSystem.cs index 78d4e2f6eeb..2111c935a15 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Reflection/HDRuntimeReflectionSystem.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Reflection/HDRuntimeReflectionSystem.cs @@ -13,7 +13,7 @@ namespace UnityEngine.Rendering.HighDefinition { class HDRuntimeReflectionSystem : ScriptableRuntimeReflectionSystem { - #if !REFLECTION_PROBE_UPDATE_CACHED_DATA_AVAILABLE +#if !REFLECTION_PROBE_UPDATE_CACHED_DATA_AVAILABLE static MethodInfo BuiltinUpdate; static HDRuntimeReflectionSystem() @@ -24,7 +24,7 @@ static HDRuntimeReflectionSystem() BuiltinUpdate = method; } - #endif +#endif static HDRuntimeReflectionSystem k_instance = new HDRuntimeReflectionSystem(); @@ -44,11 +44,11 @@ static void Initialize() public override bool TickRealtimeProbes() { - #if REFLECTION_PROBE_UPDATE_CACHED_DATA_AVAILABLE +#if REFLECTION_PROBE_UPDATE_CACHED_DATA_AVAILABLE ReflectionProbe.UpdateCachedState(); - #else +#else BuiltinUpdate.Invoke(null, new object[0]); - #endif +#endif return base.TickRealtimeProbes(); } } diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Reflection/PlanarReflectionProbeCache.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Reflection/PlanarReflectionProbeCache.cs index b5f855e366c..5ac653174a9 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Reflection/PlanarReflectionProbeCache.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Reflection/PlanarReflectionProbeCache.cs @@ -16,17 +16,17 @@ enum ProbeFilteringState Ready } - int m_ProbeSize; - IBLFilterGGX m_IBLFilterGGX; - PowerOfTwoTextureAtlas m_TextureAtlas; - RenderTexture m_TempRenderTexture = null; - RenderTexture m_ConvolutionTargetTexture; + int m_ProbeSize; + IBLFilterGGX m_IBLFilterGGX; + PowerOfTwoTextureAtlas m_TextureAtlas; + RenderTexture m_TempRenderTexture = null; + RenderTexture m_ConvolutionTargetTexture; Dictionary m_ProbeBakingState = new Dictionary(); - Material m_ConvertTextureMaterial; - MaterialPropertyBlock m_ConvertTextureMPB; - Dictionary m_TextureHashes = new Dictionary(); - int m_FrameProbeIndex; - GraphicsFormat m_ProbeFormat; + Material m_ConvertTextureMaterial; + MaterialPropertyBlock m_ConvertTextureMPB; + Dictionary m_TextureHashes = new Dictionary(); + int m_FrameProbeIndex; + GraphicsFormat m_ProbeFormat; public PlanarReflectionProbeCache(RenderPipelineResources defaultResources, IBLFilterGGX iblFilter, int atlasResolution, GraphicsFormat probeFormat, bool isMipmaped) { @@ -133,7 +133,7 @@ public Vector4 FetchSlice(CommandBuffer cmd, Texture texture, ref IBLFilterBSDF. bool UpdatePlanarTexture(CommandBuffer cmd, Texture texture, ref IBLFilterBSDF.PlanarTextureFilteringParameters planarTextureFilteringParameters, ref Vector4 scaleOffset) { - bool success = false; + bool success = false; using (new ProfilingScope(cmd, ProfilingSampler.Get(HDProfileId.ConvolvePlanarReflectionProbe))) { @@ -167,7 +167,7 @@ bool UpdatePlanarTexture(CommandBuffer cmd, Texture texture, ref IBLFilterBSDF.P public uint GetTextureHash(Texture texture) { - uint textureHash = texture.updateCount; + uint textureHash = texture.updateCount; // For baked probes in the editor we need to factor in the actual hash of texture because we can't increment the update count of a texture that's baked on the disk. #if UNITY_EDITOR textureHash += (uint)texture.imageContentsHash.GetHashCode(); diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Reflection/ReflectionProbeCache.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Reflection/ReflectionProbeCache.cs index db4aa7364e2..fec6c451dab 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Reflection/ReflectionProbeCache.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Reflection/ReflectionProbeCache.cs @@ -11,19 +11,19 @@ enum ProbeFilteringState Ready } - int m_ProbeSize; - int m_CacheSize; - IBLFilterBSDF[] m_IBLFilterBSDF; - TextureCacheCubemap m_TextureCache; - RenderTexture m_TempRenderTexture; - RenderTexture[] m_ConvolutionTargetTextureArray; - ProbeFilteringState[] m_ProbeBakingState; - Material m_ConvertTextureMaterial; - Material m_CubeToPano; - MaterialPropertyBlock m_ConvertTextureMPB; - bool m_PerformBC6HCompression; - - GraphicsFormat m_ProbeFormat; + int m_ProbeSize; + int m_CacheSize; + IBLFilterBSDF[] m_IBLFilterBSDF; + TextureCacheCubemap m_TextureCache; + RenderTexture m_TempRenderTexture; + RenderTexture[] m_ConvolutionTargetTextureArray; + ProbeFilteringState[] m_ProbeBakingState; + Material m_ConvertTextureMaterial; + Material m_CubeToPano; + MaterialPropertyBlock m_ConvertTextureMPB; + bool m_PerformBC6HCompression; + + GraphicsFormat m_ProbeFormat; public ReflectionProbeCache(RenderPipelineResources defaultResources, IBLFilterBSDF[] iblFilterBSDFArray, int cacheSize, int probeSize, GraphicsFormat probeFormat, bool isMipmaped) { diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Reflection/Volume/InfluenceVolume.Migration.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Reflection/Volume/InfluenceVolume.Migration.cs index 3c87c7b616b..f0df19c3cd6 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Reflection/Volume/InfluenceVolume.Migration.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Reflection/Volume/InfluenceVolume.Migration.cs @@ -38,7 +38,7 @@ enum Version #pragma warning restore 649 //never assigned /// Serialization callback - public void OnBeforeSerialize() {} + public void OnBeforeSerialize() { } /// Serialization callback public void OnAfterDeserialize() => k_Migration.Migrate(this); } diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Reflection/Volume/InfluenceVolume.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Reflection/Volume/InfluenceVolume.cs index bdd8f8f34d1..3f89d95691b 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Reflection/Volume/InfluenceVolume.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Reflection/Volume/InfluenceVolume.cs @@ -49,7 +49,7 @@ public partial class InfluenceVolume /// Offset of sub volume defining fading. public Vector3 boxBlendOffset => (boxBlendDistanceNegative - boxBlendDistancePositive) * 0.5f; /// Size of sub volume defining fading. - public Vector3 boxBlendSize => - (boxBlendDistancePositive + boxBlendDistanceNegative); + public Vector3 boxBlendSize => -(boxBlendDistancePositive + boxBlendDistanceNegative); /// /// Position of fade sub volume maxOffset point relative to InfluenceVolume max corner. /// Values between 0 (on InfluenceVolume hull) to half of boxSize corresponding axis. @@ -64,7 +64,7 @@ public partial class InfluenceVolume /// Offset of sub volume defining fading relative to normal orientation. public Vector3 boxBlendNormalOffset => (boxBlendNormalDistanceNegative - boxBlendNormalDistancePositive) * 0.5f; /// Size of sub volume defining fading relative to normal orientation. - public Vector3 boxBlendNormalSize => - (boxBlendNormalDistancePositive + boxBlendNormalDistanceNegative); + public Vector3 boxBlendNormalSize => -(boxBlendNormalDistancePositive + boxBlendNormalDistanceNegative); /// /// Position of normal fade sub volume maxOffset point relative to InfluenceVolume max corner. /// Values between 0 (on InfluenceVolume hull) to half of boxSize corresponding axis (on origin for this axis). diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Reflection/Volume/ProxyVolume.Migration.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Reflection/Volume/ProxyVolume.Migration.cs index 8005adf3f43..9514356eed0 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Reflection/Volume/ProxyVolume.Migration.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Reflection/Volume/ProxyVolume.Migration.cs @@ -35,7 +35,7 @@ enum Version bool m_ObsoleteBoxInfiniteProjection = false; /// Serialization callback - void ISerializationCallbackReceiver.OnBeforeSerialize() {} + void ISerializationCallbackReceiver.OnBeforeSerialize() { } /// Serialization callback void ISerializationCallbackReceiver.OnAfterDeserialize() => k_Migration.Migrate(this); } diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/ScreenSpaceLighting/AmbientOcclusion.RenderGraph.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/ScreenSpaceLighting/AmbientOcclusion.RenderGraph.cs index ba120c65e99..87d7b27e799 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/ScreenSpaceLighting/AmbientOcclusion.RenderGraph.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/ScreenSpaceLighting/AmbientOcclusion.RenderGraph.cs @@ -61,10 +61,10 @@ public TextureHandle Render(RenderGraph renderGraph, HDCamera hdCamera, TextureH class RenderAOPassData { - public RenderAOParameters parameters; - public TextureHandle packedData; - public TextureHandle depthPyramid; - public TextureHandle normalBuffer; + public RenderAOParameters parameters; + public TextureHandle packedData; + public TextureHandle depthPyramid; + public TextureHandle normalBuffer; } TextureHandle RenderAO(RenderGraph renderGraph, in RenderAOParameters parameters, TextureHandle depthPyramid, TextureHandle normalBuffer) @@ -77,7 +77,7 @@ TextureHandle RenderAO(RenderGraph renderGraph, in RenderAOParameters parameters passData.parameters = parameters; passData.packedData = builder.WriteTexture(renderGraph.CreateTexture(new TextureDesc(Vector2.one * scaleFactor, true, true) - { colorFormat = GraphicsFormat.R32_SFloat, enableRandomWrite = true, name = "AO Packed data" })); + { colorFormat = GraphicsFormat.R32_SFloat, enableRandomWrite = true, name = "AO Packed data" })); passData.depthPyramid = builder.ReadTexture(depthPyramid); passData.normalBuffer = builder.ReadTexture(normalBuffer); @@ -93,22 +93,22 @@ TextureHandle RenderAO(RenderGraph renderGraph, in RenderAOParameters parameters class DenoiseAOPassData { - public RenderAOParameters parameters; - public TextureHandle packedData; - public TextureHandle packedDataBlurred; - public TextureHandle currentHistory; - public TextureHandle outputHistory; - public TextureHandle denoiseOutput; - public TextureHandle motionVectors; + public RenderAOParameters parameters; + public TextureHandle packedData; + public TextureHandle packedDataBlurred; + public TextureHandle currentHistory; + public TextureHandle outputHistory; + public TextureHandle denoiseOutput; + public TextureHandle motionVectors; } - TextureHandle DenoiseAO(RenderGraph renderGraph, - in RenderAOParameters parameters, - TextureHandle depthTexture, - TextureHandle motionVectors, - TextureHandle aoPackedData, - TextureHandle currentHistory, - TextureHandle outputHistory) + TextureHandle DenoiseAO(RenderGraph renderGraph, + in RenderAOParameters parameters, + TextureHandle depthTexture, + TextureHandle motionVectors, + TextureHandle aoPackedData, + TextureHandle currentHistory, + TextureHandle outputHistory) { if (!parameters.temporalAccumulation && !parameters.fullResolution) return aoPackedData; @@ -159,10 +159,10 @@ TextureHandle DenoiseAO(RenderGraph renderGraph, class UpsampleAOPassData { - public RenderAOParameters parameters; - public TextureHandle depthTexture; - public TextureHandle input; - public TextureHandle output; + public RenderAOParameters parameters; + public TextureHandle depthTexture; + public TextureHandle input; + public TextureHandle output; } TextureHandle UpsampleAO(RenderGraph renderGraph, in RenderAOParameters parameters, TextureHandle input, TextureHandle depthTexture) diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/ScreenSpaceLighting/AmbientOcclusion.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/ScreenSpaceLighting/AmbientOcclusion.cs index 44de820c7bd..ef713fce61e 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/ScreenSpaceLighting/AmbientOcclusion.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/ScreenSpaceLighting/AmbientOcclusion.cs @@ -257,27 +257,27 @@ internal float EvaluateSpecularOcclusionFlag(HDCamera hdCamera) struct RenderAOParameters { - public ComputeShader gtaoCS; - public int gtaoKernel; - public ComputeShader spatialDenoiseAOCS; - public int denoiseKernelSpatial; - public ComputeShader temporalDenoiseAOCS; - public int denoiseKernelTemporal; - public ComputeShader copyHistoryAOCS; - public int denoiseKernelCopyHistory; - public ComputeShader upsampleAndBlurAOCS; - public int upsampleAndBlurKernel; - public int upsampleAOKernel; - - public Vector2 runningRes; - public int viewCount; - public bool historyReady; - public int outputWidth; - public int outputHeight; - public bool fullResolution; - public bool runAsync; - public bool temporalAccumulation; - public bool bilateralUpsample; + public ComputeShader gtaoCS; + public int gtaoKernel; + public ComputeShader spatialDenoiseAOCS; + public int denoiseKernelSpatial; + public ComputeShader temporalDenoiseAOCS; + public int denoiseKernelTemporal; + public ComputeShader copyHistoryAOCS; + public int denoiseKernelCopyHistory; + public ComputeShader upsampleAndBlurAOCS; + public int upsampleAndBlurKernel; + public int upsampleAOKernel; + + public Vector2 runningRes; + public int viewCount; + public bool historyReady; + public int outputWidth; + public int outputHeight; + public bool fullResolution; + public bool runAsync; + public bool temporalAccumulation; + public bool bilateralUpsample; public ShaderVariablesAmbientOcclusion cb; } @@ -428,11 +428,11 @@ RenderAOParameters PrepareRenderAOParameters(HDCamera camera, Vector2 historySiz return parameters; } - static void RenderAO(in RenderAOParameters parameters, - RTHandle packedDataTexture, - RTHandle depthTexture, - RTHandle normalBuffer, - CommandBuffer cmd) + static void RenderAO(in RenderAOParameters parameters, + RTHandle packedDataTexture, + RTHandle depthTexture, + RTHandle normalBuffer, + CommandBuffer cmd) { ConstantBuffer.Push(cmd, parameters.cb, parameters.gtaoCS, HDShaderIDs._ShaderVariablesAmbientOcclusion); cmd.SetComputeTextureParam(parameters.gtaoCS, parameters.gtaoKernel, HDShaderIDs._AOPackedData, packedDataTexture); @@ -447,14 +447,14 @@ static void RenderAO(in RenderAOParameters parameters, cmd.DispatchCompute(parameters.gtaoCS, parameters.gtaoKernel, threadGroupX, threadGroupY, parameters.viewCount); } - static void DenoiseAO(in RenderAOParameters parameters, - RTHandle packedDataTex, - RTHandle packedDataBlurredTex, - RTHandle packedHistoryTex, - RTHandle packedHistoryOutputTex, - RTHandle motionVectors, - RTHandle aoOutputTex, - CommandBuffer cmd) + static void DenoiseAO(in RenderAOParameters parameters, + RTHandle packedDataTex, + RTHandle packedDataBlurredTex, + RTHandle packedHistoryTex, + RTHandle packedHistoryOutputTex, + RTHandle motionVectors, + RTHandle aoOutputTex, + CommandBuffer cmd) { const int groupSizeX = 8; const int groupSizeY = 8; @@ -503,11 +503,11 @@ static void DenoiseAO(in RenderAOParameters parameters, } } - static void UpsampleAO(in RenderAOParameters parameters, - RTHandle depthTexture, - RTHandle input, - RTHandle output, - CommandBuffer cmd) + static void UpsampleAO(in RenderAOParameters parameters, + RTHandle depthTexture, + RTHandle input, + RTHandle output, + CommandBuffer cmd) { bool blurAndUpsample = !parameters.temporalAccumulation; diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/ScreenSpaceLighting/SSGIDenoiser.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/ScreenSpaceLighting/SSGIDenoiser.cs index fafdc44d7a9..bcaf0281d4b 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/ScreenSpaceLighting/SSGIDenoiser.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/ScreenSpaceLighting/SSGIDenoiser.cs @@ -282,9 +282,9 @@ public SSGIDenoiserOutput Denoise(RenderGraph renderGraph, HDCamera hdCamera, var historyDepthBuffer = halfResolution ? hdCamera.GetCurrentFrameRT((int)HDCameraFrameHistoryType.Depth1) : hdCamera.GetCurrentFrameRT((int)HDCameraFrameHistoryType.Depth); passData.historyDepthBuffer = historyDepthBuffer != null ? builder.ReadTexture(renderGraph.ImportTexture(historyDepthBuffer)) : renderGraph.defaultResources.blackTextureXR; passData.intermediateBuffer0 = builder.CreateTransientTexture(new TextureDesc(Vector2.one, true, true) - { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, enableRandomWrite = true, name = "SSGI Denoiser Intermediate0" }); + { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, enableRandomWrite = true, name = "SSGI Denoiser Intermediate0" }); passData.intermediateBuffer1 = builder.CreateTransientTexture(new TextureDesc(Vector2.one, true, true) - { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, enableRandomWrite = true, name = "SSGI Denoiser Intermediate1" }); + { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, enableRandomWrite = true, name = "SSGI Denoiser Intermediate1" }); passData.inputOutputBuffer0 = builder.ReadWriteTexture(inputOutputBuffer0); passData.inputOutputBuffer1 = builder.ReadWriteTexture(inputOutputBuffer1); diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/ScreenSpaceLighting/ScreenSpaceGlobalIllumination.RenderGraph.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/ScreenSpaceLighting/ScreenSpaceGlobalIllumination.RenderGraph.cs index 6ad13bd1638..f0f5c942c40 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/ScreenSpaceLighting/ScreenSpaceGlobalIllumination.RenderGraph.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/ScreenSpaceLighting/ScreenSpaceGlobalIllumination.RenderGraph.cs @@ -47,11 +47,11 @@ TraceOutput TraceSSGI(RenderGraph renderGraph, HDCamera hdCamera, GlobalIllumina var historyDepth = hdCamera.GetCurrentFrameRT((int)HDCameraFrameHistoryType.Depth); passData.historyDepth = historyDepth != null ? builder.ReadTexture(renderGraph.ImportTexture(historyDepth)) : renderGraph.defaultResources.blackTextureXR; passData.hitPointBuffer = builder.CreateTransientTexture(new TextureDesc(Vector2.one, true, true) - { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, enableRandomWrite = true, name = "SSGI Hit Point"}); + { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, enableRandomWrite = true, name = "SSGI Hit Point" }); passData.outputBuffer0 = builder.WriteTexture(renderGraph.CreateTexture(new TextureDesc(Vector2.one, true, true) - { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, enableRandomWrite = true, name = "SSGI Signal0"})); + { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, enableRandomWrite = true, name = "SSGI Signal0" })); passData.outputBuffer1 = builder.WriteTexture(renderGraph.CreateTexture(new TextureDesc(Vector2.one, true, true) - { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, enableRandomWrite = true, name = "SSGI Signal1" })); + { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, enableRandomWrite = true, name = "SSGI Signal1" })); builder.SetRenderFunc( (TraceSSGIPassData data, RenderGraphContext ctx) => @@ -93,7 +93,7 @@ TextureHandle UpscaleSSGI(RenderGraph renderGraph, HDCamera hdCamera, GlobalIllu passData.depthTexture = builder.ReadTexture(depthPyramid); passData.inputBuffer = builder.ReadTexture(inputBuffer); passData.outputBuffer = builder.WriteTexture(renderGraph.CreateTexture(new TextureDesc(Vector2.one, true, true) - { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, enableRandomWrite = true, name = "SSGI Final" })); + { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, enableRandomWrite = true, name = "SSGI Final" })); builder.SetRenderFunc( (UpscaleSSGIPassData data, RenderGraphContext ctx) => diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/ScreenSpaceLighting/ScreenSpaceReflection.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/ScreenSpaceLighting/ScreenSpaceReflection.cs index 073cb1df9f1..391f0c88ed1 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/ScreenSpaceLighting/ScreenSpaceReflection.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/ScreenSpaceLighting/ScreenSpaceReflection.cs @@ -27,7 +27,7 @@ public sealed class SSRAlgoParameter : VolumeParameterSSR Algo Type parameter. /// Initial override state. public SSRAlgoParameter(ScreenSpaceReflectionAlgorithm value, bool overrideState = false) - : base(value, overrideState) {} + : base(value, overrideState) { } } /// diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/ScreenSpaceLighting/ShaderVariablesScreenSpaceReflection.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/ScreenSpaceLighting/ShaderVariablesScreenSpaceReflection.cs index 0ed5a611b0b..f02f9002494 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/ScreenSpaceLighting/ShaderVariablesScreenSpaceReflection.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/ScreenSpaceLighting/ShaderVariablesScreenSpaceReflection.cs @@ -3,21 +3,21 @@ namespace UnityEngine.Rendering.HighDefinition [GenerateHLSL(needAccessors = false, generateCBuffer = true)] unsafe struct ShaderVariablesScreenSpaceReflection { - public float _SsrThicknessScale; - public float _SsrThicknessBias; - public int _SsrStencilBit; - public int _SsrIterLimit; + public float _SsrThicknessScale; + public float _SsrThicknessBias; + public int _SsrStencilBit; + public int _SsrIterLimit; - public float _SsrRoughnessFadeEnd; - public float _SsrRoughnessFadeRcpLength; - public float _SsrRoughnessFadeEndTimesRcpLength; - public float _SsrEdgeFadeRcpLength; + public float _SsrRoughnessFadeEnd; + public float _SsrRoughnessFadeRcpLength; + public float _SsrRoughnessFadeEndTimesRcpLength; + public float _SsrEdgeFadeRcpLength; public Vector4 _ColorPyramidUvScaleAndLimitPrevFrame; - public int _SsrDepthPyramidMaxMip; - public int _SsrColorPyramidMaxMip; - public int _SsrReflectsSky; - public float _SsrAccumulationAmount; + public int _SsrDepthPyramidMaxMip; + public int _SsrColorPyramidMaxMip; + public int _SsrReflectsSky; + public float _SsrAccumulationAmount; } } diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/ContactShadows.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/ContactShadows.cs index f3c9037e74e..8100c095a6f 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/ContactShadows.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/ContactShadows.cs @@ -13,44 +13,44 @@ public class ContactShadows : VolumeComponentWithQuality /// /// When enabled, HDRP processes Contact Shadows for this Volume. /// - public BoolParameter enable = new BoolParameter(false); + public BoolParameter enable = new BoolParameter(false); /// /// Controls the length of the rays HDRP uses to calculate Contact Shadows. It is in meters, but it gets scaled by a factor depending on Distance Scale Factor /// and the depth of the point from where the contact shadow ray is traced. /// - public ClampedFloatParameter length = new ClampedFloatParameter(0.15f, 0.0f, 1.0f); + public ClampedFloatParameter length = new ClampedFloatParameter(0.15f, 0.0f, 1.0f); /// /// Controls the opacity of the contact shadows. /// - public ClampedFloatParameter opacity = new ClampedFloatParameter(1.0f, 0.0f, 1.0f); + public ClampedFloatParameter opacity = new ClampedFloatParameter(1.0f, 0.0f, 1.0f); /// /// Scales the length of the contact shadow ray based on the linear depth value at the origin of the ray. /// - public ClampedFloatParameter distanceScaleFactor = new ClampedFloatParameter(0.5f, 0.0f, 1.0f); + public ClampedFloatParameter distanceScaleFactor = new ClampedFloatParameter(0.5f, 0.0f, 1.0f); /// /// The distance from the camera, in meters, at which HDRP begins to fade out Contact Shadows. /// - public MinFloatParameter maxDistance = new MinFloatParameter(50.0f, 0.0f); + public MinFloatParameter maxDistance = new MinFloatParameter(50.0f, 0.0f); /// /// The distance from the camera, in meters, at which HDRP begins to fade in Contact Shadows. /// - public MinFloatParameter minDistance = new MinFloatParameter(0.0f, 0.0f); + public MinFloatParameter minDistance = new MinFloatParameter(0.0f, 0.0f); /// /// The distance, in meters, over which HDRP fades Contact Shadows out when past the Max Distance. /// - public MinFloatParameter fadeDistance = new MinFloatParameter(5.0f, 0.0f); + public MinFloatParameter fadeDistance = new MinFloatParameter(5.0f, 0.0f); /// /// The distance, in meters, over which HDRP fades Contact Shadows in when past the Min Distance. /// - public MinFloatParameter fadeInDistance = new MinFloatParameter(0.0f, 0.0f); + public MinFloatParameter fadeInDistance = new MinFloatParameter(0.0f, 0.0f); /// /// Controls the bias applied to the screen space ray cast to get contact shadows. /// - public ClampedFloatParameter rayBias = new ClampedFloatParameter(0.2f, 0.0f, 1.0f); + public ClampedFloatParameter rayBias = new ClampedFloatParameter(0.2f, 0.0f, 1.0f); /// /// Controls the thickness of the objects found along the ray, essentially thickening the contact shadows. /// - public ClampedFloatParameter thicknessScale = new ClampedFloatParameter(0.15f, 0.02f, 1.0f); + public ClampedFloatParameter thicknessScale = new ClampedFloatParameter(0.15f, 0.02f, 1.0f); /// diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/HDCachedShadowManager.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/HDCachedShadowManager.cs index 56ff0ffaea9..7fa468524f6 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/HDCachedShadowManager.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/HDCachedShadowManager.cs @@ -24,7 +24,7 @@ public class HDCachedShadowManager private Vector3 m_CachedDirectionalAngles; // Helper array used to check what has been tmp filled. - private (int, int)[] m_TempFilled = new(int, int)[6]; + private (int, int)[] m_TempFilled = new (int, int)[6]; // Cached atlas internal HDCachedShadowAtlas punctualShadowAtlas; diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/HDDynamicShadowAtlas.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/HDDynamicShadowAtlas.cs index ae5b5037b81..1c7e6ecc635 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/HDDynamicShadowAtlas.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/HDDynamicShadowAtlas.cs @@ -6,8 +6,8 @@ namespace UnityEngine.Rendering.HighDefinition { partial class HDDynamicShadowAtlas : HDShadowAtlas { - readonly List m_ShadowResolutionRequests = new List(); - readonly List m_MixedRequestsPendingBlits = new List(); + readonly List m_ShadowResolutionRequests = new List(); + readonly List m_MixedRequestsPendingBlits = new List(); float m_RcpScaleFactor = 1; HDShadowResolutionRequest[] m_SortedRequestsCache; @@ -185,9 +185,9 @@ public bool HasPendingBlitsRequests() internal struct ShadowBlitParameters { public List requestsWaitingBlits; - public Material blitMaterial; + public Material blitMaterial; public MaterialPropertyBlock blitMaterialPropertyBlock; - public Vector2Int cachedShadowAtlasSize; + public Vector2Int cachedShadowAtlasSize; } internal ShadowBlitParameters PrepareShadowBlitParameters(HDCachedShadowAtlas cachedAtlas, Material blitMaterial, MaterialPropertyBlock blitMpb) diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/HDShadowAtlas.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/HDShadowAtlas.cs index 2164f844d1c..45e0443730f 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/HDShadowAtlas.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/HDShadowAtlas.cs @@ -57,21 +57,21 @@ public enum BlurAlgorithm protected List m_ShadowRequests = new List(); - public int width { get; private set; } - public int height { get; private set; } - - Material m_ClearMaterial; - LightingDebugSettings m_LightingDebugSettings; - FilterMode m_FilterMode; - DepthBits m_DepthBufferBits; - RenderTextureFormat m_Format; - string m_Name; - string m_MomentName; - string m_MomentCopyName; - string m_IntermediateSummedAreaName; - string m_SummedAreaName; - int m_AtlasShaderID; - RenderPipelineResources m_RenderPipelineResources; + public int width { get; private set; } + public int height { get; private set; } + + Material m_ClearMaterial; + LightingDebugSettings m_LightingDebugSettings; + FilterMode m_FilterMode; + DepthBits m_DepthBufferBits; + RenderTextureFormat m_Format; + string m_Name; + string m_MomentName; + string m_MomentCopyName; + string m_IntermediateSummedAreaName; + string m_SummedAreaName; + int m_AtlasShaderID; + RenderPipelineResources m_RenderPipelineResources; // Moment shadow data BlurAlgorithm m_BlurAlgorithm; @@ -84,7 +84,7 @@ public enum BlurAlgorithm // if false we filter only for dynamic) protected bool m_IsACacheForShadows; - public HDShadowAtlas() {} + public HDShadowAtlas() { } public virtual void InitAtlas(HDShadowAtlasInitParameters initParams) { @@ -133,18 +133,18 @@ public void UpdateDebugSettings(LightingDebugSettings lightingDebugSettings) struct RenderShadowsParameters { - public ShaderVariablesGlobal globalCB; - public List shadowRequests; - public Material clearMaterial; - public bool debugClearAtlas; - public int atlasShaderID; - public BlurAlgorithm blurAlgorithm; + public ShaderVariablesGlobal globalCB; + public List shadowRequests; + public Material clearMaterial; + public bool debugClearAtlas; + public int atlasShaderID; + public BlurAlgorithm blurAlgorithm; // EVSM - public ComputeShader evsmShadowBlurMomentsCS; + public ComputeShader evsmShadowBlurMomentsCS; // IM - public ComputeShader imShadowBlurMomentsCS; + public ComputeShader imShadowBlurMomentsCS; } RenderShadowsParameters PrepareRenderShadowsParameters(in ShaderVariablesGlobal globalCB) @@ -166,13 +166,13 @@ RenderShadowsParameters PrepareRenderShadowsParameters(in ShaderVariablesGlobal return parameters; } - static void RenderShadows(in RenderShadowsParameters parameters, - RTHandle atlasRenderTexture, - ShadowDrawingSettings shadowDrawSettings, - ScriptableRenderContext renderContext, - bool renderingOnAShadowCache, + static void RenderShadows(in RenderShadowsParameters parameters, + RTHandle atlasRenderTexture, + ShadowDrawingSettings shadowDrawSettings, + ScriptableRenderContext renderContext, + bool renderingOnAShadowCache, ConstantBuffer constantBuffer, - CommandBuffer cmd) + CommandBuffer cmd) { cmd.SetRenderTarget(atlasRenderTexture, RenderBufferLoadAction.DontCare, RenderBufferStoreAction.Store); diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/HDShadowManager.RenderGraph.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/HDShadowManager.RenderGraph.cs index 37fc0eb0335..91da1d3c331 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/HDShadowManager.RenderGraph.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/HDShadowManager.RenderGraph.cs @@ -305,9 +305,9 @@ internal TextureHandle RenderShadows(RenderGraph renderGraph, CullingResults cul passData.atlasTexture = builder.WriteTexture(renderGraph.CreateTexture(GetShadowMapTextureDesc())); passData.momentAtlasTexture1 = builder.WriteTexture(GetOutputTexture(renderGraph)); passData.intermediateSummedAreaTexture = builder.WriteTexture(renderGraph.CreateTexture(new TextureDesc(width, height) - { colorFormat = GraphicsFormat.R32G32B32A32_SInt, name = m_IntermediateSummedAreaName, enableRandomWrite = true })); + { colorFormat = GraphicsFormat.R32G32B32A32_SInt, name = m_IntermediateSummedAreaName, enableRandomWrite = true })); passData.summedAreaTexture = builder.WriteTexture(renderGraph.CreateTexture(new TextureDesc(width, height) - { colorFormat = GraphicsFormat.R32G32B32A32_SInt, name = m_SummedAreaName, enableRandomWrite = true })); + { colorFormat = GraphicsFormat.R32G32B32A32_SInt, name = m_SummedAreaName, enableRandomWrite = true })); } else { diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/HDShadowManager.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/HDShadowManager.cs index 7cd2e499f38..f6fec9132d9 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/HDShadowManager.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/HDShadowManager.cs @@ -45,26 +45,26 @@ enum ShadowMapUpdateType [GenerateHLSL(needAccessors = false)] struct HDShadowData { - public Vector3 rot0; - public Vector3 rot1; - public Vector3 rot2; - public Vector3 pos; - public Vector4 proj; + public Vector3 rot0; + public Vector3 rot1; + public Vector3 rot2; + public Vector3 pos; + public Vector4 proj; - public Vector2 atlasOffset; - public float worldTexelSize; - public float normalBias; + public Vector2 atlasOffset; + public float worldTexelSize; + public float normalBias; [SurfaceDataAttributes(precision = FieldPrecision.Real)] - public Vector4 zBufferParam; - public Vector4 shadowMapSize; + public Vector4 zBufferParam; + public Vector4 shadowMapSize; - public Vector4 shadowFilterParams0; + public Vector4 shadowFilterParams0; - public Vector3 cacheTranslationDelta; - public float isInCachedAtlas; + public Vector3 cacheTranslationDelta; + public float isInCachedAtlas; - public Matrix4x4 shadowToWorld; + public Matrix4x4 shadowToWorld; } // We use a different structure for directional light because these is a lot of data there @@ -75,68 +75,68 @@ unsafe struct HDDirectionalShadowData { // We can't use Vector4 here because the vector4[] makes this struct non blittable [HLSLArray(4, typeof(Vector4))] - public fixed float sphereCascades[4 * 4]; + public fixed float sphereCascades[4 * 4]; [SurfaceDataAttributes(precision = FieldPrecision.Real)] - public Vector4 cascadeDirection; + public Vector4 cascadeDirection; [HLSLArray(4, typeof(float))] [SurfaceDataAttributes(precision = FieldPrecision.Real)] - public fixed float cascadeBorders[4]; + public fixed float cascadeBorders[4]; } class HDShadowRequest { - public Matrix4x4 view; + public Matrix4x4 view; // Use the y flipped device projection matrix as light projection matrix - public Matrix4x4 deviceProjectionYFlip; - public Matrix4x4 deviceProjection; - public Matrix4x4 projection; - public Matrix4x4 shadowToWorld; - public Vector3 position; - public Vector4 zBufferParam; + public Matrix4x4 deviceProjectionYFlip; + public Matrix4x4 deviceProjection; + public Matrix4x4 projection; + public Matrix4x4 shadowToWorld; + public Vector3 position; + public Vector4 zBufferParam; // Warning: these viewport fields are updated by ProcessShadowRequests and are invalid before - public Rect dynamicAtlasViewport; - public Rect cachedAtlasViewport; - public bool zClip; - public Vector4[] frustumPlanes; + public Rect dynamicAtlasViewport; + public Rect cachedAtlasViewport; + public bool zClip; + public Vector4[] frustumPlanes; // Store the final shadow indice in the shadow data array // Warning: the index is computed during ProcessShadowRequest and so is invalid before calling this function - public int shadowIndex; + public int shadowIndex; // Determine in which atlas the shadow will be rendered - public ShadowMapType shadowMapType = ShadowMapType.PunctualAtlas; + public ShadowMapType shadowMapType = ShadowMapType.PunctualAtlas; // TODO: Remove these field once scriptable culling is here (currently required by ScriptableRenderContext.DrawShadows) - public int lightIndex; - public ShadowSplitData splitData; + public int lightIndex; + public ShadowSplitData splitData; // end - public float normalBias; - public float worldTexelSize; - public float slopeBias; + public float normalBias; + public float worldTexelSize; + public float slopeBias; // PCSS parameters - public float shadowSoftness; - public int blockerSampleCount; - public int filterSampleCount; - public float minFilterSize; + public float shadowSoftness; + public int blockerSampleCount; + public int filterSampleCount; + public float minFilterSize; // IMS parameters - public float kernelSize; - public float lightAngle; - public float maxDepthBias; + public float kernelSize; + public float lightAngle; + public float maxDepthBias; - public Vector4 evsmParams; + public Vector4 evsmParams; - public bool shouldUseCachedShadowData = false; - public bool shouldRenderCachedComponent = false; + public bool shouldUseCachedShadowData = false; + public bool shouldRenderCachedComponent = false; public HDShadowData cachedShadowData; - public bool isInCachedAtlas; - public bool isMixedCached = false; + public bool isInCachedAtlas; + public bool isMixedCached = false; } enum DirectionalShadowAlgorithm @@ -190,22 +190,22 @@ internal static HDShadowAtlasInitParams GetDefault() internal static HDShadowInitParameters NewDefault() => new HDShadowInitParameters() { - maxShadowRequests = k_DefaultMaxShadowRequests, - directionalShadowsDepthBits = k_DefaultShadowMapDepthBits, - punctualLightShadowAtlas = HDShadowAtlasInitParams.GetDefault(), - areaLightShadowAtlas = HDShadowAtlasInitParams.GetDefault(), - cachedPunctualLightShadowAtlas = 2048, - cachedAreaLightShadowAtlas = 1024, - shadowResolutionDirectional = new IntScalableSetting(new[] { 256, 512, 1024, 2048 }, ScalableSettingSchemaId.With4Levels), - shadowResolutionArea = new IntScalableSetting(new[] { 256, 512, 1024, 2048 }, ScalableSettingSchemaId.With4Levels), - shadowResolutionPunctual = new IntScalableSetting(new[] { 256, 512, 1024, 2048 }, ScalableSettingSchemaId.With4Levels), - shadowFilteringQuality = HDShadowFilteringQuality.Medium, - supportScreenSpaceShadows = false, - maxScreenSpaceShadowSlots = 4, - screenSpaceShadowBufferFormat = ScreenSpaceShadowFormat.R16G16B16A16, - maxDirectionalShadowMapResolution = 2048, - maxAreaShadowMapResolution = 2048, - maxPunctualShadowMapResolution = 2048, + maxShadowRequests = k_DefaultMaxShadowRequests, + directionalShadowsDepthBits = k_DefaultShadowMapDepthBits, + punctualLightShadowAtlas = HDShadowAtlasInitParams.GetDefault(), + areaLightShadowAtlas = HDShadowAtlasInitParams.GetDefault(), + cachedPunctualLightShadowAtlas = 2048, + cachedAreaLightShadowAtlas = 1024, + shadowResolutionDirectional = new IntScalableSetting(new[] { 256, 512, 1024, 2048 }, ScalableSettingSchemaId.With4Levels), + shadowResolutionArea = new IntScalableSetting(new[] { 256, 512, 1024, 2048 }, ScalableSettingSchemaId.With4Levels), + shadowResolutionPunctual = new IntScalableSetting(new[] { 256, 512, 1024, 2048 }, ScalableSettingSchemaId.With4Levels), + shadowFilteringQuality = HDShadowFilteringQuality.Medium, + supportScreenSpaceShadows = false, + maxScreenSpaceShadowSlots = 4, + screenSpaceShadowBufferFormat = ScreenSpaceShadowFormat.R16G16B16A16, + maxDirectionalShadowMapResolution = 2048, + maxAreaShadowMapResolution = 2048, + maxPunctualShadowMapResolution = 2048, }; internal const int k_DefaultShadowAtlasResolution = 4096; @@ -256,10 +256,10 @@ internal static HDShadowAtlasInitParams GetDefault() class HDShadowResolutionRequest { - public Rect dynamicAtlasViewport; - public Rect cachedAtlasViewport; - public Vector2 resolution; - public ShadowMapType shadowMapType; + public Rect dynamicAtlasViewport; + public Rect cachedAtlasViewport; + public Vector2 resolution; + public ShadowMapType shadowMapType; public HDShadowResolutionRequest ShallowCopy() { @@ -269,38 +269,38 @@ public HDShadowResolutionRequest ShallowCopy() partial class HDShadowManager { - public const int k_DirectionalShadowCascadeCount = 4; - public const int k_MinShadowMapResolution = 16; - public const int k_MaxShadowMapResolution = 16384; + public const int k_DirectionalShadowCascadeCount = 4; + public const int k_MinShadowMapResolution = 16; + public const int k_MaxShadowMapResolution = 16384; - List m_ShadowDatas = new List(); - HDShadowRequest[] m_ShadowRequests; + List m_ShadowDatas = new List(); + HDShadowRequest[] m_ShadowRequests; HDShadowResolutionRequest[] m_ShadowResolutionRequests; - HDDirectionalShadowData[] m_CachedDirectionalShadowData; + HDDirectionalShadowData[] m_CachedDirectionalShadowData; - HDDirectionalShadowData m_DirectionalShadowData; + HDDirectionalShadowData m_DirectionalShadowData; // Structured buffer of shadow datas - ComputeBuffer m_ShadowDataBuffer; - ComputeBuffer m_DirectionalShadowDataBuffer; + ComputeBuffer m_ShadowDataBuffer; + ComputeBuffer m_DirectionalShadowDataBuffer; // The two shadowmaps atlases we uses, one for directional cascade (without resize) and the second for the rest of the shadows - HDDynamicShadowAtlas m_CascadeAtlas; - HDDynamicShadowAtlas m_Atlas; - HDDynamicShadowAtlas m_AreaLightShadowAtlas; + HDDynamicShadowAtlas m_CascadeAtlas; + HDDynamicShadowAtlas m_Atlas; + HDDynamicShadowAtlas m_AreaLightShadowAtlas; - int m_MaxShadowRequests; - int m_ShadowRequestCount; - int m_CascadeCount; - int m_ShadowResolutionRequestCounter; + int m_MaxShadowRequests; + int m_ShadowRequestCount; + int m_CascadeCount; + int m_ShadowResolutionRequestCounter; - Material m_ClearShadowMaterial; - Material m_BlitShadowMaterial; - MaterialPropertyBlock m_BlitShadowPropertyBlock = new MaterialPropertyBlock(); + Material m_ClearShadowMaterial; + Material m_BlitShadowMaterial; + MaterialPropertyBlock m_BlitShadowPropertyBlock = new MaterialPropertyBlock(); ConstantBuffer m_GlobalShaderVariables; - public static HDCachedShadowManager cachedShadowManager { get { return HDCachedShadowManager.instance; } } + public static HDCachedShadowManager cachedShadowManager { get { return HDCachedShadowManager.instance; } } public void InitShadowManager(RenderPipelineResources renderPipelineResources, HDShadowInitParameters initParams, RenderGraph renderGraph, Shader clearShader) { @@ -575,10 +575,10 @@ public void UpdateCascade(int cascadeIndex, Vector4 cullingSphere, float border) unsafe { - fixed(float * sphereCascadesBuffer = m_DirectionalShadowData.sphereCascades) - ((Vector4 *)sphereCascadesBuffer)[cascadeIndex] = cullingSphere; - fixed(float * cascadeBorders = m_DirectionalShadowData.cascadeBorders) - cascadeBorders[cascadeIndex] = border; + fixed (float* sphereCascadesBuffer = m_DirectionalShadowData.sphereCascades) + ((Vector4*)sphereCascadesBuffer)[cascadeIndex] = cullingSphere; + fixed (float* cascadeBorders = m_DirectionalShadowData.cascadeBorders) + cascadeBorders[cascadeIndex] = border; } } @@ -626,9 +626,9 @@ HDShadowData CreateShadowData(HDShadowRequest shadowRequest, HDShadowAtlas atlas unsafe Vector4 GetCascadeSphereAtIndex(int index) { - fixed(float * sphereCascadesBuffer = m_DirectionalShadowData.sphereCascades) + fixed (float* sphereCascadesBuffer = m_DirectionalShadowData.sphereCascades) { - return ((Vector4 *)sphereCascadesBuffer)[index]; + return ((Vector4*)sphereCascadesBuffer)[index]; } } @@ -721,13 +721,13 @@ unsafe public void PrepareGPUShadowDatas(CullingResults cullResults, HDCamera ca int first = k_DirectionalShadowCascadeCount, second = k_DirectionalShadowCascadeCount; - fixed(float *sphereBuffer = m_DirectionalShadowData.sphereCascades) + fixed (float* sphereBuffer = m_DirectionalShadowData.sphereCascades) { - Vector4 * sphere = (Vector4 *)sphereBuffer; + Vector4* sphere = (Vector4*)sphereBuffer; for (int i = 0; i < k_DirectionalShadowCascadeCount; i++) { - first = (first == k_DirectionalShadowCascadeCount && sphere[i].w > 0.0f) ? i : first; - second = ((second == k_DirectionalShadowCascadeCount || second == first) && sphere[i].w > 0.0f) ? i : second; + first = (first == k_DirectionalShadowCascadeCount && sphere[i].w > 0.0f) ? i : first; + second = ((second == k_DirectionalShadowCascadeCount || second == first) && sphere[i].w > 0.0f) ? i : second; } } @@ -825,7 +825,7 @@ public void DisplayShadowMap(in ShadowDebugAtlasTextures atlasTextures, int shad if (shadowIndex >= m_ShadowRequestCount) return; - HDShadowRequest shadowRequest = m_ShadowRequests[shadowIndex]; + HDShadowRequest shadowRequest = m_ShadowRequests[shadowIndex]; switch (shadowRequest.shadowMapType) { diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/HDShadowSettings.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/HDShadowSettings.cs index b6c5a542baf..be81271f750 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/HDShadowSettings.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/HDShadowSettings.cs @@ -49,36 +49,36 @@ public float[] cascadeShadowBorders /// Sets the maximum distance HDRP renders shadows for all Light types. [Tooltip("Sets the maximum distance HDRP renders shadows for all Light types.")] - public NoInterpMinFloatParameter maxShadowDistance = new NoInterpMinFloatParameter(500.0f, 0.0f); + public NoInterpMinFloatParameter maxShadowDistance = new NoInterpMinFloatParameter(500.0f, 0.0f); /// Multiplier for thick transmission for directional lights. [Tooltip("Multiplier for thick transmission.")] - public ClampedFloatParameter directionalTransmissionMultiplier = new ClampedFloatParameter(1.0f, 0.0f, 1.0f); + public ClampedFloatParameter directionalTransmissionMultiplier = new ClampedFloatParameter(1.0f, 0.0f, 1.0f); /// Number of cascades HDRP uses for cascaded shadow maps. [Tooltip("Controls the number of cascades HDRP uses for cascaded shadow maps.")] - public NoInterpClampedIntParameter cascadeShadowSplitCount = new NoInterpClampedIntParameter(4, 1, 4); + public NoInterpClampedIntParameter cascadeShadowSplitCount = new NoInterpClampedIntParameter(4, 1, 4); /// Position of the first cascade split as a percentage of Max Distance if the parameter is normalized or as the distance from the camera if it's not normalized. [Tooltip("Sets the position of the first cascade split as a percentage of Max Distance if the parameter is normalized or as the distance from the camera if it's not normalized.")] - public CascadePartitionSplitParameter cascadeShadowSplit0 = new CascadePartitionSplitParameter(0.05f); + public CascadePartitionSplitParameter cascadeShadowSplit0 = new CascadePartitionSplitParameter(0.05f); /// Position of the second cascade split as a percentage of Max Distance if the parameter is normalized or as the distance from the camera if it's not normalized. [Tooltip("Sets the position of the second cascade split as a percentage of Max Distance if the parameter is normalized or as the distance from the camera if it's not normalized.")] - public CascadePartitionSplitParameter cascadeShadowSplit1 = new CascadePartitionSplitParameter(0.15f); + public CascadePartitionSplitParameter cascadeShadowSplit1 = new CascadePartitionSplitParameter(0.15f); /// Sets the position of the third cascade split as a percentage of Max Distance if the parameter is normalized or as the distance from the camera if it's not normalized. [Tooltip("Sets the position of the third cascade split as a percentage of Max Distance if the parameter is normalized or as the distance from the camera if it's not normalized.")] - public CascadePartitionSplitParameter cascadeShadowSplit2 = new CascadePartitionSplitParameter(0.3f); + public CascadePartitionSplitParameter cascadeShadowSplit2 = new CascadePartitionSplitParameter(0.3f); /// Border size between the first and second cascade split. [Tooltip("Sets the border size between the first and second cascade split.")] - public CascadeEndBorderParameter cascadeShadowBorder0 = new CascadeEndBorderParameter(0.0f); + public CascadeEndBorderParameter cascadeShadowBorder0 = new CascadeEndBorderParameter(0.0f); /// Border size between the second and third cascade split. [Tooltip("Sets the border size between the second and third cascade split.")] - public CascadeEndBorderParameter cascadeShadowBorder1 = new CascadeEndBorderParameter(0.0f); + public CascadeEndBorderParameter cascadeShadowBorder1 = new CascadeEndBorderParameter(0.0f); /// Border size between the third and last cascade split. [Tooltip("Sets the border size between the third and last cascade split.")] - public CascadeEndBorderParameter cascadeShadowBorder2 = new CascadeEndBorderParameter(0.0f); + public CascadeEndBorderParameter cascadeShadowBorder2 = new CascadeEndBorderParameter(0.0f); /// Border size at the end of the last cascade split. [Tooltip("Sets the border size at the end of the last cascade split.")] - public CascadeEndBorderParameter cascadeShadowBorder3 = new CascadeEndBorderParameter(0.0f); + public CascadeEndBorderParameter cascadeShadowBorder3 = new CascadeEndBorderParameter(0.0f); HDShadowSettings() diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/HDShadowUtils.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/HDShadowUtils.cs index 0f2771fabc4..c619bf3e63a 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/HDShadowUtils.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/HDShadowUtils.cs @@ -9,9 +9,9 @@ static class HDShadowUtils public static readonly float k_MaxShadowNearPlane = 10.0f; public static float Asfloat(uint val) { unsafe { return *((float*)&val); } } - public static float Asfloat(int val) { unsafe { return *((float*)&val); } } - public static int Asint(float val) { unsafe { return *((int*)&val); } } - public static uint Asuint(float val) { unsafe { return *((uint*)&val); } } + public static float Asfloat(int val) { unsafe { return *((float*)&val); } } + public static int Asint(float val) { unsafe { return *((int*)&val); } } + public static uint Asuint(float val) { unsafe { return *((uint*)&val); } } static Plane[] s_CachedPlanes = new Plane[6]; @@ -64,7 +64,7 @@ public static void ExtractSpotLightData(SpotLightShape shape, float spotAngle, f public static void ExtractDirectionalLightData(VisibleLight visibleLight, Vector2 viewportSize, uint cascadeIndex, int cascadeCount, float[] cascadeRatios, float nearPlaneOffset, CullingResults cullResults, int lightIndex, out Matrix4x4 view, out Matrix4x4 invViewProjection, out Matrix4x4 projection, out Matrix4x4 deviceProjection, out Matrix4x4 deviceProjectionYFlip, out ShadowSplitData splitData) { - Vector4 lightDir; + Vector4 lightDir; Debug.Assert((uint)viewportSize.x == (uint)viewportSize.y, "Currently the cascaded shadow mapping code requires square cascades."); splitData = new ShadowSplitData(); @@ -164,8 +164,8 @@ static void InvertOrthographic(ref Matrix4x4 proj, ref Matrix4x4 view, out Matri invproj.m11 = 1.0f / proj.m11; invproj.m22 = 1.0f / proj.m22; invproj.m33 = 1.0f; - invproj.m03 = proj.m03 * invproj.m00; - invproj.m13 = proj.m13 * invproj.m11; + invproj.m03 = proj.m03 * invproj.m00; + invproj.m13 = proj.m13 * invproj.m11; invproj.m23 = -proj.m23 * invproj.m22; vpinv = invview * invproj; @@ -310,13 +310,13 @@ static Matrix4x4 ExtractPointLightMatrix(VisibleLight vl, uint faceIdx, float ne static float CalcGuardAnglePerspective(float angleInDeg, float resolution, float filterWidth, float normalBiasMax, float guardAngleMaxInDeg) { - float angleInRad = angleInDeg * 0.5f * Mathf.Deg2Rad; - float res = 2.0f / resolution; - float texelSize = Mathf.Cos(angleInRad) * res; - float beta = normalBiasMax * texelSize * 1.4142135623730950488016887242097f; - float guardAngle = Mathf.Atan(beta); - texelSize = Mathf.Tan(angleInRad + guardAngle) * res; - guardAngle = Mathf.Atan((resolution + Mathf.Ceil(filterWidth)) * texelSize * 0.5f) * 2.0f * Mathf.Rad2Deg - angleInDeg; + float angleInRad = angleInDeg * 0.5f * Mathf.Deg2Rad; + float res = 2.0f / resolution; + float texelSize = Mathf.Cos(angleInRad) * res; + float beta = normalBiasMax * texelSize * 1.4142135623730950488016887242097f; + float guardAngle = Mathf.Atan(beta); + texelSize = Mathf.Tan(angleInRad + guardAngle) * res; + guardAngle = Mathf.Atan((resolution + Mathf.Ceil(filterWidth)) * texelSize * 0.5f) * 2.0f * Mathf.Rad2Deg - angleInDeg; guardAngle *= 2.0f; return guardAngle < guardAngleMaxInDeg ? guardAngle : guardAngleMaxInDeg; diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/ScreenSpaceShadowManager.RenderGraph.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/ScreenSpaceShadowManager.RenderGraph.cs index 74be442863e..8a8a745fcff 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/ScreenSpaceShadowManager.RenderGraph.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/ScreenSpaceShadowManager.RenderGraph.cs @@ -40,7 +40,7 @@ TextureHandle EvaluateShadowDebugView(RenderGraph renderGraph, HDCamera hdCamera passData.parameters = PrepareSSShadowDebugParameters(hdCamera, (int)m_CurrentDebugDisplaySettings.data.screenSpaceShadowIndex); passData.screenSpaceShadowArray = builder.ReadTexture(screenSpaceShadowArray); passData.outputBuffer = builder.WriteTexture(renderGraph.CreateTexture(new TextureDesc(Vector2.one, true, true) - { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, enableRandomWrite = true, name = "EvaluateShadowDebug" })); + { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, enableRandomWrite = true, name = "EvaluateShadowDebug" })); builder.SetRenderFunc( (ScreenSpaceShadowDebugPassData data, RenderGraphContext context) => diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/ScreenSpaceShadowManagerArea.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/ScreenSpaceShadowManagerArea.cs index cb25296b28a..85a114fc745 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/ScreenSpaceShadowManagerArea.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/ScreenSpaceShadowManagerArea.cs @@ -366,7 +366,7 @@ void RenderAreaScreenSpaceShadow(RenderGraph renderGraph, HDCamera hdCamera // Intermediate buffers passData.directionBuffer = builder.CreateTransientTexture(new TextureDesc(Vector2.one, true, true) { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, enableRandomWrite = true, name = "Direction Buffer" }); passData.rayLengthBuffer = builder.CreateTransientTexture(new TextureDesc(Vector2.one, true, true) { colorFormat = GraphicsFormat.R32_SFloat, enableRandomWrite = true, name = "Ray Length Buffer" }); - passData.intermediateBufferRGBA1 = builder.CreateTransientTexture(new TextureDesc(Vector2.one, true, true) { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, enableRandomWrite = true, name = "Intermediate Buffer RGBA1" });; + passData.intermediateBufferRGBA1 = builder.CreateTransientTexture(new TextureDesc(Vector2.one, true, true) { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, enableRandomWrite = true, name = "Intermediate Buffer RGBA1" }); ; passData.intermediateBufferRG0 = builder.CreateTransientTexture(new TextureDesc(Vector2.one, true, true) { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, enableRandomWrite = true, name = "Intermediate Buffer RG0" }); // Debug textures diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/ScreenSpaceShadowManagerDirectional.RenderGraph.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/ScreenSpaceShadowManagerDirectional.RenderGraph.cs index 09829db400c..cca78b9924a 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/ScreenSpaceShadowManagerDirectional.RenderGraph.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/ScreenSpaceShadowManagerDirectional.RenderGraph.cs @@ -81,11 +81,11 @@ void RenderRayTracedDirectionalScreenSpaceShadow(RenderGraph renderGraph, HDCame // Output Buffers passData.velocityBuffer = builder.ReadWriteTexture(renderGraph.CreateTexture(new TextureDesc(Vector2.one, true, true) - { colorFormat = GraphicsFormat.R8_SNorm, enableRandomWrite = true, clearBuffer = true, name = "Velocity Buffer" })); + { colorFormat = GraphicsFormat.R8_SNorm, enableRandomWrite = true, clearBuffer = true, name = "Velocity Buffer" })); passData.distanceBuffer = builder.ReadWriteTexture(renderGraph.CreateTexture(new TextureDesc(Vector2.one, true, true) - { colorFormat = GraphicsFormat.R32_SFloat, enableRandomWrite = true, clearBuffer = true, name = "Distance Buffer" })); + { colorFormat = GraphicsFormat.R32_SFloat, enableRandomWrite = true, clearBuffer = true, name = "Distance Buffer" })); passData.outputShadowBuffer = builder.ReadWriteTexture(renderGraph.CreateTexture(new TextureDesc(Vector2.one, true, true) - { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, enableRandomWrite = true, clearBuffer = true, name = "RT Directional Shadow" })); + { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, enableRandomWrite = true, clearBuffer = true, name = "RT Directional Shadow" })); builder.SetRenderFunc( (RTSDirectionalTracePassData data, RenderGraphContext context) => diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/ScreenSpaceShadowManagerPunctual.RenderGraph.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/ScreenSpaceShadowManagerPunctual.RenderGraph.cs index 07c31caa6c7..4815ad21144 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/ScreenSpaceShadowManagerPunctual.RenderGraph.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/ScreenSpaceShadowManagerPunctual.RenderGraph.cs @@ -112,11 +112,11 @@ void RenderPunctualScreenSpaceShadow(RenderGraph renderGraph, HDCamera hdCamera // Output Buffers passData.velocityBuffer = builder.ReadWriteTexture(renderGraph.CreateTexture(new TextureDesc(Vector2.one, true, true) - { colorFormat = GraphicsFormat.R8_SNorm, enableRandomWrite = true, name = "Velocity Buffer" })); + { colorFormat = GraphicsFormat.R8_SNorm, enableRandomWrite = true, name = "Velocity Buffer" })); passData.distanceBuffer = builder.ReadWriteTexture(renderGraph.CreateTexture(new TextureDesc(Vector2.one, true, true) - { colorFormat = GraphicsFormat.R32_SFloat, enableRandomWrite = true, name = "Distance Buffer" })); + { colorFormat = GraphicsFormat.R32_SFloat, enableRandomWrite = true, name = "Distance Buffer" })); passData.outputShadowBuffer = builder.ReadWriteTexture(renderGraph.CreateTexture(new TextureDesc(Vector2.one, true, true) - { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, enableRandomWrite = true, name = "RT Sphere Shadow" })); + { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, enableRandomWrite = true, name = "RT Sphere Shadow" })); builder.SetRenderFunc( (RTSPunctualTracePassData data, RenderGraphContext context) => diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/SphericalHarmonics.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/SphericalHarmonics.cs index 1f42899007c..1dcedfcc995 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/SphericalHarmonics.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/SphericalHarmonics.cs @@ -45,42 +45,42 @@ internal struct SphericalHarmonicsL1 }; // These operators are implemented so that SphericalHarmonicsL1 matches API of SphericalHarmonicsL2. - public static SphericalHarmonicsL1 operator+(SphericalHarmonicsL1 lhs, SphericalHarmonicsL1 rhs) => new SphericalHarmonicsL1() + public static SphericalHarmonicsL1 operator +(SphericalHarmonicsL1 lhs, SphericalHarmonicsL1 rhs) => new SphericalHarmonicsL1() { shAr = lhs.shAr + rhs.shAr, shAg = lhs.shAg + rhs.shAg, shAb = lhs.shAb + rhs.shAb }; - public static SphericalHarmonicsL1 operator-(SphericalHarmonicsL1 lhs, SphericalHarmonicsL1 rhs) => new SphericalHarmonicsL1() + public static SphericalHarmonicsL1 operator -(SphericalHarmonicsL1 lhs, SphericalHarmonicsL1 rhs) => new SphericalHarmonicsL1() { shAr = lhs.shAr - rhs.shAr, shAg = lhs.shAg - rhs.shAg, shAb = lhs.shAb - rhs.shAb }; - public static SphericalHarmonicsL1 operator*(SphericalHarmonicsL1 lhs, float rhs) => new SphericalHarmonicsL1() + public static SphericalHarmonicsL1 operator *(SphericalHarmonicsL1 lhs, float rhs) => new SphericalHarmonicsL1() { shAr = lhs.shAr * rhs, shAg = lhs.shAg * rhs, shAb = lhs.shAb * rhs }; - public static SphericalHarmonicsL1 operator/(SphericalHarmonicsL1 lhs, float rhs) => new SphericalHarmonicsL1() + public static SphericalHarmonicsL1 operator /(SphericalHarmonicsL1 lhs, float rhs) => new SphericalHarmonicsL1() { shAr = lhs.shAr / rhs, shAg = lhs.shAg / rhs, shAb = lhs.shAb / rhs }; - public static bool operator==(SphericalHarmonicsL1 lhs, SphericalHarmonicsL1 rhs) + public static bool operator ==(SphericalHarmonicsL1 lhs, SphericalHarmonicsL1 rhs) { return lhs.shAr == rhs.shAr && lhs.shAg == rhs.shAg && lhs.shAb == rhs.shAb; } - public static bool operator!=(SphericalHarmonicsL1 lhs, SphericalHarmonicsL1 rhs) + public static bool operator !=(SphericalHarmonicsL1 lhs, SphericalHarmonicsL1 rhs) { return !(lhs == rhs); } diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/DensityVolume.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/DensityVolume.cs index 6ad5c6d5004..8df0dea738f 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/DensityVolume.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/DensityVolume.cs @@ -8,50 +8,50 @@ namespace UnityEngine.Rendering.HighDefinition public partial struct DensityVolumeArtistParameters { /// Single scattering albedo: [0, 1]. Alpha is ignored. - public Color albedo; + public Color albedo; /// Mean free path, in meters: [1, inf]. - public float meanFreePath; // Should be chromatic - this is an optimization! + public float meanFreePath; // Should be chromatic - this is an optimization! /// Anisotropy of the phase function: [-1, 1]. Positive values result in forward scattering, and negative values - in backward scattering. [FormerlySerializedAs("asymmetry")] - public float anisotropy; // . Not currently available for density volumes + public float anisotropy; // . Not currently available for density volumes /// Texture containing density values. public Texture3D volumeMask; /// Scrolling speed of the density texture. - public Vector3 textureScrollingSpeed; + public Vector3 textureScrollingSpeed; /// Tiling rate of the density texture. - public Vector3 textureTiling; + public Vector3 textureTiling; /// Edge fade factor along the positive X, Y and Z axes. [FormerlySerializedAs("m_PositiveFade")] - public Vector3 positiveFade; + public Vector3 positiveFade; /// Edge fade factor along the negative X, Y and Z axes. [FormerlySerializedAs("m_NegativeFade")] - public Vector3 negativeFade; + public Vector3 negativeFade; [SerializeField, FormerlySerializedAs("m_UniformFade")] - internal float m_EditorUniformFade; + internal float m_EditorUniformFade; [SerializeField] internal Vector3 m_EditorPositiveFade; [SerializeField] internal Vector3 m_EditorNegativeFade; [SerializeField, FormerlySerializedAs("advancedFade"), FormerlySerializedAs("m_AdvancedFade")] - internal bool m_EditorAdvancedFade; + internal bool m_EditorAdvancedFade; /// Dimensions of the volume. - public Vector3 size; + public Vector3 size; /// Inverts the fade gradient. - public bool invertFade; + public bool invertFade; /// Distance at which density fading starts. - public float distanceFadeStart; + public float distanceFadeStart; /// Distance at which density fading ends. - public float distanceFadeEnd; + public float distanceFadeEnd; [SerializeField] - internal int textureIndex; + internal int textureIndex; /// Allows translation of the tiling density texture. [SerializeField, FormerlySerializedAs("volumeScrollingAmount")] - public Vector3 textureOffset; + public Vector3 textureOffset; /// Constructor. /// Single scattering albedo. @@ -59,28 +59,28 @@ public partial struct DensityVolumeArtistParameters /// Anisotropy. public DensityVolumeArtistParameters(Color color, float _meanFreePath, float _anisotropy) { - albedo = color; - meanFreePath = _meanFreePath; - anisotropy = _anisotropy; + albedo = color; + meanFreePath = _meanFreePath; + anisotropy = _anisotropy; - volumeMask = null; - textureIndex = -1; + volumeMask = null; + textureIndex = -1; textureScrollingSpeed = Vector3.zero; - textureTiling = Vector3.one; - textureOffset = textureScrollingSpeed; + textureTiling = Vector3.one; + textureOffset = textureScrollingSpeed; - size = Vector3.one; + size = Vector3.one; - positiveFade = Vector3.zero; - negativeFade = Vector3.zero; - invertFade = false; + positiveFade = Vector3.zero; + negativeFade = Vector3.zero; + invertFade = false; - distanceFadeStart = 10000; - distanceFadeEnd = 10000; + distanceFadeStart = 10000; + distanceFadeEnd = 10000; m_EditorPositiveFade = Vector3.zero; m_EditorNegativeFade = Vector3.zero; - m_EditorUniformFade = 0; + m_EditorUniformFade = 0; m_EditorAdvancedFade = false; } @@ -110,19 +110,19 @@ internal void Constrain() textureOffset = Vector3.zero; distanceFadeStart = Mathf.Max(0, distanceFadeStart); - distanceFadeEnd = Mathf.Max(distanceFadeStart, distanceFadeEnd); + distanceFadeEnd = Mathf.Max(distanceFadeStart, distanceFadeEnd); } internal DensityVolumeEngineData ConvertToEngineData() { DensityVolumeEngineData data = new DensityVolumeEngineData(); - data.extinction = VolumeRenderingUtils.ExtinctionFromMeanFreePath(meanFreePath); - data.scattering = VolumeRenderingUtils.ScatteringFromExtinctionAndAlbedo(data.extinction, (Vector3)(Vector4)albedo); + data.extinction = VolumeRenderingUtils.ExtinctionFromMeanFreePath(meanFreePath); + data.scattering = VolumeRenderingUtils.ScatteringFromExtinctionAndAlbedo(data.extinction, (Vector3)(Vector4)albedo); - data.textureIndex = textureIndex; - data.textureScroll = textureOffset; - data.textureTiling = textureTiling; + data.textureIndex = textureIndex; + data.textureScroll = textureOffset; + data.textureTiling = textureTiling; // Clamp to avoid NaNs. Vector3 positiveFade = this.positiveFade; @@ -140,7 +140,7 @@ internal DensityVolumeEngineData ConvertToEngineData() float distFadeLen = Mathf.Max(distanceFadeEnd - distanceFadeStart, 0.00001526f); - data.rcpDistFadeLen = 1.0f / distFadeLen; + data.rcpDistFadeLen = 1.0f / distFadeLen; data.endTimesRcpDistFadeLen = distanceFadeEnd * data.rcpDistFadeLen; return data; diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/VolumetricLighting.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/VolumetricLighting.cs index 2263fe69e16..3456672032c 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/VolumetricLighting.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/VolumetricLighting.cs @@ -11,29 +11,29 @@ namespace UnityEngine.Rendering.HighDefinition struct DensityVolumeEngineData { public Vector3 scattering; // [0, 1] - public float extinction; // [0, 1] + public float extinction; // [0, 1] public Vector3 textureTiling; - public int textureIndex; + public int textureIndex; public Vector3 textureScroll; - public int invertFade; // bool... + public int invertFade; // bool... public Vector3 rcpPosFaceFade; - public float rcpDistFadeLen; + public float rcpDistFadeLen; public Vector3 rcpNegFaceFade; - public float endTimesRcpDistFadeLen; + public float endTimesRcpDistFadeLen; public static DensityVolumeEngineData GetNeutralValues() { DensityVolumeEngineData data; - data.scattering = Vector3.zero; - data.extinction = 0; - data.textureIndex = -1; - data.textureTiling = Vector3.one; - data.textureScroll = Vector3.zero; - data.rcpPosFaceFade = new Vector3(float.MaxValue, float.MaxValue, float.MaxValue); - data.rcpNegFaceFade = new Vector3(float.MaxValue, float.MaxValue, float.MaxValue); - data.invertFade = 0; - data.rcpDistFadeLen = 0; + data.scattering = Vector3.zero; + data.extinction = 0; + data.textureIndex = -1; + data.textureTiling = Vector3.one; + data.textureScroll = Vector3.zero; + data.rcpPosFaceFade = new Vector3(float.MaxValue, float.MaxValue, float.MaxValue); + data.rcpNegFaceFade = new Vector3(float.MaxValue, float.MaxValue, float.MaxValue); + data.invertFade = 0; + data.rcpDistFadeLen = 0; data.endTimesRcpDistFadeLen = 1; return data; @@ -105,31 +105,31 @@ public static Vector3 AlbedoFromMeanFreePathAndScattering(float meanFreePath, Ve struct DensityVolumeList { - public List bounds; + public List bounds; public List density; } struct VBufferParameters { public Vector3Int viewportSize; - public float voxelSize; - public Vector4 depthEncodingParams; - public Vector4 depthDecodingParams; + public float voxelSize; + public Vector4 depthEncodingParams; + public Vector4 depthDecodingParams; public VBufferParameters(Vector3Int viewportSize, float depthExtent, float camNear, float camFar, float camVFoV, float sliceDistributionUniformity, float voxelSize) { this.viewportSize = viewportSize; - this.voxelSize = voxelSize; + this.voxelSize = voxelSize; // The V-Buffer is sphere-capped, while the camera frustum is not. // We always start from the near plane of the camera. - float aspectRatio = viewportSize.x / (float)viewportSize.y; + float aspectRatio = viewportSize.x / (float)viewportSize.y; float farPlaneHeight = 2.0f * Mathf.Tan(0.5f * camVFoV) * camFar; - float farPlaneWidth = farPlaneHeight * aspectRatio; + float farPlaneWidth = farPlaneHeight * aspectRatio; float farPlaneMaxDim = Mathf.Max(farPlaneWidth, farPlaneHeight); - float farPlaneDist = Mathf.Sqrt(camFar * camFar + 0.25f * farPlaneMaxDim * farPlaneMaxDim); + float farPlaneDist = Mathf.Sqrt(camFar * camFar + 0.25f * farPlaneMaxDim * farPlaneMaxDim); float nearDist = camNear; float farDist = Math.Min(nearDist + depthExtent, farPlaneDist); @@ -199,28 +199,28 @@ static Vector4 ComputeLogarithmicDepthDecodingParams(float nearPlane, float farP public partial class HDRenderPipeline { - ComputeShader m_VolumeVoxelizationCS = null; - ComputeShader m_VolumetricLightingCS = null; - ComputeShader m_VolumetricLightingFilteringCS = null; + ComputeShader m_VolumeVoxelizationCS = null; + ComputeShader m_VolumetricLightingCS = null; + ComputeShader m_VolumetricLightingFilteringCS = null; - List m_VisibleVolumeBounds = null; - List m_VisibleVolumeData = null; - const int k_MaxVisibleVolumeCount = 512; + List m_VisibleVolumeBounds = null; + List m_VisibleVolumeData = null; + const int k_MaxVisibleVolumeCount = 512; // Static keyword is required here else we get a "DestroyBuffer can only be called from the main thread" - ComputeBuffer m_VisibleVolumeBoundsBuffer = null; - ComputeBuffer m_VisibleVolumeDataBuffer = null; + ComputeBuffer m_VisibleVolumeBoundsBuffer = null; + ComputeBuffer m_VisibleVolumeDataBuffer = null; // These two buffers do not depend on the frameID and are therefore shared by all views. - RTHandle m_DensityBuffer; - RTHandle m_LightingBuffer; - RTHandle m_MaxZMask8x; - RTHandle m_MaxZMask; - RTHandle m_DilatedMaxZMask; + RTHandle m_DensityBuffer; + RTHandle m_LightingBuffer; + RTHandle m_MaxZMask8x; + RTHandle m_MaxZMask; + RTHandle m_DilatedMaxZMask; Vector3Int m_CurrentVolumetricBufferSize; - ShaderVariablesVolumetric m_ShaderVariablesVolumetricCB = new ShaderVariablesVolumetric(); + ShaderVariablesVolumetric m_ShaderVariablesVolumetricCB = new ShaderVariablesVolumetric(); // Is the feature globally disabled? bool m_SupportVolumetrics = false; @@ -266,11 +266,11 @@ static internal Vector3Int ComputeVolumetricViewportSize(HDCamera hdCamera, ref var controller = hdCamera.volumeStack.GetComponent(); Debug.Assert(controller != null); - int viewportWidth = hdCamera.actualWidth; - int viewportHeight = hdCamera.actualHeight; + int viewportWidth = hdCamera.actualWidth; + int viewportHeight = hdCamera.actualHeight; float screenFraction; - int sliceCount; + int sliceCount; if (controller.fogControlMode == FogControl.Balance) { // Evaluate the ssFraction and sliceCount based on the control parameters @@ -293,7 +293,7 @@ static internal Vector3Int ComputeVolumetricViewportSize(HDCamera hdCamera, ref voxelSize = 1.0f / screenFraction; // Does not account for rounding (same function, above) } - int w = Mathf.RoundToInt(viewportWidth * screenFraction); + int w = Mathf.RoundToInt(viewportWidth * screenFraction); int h = Mathf.RoundToInt(viewportHeight * screenFraction); // Round to nearest multiple of viewCount so that each views have the exact same number of slices (important for XR) @@ -323,7 +323,7 @@ static internal void ReinitializeVolumetricBufferParams(HDCamera hdCamera) if (!Fog.IsVolumetricFogEnabled(hdCamera)) return; - bool fog = Fog.IsVolumetricFogEnabled(hdCamera); + bool fog = Fog.IsVolumetricFogEnabled(hdCamera); bool init = hdCamera.vBufferParams != null; if (fog ^ init) @@ -376,9 +376,9 @@ static internal void ResizeVolumetricBuffer(ref RTHandle rt, string name, int vi { Debug.Assert(rt != null); - int width = rt.rt.width; + int width = rt.rt.width; int height = rt.rt.height; - int depth = rt.rt.volumeDepth; + int depth = rt.rt.volumeDepth; bool realloc = (width < viewportWidth) || (height < viewportHeight) || (depth < viewportDepth); @@ -386,9 +386,9 @@ static internal void ResizeVolumetricBuffer(ref RTHandle rt, string name, int vi { RTHandles.Release(rt); - width = Math.Max(width, viewportWidth); + width = Math.Max(width, viewportWidth); height = Math.Max(height, viewportHeight); - depth = Math.Max(depth, viewportDepth); + depth = Math.Max(depth, viewportDepth); rt = RTHandles.Alloc(width, height, depth, colorFormat: GraphicsFormat.R16G16B16A16_SFloat, // 8888_sRGB is not precise enough dimension: TextureDimension.Tex3D, enableRandomWrite: true, name: name); @@ -576,13 +576,13 @@ static internal void ResizeVolumetricHistoryBuffers(HDCamera hdCamera) internal void CreateVolumetricLightingBuffers() { Debug.Assert(m_VolumetricLightingCS != null); - Debug.Assert(m_DensityBuffer == null); + Debug.Assert(m_DensityBuffer == null); Debug.Assert(m_LightingBuffer == null); - m_VisibleVolumeBounds = new List(); - m_VisibleVolumeData = new List(); + m_VisibleVolumeBounds = new List(); + m_VisibleVolumeData = new List(); m_VisibleVolumeBoundsBuffer = new ComputeBuffer(k_MaxVisibleVolumeCount, Marshal.SizeOf(typeof(OrientedBBox))); - m_VisibleVolumeDataBuffer = new ComputeBuffer(k_MaxVisibleVolumeCount, Marshal.SizeOf(typeof(DensityVolumeEngineData))); + m_VisibleVolumeDataBuffer = new ComputeBuffer(k_MaxVisibleVolumeCount, Marshal.SizeOf(typeof(DensityVolumeEngineData))); // Allocate the smallest possible 3D texture. // We will perform rescaling manually, in a custom manner, based on volume parameters. @@ -616,7 +616,7 @@ internal void DestroyVolumetricLightingBuffers() CoreUtils.SafeRelease(m_VisibleVolumeDataBuffer); CoreUtils.SafeRelease(m_VisibleVolumeBoundsBuffer); - m_VisibleVolumeData = null; // free() + m_VisibleVolumeData = null; // free() m_VisibleVolumeBounds = null; // free() } @@ -739,7 +739,7 @@ DensityVolumeList PrepareVisibleDensityVolumeList(HDCamera hdCamera, CommandBuff using (new ProfilingScope(cmd, ProfilingSampler.Get(HDProfileId.PrepareVisibleDensityVolumeList))) { Vector3 camPosition = hdCamera.camera.transform.position; - Vector3 camOffset = Vector3.zero;// World-origin-relative + Vector3 camOffset = Vector3.zero;// World-origin-relative if (ShaderConfig.s_CameraRelativeRendering != 0) { @@ -779,7 +779,7 @@ DensityVolumeList PrepareVisibleDensityVolumeList(HDCamera hdCamera, CommandBuff m_VisibleVolumeDataBuffer.SetData(m_VisibleVolumeData); // Fill the struct with pointers in order to share the data with the light loop. - densityVolumes.bounds = m_VisibleVolumeBounds; + densityVolumes.bounds = m_VisibleVolumeBounds; densityVolumes.density = m_VisibleVolumeData; return densityVolumes; @@ -788,17 +788,17 @@ DensityVolumeList PrepareVisibleDensityVolumeList(HDCamera hdCamera, CommandBuff struct VolumeVoxelizationParameters { - public ComputeShader voxelizationCS; - public int voxelizationKernel; + public ComputeShader voxelizationCS; + public int voxelizationKernel; - public Vector4 resolution; - public int viewCount; - public bool tiledLighting; + public Vector4 resolution; + public int viewCount; + public bool tiledLighting; - public Texture3D volumeAtlas; + public Texture3D volumeAtlas; - public ShaderVariablesVolumetric volumetricCB; - public ShaderVariablesLightList lightListCB; + public ShaderVariablesVolumetric volumetricCB; + public ShaderVariablesLightList lightListCB; } unsafe void SetPreconvolvedAmbientLightProbe(ref ShaderVariablesVolumetric cb, HDCamera hdCamera, Fog fog) @@ -917,18 +917,18 @@ VolumeVoxelizationParameters PrepareVolumeVoxelizationParameters(HDCamera hdCame } static void VolumeVoxelizationPass(in VolumeVoxelizationParameters parameters, - RTHandle densityBuffer, - ComputeBuffer visibleVolumeBoundsBuffer, - ComputeBuffer visibleVolumeDataBuffer, - ComputeBuffer bigTileLightList, - CommandBuffer cmd) + RTHandle densityBuffer, + ComputeBuffer visibleVolumeBoundsBuffer, + ComputeBuffer visibleVolumeDataBuffer, + ComputeBuffer bigTileLightList, + CommandBuffer cmd) { if (parameters.tiledLighting) cmd.SetComputeBufferParam(parameters.voxelizationCS, parameters.voxelizationKernel, HDShaderIDs.g_vBigTileLightList, bigTileLightList); - cmd.SetComputeTextureParam(parameters.voxelizationCS, parameters.voxelizationKernel, HDShaderIDs._VBufferDensity, densityBuffer); - cmd.SetComputeBufferParam(parameters.voxelizationCS, parameters.voxelizationKernel, HDShaderIDs._VolumeBounds, visibleVolumeBoundsBuffer); - cmd.SetComputeBufferParam(parameters.voxelizationCS, parameters.voxelizationKernel, HDShaderIDs._VolumeData, visibleVolumeDataBuffer); + cmd.SetComputeTextureParam(parameters.voxelizationCS, parameters.voxelizationKernel, HDShaderIDs._VBufferDensity, densityBuffer); + cmd.SetComputeBufferParam(parameters.voxelizationCS, parameters.voxelizationKernel, HDShaderIDs._VolumeBounds, visibleVolumeBoundsBuffer); + cmd.SetComputeBufferParam(parameters.voxelizationCS, parameters.voxelizationKernel, HDShaderIDs._VolumeData, visibleVolumeDataBuffer); cmd.SetComputeTextureParam(parameters.voxelizationCS, parameters.voxelizationKernel, HDShaderIDs._VolumeMaskAtlas, parameters.volumeAtlas); ConstantBuffer.Push(cmd, parameters.volumetricCB, parameters.voxelizationCS, HDShaderIDs._ShaderVariablesVolumetric); @@ -952,13 +952,13 @@ static void GetHexagonalClosePackedSpheres7(Vector2[] coords) // (7)(5) ( )( ) ( )( ) ( )( ) ( )( ) ( )(o) ( )(x) (o)(x) (x)(x) // (2)(1)(3) ( )(o)( ) (o)(x)( ) (x)(x)(o) (x)(x)(x) (x)(x)(x) (x)(x)(x) (x)(x)(x) (x)(x)(x) // (4)(6) ( )( ) ( )( ) ( )( ) (o)( ) (x)( ) (x)(o) (x)(x) (x)(x) - coords[0] = new Vector2(0, 0); - coords[1] = new Vector2(-d, 0); - coords[2] = new Vector2(d, 0); + coords[0] = new Vector2(0, 0); + coords[1] = new Vector2(-d, 0); + coords[2] = new Vector2(d, 0); coords[3] = new Vector2(-r, -s); - coords[4] = new Vector2(r, s); + coords[4] = new Vector2(r, s); coords[5] = new Vector2(r, -s); - coords[6] = new Vector2(-r, s); + coords[6] = new Vector2(-r, s); // Rotate the sampling pattern by 15 degrees. const float cos15 = 0.96592582628906828675f; @@ -975,18 +975,18 @@ static void GetHexagonalClosePackedSpheres7(Vector2[] coords) struct VolumetricLightingParameters { - public ComputeShader volumetricLightingCS; - public ComputeShader volumetricLightingFilteringCS; - public int volumetricLightingKernel; - public int volumetricFilteringKernel; - public bool tiledLighting; - public Vector4 resolution; - public bool enableReprojection; - public int viewCount; - public int sliceCount; - public bool filterVolume; - public ShaderVariablesVolumetric volumetricCB; - public ShaderVariablesLightList lightListCB; + public ComputeShader volumetricLightingCS; + public ComputeShader volumetricLightingFilteringCS; + public int volumetricLightingKernel; + public int volumetricFilteringKernel; + public bool tiledLighting; + public Vector4 resolution; + public bool enableReprojection; + public int viewCount; + public int sliceCount; + public bool filterVolume; + public ShaderVariablesVolumetric volumetricCB; + public ShaderVariablesLightList lightListCB; } VolumetricLightingParameters PrepareVolumetricLightingParameters(HDCamera hdCamera) @@ -1038,14 +1038,14 @@ VolumetricLightingParameters PrepareVolumetricLightingParameters(HDCamera hdCame } static void VolumetricLightingPass(in VolumetricLightingParameters parameters, - RTHandle depthTexture, - RTHandle densityBuffer, - RTHandle lightingBuffer, - RTHandle maxZTexture, - RTHandle historyRT, - RTHandle feedbackRT, - ComputeBuffer bigTileLightList, - CommandBuffer cmd) + RTHandle depthTexture, + RTHandle densityBuffer, + RTHandle lightingBuffer, + RTHandle maxZTexture, + RTHandle historyRT, + RTHandle feedbackRT, + ComputeBuffer bigTileLightList, + CommandBuffer cmd) { if (parameters.tiledLighting) cmd.SetComputeBufferParam(parameters.volumetricLightingCS, parameters.volumetricLightingKernel, HDShaderIDs.g_vBigTileLightList, bigTileLightList); @@ -1053,12 +1053,12 @@ static void VolumetricLightingPass(in VolumetricLightingParameters parameters, cmd.SetComputeTextureParam(parameters.volumetricLightingCS, parameters.volumetricLightingKernel, HDShaderIDs._MaxZMaskTexture, maxZTexture); // Read cmd.SetComputeTextureParam(parameters.volumetricLightingCS, parameters.volumetricLightingKernel, HDShaderIDs._CameraDepthTexture, depthTexture); // Read - cmd.SetComputeTextureParam(parameters.volumetricLightingCS, parameters.volumetricLightingKernel, HDShaderIDs._VBufferDensity, densityBuffer); // Read + cmd.SetComputeTextureParam(parameters.volumetricLightingCS, parameters.volumetricLightingKernel, HDShaderIDs._VBufferDensity, densityBuffer); // Read cmd.SetComputeTextureParam(parameters.volumetricLightingCS, parameters.volumetricLightingKernel, HDShaderIDs._VBufferLighting, lightingBuffer); // Write if (parameters.enableReprojection) { - cmd.SetComputeTextureParam(parameters.volumetricLightingCS, parameters.volumetricLightingKernel, HDShaderIDs._VBufferHistory, historyRT); // Read + cmd.SetComputeTextureParam(parameters.volumetricLightingCS, parameters.volumetricLightingKernel, HDShaderIDs._VBufferHistory, historyRT); // Read cmd.SetComputeTextureParam(parameters.volumetricLightingCS, parameters.volumetricLightingKernel, HDShaderIDs._VBufferFeedback, feedbackRT); // Write } diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/AxF/AxF.cs b/com.unity.render-pipelines.high-definition/Runtime/Material/AxF/AxF.cs index fd177cf241f..a9214a84564 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/AxF/AxF.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/AxF/AxF.cs @@ -22,15 +22,15 @@ class AxF : RenderPipelineMaterial [GenerateHLSL(PackingRules.Exact)] public enum FeatureFlags { - AxfAnisotropy = 1 << 0, - AxfClearCoat = 1 << 1, - AxfClearCoatRefraction = 1 << 2, - AxfUseHeightMap = 1 << 3, + AxfAnisotropy = 1 << 0, + AxfClearCoat = 1 << 1, + AxfClearCoatRefraction = 1 << 2, + AxfUseHeightMap = 1 << 3, AxfBRDFColorDiagonalClamp = 1 << 4, //Some TODO: - AxfHonorMinRoughness = 1 << 8, + AxfHonorMinRoughness = 1 << 8, AxfHonorMinRoughnessCoat = 1 << 9, // the X-Rite viewer never shows a specular highlight on coat for dirac lights - AxfDebugTest = 1 << 23, + AxfDebugTest = 1 << 23, //Experimental: // // Warning: don't go over 23, or need to use float and bitcast on the UI side, and in the shader, @@ -57,83 +57,83 @@ public struct SurfaceData public float specularOcclusion; [MaterialSharedPropertyMapping(MaterialSharedProperty.Normal)] - [SurfaceDataAttributes(new string[] {"Normal", "Normal View Space"}, true, checkIsNormalized = true)] - public Vector3 normalWS; + [SurfaceDataAttributes(new string[] { "Normal", "Normal View Space" }, true, checkIsNormalized = true)] + public Vector3 normalWS; [SurfaceDataAttributes("Tangent", true)] - public Vector3 tangentWS; + public Vector3 tangentWS; // SVBRDF Variables [MaterialSharedPropertyMapping(MaterialSharedProperty.Albedo)] [SurfaceDataAttributes("Diffuse Color", false, true)] - public Vector3 diffuseColor; + public Vector3 diffuseColor; [MaterialSharedPropertyMapping(MaterialSharedProperty.Specular)] [SurfaceDataAttributes("Specular Color", false, true)] - public Vector3 specularColor; + public Vector3 specularColor; [SurfaceDataAttributes("Fresnel F0")] - public Vector3 fresnelF0; + public Vector3 fresnelF0; [SurfaceDataAttributes("Specular Lobe")] - public Vector3 specularLobe; // .xy for SVBRDF, .xyz for CARPAINT2, for _CarPaint2_CTSpreads per lobe roughnesses + public Vector3 specularLobe; // .xy for SVBRDF, .xyz for CARPAINT2, for _CarPaint2_CTSpreads per lobe roughnesses [SurfaceDataAttributes("Height")] - public float height_mm; + public float height_mm; [SurfaceDataAttributes("Anisotropic Angle")] - public float anisotropyAngle; + public float anisotropyAngle; // Car Paint Variables [SurfaceDataAttributes("Flakes UV (or PlanarZY)")] - public Vector2 flakesUVZY; + public Vector2 flakesUVZY; [SurfaceDataAttributes("Flakes PlanarXZ")] - public Vector2 flakesUVXZ; + public Vector2 flakesUVXZ; [SurfaceDataAttributes("Flakes PlanarXY")] - public Vector2 flakesUVXY; + public Vector2 flakesUVXY; [SurfaceDataAttributes("Flakes Mip (and for PlanarZY)")] - public float flakesMipLevelZY; + public float flakesMipLevelZY; [SurfaceDataAttributes("Flakes Mip for PlanarXZ")] - public float flakesMipLevelXZ; + public float flakesMipLevelXZ; [SurfaceDataAttributes("Flakes Mip for PlanarXY")] - public float flakesMipLevelXY; + public float flakesMipLevelXY; [SurfaceDataAttributes("Flakes Triplanar Weights")] - public Vector3 flakesTriplanarWeights; + public Vector3 flakesTriplanarWeights; // if non null, we will prefer gradients (to be used statically only!) [SurfaceDataAttributes("Flakes ddx (and for PlanarZY)")] - public Vector2 flakesDdxZY; + public Vector2 flakesDdxZY; [SurfaceDataAttributes("Flakes ddy (and for PlanarZY)")] - public Vector2 flakesDdyZY; + public Vector2 flakesDdyZY; [SurfaceDataAttributes("Flakes ddx for PlanarXZ")] - public Vector2 flakesDdxXZ; + public Vector2 flakesDdxXZ; [SurfaceDataAttributes("Flakes ddy for PlanarXZ")] - public Vector2 flakesDdyXZ; + public Vector2 flakesDdyXZ; [SurfaceDataAttributes("Flakes ddx for PlanarXY")] - public Vector2 flakesDdxXY; + public Vector2 flakesDdxXY; [SurfaceDataAttributes("Flakes ddy for PlanarXY")] - public Vector2 flakesDdyXY; + public Vector2 flakesDdyXY; // BTF Variables // Clearcoat [SurfaceDataAttributes("Clearcoat Color")] - public Vector3 clearcoatColor; + public Vector3 clearcoatColor; [SurfaceDataAttributes("Clearcoat Normal", true)] - public Vector3 clearcoatNormalWS; + public Vector3 clearcoatNormalWS; [SurfaceDataAttributes("Clearcoat IOR")] - public float clearcoatIOR; + public float clearcoatIOR; - [SurfaceDataAttributes(new string[] {"Geometric Normal", "Geometric Normal View Space" }, true, checkIsNormalized = true)] - public Vector3 geomNormalWS; + [SurfaceDataAttributes(new string[] { "Geometric Normal", "Geometric Normal View Space" }, true, checkIsNormalized = true)] + public Vector3 geomNormalWS; // Needed for raytracing. // TODO: should just modify FitToStandardLit in ShaderPassRaytracingGBuffer.hlsl and callee // to have "V" (from -incidentDir) [SurfaceDataAttributes("View Direction", true)] - public Vector3 viewWS; + public Vector3 viewWS; }; //----------------------------------------------------------------------------- @@ -147,42 +147,42 @@ public struct BSDFData public float specularOcclusion; [SurfaceDataAttributes(new string[] { "Normal WS", "Normal View Space" }, true, checkIsNormalized = true)] - public Vector3 normalWS; + public Vector3 normalWS; [SurfaceDataAttributes("", true)] - public Vector3 tangentWS; + public Vector3 tangentWS; [SurfaceDataAttributes("", true)] - public Vector3 biTangentWS; + public Vector3 biTangentWS; // SVBRDF Variables - public Vector3 diffuseColor; - public Vector3 specularColor; - public Vector3 fresnelF0; + public Vector3 diffuseColor; + public Vector3 specularColor; + public Vector3 fresnelF0; public float perceptualRoughness; // approximated for SSAO - public Vector3 roughness; // .xy for SVBRDF, .xyz for CARPAINT2, for _CarPaint2_CTSpreads per lobe roughnesses - public float height_mm; + public Vector3 roughness; // .xy for SVBRDF, .xyz for CARPAINT2, for _CarPaint2_CTSpreads per lobe roughnesses + public float height_mm; // Car Paint Variables - public Vector2 flakesUVZY; - public Vector2 flakesUVXZ; - public Vector2 flakesUVXY; - public float flakesMipLevelZY; - public float flakesMipLevelXZ; - public float flakesMipLevelXY; - public Vector3 flakesTriplanarWeights; - public Vector2 flakesDdxZY; // if non null, we will prefer gradients (to be used statically only!) - public Vector2 flakesDdyZY; - public Vector2 flakesDdxXZ; - public Vector2 flakesDdyXZ; - public Vector2 flakesDdxXY; - public Vector2 flakesDdyXY; + public Vector2 flakesUVZY; + public Vector2 flakesUVXZ; + public Vector2 flakesUVXY; + public float flakesMipLevelZY; + public float flakesMipLevelXZ; + public float flakesMipLevelXY; + public Vector3 flakesTriplanarWeights; + public Vector2 flakesDdxZY; // if non null, we will prefer gradients (to be used statically only!) + public Vector2 flakesDdyZY; + public Vector2 flakesDdxXZ; + public Vector2 flakesDdyXZ; + public Vector2 flakesDdxXY; + public Vector2 flakesDdyXY; // BTF Variables // Clearcoat - public Vector3 clearcoatColor; + public Vector3 clearcoatColor; [SurfaceDataAttributes("", true)] - public Vector3 clearcoatNormalWS; - public float clearcoatIOR; + public Vector3 clearcoatNormalWS; + public float clearcoatIOR; [SurfaceDataAttributes(new string[] { "Geometric Normal", "Geometric Normal View Space" }, true, checkIsNormalized = true)] public Vector3 geomNormalWS; @@ -195,10 +195,10 @@ public struct BSDFData // For area lighting - We pack all texture inside a texture array to reduce the number of resource required Texture2DArray m_LtcData; // 0: m_LtcGGXMatrix - RGBA; - Material m_preIntegratedFGDMaterial_Ward = null; - Material m_preIntegratedFGDMaterial_CookTorrance = null; - RenderTexture m_preIntegratedFGD_Ward = null; - RenderTexture m_preIntegratedFGD_CookTorrance = null; + Material m_preIntegratedFGDMaterial_Ward = null; + Material m_preIntegratedFGDMaterial_CookTorrance = null; + RenderTexture m_preIntegratedFGD_Ward = null; + RenderTexture m_preIntegratedFGD_CookTorrance = null; private bool m_precomputedFGDTablesAreInit = false; @@ -206,7 +206,7 @@ public struct BSDFData public static readonly int _PreIntegratedFGD_CookTorrance = Shader.PropertyToID("_PreIntegratedFGD_CookTorrance"); public static readonly int _AxFLtcData = Shader.PropertyToID("_AxFLtcData"); - public AxF() {} + public AxF() { } public override void Build(HDRenderPipelineAsset hdAsset, RenderPipelineResources defaultResources) { @@ -295,7 +295,7 @@ public override void RenderInit(CommandBuffer cmd) public override void Bind(CommandBuffer cmd) { - if (m_preIntegratedFGD_Ward == null || m_preIntegratedFGD_CookTorrance == null) + if (m_preIntegratedFGD_Ward == null || m_preIntegratedFGD_CookTorrance == null) { throw new Exception("Ward & Cook-Torrance BRDF pre-integration table not available!"); } diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/Decal.cs b/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/Decal.cs index 994b5ec6837..f9a49f0a17b 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/Decal.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/Decal.cs @@ -34,7 +34,7 @@ public enum DBufferMaterial // should this be combined into common class shared with Lit.cs??? static public int GetMaterialDBufferCount() { return (int)DBufferMaterial.Count; } - static GraphicsFormat[] m_RTFormat = { GraphicsFormat.R8G8B8A8_SRGB, GraphicsFormat.R8G8B8A8_UNorm, GraphicsFormat.R8G8B8A8_UNorm, GraphicsFormat.R8G8_UNorm}; + static GraphicsFormat[] m_RTFormat = { GraphicsFormat.R8G8B8A8_SRGB, GraphicsFormat.R8G8B8A8_UNorm, GraphicsFormat.R8G8B8A8_UNorm, GraphicsFormat.R8G8_UNorm }; static public void GetMaterialDBufferDescription(out GraphicsFormat[] RTFormat) { diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalSystem.cs b/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalSystem.cs index 8fd6dc7e6cc..86ab67b3ad8 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalSystem.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalSystem.cs @@ -635,12 +635,12 @@ private void GetDecalVolumeDataAndBound(Matrix4x4 decalToWorld, Matrix4x4 worldT var influenceForwardVS = worldToView.MultiplyVector(influenceZ / influenceExtents.z); var influencePositionVS = worldToView.MultiplyPoint(pos); // place the mesh pivot in the center - m_Bounds[m_DecalDatasCount].center = influencePositionVS; + m_Bounds[m_DecalDatasCount].center = influencePositionVS; m_Bounds[m_DecalDatasCount].boxAxisX = influenceRightVS * influenceExtents.x; m_Bounds[m_DecalDatasCount].boxAxisY = influenceUpVS * influenceExtents.y; m_Bounds[m_DecalDatasCount].boxAxisZ = influenceForwardVS * influenceExtents.z; - m_Bounds[m_DecalDatasCount].scaleXY = 1.0f; - m_Bounds[m_DecalDatasCount].radius = influenceExtents.magnitude; + m_Bounds[m_DecalDatasCount].scaleXY = 1.0f; + m_Bounds[m_DecalDatasCount].radius = influenceExtents.magnitude; // The culling system culls pixels that are further // than a threshold to the box influence extents. diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/DiffusionProfile/DiffusionProfileSettings.cs b/com.unity.render-pipelines.high-definition/Runtime/Material/DiffusionProfile/DiffusionProfileSettings.cs index 05b0e73c6d8..9d7d34a89f1 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/DiffusionProfile/DiffusionProfileSettings.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/DiffusionProfile/DiffusionProfileSettings.cs @@ -6,17 +6,17 @@ namespace UnityEngine.Rendering.HighDefinition [GenerateHLSL] class DiffusionProfileConstants { - public const int DIFFUSION_PROFILE_COUNT = 16; // Max. number of profiles, including the slot taken by the neutral profile + public const int DIFFUSION_PROFILE_COUNT = 16; // Max. number of profiles, including the slot taken by the neutral profile public const int DIFFUSION_PROFILE_NEUTRAL_ID = 0; // Does not result in blurring - public const int SSS_PIXELS_PER_SAMPLE = 4; + public const int SSS_PIXELS_PER_SAMPLE = 4; } enum DefaultSssSampleBudgetForQualityLevel { - Low = 20, + Low = 20, Medium = 40, - High = 80, - Max = 1000 + High = 80, + Max = 1000 } [Serializable] @@ -35,21 +35,21 @@ public enum TransmissionMode : uint } [ColorUsage(false, true)] - public Color scatteringDistance; // Per color channel (no meaningful units) + public Color scatteringDistance; // Per color channel (no meaningful units) [ColorUsage(false, true)] - public Color transmissionTint; // HDR color - public TexturingMode texturingMode; + public Color transmissionTint; // HDR color + public TexturingMode texturingMode; public TransmissionMode transmissionMode; - public Vector2 thicknessRemap; // X = min, Y = max (in millimeters) - public float worldScale; // Size of the world unit in meters - public float ior; // 1.4 for skin (mean ~0.028) + public Vector2 thicknessRemap; // X = min, Y = max (in millimeters) + public float worldScale; // Size of the world unit in meters + public float ior; // 1.4 for skin (mean ~0.028) - public Vector3 shapeParam { get; private set; } // RGB = shape parameter: S = 1 / D - public float filterRadius { get; private set; } // In millimeters - public float maxScatteringDistance { get; private set; } // No meaningful units + public Vector3 shapeParam { get; private set; } // RGB = shape parameter: S = 1 / D + public float filterRadius { get; private set; } // In millimeters + public float maxScatteringDistance { get; private set; } // No meaningful units // Unique hash used in shaders to identify the index in the diffusion profile array - public uint hash = 0; + public uint hash = 0; // Here we need to have one parameter in the diffusion profile parameter because the deserialization call the default constructor public DiffusionProfile(bool dontUseDefaultConstructor) @@ -72,8 +72,8 @@ internal void Validate() { thicknessRemap.y = Mathf.Max(thicknessRemap.y, 0f); thicknessRemap.x = Mathf.Clamp(thicknessRemap.x, 0f, thicknessRemap.y); - worldScale = Mathf.Max(worldScale, 0.001f); - ior = Mathf.Clamp(ior, 1.0f, 2.0f); + worldScale = Mathf.Max(worldScale, 0.001f); + ior = Mathf.Clamp(ior, 1.0f, 2.0f); UpdateKernel(); } @@ -246,7 +246,7 @@ internal void UpdateCache() profile.filterRadius, profile.thicknessRemap.x, profile.thicknessRemap.y - profile.thicknessRemap.x); - shapeParamAndMaxScatterDist = profile.shapeParam; + shapeParamAndMaxScatterDist = profile.shapeParam; shapeParamAndMaxScatterDist.w = profile.maxScatteringDistance; // Convert ior to fresnel0 float fresnel0 = (profile.ior - 1.0f) / (profile.ior + 1.0f); @@ -268,8 +268,8 @@ internal bool HasChanged(int update) public void SetDefaultParams() { worldScaleAndFilterRadiusAndThicknessRemap = new Vector4(1, 0, 0, 1); - shapeParamAndMaxScatterDist = new Vector4(16777216, 16777216, 16777216, 0); - transmissionTintAndFresnel0.w = 0.04f; // Match DEFAULT_SPECULAR_VALUE defined in Lit.hlsl + shapeParamAndMaxScatterDist = new Vector4(16777216, 16777216, 16777216, 0); + transmissionTintAndFresnel0.w = 0.04f; // Match DEFAULT_SPECULAR_VALUE defined in Lit.hlsl } } } diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/Eye/Eye.cs b/com.unity.render-pipelines.high-definition/Runtime/Material/Eye/Eye.cs index 2d1a1a4ff5b..3330fdcb7ce 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/Eye/Eye.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/Eye/Eye.cs @@ -109,7 +109,7 @@ public struct BSDFData // Init precomputed textures //----------------------------------------------------------------------------- - public Eye() {} + public Eye() { } // Reuse GGX textures } diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/Fabric/Fabric.cs b/com.unity.render-pipelines.high-definition/Runtime/Material/Fabric/Fabric.cs index 10c1d017e80..47342c3cdb3 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/Fabric/Fabric.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/Fabric/Fabric.cs @@ -125,7 +125,7 @@ public struct BSDFData // Init precomputed textures //----------------------------------------------------------------------------- - public Fabric() {} + public Fabric() { } public override void Build(HDRenderPipelineAsset hdAsset, RenderPipelineResources defaultResources) { diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/GGXConvolution/IBLFilterGGX.cs b/com.unity.render-pipelines.high-definition/Runtime/Material/GGXConvolution/IBLFilterGGX.cs index fa26f0b849d..d2cb9f450bf 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/GGXConvolution/IBLFilterGGX.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/GGXConvolution/IBLFilterGGX.cs @@ -5,26 +5,26 @@ namespace UnityEngine.Rendering.HighDefinition class IBLFilterGGX : IBLFilterBSDF { RenderTexture m_GgxIblSampleData; - int m_GgxIblMaxSampleCount = TextureCache.isMobileBuildTarget ? 34 : 89; // Width - const int k_GgxIblMipCountMinusOne = 6; // Height (UNITY_SPECCUBE_LOD_STEPS) + int m_GgxIblMaxSampleCount = TextureCache.isMobileBuildTarget ? 34 : 89; // Width + const int k_GgxIblMipCountMinusOne = 6; // Height (UNITY_SPECCUBE_LOD_STEPS) ComputeShader m_ComputeGgxIblSampleDataCS; - int m_ComputeGgxIblSampleDataKernel = -1; + int m_ComputeGgxIblSampleDataKernel = -1; ComputeShader m_BuildProbabilityTablesCS; - int m_ConditionalDensitiesKernel = -1; - int m_MarginalRowDensitiesKernel = -1; + int m_ConditionalDensitiesKernel = -1; + int m_MarginalRowDensitiesKernel = -1; // Planar reflection filtering ComputeShader m_PlanarReflectionFilteringCS; - int m_PlanarReflectionDepthConversionKernel = -1; - int m_PlanarReflectionDownScaleKernel = -1; - int m_PlanarReflectionFilteringKernel = -1; - RTHandle m_PlanarReflectionFilterTex0; - RTHandle m_PlanarReflectionFilterTex1; - RTHandle m_PlanarReflectionFilterDepthTex0; - RTHandle m_PlanarReflectionFilterDepthTex1; - const int k_DefaultPlanarResolution = 512; + int m_PlanarReflectionDepthConversionKernel = -1; + int m_PlanarReflectionDownScaleKernel = -1; + int m_PlanarReflectionFilteringKernel = -1; + RTHandle m_PlanarReflectionFilterTex0; + RTHandle m_PlanarReflectionFilterTex1; + RTHandle m_PlanarReflectionFilterDepthTex0; + RTHandle m_PlanarReflectionFilterDepthTex1; + const int k_DefaultPlanarResolution = 512; // Intermediate variables Vector4 currentScreenSize = new Vector4(1.0f, 1.0f, 1.0f, 1.0f); @@ -43,13 +43,13 @@ public override void Initialize(CommandBuffer cmd) { if (!m_ComputeGgxIblSampleDataCS) { - m_ComputeGgxIblSampleDataCS = m_RenderPipelineResources.shaders.computeGgxIblSampleDataCS; + m_ComputeGgxIblSampleDataCS = m_RenderPipelineResources.shaders.computeGgxIblSampleDataCS; m_ComputeGgxIblSampleDataKernel = m_ComputeGgxIblSampleDataCS.FindKernel("ComputeGgxIblSampleData"); } if (!m_BuildProbabilityTablesCS) { - m_BuildProbabilityTablesCS = m_RenderPipelineResources.shaders.buildProbabilityTablesCS; + m_BuildProbabilityTablesCS = m_RenderPipelineResources.shaders.buildProbabilityTablesCS; m_ConditionalDensitiesKernel = m_BuildProbabilityTablesCS.FindKernel("ComputeConditionalDensities"); m_MarginalRowDensitiesKernel = m_BuildProbabilityTablesCS.FindKernel("ComputeMarginalRowDensities"); } @@ -75,7 +75,7 @@ public override void Initialize(CommandBuffer cmd) if (!m_PlanarReflectionFilteringCS) { - m_PlanarReflectionFilteringCS = m_RenderPipelineResources.shaders.planarReflectionFilteringCS; + m_PlanarReflectionFilteringCS = m_RenderPipelineResources.shaders.planarReflectionFilteringCS; m_PlanarReflectionDepthConversionKernel = m_PlanarReflectionFilteringCS.FindKernel("DepthConversion"); m_PlanarReflectionDownScaleKernel = m_PlanarReflectionFilteringCS.FindKernel("DownScale"); m_PlanarReflectionFilteringKernel = m_PlanarReflectionFilteringCS.FindKernel("FilterPlanarReflection"); diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/Hair/Hair.cs b/com.unity.render-pipelines.high-definition/Runtime/Material/Hair/Hair.cs index c1c1df4bac0..f9b08e572b8 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/Hair/Hair.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/Hair/Hair.cs @@ -33,7 +33,7 @@ public struct SurfaceData public float specularOcclusion; [MaterialSharedPropertyMapping(MaterialSharedProperty.Normal)] - [SurfaceDataAttributes(new string[] {"Normal", "Normal View Space"}, true, checkIsNormalized = true)] + [SurfaceDataAttributes(new string[] { "Normal", "Normal View Space" }, true, checkIsNormalized = true)] public Vector3 normalWS; [SurfaceDataAttributes(new string[] { "Geometric Normal", "Geometric Normal View Space" }, true, checkIsNormalized = true)] @@ -99,7 +99,7 @@ public struct BSDFData public float perceptualRoughness; public Vector3 transmittance; - public float rimTransmissionIntensity; + public float rimTransmissionIntensity; // Anisotropic [SurfaceDataAttributes("", true)] @@ -120,7 +120,7 @@ public struct BSDFData // Init precomputed texture //----------------------------------------------------------------------------- - public Hair() {} + public Hair() { } public override void Build(HDRenderPipelineAsset hdAsset, RenderPipelineResources defaultResources) { diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.cs b/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.cs index 18b96ccb229..e9aff39b10f 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.cs @@ -12,13 +12,13 @@ partial class Lit : RenderPipelineMaterial [GenerateHLSL(PackingRules.Exact)] public enum MaterialFeatureFlags { - LitStandard = 1 << 0, // For material classification we need to identify that we are indeed use as standard material, else we are consider as sky/background element - LitSpecularColor = 1 << 1, // LitSpecularColor is not use statically but only dynamically + LitStandard = 1 << 0, // For material classification we need to identify that we are indeed use as standard material, else we are consider as sky/background element + LitSpecularColor = 1 << 1, // LitSpecularColor is not use statically but only dynamically LitSubsurfaceScattering = 1 << 2, - LitTransmission = 1 << 3, - LitAnisotropy = 1 << 4, - LitIridescence = 1 << 5, - LitClearCoat = 1 << 6 + LitTransmission = 1 << 3, + LitAnisotropy = 1 << 4, + LitIridescence = 1 << 5, + LitClearCoat = 1 << 6 }; //----------------------------------------------------------------------------- @@ -40,7 +40,7 @@ public struct SurfaceData public float specularOcclusion; [MaterialSharedPropertyMapping(MaterialSharedProperty.Normal)] - [SurfaceDataAttributes(new string[] {"Normal", "Normal View Space"}, true, checkIsNormalized = true)] + [SurfaceDataAttributes(new string[] { "Normal", "Normal View Space" }, true, checkIsNormalized = true)] public Vector3 normalWS; [MaterialSharedPropertyMapping(MaterialSharedProperty.Smoothness)] @@ -195,7 +195,7 @@ public struct BSDFData // Init precomputed texture //----------------------------------------------------------------------------- - public Lit() {} + public Lit() { } public override void Build(HDRenderPipelineAsset hdAsset, RenderPipelineResources defaultResources) { diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/MaterialExtension.cs b/com.unity.render-pipelines.high-definition/Runtime/Material/MaterialExtension.cs index e5422c068e4..a959c49dbf8 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/MaterialExtension.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/MaterialExtension.cs @@ -118,31 +118,31 @@ internal enum OpaqueCullMode internal static class MaterialExtension { - public static SurfaceType GetSurfaceType(this Material material) + public static SurfaceType GetSurfaceType(this Material material) => material.HasProperty(kSurfaceType) ? (SurfaceType)material.GetFloat(kSurfaceType) : SurfaceType.Opaque; - public static MaterialId GetMaterialId(this Material material) + public static MaterialId GetMaterialId(this Material material) => material.HasProperty(kMaterialID) ? (MaterialId)material.GetFloat(kMaterialID) : MaterialId.LitStandard; - public static BlendMode GetBlendMode(this Material material) + public static BlendMode GetBlendMode(this Material material) => material.HasProperty(kBlendMode) ? (BlendMode)material.GetFloat(kBlendMode) : BlendMode.Additive; - public static int GetLayerCount(this Material material) + public static int GetLayerCount(this Material material) => material.HasProperty(kLayerCount) ? material.GetInt(kLayerCount) : 1; - public static bool GetZWrite(this Material material) + public static bool GetZWrite(this Material material) => material.HasProperty(kZWrite) ? material.GetInt(kZWrite) == 1 : false; - public static bool GetTransparentZWrite(this Material material) + public static bool GetTransparentZWrite(this Material material) => material.HasProperty(kTransparentZWrite) ? material.GetInt(kTransparentZWrite) == 1 : false; - public static CullMode GetTransparentCullMode(this Material material) + public static CullMode GetTransparentCullMode(this Material material) => material.HasProperty(kTransparentCullMode) ? (CullMode)material.GetInt(kTransparentCullMode) : CullMode.Back; - public static CullMode GetOpaqueCullMode(this Material material) + public static CullMode GetOpaqueCullMode(this Material material) => material.HasProperty(kOpaqueCullMode) ? (CullMode)material.GetInt(kOpaqueCullMode) : CullMode.Back; - public static CompareFunction GetTransparentZTest(this Material material) + public static CompareFunction GetTransparentZTest(this Material material) => material.HasProperty(kZTestTransparent) ? (CompareFunction)material.GetInt(kZTestTransparent) : CompareFunction.LessEqual; public static void ResetMaterialCustomRenderQueue(this Material material) diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/PreIntegratedFGD/PreIntegratedFGD.cs b/com.unity.render-pipelines.high-definition/Runtime/Material/PreIntegratedFGD/PreIntegratedFGD.cs index de8634e2ab4..54aa8d43642 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/PreIntegratedFGD/PreIntegratedFGD.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/PreIntegratedFGD/PreIntegratedFGD.cs @@ -51,7 +51,7 @@ public void Build(FGDIndex index) if (m_refCounting[(int)index] == 0) { var hdrp = HDRenderPipeline.defaultAsset; - int res = (int)FGDTexture.Resolution; + int res = (int)FGDTexture.Resolution; switch (index) { diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/RenderPipelineMaterial.cs b/com.unity.render-pipelines.high-definition/Runtime/Material/RenderPipelineMaterial.cs index f0379eb1e3d..2bcea3f1cb7 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/RenderPipelineMaterial.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/RenderPipelineMaterial.cs @@ -8,11 +8,11 @@ class RenderPipelineMaterial : Object public virtual bool IsDefferedMaterial() { return false; } // Regular interface - public virtual void Build(HDRenderPipelineAsset hdAsset, RenderPipelineResources defaultResources) {} - public virtual void Cleanup() {} + public virtual void Build(HDRenderPipelineAsset hdAsset, RenderPipelineResources defaultResources) { } + public virtual void Cleanup() { } // Following function can be use to initialize GPU resource (once or each frame) and bind them - public virtual void RenderInit(CommandBuffer cmd) {} - public virtual void Bind(CommandBuffer cmd) {} + public virtual void RenderInit(CommandBuffer cmd) { } + public virtual void Bind(CommandBuffer cmd) { } } } diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/StackLit/StackLit.cs b/com.unity.render-pipelines.high-definition/Runtime/Material/StackLit/StackLit.cs index d665a1b6457..eabef864a6c 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/StackLit/StackLit.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/StackLit/StackLit.cs @@ -7,16 +7,16 @@ class StackLit : RenderPipelineMaterial [GenerateHLSL(PackingRules.Exact)] public enum MaterialFeatureFlags { - StackLitStandard = 1 << 0, - StackLitDualSpecularLobe = 1 << 1, - StackLitAnisotropy = 1 << 2, - StackLitCoat = 1 << 3, - StackLitIridescence = 1 << 4, - StackLitSubsurfaceScattering = 1 << 5, - StackLitTransmission = 1 << 6, - StackLitCoatNormalMap = 1 << 7, - StackLitSpecularColor = 1 << 8, - StackLitHazyGloss = 1 << 9, + StackLitStandard = 1 << 0, + StackLitDualSpecularLobe = 1 << 1, + StackLitAnisotropy = 1 << 2, + StackLitCoat = 1 << 3, + StackLitIridescence = 1 << 4, + StackLitSubsurfaceScattering = 1 << 5, + StackLitTransmission = 1 << 6, + StackLitCoatNormalMap = 1 << 7, + StackLitSpecularColor = 1 << 8, + StackLitHazyGloss = 1 << 9, }; // We will use keywords no need for [GenerateHLSL] as we don't test in HLSL such a value @@ -70,16 +70,16 @@ public struct SurfaceData public Vector3 specularColor; [MaterialSharedPropertyMapping(MaterialSharedProperty.Normal)] - [SurfaceDataAttributes(new string[] {"Normal", "Normal View Space"}, true, checkIsNormalized = true)] + [SurfaceDataAttributes(new string[] { "Normal", "Normal View Space" }, true, checkIsNormalized = true)] public Vector3 normalWS; - [SurfaceDataAttributes(new string[] {"Geometric Normal", "Geometric Normal View Space"}, true, checkIsNormalized = true)] + [SurfaceDataAttributes(new string[] { "Geometric Normal", "Geometric Normal View Space" }, true, checkIsNormalized = true)] public Vector3 geomNormalWS; - [SurfaceDataAttributes(new string[] {"Coat Normal", "Coat Normal View Space"}, true, checkIsNormalized = true)] + [SurfaceDataAttributes(new string[] { "Coat Normal", "Coat Normal View Space" }, true, checkIsNormalized = true)] public Vector3 coatNormalWS; - [SurfaceDataAttributes(new string[] {"Bent Normal", "Bent Normal View Space"}, true, checkIsNormalized = true)] + [SurfaceDataAttributes(new string[] { "Bent Normal", "Bent Normal View Space" }, true, checkIsNormalized = true)] public Vector3 bentNormalWS; [MaterialSharedPropertyMapping(MaterialSharedProperty.Smoothness)] @@ -207,13 +207,13 @@ public struct BSDFData [SurfaceDataAttributes(new string[] { "Normal WS", "Normal View Space" }, true, checkIsNormalized = true)] public Vector3 normalWS; - [SurfaceDataAttributes(new string[] {"Geometric Normal", "Geometric Normal View Space"}, true, checkIsNormalized = true)] + [SurfaceDataAttributes(new string[] { "Geometric Normal", "Geometric Normal View Space" }, true, checkIsNormalized = true)] public Vector3 geomNormalWS; - [SurfaceDataAttributes(new string[] {"Coat Normal", "Coat Normal View Space"}, true, checkIsNormalized = true)] + [SurfaceDataAttributes(new string[] { "Coat Normal", "Coat Normal View Space" }, true, checkIsNormalized = true)] public Vector3 coatNormalWS; - [SurfaceDataAttributes(new string[] {"Bent Normal", "Bent Normal View Space"}, true, checkIsNormalized = true)] + [SurfaceDataAttributes(new string[] { "Bent Normal", "Bent Normal View Space" }, true, checkIsNormalized = true)] public Vector3 bentNormalWS; public float perceptualRoughnessA; @@ -273,7 +273,7 @@ public struct BSDFData // Init precomputed textures //----------------------------------------------------------------------------- - public StackLit() {} + public StackLit() { } public override void Build(HDRenderPipelineAsset hdAsset, RenderPipelineResources defaultResources) { diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/SubsurfaceScattering/SubsurfaceScatteringManager.cs b/com.unity.render-pipelines.high-definition/Runtime/Material/SubsurfaceScattering/SubsurfaceScatteringManager.cs index c56e662c484..9adf6610789 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/SubsurfaceScattering/SubsurfaceScatteringManager.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/SubsurfaceScattering/SubsurfaceScatteringManager.cs @@ -15,17 +15,17 @@ public partial class HDRenderPipeline Material m_SSSCopyStencilForSplitLighting; // List of every diffusion profile data we need - Vector4[] m_SSSShapeParamsAndMaxScatterDists; - Vector4[] m_SSSTransmissionTintsAndFresnel0; - Vector4[] m_SSSDisabledTransmissionTintsAndFresnel0; - Vector4[] m_SSSWorldScalesAndFilterRadiiAndThicknessRemaps; - uint[] m_SSSDiffusionProfileHashes; - int[] m_SSSDiffusionProfileUpdate; - DiffusionProfileSettings[] m_SSSSetDiffusionProfiles; - DiffusionProfileSettings m_SSSDefaultDiffusionProfile; - int m_SSSActiveDiffusionProfileCount; - uint m_SSSTexturingModeFlags; // 1 bit/profile: 0 = PreAndPostScatter, 1 = PostScatter - uint m_SSSTransmissionFlags; // 1 bit/profile: 0 = regular, 1 = thin + Vector4[] m_SSSShapeParamsAndMaxScatterDists; + Vector4[] m_SSSTransmissionTintsAndFresnel0; + Vector4[] m_SSSDisabledTransmissionTintsAndFresnel0; + Vector4[] m_SSSWorldScalesAndFilterRadiiAndThicknessRemaps; + uint[] m_SSSDiffusionProfileHashes; + int[] m_SSSDiffusionProfileUpdate; + DiffusionProfileSettings[] m_SSSSetDiffusionProfiles; + DiffusionProfileSettings m_SSSDefaultDiffusionProfile; + int m_SSSActiveDiffusionProfileCount; + uint m_SSSTexturingModeFlags; // 1 bit/profile: 0 = PreAndPostScatter, 1 = PostScatter + uint m_SSSTransmissionFlags; // 1 bit/profile: 0 = regular, 1 = thin void InitializeSubsurfaceScattering() { @@ -104,19 +104,19 @@ void SetDiffusionProfileAtIndex(DiffusionProfileSettings settings, int index) if (settings.profile.hash == 0) return; - m_SSSShapeParamsAndMaxScatterDists[index] = settings.shapeParamAndMaxScatterDist; - m_SSSTransmissionTintsAndFresnel0[index] = settings.transmissionTintAndFresnel0; - m_SSSDisabledTransmissionTintsAndFresnel0[index] = settings.disabledTransmissionTintAndFresnel0; + m_SSSShapeParamsAndMaxScatterDists[index] = settings.shapeParamAndMaxScatterDist; + m_SSSTransmissionTintsAndFresnel0[index] = settings.transmissionTintAndFresnel0; + m_SSSDisabledTransmissionTintsAndFresnel0[index] = settings.disabledTransmissionTintAndFresnel0; m_SSSWorldScalesAndFilterRadiiAndThicknessRemaps[index] = settings.worldScaleAndFilterRadiusAndThicknessRemap; - m_SSSDiffusionProfileHashes[index] = settings.profile.hash; + m_SSSDiffusionProfileHashes[index] = settings.profile.hash; // Erase previous value (This need to be done here individually as in the SSS editor we edit individual component) uint mask = 1u << index; m_SSSTexturingModeFlags &= ~mask; m_SSSTransmissionFlags &= ~mask; - m_SSSTexturingModeFlags |= (uint)settings.profile.texturingMode << index; - m_SSSTransmissionFlags |= (uint)settings.profile.transmissionMode << index; + m_SSSTexturingModeFlags |= (uint)settings.profile.texturingMode << index; + m_SSSTransmissionFlags |= (uint)settings.profile.transmissionMode << index; m_SSSSetDiffusionProfiles[index] = settings; m_SSSDiffusionProfileUpdate[index] = settings.updateCount; @@ -161,15 +161,15 @@ static bool NeedTemporarySubsurfaceBuffer() struct SubsurfaceScatteringParameters { - public ComputeShader subsurfaceScatteringCS; - public int subsurfaceScatteringCSKernel; - public int sampleBudget; - public bool needTemporaryBuffer; - public Material copyStencilForSplitLighting; - public Material combineLighting; - public int numTilesX; - public int numTilesY; - public int numTilesZ; + public ComputeShader subsurfaceScatteringCS; + public int subsurfaceScatteringCSKernel; + public int sampleBudget; + public bool needTemporaryBuffer; + public Material copyStencilForSplitLighting; + public Material combineLighting; + public int numTilesX; + public int numTilesY; + public int numTilesZ; } struct SubsurfaceScatteringResources diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/SubsurfaceScattering/SubsurfaceScatteringManagerRT.cs b/com.unity.render-pipelines.high-definition/Runtime/Material/SubsurfaceScattering/SubsurfaceScatteringManagerRT.cs index a88b899457f..a14e8b8cfaa 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/SubsurfaceScattering/SubsurfaceScatteringManagerRT.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/SubsurfaceScattering/SubsurfaceScatteringManagerRT.cs @@ -281,17 +281,17 @@ TextureHandle TraceRTSSS(RenderGraph renderGraph, HDCamera hdCamera, TextureHand passData.normalBuffer = builder.ReadTexture(normalBuffer); passData.sssColor = builder.ReadTexture(sssColor); passData.intermediateBuffer0 = builder.CreateTransientTexture(new TextureDesc(Vector2.one, true, true) - { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, enableRandomWrite = true, name = "Intermediate Texture 0" }); + { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, enableRandomWrite = true, name = "Intermediate Texture 0" }); passData.intermediateBuffer1 = builder.CreateTransientTexture(new TextureDesc(Vector2.one, true, true) - { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, enableRandomWrite = true, name = "Intermediate Texture 1" }); + { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, enableRandomWrite = true, name = "Intermediate Texture 1" }); passData.intermediateBuffer2 = builder.CreateTransientTexture(new TextureDesc(Vector2.one, true, true) - { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, enableRandomWrite = true, name = "Intermediate Texture 2" }); + { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, enableRandomWrite = true, name = "Intermediate Texture 2" }); passData.intermediateBuffer3 = builder.CreateTransientTexture(new TextureDesc(Vector2.one, true, true) - { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, enableRandomWrite = true, name = "Intermediate Texture 3" }); + { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, enableRandomWrite = true, name = "Intermediate Texture 3" }); passData.directionBuffer = builder.CreateTransientTexture(new TextureDesc(Vector2.one, true, true) - { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, enableRandomWrite = true, name = "Distance buffer" }); + { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, enableRandomWrite = true, name = "Distance buffer" }); passData.outputBuffer = builder.WriteTexture(renderGraph.CreateTexture(new TextureDesc(Vector2.one, true, true) - { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, enableRandomWrite = true, name = "Ray Traced SSS" })); + { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, enableRandomWrite = true, name = "Ray Traced SSS" })); builder.SetRenderFunc( (TraceRTSSSPassData data, RenderGraphContext ctx) => diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/Unlit/Unlit.cs b/com.unity.render-pipelines.high-definition/Runtime/Material/Unlit/Unlit.cs index 290bab0ae9b..a89e177e405 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/Unlit/Unlit.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/Unlit/Unlit.cs @@ -20,7 +20,7 @@ public struct SurfaceData public Vector3 color; [MaterialSharedPropertyMapping(MaterialSharedProperty.Normal)] - [SurfaceDataAttributes(new string[] {"Normal", "Normal View Space"}, true)] + [SurfaceDataAttributes(new string[] { "Normal", "Normal View Space" }, true)] public Vector3 normalWS; }; diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/Bloom.cs b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/Bloom.cs index b86961ed2d6..c2db2200c65 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/Bloom.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/Bloom.cs @@ -168,6 +168,6 @@ public sealed class BloomResolutionParameter : VolumeParameter /// /// The initial value to store in the parameter. /// The initial override state for the parameter. - public BloomResolutionParameter(BloomResolution value, bool overrideState = false) : base(value, overrideState) {} + public BloomResolutionParameter(BloomResolution value, bool overrideState = false) : base(value, overrideState) { } } } diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/ColorCurves.cs b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/ColorCurves.cs index dc4eb6f3aaa..059ecda0453 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/ColorCurves.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/ColorCurves.cs @@ -34,22 +34,22 @@ public sealed class ColorCurves : VolumeComponent, IPostProcessComponent /// /// Shifts the input hue (x-axis) according to the output hue (y-axis). /// - public TextureCurveParameter hueVsHue = new TextureCurveParameter(new TextureCurve(new Keyframe[] {}, 0.5f, true, new Vector2(0f, 1f))); + public TextureCurveParameter hueVsHue = new TextureCurveParameter(new TextureCurve(new Keyframe[] { }, 0.5f, true, new Vector2(0f, 1f))); /// /// Adjusts saturation (y-axis) according to the input hue (x-axis). /// - public TextureCurveParameter hueVsSat = new TextureCurveParameter(new TextureCurve(new Keyframe[] {}, 0.5f, true, new Vector2(0f, 1f))); + public TextureCurveParameter hueVsSat = new TextureCurveParameter(new TextureCurve(new Keyframe[] { }, 0.5f, true, new Vector2(0f, 1f))); /// /// Adjusts saturation (y-axis) according to the input saturation (x-axis). /// - public TextureCurveParameter satVsSat = new TextureCurveParameter(new TextureCurve(new Keyframe[] {}, 0.5f, false, new Vector2(0f, 1f))); + public TextureCurveParameter satVsSat = new TextureCurveParameter(new TextureCurve(new Keyframe[] { }, 0.5f, false, new Vector2(0f, 1f))); /// /// Adjusts saturation (y-axis) according to the input luminance (x-axis). /// - public TextureCurveParameter lumVsSat = new TextureCurveParameter(new TextureCurve(new Keyframe[] {}, 0.5f, false, new Vector2(0f, 1f))); + public TextureCurveParameter lumVsSat = new TextureCurveParameter(new TextureCurve(new Keyframe[] { }, 0.5f, false, new Vector2(0f, 1f))); #pragma warning disable 414 [SerializeField] diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/DepthOfField.cs b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/DepthOfField.cs index a5848281405..bed1195c97a 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/DepthOfField.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/DepthOfField.cs @@ -318,7 +318,7 @@ public sealed class DepthOfFieldModeParameter : VolumeParameter /// The initial value to store in the parameter. /// The initial override state for the parameter. - public DepthOfFieldModeParameter(DepthOfFieldMode value, bool overrideState = false) : base(value, overrideState) {} + public DepthOfFieldModeParameter(DepthOfFieldMode value, bool overrideState = false) : base(value, overrideState) { } } /// @@ -332,6 +332,6 @@ public sealed class DepthOfFieldResolutionParameter : VolumeParameter /// The initial value to store in the parameter. /// The initial override state for the parameter. - public DepthOfFieldResolutionParameter(DepthOfFieldResolution value, bool overrideState = false) : base(value, overrideState) {} + public DepthOfFieldResolutionParameter(DepthOfFieldResolution value, bool overrideState = false) : base(value, overrideState) { } } } diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/Exposure.cs b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/Exposure.cs index 220a2324012..af32253f8a1 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/Exposure.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/Exposure.cs @@ -141,7 +141,7 @@ public sealed class Exposure : VolumeComponent, IPostProcessComponent /// /// Sets the radii of the procedural mask, in terms of fraction of half the screen (i.e. 0.5 means a mask that stretch half of the screen in both directions). /// - public NoInterpVector2Parameter proceduralRadii = new NoInterpVector2Parameter(new Vector2(0.3f, 0.3f)); + public NoInterpVector2Parameter proceduralRadii = new NoInterpVector2Parameter(new Vector2(0.3f, 0.3f)); /// /// All pixels below this threshold (in EV100 units) will be assigned a weight of 0 in the metering mask. /// @@ -316,7 +316,7 @@ public sealed class ExposureModeParameter : VolumeParameter /// /// The initial value to store in the parameter. /// The initial override state for the parameter. - public ExposureModeParameter(ExposureMode value, bool overrideState = false) : base(value, overrideState) {} + public ExposureModeParameter(ExposureMode value, bool overrideState = false) : base(value, overrideState) { } } /// @@ -330,7 +330,7 @@ public sealed class MeteringModeParameter : VolumeParameter /// /// The initial value to store in the parameter. /// The initial override state for the parameter. - public MeteringModeParameter(MeteringMode value, bool overrideState = false) : base(value, overrideState) {} + public MeteringModeParameter(MeteringMode value, bool overrideState = false) : base(value, overrideState) { } } /// @@ -344,7 +344,7 @@ public sealed class LuminanceSourceParameter : VolumeParameter /// /// The initial value to store in the parameter. /// The initial override state for the parameter. - public LuminanceSourceParameter(LuminanceSource value, bool overrideState = false) : base(value, overrideState) {} + public LuminanceSourceParameter(LuminanceSource value, bool overrideState = false) : base(value, overrideState) { } } /// @@ -358,7 +358,7 @@ public sealed class AdaptationModeParameter : VolumeParameter /// /// The initial value to store in the parameter. /// The initial override state for the parameter. - public AdaptationModeParameter(AdaptationMode value, bool overrideState = false) : base(value, overrideState) {} + public AdaptationModeParameter(AdaptationMode value, bool overrideState = false) : base(value, overrideState) { } } /// @@ -372,6 +372,6 @@ public sealed class TargetMidGrayParameter : VolumeParameter /// /// The initial value to store in the parameter. /// The initial override state for the parameter. - public TargetMidGrayParameter(TargetMidGray value, bool overrideState = false) : base(value, overrideState) {} + public TargetMidGrayParameter(TargetMidGray value, bool overrideState = false) : base(value, overrideState) { } } } diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/FilmGrain.cs b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/FilmGrain.cs index 133eb73a7a5..1ef678988d3 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/FilmGrain.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/FilmGrain.cs @@ -119,6 +119,6 @@ public sealed class FilmGrainLookupParameter : VolumeParameter /// /// The initial value to store in the parameter. /// The initial override state for the parameter. - public FilmGrainLookupParameter(FilmGrainLookup value, bool overrideState = false) : base(value, overrideState) {} + public FilmGrainLookupParameter(FilmGrainLookup value, bool overrideState = false) : base(value, overrideState) { } } } diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/MotionBlur.cs b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/MotionBlur.cs index a3a8baf78c1..52fdc503d4d 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/MotionBlur.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/MotionBlur.cs @@ -45,7 +45,7 @@ public sealed class CameraClampModeParameter : VolumeParameter /// /// The initial value to store in the parameter. /// The initial override state for the parameter. - public CameraClampModeParameter(CameraClampMode value, bool overrideState = false) : base(value, overrideState) {} + public CameraClampModeParameter(CameraClampMode value, bool overrideState = false) : base(value, overrideState) { } } /// diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/Tonemapping.cs b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/Tonemapping.cs index db8003d210d..e30768f38ee 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/Tonemapping.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/Tonemapping.cs @@ -165,6 +165,6 @@ public sealed class TonemappingModeParameter : VolumeParameter /// /// The initial value to store in the parameter. /// The initial override state for the parameter. - public TonemappingModeParameter(TonemappingMode value, bool overrideState = false) : base(value, overrideState) {} + public TonemappingModeParameter(TonemappingMode value, bool overrideState = false) : base(value, overrideState) { } } } diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/Vignette.cs b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/Vignette.cs index 085694a0b24..021d605c8f5 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/Vignette.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/Vignette.cs @@ -103,6 +103,6 @@ public sealed class VignetteModeParameter : VolumeParameter /// /// The initial value to store in the parameter. /// The initial override state for the parameter. - public VignetteModeParameter(VignetteMode value, bool overrideState = false) : base(value, overrideState) {} + public VignetteModeParameter(VignetteMode value, bool overrideState = false) : base(value, overrideState) { } } } diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/CustomPostProcessing/CustomPostProcessInjectionPoint.cs b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/CustomPostProcessing/CustomPostProcessInjectionPoint.cs index 90bccb3ee05..ab99e9cc5e9 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/CustomPostProcessing/CustomPostProcessInjectionPoint.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/CustomPostProcessing/CustomPostProcessInjectionPoint.cs @@ -6,12 +6,12 @@ namespace UnityEngine.Rendering.HighDefinition public enum CustomPostProcessInjectionPoint { /// After Opaque and Sky. - AfterOpaqueAndSky = 0, + AfterOpaqueAndSky = 0, /// Before TAA and Post Processing. - BeforeTAA = 3, + BeforeTAA = 3, /// Before Post Processing. - BeforePostProcess = 1, + BeforePostProcess = 1, /// After Post Processing. - AfterPostProcess = 2, + AfterPostProcess = 2, } } diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/CustomPostProcessing/CustomPostProcessVolumeComponent.cs b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/CustomPostProcessing/CustomPostProcessVolumeComponent.cs index 29f699ecd93..9f8c846735c 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/CustomPostProcessing/CustomPostProcessVolumeComponent.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/CustomPostProcessing/CustomPostProcessVolumeComponent.cs @@ -22,7 +22,7 @@ public abstract class CustomPostProcessVolumeComponent : VolumeComponent /// /// Setup function, called once before render is called. /// - public virtual void Setup() {} + public virtual void Setup() { } /// /// Called every frame for each camera when the post process needs to be rendered. @@ -36,7 +36,7 @@ public virtual void Setup() {} /// /// Cleanup function, called when the render pipeline is disposed. /// - public virtual void Cleanup() {} + public virtual void Cleanup() { } /// /// Unity calls this method when the object goes out of scope. diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/PostProcessSystem.RenderGraph.cs b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/PostProcessSystem.RenderGraph.cs index b0a5182bfa2..2bb1ca99948 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/PostProcessSystem.RenderGraph.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/PostProcessSystem.RenderGraph.cs @@ -166,7 +166,7 @@ class CustomPostProcessData public CustomPostProcessVolumeComponent customPostProcess; } - TextureHandle GetPostprocessOutputHandle(RenderGraph renderGraph, string name, bool dynamicResolution = true) + TextureHandle GetPostprocessOutputHandle(RenderGraph renderGraph, string name, bool dynamicResolution = true) { return renderGraph.CreateTexture(new TextureDesc(Vector2.one, dynamicResolution, true) { @@ -190,12 +190,12 @@ void FillBloomMipsTextureHandles(BloomData bloomData, RenderGraph renderGraph, R var pixelSize = new Vector2Int((int)m_BloomMipsInfo[i].x, (int)m_BloomMipsInfo[i].y); bloomData.mipsDown[i] = builder.CreateTransientTexture(new TextureDesc(scale, true, true) - { colorFormat = m_ColorFormat, enableRandomWrite = true, name = "BloomMipDown" }); + { colorFormat = m_ColorFormat, enableRandomWrite = true, name = "BloomMipDown" }); if (i != 0) { bloomData.mipsUp[i] = builder.CreateTransientTexture(new TextureDesc(scale, true, true) - { colorFormat = m_ColorFormat, enableRandomWrite = true, name = "BloomMipUp" }); + { colorFormat = m_ColorFormat, enableRandomWrite = true, name = "BloomMipUp" }); } } @@ -220,7 +220,7 @@ TextureHandle DoCopyAlpha(RenderGraph renderGraph, HDCamera hdCamera, TextureHan passData.parameters = PrepareCopyAlphaParameters(hdCamera); passData.source = builder.ReadTexture(source); passData.outputAlpha = builder.WriteTexture(renderGraph.CreateTexture(new TextureDesc(Vector2.one, true, true) - { name = "Alpha Channel Copy", colorFormat = GraphicsFormat.R16_SFloat, enableRandomWrite = true })); + { name = "Alpha Channel Copy", colorFormat = GraphicsFormat.R16_SFloat, enableRandomWrite = true })); builder.SetRenderFunc( (AlphaCopyPassData data, RenderGraphContext ctx) => @@ -252,7 +252,7 @@ TextureHandle StopNaNsPass(RenderGraph renderGraph, HDCamera hdCamera, TextureHa passData.source = builder.ReadTexture(source); passData.parameters = PrepareStopNaNParameters(hdCamera); TextureHandle dest = GetPostprocessOutputHandle(renderGraph, "Stop NaNs Destination"); - passData.destination = builder.WriteTexture(dest);; + passData.destination = builder.WriteTexture(dest); ; builder.SetRenderFunc( (StopNaNPassData data, RenderGraphContext ctx) => @@ -302,9 +302,9 @@ TextureHandle DynamicExposurePass(RenderGraph renderGraph, HDCamera hdCamera, Te else { passData.tmpTarget1024 = builder.CreateTransientTexture(new TextureDesc(1024, 1024, false, false) - { colorFormat = GraphicsFormat.R16G16_SFloat, enableRandomWrite = true, name = "Average Luminance Temp 1024" }); + { colorFormat = GraphicsFormat.R16G16_SFloat, enableRandomWrite = true, name = "Average Luminance Temp 1024" }); passData.tmpTarget32 = builder.CreateTransientTexture(new TextureDesc(32, 32, false, false) - { colorFormat = GraphicsFormat.R16G16_SFloat, enableRandomWrite = true, name = "Average Luminance Temp 32" }); + { colorFormat = GraphicsFormat.R16G16_SFloat, enableRandomWrite = true, name = "Average Luminance Temp 32" }); builder.SetRenderFunc( (DynamicExposureData data, RenderGraphContext ctx) => @@ -365,7 +365,7 @@ TextureHandle DoTemporalAntialiasing(RenderGraph renderGraph, HDCamera hdCamera, passData.nextMVLen = builder.WriteTexture(renderGraph.ImportTexture(nextMVLen)); TextureHandle dest = GetPostprocessOutputHandle(renderGraph, "TAA Destination"); - passData.destination = builder.WriteTexture(dest);; + passData.destination = builder.WriteTexture(dest); ; builder.SetRenderFunc( (TemporalAntiAliasingData data, RenderGraphContext ctx) => @@ -396,12 +396,12 @@ TextureHandle SMAAPass(RenderGraph renderGraph, HDCamera hdCamera, TextureHandle builder.ReadTexture(depthBuffer); passData.depthBuffer = builder.WriteTexture(depthBuffer); passData.smaaEdgeTex = builder.CreateTransientTexture(new TextureDesc(Vector2.one, true, true) - { colorFormat = GraphicsFormat.R8G8B8A8_UNorm, enableRandomWrite = true, name = "SMAA Edge Texture" }); + { colorFormat = GraphicsFormat.R8G8B8A8_UNorm, enableRandomWrite = true, name = "SMAA Edge Texture" }); passData.smaaBlendTex = builder.CreateTransientTexture(new TextureDesc(Vector2.one, true, true) - { colorFormat = GraphicsFormat.R8G8B8A8_UNorm, enableRandomWrite = true, name = "SMAA Blend Texture" }); + { colorFormat = GraphicsFormat.R8G8B8A8_UNorm, enableRandomWrite = true, name = "SMAA Blend Texture" }); TextureHandle dest = GetPostprocessOutputHandle(renderGraph, "SMAA Destination"); - passData.destination = builder.WriteTexture(dest);; + passData.destination = builder.WriteTexture(dest); ; builder.SetRenderFunc( (SMAAData data, RenderGraphContext ctx) => @@ -473,19 +473,19 @@ TextureHandle DepthOfFieldPass(RenderGraph renderGraph, HDCamera hdCamera, Textu if (passData.parameters.nearLayerActive) { passData.pingNearRGB = builder.CreateTransientTexture(new TextureDesc(screenScale, true, true) - { colorFormat = m_ColorFormat, enableRandomWrite = true, name = "Ping Near RGB" }); + { colorFormat = m_ColorFormat, enableRandomWrite = true, name = "Ping Near RGB" }); passData.pongNearRGB = builder.CreateTransientTexture(new TextureDesc(screenScale, true, true) - { colorFormat = m_ColorFormat, enableRandomWrite = true, name = "Pong Near RGB" }); + { colorFormat = m_ColorFormat, enableRandomWrite = true, name = "Pong Near RGB" }); passData.nearCoC = builder.CreateTransientTexture(new TextureDesc(screenScale, true, true) - { colorFormat = k_CoCFormat, enableRandomWrite = true, name = "Near CoC" }); + { colorFormat = k_CoCFormat, enableRandomWrite = true, name = "Near CoC" }); passData.nearAlpha = builder.CreateTransientTexture(new TextureDesc(screenScale, true, true) - { colorFormat = k_CoCFormat, enableRandomWrite = true, name = "Near Alpha" }); + { colorFormat = k_CoCFormat, enableRandomWrite = true, name = "Near Alpha" }); passData.dilatedNearCoC = builder.CreateTransientTexture(new TextureDesc(screenScale, true, true) - { colorFormat = k_CoCFormat, enableRandomWrite = true, name = "Dilated Near CoC" }); + { colorFormat = k_CoCFormat, enableRandomWrite = true, name = "Dilated Near CoC" }); } else { @@ -499,13 +499,13 @@ TextureHandle DepthOfFieldPass(RenderGraph renderGraph, HDCamera hdCamera, Textu if (passData.parameters.farLayerActive) { passData.pingFarRGB = builder.CreateTransientTexture(new TextureDesc(screenScale, true, true) - { colorFormat = m_ColorFormat, useMipMap = true, enableRandomWrite = true, name = "Ping Far RGB" }); + { colorFormat = m_ColorFormat, useMipMap = true, enableRandomWrite = true, name = "Ping Far RGB" }); passData.pongFarRGB = builder.CreateTransientTexture(new TextureDesc(screenScale, true, true) - { colorFormat = m_ColorFormat, enableRandomWrite = true, name = "Pong Far RGB" }); + { colorFormat = m_ColorFormat, enableRandomWrite = true, name = "Pong Far RGB" }); passData.farCoC = builder.CreateTransientTexture(new TextureDesc(screenScale, true, true) - { colorFormat = k_CoCFormat, useMipMap = true, enableRandomWrite = true, name = "Far CoC" }); + { colorFormat = k_CoCFormat, useMipMap = true, enableRandomWrite = true, name = "Far CoC" }); } else { @@ -515,7 +515,7 @@ TextureHandle DepthOfFieldPass(RenderGraph renderGraph, HDCamera hdCamera, Textu } passData.fullresCoC = builder.ReadWriteTexture(renderGraph.CreateTexture(new TextureDesc(Vector2.one, true, true) - { colorFormat = k_CoCFormat, enableRandomWrite = true, name = "Full res CoC" })); + { colorFormat = k_CoCFormat, enableRandomWrite = true, name = "Full res CoC" })); GetDoFResolutionScale(passData.parameters, out float unused, out float resolutionScale); float actualNearMaxBlur = passData.parameters.nearMaxBlur * resolutionScale; @@ -525,7 +525,7 @@ TextureHandle DepthOfFieldPass(RenderGraph renderGraph, HDCamera hdCamera, Textu if (passCount > 1) { passData.dilationPingPongRT = builder.CreateTransientTexture(new TextureDesc(screenScale, true, true) - { colorFormat = k_CoCFormat, enableRandomWrite = true, name = "Dilation ping pong CoC" }); + { colorFormat = k_CoCFormat, enableRandomWrite = true, name = "Dilation ping pong CoC" }); } var mipScale = scale; @@ -573,17 +573,17 @@ TextureHandle DepthOfFieldPass(RenderGraph renderGraph, HDCamera hdCamera, Textu else { passData.fullresCoC = builder.ReadWriteTexture(renderGraph.CreateTexture(new TextureDesc(Vector2.one, true, true) - { colorFormat = k_CoCFormat, enableRandomWrite = true, useMipMap = false, name = "Full res CoC" })); + { colorFormat = k_CoCFormat, enableRandomWrite = true, useMipMap = false, name = "Full res CoC" })); passData.pingFarRGB = builder.CreateTransientTexture(new TextureDesc(Vector2.one, true, true) - { colorFormat = m_ColorFormat, useMipMap = true, enableRandomWrite = true, name = "DoF Source Pyramid" }); + { colorFormat = m_ColorFormat, useMipMap = true, enableRandomWrite = true, name = "DoF Source Pyramid" }); float scaleFactor = 1.0f / passData.parameters.minMaxCoCTileSize; passData.pingNearRGB = builder.CreateTransientTexture(new TextureDesc(Vector2.one * scaleFactor, true, true) - { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, useMipMap = false, enableRandomWrite = true, name = "CoC Min Max Tiles" }); + { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, useMipMap = false, enableRandomWrite = true, name = "CoC Min Max Tiles" }); passData.pongNearRGB = builder.CreateTransientTexture(new TextureDesc(Vector2.one * scaleFactor, true, true) - { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, useMipMap = false, enableRandomWrite = true, name = "CoC Min Max Tiles" }); + { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, useMipMap = false, enableRandomWrite = true, name = "CoC Min Max Tiles" }); builder.SetRenderFunc( @@ -676,13 +676,13 @@ TextureHandle MotionBlurPass(RenderGraph renderGraph, HDCamera hdCamera, Texture Vector2 tileTexScale = new Vector2((float)passData.parameters.tileTargetSize.x / hdCamera.actualWidth, (float)passData.parameters.tileTargetSize.y / hdCamera.actualHeight); passData.preppedMotionVec = builder.CreateTransientTexture(new TextureDesc(Vector2.one, true, true) - { colorFormat = GraphicsFormat.B10G11R11_UFloatPack32, enableRandomWrite = true, name = "Prepped Motion Vectors" }); + { colorFormat = GraphicsFormat.B10G11R11_UFloatPack32, enableRandomWrite = true, name = "Prepped Motion Vectors" }); passData.minMaxTileVel = builder.CreateTransientTexture(new TextureDesc(tileTexScale, true, true) - { colorFormat = GraphicsFormat.B10G11R11_UFloatPack32, enableRandomWrite = true, name = "MinMax Tile Motion Vectors" }); + { colorFormat = GraphicsFormat.B10G11R11_UFloatPack32, enableRandomWrite = true, name = "MinMax Tile Motion Vectors" }); passData.maxTileNeigbourhood = builder.CreateTransientTexture(new TextureDesc(tileTexScale, true, true) - { colorFormat = GraphicsFormat.B10G11R11_UFloatPack32, enableRandomWrite = true, name = "Max Neighbourhood Tile" }); + { colorFormat = GraphicsFormat.B10G11R11_UFloatPack32, enableRandomWrite = true, name = "Max Neighbourhood Tile" }); passData.tileToScatterMax = TextureHandle.nullHandle; passData.tileToScatterMin = TextureHandle.nullHandle; @@ -690,10 +690,10 @@ TextureHandle MotionBlurPass(RenderGraph renderGraph, HDCamera hdCamera, Texture if (passData.parameters.motionblurSupportScattering) { passData.tileToScatterMax = builder.CreateTransientTexture(new TextureDesc(tileTexScale, true, true) - { colorFormat = GraphicsFormat.R32_UInt, enableRandomWrite = true, name = "Tile to Scatter Max" }); + { colorFormat = GraphicsFormat.R32_UInt, enableRandomWrite = true, name = "Tile to Scatter Max" }); passData.tileToScatterMin = builder.CreateTransientTexture(new TextureDesc(tileTexScale, true, true) - { colorFormat = GraphicsFormat.R16_SFloat, enableRandomWrite = true, name = "Tile to Scatter Min" }); + { colorFormat = GraphicsFormat.R16_SFloat, enableRandomWrite = true, name = "Tile to Scatter Min" }); } TextureHandle dest = GetPostprocessOutputHandle(renderGraph, "Motion Blur Destination"); @@ -856,7 +856,7 @@ TextureHandle FXAAPass(RenderGraph renderGraph, HDCamera hdCamera, TextureHandle passData.source = builder.ReadTexture(source); passData.parameters = PrepareFXAAParameters(hdCamera); TextureHandle dest = GetPostprocessOutputHandle(renderGraph, "FXAA Destination"); - passData.destination = builder.WriteTexture(dest);; + passData.destination = builder.WriteTexture(dest); ; builder.SetRenderFunc( (FXAAData data, RenderGraphContext ctx) => @@ -965,7 +965,7 @@ bool DoCustomPostProcess(RenderGraph renderGraph, HDCamera hdCamera, ref Texture passData.source = builder.ReadTexture(source); passData.destination = builder.UseColorBuffer(renderGraph.CreateTexture(new TextureDesc(Vector2.one, true, true) - { colorFormat = m_ColorFormat, enableRandomWrite = true, name = "CustomPostProcesDestination" }), 0); + { colorFormat = m_ColorFormat, enableRandomWrite = true, name = "CustomPostProcesDestination" }), 0); passData.hdCamera = hdCamera; passData.customPostProcess = customPP; builder.SetRenderFunc( @@ -1081,11 +1081,11 @@ public void Render(RenderGraph renderGraph, class FinalPassData { - public FinalPassParameters parameters; - public TextureHandle source; - public TextureHandle afterPostProcessTexture; - public TextureHandle alphaTexture; - public TextureHandle destination; + public FinalPassParameters parameters; + public TextureHandle source; + public TextureHandle afterPostProcessTexture; + public TextureHandle alphaTexture; + public TextureHandle destination; } } } diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/PostProcessSystem.cs b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/PostProcessSystem.cs index b2b31060b61..8d2f5077e9e 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/PostProcessSystem.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/PostProcessSystem.cs @@ -19,9 +19,9 @@ private enum SMAAStage NeighborhoodBlending = 2 } - GraphicsFormat m_ColorFormat = GraphicsFormat.B10G11R11_UFloatPack32; - const GraphicsFormat k_CoCFormat = GraphicsFormat.R16_SFloat; - internal const GraphicsFormat k_ExposureFormat = GraphicsFormat.R32G32_SFloat; + GraphicsFormat m_ColorFormat = GraphicsFormat.B10G11R11_UFloatPack32; + const GraphicsFormat k_CoCFormat = GraphicsFormat.R16_SFloat; + internal const GraphicsFormat k_ExposureFormat = GraphicsFormat.R32G32_SFloat; readonly RenderPipelineResources m_Resources; Material m_FinalPassMaterial; @@ -34,7 +34,7 @@ private enum SMAAStage // Exposure data const int k_ExposureCurvePrecision = 128; - const int k_HistogramBins = 128; // Important! If this changes, need to change HistogramExposure.compute + const int k_HistogramBins = 128; // Important! If this changes, need to change HistogramExposure.compute const int k_DebugImageHistogramBins = 256; // Important! If this changes, need to change HistogramExposure.compute readonly Color[] m_ExposureCurveColorArray = new Color[k_ExposureCurvePrecision]; readonly int[] m_ExposureVariants = new int[4]; @@ -223,13 +223,13 @@ public void Cleanup() CoreUtils.SafeRelease(m_DebugImageHistogramBuffer); RTHandles.Release(m_DebugExposureData); - m_ExposureCurveTexture = null; - m_InternalSpectralLut = null; - m_FinalPassMaterial = null; - m_ClearBlackMaterial = null; - m_SMAAMaterial = null; - m_TemporalAAMaterial = null; - m_HistogramBuffer = null; + m_ExposureCurveTexture = null; + m_InternalSpectralLut = null; + m_FinalPassMaterial = null; + m_ClearBlackMaterial = null; + m_SMAAMaterial = null; + m_TemporalAAMaterial = null; + m_HistogramBuffer = null; m_DebugImageHistogramBuffer = null; m_DebugExposureData = null; } @@ -258,44 +258,44 @@ public void BeginFrame(CommandBuffer cmd, HDCamera camera, HDRenderPipeline hdIn // Prefetch all the volume components we need to save some cycles as most of these will // be needed in multiple places var stack = camera.volumeStack; - m_Exposure = stack.GetComponent(); - m_DepthOfField = stack.GetComponent(); - m_MotionBlur = stack.GetComponent(); - m_PaniniProjection = stack.GetComponent(); - m_Bloom = stack.GetComponent(); - m_ChromaticAberration = stack.GetComponent(); - m_LensDistortion = stack.GetComponent(); - m_Vignette = stack.GetComponent(); - m_Tonemapping = stack.GetComponent(); - m_WhiteBalance = stack.GetComponent(); - m_ColorAdjustments = stack.GetComponent(); - m_ChannelMixer = stack.GetComponent(); - m_SplitToning = stack.GetComponent(); - m_LiftGammaGain = stack.GetComponent(); + m_Exposure = stack.GetComponent(); + m_DepthOfField = stack.GetComponent(); + m_MotionBlur = stack.GetComponent(); + m_PaniniProjection = stack.GetComponent(); + m_Bloom = stack.GetComponent(); + m_ChromaticAberration = stack.GetComponent(); + m_LensDistortion = stack.GetComponent(); + m_Vignette = stack.GetComponent(); + m_Tonemapping = stack.GetComponent(); + m_WhiteBalance = stack.GetComponent(); + m_ColorAdjustments = stack.GetComponent(); + m_ChannelMixer = stack.GetComponent(); + m_SplitToning = stack.GetComponent(); + m_LiftGammaGain = stack.GetComponent(); m_ShadowsMidtonesHighlights = stack.GetComponent(); - m_Curves = stack.GetComponent(); - m_FilmGrain = stack.GetComponent(); - m_PathTracing = stack.GetComponent(); + m_Curves = stack.GetComponent(); + m_FilmGrain = stack.GetComponent(); + m_PathTracing = stack.GetComponent(); // Prefetch frame settings - these aren't free to pull so we want to do it only once // per frame var frameSettings = camera.frameSettings; - m_StopNaNFS = frameSettings.IsEnabled(FrameSettingsField.StopNaN); - m_DepthOfFieldFS = frameSettings.IsEnabled(FrameSettingsField.DepthOfField); - m_MotionBlurFS = frameSettings.IsEnabled(FrameSettingsField.MotionBlur); - m_PaniniProjectionFS = frameSettings.IsEnabled(FrameSettingsField.PaniniProjection); - m_BloomFS = frameSettings.IsEnabled(FrameSettingsField.Bloom); + m_StopNaNFS = frameSettings.IsEnabled(FrameSettingsField.StopNaN); + m_DepthOfFieldFS = frameSettings.IsEnabled(FrameSettingsField.DepthOfField); + m_MotionBlurFS = frameSettings.IsEnabled(FrameSettingsField.MotionBlur); + m_PaniniProjectionFS = frameSettings.IsEnabled(FrameSettingsField.PaniniProjection); + m_BloomFS = frameSettings.IsEnabled(FrameSettingsField.Bloom); m_ChromaticAberrationFS = frameSettings.IsEnabled(FrameSettingsField.ChromaticAberration); - m_LensDistortionFS = frameSettings.IsEnabled(FrameSettingsField.LensDistortion); - m_VignetteFS = frameSettings.IsEnabled(FrameSettingsField.Vignette); - m_ColorGradingFS = frameSettings.IsEnabled(FrameSettingsField.ColorGrading); - m_TonemappingFS = frameSettings.IsEnabled(FrameSettingsField.Tonemapping); - m_FilmGrainFS = frameSettings.IsEnabled(FrameSettingsField.FilmGrain); - m_DitheringFS = frameSettings.IsEnabled(FrameSettingsField.Dithering); - m_AntialiasingFS = frameSettings.IsEnabled(FrameSettingsField.Antialiasing); + m_LensDistortionFS = frameSettings.IsEnabled(FrameSettingsField.LensDistortion); + m_VignetteFS = frameSettings.IsEnabled(FrameSettingsField.Vignette); + m_ColorGradingFS = frameSettings.IsEnabled(FrameSettingsField.ColorGrading); + m_TonemappingFS = frameSettings.IsEnabled(FrameSettingsField.Tonemapping); + m_FilmGrainFS = frameSettings.IsEnabled(FrameSettingsField.FilmGrain); + m_DitheringFS = frameSettings.IsEnabled(FrameSettingsField.Dithering); + m_AntialiasingFS = frameSettings.IsEnabled(FrameSettingsField.Antialiasing); // Override full screen anti-aliasing when doing path tracing (which is naturally anti-aliased already) - m_AntialiasingFS &= !m_PathTracing.enable.value; + m_AntialiasingFS &= !m_PathTracing.enable.value; m_DebugExposureCompensation = m_HDInstance.m_CurrentDebugDisplaySettings.data.lightingDebugSettings.debugExposure; @@ -321,34 +321,34 @@ public void BeginFrame(CommandBuffer cmd, HDCamera camera, HDRenderPipeline hdIn struct UberPostParameters { - public ComputeShader uberPostCS; - public int uberPostKernel; - public bool outputColorLog; - public int width; - public int height; - public int viewCount; + public ComputeShader uberPostCS; + public int uberPostKernel; + public bool outputColorLog; + public int width; + public int height; + public int viewCount; - public Vector4 logLutSettings; + public Vector4 logLutSettings; - public Vector4 lensDistortionParams1; - public Vector4 lensDistortionParams2; + public Vector4 lensDistortionParams1; + public Vector4 lensDistortionParams2; - public Texture spectralLut; - public Vector4 chromaticAberrationParameters; + public Texture spectralLut; + public Vector4 chromaticAberrationParameters; - public Vector4 vignetteParams1; - public Vector4 vignetteParams2; - public Vector4 vignetteColor; - public Texture vignetteMask; + public Vector4 vignetteParams1; + public Vector4 vignetteParams2; + public Vector4 vignetteColor; + public Texture vignetteMask; - public Texture bloomDirtTexture; - public Vector4 bloomParams; - public Vector4 bloomTint; - public Vector4 bloomBicubicParams; - public Vector4 bloomDirtTileOffset; - public Vector4 bloomThreshold; + public Texture bloomDirtTexture; + public Vector4 bloomParams; + public Vector4 bloomTint; + public Vector4 bloomBicubicParams; + public Vector4 bloomDirtTileOffset; + public Vector4 bloomThreshold; - public Vector4 alphaScaleBias; + public Vector4 alphaScaleBias; } UberPostParameters PrepareUberPostParameters(HDCamera hdCamera, bool isSceneView) @@ -723,9 +723,9 @@ ExposureParameters PrepareExposureParameters(HDCamera hdCamera) [MethodImpl(MethodImplOptions.AggressiveInlining)] bool IsExposureFixed(HDCamera camera) => m_Exposure.mode.value == ExposureMode.Fixed || m_Exposure.mode.value == ExposureMode.UsePhysicalCamera - #if UNITY_EDITOR +#if UNITY_EDITOR || (camera.camera.cameraType == CameraType.SceneView && HDAdditionalSceneViewSettings.sceneExposureOverriden) - #endif +#endif ; //if exposure comes from the parent camera, it means we dont have to calculate / force it. @@ -910,7 +910,7 @@ static void DoDynamicExposure(in ExposureParameters exposureParameters, CommandB var sourceTex = colorBuffer; kernel = exposureParameters.exposurePreparationKernel; - cmd.SetComputeIntParams(cs, HDShaderIDs._Variants, exposureParameters.exposureVariants); + cmd.SetComputeIntParams(cs, HDShaderIDs._Variants, exposureParameters.exposureVariants); cmd.SetComputeTextureParam(cs, kernel, HDShaderIDs._PreviousExposureTexture, prevExposure); cmd.SetComputeTextureParam(cs, kernel, HDShaderIDs._SourceTexture, sourceTex); cmd.SetComputeVectorParam(cs, HDShaderIDs._ExposureParams2, exposureParameters.exposureParams2); @@ -3346,22 +3346,22 @@ static void DoContrastAdaptiveSharpening(in CASParameters parameters, CommandBuf struct FinalPassParameters { - public bool postProcessEnabled; - public Material finalPassMaterial; - public HDCamera hdCamera; - public BlueNoise blueNoise; - public bool flipY; - public System.Random random; - public bool useFXAA; - public bool enableAlpha; - public bool keepAlpha; + public bool postProcessEnabled; + public Material finalPassMaterial; + public HDCamera hdCamera; + public BlueNoise blueNoise; + public bool flipY; + public System.Random random; + public bool useFXAA; + public bool enableAlpha; + public bool keepAlpha; - public bool filmGrainEnabled; - public Texture filmGrainTexture; - public float filmGrainIntensity; - public float filmGrainResponse; + public bool filmGrainEnabled; + public Texture filmGrainTexture; + public float filmGrainIntensity; + public float filmGrainResponse; - public bool ditheringEnabled; + public bool ditheringEnabled; } FinalPassParameters PrepareFinalPass(HDCamera hdCamera, BlueNoise blueNoise, bool flipY) @@ -3397,12 +3397,12 @@ FinalPassParameters PrepareFinalPass(HDCamera hdCamera, BlueNoise blueNoise, boo return parameters; } - static void DoFinalPass(in FinalPassParameters parameters, - RTHandle source, - RTHandle afterPostProcessTexture, - RenderTargetIdentifier destination, - RTHandle alphaTexture, - CommandBuffer cmd) + static void DoFinalPass(in FinalPassParameters parameters, + RTHandle source, + RTHandle afterPostProcessTexture, + RenderTargetIdentifier destination, + RTHandle alphaTexture, + CommandBuffer cmd) { // Final pass has to be done in a pixel shader as it will be the one writing straight // to the backbuffer eventually @@ -3445,13 +3445,13 @@ static void DoFinalPass(in FinalPassParameters parameters, { if (parameters.filmGrainTexture != null) // Fail safe if the resources asset breaks :/ { - #if HDRP_DEBUG_STATIC_POSTFX +#if HDRP_DEBUG_STATIC_POSTFX float offsetX = 0; float offsetY = 0; - #else +#else float offsetX = (float)(parameters.random.NextDouble()); float offsetY = (float)(parameters.random.NextDouble()); - #endif +#endif finalPassMaterial.EnableKeyword("GRAIN"); finalPassMaterial.SetTexture(HDShaderIDs._GrainTexture, parameters.filmGrainTexture); @@ -3470,11 +3470,11 @@ static void DoFinalPass(in FinalPassParameters parameters, { var blueNoiseTexture = parameters.blueNoise.textureArray16L; - #if HDRP_DEBUG_STATIC_POSTFX +#if HDRP_DEBUG_STATIC_POSTFX int textureId = 0; - #else +#else int textureId = (int)hdCamera.GetCameraFrameCount() % blueNoiseTexture.depth; - #endif +#endif finalPassMaterial.EnableKeyword("DITHER"); finalPassMaterial.SetTexture(HDShaderIDs._BlueNoiseTexture, blueNoiseTexture); @@ -3494,7 +3494,7 @@ static void DoFinalPass(in FinalPassParameters parameters, finalPassMaterial.SetVector(HDShaderIDs._UVTransform, flipY ? new Vector4(1.0f, -1.0f, 0.0f, 1.0f) - : new Vector4(1.0f, 1.0f, 0.0f, 0.0f) + : new Vector4(1.0f, 1.0f, 0.0f, 0.0f) ); finalPassMaterial.SetVector(HDShaderIDs._ViewPortSize, diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/UberPostFeatures.cs b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/UberPostFeatures.cs index 20036021ed9..9d6ebd469d3 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/UberPostFeatures.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/UberPostFeatures.cs @@ -5,10 +5,10 @@ namespace UnityEngine.Rendering.HighDefinition [Flags] internal enum UberPostFeatureFlags { - None = 0, - ChromaticAberration = 1 << 0, - Vignette = 1 << 1, - LensDistortion = 1 << 2, - EnableAlpha = 1 << 3 + None = 0, + ChromaticAberration = 1 << 0, + Vignette = 1 << 1, + LensDistortion = 1 << 2, + EnableAlpha = 1 << 3 } } diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Accumulation/SubFrameManager.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Accumulation/SubFrameManager.cs index f314147fa23..7d04b577be6 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Accumulation/SubFrameManager.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Accumulation/SubFrameManager.cs @@ -24,7 +24,7 @@ public void ResetIteration() public bool fogEnabled; public float accumulatedWeight; - public uint currentIteration; + public uint currentIteration; } // Helper class to manage time-scale in Unity when recording multi-frame sequences where one final frame is an accumulation of multiple sub-frames @@ -266,11 +266,11 @@ public void PrepareNewSubFrame() struct RenderAccumulationParameters { - public ComputeShader accumulationCS; - public int accumulationKernel; - public SubFrameManager subFrameManager; - public bool needExposure; - public HDCamera hdCamera; + public ComputeShader accumulationCS; + public int accumulationKernel; + public SubFrameManager subFrameManager; + public bool needExposure; + public HDCamera hdCamera; } RenderAccumulationParameters PrepareRenderAccumulationParameters(HDCamera hdCamera, bool needExposure, bool inputFromRadianceTexture) diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDAdditionalCameraData.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDAdditionalCameraData.cs index 4ebb56d87ef..c2e9856ae9e 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDAdditionalCameraData.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDAdditionalCameraData.cs @@ -31,18 +31,18 @@ public class HDPhysicalCamera public const int kMaxBladeCount = 11; // Camera body - [SerializeField][Min(1f)] int m_Iso = 200; - [SerializeField][Min(0f)] float m_ShutterSpeed = 1f / 200f; + [SerializeField] [Min(1f)] int m_Iso = 200; + [SerializeField] [Min(0f)] float m_ShutterSpeed = 1f / 200f; // Lens // Note: focalLength is already defined in the regular camera component - [SerializeField][Range(kMinAperture, kMaxAperture)] float m_Aperture = 16f; + [SerializeField] [Range(kMinAperture, kMaxAperture)] float m_Aperture = 16f; // Aperture shape - [SerializeField][Range(kMinBladeCount, kMaxBladeCount)] int m_BladeCount = 5; + [SerializeField] [Range(kMinBladeCount, kMaxBladeCount)] int m_BladeCount = 5; [SerializeField] Vector2 m_Curvature = new Vector2(2f, 11f); - [SerializeField][Range(0f, 1f)] float m_BarrelClipping = 0.25f; - [SerializeField][Range(-1f, 1f)] float m_Anamorphism = 0f; + [SerializeField] [Range(0f, 1f)] float m_BarrelClipping = 0.25f; + [SerializeField] [Range(-1f, 1f)] float m_Anamorphism = 0f; /// /// The sensor sensitivity (ISO). diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs index cc192359db7..edd947a899a 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs @@ -70,38 +70,38 @@ public struct ViewConstants /// Screen resolution information. /// Width, height, inverse width, inverse height. /// - public Vector4 screenSize; + public Vector4 screenSize; /// Camera frustum. - public Frustum frustum; + public Frustum frustum; /// Camera component. - public Camera camera; + public Camera camera; /// TAA jitter information. - public Vector4 taaJitter; + public Vector4 taaJitter; /// View constants. - public ViewConstants mainViewConstants; + public ViewConstants mainViewConstants; /// Color pyramid history buffer state. - public bool colorPyramidHistoryIsValid = false; + public bool colorPyramidHistoryIsValid = false; /// Volumetric history buffer state. - public bool volumetricHistoryIsValid = false; + public bool volumetricHistoryIsValid = false; - internal int volumetricValidFrames = 0; + internal int volumetricValidFrames = 0; /// Width actually used for rendering after dynamic resolution and XR is applied. - public int actualWidth { get; private set; } + public int actualWidth { get; private set; } /// Height actually used for rendering after dynamic resolution and XR is applied. - public int actualHeight { get; private set; } + public int actualHeight { get; private set; } /// Number of MSAA samples used for this frame. - public MSAASamples msaaSamples { get; private set; } + public MSAASamples msaaSamples { get; private set; } /// Frame settings for this camera. - public FrameSettings frameSettings { get; private set; } + public FrameSettings frameSettings { get; private set; } /// RTHandle properties for the camera history buffers. - public RTHandleProperties historyRTHandleProperties { get { return m_HistoryRTSystem.rtHandleProperties; } } + public RTHandleProperties historyRTHandleProperties { get { return m_HistoryRTSystem.rtHandleProperties; } } /// Volume stack used for this camera. - public VolumeStack volumeStack { get; private set; } + public VolumeStack volumeStack { get; private set; } /// Current time for this camera. - public float time; // Take the 'animateMaterials' setting into account. + public float time; // Take the 'animateMaterials' setting into account. - internal bool dofHistoryIsValid = false; // used to invalidate DoF accumulation history when switching DoF modes + internal bool dofHistoryIsValid = false; // used to invalidate DoF accumulation history when switching DoF modes // Pass all the systems that may want to initialize per-camera data here. // That way you will never create an HDCamera and forget to initialize the data. @@ -203,31 +203,31 @@ internal struct HistoryEffectValidity public bool rayTraced; } - internal Vector4[] frustumPlaneEquations; - internal int taaFrameIndex; - internal float taaSharpenStrength; - internal float taaHistorySharpening; - internal float taaAntiFlicker; - internal float taaMotionVectorRejection; - internal bool taaAntiRinging; - - internal Vector4 zBufferParams; - internal Vector4 unity_OrthoParams; - internal Vector4 projectionParams; - internal Vector4 screenParams; - internal int volumeLayerMask; - internal Transform volumeAnchor; - internal Rect finalViewport; // This will have the correct viewport position and the size will be full resolution (ie : not taking dynamic rez into account) - internal int colorPyramidHistoryMipCount = 0; - internal VBufferParameters[] vBufferParams; // Double-buffered; needed even if reprojection is off - internal RTHandle[] volumetricHistoryBuffers; // Double-buffered; only used for reprojection + internal Vector4[] frustumPlaneEquations; + internal int taaFrameIndex; + internal float taaSharpenStrength; + internal float taaHistorySharpening; + internal float taaAntiFlicker; + internal float taaMotionVectorRejection; + internal bool taaAntiRinging; + + internal Vector4 zBufferParams; + internal Vector4 unity_OrthoParams; + internal Vector4 projectionParams; + internal Vector4 screenParams; + internal int volumeLayerMask; + internal Transform volumeAnchor; + internal Rect finalViewport; // This will have the correct viewport position and the size will be full resolution (ie : not taking dynamic rez into account) + internal int colorPyramidHistoryMipCount = 0; + internal VBufferParameters[] vBufferParams; // Double-buffered; needed even if reprojection is off + internal RTHandle[] volumetricHistoryBuffers; // Double-buffered; only used for reprojection // Currently the frame count is not increase every render, for ray tracing shadow filtering. We need to have a number that increases every render - internal uint cameraFrameCount = 0; - internal bool animateMaterials; - internal float lastTime; + internal uint cameraFrameCount = 0; + internal bool animateMaterials; + internal float lastTime; - private Camera m_parentCamera = null; // Used for recursive rendering, e.g. a reflection in a scene view. - internal Camera parentCamera { get { return m_parentCamera; } } + private Camera m_parentCamera = null; // Used for recursive rendering, e.g. a reflection in a scene view. + internal Camera parentCamera { get { return m_parentCamera; } } //Setting a parent camera also tries to use the parent's camera exposure textures. //One example is planar reflection probe volume being pre exposed. @@ -258,14 +258,14 @@ internal void SetParentCamera(HDCamera parentHdCam) // This property is ray tracing specific. It allows us to track for the RayTracingShadow history which light was using which slot. // This avoid ghosting and many other problems that may happen due to an unwanted history usage - internal ShadowHistoryUsage[] shadowHistoryUsage = null; + internal ShadowHistoryUsage[] shadowHistoryUsage = null; // This property allows us to track for the various history accumulation based effects, the last registered validity frame ubdex of each effect as well as the resolution at which it was built. internal HistoryEffectValidity[] historyEffectUsage = null; - internal SkyUpdateContext m_LightingOverrideSky = new SkyUpdateContext(); + internal SkyUpdateContext m_LightingOverrideSky = new SkyUpdateContext(); /// Mark the HDCamera as persistant so it won't be destroyed if the camera is disabled - internal bool isPersistent = false; + internal bool isPersistent = false; // VisualSky is the sky used for rendering in the main view. // LightingSky is the sky used for lighting the scene (ambient probe and sky reflection) @@ -273,11 +273,11 @@ internal void SetParentCamera(HDCamera parentHdCam) // Ambient Probe: Only used if Ambient Mode is set to dynamic in the Visual Environment component. Updated according to the Update Mode parameter. // (Otherwise it uses the one from the static lighting sky) // Sky Reflection Probe : Always used and updated according to the Update Mode parameter. - internal SkyUpdateContext visualSky { get; private set; } = new SkyUpdateContext(); - internal SkyUpdateContext lightingSky { get; private set; } = null; + internal SkyUpdateContext visualSky { get; private set; } = new SkyUpdateContext(); + internal SkyUpdateContext lightingSky { get; private set; } = null; // We need to cache this here because it's need in SkyManager.SetupAmbientProbe // The issue is that this is called during culling which happens before Volume updates so we can't query it via volumes in there. - internal SkyAmbientMode skyAmbientMode { get; private set; } + internal SkyAmbientMode skyAmbientMode { get; private set; } // XR multipass and instanced views are supported (see XRSystem) internal XRPass xr { get; private set; } @@ -424,7 +424,7 @@ private void PumpReadbackQueue() if (requestState.isDeExposure) m_GpuDeExposureValue = exposureValue[0]; else - m_GpuExposureValue = exposureValue[0]; + m_GpuExposureValue = exposureValue[0]; } m_ExposureAsyncRequest.Dequeue(); } @@ -459,7 +459,7 @@ public void clear() private bool m_ExposureControlFS = false; internal bool exposureControlFS { get { return m_ExposureControlFS; } } - private ExposureTextures m_ExposureTextures = new ExposureTextures(){ useCurrentCamera = true, current = null, previous = null}; + private ExposureTextures m_ExposureTextures = new ExposureTextures() { useCurrentCamera = true, current = null, previous = null }; internal ExposureTextures currentExposureTextures { get { return m_ExposureTextures; } } internal void SetupExposureTextures() @@ -521,7 +521,7 @@ RTHandle Allocator(string id, int frameIndex, RTHandleSystem rtHandleSystem) internal LayerMask probeLayerMask => m_AdditionalCameraData != null ? m_AdditionalCameraData.probeLayerMask - : (LayerMask) ~0; + : (LayerMask)~0; internal float probeRangeCompressionFactor => m_AdditionalCameraData != null @@ -742,7 +742,7 @@ internal void Update(FrameSettings currentFrameSettings, HDRenderPipeline hdrp, } // Mark as init. - m_NumVolumetricBuffersAllocated = numVolumetricBuffersRequired; + m_NumVolumetricBuffersAllocated = numVolumetricBuffersRequired; } } @@ -959,7 +959,7 @@ unsafe internal void UpdateShaderVariablesGlobalCB(ref ShaderVariablesGlobal cb, cb._XRViewCount = (uint)viewCount; float exposureMultiplierForProbes = 1.0f / Mathf.Max(probeRangeCompressionFactor, 1e-6f); - cb._ProbeExposureScale = exposureMultiplierForProbes; + cb._ProbeExposureScale = exposureMultiplierForProbes; cb._DeExposureMultiplier = m_AdditionalCameraData == null ? 1.0f : m_AdditionalCameraData.deExposureMultiplier; @@ -1066,7 +1066,7 @@ internal void ExecuteCaptureActions(RenderGraph renderGraph, TextureHandle input // We need to blit to an intermediate texture because input resolution can be bigger than the camera resolution // Since recorder does not know about this, we need to send a texture of the right size. passData.tempTexture = builder.CreateTransientTexture(new TextureDesc(actualWidth, actualHeight) - { colorFormat = inputDesc.colorFormat, name = "TempCaptureActions" }); + { colorFormat = inputDesc.colorFormat, name = "TempCaptureActions" }); builder.SetRenderFunc( (ExecuteCaptureActionsPassData data, RenderGraphContext ctx) => @@ -1156,11 +1156,11 @@ public RTHandle Allocator(string id, int frameIndex, RTHandleSystem rtHandleSyst static Dictionary<(Camera, int), HDCamera> s_Cameras = new Dictionary<(Camera, int), HDCamera>(); static List<(Camera, int)> s_Cleanup = new List<(Camera, int)>(); // Recycled to reduce GC pressure - HDAdditionalCameraData m_AdditionalCameraData = null; // Init in Update - BufferedRTHandleSystem m_HistoryRTSystem = new BufferedRTHandleSystem(); - int m_NumVolumetricBuffersAllocated = 0; - float m_AmbientOcclusionResolutionScale = 0.0f; // Factor used to track if history should be reallocated for Ambient Occlusion - float m_ScreenSpaceAccumulationResolutionScale = 0.0f; // Use another scale if AO & SSR don't have the same resolution + HDAdditionalCameraData m_AdditionalCameraData = null; // Init in Update + BufferedRTHandleSystem m_HistoryRTSystem = new BufferedRTHandleSystem(); + int m_NumVolumetricBuffersAllocated = 0; + float m_AmbientOcclusionResolutionScale = 0.0f; // Factor used to track if history should be reallocated for Ambient Occlusion + float m_ScreenSpaceAccumulationResolutionScale = 0.0f; // Use another scale if AO & SSR don't have the same resolution Dictionary m_AOVHistoryRTSystem = new Dictionary(new AOVRequestDataComparer()); @@ -1175,9 +1175,9 @@ public ScreenSpaceReflectionAlgorithm // Recorder specific IEnumerator> m_RecorderCaptureActions; - int m_RecorderTempRT = Shader.PropertyToID("TempRecorder"); - MaterialPropertyBlock m_RecorderPropertyBlock = new MaterialPropertyBlock(); - Rect? m_OverridePixelRect = null; + int m_RecorderTempRT = Shader.PropertyToID("TempRecorder"); + MaterialPropertyBlock m_RecorderPropertyBlock = new MaterialPropertyBlock(); + Rect? m_OverridePixelRect = null; void SetupCurrentMaterialQuality(CommandBuffer cmd) { @@ -1397,10 +1397,10 @@ void UpdateFrustum(in ViewConstants viewConstants) // Analyze the projection matrix. // p[2][3] = (reverseZ ? 1 : -1) * (depth_0_1 ? 1 : 2) * (f * n) / (f - n) - float scale = projMatrix[2, 3] / (f * n) * (f - n); - bool depth_0_1 = Mathf.Abs(scale) < 1.5f; - bool reverseZ = scale > 0; - bool flipProj = invProjMatrix.MultiplyPoint(new Vector3(0, 1, 0)).y < 0; + float scale = projMatrix[2, 3] / (f * n) * (f - n); + bool depth_0_1 = Mathf.Abs(scale) < 1.5f; + bool reverseZ = scale > 0; + bool flipProj = invProjMatrix.MultiplyPoint(new Vector3(0, 1, 0)).y < 0; // http://www.humus.name/temp/Linearize%20depth.txt if (reverseZ) @@ -1415,7 +1415,7 @@ void UpdateFrustum(in ViewConstants viewConstants) projectionParams = new Vector4(flipProj ? -1 : 1, n, f, 1.0f / f); float orthoHeight = camera.orthographic ? 2 * camera.orthographicSize : 0; - float orthoWidth = orthoHeight * camera.aspect; + float orthoWidth = orthoHeight * camera.aspect; unity_OrthoParams = new Vector4(orthoWidth, orthoHeight, 0, camera.orthographic ? 1 : 0); Vector3 viewDir = -viewConstants.invViewMatrix.GetColumn(2); diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/GlobalPostProcessingQualitySettings.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/GlobalPostProcessingQualitySettings.cs index 39d3c7ed98e..d55c7d7110c 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/GlobalPostProcessingQualitySettings.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/GlobalPostProcessingQualitySettings.cs @@ -45,7 +45,7 @@ internal static int GetScalableSettingLevelParameterValue(int level, bool useOve get => value == LevelCount ? ((int)Level.Low, true) : (value, false); set { - var(level, useOverride) = value; + var (level, useOverride) = value; this.value = GetScalableSettingLevelParameterValue(level, useOverride); } } @@ -114,34 +114,34 @@ internal GlobalPostProcessingQualitySettings() /* Depth of field */ /// Depth of field near blur sample count for each quality level. - public int[] NearBlurSampleCount = new int[s_QualitySettingCount]; + public int[] NearBlurSampleCount = new int[s_QualitySettingCount]; /// Depth of field near blur maximum radius for each quality level. - public float[] NearBlurMaxRadius = new float[s_QualitySettingCount]; + public float[] NearBlurMaxRadius = new float[s_QualitySettingCount]; /// Depth of field far blur sample count for each quality level. - public int[] FarBlurSampleCount = new int[s_QualitySettingCount]; + public int[] FarBlurSampleCount = new int[s_QualitySettingCount]; /// Depth of field far blur maximum radius for each quality level. - public float[] FarBlurMaxRadius = new float[s_QualitySettingCount]; + public float[] FarBlurMaxRadius = new float[s_QualitySettingCount]; /// Depth of field resolution for each quality level. - public DepthOfFieldResolution[] DoFResolution = new DepthOfFieldResolution[s_QualitySettingCount]; + public DepthOfFieldResolution[] DoFResolution = new DepthOfFieldResolution[s_QualitySettingCount]; /// Use Depth of field high quality filtering for each quality level. - public bool[] DoFHighQualityFiltering = new bool[s_QualitySettingCount]; + public bool[] DoFHighQualityFiltering = new bool[s_QualitySettingCount]; /// Use Depth of field high physically based setting for each quality level. - public bool[] DoFPhysicallyBased = new bool[s_QualitySettingCount]; + public bool[] DoFPhysicallyBased = new bool[s_QualitySettingCount]; /* Motion Blur */ /// Motion Blur sample count for each quality level. - public int[] MotionBlurSampleCount = new int[s_QualitySettingCount]; + public int[] MotionBlurSampleCount = new int[s_QualitySettingCount]; /* Bloom */ /// Bloom resolution for each quality level. - public BloomResolution[] BloomRes = new BloomResolution[s_QualitySettingCount]; + public BloomResolution[] BloomRes = new BloomResolution[s_QualitySettingCount]; /// Bloom high quality filtering for each quality level. - public bool[] BloomHighQualityFiltering = new bool[s_QualitySettingCount]; + public bool[] BloomHighQualityFiltering = new bool[s_QualitySettingCount]; /// Bloom high quality prefiltering for each quality level. - public bool[] BloomHighQualityPrefiltering = new bool[s_QualitySettingCount]; + public bool[] BloomHighQualityPrefiltering = new bool[s_QualitySettingCount]; /* Chromatic Aberration */ /// Chromatic aberration maximum sample count for each quality level. - public int[] ChromaticAberrationMaxSamples = new int[s_QualitySettingCount]; + public int[] ChromaticAberrationMaxSamples = new int[s_QualitySettingCount]; } } diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.Debug.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.Debug.cs index bac071ab2f8..6a71356fedf 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.Debug.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.Debug.cs @@ -116,7 +116,7 @@ TextureHandle ResolveFullScreenDebug(RenderGraph renderGraph, in DebugParameters else passData.fullscreenBuffer = builder.CreateTransientComputeBuffer(new ComputeBufferDesc(4, sizeof(uint))); passData.output = builder.WriteTexture(renderGraph.CreateTexture(new TextureDesc(Vector2.one, true, true) - { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, name = "ResolveFullScreenDebug" })); + { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, name = "ResolveFullScreenDebug" })); builder.SetRenderFunc( (ResolveFullScreenDebugPassData data, RenderGraphContext ctx) => @@ -142,7 +142,7 @@ TextureHandle ResolveColorPickerDebug(RenderGraph renderGraph, in DebugParameter passData.debugParameters = debugParameters; passData.input = builder.ReadTexture(inputColorPickerDebug); passData.output = builder.WriteTexture(renderGraph.CreateTexture(new TextureDesc(Vector2.one, true, true) - { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, name = "ResolveColorPickerDebug" })); + { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, name = "ResolveColorPickerDebug" })); builder.SetRenderFunc( (ResolveColorPickerDebugPassData data, RenderGraphContext ctx) => @@ -304,14 +304,14 @@ void RenderDecalOverlay(RenderGraph renderGraph, in DebugParameters debugParamet } } - void RenderDebugOverlays(RenderGraph renderGraph, - in DebugParameters debugParameters, - TextureHandle colorBuffer, - TextureHandle depthBuffer, - TextureHandle depthPyramidTexture, - TextureHandle rayCountTexture, - in BuildGPULightListOutput lightLists, - in ShadowResult shadowResult) + void RenderDebugOverlays(RenderGraph renderGraph, + in DebugParameters debugParameters, + TextureHandle colorBuffer, + TextureHandle depthBuffer, + TextureHandle depthPyramidTexture, + TextureHandle rayCountTexture, + in BuildGPULightListOutput lightLists, + in ShadowResult shadowResult) { RenderSkyReflectionOverlay(renderGraph, debugParameters, colorBuffer, depthBuffer); RenderRayCountOverlay(renderGraph, debugParameters, colorBuffer, depthBuffer, rayCountTexture); @@ -323,16 +323,16 @@ void RenderDebugOverlays(RenderGraph renderGraph, class RenderLightVolumesPassData { - public DebugLightVolumes.RenderLightVolumesParameters parameters; + public DebugLightVolumes.RenderLightVolumesParameters parameters; // Render target that holds the light count in floating points - public TextureHandle lightCountBuffer; + public TextureHandle lightCountBuffer; // Render target that holds the color accumulated value - public TextureHandle colorAccumulationBuffer; + public TextureHandle colorAccumulationBuffer; // The output texture of the debug - public TextureHandle debugLightVolumesTexture; + public TextureHandle debugLightVolumesTexture; // Required depth texture given that we render multiple render targets - public TextureHandle depthBuffer; - public TextureHandle destination; + public TextureHandle depthBuffer; + public TextureHandle destination; } static void RenderLightVolumes(RenderGraph renderGraph, in DebugParameters debugParameters, TextureHandle destination, TextureHandle depthBuffer, CullingResults cullResults) @@ -341,11 +341,11 @@ static void RenderLightVolumes(RenderGraph renderGraph, in DebugParameters debug { passData.parameters = s_lightVolumes.PrepareLightVolumeParameters(debugParameters.hdCamera, debugParameters.debugDisplaySettings.data.lightingDebugSettings, cullResults); passData.lightCountBuffer = builder.CreateTransientTexture(new TextureDesc(Vector2.one, true, true) - { colorFormat = GraphicsFormat.R32_SFloat, clearBuffer = true, clearColor = Color.black, name = "LightVolumeCount" }); + { colorFormat = GraphicsFormat.R32_SFloat, clearBuffer = true, clearColor = Color.black, name = "LightVolumeCount" }); passData.colorAccumulationBuffer = builder.CreateTransientTexture(new TextureDesc(Vector2.one, true, true) - { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, clearBuffer = true, clearColor = Color.black, name = "LightVolumeColorAccumulation" }); + { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, clearBuffer = true, clearColor = Color.black, name = "LightVolumeColorAccumulation" }); passData.debugLightVolumesTexture = builder.CreateTransientTexture(new TextureDesc(Vector2.one, true, true) - { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, clearBuffer = true, clearColor = Color.black, enableRandomWrite = true, name = "LightVolumeDebugLightVolumesTexture" }); + { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, clearBuffer = true, clearColor = Color.black, enableRandomWrite = true, name = "LightVolumeDebugLightVolumesTexture" }); passData.depthBuffer = builder.UseDepthBuffer(depthBuffer, DepthAccess.ReadWrite); passData.destination = builder.WriteTexture(destination); @@ -414,7 +414,7 @@ TextureHandle RenderExposureDebug(RenderGraph renderGraph, HDCamera hdCamera, De passData.colorBuffer = builder.ReadTexture(colorBuffer); passData.debugFullScreenTexture = builder.ReadTexture(m_DebugFullScreenTexture); passData.output = builder.WriteTexture(renderGraph.CreateTexture(new TextureDesc(Vector2.one, true, true) - { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, name = "ExposureDebug" })); + { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, name = "ExposureDebug" })); passData.currentExposure = builder.ReadTexture(renderGraph.ImportTexture(m_PostProcessSystem.GetExposureTexture(hdCamera))); passData.previousExposure = builder.ReadTexture(renderGraph.ImportTexture(m_PostProcessSystem.GetPreviousExposureTexture(hdCamera))); passData.debugExposureData = builder.ReadTexture(renderGraph.ImportTexture(m_PostProcessSystem.GetExposureDebugData())); @@ -441,16 +441,16 @@ TextureHandle RenderExposureDebug(RenderGraph renderGraph, HDCamera hdCamera, De } } - TextureHandle RenderDebug(RenderGraph renderGraph, - HDCamera hdCamera, - TextureHandle colorBuffer, - TextureHandle depthBuffer, - TextureHandle depthPyramidTexture, - TextureHandle colorPickerDebugTexture, - TextureHandle rayCountTexture, - in BuildGPULightListOutput lightLists, - in ShadowResult shadowResult, - CullingResults cullResults) + TextureHandle RenderDebug(RenderGraph renderGraph, + HDCamera hdCamera, + TextureHandle colorBuffer, + TextureHandle depthBuffer, + TextureHandle depthPyramidTexture, + TextureHandle colorPickerDebugTexture, + TextureHandle rayCountTexture, + in BuildGPULightListOutput lightLists, + in ShadowResult shadowResult, + CullingResults cullResults) { // We don't want any overlay for these kind of rendering if (hdCamera.camera.cameraType == CameraType.Reflection || hdCamera.camera.cameraType == CameraType.Preview) @@ -597,9 +597,9 @@ TextureHandle RenderDebugViewMaterial(RenderGraph renderGraph, CullingResults cu class PushFullScreenDebugPassData { - public TextureHandle input; - public TextureHandle output; - public int mipIndex; + public TextureHandle input; + public TextureHandle output; + public int mipIndex; } void PushFullScreenLightingDebugTexture(RenderGraph renderGraph, TextureHandle input) @@ -637,7 +637,7 @@ void PushFullScreenDebugTexture(RenderGraph renderGraph, TextureHandle input, in passData.mipIndex = mipIndex; passData.input = builder.ReadTexture(input); passData.output = builder.UseColorBuffer(renderGraph.CreateTexture(new TextureDesc(Vector2.one, true, true) - { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, name = "DebugFullScreen" }), 0); + { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, name = "DebugFullScreen" }), 0); builder.SetRenderFunc( (PushFullScreenDebugPassData data, RenderGraphContext ctx) => @@ -707,7 +707,7 @@ TextureHandle PushColorPickerDebugTexture(RenderGraph renderGraph, TextureHandle { passData.input = builder.ReadTexture(input); passData.output = builder.UseColorBuffer(renderGraph.CreateTexture(new TextureDesc(Vector2.one, true, true) - { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, name = "DebugColorPicker" }), 0); + { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, name = "DebugColorPicker" }), 0); builder.SetRenderFunc( (PushFullScreenDebugPassData data, RenderGraphContext ctx) => diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.LightLoop.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.LightLoop.cs index e11be2585eb..ac3400bae09 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.LightLoop.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.LightLoop.cs @@ -12,14 +12,14 @@ struct LightingBuffers { // TODO RENDERGRAPH: Those two buffers aren't really lighting buffers but only used for SSS // We should probably move them out of here. - public TextureHandle sssBuffer; - public TextureHandle diffuseLightingBuffer; - - public TextureHandle ambientOcclusionBuffer; - public TextureHandle ssrLightingBuffer; - public TextureHandle ssgiLightingBuffer; - public TextureHandle contactShadowsBuffer; - public TextureHandle screenspaceShadowBuffer; + public TextureHandle sssBuffer; + public TextureHandle diffuseLightingBuffer; + + public TextureHandle ambientOcclusionBuffer; + public TextureHandle ssrLightingBuffer; + public TextureHandle ssgiLightingBuffer; + public TextureHandle contactShadowsBuffer; + public TextureHandle screenspaceShadowBuffer; } static LightingBuffers ReadLightingBuffers(in LightingBuffers buffers, RenderGraphBuilder builder) @@ -46,21 +46,21 @@ static void BindGlobalLightingBuffers(in LightingBuffers buffers, CommandBuffer class BuildGPULightListPassData { - public BuildGPULightListParameters buildGPULightListParameters; - public TextureHandle depthBuffer; - public TextureHandle stencilTexture; - public TextureHandle[] gBuffer = new TextureHandle[RenderGraph.kMaxMRTCount]; - public int gBufferCount; + public BuildGPULightListParameters buildGPULightListParameters; + public TextureHandle depthBuffer; + public TextureHandle stencilTexture; + public TextureHandle[] gBuffer = new TextureHandle[RenderGraph.kMaxMRTCount]; + public int gBufferCount; // Buffers filled with the CPU outside of render graph. - public ComputeBufferHandle convexBoundsBuffer; - public ComputeBufferHandle AABBBoundsBuffer; + public ComputeBufferHandle convexBoundsBuffer; + public ComputeBufferHandle AABBBoundsBuffer; // Transient buffers that are not used outside of BuildGPULight list so they don't need to go outside the pass. - public ComputeBufferHandle globalLightListAtomic; - public ComputeBufferHandle lightVolumeDataBuffer; + public ComputeBufferHandle globalLightListAtomic; + public ComputeBufferHandle lightVolumeDataBuffer; - public BuildGPULightListOutput output = new BuildGPULightListOutput(); + public BuildGPULightListOutput output = new BuildGPULightListOutput(); } struct BuildGPULightListOutput @@ -122,14 +122,14 @@ static BuildGPULightListResources PrepareBuildGPULightListResources(RenderGraphC return buildLightListResources; } - BuildGPULightListOutput BuildGPULightList(RenderGraph renderGraph, - HDCamera hdCamera, - TileAndClusterData tileAndClusterData, - int totalLightCount, - ref ShaderVariablesLightList constantBuffer, - TextureHandle depthStencilBuffer, - TextureHandle stencilBufferCopy, - GBufferOutput gBuffer) + BuildGPULightListOutput BuildGPULightList(RenderGraph renderGraph, + HDCamera hdCamera, + TileAndClusterData tileAndClusterData, + int totalLightCount, + ref ShaderVariablesLightList constantBuffer, + TextureHandle depthStencilBuffer, + TextureHandle stencilBufferCopy, + GBufferOutput gBuffer) { using (var builder = renderGraph.AddRenderPass("Build Light List", out var passData, ProfilingSampler.Get(HDProfileId.BuildLightList))) { @@ -152,7 +152,7 @@ BuildGPULightListOutput BuildGPULightList(RenderGraph render passData.convexBoundsBuffer = builder.ReadComputeBuffer(renderGraph.ImportComputeBuffer(tileAndClusterData.convexBoundsBuffer)); passData.lightVolumeDataBuffer = builder.ReadComputeBuffer(renderGraph.ImportComputeBuffer(tileAndClusterData.lightVolumeDataBuffer)); - passData.globalLightListAtomic = builder.CreateTransientComputeBuffer(new ComputeBufferDesc(1, sizeof(uint)) { name = "LightListAtomic"}); + passData.globalLightListAtomic = builder.CreateTransientComputeBuffer(new ComputeBufferDesc(1, sizeof(uint)) { name = "LightListAtomic" }); passData.AABBBoundsBuffer = builder.CreateTransientComputeBuffer(new ComputeBufferDesc(m_MaxViewCount * 2 * tileAndClusterData.maxLightCount, 4 * sizeof(float)) { name = "AABBBoundBuffer" }); var nrTilesX = (m_MaxCameraWidth + LightDefinitions.s_TileSizeFptl - 1) / LightDefinitions.s_TileSizeFptl; @@ -226,9 +226,9 @@ BuildGPULightListOutput BuildGPULightList(RenderGraph render class PushGlobalCameraParamPassData { - public HDCamera hdCamera; - public ShaderVariablesGlobal globalCB; - public ShaderVariablesXR xrCB; + public HDCamera hdCamera; + public ShaderVariablesGlobal globalCB; + public ShaderVariablesXR xrCB; } void PushGlobalCameraParams(RenderGraph renderGraph, HDCamera hdCamera) @@ -262,31 +262,36 @@ TextureHandle CreateDiffuseLightingBuffer(RenderGraph renderGraph, bool msaa) { return renderGraph.CreateTexture(new TextureDesc(Vector2.one, true, true) { - colorFormat = GraphicsFormat.B10G11R11_UFloatPack32, enableRandomWrite = !msaa, - bindTextureMS = msaa, enableMSAA = msaa, clearBuffer = true, clearColor = Color.clear, name = msaa ? "CameraSSSDiffuseLightingMSAA" : "CameraSSSDiffuseLighting" + colorFormat = GraphicsFormat.B10G11R11_UFloatPack32, + enableRandomWrite = !msaa, + bindTextureMS = msaa, + enableMSAA = msaa, + clearBuffer = true, + clearColor = Color.clear, + name = msaa ? "CameraSSSDiffuseLightingMSAA" : "CameraSSSDiffuseLighting" }); } class DeferredLightingPassData { - public DeferredLightingParameters parameters; + public DeferredLightingParameters parameters; - public TextureHandle colorBuffer; - public TextureHandle sssDiffuseLightingBuffer; - public TextureHandle depthBuffer; - public TextureHandle depthTexture; + public TextureHandle colorBuffer; + public TextureHandle sssDiffuseLightingBuffer; + public TextureHandle depthBuffer; + public TextureHandle depthTexture; - public int gbufferCount; - public int lightLayersTextureIndex; - public int shadowMaskTextureIndex; - public TextureHandle[] gbuffer = new TextureHandle[8]; + public int gbufferCount; + public int lightLayersTextureIndex; + public int shadowMaskTextureIndex; + public TextureHandle[] gbuffer = new TextureHandle[8]; - public ComputeBufferHandle lightListBuffer; - public ComputeBufferHandle tileFeatureFlagsBuffer; - public ComputeBufferHandle tileListBuffer; - public ComputeBufferHandle dispatchIndirectBuffer; + public ComputeBufferHandle lightListBuffer; + public ComputeBufferHandle tileFeatureFlagsBuffer; + public ComputeBufferHandle tileListBuffer; + public ComputeBufferHandle dispatchIndirectBuffer; - public LightingBuffers lightingBuffers; + public LightingBuffers lightingBuffers; } struct LightingOutput @@ -294,15 +299,15 @@ struct LightingOutput public TextureHandle colorBuffer; } - LightingOutput RenderDeferredLighting(RenderGraph renderGraph, - HDCamera hdCamera, - TextureHandle colorBuffer, - TextureHandle depthStencilBuffer, - TextureHandle depthPyramidTexture, - in LightingBuffers lightingBuffers, - in GBufferOutput gbuffer, - in ShadowResult shadowResult, - in BuildGPULightListOutput lightLists) + LightingOutput RenderDeferredLighting(RenderGraph renderGraph, + HDCamera hdCamera, + TextureHandle colorBuffer, + TextureHandle depthStencilBuffer, + TextureHandle depthPyramidTexture, + in LightingBuffers lightingBuffers, + in GBufferOutput gbuffer, + in ShadowResult shadowResult, + in BuildGPULightListOutput lightLists) { if (hdCamera.frameSettings.litShaderMode != LitShaderMode.Deferred || !hdCamera.frameSettings.IsEnabled(FrameSettingsField.OpaqueObjects)) @@ -420,13 +425,13 @@ class RenderSSRPassData //public TextureHandle debugTexture; } - TextureHandle RenderSSR(RenderGraph renderGraph, - HDCamera hdCamera, - ref PrepassOutput prepassOutput, - TextureHandle clearCoatMask, - TextureHandle rayCountTexture, - Texture skyTexture, - bool transparent) + TextureHandle RenderSSR(RenderGraph renderGraph, + HDCamera hdCamera, + ref PrepassOutput prepassOutput, + TextureHandle clearCoatMask, + TextureHandle rayCountTexture, + Texture skyTexture, + bool transparent) { if (!hdCamera.IsSSREnabled(transparent)) return renderGraph.defaultResources.blackTextureXR; @@ -480,21 +485,21 @@ TextureHandle RenderSSR(RenderGraph renderGraph, // In practice, these textures are sparse (mostly black). Therefore, clearing them is fast (due to CMASK), // and much faster than fully overwriting them from within SSR shaders. passData.hitPointsTexture = builder.CreateTransientTexture(new TextureDesc(Vector2.one, true, true) - { colorFormat = GraphicsFormat.R16G16_UNorm, clearBuffer = true, clearColor = Color.clear, enableRandomWrite = true, name = transparent ? "SSR_Hit_Point_Texture_Trans" : "SSR_Hit_Point_Texture" }); + { colorFormat = GraphicsFormat.R16G16_UNorm, clearBuffer = true, clearColor = Color.clear, enableRandomWrite = true, name = transparent ? "SSR_Hit_Point_Texture_Trans" : "SSR_Hit_Point_Texture" }); if (usePBRAlgo) { TextureHandle ssrAccum = renderGraph.ImportTexture(hdCamera.GetCurrentFrameRT((int)HDCameraFrameHistoryType.ScreenSpaceReflectionAccumulation)); - TextureHandle ssrAccumPrev = renderGraph.ImportTexture(hdCamera.GetPreviousFrameRT((int)HDCameraFrameHistoryType.ScreenSpaceReflectionAccumulation));; + TextureHandle ssrAccumPrev = renderGraph.ImportTexture(hdCamera.GetPreviousFrameRT((int)HDCameraFrameHistoryType.ScreenSpaceReflectionAccumulation)); ; passData.ssrAccum = builder.WriteTexture(ssrAccum); passData.ssrAccumPrev = builder.WriteTexture(ssrAccumPrev); passData.lightingTexture = builder.CreateTransientTexture(new TextureDesc(Vector2.one, true, true) - { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, clearBuffer = true, clearColor = Color.clear, enableRandomWrite = true, name = "SSR_Lighting_Texture" }); + { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, clearBuffer = true, clearColor = Color.clear, enableRandomWrite = true, name = "SSR_Lighting_Texture" }); } else { passData.lightingTexture = builder.WriteTexture(renderGraph.CreateTexture(new TextureDesc(Vector2.one, true, true) - { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, clearBuffer = true, clearColor = Color.clear, enableRandomWrite = true, name = "SSR_Lighting_Texture" })); + { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, clearBuffer = true, clearColor = Color.clear, enableRandomWrite = true, name = "SSR_Lighting_Texture" })); } builder.SetRenderFunc( @@ -545,11 +550,11 @@ TextureHandle RenderSSR(RenderGraph renderGraph, class RenderContactShadowPassData { - public ContactShadowsParameters parameters; - public LightLoopLightData lightLoopLightData; - public TextureHandle depthTexture; - public TextureHandle contactShadowsTexture; - public ComputeBufferHandle lightList; + public ContactShadowsParameters parameters; + public LightLoopLightData lightLoopLightData; + public TextureHandle depthTexture; + public TextureHandle contactShadowsTexture; + public ComputeBufferHandle lightList; } TextureHandle RenderContactShadows(RenderGraph renderGraph, HDCamera hdCamera, TextureHandle depthTexture, in BuildGPULightListOutput lightLists, int firstMipOffsetY) @@ -570,7 +575,7 @@ TextureHandle RenderContactShadows(RenderGraph renderGraph, HDCamera hdCamera, T passData.lightList = builder.ReadComputeBuffer(lightLists.lightList); passData.depthTexture = builder.ReadTexture(depthTexture); passData.contactShadowsTexture = builder.WriteTexture(renderGraph.CreateTexture(new TextureDesc(Vector2.one, true, true) - { colorFormat = GraphicsFormat.R32_UInt, enableRandomWrite = true, clearBuffer = clearBuffer, clearColor = Color.clear, name = "ContactShadowsBuffer" })); + { colorFormat = GraphicsFormat.R32_UInt, enableRandomWrite = true, clearBuffer = clearBuffer, clearColor = Color.clear, name = "ContactShadowsBuffer" })); result = passData.contactShadowsTexture; @@ -588,16 +593,16 @@ TextureHandle RenderContactShadows(RenderGraph renderGraph, HDCamera hdCamera, T class VolumeVoxelizationPassData { public VolumeVoxelizationParameters parameters; - public TextureHandle densityBuffer; - public ComputeBufferHandle bigTileLightListBuffer; - public ComputeBuffer visibleVolumeBoundsBuffer; - public ComputeBuffer visibleVolumeDataBuffer; + public TextureHandle densityBuffer; + public ComputeBufferHandle bigTileLightListBuffer; + public ComputeBuffer visibleVolumeBoundsBuffer; + public ComputeBuffer visibleVolumeDataBuffer; } - TextureHandle VolumeVoxelizationPass(RenderGraph renderGraph, - HDCamera hdCamera, - ComputeBuffer visibleVolumeBoundsBuffer, - ComputeBuffer visibleVolumeDataBuffer, + TextureHandle VolumeVoxelizationPass(RenderGraph renderGraph, + HDCamera hdCamera, + ComputeBuffer visibleVolumeBoundsBuffer, + ComputeBuffer visibleVolumeDataBuffer, ComputeBufferHandle bigTileLightList) { if (Fog.IsVolumetricFogEnabled(hdCamera)) @@ -637,10 +642,10 @@ TextureHandle VolumeVoxelizationPass(RenderGraph renderGraph, class GenerateMaxZMaskPassData { public GenerateMaxZParameters parameters; - public TextureHandle depthTexture; - public TextureHandle maxZ8xBuffer; - public TextureHandle maxZBuffer; - public TextureHandle dilatedMaxZBuffer; + public TextureHandle depthTexture; + public TextureHandle maxZ8xBuffer; + public TextureHandle maxZBuffer; + public TextureHandle dilatedMaxZBuffer; } TextureHandle GenerateMaxZPass(RenderGraph renderGraph, HDCamera hdCamera, TextureHandle depthTexture, HDUtils.PackedMipChainInfo depthMipInfo) @@ -679,13 +684,13 @@ TextureHandle GenerateMaxZPass(RenderGraph renderGraph, HDCamera hdCamera, Textu class VolumetricLightingPassData { public VolumetricLightingParameters parameters; - public TextureHandle densityBuffer; - public TextureHandle depthTexture; - public TextureHandle lightingBuffer; - public TextureHandle maxZBuffer; - public TextureHandle historyBuffer; - public TextureHandle feedbackBuffer; - public ComputeBufferHandle bigTileLightListBuffer; + public TextureHandle densityBuffer; + public TextureHandle depthTexture; + public TextureHandle lightingBuffer; + public TextureHandle maxZBuffer; + public TextureHandle historyBuffer; + public TextureHandle feedbackBuffer; + public ComputeBufferHandle bigTileLightListBuffer; } TextureHandle VolumetricLightingPass(RenderGraph renderGraph, HDCamera hdCamera, TextureHandle depthTexture, TextureHandle densityBuffer, TextureHandle maxZBuffer, ComputeBufferHandle bigTileLightListBuffer, ShadowResult shadowResult) @@ -720,7 +725,7 @@ TextureHandle VolumetricLightingPass(RenderGraph renderGraph, HDCamera hdCamera, var prevIdx = (frameIndex + 1) & 1; passData.feedbackBuffer = builder.WriteTexture(renderGraph.ImportTexture(hdCamera.volumetricHistoryBuffers[currIdx])); - passData.historyBuffer = builder.ReadTexture(renderGraph.ImportTexture(hdCamera.volumetricHistoryBuffers[prevIdx])); + passData.historyBuffer = builder.ReadTexture(renderGraph.ImportTexture(hdCamera.volumetricHistoryBuffers[prevIdx])); } HDShadowManager.ReadShadowResult(shadowResult, builder); @@ -733,7 +738,7 @@ TextureHandle VolumetricLightingPass(RenderGraph renderGraph, HDCamera hdCamera, data.densityBuffer, data.lightingBuffer, data.maxZBuffer, - data.parameters.enableReprojection ? data.historyBuffer : (RTHandle)null, + data.parameters.enableReprojection ? data.historyBuffer : (RTHandle)null, data.parameters.enableReprojection ? data.feedbackBuffer : (RTHandle)null, data.bigTileLightListBuffer, ctx.cmd); diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs index 6ff1663353c..7364992ee50 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs @@ -7,19 +7,19 @@ public partial class HDRenderPipeline { class AfterPostProcessPassData { - public PostProcessParameters parameters; - public TextureHandle afterPostProcessBuffer; - public TextureHandle depthStencilBuffer; - public RendererListHandle opaqueAfterPostprocessRL; - public RendererListHandle transparentAfterPostprocessRL; + public PostProcessParameters parameters; + public TextureHandle afterPostProcessBuffer; + public TextureHandle depthStencilBuffer; + public RendererListHandle opaqueAfterPostprocessRL; + public RendererListHandle transparentAfterPostprocessRL; } - TextureHandle RenderPostProcess(RenderGraph renderGraph, - PrepassOutput prepassOutput, - TextureHandle inputColor, - TextureHandle backBuffer, - CullingResults cullResults, - HDCamera hdCamera) + TextureHandle RenderPostProcess(RenderGraph renderGraph, + PrepassOutput prepassOutput, + TextureHandle inputColor, + TextureHandle backBuffer, + CullingResults cullResults, + HDCamera hdCamera) { PostProcessParameters parameters = PreparePostProcess(cullResults, hdCamera); diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.Prepass.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.Prepass.cs index e89d4f6c819..a89dc59a744 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.Prepass.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.Prepass.cs @@ -58,33 +58,33 @@ struct PrepassOutput { // Buffers that may be output by the prepass. // They will be MSAA depending on the frame settings - public TextureHandle depthBuffer; - public TextureHandle depthAsColor; - public TextureHandle normalBuffer; - public TextureHandle motionVectorsBuffer; + public TextureHandle depthBuffer; + public TextureHandle depthAsColor; + public TextureHandle normalBuffer; + public TextureHandle motionVectorsBuffer; // GBuffer output. Will also contain a reference to the normal buffer (as it is shared between deferred and forward objects) - public GBufferOutput gbuffer; + public GBufferOutput gbuffer; - public DBufferOutput dbuffer; + public DBufferOutput dbuffer; // Additional buffers only for MSAA - public TextureHandle depthValuesMSAA; + public TextureHandle depthValuesMSAA; // Resolved buffers for MSAA. When MSAA is off, they will be the same reference as the buffers above. - public TextureHandle resolvedDepthBuffer; - public TextureHandle resolvedNormalBuffer; - public TextureHandle resolvedMotionVectorsBuffer; + public TextureHandle resolvedDepthBuffer; + public TextureHandle resolvedNormalBuffer; + public TextureHandle resolvedMotionVectorsBuffer; // Copy of the resolved depth buffer with mip chain - public TextureHandle depthPyramidTexture; + public TextureHandle depthPyramidTexture; // Depth buffer used for low res transparents. - public TextureHandle downsampledDepthBuffer; + public TextureHandle downsampledDepthBuffer; - public TextureHandle stencilBuffer; - public ComputeBufferHandle coarseStencilBuffer; + public TextureHandle stencilBuffer; + public ComputeBufferHandle coarseStencilBuffer; - public TextureHandle flagMaskBuffer; + public TextureHandle flagMaskBuffer; } TextureHandle CreateDepthBuffer(RenderGraph renderGraph, bool clear, bool msaa) @@ -98,7 +98,11 @@ TextureHandle CreateDepthBuffer(RenderGraph renderGraph, bool clear, bool msaa) TextureDesc depthDesc = new TextureDesc(Vector2.one, true, true) { - depthBufferBits = DepthBits.Depth32, bindTextureMS = msaa, enableMSAA = msaa, clearBuffer = clear, name = msaa ? "CameraDepthStencilMSAA" : "CameraDepthStencil" + depthBufferBits = DepthBits.Depth32, + bindTextureMS = msaa, + enableMSAA = msaa, + clearBuffer = clear, + name = msaa ? "CameraDepthStencilMSAA" : "CameraDepthStencil" #if UNITY_2020_2_OR_NEWER , fastMemoryDesc = fastMemDesc #endif @@ -118,11 +122,18 @@ TextureHandle CreateNormalBuffer(RenderGraph renderGraph, HDCamera hdCamera, boo TextureDesc normalDesc = new TextureDesc(Vector2.one, true, true) { - colorFormat = GraphicsFormat.R8G8B8A8_UNorm, clearBuffer = NeedClearGBuffer(hdCamera), clearColor = Color.black, bindTextureMS = msaa, enableMSAA = msaa, enableRandomWrite = !msaa, name = msaa ? "NormalBufferMSAA" : "NormalBuffer" + colorFormat = GraphicsFormat.R8G8B8A8_UNorm, + clearBuffer = NeedClearGBuffer(hdCamera), + clearColor = Color.black, + bindTextureMS = msaa, + enableMSAA = msaa, + enableRandomWrite = !msaa, + name = msaa ? "NormalBufferMSAA" : "NormalBuffer" #if UNITY_2020_2_OR_NEWER , fastMemoryDesc = fastMemDesc #endif - , fallBackToBlackTexture = true + , + fallBackToBlackTexture = true }; return renderGraph.CreateTexture(normalDesc); } @@ -173,15 +184,15 @@ void BindMotionVectorPassColorBuffers(in RenderGraphBuilder builder, in PrepassO } } - PrepassOutput RenderPrepass(RenderGraph renderGraph, - TextureHandle colorBuffer, - TextureHandle sssBuffer, - TextureHandle vtFeedbackBuffer, - CullingResults cullingResults, - CullingResults customPassCullingResults, - HDCamera hdCamera, - AOVRequestData aovRequest, - List aovBuffers) + PrepassOutput RenderPrepass(RenderGraph renderGraph, + TextureHandle colorBuffer, + TextureHandle sssBuffer, + TextureHandle vtFeedbackBuffer, + CullingResults cullingResults, + CullingResults customPassCullingResults, + HDCamera hdCamera, + AOVRequestData aovRequest, + List aovBuffers) { m_IsDepthBufferCopyValid = false; @@ -285,17 +296,17 @@ PrepassOutput RenderPrepass(RenderGraph renderGraph, class DepthPrepassData { - public FrameSettings frameSettings; - public bool msaaEnabled; - public bool decalLayersEnabled; - public bool hasDepthDeferredPass; - public TextureHandle depthBuffer; - public TextureHandle depthAsColorBuffer; - public TextureHandle normalBuffer; - public TextureHandle decalBuffer; - - public RendererListHandle rendererListDepthForward; - public RendererListHandle rendererListDepthDeferred; + public FrameSettings frameSettings; + public bool msaaEnabled; + public bool decalLayersEnabled; + public bool hasDepthDeferredPass; + public TextureHandle depthBuffer; + public TextureHandle depthAsColorBuffer; + public TextureHandle normalBuffer; + public TextureHandle decalBuffer; + + public RendererListHandle rendererListDepthForward; + public RendererListHandle rendererListDepthDeferred; } // RenderDepthPrepass render both opaque and opaque alpha tested based on engine configuration. @@ -314,7 +325,7 @@ bool RenderDepthPrepass(RenderGraph renderGraph, CullingResults cull, HDCamera h { decalBuffer = renderGraph.defaultResources.blackTextureXR; output.depthAsColor = renderGraph.CreateTexture(new TextureDesc(Vector2.one, true, true) - { colorFormat = GraphicsFormat.R32_SFloat, clearBuffer = true, clearColor = Color.black, bindTextureMS = true, enableMSAA = true, name = "DepthAsColorMSAA" }); + { colorFormat = GraphicsFormat.R32_SFloat, clearBuffer = true, clearColor = Color.black, bindTextureMS = true, enableMSAA = true, name = "DepthAsColorMSAA" }); output.normalBuffer = CreateNormalBuffer(renderGraph, hdCamera, msaa); return false; } @@ -335,7 +346,7 @@ bool RenderDepthPrepass(RenderGraph renderGraph, CullingResults cull, HDCamera h if (msaa) { passData.depthAsColorBuffer = builder.WriteTexture(renderGraph.CreateTexture(new TextureDesc(Vector2.one, true, true) - { colorFormat = GraphicsFormat.R32_SFloat, clearBuffer = true, clearColor = Color.black, bindTextureMS = true, enableMSAA = true, name = "DepthAsColorMSAA" })); + { colorFormat = GraphicsFormat.R32_SFloat, clearBuffer = true, clearColor = Color.black, bindTextureMS = true, enableMSAA = true, name = "DepthAsColorMSAA" })); } if (passData.hasDepthDeferredPass) @@ -394,9 +405,9 @@ bool RenderDepthPrepass(RenderGraph renderGraph, CullingResults cull, HDCamera h class ObjectMotionVectorsPassData { - public FrameSettings frameSettings; - public TextureHandle depthBuffer; - public RendererListHandle rendererList; + public FrameSettings frameSettings; + public TextureHandle depthBuffer; + public RendererListHandle rendererList; } void RenderObjectsMotionVectors(RenderGraph renderGraph, CullingResults cull, HDCamera hdCamera, TextureHandle decalBuffer, in PrepassOutput output) @@ -458,11 +469,11 @@ void RenderObjectsMotionVectors(RenderGraph renderGraph, CullingResults cull, HD class GBufferPassData { - public FrameSettings frameSettings; - public RendererListHandle rendererList; - public TextureHandle[] gbufferRT = new TextureHandle[RenderGraph.kMaxMRTCount]; - public TextureHandle depthBuffer; - public DBufferOutput dBuffer; + public FrameSettings frameSettings; + public RendererListHandle rendererList; + public TextureHandle[] gbufferRT = new TextureHandle[RenderGraph.kMaxMRTCount]; + public TextureHandle depthBuffer; + public DBufferOutput dBuffer; } struct GBufferOutput @@ -494,15 +505,23 @@ void SetupGBufferTargets(RenderGraph renderGraph, HDCamera hdCamera, GBufferPass // If we are in deferred mode and the SSR is enabled, we need to make sure that the second gbuffer is cleared given that we are using that information for clear coat selection bool clearGBuffer2 = clearGBuffer || hdCamera.IsSSREnabled(); passData.gbufferRT[currentIndex++] = builder.UseColorBuffer(renderGraph.CreateTexture( - new TextureDesc(Vector2.one, true, true) { - colorFormat = GraphicsFormat.R8G8B8A8_UNorm, clearBuffer = clearGBuffer2, clearColor = Color.clear, name = "GBuffer2" + new TextureDesc(Vector2.one, true, true) + { + colorFormat = GraphicsFormat.R8G8B8A8_UNorm, + clearBuffer = clearGBuffer2, + clearColor = Color.clear, + name = "GBuffer2" #if UNITY_2020_2_OR_NEWER , fastMemoryDesc = gbufferFastMemDesc #endif }), 2); passData.gbufferRT[currentIndex++] = builder.UseColorBuffer(renderGraph.CreateTexture( - new TextureDesc(Vector2.one, true, true) { - colorFormat = Builtin.GetLightingBufferFormat(), clearBuffer = clearGBuffer, clearColor = Color.clear, name = "GBuffer3" + new TextureDesc(Vector2.one, true, true) + { + colorFormat = Builtin.GetLightingBufferFormat(), + clearBuffer = clearGBuffer, + clearColor = Color.clear, + name = "GBuffer3" #if UNITY_2020_2_OR_NEWER , fastMemoryDesc = gbufferFastMemDesc #endif @@ -584,16 +603,16 @@ void RenderGBuffer(RenderGraph renderGraph, TextureHandle sssBuffer, TextureHand class ResolvePrepassData { - public TextureHandle depthBuffer; - public TextureHandle depthValuesBuffer; - public TextureHandle normalBuffer; - public TextureHandle motionVectorsBuffer; - public TextureHandle depthAsColorBufferMSAA; - public TextureHandle normalBufferMSAA; - public TextureHandle motionVectorBufferMSAA; - public Material depthResolveMaterial; - public int depthResolvePassIndex; - public bool needMotionVectors; + public TextureHandle depthBuffer; + public TextureHandle depthValuesBuffer; + public TextureHandle normalBuffer; + public TextureHandle motionVectorsBuffer; + public TextureHandle depthAsColorBufferMSAA; + public TextureHandle normalBufferMSAA; + public TextureHandle motionVectorBufferMSAA; + public Material depthResolveMaterial; + public int depthResolvePassIndex; + public bool needMotionVectors; } void ResolvePrepassBuffers(RenderGraph renderGraph, HDCamera hdCamera, ref PrepassOutput output) @@ -655,11 +674,11 @@ void ResolvePrepassBuffers(RenderGraph renderGraph, HDCamera hdCamera, ref Prepa class CopyDepthPassData { - public TextureHandle inputDepth; - public TextureHandle outputDepth; - public GPUCopy GPUCopy; - public int width; - public int height; + public TextureHandle inputDepth; + public TextureHandle outputDepth; + public GPUCopy GPUCopy; + public int width; + public int height; } void CopyDepthBufferIfNeeded(RenderGraph renderGraph, HDCamera hdCamera, ref PrepassOutput output) @@ -740,19 +759,19 @@ void BuildCoarseStencilAndResolveIfNeeded(RenderGraph renderGraph, HDCamera hdCa class RenderDBufferPassData { - public RenderDBufferParameters parameters; - public TextureHandle[] mrt = new TextureHandle[Decal.GetMaterialDBufferCount()]; - public int dBufferCount; - public RendererListHandle meshDecalsRendererList; - public TextureHandle depthStencilBuffer; - public TextureHandle depthTexture; - public TextureHandle decalBuffer; + public RenderDBufferParameters parameters; + public TextureHandle[] mrt = new TextureHandle[Decal.GetMaterialDBufferCount()]; + public int dBufferCount; + public RendererListHandle meshDecalsRendererList; + public TextureHandle depthStencilBuffer; + public TextureHandle depthTexture; + public TextureHandle decalBuffer; } struct DBufferOutput { - public TextureHandle[] mrt; - public int dBufferCount; + public TextureHandle[] mrt; + public int dBufferCount; } class DBufferNormalPatchData @@ -965,11 +984,11 @@ void DownsampleDepthForLowResTransparency(RenderGraph renderGraph, HDCamera hdCa class GenerateDepthPyramidPassData { - public TextureHandle depthTexture; - public HDUtils.PackedMipChainInfo mipInfo; - public MipGenerator mipGenerator; + public TextureHandle depthTexture; + public HDUtils.PackedMipChainInfo mipInfo; + public MipGenerator mipGenerator; - public bool mip0AlreadyComputed; + public bool mip0AlreadyComputed; } void GenerateDepthPyramid(RenderGraph renderGraph, HDCamera hdCamera, bool mip0AlreadyComputed, ref PrepassOutput output) diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.RenderGraph.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.RenderGraph.cs index 6dd5ce5206c..956fc66cfb8 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.RenderGraph.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.RenderGraph.cs @@ -7,17 +7,17 @@ namespace UnityEngine.Rendering.HighDefinition { public partial class HDRenderPipeline { - class TempPassData {}; + class TempPassData { }; // Needed only because of custom pass. See comment at ResolveMSAAColor. TextureHandle m_NonMSAAColorBuffer; - void ExecuteWithRenderGraph(RenderRequest renderRequest, - AOVRequestData aovRequest, - List aovBuffers, - List aovCustomPassBuffers, + void ExecuteWithRenderGraph(RenderRequest renderRequest, + AOVRequestData aovRequest, + List aovBuffers, + List aovCustomPassBuffers, ScriptableRenderContext renderContext, - CommandBuffer commandBuffer) + CommandBuffer commandBuffer) { var hdCamera = renderRequest.hdCamera; var camera = hdCamera.camera; @@ -145,7 +145,7 @@ void ExecuteWithRenderGraph(RenderRequest renderRequest, case IndirectDiffuseMode.Raytrace: lightingBuffers.ssgiLightingBuffer = RenderRayTracedIndirectDiffuse(m_RenderGraph, hdCamera, - prepassOutput.depthBuffer, prepassOutput.stencilBuffer, prepassOutput.normalBuffer, prepassOutput.resolvedMotionVectorsBuffer, historyValidationTexture, + prepassOutput.depthBuffer, prepassOutput.stencilBuffer, prepassOutput.normalBuffer, prepassOutput.resolvedMotionVectorsBuffer, historyValidationTexture, m_SkyManager.GetSkyReflection(hdCamera), rayCountTexture, m_ShaderVariablesRayTracingCB); break; @@ -357,8 +357,8 @@ void ExecuteWithRenderGraph(RenderRequest renderRequest, class FinalBlitPassData { public BlitFinalCameraTextureParameters parameters; - public TextureHandle source; - public TextureHandle destination; + public TextureHandle source; + public TextureHandle destination; } void BlitFinalCameraTexture(RenderGraph renderGraph, HDCamera hdCamera, TextureHandle source, TextureHandle destination, int viewIndex) @@ -379,12 +379,12 @@ void BlitFinalCameraTexture(RenderGraph renderGraph, HDCamera hdCamera, TextureH class SetFinalTargetPassData { - public bool copyDepth; - public Material copyDepthMaterial; - public TextureHandle finalTarget; - public Rect finalViewport; - public TextureHandle depthBuffer; - public bool flipY; + public bool copyDepth; + public Material copyDepthMaterial; + public TextureHandle finalTarget; + public Rect finalViewport; + public TextureHandle depthBuffer; + public bool flipY; } void SetFinalTarget(RenderGraph renderGraph, HDCamera hdCamera, TextureHandle depthBuffer, TextureHandle finalTarget) @@ -438,11 +438,11 @@ void SetFinalTarget(RenderGraph renderGraph, HDCamera hdCamera, TextureHandle de class CopyXRDepthPassData { - public Material copyDepth; - public Rect viewport; - public TextureHandle depthBuffer; - public TextureHandle output; - public float dynamicResolutionScale; + public Material copyDepth; + public Rect viewport; + public TextureHandle depthBuffer; + public TextureHandle output; + public float dynamicResolutionScale; } void CopyXRDepth(RenderGraph renderGraph, HDCamera hdCamera, TextureHandle depthBuffer, TextureHandle output) @@ -479,41 +479,41 @@ void CopyXRDepth(RenderGraph renderGraph, HDCamera hdCamera, TextureHandle depth class ForwardPassData { - public RendererListHandle rendererList; - public TextureHandle[] renderTarget = new TextureHandle[RenderGraph.kMaxMRTCount]; - public int renderTargetCount; - public TextureHandle depthBuffer; - public ComputeBufferHandle lightListBuffer; - public ComputeBufferHandle perVoxelOffset; - public ComputeBufferHandle perTileLogBaseTweak; - public FrameSettings frameSettings; + public RendererListHandle rendererList; + public TextureHandle[] renderTarget = new TextureHandle[RenderGraph.kMaxMRTCount]; + public int renderTargetCount; + public TextureHandle depthBuffer; + public ComputeBufferHandle lightListBuffer; + public ComputeBufferHandle perVoxelOffset; + public ComputeBufferHandle perTileLogBaseTweak; + public FrameSettings frameSettings; } class ForwardOpaquePassData : ForwardPassData { - public DBufferOutput dbuffer; - public LightingBuffers lightingBuffers; + public DBufferOutput dbuffer; + public LightingBuffers lightingBuffers; } class ForwardTransparentPassData : ForwardPassData { - public bool decalsEnabled; - public bool renderMotionVecForTransparent; - public TextureHandle transparentSSRLighting; - public TextureHandle volumetricLighting; - public TextureHandle depthPyramidTexture; - public TextureHandle normalBuffer; + public bool decalsEnabled; + public bool renderMotionVecForTransparent; + public TextureHandle transparentSSRLighting; + public TextureHandle volumetricLighting; + public TextureHandle depthPyramidTexture; + public TextureHandle normalBuffer; } - void PrepareCommonForwardPassData(RenderGraph renderGraph, - RenderGraphBuilder builder, - ForwardPassData data, - bool opaque, - FrameSettings frameSettings, - RendererListDesc rendererListDesc, - in BuildGPULightListOutput lightLists, - TextureHandle depthBuffer, - ShadowResult shadowResult) + void PrepareCommonForwardPassData(RenderGraph renderGraph, + RenderGraphBuilder builder, + ForwardPassData data, + bool opaque, + FrameSettings frameSettings, + RendererListDesc rendererListDesc, + in BuildGPULightListOutput lightLists, + TextureHandle depthBuffer, + ShadowResult shadowResult) { bool useFptl = frameSettings.IsEnabled(FrameSettingsField.FPTLForForwardOpaque) && opaque; @@ -547,16 +547,16 @@ static void BindGlobalLightListBuffers(ForwardPassData data, RenderGraphContext // The RenderForward pass will render the appropriate pass depends on the engine settings. In case of forward only rendering, both "Forward" pass and "ForwardOnly" pass // material will be render for both transparent and opaque. In case of deferred, both path are used for transparent but only "ForwardOnly" is use for opaque. // (Thus why "Forward" and "ForwardOnly" are exclusive, else they will render two times" - void RenderForwardOpaque(RenderGraph renderGraph, - HDCamera hdCamera, - TextureHandle colorBuffer, - in LightingBuffers lightingBuffers, - in BuildGPULightListOutput lightLists, - TextureHandle depthBuffer, - TextureHandle vtFeedbackBuffer, - ShadowResult shadowResult, - DBufferOutput dbuffer, - CullingResults cullResults) + void RenderForwardOpaque(RenderGraph renderGraph, + HDCamera hdCamera, + TextureHandle colorBuffer, + in LightingBuffers lightingBuffers, + in BuildGPULightListOutput lightLists, + TextureHandle depthBuffer, + TextureHandle vtFeedbackBuffer, + ShadowResult shadowResult, + DBufferOutput dbuffer, + CullingResults cullResults) { bool debugDisplay = m_CurrentDebugDisplaySettings.IsDebugDisplayEnabled(); @@ -611,19 +611,19 @@ void RenderForwardOpaque(RenderGraph renderGraph, } } - void RenderForwardTransparent(RenderGraph renderGraph, - HDCamera hdCamera, - TextureHandle colorBuffer, - TextureHandle normalBuffer, - in PrepassOutput prepassOutput, - TextureHandle vtFeedbackBuffer, - TextureHandle volumetricLighting, - TextureHandle ssrLighting, - TextureHandle? colorPyramid, - in BuildGPULightListOutput lightLists, - in ShadowResult shadowResult, - CullingResults cullResults, - bool preRefractionPass) + void RenderForwardTransparent(RenderGraph renderGraph, + HDCamera hdCamera, + TextureHandle colorBuffer, + TextureHandle normalBuffer, + in PrepassOutput prepassOutput, + TextureHandle vtFeedbackBuffer, + TextureHandle volumetricLighting, + TextureHandle ssrLighting, + TextureHandle? colorPyramid, + in BuildGPULightListOutput lightLists, + in ShadowResult shadowResult, + CullingResults cullResults, + bool preRefractionPass) { if (!hdCamera.frameSettings.IsEnabled(FrameSettingsField.TransparentObjects)) return; @@ -676,7 +676,7 @@ void RenderForwardTransparent(RenderGraph renderGraph, // to avoid warnings about unbound render targets. The following rendertarget could really be anything if renderVelocitiesForTransparent // Create a new target here should reuse existing already released one passData.renderTarget[index++] = builder.CreateTransientTexture(new TextureDesc(Vector2.one, true, true) - { colorFormat = GraphicsFormat.R8G8B8A8_SRGB, bindTextureMS = msaa, enableMSAA = msaa, name = "Transparency Velocity Dummy" }); + { colorFormat = GraphicsFormat.R8G8B8A8_SRGB, bindTextureMS = msaa, enableMSAA = msaa, name = "Transparency Velocity Dummy" }); } passData.renderTargetCount = index; @@ -763,11 +763,11 @@ void RenderTransparentDepthPostpass(RenderGraph renderGraph, HDCamera hdCamera, class RenderLowResTransparentPassData { - public ShaderVariablesGlobal globalCB; - public FrameSettings frameSettings; - public RendererListHandle rendererList; - public TextureHandle lowResBuffer; - public TextureHandle downsampledDepthBuffer; + public ShaderVariablesGlobal globalCB; + public FrameSettings frameSettings; + public RendererListHandle rendererList; + public TextureHandle lowResBuffer; + public TextureHandle downsampledDepthBuffer; } TextureHandle RenderLowResTransparent(RenderGraph renderGraph, HDCamera hdCamera, TextureHandle downsampledDepth, CullingResults cullingResults) @@ -783,7 +783,7 @@ TextureHandle RenderLowResTransparent(RenderGraph renderGraph, HDCamera hdCamera passData.downsampledDepthBuffer = builder.UseDepthBuffer(downsampledDepth, DepthAccess.ReadWrite); // We need R16G16B16A16_SFloat as we need a proper alpha channel for compositing. passData.lowResBuffer = builder.UseColorBuffer(renderGraph.CreateTexture(new TextureDesc(Vector2.one * 0.5f, true, true) - { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, enableRandomWrite = true, clearBuffer = true, clearColor = Color.black, name = "Low res transparent" }), 0); + { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, enableRandomWrite = true, clearBuffer = true, clearColor = Color.black, name = "Low res transparent" }), 0); builder.SetRenderFunc( (RenderLowResTransparentPassData data, RenderGraphContext context) => @@ -791,7 +791,7 @@ TextureHandle RenderLowResTransparent(RenderGraph renderGraph, HDCamera hdCamera UpdateOffscreenRenderingConstants(ref data.globalCB, true, 2u); ConstantBuffer.PushGlobal(context.cmd, data.globalCB, HDShaderIDs._ShaderVariablesGlobal); - DrawTransparentRendererList(context.renderContext, context.cmd, data.frameSettings, data.rendererList); + DrawTransparentRendererList(context.renderContext, context.cmd, data.frameSettings, data.rendererList); UpdateOffscreenRenderingConstants(ref data.globalCB, false, 1u); ConstantBuffer.PushGlobal(context.cmd, data.globalCB, HDShaderIDs._ShaderVariablesGlobal); @@ -803,10 +803,10 @@ TextureHandle RenderLowResTransparent(RenderGraph renderGraph, HDCamera hdCamera class UpsampleTransparentPassData { - public Material upsampleMaterial; - public TextureHandle colorBuffer; - public TextureHandle lowResTransparentBuffer; - public TextureHandle downsampledDepthBuffer; + public Material upsampleMaterial; + public TextureHandle colorBuffer; + public TextureHandle lowResTransparentBuffer; + public TextureHandle downsampledDepthBuffer; } void UpsampleTransparent(RenderGraph renderGraph, HDCamera hdCamera, TextureHandle colorBuffer, TextureHandle lowResTransparentBuffer, TextureHandle downsampledDepthBuffer) @@ -915,22 +915,22 @@ void RenderRayTracingPrepass(RenderGraph renderGraph, CullingResults cull, HDCam } } - TextureHandle RenderTransparency(RenderGraph renderGraph, - HDCamera hdCamera, - TextureHandle colorBuffer, - TextureHandle normalBuffer, - TextureHandle vtFeedbackBuffer, - TextureHandle currentColorPyramid, - TextureHandle volumetricLighting, - TextureHandle rayCountTexture, - Texture skyTexture, - in BuildGPULightListOutput lightLists, - ref PrepassOutput prepassOutput, - ShadowResult shadowResult, - CullingResults cullingResults, - CullingResults customPassCullingResults, - AOVRequestData aovRequest, - List aovCustomPassBuffers) + TextureHandle RenderTransparency(RenderGraph renderGraph, + HDCamera hdCamera, + TextureHandle colorBuffer, + TextureHandle normalBuffer, + TextureHandle vtFeedbackBuffer, + TextureHandle currentColorPyramid, + TextureHandle volumetricLighting, + TextureHandle rayCountTexture, + Texture skyTexture, + in BuildGPULightListOutput lightLists, + ref PrepassOutput prepassOutput, + ShadowResult shadowResult, + CullingResults cullingResults, + CullingResults customPassCullingResults, + AOVRequestData aovRequest, + List aovCustomPassBuffers) { // Transparent (non recursive) objects that are rendered in front of transparent (recursive) require the recursive rendering to be executed for that pixel. // This means our flagging process needs to happen before the transparent depth prepass as we use the depth to discriminate pixels that do not need recursive rendering. @@ -986,11 +986,11 @@ class RenderForwardEmissivePassData public RendererListHandle rendererList; } - void RenderForwardEmissive(RenderGraph renderGraph, - HDCamera hdCamera, - TextureHandle colorBuffer, - TextureHandle depthStencilBuffer, - CullingResults cullingResults) + void RenderForwardEmissive(RenderGraph renderGraph, + HDCamera hdCamera, + TextureHandle colorBuffer, + TextureHandle depthStencilBuffer, + CullingResults cullingResults) { if (!hdCamera.frameSettings.IsEnabled(FrameSettingsField.TransparentObjects) && !hdCamera.frameSettings.IsEnabled(FrameSettingsField.OpaqueObjects)) @@ -1018,11 +1018,11 @@ void RenderForwardEmissive(RenderGraph renderGraph, // This is use to Display legacy shader with an error shader [System.Diagnostics.Conditional("DEVELOPMENT_BUILD"), System.Diagnostics.Conditional("UNITY_EDITOR")] - void RenderForwardError(RenderGraph renderGraph, - HDCamera hdCamera, - TextureHandle colorBuffer, - TextureHandle depthStencilBuffer, - CullingResults cullResults) + void RenderForwardError(RenderGraph renderGraph, + HDCamera hdCamera, + TextureHandle colorBuffer, + TextureHandle depthStencilBuffer, + CullingResults cullResults) { if (!hdCamera.frameSettings.IsEnabled(FrameSettingsField.TransparentObjects) && !hdCamera.frameSettings.IsEnabled(FrameSettingsField.OpaqueObjects)) @@ -1170,16 +1170,16 @@ void PreRenderSky(RenderGraph renderGraph, HDCamera hdCamera, TextureHandle colo class RenderSkyPassData { - public VisualEnvironment visualEnvironment; - public Light sunLight; - public HDCamera hdCamera; - public TextureHandle volumetricLighting; - public TextureHandle colorBuffer; - public TextureHandle depthTexture; - public TextureHandle depthStencilBuffer; - public TextureHandle intermediateBuffer; + public VisualEnvironment visualEnvironment; + public Light sunLight; + public HDCamera hdCamera; + public TextureHandle volumetricLighting; + public TextureHandle colorBuffer; + public TextureHandle depthTexture; + public TextureHandle depthStencilBuffer; + public TextureHandle intermediateBuffer; public DebugDisplaySettings debugDisplaySettings; - public SkyManager skyManager; + public SkyManager skyManager; } void RenderSky(RenderGraph renderGraph, HDCamera hdCamera, TextureHandle colorBuffer, TextureHandle volumetricLighting, TextureHandle depthStencilBuffer, TextureHandle depthTexture) @@ -1255,16 +1255,16 @@ void GenerateColorPyramid(RenderGraph renderGraph, HDCamera hdCamera, TextureHan class AccumulateDistortionPassData { - public TextureHandle distortionBuffer; - public TextureHandle depthStencilBuffer; - public RendererListHandle distortionRendererList; - public FrameSettings frameSettings; + public TextureHandle distortionBuffer; + public TextureHandle depthStencilBuffer; + public RendererListHandle distortionRendererList; + public FrameSettings frameSettings; } - TextureHandle AccumulateDistortion(RenderGraph renderGraph, - HDCamera hdCamera, - TextureHandle depthStencilBuffer, - CullingResults cullResults) + TextureHandle AccumulateDistortion(RenderGraph renderGraph, + HDCamera hdCamera, + TextureHandle depthStencilBuffer, + CullingResults cullResults) { using (var builder = renderGraph.AddRenderPass("Accumulate Distortion", out var passData, ProfilingSampler.Get(HDProfileId.AccumulateDistortion))) { @@ -1287,21 +1287,21 @@ TextureHandle AccumulateDistortion(RenderGraph renderGraph, class RenderDistortionPassData { - public Material applyDistortionMaterial; - public TextureHandle sourceColorBuffer; - public TextureHandle distortionBuffer; - public TextureHandle colorBuffer; - public TextureHandle depthStencilBuffer; - public Vector4 size; - public bool roughDistortion; + public Material applyDistortionMaterial; + public TextureHandle sourceColorBuffer; + public TextureHandle distortionBuffer; + public TextureHandle colorBuffer; + public TextureHandle depthStencilBuffer; + public Vector4 size; + public bool roughDistortion; } - void RenderDistortion(RenderGraph renderGraph, - HDCamera hdCamera, - TextureHandle colorBuffer, - TextureHandle depthStencilBuffer, - TextureHandle colorPyramidBuffer, - TextureHandle distortionBuffer) + void RenderDistortion(RenderGraph renderGraph, + HDCamera hdCamera, + TextureHandle colorBuffer, + TextureHandle depthStencilBuffer, + TextureHandle colorPyramidBuffer, + TextureHandle distortionBuffer) { if (!hdCamera.frameSettings.IsEnabled(FrameSettingsField.Distortion)) return; @@ -1362,10 +1362,10 @@ TextureHandle CreateColorBuffer(RenderGraph renderGraph, HDCamera hdCamera, bool class ResolveColorData { - public TextureHandle input; - public TextureHandle output; - public Material resolveMaterial; - public int passIndex; + public TextureHandle input; + public TextureHandle output; + public Material resolveMaterial; + public int passIndex; } TextureHandle ResolveMSAAColor(RenderGraph renderGraph, HDCamera hdCamera, TextureHandle input) @@ -1523,15 +1523,15 @@ void RenderGizmos(RenderGraph renderGraph, HDCamera hdCamera, TextureHandle colo #endif } - bool RenderCustomPass(RenderGraph renderGraph, - HDCamera hdCamera, - TextureHandle colorBuffer, - in PrepassOutput prepassOutput, - CullingResults cullingResults, - CullingResults cameraCullingResults, - CustomPassInjectionPoint injectionPoint, - AOVRequestData aovRequest, - List aovCustomPassBuffers) + bool RenderCustomPass(RenderGraph renderGraph, + HDCamera hdCamera, + TextureHandle colorBuffer, + in PrepassOutput prepassOutput, + CullingResults cullingResults, + CullingResults cameraCullingResults, + CustomPassInjectionPoint injectionPoint, + AOVRequestData aovRequest, + List aovCustomPassBuffers) { if (!hdCamera.frameSettings.IsEnabled(FrameSettingsField.CustomPass)) return false; diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs index 0daea1c8a27..9990fe10eb2 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs @@ -267,11 +267,11 @@ internal int GetMaxScreenSpaceShadows() static DebugDisplaySettings s_NeutralDebugDisplaySettings = new DebugDisplaySettings(); internal DebugDisplaySettings m_CurrentDebugDisplaySettings; // We need this flag because otherwise if no full screen debug is pushed (like for example if the corresponding pass is disabled), when we render the result in RenderDebug m_DebugFullScreenTempBuffer will contain potential garbage - bool m_FullScreenDebugPushed; - bool m_ValidAPI; // False by default mean we render normally, true mean we don't render anything - bool m_IsDepthBufferCopyValid; - RenderTexture m_TemporaryTargetForCubemaps; - HDCamera m_CurrentHDCamera; + bool m_FullScreenDebugPushed; + bool m_ValidAPI; // False by default mean we render normally, true mean we don't render anything + bool m_IsDepthBufferCopyValid; + RenderTexture m_TemporaryTargetForCubemaps; + HDCamera m_CurrentHDCamera; private CameraCache<(Transform viewer, HDProbe probe, int face)> m_ProbeCameraCache = new CameraCache<(Transform viewer, HDProbe probe, int face)>(); @@ -672,14 +672,21 @@ void SetRenderingFeatures() overridesFog = true, overridesOtherLightingSettings = true, editableMaterialRenderQueue = false - // Enlighten is deprecated in 2019.3 and above - , enlighten = false - , overridesLODBias = true - , overridesMaximumLODLevel = true - , terrainDetailUnsupported = true - , overridesShadowmask = true // Don't display the shadow mask UI in Quality Settings - , overrideShadowmaskMessage = "\nThe Shadowmask Mode used at run time can be found in the Shadows section of Light component." - , overridesRealtimeReflectionProbes = true // Don't display the real time reflection probes checkbox UI in Quality Settings + // Enlighten is deprecated in 2019.3 and above + , + enlighten = false + , + overridesLODBias = true + , + overridesMaximumLODLevel = true + , + terrainDetailUnsupported = true + , + overridesShadowmask = true // Don't display the shadow mask UI in Quality Settings + , + overrideShadowmaskMessage = "\nThe Shadowmask Mode used at run time can be found in the Shadows section of Light component." + , + overridesRealtimeReflectionProbes = true // Don't display the real time reflection probes checkbox UI in Quality Settings }; Lightmapping.SetDelegate(GlobalIlluminationUtils.hdLightsDelegate); @@ -1084,11 +1091,11 @@ void UpdateShaderVariablesRaytracingCB(HDCamera hdCamera, CommandBuffer cmd) struct BuildCoarseStencilAndResolveParameters { - public HDCamera hdCamera; - public ComputeShader resolveStencilCS; - public int resolveKernel; - public bool resolveIsNecessary; - public bool resolveOnly; + public HDCamera hdCamera; + public ComputeShader resolveStencilCS; + public int resolveKernel; + public bool resolveIsNecessary; + public bool resolveOnly; } BuildCoarseStencilAndResolveParameters PrepareBuildCoarseStencilParameters(HDCamera hdCamera, bool resolveOnly) @@ -1433,7 +1440,7 @@ protected override void Render(ScriptableRenderContext renderContext, Camera[] c index = renderRequests.Count, cameraSettings = CameraSettings.From(hdCamera), viewDependentProbesData = ListPool<(HDProbe.RenderData, HDProbe)>.Get() - // TODO: store DecalCullResult + // TODO: store DecalCullResult }; renderRequests.Add(request); // This is a root render request @@ -1527,7 +1534,7 @@ float ComputeVisibility(int visibleInIndex, HDProbe visibleProbe) AddHDProbeRenderRequests( visibleProbe, viewerTransform, - new List<(int index, float weight)> {visibility}, + new List<(int index, float weight)> { visibility }, HDUtils.GetSceneCullingMaskFromCamera(visibleInRenderRequest.hdCamera.camera), hdParentCamera, visibleInRenderRequest.hdCamera.camera.fieldOfView, @@ -1754,7 +1761,7 @@ ref _cullingResults index = renderRequests.Count, cameraSettings = cameraSettings[j], viewDependentProbesData = ListPool<(HDProbe.RenderData, HDProbe)>.Get() - // TODO: store DecalCullResult + // TODO: store DecalCullResult }; if (m_SkyManager.HasSetValidAmbientProbe(hdCamera)) @@ -2177,11 +2184,11 @@ AOVRequestData aovRequest struct BlitFinalCameraTextureParameters { - public bool flip; - public int srcTexArraySlice; - public int dstTexArraySlice; - public Rect viewport; - public Material blitMaterial; + public bool flip; + public int srcTexArraySlice; + public int dstTexArraySlice; + public Rect viewport; + public Material blitMaterial; } internal RTHandle GetExposureTexture(HDCamera hdCamera) => @@ -2658,12 +2665,12 @@ static void DrawTransparentRendererList(in ScriptableRenderContext renderContext struct DepthPrepassParameters { - public string passName; - public HDProfileId profilingId; + public string passName; + public HDProfileId profilingId; public RendererListDesc depthDeferredRendererListDesc; public RendererListDesc depthForwardRendererListDesc; - public bool hasDepthDeferredPass; - public bool shouldRenderMotionVectorAfterGBuffer; + public bool hasDepthDeferredPass; + public bool shouldRenderMotionVectorAfterGBuffer; } DepthPrepassParameters PrepareDepthPrepass(CullingResults cull, HDCamera hdCamera) @@ -2782,15 +2789,15 @@ DepthPrepassParameters PrepareDepthPrepass(CullingResults cull, HDCamera hdCamer return result; } - static void RenderDepthPrepass(ScriptableRenderContext renderContext, - CommandBuffer cmd, - FrameSettings frameSettings, - RenderTargetIdentifier[] deferredMrt, - RenderTargetIdentifier[] forwardMrt, - RTHandle depthBuffer, - in RendererList depthDeferredRendererListDesc, - in RendererList depthForwardRendererListDesc, - bool hasDepthDeferredPass + static void RenderDepthPrepass(ScriptableRenderContext renderContext, + CommandBuffer cmd, + FrameSettings frameSettings, + RenderTargetIdentifier[] deferredMrt, + RenderTargetIdentifier[] forwardMrt, + RTHandle depthBuffer, + in RendererList depthDeferredRendererListDesc, + in RendererList depthForwardRendererListDesc, + bool hasDepthDeferredPass ) { if (hasDepthDeferredPass) @@ -2837,11 +2844,11 @@ DBufferNormalPatchParameters PrepareDBufferNormalPatchParameters(HDCamera hdCame return parameters; } - static void DecalNormalPatch(DBufferNormalPatchParameters parameters, - RTHandle[] dBuffer, - RTHandle depthStencilBuffer, - RTHandle normalBuffer, - CommandBuffer cmd) + static void DecalNormalPatch(DBufferNormalPatchParameters parameters, + RTHandle[] dBuffer, + RTHandle depthStencilBuffer, + RTHandle normalBuffer, + CommandBuffer cmd) { using (new ProfilingScope(cmd, ProfilingSampler.Get(HDProfileId.DBufferNormal))) { @@ -2873,7 +2880,7 @@ void UpdateShaderVariablesGlobalDecal(ref ShaderVariablesGlobal cb, HDCamera hdC { if (hdCamera.frameSettings.IsEnabled(FrameSettingsField.Decals)) { - cb._EnableDecals = 1; + cb._EnableDecals = 1; cb._DecalAtlasResolution = new Vector2(HDUtils.hdrpSettings.decalSettings.atlasWidth, HDUtils.hdrpSettings.decalSettings.atlasHeight); } else @@ -2898,15 +2905,15 @@ RenderDBufferParameters PrepareRenderDBufferParameters(HDCamera hdCamera) return parameters; } - static void RenderDBuffer(in RenderDBufferParameters parameters, - RenderTargetIdentifier[] mrt, - RTHandle[] rtHandles, - RTHandle depthStencilBuffer, - RTHandle depthTexture, - RendererList meshDecalsRendererList, - RTHandle decalPrepassBuffer, - ScriptableRenderContext renderContext, - CommandBuffer cmd) + static void RenderDBuffer(in RenderDBufferParameters parameters, + RenderTargetIdentifier[] mrt, + RTHandle[] rtHandles, + RTHandle depthStencilBuffer, + RTHandle depthTexture, + RendererList meshDecalsRendererList, + RTHandle decalPrepassBuffer, + ScriptableRenderContext renderContext, + CommandBuffer cmd) { // for alpha compositing, color is cleared to 0, alpha to 1 // https://developer.nvidia.com/gpugems/GPUGems3/gpugems3_ch23.html @@ -3017,14 +3024,14 @@ TransparencyOverdrawParameters PrepareTransparencyOverdrawParameters(HDCamera hd return parameters; } - static void RenderTransparencyOverdraw(TransparencyOverdrawParameters parameters, - RTHandle colorBuffer, - RTHandle depthBuffer, - in RendererList transparencyRL, - in RendererList transparencyAfterPostRL, - in RendererList transparencyLowResRL, - ScriptableRenderContext renderContext, - CommandBuffer cmd) + static void RenderTransparencyOverdraw(TransparencyOverdrawParameters parameters, + RTHandle colorBuffer, + RTHandle depthBuffer, + in RendererList transparencyRL, + in RendererList transparencyAfterPostRL, + in RendererList transparencyLowResRL, + ScriptableRenderContext renderContext, + CommandBuffer cmd) { CoreUtils.SetRenderTarget(cmd, colorBuffer, depthBuffer, clearFlag: ClearFlag.Color, clearColor: Color.black); @@ -3059,13 +3066,13 @@ FullScreenDebugParameters PrepareFullScreenDebugParameters(HDCamera hdCamera, Cu return parameters; } - static void RenderFullScreenDebug(FullScreenDebugParameters parameters, - RTHandle colorBuffer, - RTHandle depthBuffer, - ComputeBuffer debugBuffer, - in RendererList rendererList, - ScriptableRenderContext renderContext, - CommandBuffer cmd) + static void RenderFullScreenDebug(FullScreenDebugParameters parameters, + RTHandle colorBuffer, + RTHandle depthBuffer, + ComputeBuffer debugBuffer, + in RendererList rendererList, + ScriptableRenderContext renderContext, + CommandBuffer cmd) { using (new ProfilingScope(cmd, ProfilingSampler.Get(HDProfileId.RenderFullScreenDebug))) { @@ -3152,14 +3159,14 @@ RendererListDesc PrepareForwardTransparentRendererList(CullingResults cullResult return CreateTransparentRendererListDesc(cullResults, hdCamera.camera, passNames, m_CurrentRendererConfigurationBakedLighting, transparentRange); } - static void RenderForwardRendererList(FrameSettings frameSettings, - RendererList rendererList, - RenderTargetIdentifier[] renderTarget, - RTHandle depthBuffer, - ComputeBuffer lightListBuffer, - bool opaque, - ScriptableRenderContext renderContext, - CommandBuffer cmd) + static void RenderForwardRendererList(FrameSettings frameSettings, + RendererList rendererList, + RenderTargetIdentifier[] renderTarget, + RTHandle depthBuffer, + ComputeBuffer lightListBuffer, + bool opaque, + ScriptableRenderContext renderContext, + CommandBuffer cmd) { // Note: SHADOWS_SHADOWMASK keyword is enabled in HDRenderPipeline.cs ConfigureForShadowMask bool useFptl = opaque && frameSettings.IsEnabled(FrameSettingsField.FPTLForForwardOpaque); @@ -3178,16 +3185,16 @@ static void RenderForwardRendererList(FrameSettings frameSettings, struct RenderSSRParameters { - public ComputeShader ssrCS; - public int tracingKernel; - public int reprojectionKernel; - public int accumulateKernel; - public bool transparentSSR; - public bool usePBRAlgo; + public ComputeShader ssrCS; + public int tracingKernel; + public int reprojectionKernel; + public int accumulateKernel; + public bool transparentSSR; + public bool usePBRAlgo; - public int width, height, viewCount; + public int width, height, viewCount; - public ComputeBuffer offsetBufferData; + public ComputeBuffer offsetBufferData; public ShaderVariablesScreenSpaceReflection cb; } @@ -3237,22 +3244,22 @@ RenderSSRParameters PrepareSSRParameters(HDCamera hdCamera, in HDUtils.PackedMip return parameters; } - static void RenderSSR(in RenderSSRParameters parameters, - HDCamera hdCamera, - BlueNoise blueNoise, - RTHandle depthTexture, - RTHandle depthPyramid, - RTHandle normalBuffer, - RTHandle motionVectorsBuffer, - RTHandle SsrHitPointTexture, - RTHandle stencilBuffer, - RTHandle clearCoatMask, - RTHandle previousColorPyramid, - RTHandle ssrAccum, - RTHandle ssrLightingTexture, - RTHandle ssrAccumPrev, - ComputeBuffer coarseStencilBuffer, - CommandBuffer cmd, + static void RenderSSR(in RenderSSRParameters parameters, + HDCamera hdCamera, + BlueNoise blueNoise, + RTHandle depthTexture, + RTHandle depthPyramid, + RTHandle normalBuffer, + RTHandle motionVectorsBuffer, + RTHandle SsrHitPointTexture, + RTHandle stencilBuffer, + RTHandle clearCoatMask, + RTHandle previousColorPyramid, + RTHandle ssrAccum, + RTHandle ssrLightingTexture, + RTHandle ssrAccumPrev, + ComputeBuffer coarseStencilBuffer, + CommandBuffer cmd, ScriptableRenderContext renderContext) { var cs = parameters.ssrCS; @@ -3476,10 +3483,10 @@ struct DebugParameters public DebugOverlay debugOverlay; // Full screen debug - public bool resolveFullScreenDebug; - public Material debugFullScreenMaterial; - public int depthPyramidMip; - public ComputeBuffer depthPyramidOffsets; + public bool resolveFullScreenDebug; + public Material debugFullScreenMaterial; + public int depthPyramidMip; + public ComputeBuffer depthPyramidOffsets; // Sky public Texture skyReflectionTexture; @@ -3493,11 +3500,11 @@ struct DebugParameters public ProbeVolumeDebugOverlayParameters probeVolumeOverlayParameters; // Color picker - public bool colorPickerEnabled; + public bool colorPickerEnabled; public Material colorPickerMaterial; // Exposure - public bool exposureDebugEnabled; + public bool exposureDebugEnabled; public Material debugExposureMaterial; } @@ -3535,13 +3542,13 @@ DebugParameters PrepareDebugParameters(HDCamera hdCamera, HDUtils.PackedMipChain return parameters; } - static void ResolveFullScreenDebug(in DebugParameters parameters, - MaterialPropertyBlock mpb, - RTHandle inputFullScreenDebug, - RTHandle inputDepthPyramid, - RTHandle output, - ComputeBuffer fullscreenBuffer, - CommandBuffer cmd) + static void ResolveFullScreenDebug(in DebugParameters parameters, + MaterialPropertyBlock mpb, + RTHandle inputFullScreenDebug, + RTHandle inputDepthPyramid, + RTHandle output, + ComputeBuffer fullscreenBuffer, + CommandBuffer cmd) { mpb.SetTexture(HDShaderIDs._DebugFullScreenTexture, inputFullScreenDebug); mpb.SetTexture(HDShaderIDs._CameraDepthTexture, inputDepthPyramid); @@ -3566,10 +3573,10 @@ static void ResolveFullScreenDebug(in DebugParameters parameters, cmd.ClearRandomWriteTargets(); } - static void ResolveColorPickerDebug(in DebugParameters parameters, - RTHandle debugColorPickerBuffer, - RTHandle output, - CommandBuffer cmd) + static void ResolveColorPickerDebug(in DebugParameters parameters, + RTHandle debugColorPickerBuffer, + RTHandle output, + CommandBuffer cmd) { ColorPickerDebugSettings colorPickerDebugSettings = parameters.debugDisplaySettings.data.colorPickerDebugSettings; FalseColorDebugSettings falseColorDebugSettings = parameters.debugDisplaySettings.data.falseColorDebugSettings; @@ -3706,13 +3713,13 @@ struct PostProcessParameters { public ShaderVariablesGlobal globalCB; - public HDCamera hdCamera; - public bool postProcessIsFinalPass; - public bool flipYInPostProcess; - public BlueNoise blueNoise; + public HDCamera hdCamera; + public bool postProcessIsFinalPass; + public bool flipYInPostProcess; + public BlueNoise blueNoise; // After Postprocess - public bool useDepthBuffer; + public bool useDepthBuffer; public RendererListDesc opaqueAfterPPDesc; public RendererListDesc transparentAfterPPDesc; } @@ -3741,9 +3748,9 @@ static void UpdateOffscreenRenderingConstants(ref ShaderVariablesGlobal cb, bool cb._OffScreenDownsampleFactor = factor; } - static void RenderAfterPostProcess(PostProcessParameters parameters, - in RendererList opaqueAfterPostProcessRendererList, - in RendererList transparentAfterPostProcessRendererList, + static void RenderAfterPostProcess(PostProcessParameters parameters, + in RendererList opaqueAfterPostProcessRendererList, + in RendererList transparentAfterPostProcessRendererList, ScriptableRenderContext renderContext, CommandBuffer cmd) { using (new ProfilingScope(cmd, ProfilingSampler.Get(HDProfileId.AfterPostProcessing))) @@ -3899,10 +3906,10 @@ static void SendColorGraphicsBuffer(CommandBuffer cmd, HDCamera hdCamera) /// internal struct OverrideCameraRendering : IDisposable { - CommandBuffer cmd; - Camera overrideCamera; - HDCamera overrideHDCamera; - float originalAspect; + CommandBuffer cmd; + Camera overrideCamera; + HDCamera overrideHDCamera; + float originalAspect; /// /// Overrides the current camera, changing all the matrices and view parameters for the new one. diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipelineAsset.Migration.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipelineAsset.Migration.cs index 8f481a52552..e466099e318 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipelineAsset.Migration.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipelineAsset.Migration.cs @@ -106,13 +106,13 @@ enum Version }), MigrationStep.New(Version.AddedAdaptiveSSS, (HDRenderPipelineAsset data) => { - #pragma warning disable 618 // Type or member is obsolete +#pragma warning disable 618 // Type or member is obsolete bool previouslyHighQuality = data.m_RenderPipelineSettings.m_ObsoleteincreaseSssSampleCount; - #pragma warning restore 618 +#pragma warning restore 618 - FrameSettings.MigrateSubsurfaceParams(ref data.m_RenderingPathDefaultCameraFrameSettings, previouslyHighQuality); + FrameSettings.MigrateSubsurfaceParams(ref data.m_RenderingPathDefaultCameraFrameSettings, previouslyHighQuality); FrameSettings.MigrateSubsurfaceParams(ref data.m_RenderingPathDefaultBakedOrCustomReflectionFrameSettings, previouslyHighQuality); - FrameSettings.MigrateSubsurfaceParams(ref data.m_RenderingPathDefaultRealtimeReflectionFrameSettings, previouslyHighQuality); + FrameSettings.MigrateSubsurfaceParams(ref data.m_RenderingPathDefaultRealtimeReflectionFrameSettings, previouslyHighQuality); }), MigrationStep.New(Version.RemoveCookieCubeAtlasToOctahedral2D, (HDRenderPipelineAsset data) => { diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipelineRayTracingResources.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipelineRayTracingResources.cs index 3e6bbee2817..ae144f37b6e 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipelineRayTracingResources.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipelineRayTracingResources.cs @@ -106,6 +106,6 @@ public override void OnInspectorGUI() } } } - #endif +#endif } } diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDStencilUsage.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDStencilUsage.cs index e378929e0f3..83942a359ce 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDStencilUsage.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDStencilUsage.cs @@ -13,19 +13,19 @@ internal enum StencilUsage // --- Following bits are used before transparent rendering --- - RequiresDeferredLighting = (1 << 1), - SubsurfaceScattering = (1 << 2), // SSS, Split Lighting - TraceReflectionRay = (1 << 3), // SSR or RTR - Decals = (1 << 4), // Use to tag when an Opaque Decal is render into DBuffer - ObjectMotionVector = (1 << 5), // Animated object (for motion blur, SSR, SSAO, TAA) + RequiresDeferredLighting = (1 << 1), + SubsurfaceScattering = (1 << 2), // SSS, Split Lighting + TraceReflectionRay = (1 << 3), // SSR or RTR + Decals = (1 << 4), // Use to tag when an Opaque Decal is render into DBuffer + ObjectMotionVector = (1 << 5), // Animated object (for motion blur, SSR, SSAO, TAA) // --- Stencil is cleared after opaque rendering has finished --- // --- Following bits are used exclusively for what happens after opaque --- - ExcludeFromTAA = (1 << 1), // Disable Temporal Antialiasing for certain objects - DistortionVectors = (1 << 2), // Distortion pass - reset after distortion pass, shared with SMAA - SMAA = (1 << 2), // Subpixel Morphological Antialiasing - AfterOpaqueReservedBits = 0x38, // Reserved for future usage + ExcludeFromTAA = (1 << 1), // Disable Temporal Antialiasing for certain objects + DistortionVectors = (1 << 2), // Distortion pass - reset after distortion pass, shared with SMAA + SMAA = (1 << 2), // Subpixel Morphological Antialiasing + AfterOpaqueReservedBits = 0x38, // Reserved for future usage // --- Following are user bits, we don't touch them inside HDRP and is up to the user to handle them --- UserBit0 = (1 << 6), diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDStringConstants.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDStringConstants.cs index 464ea911178..c104cdf8025 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDStringConstants.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDStringConstants.cs @@ -277,14 +277,14 @@ static class HDShaderIDs public static readonly int _WorldSpaceCameraPos1 = Shader.PropertyToID("_WorldSpaceCameraPos1"); public static readonly int _ViewMatrix1 = Shader.PropertyToID("_ViewMatrix1"); - public static readonly int _ColorTexture = Shader.PropertyToID("_ColorTexture"); - public static readonly int _DepthTexture = Shader.PropertyToID("_DepthTexture"); - public static readonly int _DepthValuesTexture = Shader.PropertyToID("_DepthValuesTexture"); - public static readonly int _CameraColorTexture = Shader.PropertyToID("_CameraColorTexture"); - public static readonly int _CameraColorTextureRW = Shader.PropertyToID("_CameraColorTextureRW"); + public static readonly int _ColorTexture = Shader.PropertyToID("_ColorTexture"); + public static readonly int _DepthTexture = Shader.PropertyToID("_DepthTexture"); + public static readonly int _DepthValuesTexture = Shader.PropertyToID("_DepthValuesTexture"); + public static readonly int _CameraColorTexture = Shader.PropertyToID("_CameraColorTexture"); + public static readonly int _CameraColorTextureRW = Shader.PropertyToID("_CameraColorTextureRW"); public static readonly int _CameraSssDiffuseLightingBuffer = Shader.PropertyToID("_CameraSssDiffuseLightingTexture"); - public static readonly int _CameraFilteringBuffer = Shader.PropertyToID("_CameraFilteringTexture"); - public static readonly int _IrradianceSource = Shader.PropertyToID("_IrradianceSource"); + public static readonly int _CameraFilteringBuffer = Shader.PropertyToID("_CameraFilteringTexture"); + public static readonly int _IrradianceSource = Shader.PropertyToID("_IrradianceSource"); // Planar reflection filtering public static readonly int _ReflectionColorMipChain = Shader.PropertyToID("_ReflectionColorMipChain"); @@ -309,11 +309,11 @@ static class HDShaderIDs public static readonly int _DepthTextureNonOblique = Shader.PropertyToID("_DepthTextureNonOblique"); public static readonly int _CaptureCameraIVP_NO = Shader.PropertyToID("_CaptureCameraIVP_NO"); - public static readonly int _Output = Shader.PropertyToID("_Output"); - public static readonly int _Input = Shader.PropertyToID("_Input"); - public static readonly int _InputVal = Shader.PropertyToID("_InputVal"); - public static readonly int _Sizes = Shader.PropertyToID("_Sizes"); - public static readonly int _ScaleBias = Shader.PropertyToID("_ScaleBias"); + public static readonly int _Output = Shader.PropertyToID("_Output"); + public static readonly int _Input = Shader.PropertyToID("_Input"); + public static readonly int _InputVal = Shader.PropertyToID("_InputVal"); + public static readonly int _Sizes = Shader.PropertyToID("_Sizes"); + public static readonly int _ScaleBias = Shader.PropertyToID("_ScaleBias"); // MSAA shader properties public static readonly int _ColorTextureMS = Shader.PropertyToID("_ColorTextureMS"); @@ -367,16 +367,16 @@ static class HDShaderIDs public static readonly int _NormalBufferTexture = Shader.PropertyToID("_NormalBufferTexture"); public static readonly int _RaytracePrepassBufferTexture = Shader.PropertyToID("_RaytracePrepassBufferTexture"); - public static readonly int _ShaderVariablesScreenSpaceReflection = Shader.PropertyToID("ShaderVariablesScreenSpaceReflection"); - public static readonly int _SsrLightingTexture = Shader.PropertyToID("_SsrLightingTexture"); - public static readonly int _SsrAccumPrev = Shader.PropertyToID("_SsrAccumPrev"); - public static readonly int _SsrLightingTextureRW = Shader.PropertyToID("_SsrLightingTextureRW"); - public static readonly int _DirectionPDFTexture = Shader.PropertyToID("_DirectionPDFTexture"); - public static readonly int _SSRAccumTexture = Shader.PropertyToID("_SSRAccumTexture"); - public static readonly int _SsrHitPointTexture = Shader.PropertyToID("_SsrHitPointTexture"); - public static readonly int _SsrClearCoatMaskTexture = Shader.PropertyToID("_SsrClearCoatMaskTexture"); - public static readonly int _DepthPyramidMipLevelOffsets = Shader.PropertyToID("_DepthPyramidMipLevelOffsets"); - public static readonly int _DepthPyramidFirstMipLevelOffset = Shader.PropertyToID("_DepthPyramidFirstMipLevelOffset"); + public static readonly int _ShaderVariablesScreenSpaceReflection = Shader.PropertyToID("ShaderVariablesScreenSpaceReflection"); + public static readonly int _SsrLightingTexture = Shader.PropertyToID("_SsrLightingTexture"); + public static readonly int _SsrAccumPrev = Shader.PropertyToID("_SsrAccumPrev"); + public static readonly int _SsrLightingTextureRW = Shader.PropertyToID("_SsrLightingTextureRW"); + public static readonly int _DirectionPDFTexture = Shader.PropertyToID("_DirectionPDFTexture"); + public static readonly int _SSRAccumTexture = Shader.PropertyToID("_SSRAccumTexture"); + public static readonly int _SsrHitPointTexture = Shader.PropertyToID("_SsrHitPointTexture"); + public static readonly int _SsrClearCoatMaskTexture = Shader.PropertyToID("_SsrClearCoatMaskTexture"); + public static readonly int _DepthPyramidMipLevelOffsets = Shader.PropertyToID("_DepthPyramidMipLevelOffsets"); + public static readonly int _DepthPyramidFirstMipLevelOffset = Shader.PropertyToID("_DepthPyramidFirstMipLevelOffset"); // Still used by ray tracing. @@ -460,454 +460,454 @@ static class HDShaderIDs public static readonly int _SrcOffsetAndLimit = Shader.PropertyToID("_SrcOffsetAndLimit"); public static readonly int _SrcScaleBias = Shader.PropertyToID("_SrcScaleBias"); public static readonly int _SrcUvLimits = Shader.PropertyToID("_SrcUvLimits"); - public static readonly int _DstOffset = Shader.PropertyToID("_DstOffset"); + public static readonly int _DstOffset = Shader.PropertyToID("_DstOffset"); public static readonly int _DepthMipChain = Shader.PropertyToID("_DepthMipChain"); - public static readonly int _VBufferDensity = Shader.PropertyToID("_VBufferDensity"); - public static readonly int _VBufferLighting = Shader.PropertyToID("_VBufferLighting"); - public static readonly int _VBufferHistory = Shader.PropertyToID("_VBufferHistory"); - public static readonly int _VBufferFeedback = Shader.PropertyToID("_VBufferFeedback"); - public static readonly int _VolumeBounds = Shader.PropertyToID("_VolumeBounds"); - public static readonly int _VolumeData = Shader.PropertyToID("_VolumeData"); - public static readonly int _VolumeMaskAtlas = Shader.PropertyToID("_VolumeMaskAtlas"); - - public static readonly int _MaxZMaskTexture = Shader.PropertyToID("_MaxZMaskTexture"); - public static readonly int _DilationWidth = Shader.PropertyToID("_DilationWidth"); - - public static readonly int _GroundIrradianceTexture = Shader.PropertyToID("_GroundIrradianceTexture"); - public static readonly int _GroundIrradianceTable = Shader.PropertyToID("_GroundIrradianceTable"); - public static readonly int _GroundIrradianceTableOrder = Shader.PropertyToID("_GroundIrradianceTableOrder"); - public static readonly int _AirSingleScatteringTexture = Shader.PropertyToID("_AirSingleScatteringTexture"); - public static readonly int _AirSingleScatteringTable = Shader.PropertyToID("_AirSingleScatteringTable"); - public static readonly int _AerosolSingleScatteringTexture = Shader.PropertyToID("_AerosolSingleScatteringTexture"); - public static readonly int _AerosolSingleScatteringTable = Shader.PropertyToID("_AerosolSingleScatteringTable"); - public static readonly int _MultipleScatteringTexture = Shader.PropertyToID("_MultipleScatteringTexture"); - public static readonly int _MultipleScatteringTable = Shader.PropertyToID("_MultipleScatteringTable"); - public static readonly int _MultipleScatteringTableOrder = Shader.PropertyToID("_MultipleScatteringTableOrder"); - - public static readonly int _PlanetaryRadius = Shader.PropertyToID("_PlanetaryRadius"); - public static readonly int _RcpPlanetaryRadius = Shader.PropertyToID("_RcpPlanetaryRadius"); - public static readonly int _AtmosphericDepth = Shader.PropertyToID("_AtmosphericDepth"); - public static readonly int _RcpAtmosphericDepth = Shader.PropertyToID("_RcpAtmosphericDepth"); - - public static readonly int _AtmosphericRadius = Shader.PropertyToID("_AtmosphericRadius"); - public static readonly int _AerosolAnisotropy = Shader.PropertyToID("_AerosolAnisotropy"); - public static readonly int _AerosolPhasePartConstant = Shader.PropertyToID("_AerosolPhasePartConstant"); - - public static readonly int _AirDensityFalloff = Shader.PropertyToID("_AirDensityFalloff"); - public static readonly int _AirScaleHeight = Shader.PropertyToID("_AirScaleHeight"); - public static readonly int _AerosolDensityFalloff = Shader.PropertyToID("_AerosolDensityFalloff"); - public static readonly int _AerosolScaleHeight = Shader.PropertyToID("_AerosolScaleHeight"); - - public static readonly int _AirSeaLevelExtinction = Shader.PropertyToID("_AirSeaLevelExtinction"); - public static readonly int _AerosolSeaLevelExtinction = Shader.PropertyToID("_AerosolSeaLevelExtinction"); - - public static readonly int _AirSeaLevelScattering = Shader.PropertyToID("_AirSeaLevelScattering"); - public static readonly int _AerosolSeaLevelScattering = Shader.PropertyToID("_AerosolSeaLevelScattering"); - - public static readonly int _GroundAlbedo = Shader.PropertyToID("_GroundAlbedo"); - public static readonly int _IntensityMultiplier = Shader.PropertyToID("_IntensityMultiplier"); - - public static readonly int _PlanetCenterPosition = Shader.PropertyToID("_PlanetCenterPosition"); - - public static readonly int _PlanetRotation = Shader.PropertyToID("_PlanetRotation"); - public static readonly int _SpaceRotation = Shader.PropertyToID("_SpaceRotation"); - - public static readonly int _HasGroundAlbedoTexture = Shader.PropertyToID("_HasGroundAlbedoTexture"); - public static readonly int _GroundAlbedoTexture = Shader.PropertyToID("_GroundAlbedoTexture"); - - public static readonly int _HasGroundEmissionTexture = Shader.PropertyToID("_HasGroundEmissionTexture"); - public static readonly int _GroundEmissionTexture = Shader.PropertyToID("_GroundEmissionTexture"); - public static readonly int _GroundEmissionMultiplier = Shader.PropertyToID("_GroundEmissionMultiplier"); - - public static readonly int _HasSpaceEmissionTexture = Shader.PropertyToID("_HasSpaceEmissionTexture"); - public static readonly int _SpaceEmissionTexture = Shader.PropertyToID("_SpaceEmissionTexture"); - public static readonly int _SpaceEmissionMultiplier = Shader.PropertyToID("_SpaceEmissionMultiplier"); - - public static readonly int _RenderSunDisk = Shader.PropertyToID("_RenderSunDisk"); - - public static readonly int _ColorSaturation = Shader.PropertyToID("_ColorSaturation"); - public static readonly int _AlphaSaturation = Shader.PropertyToID("_AlphaSaturation"); - public static readonly int _AlphaMultiplier = Shader.PropertyToID("_AlphaMultiplier"); - public static readonly int _HorizonTint = Shader.PropertyToID("_HorizonTint"); - public static readonly int _ZenithTint = Shader.PropertyToID("_ZenithTint"); - public static readonly int _HorizonZenithShiftPower = Shader.PropertyToID("_HorizonZenithShiftPower"); - public static readonly int _HorizonZenithShiftScale = Shader.PropertyToID("_HorizonZenithShiftScale"); + public static readonly int _VBufferDensity = Shader.PropertyToID("_VBufferDensity"); + public static readonly int _VBufferLighting = Shader.PropertyToID("_VBufferLighting"); + public static readonly int _VBufferHistory = Shader.PropertyToID("_VBufferHistory"); + public static readonly int _VBufferFeedback = Shader.PropertyToID("_VBufferFeedback"); + public static readonly int _VolumeBounds = Shader.PropertyToID("_VolumeBounds"); + public static readonly int _VolumeData = Shader.PropertyToID("_VolumeData"); + public static readonly int _VolumeMaskAtlas = Shader.PropertyToID("_VolumeMaskAtlas"); + + public static readonly int _MaxZMaskTexture = Shader.PropertyToID("_MaxZMaskTexture"); + public static readonly int _DilationWidth = Shader.PropertyToID("_DilationWidth"); + + public static readonly int _GroundIrradianceTexture = Shader.PropertyToID("_GroundIrradianceTexture"); + public static readonly int _GroundIrradianceTable = Shader.PropertyToID("_GroundIrradianceTable"); + public static readonly int _GroundIrradianceTableOrder = Shader.PropertyToID("_GroundIrradianceTableOrder"); + public static readonly int _AirSingleScatteringTexture = Shader.PropertyToID("_AirSingleScatteringTexture"); + public static readonly int _AirSingleScatteringTable = Shader.PropertyToID("_AirSingleScatteringTable"); + public static readonly int _AerosolSingleScatteringTexture = Shader.PropertyToID("_AerosolSingleScatteringTexture"); + public static readonly int _AerosolSingleScatteringTable = Shader.PropertyToID("_AerosolSingleScatteringTable"); + public static readonly int _MultipleScatteringTexture = Shader.PropertyToID("_MultipleScatteringTexture"); + public static readonly int _MultipleScatteringTable = Shader.PropertyToID("_MultipleScatteringTable"); + public static readonly int _MultipleScatteringTableOrder = Shader.PropertyToID("_MultipleScatteringTableOrder"); + + public static readonly int _PlanetaryRadius = Shader.PropertyToID("_PlanetaryRadius"); + public static readonly int _RcpPlanetaryRadius = Shader.PropertyToID("_RcpPlanetaryRadius"); + public static readonly int _AtmosphericDepth = Shader.PropertyToID("_AtmosphericDepth"); + public static readonly int _RcpAtmosphericDepth = Shader.PropertyToID("_RcpAtmosphericDepth"); + + public static readonly int _AtmosphericRadius = Shader.PropertyToID("_AtmosphericRadius"); + public static readonly int _AerosolAnisotropy = Shader.PropertyToID("_AerosolAnisotropy"); + public static readonly int _AerosolPhasePartConstant = Shader.PropertyToID("_AerosolPhasePartConstant"); + + public static readonly int _AirDensityFalloff = Shader.PropertyToID("_AirDensityFalloff"); + public static readonly int _AirScaleHeight = Shader.PropertyToID("_AirScaleHeight"); + public static readonly int _AerosolDensityFalloff = Shader.PropertyToID("_AerosolDensityFalloff"); + public static readonly int _AerosolScaleHeight = Shader.PropertyToID("_AerosolScaleHeight"); + + public static readonly int _AirSeaLevelExtinction = Shader.PropertyToID("_AirSeaLevelExtinction"); + public static readonly int _AerosolSeaLevelExtinction = Shader.PropertyToID("_AerosolSeaLevelExtinction"); + + public static readonly int _AirSeaLevelScattering = Shader.PropertyToID("_AirSeaLevelScattering"); + public static readonly int _AerosolSeaLevelScattering = Shader.PropertyToID("_AerosolSeaLevelScattering"); + + public static readonly int _GroundAlbedo = Shader.PropertyToID("_GroundAlbedo"); + public static readonly int _IntensityMultiplier = Shader.PropertyToID("_IntensityMultiplier"); + + public static readonly int _PlanetCenterPosition = Shader.PropertyToID("_PlanetCenterPosition"); + + public static readonly int _PlanetRotation = Shader.PropertyToID("_PlanetRotation"); + public static readonly int _SpaceRotation = Shader.PropertyToID("_SpaceRotation"); + + public static readonly int _HasGroundAlbedoTexture = Shader.PropertyToID("_HasGroundAlbedoTexture"); + public static readonly int _GroundAlbedoTexture = Shader.PropertyToID("_GroundAlbedoTexture"); + + public static readonly int _HasGroundEmissionTexture = Shader.PropertyToID("_HasGroundEmissionTexture"); + public static readonly int _GroundEmissionTexture = Shader.PropertyToID("_GroundEmissionTexture"); + public static readonly int _GroundEmissionMultiplier = Shader.PropertyToID("_GroundEmissionMultiplier"); + + public static readonly int _HasSpaceEmissionTexture = Shader.PropertyToID("_HasSpaceEmissionTexture"); + public static readonly int _SpaceEmissionTexture = Shader.PropertyToID("_SpaceEmissionTexture"); + public static readonly int _SpaceEmissionMultiplier = Shader.PropertyToID("_SpaceEmissionMultiplier"); + + public static readonly int _RenderSunDisk = Shader.PropertyToID("_RenderSunDisk"); + + public static readonly int _ColorSaturation = Shader.PropertyToID("_ColorSaturation"); + public static readonly int _AlphaSaturation = Shader.PropertyToID("_AlphaSaturation"); + public static readonly int _AlphaMultiplier = Shader.PropertyToID("_AlphaMultiplier"); + public static readonly int _HorizonTint = Shader.PropertyToID("_HorizonTint"); + public static readonly int _ZenithTint = Shader.PropertyToID("_ZenithTint"); + public static readonly int _HorizonZenithShiftPower = Shader.PropertyToID("_HorizonZenithShiftPower"); + public static readonly int _HorizonZenithShiftScale = Shader.PropertyToID("_HorizonZenithShiftScale"); // Raytracing variables - public static readonly int _RayTracingLayerMask = Shader.PropertyToID("_RayTracingLayerMask"); - public static readonly int _PixelSpreadAngleTangent = Shader.PropertyToID("_PixelSpreadAngleTangent"); - public static readonly string _RaytracingAccelerationStructureName = "_RaytracingAccelerationStructure"; + public static readonly int _RayTracingLayerMask = Shader.PropertyToID("_RayTracingLayerMask"); + public static readonly int _PixelSpreadAngleTangent = Shader.PropertyToID("_PixelSpreadAngleTangent"); + public static readonly string _RaytracingAccelerationStructureName = "_RaytracingAccelerationStructure"; // Path tracing variables - public static readonly int _PathTracedDoFConstants = Shader.PropertyToID("_PathTracedDoFConstants"); - public static readonly int _InvViewportScaleBias = Shader.PropertyToID("_InvViewportScaleBias"); + public static readonly int _PathTracedDoFConstants = Shader.PropertyToID("_PathTracedDoFConstants"); + public static readonly int _InvViewportScaleBias = Shader.PropertyToID("_InvViewportScaleBias"); // Light Cluster - public static readonly int _LightDatasRT = Shader.PropertyToID("_LightDatasRT"); - public static readonly int _EnvLightDatasRT = Shader.PropertyToID("_EnvLightDatasRT"); - public static readonly int _RaytracingLightCluster = Shader.PropertyToID("_RaytracingLightCluster"); - public static readonly int _RaytracingLightClusterRW = Shader.PropertyToID("_RaytracingLightClusterRW"); + public static readonly int _LightDatasRT = Shader.PropertyToID("_LightDatasRT"); + public static readonly int _EnvLightDatasRT = Shader.PropertyToID("_EnvLightDatasRT"); + public static readonly int _RaytracingLightCluster = Shader.PropertyToID("_RaytracingLightCluster"); + public static readonly int _RaytracingLightClusterRW = Shader.PropertyToID("_RaytracingLightClusterRW"); // Denoising - public static readonly int _HistoryBuffer = Shader.PropertyToID("_HistoryBuffer"); - public static readonly int _HistoryBuffer0 = Shader.PropertyToID("_HistoryBuffer0"); - public static readonly int _HistoryBuffer1 = Shader.PropertyToID("_HistoryBuffer1"); - public static readonly int _ValidationBuffer = Shader.PropertyToID("_ValidationBuffer"); - public static readonly int _ValidationBufferRW = Shader.PropertyToID("_ValidationBufferRW"); - public static readonly int _HistoryDepthTexture = Shader.PropertyToID("_HistoryDepthTexture"); - public static readonly int _HistoryNormalTexture = Shader.PropertyToID("_HistoryNormalTexture"); - public static readonly int _RaytracingDenoiseRadius = Shader.PropertyToID("_RaytracingDenoiseRadius"); - public static readonly int _DenoiserFilterRadius = Shader.PropertyToID("_DenoiserFilterRadius"); - public static readonly int _NormalHistoryCriterion = Shader.PropertyToID("_NormalHistoryCriterion"); - public static readonly int _DenoiseInputTexture = Shader.PropertyToID("_DenoiseInputTexture"); - public static readonly int _DenoiseOutputTextureRW = Shader.PropertyToID("_DenoiseOutputTextureRW"); - public static readonly int _HalfResolutionFilter = Shader.PropertyToID("_HalfResolutionFilter"); - public static readonly int _DenoisingHistorySlot = Shader.PropertyToID("_DenoisingHistorySlot"); - public static readonly int _HistoryValidity = Shader.PropertyToID("_HistoryValidity"); - public static readonly int _ReflectionFilterMapping = Shader.PropertyToID("_ReflectionFilterMapping"); - public static readonly int _DenoisingHistorySlice = Shader.PropertyToID("_DenoisingHistorySlice"); - public static readonly int _DenoisingHistoryMask = Shader.PropertyToID("_DenoisingHistoryMask"); - public static readonly int _DenoisingHistoryMaskSn = Shader.PropertyToID("_DenoisingHistoryMaskSn"); - public static readonly int _DenoisingHistoryMaskUn = Shader.PropertyToID("_DenoisingHistoryMaskUn"); - public static readonly int _HistoryValidityBuffer = Shader.PropertyToID("_HistoryValidityBuffer"); - public static readonly int _ValidityOutputTextureRW = Shader.PropertyToID("_ValidityOutputTextureRW"); - public static readonly int _VelocityBuffer = Shader.PropertyToID("_VelocityBuffer"); - public static readonly int _ShadowFilterMapping = Shader.PropertyToID("_ShadowFilterMapping"); - public static readonly int _DistanceTexture = Shader.PropertyToID("_DistanceTexture"); - public static readonly int _JitterFramePeriod = Shader.PropertyToID("_JitterFramePeriod"); - public static readonly int _SingleReflectionBounce = Shader.PropertyToID("_SingleReflectionBounce"); - public static readonly int _HistoryBufferSize = Shader.PropertyToID("_HistoryBufferSize"); - public static readonly int _CurrentEffectResolution = Shader.PropertyToID("_CurrentEffectResolution"); - public static readonly int _SampleCountTextureRW = Shader.PropertyToID("_SampleCountTextureRW"); - public static readonly int _AffectSmoothSurfaces = Shader.PropertyToID("_AffectSmoothSurfaces"); - public static readonly int _ObjectMotionStencilBit = Shader.PropertyToID("_ObjectMotionStencilBit"); + public static readonly int _HistoryBuffer = Shader.PropertyToID("_HistoryBuffer"); + public static readonly int _HistoryBuffer0 = Shader.PropertyToID("_HistoryBuffer0"); + public static readonly int _HistoryBuffer1 = Shader.PropertyToID("_HistoryBuffer1"); + public static readonly int _ValidationBuffer = Shader.PropertyToID("_ValidationBuffer"); + public static readonly int _ValidationBufferRW = Shader.PropertyToID("_ValidationBufferRW"); + public static readonly int _HistoryDepthTexture = Shader.PropertyToID("_HistoryDepthTexture"); + public static readonly int _HistoryNormalTexture = Shader.PropertyToID("_HistoryNormalTexture"); + public static readonly int _RaytracingDenoiseRadius = Shader.PropertyToID("_RaytracingDenoiseRadius"); + public static readonly int _DenoiserFilterRadius = Shader.PropertyToID("_DenoiserFilterRadius"); + public static readonly int _NormalHistoryCriterion = Shader.PropertyToID("_NormalHistoryCriterion"); + public static readonly int _DenoiseInputTexture = Shader.PropertyToID("_DenoiseInputTexture"); + public static readonly int _DenoiseOutputTextureRW = Shader.PropertyToID("_DenoiseOutputTextureRW"); + public static readonly int _HalfResolutionFilter = Shader.PropertyToID("_HalfResolutionFilter"); + public static readonly int _DenoisingHistorySlot = Shader.PropertyToID("_DenoisingHistorySlot"); + public static readonly int _HistoryValidity = Shader.PropertyToID("_HistoryValidity"); + public static readonly int _ReflectionFilterMapping = Shader.PropertyToID("_ReflectionFilterMapping"); + public static readonly int _DenoisingHistorySlice = Shader.PropertyToID("_DenoisingHistorySlice"); + public static readonly int _DenoisingHistoryMask = Shader.PropertyToID("_DenoisingHistoryMask"); + public static readonly int _DenoisingHistoryMaskSn = Shader.PropertyToID("_DenoisingHistoryMaskSn"); + public static readonly int _DenoisingHistoryMaskUn = Shader.PropertyToID("_DenoisingHistoryMaskUn"); + public static readonly int _HistoryValidityBuffer = Shader.PropertyToID("_HistoryValidityBuffer"); + public static readonly int _ValidityOutputTextureRW = Shader.PropertyToID("_ValidityOutputTextureRW"); + public static readonly int _VelocityBuffer = Shader.PropertyToID("_VelocityBuffer"); + public static readonly int _ShadowFilterMapping = Shader.PropertyToID("_ShadowFilterMapping"); + public static readonly int _DistanceTexture = Shader.PropertyToID("_DistanceTexture"); + public static readonly int _JitterFramePeriod = Shader.PropertyToID("_JitterFramePeriod"); + public static readonly int _SingleReflectionBounce = Shader.PropertyToID("_SingleReflectionBounce"); + public static readonly int _HistoryBufferSize = Shader.PropertyToID("_HistoryBufferSize"); + public static readonly int _CurrentEffectResolution = Shader.PropertyToID("_CurrentEffectResolution"); + public static readonly int _SampleCountTextureRW = Shader.PropertyToID("_SampleCountTextureRW"); + public static readonly int _AffectSmoothSurfaces = Shader.PropertyToID("_AffectSmoothSurfaces"); + public static readonly int _ObjectMotionStencilBit = Shader.PropertyToID("_ObjectMotionStencilBit"); // Reflections - public static readonly int _ReflectionHistorybufferRW = Shader.PropertyToID("_ReflectionHistorybufferRW"); - public static readonly int _CurrentFrameTexture = Shader.PropertyToID("_CurrentFrameTexture"); - public static readonly int _AccumulatedFrameTexture = Shader.PropertyToID("_AccumulatedFrameTexture"); - public static readonly int _TemporalAccumuationWeight = Shader.PropertyToID("_TemporalAccumuationWeight"); - public static readonly int _SpatialFilterRadius = Shader.PropertyToID("_SpatialFilterRadius"); - public static readonly int _RaytracingHitDistanceTexture = Shader.PropertyToID("_RaytracingHitDistanceTexture"); - public static readonly int _RaytracingVSNormalTexture = Shader.PropertyToID("_RaytracingVSNormalTexture"); - public static readonly int _RaytracingReflectionTexture = Shader.PropertyToID("_RaytracingReflectionTexture"); + public static readonly int _ReflectionHistorybufferRW = Shader.PropertyToID("_ReflectionHistorybufferRW"); + public static readonly int _CurrentFrameTexture = Shader.PropertyToID("_CurrentFrameTexture"); + public static readonly int _AccumulatedFrameTexture = Shader.PropertyToID("_AccumulatedFrameTexture"); + public static readonly int _TemporalAccumuationWeight = Shader.PropertyToID("_TemporalAccumuationWeight"); + public static readonly int _SpatialFilterRadius = Shader.PropertyToID("_SpatialFilterRadius"); + public static readonly int _RaytracingHitDistanceTexture = Shader.PropertyToID("_RaytracingHitDistanceTexture"); + public static readonly int _RaytracingVSNormalTexture = Shader.PropertyToID("_RaytracingVSNormalTexture"); + public static readonly int _RaytracingReflectionTexture = Shader.PropertyToID("_RaytracingReflectionTexture"); // Shadows - public static readonly int _RaytracingTargetAreaLight = Shader.PropertyToID("_RaytracingTargetAreaLight"); - public static readonly int _RaytracingShadowSlot = Shader.PropertyToID("_RaytracingShadowSlot"); - public static readonly int _RaytracingChannelMask = Shader.PropertyToID("_RaytracingChannelMask"); - public static readonly int _RaytracingChannelMask0 = Shader.PropertyToID("_RaytracingChannelMask0"); - public static readonly int _RaytracingChannelMask1 = Shader.PropertyToID("_RaytracingChannelMask1"); - public static readonly int _RaytracingAreaWorldToLocal = Shader.PropertyToID("_RaytracingAreaWorldToLocal"); - public static readonly int _RaytracedAreaShadowSample = Shader.PropertyToID("_RaytracedAreaShadowSample"); + public static readonly int _RaytracingTargetAreaLight = Shader.PropertyToID("_RaytracingTargetAreaLight"); + public static readonly int _RaytracingShadowSlot = Shader.PropertyToID("_RaytracingShadowSlot"); + public static readonly int _RaytracingChannelMask = Shader.PropertyToID("_RaytracingChannelMask"); + public static readonly int _RaytracingChannelMask0 = Shader.PropertyToID("_RaytracingChannelMask0"); + public static readonly int _RaytracingChannelMask1 = Shader.PropertyToID("_RaytracingChannelMask1"); + public static readonly int _RaytracingAreaWorldToLocal = Shader.PropertyToID("_RaytracingAreaWorldToLocal"); + public static readonly int _RaytracedAreaShadowSample = Shader.PropertyToID("_RaytracedAreaShadowSample"); public static readonly int _RaytracedAreaShadowIntegration = Shader.PropertyToID("_RaytracedAreaShadowIntegration"); - public static readonly int _RaytracingDirectionBuffer = Shader.PropertyToID("_RaytracingDirectionBuffer"); - public static readonly int _RayTracingLengthBuffer = Shader.PropertyToID("_RayTracingLengthBuffer"); - public static readonly int _RaytracingDistanceBufferRW = Shader.PropertyToID("_RaytracingDistanceBufferRW"); - public static readonly int _RaytracingDistanceBuffer = Shader.PropertyToID("_RaytracingDistanceBuffer"); - public static readonly int _AreaShadowTexture = Shader.PropertyToID("_AreaShadowTexture"); - public static readonly int _AreaShadowTextureRW = Shader.PropertyToID("_AreaShadowTextureRW"); - public static readonly int _ScreenSpaceShadowsTextureRW = Shader.PropertyToID("_ScreenSpaceShadowsTextureRW"); - public static readonly int _AreaShadowHistory = Shader.PropertyToID("_AreaShadowHistory"); - public static readonly int _AreaShadowHistoryRW = Shader.PropertyToID("_AreaShadowHistoryRW"); - public static readonly int _AnalyticProbBuffer = Shader.PropertyToID("_AnalyticProbBuffer"); - public static readonly int _AnalyticHistoryBuffer = Shader.PropertyToID("_AnalyticHistoryBuffer"); - public static readonly int _RaytracingLightRadius = Shader.PropertyToID("_RaytracingLightRadius"); - public static readonly int _RaytracingSpotAngle = Shader.PropertyToID("_RaytracingSpotAngle"); - public static readonly int _RaytracedShadowIntegration = Shader.PropertyToID("_RaytracedShadowIntegration"); + public static readonly int _RaytracingDirectionBuffer = Shader.PropertyToID("_RaytracingDirectionBuffer"); + public static readonly int _RayTracingLengthBuffer = Shader.PropertyToID("_RayTracingLengthBuffer"); + public static readonly int _RaytracingDistanceBufferRW = Shader.PropertyToID("_RaytracingDistanceBufferRW"); + public static readonly int _RaytracingDistanceBuffer = Shader.PropertyToID("_RaytracingDistanceBuffer"); + public static readonly int _AreaShadowTexture = Shader.PropertyToID("_AreaShadowTexture"); + public static readonly int _AreaShadowTextureRW = Shader.PropertyToID("_AreaShadowTextureRW"); + public static readonly int _ScreenSpaceShadowsTextureRW = Shader.PropertyToID("_ScreenSpaceShadowsTextureRW"); + public static readonly int _AreaShadowHistory = Shader.PropertyToID("_AreaShadowHistory"); + public static readonly int _AreaShadowHistoryRW = Shader.PropertyToID("_AreaShadowHistoryRW"); + public static readonly int _AnalyticProbBuffer = Shader.PropertyToID("_AnalyticProbBuffer"); + public static readonly int _AnalyticHistoryBuffer = Shader.PropertyToID("_AnalyticHistoryBuffer"); + public static readonly int _RaytracingLightRadius = Shader.PropertyToID("_RaytracingLightRadius"); + public static readonly int _RaytracingSpotAngle = Shader.PropertyToID("_RaytracingSpotAngle"); + public static readonly int _RaytracedShadowIntegration = Shader.PropertyToID("_RaytracedShadowIntegration"); public static readonly int _RaytracedColorShadowIntegration = Shader.PropertyToID("_RaytracedColorShadowIntegration"); - public static readonly int _DirectionalLightAngle = Shader.PropertyToID("_DirectionalLightAngle"); - public static readonly int _DirectionalMaxRayLength = Shader.PropertyToID("_DirectionalMaxRayLength"); - public static readonly int _DirectionalLightDirection = Shader.PropertyToID("_DirectionalLightDirection"); - public static readonly int _SphereLightPosition = Shader.PropertyToID("_SphereLightPosition"); - public static readonly int _SphereLightRadius = Shader.PropertyToID("_SphereLightRadius"); - public static readonly int _CameraFOV = Shader.PropertyToID("_CameraFOV"); + public static readonly int _DirectionalLightAngle = Shader.PropertyToID("_DirectionalLightAngle"); + public static readonly int _DirectionalMaxRayLength = Shader.PropertyToID("_DirectionalMaxRayLength"); + public static readonly int _DirectionalLightDirection = Shader.PropertyToID("_DirectionalLightDirection"); + public static readonly int _SphereLightPosition = Shader.PropertyToID("_SphereLightPosition"); + public static readonly int _SphereLightRadius = Shader.PropertyToID("_SphereLightRadius"); + public static readonly int _CameraFOV = Shader.PropertyToID("_CameraFOV"); // Ambient occlusion - public static readonly int _RaytracingAOIntensity = Shader.PropertyToID("_RaytracingAOIntensity"); + public static readonly int _RaytracingAOIntensity = Shader.PropertyToID("_RaytracingAOIntensity"); // Ray count - public static readonly int _RayCountTexture = Shader.PropertyToID("_RayCountTexture"); - public static readonly int _RayCountType = Shader.PropertyToID("_RayCountType"); - public static readonly int _InputRayCountTexture = Shader.PropertyToID("_InputRayCountTexture"); - public static readonly int _InputRayCountBuffer = Shader.PropertyToID("_InputRayCountBuffer"); - public static readonly int _OutputRayCountBuffer = Shader.PropertyToID("_OutputRayCountBuffer"); - public static readonly int _InputBufferDimension = Shader.PropertyToID("_InputBufferDimension"); - public static readonly int _OutputBufferDimension = Shader.PropertyToID("_OutputBufferDimension"); + public static readonly int _RayCountTexture = Shader.PropertyToID("_RayCountTexture"); + public static readonly int _RayCountType = Shader.PropertyToID("_RayCountType"); + public static readonly int _InputRayCountTexture = Shader.PropertyToID("_InputRayCountTexture"); + public static readonly int _InputRayCountBuffer = Shader.PropertyToID("_InputRayCountBuffer"); + public static readonly int _OutputRayCountBuffer = Shader.PropertyToID("_OutputRayCountBuffer"); + public static readonly int _InputBufferDimension = Shader.PropertyToID("_InputBufferDimension"); + public static readonly int _OutputBufferDimension = Shader.PropertyToID("_OutputBufferDimension"); // Primary Visibility - public static readonly int _RaytracingFlagMask = Shader.PropertyToID("_RaytracingFlagMask"); - public static readonly int _RaytracingPrimaryDebug = Shader.PropertyToID("_RaytracingPrimaryDebug"); - public static readonly int _RaytracingCameraSkyEnabled = Shader.PropertyToID("_RaytracingCameraSkyEnabled"); - public static readonly int _RaytracingCameraClearColor = Shader.PropertyToID("_RaytracingCameraClearColor"); + public static readonly int _RaytracingFlagMask = Shader.PropertyToID("_RaytracingFlagMask"); + public static readonly int _RaytracingPrimaryDebug = Shader.PropertyToID("_RaytracingPrimaryDebug"); + public static readonly int _RaytracingCameraSkyEnabled = Shader.PropertyToID("_RaytracingCameraSkyEnabled"); + public static readonly int _RaytracingCameraClearColor = Shader.PropertyToID("_RaytracingCameraClearColor"); // Indirect diffuse - public static readonly int _IndirectDiffuseTexture = Shader.PropertyToID("_IndirectDiffuseTexture"); - public static readonly int _IndirectDiffuseTextureRW = Shader.PropertyToID("_IndirectDiffuseTextureRW"); - public static readonly int _IndirectDiffuseTexture0RW = Shader.PropertyToID("_IndirectDiffuseTexture0RW"); - public static readonly int _IndirectDiffuseTexture1RW = Shader.PropertyToID("_IndirectDiffuseTexture1RW"); - public static readonly int _IndirectDiffuseTexture0 = Shader.PropertyToID("_IndirectDiffuseTexture0"); - public static readonly int _IndirectDiffuseTexture1 = Shader.PropertyToID("_IndirectDiffuseTexture1"); - public static readonly int _UpscaledIndirectDiffuseTextureRW = Shader.PropertyToID("_UpscaledIndirectDiffuseTextureRW"); - public static readonly int _IndirectDiffuseHitPointTexture = Shader.PropertyToID("_IndirectDiffuseHitPointTexture"); - public static readonly int _IndirectDiffuseHitPointTextureRW = Shader.PropertyToID("_IndirectDiffuseHitPointTextureRW"); - public static readonly int _IndirectDiffuseThicknessScale = Shader.PropertyToID("_IndirectDiffuseThicknessScale"); - public static readonly int _IndirectDiffuseThicknessBias = Shader.PropertyToID("_IndirectDiffuseThicknessBias"); - public static readonly int _IndirectDiffuseSteps = Shader.PropertyToID("_IndirectDiffuseSteps"); - public static readonly int _InputNoisyBuffer = Shader.PropertyToID("_InputNoisyBuffer"); - public static readonly int _InputNoisyBuffer0 = Shader.PropertyToID("_InputNoisyBuffer0"); - public static readonly int _InputNoisyBuffer1 = Shader.PropertyToID("_InputNoisyBuffer1"); - public static readonly int _OutputFilteredBuffer = Shader.PropertyToID("_OutputFilteredBuffer"); - public static readonly int _OutputFilteredBuffer0 = Shader.PropertyToID("_OutputFilteredBuffer0"); - public static readonly int _OutputFilteredBuffer1 = Shader.PropertyToID("_OutputFilteredBuffer1"); - public static readonly int _LowResolutionTexture = Shader.PropertyToID("_LowResolutionTexture"); - public static readonly int _OutputUpscaledTexture = Shader.PropertyToID("_OutputUpscaledTexture"); - public static readonly int _IndirectDiffuseSpatialFilter = Shader.PropertyToID("_IndirectDiffuseSpatialFilter"); + public static readonly int _IndirectDiffuseTexture = Shader.PropertyToID("_IndirectDiffuseTexture"); + public static readonly int _IndirectDiffuseTextureRW = Shader.PropertyToID("_IndirectDiffuseTextureRW"); + public static readonly int _IndirectDiffuseTexture0RW = Shader.PropertyToID("_IndirectDiffuseTexture0RW"); + public static readonly int _IndirectDiffuseTexture1RW = Shader.PropertyToID("_IndirectDiffuseTexture1RW"); + public static readonly int _IndirectDiffuseTexture0 = Shader.PropertyToID("_IndirectDiffuseTexture0"); + public static readonly int _IndirectDiffuseTexture1 = Shader.PropertyToID("_IndirectDiffuseTexture1"); + public static readonly int _UpscaledIndirectDiffuseTextureRW = Shader.PropertyToID("_UpscaledIndirectDiffuseTextureRW"); + public static readonly int _IndirectDiffuseHitPointTexture = Shader.PropertyToID("_IndirectDiffuseHitPointTexture"); + public static readonly int _IndirectDiffuseHitPointTextureRW = Shader.PropertyToID("_IndirectDiffuseHitPointTextureRW"); + public static readonly int _IndirectDiffuseThicknessScale = Shader.PropertyToID("_IndirectDiffuseThicknessScale"); + public static readonly int _IndirectDiffuseThicknessBias = Shader.PropertyToID("_IndirectDiffuseThicknessBias"); + public static readonly int _IndirectDiffuseSteps = Shader.PropertyToID("_IndirectDiffuseSteps"); + public static readonly int _InputNoisyBuffer = Shader.PropertyToID("_InputNoisyBuffer"); + public static readonly int _InputNoisyBuffer0 = Shader.PropertyToID("_InputNoisyBuffer0"); + public static readonly int _InputNoisyBuffer1 = Shader.PropertyToID("_InputNoisyBuffer1"); + public static readonly int _OutputFilteredBuffer = Shader.PropertyToID("_OutputFilteredBuffer"); + public static readonly int _OutputFilteredBuffer0 = Shader.PropertyToID("_OutputFilteredBuffer0"); + public static readonly int _OutputFilteredBuffer1 = Shader.PropertyToID("_OutputFilteredBuffer1"); + public static readonly int _LowResolutionTexture = Shader.PropertyToID("_LowResolutionTexture"); + public static readonly int _OutputUpscaledTexture = Shader.PropertyToID("_OutputUpscaledTexture"); + public static readonly int _IndirectDiffuseSpatialFilter = Shader.PropertyToID("_IndirectDiffuseSpatialFilter"); // Deferred Lighting - public static readonly int _RaytracingLitBufferRW = Shader.PropertyToID("_RaytracingLitBufferRW"); - public static readonly int _RayTracingDiffuseLightingOnly = Shader.PropertyToID("_RayTracingDiffuseLightingOnly"); - public static readonly int _RaytracingHalfResolution = Shader.PropertyToID("_RaytracingHalfResolution"); + public static readonly int _RaytracingLitBufferRW = Shader.PropertyToID("_RaytracingLitBufferRW"); + public static readonly int _RayTracingDiffuseLightingOnly = Shader.PropertyToID("_RayTracingDiffuseLightingOnly"); + public static readonly int _RaytracingHalfResolution = Shader.PropertyToID("_RaytracingHalfResolution"); // Ray binning - public static readonly int _RayBinResult = Shader.PropertyToID("_RayBinResult"); - public static readonly int _RayBinSizeResult = Shader.PropertyToID("_RayBinSizeResult"); - public static readonly int _RayBinTileCountX = Shader.PropertyToID("_RayBinTileCountX"); - public static readonly int _BufferSizeX = Shader.PropertyToID("_BufferSizeX"); + public static readonly int _RayBinResult = Shader.PropertyToID("_RayBinResult"); + public static readonly int _RayBinSizeResult = Shader.PropertyToID("_RayBinSizeResult"); + public static readonly int _RayBinTileCountX = Shader.PropertyToID("_RayBinTileCountX"); + public static readonly int _BufferSizeX = Shader.PropertyToID("_BufferSizeX"); // Sub Surface - public static readonly int _ThroughputTextureRW = Shader.PropertyToID("_ThroughputTextureRW"); - public static readonly int _NormalTextureRW = Shader.PropertyToID("_NormalTextureRW"); - public static readonly int _DirectionTextureRW = Shader.PropertyToID("_DirectionTextureRW"); - public static readonly int _PositionTextureRW = Shader.PropertyToID("_PositionTextureRW"); - public static readonly int _DiffuseLightingTextureRW = Shader.PropertyToID("_DiffuseLightingTextureRW"); - public static readonly int _SubSurfaceLightingBuffer = Shader.PropertyToID("_SubSurfaceLightingBuffer"); - public static readonly int _IndirectDiffuseLightingBuffer = Shader.PropertyToID("_IndirectDiffuseLightingBuffer"); + public static readonly int _ThroughputTextureRW = Shader.PropertyToID("_ThroughputTextureRW"); + public static readonly int _NormalTextureRW = Shader.PropertyToID("_NormalTextureRW"); + public static readonly int _DirectionTextureRW = Shader.PropertyToID("_DirectionTextureRW"); + public static readonly int _PositionTextureRW = Shader.PropertyToID("_PositionTextureRW"); + public static readonly int _DiffuseLightingTextureRW = Shader.PropertyToID("_DiffuseLightingTextureRW"); + public static readonly int _SubSurfaceLightingBuffer = Shader.PropertyToID("_SubSurfaceLightingBuffer"); + public static readonly int _IndirectDiffuseLightingBuffer = Shader.PropertyToID("_IndirectDiffuseLightingBuffer"); // Accumulation - public static readonly int _AccumulationFrameIndex = Shader.PropertyToID("_AccumulationFrameIndex"); - public static readonly int _AccumulationNumSamples = Shader.PropertyToID("_AccumulationNumSamples"); - public static readonly int _AccumulationWeights = Shader.PropertyToID("_AccumulationWeights"); - public static readonly int _AccumulationNeedsExposure = Shader.PropertyToID("_AccumulationNeedsExposure"); - public static readonly int _RadianceTexture = Shader.PropertyToID("_RadianceTexture"); + public static readonly int _AccumulationFrameIndex = Shader.PropertyToID("_AccumulationFrameIndex"); + public static readonly int _AccumulationNumSamples = Shader.PropertyToID("_AccumulationNumSamples"); + public static readonly int _AccumulationWeights = Shader.PropertyToID("_AccumulationWeights"); + public static readonly int _AccumulationNeedsExposure = Shader.PropertyToID("_AccumulationNeedsExposure"); + public static readonly int _RadianceTexture = Shader.PropertyToID("_RadianceTexture"); // Preintegrated texture name public static readonly int _PreIntegratedFGD_GGXDisneyDiffuse = Shader.PropertyToID("_PreIntegratedFGD_GGXDisneyDiffuse"); public static readonly int _PreIntegratedFGD_CharlieAndFabric = Shader.PropertyToID("_PreIntegratedFGD_CharlieAndFabric"); - public static readonly int _ExposureTexture = Shader.PropertyToID("_ExposureTexture"); - public static readonly int _PrevExposureTexture = Shader.PropertyToID("_PrevExposureTexture"); - public static readonly int _PreviousExposureTexture = Shader.PropertyToID("_PreviousExposureTexture"); - public static readonly int _ExposureDebugTexture = Shader.PropertyToID("_ExposureDebugTexture"); - public static readonly int _ExposureParams = Shader.PropertyToID("_ExposureParams"); - public static readonly int _ExposureParams2 = Shader.PropertyToID("_ExposureParams2"); - public static readonly int _ExposureDebugParams = Shader.PropertyToID("_ExposureDebugParams"); - public static readonly int _HistogramExposureParams = Shader.PropertyToID("_HistogramExposureParams"); - public static readonly int _HistogramBuffer = Shader.PropertyToID("_HistogramBuffer"); - public static readonly int _FullImageHistogram = Shader.PropertyToID("_FullImageHistogram"); - public static readonly int _AdaptationParams = Shader.PropertyToID("_AdaptationParams"); - public static readonly int _ExposureCurveTexture = Shader.PropertyToID("_ExposureCurveTexture"); - public static readonly int _ExposureWeightMask = Shader.PropertyToID("_ExposureWeightMask"); - public static readonly int _ProceduralMaskParams = Shader.PropertyToID("_ProceduralMaskParams"); - public static readonly int _ProceduralMaskParams2 = Shader.PropertyToID("_ProceduralMaskParams2"); - public static readonly int _Variants = Shader.PropertyToID("_Variants"); - public static readonly int _InputTexture = Shader.PropertyToID("_InputTexture"); - public static readonly int _InputTextureMSAA = Shader.PropertyToID("_InputTextureMSAA"); - public static readonly int _OutputTexture = Shader.PropertyToID("_OutputTexture"); - public static readonly int _SourceTexture = Shader.PropertyToID("_SourceTexture"); - public static readonly int _InputHistoryTexture = Shader.PropertyToID("_InputHistoryTexture"); - public static readonly int _OutputHistoryTexture = Shader.PropertyToID("_OutputHistoryTexture"); - public static readonly int _InputVelocityMagnitudeHistory = Shader.PropertyToID("_InputVelocityMagnitudeHistory"); + public static readonly int _ExposureTexture = Shader.PropertyToID("_ExposureTexture"); + public static readonly int _PrevExposureTexture = Shader.PropertyToID("_PrevExposureTexture"); + public static readonly int _PreviousExposureTexture = Shader.PropertyToID("_PreviousExposureTexture"); + public static readonly int _ExposureDebugTexture = Shader.PropertyToID("_ExposureDebugTexture"); + public static readonly int _ExposureParams = Shader.PropertyToID("_ExposureParams"); + public static readonly int _ExposureParams2 = Shader.PropertyToID("_ExposureParams2"); + public static readonly int _ExposureDebugParams = Shader.PropertyToID("_ExposureDebugParams"); + public static readonly int _HistogramExposureParams = Shader.PropertyToID("_HistogramExposureParams"); + public static readonly int _HistogramBuffer = Shader.PropertyToID("_HistogramBuffer"); + public static readonly int _FullImageHistogram = Shader.PropertyToID("_FullImageHistogram"); + public static readonly int _AdaptationParams = Shader.PropertyToID("_AdaptationParams"); + public static readonly int _ExposureCurveTexture = Shader.PropertyToID("_ExposureCurveTexture"); + public static readonly int _ExposureWeightMask = Shader.PropertyToID("_ExposureWeightMask"); + public static readonly int _ProceduralMaskParams = Shader.PropertyToID("_ProceduralMaskParams"); + public static readonly int _ProceduralMaskParams2 = Shader.PropertyToID("_ProceduralMaskParams2"); + public static readonly int _Variants = Shader.PropertyToID("_Variants"); + public static readonly int _InputTexture = Shader.PropertyToID("_InputTexture"); + public static readonly int _InputTextureMSAA = Shader.PropertyToID("_InputTextureMSAA"); + public static readonly int _OutputTexture = Shader.PropertyToID("_OutputTexture"); + public static readonly int _SourceTexture = Shader.PropertyToID("_SourceTexture"); + public static readonly int _InputHistoryTexture = Shader.PropertyToID("_InputHistoryTexture"); + public static readonly int _OutputHistoryTexture = Shader.PropertyToID("_OutputHistoryTexture"); + public static readonly int _InputVelocityMagnitudeHistory = Shader.PropertyToID("_InputVelocityMagnitudeHistory"); public static readonly int _OutputVelocityMagnitudeHistory = Shader.PropertyToID("_OutputVelocityMagnitudeHistory"); - public static readonly int _TargetScale = Shader.PropertyToID("_TargetScale"); - public static readonly int _Params = Shader.PropertyToID("_Params"); - public static readonly int _Params1 = Shader.PropertyToID("_Params1"); - public static readonly int _Params2 = Shader.PropertyToID("_Params2"); - public static readonly int _BokehKernel = Shader.PropertyToID("_BokehKernel"); - public static readonly int _InputCoCTexture = Shader.PropertyToID("_InputCoCTexture"); - public static readonly int _InputHistoryCoCTexture = Shader.PropertyToID("_InputHistoryCoCTexture"); - public static readonly int _OutputCoCTexture = Shader.PropertyToID("_OutputCoCTexture"); - public static readonly int _OutputNearCoCTexture = Shader.PropertyToID("_OutputNearCoCTexture"); - public static readonly int _OutputNearTexture = Shader.PropertyToID("_OutputNearTexture"); - public static readonly int _OutputFarCoCTexture = Shader.PropertyToID("_OutputFarCoCTexture"); - public static readonly int _OutputFarTexture = Shader.PropertyToID("_OutputFarTexture"); - public static readonly int _OutputMip1 = Shader.PropertyToID("_OutputMip1"); - public static readonly int _OutputMip2 = Shader.PropertyToID("_OutputMip2"); - public static readonly int _OutputMip3 = Shader.PropertyToID("_OutputMip3"); - public static readonly int _OutputMip4 = Shader.PropertyToID("_OutputMip4"); - public static readonly int _OutputMip5 = Shader.PropertyToID("_OutputMip5"); - public static readonly int _OutputMip6 = Shader.PropertyToID("_OutputMip6"); - public static readonly int _IndirectBuffer = Shader.PropertyToID("_IndirectBuffer"); - public static readonly int _InputNearCoCTexture = Shader.PropertyToID("_InputNearCoCTexture"); - public static readonly int _NearTileList = Shader.PropertyToID("_NearTileList"); - public static readonly int _InputFarTexture = Shader.PropertyToID("_InputFarTexture"); - public static readonly int _InputNearTexture = Shader.PropertyToID("_InputNearTexture"); - public static readonly int _InputFarCoCTexture = Shader.PropertyToID("_InputFarCoCTexture"); - public static readonly int _FarTileList = Shader.PropertyToID("_FarTileList"); - public static readonly int _TileList = Shader.PropertyToID("_TileList"); - public static readonly int _TexelSize = Shader.PropertyToID("_TexelSize"); - public static readonly int _InputDilatedCoCTexture = Shader.PropertyToID("_InputDilatedCoCTexture"); - public static readonly int _OutputAlphaTexture = Shader.PropertyToID("_OutputAlphaTexture"); - public static readonly int _InputNearAlphaTexture = Shader.PropertyToID("_InputNearAlphaTexture"); - public static readonly int _CoCTargetScale = Shader.PropertyToID("_CoCTargetScale"); - public static readonly int _DepthMinMaxAvg = Shader.PropertyToID("_DepthMinMaxAvg"); - - public static readonly int _BloomParams = Shader.PropertyToID("_BloomParams"); - public static readonly int _BloomTint = Shader.PropertyToID("_BloomTint"); - public static readonly int _BloomTexture = Shader.PropertyToID("_BloomTexture"); - public static readonly int _BloomDirtTexture = Shader.PropertyToID("_BloomDirtTexture"); - public static readonly int _BloomDirtScaleOffset = Shader.PropertyToID("_BloomDirtScaleOffset"); - public static readonly int _InputLowTexture = Shader.PropertyToID("_InputLowTexture"); - public static readonly int _InputHighTexture = Shader.PropertyToID("_InputHighTexture"); - public static readonly int _BloomBicubicParams = Shader.PropertyToID("_BloomBicubicParams"); - public static readonly int _BloomThreshold = Shader.PropertyToID("_BloomThreshold"); - - public static readonly int _ChromaSpectralLut = Shader.PropertyToID("_ChromaSpectralLut"); - public static readonly int _ChromaParams = Shader.PropertyToID("_ChromaParams"); - - public static readonly int _AlphaScaleBias = Shader.PropertyToID("_AlphaScaleBias"); - - public static readonly int _VignetteParams1 = Shader.PropertyToID("_VignetteParams1"); - public static readonly int _VignetteParams2 = Shader.PropertyToID("_VignetteParams2"); - public static readonly int _VignetteColor = Shader.PropertyToID("_VignetteColor"); - public static readonly int _VignetteMask = Shader.PropertyToID("_VignetteMask"); - - public static readonly int _DistortionParams1 = Shader.PropertyToID("_DistortionParams1"); - public static readonly int _DistortionParams2 = Shader.PropertyToID("_DistortionParams2"); - - public static readonly int _LogLut3D = Shader.PropertyToID("_LogLut3D"); - public static readonly int _LogLut3D_Params = Shader.PropertyToID("_LogLut3D_Params"); - public static readonly int _ColorBalance = Shader.PropertyToID("_ColorBalance"); - public static readonly int _ColorFilter = Shader.PropertyToID("_ColorFilter"); - public static readonly int _ChannelMixerRed = Shader.PropertyToID("_ChannelMixerRed"); - public static readonly int _ChannelMixerGreen = Shader.PropertyToID("_ChannelMixerGreen"); - public static readonly int _ChannelMixerBlue = Shader.PropertyToID("_ChannelMixerBlue"); - public static readonly int _HueSatCon = Shader.PropertyToID("_HueSatCon"); - public static readonly int _Lift = Shader.PropertyToID("_Lift"); - public static readonly int _Gamma = Shader.PropertyToID("_Gamma"); - public static readonly int _Gain = Shader.PropertyToID("_Gain"); - public static readonly int _Shadows = Shader.PropertyToID("_Shadows"); - public static readonly int _Midtones = Shader.PropertyToID("_Midtones"); - public static readonly int _Highlights = Shader.PropertyToID("_Highlights"); - public static readonly int _ShaHiLimits = Shader.PropertyToID("_ShaHiLimits"); - public static readonly int _SplitShadows = Shader.PropertyToID("_SplitShadows"); - public static readonly int _SplitHighlights = Shader.PropertyToID("_SplitHighlights"); - public static readonly int _CurveMaster = Shader.PropertyToID("_CurveMaster"); - public static readonly int _CurveRed = Shader.PropertyToID("_CurveRed"); - public static readonly int _CurveGreen = Shader.PropertyToID("_CurveGreen"); - public static readonly int _CurveBlue = Shader.PropertyToID("_CurveBlue"); - public static readonly int _CurveHueVsHue = Shader.PropertyToID("_CurveHueVsHue"); - public static readonly int _CurveHueVsSat = Shader.PropertyToID("_CurveHueVsSat"); - public static readonly int _CurveSatVsSat = Shader.PropertyToID("_CurveSatVsSat"); - public static readonly int _CurveLumVsSat = Shader.PropertyToID("_CurveLumVsSat"); - - public static readonly int _CustomToneCurve = Shader.PropertyToID("_CustomToneCurve"); - public static readonly int _ToeSegmentA = Shader.PropertyToID("_ToeSegmentA"); - public static readonly int _ToeSegmentB = Shader.PropertyToID("_ToeSegmentB"); - public static readonly int _MidSegmentA = Shader.PropertyToID("_MidSegmentA"); - public static readonly int _MidSegmentB = Shader.PropertyToID("_MidSegmentB"); - public static readonly int _ShoSegmentA = Shader.PropertyToID("_ShoSegmentA"); - public static readonly int _ShoSegmentB = Shader.PropertyToID("_ShoSegmentB"); - - public static readonly int _Depth = Shader.PropertyToID("_Depth"); - public static readonly int _LinearZ = Shader.PropertyToID("_LinearZ"); - public static readonly int _DS2x = Shader.PropertyToID("_DS2x"); - public static readonly int _DS4x = Shader.PropertyToID("_DS4x"); - public static readonly int _DS8x = Shader.PropertyToID("_DS8x"); - public static readonly int _DS16x = Shader.PropertyToID("_DS16x"); - public static readonly int _DS2xAtlas = Shader.PropertyToID("_DS2xAtlas"); - public static readonly int _DS4xAtlas = Shader.PropertyToID("_DS4xAtlas"); - public static readonly int _DS8xAtlas = Shader.PropertyToID("_DS8xAtlas"); - public static readonly int _DS16xAtlas = Shader.PropertyToID("_DS16xAtlas"); - public static readonly int _InvThicknessTable = Shader.PropertyToID("_InvThicknessTable"); - public static readonly int _SampleWeightTable = Shader.PropertyToID("_SampleWeightTable"); - public static readonly int _InvSliceDimension = Shader.PropertyToID("_InvSliceDimension"); - public static readonly int _AdditionalParams = Shader.PropertyToID("_AdditionalParams"); - public static readonly int _Occlusion = Shader.PropertyToID("_Occlusion"); - public static readonly int _InvLowResolution = Shader.PropertyToID("_InvLowResolution"); - public static readonly int _InvHighResolution = Shader.PropertyToID("_InvHighResolution"); - public static readonly int _LoResDB = Shader.PropertyToID("_LoResDB"); - public static readonly int _HiResDB = Shader.PropertyToID("_HiResDB"); - public static readonly int _LoResAO1 = Shader.PropertyToID("_LoResAO1"); - public static readonly int _HiResAO = Shader.PropertyToID("_HiResAO"); - public static readonly int _AoResult = Shader.PropertyToID("_AoResult"); - - public static readonly int _GrainTexture = Shader.PropertyToID("_GrainTexture"); - public static readonly int _GrainParams = Shader.PropertyToID("_GrainParams"); - public static readonly int _GrainTextureParams = Shader.PropertyToID("_GrainTextureParams"); - public static readonly int _BlueNoiseTexture = Shader.PropertyToID("_BlueNoiseTexture"); - public static readonly int _AlphaTexture = Shader.PropertyToID("_AlphaTexture"); - public static readonly int _OwenScrambledRGTexture = Shader.PropertyToID("_OwenScrambledRGTexture"); - public static readonly int _OwenScrambledTexture = Shader.PropertyToID("_OwenScrambledTexture"); - public static readonly int _ScramblingTileXSPP = Shader.PropertyToID("_ScramblingTileXSPP"); - public static readonly int _RankingTileXSPP = Shader.PropertyToID("_RankingTileXSPP"); - public static readonly int _ScramblingTexture = Shader.PropertyToID("_ScramblingTexture"); - public static readonly int _AfterPostProcessTexture = Shader.PropertyToID("_AfterPostProcessTexture"); - public static readonly int _DitherParams = Shader.PropertyToID("_DitherParams"); - public static readonly int _KeepAlpha = Shader.PropertyToID("_KeepAlpha"); - public static readonly int _UVTransform = Shader.PropertyToID("_UVTransform"); - - public static readonly int _MotionVecAndDepth = Shader.PropertyToID("_MotionVecAndDepth"); - public static readonly int _TileMinMaxMotionVec = Shader.PropertyToID("_TileMinMaxMotionVec"); - public static readonly int _TileMaxNeighbourhood = Shader.PropertyToID("_TileMaxNeighbourhood"); - public static readonly int _TileToScatterMax = Shader.PropertyToID("_TileToScatterMax"); - public static readonly int _TileToScatterMin = Shader.PropertyToID("_TileToScatterMin"); - public static readonly int _TileTargetSize = Shader.PropertyToID("_TileTargetSize"); - public static readonly int _MotionBlurParams = Shader.PropertyToID("_MotionBlurParams0"); - public static readonly int _MotionBlurParams1 = Shader.PropertyToID("_MotionBlurParams1"); - public static readonly int _MotionBlurParams2 = Shader.PropertyToID("_MotionBlurParams2"); - public static readonly int _MotionBlurParams3 = Shader.PropertyToID("_MotionBlurParams3"); - public static readonly int _PrevVPMatrixNoTranslation = Shader.PropertyToID("_PrevVPMatrixNoTranslation"); - public static readonly int _CurrVPMatrixNoTranslation = Shader.PropertyToID("_CurrVPMatrixNoTranslation"); - - public static readonly int _SMAAAreaTex = Shader.PropertyToID("_AreaTex"); - public static readonly int _SMAASearchTex = Shader.PropertyToID("_SearchTex"); - public static readonly int _SMAABlendTex = Shader.PropertyToID("_BlendTex"); - public static readonly int _SMAARTMetrics = Shader.PropertyToID("_SMAARTMetrics"); - - public static readonly int _LowResDepthTexture = Shader.PropertyToID("_LowResDepthTexture"); - public static readonly int _LowResTransparent = Shader.PropertyToID("_LowResTransparent"); + public static readonly int _TargetScale = Shader.PropertyToID("_TargetScale"); + public static readonly int _Params = Shader.PropertyToID("_Params"); + public static readonly int _Params1 = Shader.PropertyToID("_Params1"); + public static readonly int _Params2 = Shader.PropertyToID("_Params2"); + public static readonly int _BokehKernel = Shader.PropertyToID("_BokehKernel"); + public static readonly int _InputCoCTexture = Shader.PropertyToID("_InputCoCTexture"); + public static readonly int _InputHistoryCoCTexture = Shader.PropertyToID("_InputHistoryCoCTexture"); + public static readonly int _OutputCoCTexture = Shader.PropertyToID("_OutputCoCTexture"); + public static readonly int _OutputNearCoCTexture = Shader.PropertyToID("_OutputNearCoCTexture"); + public static readonly int _OutputNearTexture = Shader.PropertyToID("_OutputNearTexture"); + public static readonly int _OutputFarCoCTexture = Shader.PropertyToID("_OutputFarCoCTexture"); + public static readonly int _OutputFarTexture = Shader.PropertyToID("_OutputFarTexture"); + public static readonly int _OutputMip1 = Shader.PropertyToID("_OutputMip1"); + public static readonly int _OutputMip2 = Shader.PropertyToID("_OutputMip2"); + public static readonly int _OutputMip3 = Shader.PropertyToID("_OutputMip3"); + public static readonly int _OutputMip4 = Shader.PropertyToID("_OutputMip4"); + public static readonly int _OutputMip5 = Shader.PropertyToID("_OutputMip5"); + public static readonly int _OutputMip6 = Shader.PropertyToID("_OutputMip6"); + public static readonly int _IndirectBuffer = Shader.PropertyToID("_IndirectBuffer"); + public static readonly int _InputNearCoCTexture = Shader.PropertyToID("_InputNearCoCTexture"); + public static readonly int _NearTileList = Shader.PropertyToID("_NearTileList"); + public static readonly int _InputFarTexture = Shader.PropertyToID("_InputFarTexture"); + public static readonly int _InputNearTexture = Shader.PropertyToID("_InputNearTexture"); + public static readonly int _InputFarCoCTexture = Shader.PropertyToID("_InputFarCoCTexture"); + public static readonly int _FarTileList = Shader.PropertyToID("_FarTileList"); + public static readonly int _TileList = Shader.PropertyToID("_TileList"); + public static readonly int _TexelSize = Shader.PropertyToID("_TexelSize"); + public static readonly int _InputDilatedCoCTexture = Shader.PropertyToID("_InputDilatedCoCTexture"); + public static readonly int _OutputAlphaTexture = Shader.PropertyToID("_OutputAlphaTexture"); + public static readonly int _InputNearAlphaTexture = Shader.PropertyToID("_InputNearAlphaTexture"); + public static readonly int _CoCTargetScale = Shader.PropertyToID("_CoCTargetScale"); + public static readonly int _DepthMinMaxAvg = Shader.PropertyToID("_DepthMinMaxAvg"); + + public static readonly int _BloomParams = Shader.PropertyToID("_BloomParams"); + public static readonly int _BloomTint = Shader.PropertyToID("_BloomTint"); + public static readonly int _BloomTexture = Shader.PropertyToID("_BloomTexture"); + public static readonly int _BloomDirtTexture = Shader.PropertyToID("_BloomDirtTexture"); + public static readonly int _BloomDirtScaleOffset = Shader.PropertyToID("_BloomDirtScaleOffset"); + public static readonly int _InputLowTexture = Shader.PropertyToID("_InputLowTexture"); + public static readonly int _InputHighTexture = Shader.PropertyToID("_InputHighTexture"); + public static readonly int _BloomBicubicParams = Shader.PropertyToID("_BloomBicubicParams"); + public static readonly int _BloomThreshold = Shader.PropertyToID("_BloomThreshold"); + + public static readonly int _ChromaSpectralLut = Shader.PropertyToID("_ChromaSpectralLut"); + public static readonly int _ChromaParams = Shader.PropertyToID("_ChromaParams"); + + public static readonly int _AlphaScaleBias = Shader.PropertyToID("_AlphaScaleBias"); + + public static readonly int _VignetteParams1 = Shader.PropertyToID("_VignetteParams1"); + public static readonly int _VignetteParams2 = Shader.PropertyToID("_VignetteParams2"); + public static readonly int _VignetteColor = Shader.PropertyToID("_VignetteColor"); + public static readonly int _VignetteMask = Shader.PropertyToID("_VignetteMask"); + + public static readonly int _DistortionParams1 = Shader.PropertyToID("_DistortionParams1"); + public static readonly int _DistortionParams2 = Shader.PropertyToID("_DistortionParams2"); + + public static readonly int _LogLut3D = Shader.PropertyToID("_LogLut3D"); + public static readonly int _LogLut3D_Params = Shader.PropertyToID("_LogLut3D_Params"); + public static readonly int _ColorBalance = Shader.PropertyToID("_ColorBalance"); + public static readonly int _ColorFilter = Shader.PropertyToID("_ColorFilter"); + public static readonly int _ChannelMixerRed = Shader.PropertyToID("_ChannelMixerRed"); + public static readonly int _ChannelMixerGreen = Shader.PropertyToID("_ChannelMixerGreen"); + public static readonly int _ChannelMixerBlue = Shader.PropertyToID("_ChannelMixerBlue"); + public static readonly int _HueSatCon = Shader.PropertyToID("_HueSatCon"); + public static readonly int _Lift = Shader.PropertyToID("_Lift"); + public static readonly int _Gamma = Shader.PropertyToID("_Gamma"); + public static readonly int _Gain = Shader.PropertyToID("_Gain"); + public static readonly int _Shadows = Shader.PropertyToID("_Shadows"); + public static readonly int _Midtones = Shader.PropertyToID("_Midtones"); + public static readonly int _Highlights = Shader.PropertyToID("_Highlights"); + public static readonly int _ShaHiLimits = Shader.PropertyToID("_ShaHiLimits"); + public static readonly int _SplitShadows = Shader.PropertyToID("_SplitShadows"); + public static readonly int _SplitHighlights = Shader.PropertyToID("_SplitHighlights"); + public static readonly int _CurveMaster = Shader.PropertyToID("_CurveMaster"); + public static readonly int _CurveRed = Shader.PropertyToID("_CurveRed"); + public static readonly int _CurveGreen = Shader.PropertyToID("_CurveGreen"); + public static readonly int _CurveBlue = Shader.PropertyToID("_CurveBlue"); + public static readonly int _CurveHueVsHue = Shader.PropertyToID("_CurveHueVsHue"); + public static readonly int _CurveHueVsSat = Shader.PropertyToID("_CurveHueVsSat"); + public static readonly int _CurveSatVsSat = Shader.PropertyToID("_CurveSatVsSat"); + public static readonly int _CurveLumVsSat = Shader.PropertyToID("_CurveLumVsSat"); + + public static readonly int _CustomToneCurve = Shader.PropertyToID("_CustomToneCurve"); + public static readonly int _ToeSegmentA = Shader.PropertyToID("_ToeSegmentA"); + public static readonly int _ToeSegmentB = Shader.PropertyToID("_ToeSegmentB"); + public static readonly int _MidSegmentA = Shader.PropertyToID("_MidSegmentA"); + public static readonly int _MidSegmentB = Shader.PropertyToID("_MidSegmentB"); + public static readonly int _ShoSegmentA = Shader.PropertyToID("_ShoSegmentA"); + public static readonly int _ShoSegmentB = Shader.PropertyToID("_ShoSegmentB"); + + public static readonly int _Depth = Shader.PropertyToID("_Depth"); + public static readonly int _LinearZ = Shader.PropertyToID("_LinearZ"); + public static readonly int _DS2x = Shader.PropertyToID("_DS2x"); + public static readonly int _DS4x = Shader.PropertyToID("_DS4x"); + public static readonly int _DS8x = Shader.PropertyToID("_DS8x"); + public static readonly int _DS16x = Shader.PropertyToID("_DS16x"); + public static readonly int _DS2xAtlas = Shader.PropertyToID("_DS2xAtlas"); + public static readonly int _DS4xAtlas = Shader.PropertyToID("_DS4xAtlas"); + public static readonly int _DS8xAtlas = Shader.PropertyToID("_DS8xAtlas"); + public static readonly int _DS16xAtlas = Shader.PropertyToID("_DS16xAtlas"); + public static readonly int _InvThicknessTable = Shader.PropertyToID("_InvThicknessTable"); + public static readonly int _SampleWeightTable = Shader.PropertyToID("_SampleWeightTable"); + public static readonly int _InvSliceDimension = Shader.PropertyToID("_InvSliceDimension"); + public static readonly int _AdditionalParams = Shader.PropertyToID("_AdditionalParams"); + public static readonly int _Occlusion = Shader.PropertyToID("_Occlusion"); + public static readonly int _InvLowResolution = Shader.PropertyToID("_InvLowResolution"); + public static readonly int _InvHighResolution = Shader.PropertyToID("_InvHighResolution"); + public static readonly int _LoResDB = Shader.PropertyToID("_LoResDB"); + public static readonly int _HiResDB = Shader.PropertyToID("_HiResDB"); + public static readonly int _LoResAO1 = Shader.PropertyToID("_LoResAO1"); + public static readonly int _HiResAO = Shader.PropertyToID("_HiResAO"); + public static readonly int _AoResult = Shader.PropertyToID("_AoResult"); + + public static readonly int _GrainTexture = Shader.PropertyToID("_GrainTexture"); + public static readonly int _GrainParams = Shader.PropertyToID("_GrainParams"); + public static readonly int _GrainTextureParams = Shader.PropertyToID("_GrainTextureParams"); + public static readonly int _BlueNoiseTexture = Shader.PropertyToID("_BlueNoiseTexture"); + public static readonly int _AlphaTexture = Shader.PropertyToID("_AlphaTexture"); + public static readonly int _OwenScrambledRGTexture = Shader.PropertyToID("_OwenScrambledRGTexture"); + public static readonly int _OwenScrambledTexture = Shader.PropertyToID("_OwenScrambledTexture"); + public static readonly int _ScramblingTileXSPP = Shader.PropertyToID("_ScramblingTileXSPP"); + public static readonly int _RankingTileXSPP = Shader.PropertyToID("_RankingTileXSPP"); + public static readonly int _ScramblingTexture = Shader.PropertyToID("_ScramblingTexture"); + public static readonly int _AfterPostProcessTexture = Shader.PropertyToID("_AfterPostProcessTexture"); + public static readonly int _DitherParams = Shader.PropertyToID("_DitherParams"); + public static readonly int _KeepAlpha = Shader.PropertyToID("_KeepAlpha"); + public static readonly int _UVTransform = Shader.PropertyToID("_UVTransform"); + + public static readonly int _MotionVecAndDepth = Shader.PropertyToID("_MotionVecAndDepth"); + public static readonly int _TileMinMaxMotionVec = Shader.PropertyToID("_TileMinMaxMotionVec"); + public static readonly int _TileMaxNeighbourhood = Shader.PropertyToID("_TileMaxNeighbourhood"); + public static readonly int _TileToScatterMax = Shader.PropertyToID("_TileToScatterMax"); + public static readonly int _TileToScatterMin = Shader.PropertyToID("_TileToScatterMin"); + public static readonly int _TileTargetSize = Shader.PropertyToID("_TileTargetSize"); + public static readonly int _MotionBlurParams = Shader.PropertyToID("_MotionBlurParams0"); + public static readonly int _MotionBlurParams1 = Shader.PropertyToID("_MotionBlurParams1"); + public static readonly int _MotionBlurParams2 = Shader.PropertyToID("_MotionBlurParams2"); + public static readonly int _MotionBlurParams3 = Shader.PropertyToID("_MotionBlurParams3"); + public static readonly int _PrevVPMatrixNoTranslation = Shader.PropertyToID("_PrevVPMatrixNoTranslation"); + public static readonly int _CurrVPMatrixNoTranslation = Shader.PropertyToID("_CurrVPMatrixNoTranslation"); + + public static readonly int _SMAAAreaTex = Shader.PropertyToID("_AreaTex"); + public static readonly int _SMAASearchTex = Shader.PropertyToID("_SearchTex"); + public static readonly int _SMAABlendTex = Shader.PropertyToID("_BlendTex"); + public static readonly int _SMAARTMetrics = Shader.PropertyToID("_SMAARTMetrics"); + + public static readonly int _LowResDepthTexture = Shader.PropertyToID("_LowResDepthTexture"); + public static readonly int _LowResTransparent = Shader.PropertyToID("_LowResTransparent"); public static readonly int _ShaderVariablesAmbientOcclusion = Shader.PropertyToID("ShaderVariablesAmbientOcclusion"); - public static readonly int _OcclusionTexture = Shader.PropertyToID("_OcclusionTexture"); - public static readonly int _BentNormalsTexture = Shader.PropertyToID("_BentNormalsTexture"); - public static readonly int _AOPackedData = Shader.PropertyToID("_AOPackedData"); - public static readonly int _AOPackedHistory = Shader.PropertyToID("_AOPackedHistory"); - public static readonly int _AOPackedBlurred = Shader.PropertyToID("_AOPackedBlurred"); - public static readonly int _AOOutputHistory = Shader.PropertyToID("_AOOutputHistory"); + public static readonly int _OcclusionTexture = Shader.PropertyToID("_OcclusionTexture"); + public static readonly int _BentNormalsTexture = Shader.PropertyToID("_BentNormalsTexture"); + public static readonly int _AOPackedData = Shader.PropertyToID("_AOPackedData"); + public static readonly int _AOPackedHistory = Shader.PropertyToID("_AOPackedHistory"); + public static readonly int _AOPackedBlurred = Shader.PropertyToID("_AOPackedBlurred"); + public static readonly int _AOOutputHistory = Shader.PropertyToID("_AOOutputHistory"); // Contrast Adaptive Sharpening - public static readonly int _Sharpness = Shader.PropertyToID("Sharpness"); - public static readonly int _InputTextureDimensions = Shader.PropertyToID("InputTextureDimensions"); - public static readonly int _OutputTextureDimensions = Shader.PropertyToID("OutputTextureDimensions"); + public static readonly int _Sharpness = Shader.PropertyToID("Sharpness"); + public static readonly int _InputTextureDimensions = Shader.PropertyToID("InputTextureDimensions"); + public static readonly int _OutputTextureDimensions = Shader.PropertyToID("OutputTextureDimensions"); // BlitCubeTextureFace.shader - public static readonly int _InputTex = Shader.PropertyToID("_InputTex"); - public static readonly int _LoD = Shader.PropertyToID("_LoD"); - public static readonly int _FaceIndex = Shader.PropertyToID("_FaceIndex"); + public static readonly int _InputTex = Shader.PropertyToID("_InputTex"); + public static readonly int _LoD = Shader.PropertyToID("_LoD"); + public static readonly int _FaceIndex = Shader.PropertyToID("_FaceIndex"); // Custom Pass Utils API - public static readonly int _SourceScaleBias = Shader.PropertyToID("_SourceScaleBias"); - public static readonly int _GaussianWeights = Shader.PropertyToID("_GaussianWeights"); - public static readonly int _SampleCount = Shader.PropertyToID("_SampleCount"); - public static readonly int _Radius = Shader.PropertyToID("_Radius"); - public static readonly int _ViewPortSize = Shader.PropertyToID("_ViewPortSize"); - public static readonly int _ViewportScaleBias = Shader.PropertyToID("_ViewportScaleBias"); - public static readonly int _SourceSize = Shader.PropertyToID("_SourceSize"); - public static readonly int _SourceScaleFactor = Shader.PropertyToID("_SourceScaleFactor"); + public static readonly int _SourceScaleBias = Shader.PropertyToID("_SourceScaleBias"); + public static readonly int _GaussianWeights = Shader.PropertyToID("_GaussianWeights"); + public static readonly int _SampleCount = Shader.PropertyToID("_SampleCount"); + public static readonly int _Radius = Shader.PropertyToID("_Radius"); + public static readonly int _ViewPortSize = Shader.PropertyToID("_ViewPortSize"); + public static readonly int _ViewportScaleBias = Shader.PropertyToID("_ViewportScaleBias"); + public static readonly int _SourceSize = Shader.PropertyToID("_SourceSize"); + public static readonly int _SourceScaleFactor = Shader.PropertyToID("_SourceScaleFactor"); // Probe Volumes - public static readonly int _ProbeVolumeAtlasSH = Shader.PropertyToID("_ProbeVolumeAtlasSH"); + public static readonly int _ProbeVolumeAtlasSH = Shader.PropertyToID("_ProbeVolumeAtlasSH"); public static readonly int _ProbeVolumeAtlasResolutionAndSliceCount = Shader.PropertyToID("_ProbeVolumeAtlasResolutionAndSliceCount"); public static readonly int _ProbeVolumeAtlasResolutionAndSliceCountInverse = Shader.PropertyToID("_ProbeVolumeAtlasResolutionAndSliceCountInverse"); public static readonly int _ProbeVolumeAtlasOctahedralDepth = Shader.PropertyToID("_ProbeVolumeAtlasOctahedralDepth"); - public static readonly int _ProbeVolumeResolution = Shader.PropertyToID("_ProbeVolumeResolution"); - public static readonly int _ProbeVolumeResolutionInverse = Shader.PropertyToID("_ProbeVolumeResolutionInverse"); - public static readonly int _ProbeVolumeAtlasScale = Shader.PropertyToID("_ProbeVolumeAtlasScale"); - public static readonly int _ProbeVolumeAtlasBias = Shader.PropertyToID("_ProbeVolumeAtlasBias"); + public static readonly int _ProbeVolumeResolution = Shader.PropertyToID("_ProbeVolumeResolution"); + public static readonly int _ProbeVolumeResolutionInverse = Shader.PropertyToID("_ProbeVolumeResolutionInverse"); + public static readonly int _ProbeVolumeAtlasScale = Shader.PropertyToID("_ProbeVolumeAtlasScale"); + public static readonly int _ProbeVolumeAtlasBias = Shader.PropertyToID("_ProbeVolumeAtlasBias"); public static readonly int _ProbeVolumeAtlasReadBufferCount = Shader.PropertyToID("_ProbeVolumeAtlasReadBufferCount"); public static readonly int _ProbeVolumeAtlasReadSHL01Buffer = Shader.PropertyToID("_ProbeVolumeAtlasReadSHL01Buffer"); public static readonly int _ProbeVolumeAtlasReadSHL2Buffer = Shader.PropertyToID("_ProbeVolumeAtlasReadSHL2Buffer"); @@ -920,16 +920,16 @@ static class HDShaderIDs public static readonly int _ProbeVolumeAtlasOctahedralDepthWriteTexture = Shader.PropertyToID("_ProbeVolumeAtlasOctahedralDepthWriteTexture"); public static readonly int _ProbeVolumeAtlasOctahedralDepthScaleBiasTexels = Shader.PropertyToID("_ProbeVolumeAtlasOctahedralDepthScaleBiasTexels"); public static readonly int _ProbeVolumeAtlasOctahedralDepthRWTexture = Shader.PropertyToID("_ProbeVolumeAtlasOctahedralDepthRWTexture"); - public static readonly int _FilterSampleCount = Shader.PropertyToID("_FilterSampleCount"); - public static readonly int _FilterSharpness = Shader.PropertyToID("_FilterSharpness"); - public static readonly int _AtlasTextureSH = Shader.PropertyToID("_AtlasTextureSH"); - public static readonly int _TextureViewScale = Shader.PropertyToID("_TextureViewScale"); - public static readonly int _TextureViewBias = Shader.PropertyToID("_TextureViewBias"); - public static readonly int _TextureViewResolution = Shader.PropertyToID("_TextureViewResolution"); - public static readonly int _AtlasTextureOctahedralDepth = Shader.PropertyToID("_AtlasTextureOctahedralDepth"); + public static readonly int _FilterSampleCount = Shader.PropertyToID("_FilterSampleCount"); + public static readonly int _FilterSharpness = Shader.PropertyToID("_FilterSharpness"); + public static readonly int _AtlasTextureSH = Shader.PropertyToID("_AtlasTextureSH"); + public static readonly int _TextureViewScale = Shader.PropertyToID("_TextureViewScale"); + public static readonly int _TextureViewBias = Shader.PropertyToID("_TextureViewBias"); + public static readonly int _TextureViewResolution = Shader.PropertyToID("_TextureViewResolution"); + public static readonly int _AtlasTextureOctahedralDepth = Shader.PropertyToID("_AtlasTextureOctahedralDepth"); public static readonly int _AtlasTextureOctahedralDepthScaleBias = Shader.PropertyToID("_AtlasTextureOctahedralDepthScaleBias"); - public static readonly int _ValidRange = Shader.PropertyToID("_ValidRange"); - public static readonly int _ProbeVolumeAtlasSliceMode = Shader.PropertyToID("_ProbeVolumeAtlasSliceMode"); + public static readonly int _ValidRange = Shader.PropertyToID("_ValidRange"); + public static readonly int _ProbeVolumeAtlasSliceMode = Shader.PropertyToID("_ProbeVolumeAtlasSliceMode"); } /// @@ -998,9 +998,9 @@ public static class HDMaterialProperties public const string kDepthOffsetEnable = "_DepthOffsetEnable"; /// Enable affect Albedo (decal only). - public const string kAffectAlbedo = "_AffectAlbedo"; + public const string kAffectAlbedo = "_AffectAlbedo"; /// Enable affect Normal (decal only. - public const string kAffectNormal = "_AffectNormal"; + public const string kAffectNormal = "_AffectNormal"; /// Enable affect AO (decal only. public const string kAffectAO = "_AffectAO"; /// Enable affect Metal (decal only. diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/PathTracing/PathTracing.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/PathTracing/PathTracing.cs index 51d2d4263b7..b4b44f648de 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/PathTracing/PathTracing.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/PathTracing/PathTracing.cs @@ -68,7 +68,7 @@ public partial class HDRenderPipeline uint m_CacheMaxIteration = 0; #endif // UNITY_EDITOR ulong m_CacheAccelSize = 0; - uint m_CacheLightCount = 0; + uint m_CacheLightCount = 0; RTHandle m_RadianceTexture; // stores the per-pixel results of path tracing for this frame @@ -234,17 +234,17 @@ static RTHandle PathTracingHistoryBufferAllocatorFunction(string viewName, int f struct PathTracingParameters { - public RayTracingShader pathTracingShader; - public CameraData cameraData; - public BlueNoise.DitheredTextureSet ditheredTextureSet; - public ShaderVariablesRaytracing shaderVariablesRaytracingCB; - public Color backgroundColor; - public Texture skyReflection; - public Matrix4x4 pixelCoordToViewDirWS; - public Vector4 dofParameters; - public int width, height; - public RayTracingAccelerationStructure accelerationStructure; - public HDRaytracingLightCluster lightCluster; + public RayTracingShader pathTracingShader; + public CameraData cameraData; + public BlueNoise.DitheredTextureSet ditheredTextureSet; + public ShaderVariablesRaytracing shaderVariablesRaytracingCB; + public Color backgroundColor; + public Texture skyReflection; + public Matrix4x4 pixelCoordToViewDirWS; + public Vector4 dofParameters; + public int width, height; + public RayTracingAccelerationStructure accelerationStructure; + public HDRaytracingLightCluster lightCluster; } PathTracingParameters PreparePathTracingParameters(HDCamera hdCamera) diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/HDDiffuseShadowDenoiser.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/HDDiffuseShadowDenoiser.cs index 5be12918884..9676f379c9a 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/HDDiffuseShadowDenoiser.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/HDDiffuseShadowDenoiser.cs @@ -30,7 +30,7 @@ public void Init(HDRenderPipelineRayTracingResources rpRTResources) m_BilateralFilterVSingleDirectionalKernel = m_ShadowDenoiser.FindKernel("BilateralFilterVSingleDirectional"); m_BilateralFilterHColorDirectionalKernel = m_ShadowDenoiser.FindKernel("BilateralFilterHColorDirectional"); - m_BilateralFilterVColorDirectionalKernel = m_ShadowDenoiser.FindKernel("BilateralFilterVColorDirectional"); + m_BilateralFilterVColorDirectionalKernel = m_ShadowDenoiser.FindKernel("BilateralFilterVColorDirectional"); m_BilateralFilterHSingleSphereKernel = m_ShadowDenoiser.FindKernel("BilateralFilterHSingleSphere"); m_BilateralFilterVSingleSphereKernel = m_ShadowDenoiser.FindKernel("BilateralFilterVSingleSphere"); @@ -168,11 +168,11 @@ public TextureHandle DenoiseBufferDirectional(RenderGraph renderGraph, HDCamera // Temporary buffers passData.intermediateBuffer = builder.CreateTransientTexture(new TextureDesc(Vector2.one, true, true) - { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, enableRandomWrite = true, name = "Intermediate buffer" }); + { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, enableRandomWrite = true, name = "Intermediate buffer" }); // Output buffer passData.outputBuffer = builder.ReadWriteTexture(renderGraph.CreateTexture(new TextureDesc(Vector2.one, true, true) - { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, enableRandomWrite = true, name = "Denoised Buffer" })); + { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, enableRandomWrite = true, name = "Denoised Buffer" })); builder.SetRenderFunc( @@ -328,11 +328,11 @@ public TextureHandle DenoiseBufferSphere(RenderGraph renderGraph, HDCamera hdCam // Temporary buffers passData.intermediateBuffer = builder.CreateTransientTexture(new TextureDesc(Vector2.one, true, true) - { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, enableRandomWrite = true, name = "Intermediate buffer" }); + { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, enableRandomWrite = true, name = "Intermediate buffer" }); // Output buffer passData.outputBuffer = builder.ReadWriteTexture(renderGraph.CreateTexture(new TextureDesc(Vector2.one, true, true) - { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, enableRandomWrite = true, name = "Denoised Buffer" })); + { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, enableRandomWrite = true, name = "Denoised Buffer" })); builder.SetRenderFunc( diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/HDRaytracingAmbientOcclusion.RenderGraph.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/HDRaytracingAmbientOcclusion.RenderGraph.cs index c635856d362..23657ebd7ec 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/HDRaytracingAmbientOcclusion.RenderGraph.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/HDRaytracingAmbientOcclusion.RenderGraph.cs @@ -65,9 +65,9 @@ TraceAmbientOcclusionResult TraceAO(RenderGraph renderGraph, in AmbientOcclusion passData.rayCountTexture = builder.ReadWriteTexture(rayCountTexture); // Depending of if we will have to denoise (or not), we need to allocate the final format, or a bigger texture passData.outputTexture = builder.WriteTexture(renderGraph.CreateTexture(new TextureDesc(Vector2.one, true, true) - { colorFormat = GraphicsFormat.R8_UNorm, enableRandomWrite = true, name = "Ray Traced Ambient Occlusion" })); + { colorFormat = GraphicsFormat.R8_UNorm, enableRandomWrite = true, name = "Ray Traced Ambient Occlusion" })); passData.velocityBuffer = builder.ReadWriteTexture(renderGraph.CreateTexture(new TextureDesc(Vector2.one, true, true) - { colorFormat = GraphicsFormat.R8_SNorm, enableRandomWrite = true, name = "Velocity Buffer" })); + { colorFormat = GraphicsFormat.R8_SNorm, enableRandomWrite = true, name = "Velocity Buffer" })); builder.SetRenderFunc( (TraceRTAOPassData data, RenderGraphContext ctx) => diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/HDRaytracingDeferredLightLoop.RenderGraph.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/HDRaytracingDeferredLightLoop.RenderGraph.cs index d3e9ba0248d..110cfbcbd0c 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/HDRaytracingDeferredLightLoop.RenderGraph.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/HDRaytracingDeferredLightLoop.RenderGraph.cs @@ -38,20 +38,20 @@ TextureHandle DeferredLightingRT(RenderGraph renderGraph, in DeferredLightingRTP // Temporary buffers passData.gbuffer0 = builder.CreateTransientTexture(new TextureDesc(Vector2.one, true, true) - { colorFormat = GraphicsFormat.R8G8B8A8_SRGB, enableRandomWrite = true, name = "GBuffer0" }); + { colorFormat = GraphicsFormat.R8G8B8A8_SRGB, enableRandomWrite = true, name = "GBuffer0" }); passData.gbuffer1 = builder.CreateTransientTexture(new TextureDesc(Vector2.one, true, true) - { colorFormat = GraphicsFormat.R8G8B8A8_UNorm, enableRandomWrite = true, name = "GBuffer1" }); + { colorFormat = GraphicsFormat.R8G8B8A8_UNorm, enableRandomWrite = true, name = "GBuffer1" }); passData.gbuffer2 = builder.CreateTransientTexture(new TextureDesc(Vector2.one, true, true) - { colorFormat = GraphicsFormat.R8G8B8A8_UNorm, enableRandomWrite = true, name = "GBuffer2" }); + { colorFormat = GraphicsFormat.R8G8B8A8_UNorm, enableRandomWrite = true, name = "GBuffer2" }); passData.gbuffer3 = builder.CreateTransientTexture(new TextureDesc(Vector2.one, true, true) - { colorFormat = Builtin.GetLightingBufferFormat(), enableRandomWrite = true, name = "GBuffer3" }); + { colorFormat = Builtin.GetLightingBufferFormat(), enableRandomWrite = true, name = "GBuffer3" }); passData.distanceBuffer = builder.CreateTransientTexture(new TextureDesc(Vector2.one, true, true) - { colorFormat = GraphicsFormat.R32_SFloat, enableRandomWrite = true, name = "Distance Buffer" }); + { colorFormat = GraphicsFormat.R32_SFloat, enableRandomWrite = true, name = "Distance Buffer" }); // Output buffers passData.rayCountTexture = builder.ReadWriteTexture(rayCountTexture); passData.litBuffer = builder.WriteTexture(renderGraph.CreateTexture(new TextureDesc(Vector2.one, true, true) - { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, enableRandomWrite = true, name = "Deferred Lighting Result" })); + { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, enableRandomWrite = true, name = "Deferred Lighting Result" })); builder.SetRenderFunc( (DeferredLightingRTRPassData data, RenderGraphContext ctx) => diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/HDRaytracingDeferredLightLoop.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/HDRaytracingDeferredLightLoop.cs index 44aa8788418..c8eb548350a 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/HDRaytracingDeferredLightLoop.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/HDRaytracingDeferredLightLoop.cs @@ -146,7 +146,7 @@ static void RenderRaytracingDeferredLighting(CommandBuffer cmd, in DeferredLight if (parameters.rayBinning) { - BinRays(cmd, parameters, buffers.directionBuffer, texWidth, texHeight); + BinRays(cmd, parameters, buffers.directionBuffer, texWidth, texHeight); } // Inject the global parameters diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/HDRaytracingIndirectDiffuse.RenderGraph.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/HDRaytracingIndirectDiffuse.RenderGraph.cs index 17abee3f05c..e95c1cb6e34 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/HDRaytracingIndirectDiffuse.RenderGraph.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/HDRaytracingIndirectDiffuse.RenderGraph.cs @@ -23,7 +23,7 @@ TextureHandle DirGenRTGI(RenderGraph renderGraph, in RTIndirectDiffuseDirGenPara passData.depthStencilBuffer = builder.ReadTexture(depthPyramid); passData.normalBuffer = builder.ReadTexture(normalBuffer); passData.outputBuffer = builder.WriteTexture(renderGraph.CreateTexture(new TextureDesc(Vector2.one, true, true) - { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, enableRandomWrite = true, name = "GI Ray Directions" })); + { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, enableRandomWrite = true, name = "GI Ray Directions" })); builder.SetRenderFunc( (DirGenRTGIPassData data, RenderGraphContext ctx) => @@ -63,7 +63,7 @@ TextureHandle UpscaleRTGI(RenderGraph renderGraph, in RTIndirectDiffuseUpscalePa passData.indirectDiffuseBuffer = builder.ReadTexture(indirectDiffuseBuffer); passData.directionBuffer = builder.ReadTexture(directionBuffer); passData.outputBuffer = builder.WriteTexture(renderGraph.CreateTexture(new TextureDesc(Vector2.one, true, true) - { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, enableRandomWrite = true, name = "Reflection Ray Indirect Diffuse" })); + { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, enableRandomWrite = true, name = "Reflection Ray Indirect Diffuse" })); builder.SetRenderFunc( (UpscaleRTGIPassData data, RenderGraphContext ctx) => @@ -169,7 +169,7 @@ TextureHandle QualityRTGI(RenderGraph renderGraph, in QualityRTIndirectDiffusePa passData.normalBuffer = builder.ReadTexture(normalBuffer); passData.rayCountTexture = builder.ReadWriteTexture(rayCountTexture); passData.outputBuffer = builder.WriteTexture(renderGraph.CreateTexture(new TextureDesc(Vector2.one, true, true) - { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, enableRandomWrite = true, name = "Ray Traced Indirect Diffuse" })); + { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, enableRandomWrite = true, name = "Ray Traced Indirect Diffuse" })); builder.SetRenderFunc( (TraceQualityRTGIPassData data, RenderGraphContext ctx) => @@ -196,7 +196,7 @@ TextureHandle RenderIndirectDiffuseQuality(RenderGraph renderGraph, HDCamera hdC // Evaluate the signal QualityRTIndirectDiffuseParameters rtgiQRenderingParameters = PrepareQualityRTIndirectDiffuseParameters(hdCamera, settings); - TextureHandle rtgiResult = QualityRTGI(renderGraph, in rtgiQRenderingParameters, depthPyramid, normalBuffer, rayCountTexture); + TextureHandle rtgiResult = QualityRTGI(renderGraph, in rtgiQRenderingParameters, depthPyramid, normalBuffer, rayCountTexture); // Denoise if required rtgiResult = DenoiseRTGI(renderGraph, hdCamera, rtgiResult, depthPyramid, normalBuffer, motionVectors, historyValidationTexture); diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/HDRaytracingLightCluster.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/HDRaytracingLightCluster.cs index 1b1a15d7b21..2df1ffbcbf9 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/HDRaytracingLightCluster.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/HDRaytracingLightCluster.cs @@ -303,7 +303,7 @@ void BuildGPULightVolumes(HDCamera hdCamera, HDRayTracingLights rayTracingLights { // let's compute the oobb of the light influence volume first Vector3 oobbDimensions = new Vector3(currentLight.shapeWidth + 2 * lightRange, currentLight.shapeHeight + 2 * lightRange, lightRange); // One-sided - Vector3 extents = 0.5f * oobbDimensions; + Vector3 extents = 0.5f * oobbDimensions; Vector3 oobbCenter = lightPositionRWS + extents.z * currentLight.gameObject.transform.forward; // Let's now compute an AABB that matches the previously defined OOBB @@ -538,7 +538,7 @@ void BuildLightData(CommandBuffer cmd, HDCamera hdCamera, HDRayTracingLights ray int shadowIndex = additionalLightData.shadowIndex; int screenSpaceShadowIndex = -1; int screenSpaceChannelSlot = -1; - Vector3 lightDimensions = new Vector3(0.0f, 0.0f, 0.0f); + Vector3 lightDimensions = new Vector3(0.0f, 0.0f, 0.0f); // Use the shared code to build the light data m_RenderPipeline.GetLightData(cmd, hdCamera, hdShadowSettings, visibleLight, lightComponent, in processedData, @@ -681,7 +681,7 @@ public void EvaluateClusterDebugView(RenderGraph renderGraph, HDCamera hdCamera, passData.depthStencilBuffer = builder.UseDepthBuffer(depthStencilBuffer, DepthAccess.Read); passData.depthPyramid = builder.ReadTexture(depthStencilBuffer); passData.outputBuffer = builder.WriteTexture(renderGraph.CreateTexture(new TextureDesc(Vector2.one, true, true) - { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, enableRandomWrite = true, name = "Light Cluster Debug Texture" })); + { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, enableRandomWrite = true, name = "Light Cluster Debug Texture" })); builder.SetRenderFunc( (LightClusterDebugPassData data, RenderGraphContext ctx) => diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/HDRaytracingManager.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/HDRaytracingManager.cs index 7a688e35b5f..dea9a34c522 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/HDRaytracingManager.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/HDRaytracingManager.cs @@ -561,21 +561,21 @@ static internal bool ValidRayTracingHistory(HDCamera hdCamera) internal int RayTracingFrameIndex(HDCamera hdCamera) { - #if UNITY_HDRP_DXR_TESTS_DEFINE +#if UNITY_HDRP_DXR_TESTS_DEFINE if (Application.isPlaying) return 0; else - #endif +#endif return (int)hdCamera.GetCameraFrameCount() % 8; } internal int RayTracingFrameIndex(HDCamera hdCamera, int targetFrameCount = 8) { - #if UNITY_HDRP_DXR_TESTS_DEFINE +#if UNITY_HDRP_DXR_TESTS_DEFINE if (Application.isPlaying) return 0; else - #endif +#endif return (int)hdCamera.GetCameraFrameCount() % targetFrameCount; } diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/HDRaytracingRecursiveRenderer.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/HDRaytracingRecursiveRenderer.cs index 69d05b643fe..8317fbdc503 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/HDRaytracingRecursiveRenderer.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/HDRaytracingRecursiveRenderer.cs @@ -149,7 +149,7 @@ TextureHandle RaytracingRecursiveRender(RenderGraph renderGraph, HDCamera hdCame // Right now the debug buffer is written to independently of what is happening. This must be changed // TODO RENDERGRAPH passData.debugBuffer = builder.WriteTexture(renderGraph.CreateTexture(new TextureDesc(Vector2.one, true, true) - { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, enableRandomWrite = true, name = "Recursive Rendering Debug Texture" })); + { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, enableRandomWrite = true, name = "Recursive Rendering Debug Texture" })); builder.SetRenderFunc( (RecursiveRenderingPassData data, RenderGraphContext ctx) => diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/HDRaytracingReflection.RenderGraph.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/HDRaytracingReflection.RenderGraph.cs index 871139c585e..d8a4e475ffd 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/HDRaytracingReflection.RenderGraph.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/HDRaytracingReflection.RenderGraph.cs @@ -28,7 +28,7 @@ TextureHandle DirGenRTR(RenderGraph renderGraph, in RTReflectionDirGenParameters passData.normalBuffer = builder.ReadTexture(normalBuffer); passData.clearCoatMaskTexture = builder.ReadTexture(clearCoatTexture); passData.outputBuffer = builder.WriteTexture(renderGraph.CreateTexture(new TextureDesc(Vector2.one, true, true) - { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, enableRandomWrite = true, name = "Reflection Ray Directions" })); + { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, enableRandomWrite = true, name = "Reflection Ray Directions" })); builder.SetRenderFunc( (DirGenRTRPassData data, RenderGraphContext ctx) => @@ -76,7 +76,7 @@ TextureHandle AdjustWeightRTR(RenderGraph renderGraph, in RTRAdjustWeightParamet passData.lightingTexture = builder.ReadTexture(lightingTexture); passData.directionTexture = builder.ReadTexture(directionTexture); passData.outputTexture = builder.WriteTexture(renderGraph.CreateTexture(new TextureDesc(Vector2.one, true, true) - { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, enableRandomWrite = true, name = "Reflection Ray Reflections" })); + { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, enableRandomWrite = true, name = "Reflection Ray Reflections" })); builder.SetRenderFunc( (AdjustWeightRTRPassData data, RenderGraphContext ctx) => @@ -118,7 +118,7 @@ TextureHandle UpscaleRTR(RenderGraph renderGraph, in RTRUpscaleParameters parame passData.depthStencilBuffer = builder.ReadTexture(depthPyramid); passData.lightingTexture = builder.ReadTexture(lightingTexture); passData.outputTexture = builder.WriteTexture(renderGraph.CreateTexture(new TextureDesc(Vector2.one, true, true) - { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, enableRandomWrite = true, name = "Reflection Ray Reflections" })); + { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, enableRandomWrite = true, name = "Reflection Ray Reflections" })); builder.SetRenderFunc( (UpscaleRTRPassData data, RenderGraphContext ctx) => @@ -213,7 +213,7 @@ TextureHandle QualityRTR(RenderGraph renderGraph, in RTRQualityRenderingParamete passData.clearCoatMaskTexture = builder.ReadTexture(clearCoatTexture); passData.rayCountTexture = builder.ReadWriteTexture(rayCountTexture); passData.outputTexture = builder.WriteTexture(renderGraph.CreateTexture(new TextureDesc(Vector2.one, true, true) - { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, enableRandomWrite = true, name = "Ray Traced Reflections" })); + { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, enableRandomWrite = true, name = "Ray Traced Reflections" })); builder.SetRenderFunc( (TraceQualityRTRPassData data, RenderGraphContext ctx) => diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/HDReflectionDenoiser.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/HDReflectionDenoiser.cs index 41bb39b6dd0..895ab23a4a7 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/HDReflectionDenoiser.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/HDReflectionDenoiser.cs @@ -191,9 +191,9 @@ public TextureHandle DenoiseRTR(RenderGraph renderGraph, in ReflectionDenoiserPa passData.historyDepth = depthT != null ? renderGraph.ImportTexture(hdCamera.GetCurrentFrameRT((int)HDCameraFrameHistoryType.Depth)) : renderGraph.defaultResources.blackTextureXR; passData.intermediateBuffer0 = builder.CreateTransientTexture(new TextureDesc(Vector2.one, true, true) - { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, enableRandomWrite = true, name = "IntermediateTexture0" }); + { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, enableRandomWrite = true, name = "IntermediateTexture0" }); passData.intermediateBuffer1 = builder.CreateTransientTexture(new TextureDesc(Vector2.one, true, true) - { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, enableRandomWrite = true, name = "IntermediateTexture1" }); + { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, enableRandomWrite = true, name = "IntermediateTexture1" }); passData.historySignal = builder.ReadWriteTexture(renderGraph.ImportTexture(historyBuffer)); passData.noisyToOutputSignal = builder.ReadWriteTexture(lightingTexture); diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/HDSimpleDenoiser.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/HDSimpleDenoiser.cs index f96a9fbfd13..f830310387e 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/HDSimpleDenoiser.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/HDSimpleDenoiser.cs @@ -142,11 +142,11 @@ public TextureHandle DenoiseBufferNoHistory(RenderGraph renderGraph, HDCamera hd // Temporary buffers passData.intermediateBuffer = builder.CreateTransientTexture(new TextureDesc(Vector2.one, true, true) - { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, enableRandomWrite = true, name = "Intermediate buffer" }); + { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, enableRandomWrite = true, name = "Intermediate buffer" }); // Output buffer passData.outputBuffer = builder.ReadWriteTexture(renderGraph.CreateTexture(new TextureDesc(Vector2.one, true, true) - { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, enableRandomWrite = true, name = "Denoised Buffer" })); + { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, enableRandomWrite = true, name = "Denoised Buffer" })); builder.SetRenderFunc( diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/HDTemporalFilter.RenderGraph.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/HDTemporalFilter.RenderGraph.cs index 14d7d5cf3b5..a3895f976ec 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/HDTemporalFilter.RenderGraph.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/HDTemporalFilter.RenderGraph.cs @@ -96,7 +96,7 @@ public TextureHandle Denoise(RenderGraph renderGraph, HDCamera hdCamera, Tempora // Output buffers passData.outputBuffer = builder.ReadWriteTexture(renderGraph.CreateTexture(new TextureDesc(Vector2.one, true, true) - { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, enableRandomWrite = true, name = "Temporal Filter Output" })); + { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, enableRandomWrite = true, name = "Temporal Filter Output" })); builder.SetRenderFunc( (TemporalFilterPassData data, RenderGraphContext ctx) => @@ -181,9 +181,9 @@ public TemporalDenoiserArrayOutputData DenoiseBuffer(RenderGraph renderGraph, HD // Output textures passData.outputBuffer = builder.ReadWriteTexture(renderGraph.CreateTexture(new TextureDesc(Vector2.one, true, true) - { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, enableRandomWrite = true, name = "Temporal Filter Output" })); + { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, enableRandomWrite = true, name = "Temporal Filter Output" })); passData.outputDistanceSignal = distanceBased ? builder.ReadWriteTexture(renderGraph.CreateTexture(new TextureDesc(Vector2.one, true, true) - { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, enableRandomWrite = true, name = "Temporal Filter Distance output" })) : new TextureHandle(); + { colorFormat = GraphicsFormat.R16G16B16A16_SFloat, enableRandomWrite = true, name = "Temporal Filter Distance output" })) : new TextureHandle(); builder.SetRenderFunc( (TemporalFilterArrayPassData data, RenderGraphContext ctx) => diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/RayTracingMode.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/RayTracingMode.cs index bc157c5a7ec..d847363fc78 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/RayTracingMode.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/RayTracingMode.cs @@ -28,6 +28,6 @@ public sealed class RayTracingModeParameter : VolumeParameter /// /// The initial value to store in the parameter. /// The initial override state for the parameter. - public RayTracingModeParameter(RayTracingMode value, bool overrideState = false) : base(value, overrideState) {} + public RayTracingModeParameter(RayTracingMode value, bool overrideState = false) : base(value, overrideState) { } } } diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/Shaders/ShaderVariablesRaytracingLightLoop.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/Shaders/ShaderVariablesRaytracingLightLoop.cs index 0da49a3a9a0..bfb2470e623 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/Shaders/ShaderVariablesRaytracingLightLoop.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/Shaders/ShaderVariablesRaytracingLightLoop.cs @@ -3,11 +3,11 @@ namespace UnityEngine.Rendering.HighDefinition [GenerateHLSL(needAccessors = false, generateCBuffer = true, constantRegister = (int)ConstantRegister.RayTracingLightLoop)] unsafe struct ShaderVariablesRaytracingLightLoop { - public Vector3 _MinClusterPos; - public uint _LightPerCellCount; - public Vector3 _MaxClusterPos; - public uint _PunctualLightCountRT; - public uint _AreaLightCountRT; - public uint _EnvLightCountRT; + public Vector3 _MinClusterPos; + public uint _LightPerCellCount; + public Vector3 _MaxClusterPos; + public uint _PunctualLightCountRT; + public uint _AreaLightCountRT; + public uint _EnvLightCountRT; } } diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/AOV/AOVRequest.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/AOV/AOVRequest.cs index c16151ec9f7..e77bd9cac90 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/AOV/AOVRequest.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/AOV/AOVRequest.cs @@ -64,8 +64,8 @@ public unsafe struct AOVRequest { get { - fixed(AOVRequest* pThis = &this) - return pThis; + fixed (AOVRequest* pThis = &this) + return pThis; } } @@ -193,7 +193,7 @@ public override bool Equals(object obj) /// The first AOVRequest to compare. /// The second AOVRequest to compare. /// True if the two AOV requests have the same settings. - public static bool operator==(AOVRequest a, AOVRequest b) + public static bool operator ==(AOVRequest a, AOVRequest b) { return a.m_DebugFullScreen == b.m_DebugFullScreen && a.m_LightFilterProperty == b.m_LightFilterProperty && @@ -207,7 +207,7 @@ public override bool Equals(object obj) /// The first AOVRequest to compare. /// The second AOVRequest to compare. /// True if the two AOV requests have not the same settings. - public static bool operator!=(AOVRequest a, AOVRequest b) + public static bool operator !=(AOVRequest a, AOVRequest b) { return !(a == b); } diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/AOV/AOVRequestData.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/AOV/AOVRequestData.cs index 26d790d4fa8..8043ecc3dc7 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/AOV/AOVRequestData.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/AOV/AOVRequestData.cs @@ -43,7 +43,7 @@ public struct AOVRequestData public static AOVRequestData NewDefault() => new AOVRequestData { m_Settings = AOVRequest.NewDefault(), - m_RequestedAOVBuffers = new AOVBuffers[] {}, + m_RequestedAOVBuffers = new AOVBuffers[] { }, m_Callback = null }; diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPass.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPass.cs index 2d7262bc8cd..501efb18038 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPass.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPass.cs @@ -26,7 +26,7 @@ public string name [SerializeField, FormerlySerializedAsAttribute("name")] string m_Name = "Custom Pass"; - internal ProfilingSampler profilingSampler + internal ProfilingSampler profilingSampler { get { @@ -35,36 +35,36 @@ internal ProfilingSampler profilingSampler return m_ProfilingSampler; } } - ProfilingSampler m_ProfilingSampler; + ProfilingSampler m_ProfilingSampler; /// /// Is the custom pass enabled or not /// - public bool enabled = true; + public bool enabled = true; /// /// Target color buffer (Camera or Custom) /// - public TargetBuffer targetColorBuffer; + public TargetBuffer targetColorBuffer; /// /// Target depth buffer (camera or custom) /// - public TargetBuffer targetDepthBuffer; + public TargetBuffer targetDepthBuffer; /// /// What clear to apply when the color and depth buffer are bound /// - public ClearFlag clearFlags; + public ClearFlag clearFlags; [SerializeField] - bool passFoldout; + bool passFoldout; [System.NonSerialized] - bool isSetup = false; - bool isExecuting = false; - RenderTargets currentRenderTarget; - CustomPassVolume owner; - HDCamera currentHDCamera; + bool isSetup = false; + bool isExecuting = false; + RenderTargets currentRenderTarget; + CustomPassVolume owner; + HDCamera currentHDCamera; MaterialPropertyBlock userMaterialPropertyBlock; @@ -155,7 +155,7 @@ enum Version } [SerializeField] - Version m_Version = MigrationDescription.LastVersion(); + Version m_Version = MigrationDescription.LastVersion(); Version IVersionable.version { get => m_Version; @@ -326,7 +326,7 @@ void SetCustomPassTarget(CommandBuffer cmd) /// /// Aggregate the parameters in this property (use |= for masks fields, etc.) /// The camera where the culling is being done - protected virtual void AggregateCullingParameters(ref ScriptableCullingParameters cullingParameters, HDCamera hdCamera) {} + protected virtual void AggregateCullingParameters(ref ScriptableCullingParameters cullingParameters, HDCamera hdCamera) { } /// /// Called when your pass needs to be executed by a camera @@ -336,7 +336,7 @@ protected virtual void AggregateCullingParameters(ref ScriptableCullingParameter /// /// [Obsolete("This Execute signature is obsolete and will be removed in the future. Please use Execute(CustomPassContext) instead")] - protected virtual void Execute(ScriptableRenderContext renderContext, CommandBuffer cmd, HDCamera hdCamera, CullingResults cullingResult) {} + protected virtual void Execute(ScriptableRenderContext renderContext, CommandBuffer cmd, HDCamera hdCamera, CullingResults cullingResult) { } /// /// Called when your pass needs to be executed by a camera @@ -356,13 +356,13 @@ protected virtual void Execute(CustomPassContext ctx) /// /// The render context /// Current command buffer of the frame - protected virtual void Setup(ScriptableRenderContext renderContext, CommandBuffer cmd) {} + protected virtual void Setup(ScriptableRenderContext renderContext, CommandBuffer cmd) { } /// /// Called when HDRP is destroyed. /// Allow you to free custom buffers. /// - protected virtual void Cleanup() {} + protected virtual void Cleanup() { } /// /// Bind the camera color buffer as the current render target diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassContext.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassContext.cs index a04ad090720..68f38da4e3f 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassContext.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassContext.cs @@ -10,57 +10,57 @@ public struct CustomPassContext /// /// Scriptable Render Context, used for any SRP related operations. /// - public readonly ScriptableRenderContext renderContext; + public readonly ScriptableRenderContext renderContext; /// /// Command Buffer, used to enqueue graphic commands to the GPU. /// - public readonly CommandBuffer cmd; + public readonly CommandBuffer cmd; /// /// HdCamera, HDRP data related to the rendering camera. Use the camera property to access the Camera class. /// - public readonly HDCamera hdCamera; + public readonly HDCamera hdCamera; /// /// Result of the culling either of the camera or the custom pass if AggregateCullingParameters is used. /// - public CullingResults cullingResults; + public CullingResults cullingResults; /// /// Camera culling results, not modified by the custom pass culling. /// - public readonly CullingResults cameraCullingResults; + public readonly CullingResults cameraCullingResults; /// /// Camera color buffer. /// - public readonly RTHandle cameraColorBuffer; + public readonly RTHandle cameraColorBuffer; /// /// Camera depth buffer. /// - public readonly RTHandle cameraDepthBuffer; + public readonly RTHandle cameraDepthBuffer; /// /// Camera normal buffer. /// - public readonly RTHandle cameraNormalBuffer; + public readonly RTHandle cameraNormalBuffer; /// /// Lazy handle to the custom color buffer, not allocated if not used. /// - public readonly Lazy customColorBuffer; + public readonly Lazy customColorBuffer; /// /// Lazy handle to the custom depth buffer, not allocated if not used. /// - public readonly Lazy customDepthBuffer; + public readonly Lazy customDepthBuffer; /// /// Material Property Block, unique for each custom pass instance. /// - public readonly MaterialPropertyBlock propertyBlock; + public readonly MaterialPropertyBlock propertyBlock; internal CustomPassContext( ScriptableRenderContext renderContext, CommandBuffer cmd, diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassInjectionPoint.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassInjectionPoint.cs index 382d4a5967d..dc3cddf60fc 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassInjectionPoint.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassInjectionPoint.cs @@ -15,16 +15,16 @@ public enum CustomPassInjectionPoint // Ordered by injection point in the frame for the enum popup in the UI. /// Just after HDRP clears the depth buffer. You can write to the depth buffer to make HDRP not render depth-tested opaque GameObjects. - BeforeRendering = 0, + BeforeRendering = 0, /// At this point, you can modify the normal, roughness, and depth buffer. If you write to these buffers at this injection point, HDRP takes it into account in the lighting and the depth pyramid. - AfterOpaqueDepthAndNormal = 5, + AfterOpaqueDepthAndNormal = 5, /// At this injection point, you can render any transparent GameObject that you want to see in refraction. If you write to buffers at this injection point, they contents end up in the color pyramid that HDRP uses for refraction when it draws transparent GameObjects. - BeforePreRefraction = 4, + BeforePreRefraction = 4, /// At this injection point, you can sample the color pyramid that HDRP generates for rough transparent refraction. - BeforeTransparent = 1, + BeforeTransparent = 1, /// This injection point is after HDRP handles post-processesing. At this point, depth is jittered which means you cannot draw depth tested GameObjects without having artifacts. - BeforePostProcess = 2, + BeforePostProcess = 2, /// This injection point is before HDRP renders post-processing and custom post-processing effects. - AfterPostProcess = 3, + AfterPostProcess = 3, } } diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassUtils.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassUtils.cs index 23e55037b27..ad239d733d4 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassUtils.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassUtils.cs @@ -29,9 +29,9 @@ public static class CustomPassUtils static ProfilingSampler renderNormalFromCameraSampler = new ProfilingSampler("Render Normal"); static ProfilingSampler renderTangentFromCameraSampler = new ProfilingSampler("Render Tangent"); - static MaterialPropertyBlock propertyBlock = new MaterialPropertyBlock(); - static Material customPassUtilsMaterial; - static Material customPassRenderersUtilsMaterial; + static MaterialPropertyBlock propertyBlock = new MaterialPropertyBlock(); + static Material customPassUtilsMaterial; + static Material customPassRenderersUtilsMaterial; static Dictionary gaussianWeightsCache = new Dictionary(); diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassVolume.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassVolume.cs index 3f5c5c4ad01..0a2de461c3b 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassVolume.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassVolume.cs @@ -55,11 +55,11 @@ public class CustomPassVolume : MonoBehaviour #endif // The current active custom pass volume is simply the smallest overlapping volume with the trigger transform - static HashSet m_ActivePassVolumes = new HashSet(); - static List m_OverlappingPassVolumes = new List(); + static HashSet m_ActivePassVolumes = new HashSet(); + static List m_OverlappingPassVolumes = new List(); - List m_Colliders = new List(); - List m_OverlappingColliders = new List(); + List m_Colliders = new List(); + List m_OverlappingColliders = new List(); static List m_InjectionPoints; static List injectionPoints @@ -219,7 +219,8 @@ internal static void Update(HDCamera camera) } // Sort the overlapping volumes by priority order (smaller first, then larger and finally globals) - m_OverlappingPassVolumes.Sort((v1, v2) => { + m_OverlappingPassVolumes.Sort((v1, v2) => + { float GetVolumeExtent(CustomPassVolume volume) { float extent = 0; @@ -255,7 +256,7 @@ internal void AggregateCullingParameters(ref ScriptableCullingParameters culling internal static CullingResults? Cull(ScriptableRenderContext renderContext, HDCamera hdCamera) { - CullingResults? result = null; + CullingResults? result = null; // We need to sort the volumes first to know which one will be executed // TODO: cache the results per camera in the HDRenderPipeline so it's not executed twice per camera diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/DrawRenderersCustomPass.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/DrawRenderersCustomPass.cs index 894688ac8bc..9315a27ab52 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/DrawRenderersCustomPass.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/DrawRenderersCustomPass.cs @@ -18,9 +18,9 @@ public enum ShaderPass { // Ordered by frame time in HDRP ///Object Depth pre-pass, only the depth of the object will be rendered. - DepthPrepass = 1, + DepthPrepass = 1, ///Forward pass, render the object color. - Forward = 0, + Forward = 0, } // Used only for the UI to keep track of the toggle state @@ -77,7 +77,7 @@ public enum ShaderPass static ShaderTagId[] depthShaderTags; // Cache the shaderTagIds so we don't allocate a new array each frame - ShaderTagId[] cachedShaderTagIDs; + ShaderTagId[] cachedShaderTagIDs; /// /// Called before the first execution of the pass occurs. diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/FullScreenCustomPass.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/FullScreenCustomPass.cs index 6091a3e0c13..85a89b72cd0 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/FullScreenCustomPass.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/FullScreenCustomPass.cs @@ -14,17 +14,17 @@ public class FullScreenCustomPass : CustomPass /// /// Material used for the fullscreen pass, it's shader must have been created with. /// - public Material fullscreenPassMaterial; + public Material fullscreenPassMaterial; [SerializeField] - int materialPassIndex = 0; + int materialPassIndex = 0; /// /// Name of the pass to use in the fullscreen material. /// - public string materialPassName = "Custom Pass 0"; + public string materialPassName = "Custom Pass 0"; /// /// Set to true if your shader will sample in the camera color buffer. /// - public bool fetchColorBuffer; + public bool fetchColorBuffer; int fadeValueId; diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/MipGenerator.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/MipGenerator.cs index 4271dfe8593..d14996cacc7 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/MipGenerator.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/MipGenerator.cs @@ -60,7 +60,7 @@ public void RenderMinDepthPyramid(CommandBuffer cmd, RenderTexture texture, HDUt { HDUtils.CheckRTCreated(texture); - var cs = m_DepthPyramidCS; + var cs = m_DepthPyramidCS; int kernel = m_DepthDownsampleKernel; // TODO: Do it 1x MIP at a time for now. In the future, do 4x MIPs per pass, or even use a single pass. @@ -70,11 +70,11 @@ public void RenderMinDepthPyramid(CommandBuffer cmd, RenderTexture texture, HDUt { if (mip1AlreadyComputed && i == 1) continue; - Vector2Int dstSize = info.mipLevelSizes[i]; + Vector2Int dstSize = info.mipLevelSizes[i]; Vector2Int dstOffset = info.mipLevelOffsets[i]; - Vector2Int srcSize = info.mipLevelSizes[i - 1]; + Vector2Int srcSize = info.mipLevelSizes[i - 1]; Vector2Int srcOffset = info.mipLevelOffsets[i - 1]; - Vector2Int srcLimit = srcOffset + srcSize - Vector2Int.one; + Vector2Int srcLimit = srcOffset + srcSize - Vector2Int.one; m_SrcOffset[0] = srcOffset.x; m_SrcOffset[1] = srcOffset.y; @@ -86,9 +86,9 @@ public void RenderMinDepthPyramid(CommandBuffer cmd, RenderTexture texture, HDUt m_DstOffset[2] = 0; m_DstOffset[3] = 0; - cmd.SetComputeIntParams(cs, HDShaderIDs._SrcOffsetAndLimit, m_SrcOffset); - cmd.SetComputeIntParams(cs, HDShaderIDs._DstOffset, m_DstOffset); - cmd.SetComputeTextureParam(cs, kernel, HDShaderIDs._DepthMipChain, texture); + cmd.SetComputeIntParams(cs, HDShaderIDs._SrcOffsetAndLimit, m_SrcOffset); + cmd.SetComputeIntParams(cs, HDShaderIDs._DstOffset, m_DstOffset); + cmd.SetComputeTextureParam(cs, kernel, HDShaderIDs._DepthMipChain, texture); cmd.DispatchCompute(cs, kernel, HDUtils.DivRoundUp(dstSize.x, 8), HDUtils.DivRoundUp(dstSize.y, 8), texture.volumeDepth); } @@ -133,8 +133,8 @@ public int RenderColorGaussianPyramid(CommandBuffer cmd, Vector2Int size, Textur ); } - int srcMipLevel = 0; - int srcMipWidth = size.x; + int srcMipLevel = 0; + int srcMipWidth = size.x; int srcMipHeight = size.y; int slices = destination.volumeDepth; @@ -190,7 +190,7 @@ public int RenderColorGaussianPyramid(CommandBuffer cmd, Vector2Int size, Textur // on 8x8 blocks while (srcMipWidth >= 8 || srcMipHeight >= 8) { - int dstMipWidth = Mathf.Max(1, srcMipWidth >> 1); + int dstMipWidth = Mathf.Max(1, srcMipWidth >> 1); int dstMipHeight = Mathf.Max(1, srcMipHeight >> 1); // Scale for downsample @@ -238,7 +238,7 @@ public int RenderColorGaussianPyramid(CommandBuffer cmd, Vector2Int size, Textur cmd.DrawProcedural(Matrix4x4.identity, m_ColorPyramidPSMat, rtIndex, MeshTopology.Triangles, 3, 1, m_PropertyBlock); srcMipLevel++; - srcMipWidth = srcMipWidth >> 1; + srcMipWidth = srcMipWidth >> 1; srcMipHeight = srcMipHeight >> 1; finalTargetMipWidth = finalTargetMipWidth >> 1; diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPipelineResources.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPipelineResources.cs index ad8d9b7196f..b6aab7b5f20 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPipelineResources.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPipelineResources.cs @@ -152,7 +152,7 @@ public sealed class ShaderResources [Reload("Runtime/Sky/PhysicallyBasedSky/InScatteredRadiancePrecomputation.compute")] public ComputeShader inScatteredRadiancePrecomputationCS; [Reload("Runtime/Sky/PhysicallyBasedSky/PhysicallyBasedSky.shader")] - public Shader physicallyBasedSkyPS; + public Shader physicallyBasedSkyPS; [Reload("Runtime/Lighting/PlanarReflectionFiltering.compute")] public ComputeShader planarReflectionFilteringCS; // Material @@ -399,12 +399,12 @@ public sealed class TextureResources })] public Texture2D[] filmGrainTex; [Reload("Runtime/RenderPipelineResources/Texture/SMAA/SearchTex.tga")] - public Texture2D SMAASearchTex; + public Texture2D SMAASearchTex; [Reload("Runtime/RenderPipelineResources/Texture/SMAA/AreaTex.tga")] - public Texture2D SMAAAreaTex; + public Texture2D SMAAAreaTex; [Reload("Runtime/RenderPipelineResources/Texture/DefaultHDRISky.exr")] - public Cubemap defaultHDRISky; + public Cubemap defaultHDRISky; } [Serializable, ReloadGroup] diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Settings/FrameSettings.Migration.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Settings/FrameSettings.Migration.cs index 67ae9926563..36c406cacf8 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Settings/FrameSettings.Migration.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Settings/FrameSettings.Migration.cs @@ -423,8 +423,8 @@ internal static void MigrateSubsurfaceParams(ref FrameSettings fs, bool previous // SSS moved from 25 to 46. fs.SetEnabled(FrameSettingsField.SubsurfaceScattering, fs.bitDatas[25]); // Set the defaults. - fs.sssQualityMode = previouslyHighQuality ? SssQualityMode.OverrideQualitySettings : SssQualityMode.FromQualitySettings; - fs.sssQualityLevel = 0; + fs.sssQualityMode = previouslyHighQuality ? SssQualityMode.OverrideQualitySettings : SssQualityMode.FromQualitySettings; + fs.sssQualityLevel = 0; fs.sssCustomSampleBudget = previouslyHighQuality ? 55 : (int)DefaultSssSampleBudgetForQualityLevel.Low; } diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Settings/FrameSettings.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Settings/FrameSettings.cs index 3bd332ea9ea..7e580c4a622 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Settings/FrameSettings.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Settings/FrameSettings.cs @@ -229,7 +229,7 @@ public enum FrameSettingsField [FrameSettingsField(0, autoName: MaximumLODLevel, type: FrameSettingsFieldAttribute.DisplayType.Others, positiveDependencies: new[] { MaximumLODLevelMode }, tooltip: "Sets the Maximum Level Of Detail Level or the Offset on it.")] MaximumLODLevel = 63, /// The quality level to use when fetching the value from the quality settings. - [FrameSettingsField(0, displayedName: "Quality Level", type: FrameSettingsFieldAttribute.DisplayType.Others, customOrderInGroup: 102, positiveDependencies: new[] { MaximumLODLevelMode }, tooltip: "The quality level to use when fetching the value from the quality settings.")] + [FrameSettingsField(0, displayedName: "Quality Level", type: FrameSettingsFieldAttribute.DisplayType.Others, customOrderInGroup: 102, positiveDependencies: new[] { MaximumLODLevelMode }, tooltip: "The quality level to use when fetching the value from the quality settings.")] MaximumLODLevelQualityLevel = 65, /// The quality level to use when fetching the value from the quality settings. [FrameSettingsField(0, autoName: MaterialQualityLevel, type: FrameSettingsFieldAttribute.DisplayType.Others, tooltip: "The material quality level to use.")] @@ -449,8 +449,8 @@ partial struct FrameSettings (uint)FrameSettingsField.MSAA }), lodBias = 1, - sssQualityMode = SssQualityMode.FromQualitySettings, - sssQualityLevel = 0, + sssQualityMode = SssQualityMode.FromQualitySettings, + sssQualityLevel = 0, sssCustomSampleBudget = (int)DefaultSssSampleBudgetForQualityLevel.Low, }; internal static FrameSettings NewDefaultRealtimeReflectionProbe() => new FrameSettings() @@ -507,8 +507,8 @@ partial struct FrameSettings (uint)FrameSettingsField.DirectSpecularLighting, }), lodBias = 1, - sssQualityMode = SssQualityMode.FromQualitySettings, - sssQualityLevel = 0, + sssQualityMode = SssQualityMode.FromQualitySettings, + sssQualityLevel = 0, sssCustomSampleBudget = (int)DefaultSssSampleBudgetForQualityLevel.Low, }; internal static FrameSettings NewDefaultCustomOrBakeReflectionProbe() => new FrameSettings() @@ -562,8 +562,8 @@ partial struct FrameSettings // (uint)FrameSettingsField.DirectSpecularLighting, }), lodBias = 1, - sssQualityMode = SssQualityMode.FromQualitySettings, - sssQualityLevel = 0, + sssQualityMode = SssQualityMode.FromQualitySettings, + sssQualityLevel = 0, sssCustomSampleBudget = (int)DefaultSssSampleBudgetForQualityLevel.Low, }; @@ -678,7 +678,7 @@ public int GetResolvedSssSampleBudget(HDRenderPipelineAsset hdrp) var source = hdrp.currentPlatformRenderPipelineSettings.sssSampleBudget; switch (sssQualityMode) { - case SssQualityMode.FromQualitySettings: return source[sssQualityLevel]; + case SssQualityMode.FromQualitySettings: return source[sssQualityLevel]; case SssQualityMode.OverrideQualitySettings: return sssCustomSampleBudget; default: throw new ArgumentOutOfRangeException(nameof(maximumLODLevelMode)); } @@ -873,18 +873,18 @@ internal static void AggregateFrameSettings(ref FrameSettings aggregatedFrameSet /// First frame settings. /// Second frame settings. /// True if both settings are equal. - public static bool operator==(FrameSettings a, FrameSettings b) - => a.bitDatas == b.bitDatas - && a.sssQualityMode == b.sssQualityMode - && a.sssQualityLevel == b.sssQualityLevel - && a.sssCustomSampleBudget == b.sssCustomSampleBudget - && a.lodBias == b.lodBias - && a.lodBiasMode == b.lodBiasMode - && a.lodBiasQualityLevel == b.lodBiasQualityLevel - && a.maximumLODLevel == b.maximumLODLevel - && a.maximumLODLevelMode == b.maximumLODLevelMode + public static bool operator ==(FrameSettings a, FrameSettings b) + => a.bitDatas == b.bitDatas + && a.sssQualityMode == b.sssQualityMode + && a.sssQualityLevel == b.sssQualityLevel + && a.sssCustomSampleBudget == b.sssCustomSampleBudget + && a.lodBias == b.lodBias + && a.lodBiasMode == b.lodBiasMode + && a.lodBiasQualityLevel == b.lodBiasQualityLevel + && a.maximumLODLevel == b.maximumLODLevel + && a.maximumLODLevelMode == b.maximumLODLevelMode && a.maximumLODLevelQualityLevel == b.maximumLODLevelQualityLevel - && a.materialQuality == b.materialQuality; + && a.materialQuality == b.materialQuality; /// /// Inequality operator between two FrameSettings. Return `true` if different. (comparison of content). @@ -892,7 +892,7 @@ internal static void AggregateFrameSettings(ref FrameSettings aggregatedFrameSet /// First frame settings. /// Second frame settings. /// True if settings are not equal. - public static bool operator!=(FrameSettings a, FrameSettings b) => !(a == b); + public static bool operator !=(FrameSettings a, FrameSettings b) => !(a == b); /// /// Equality operator between two FrameSettings. Return `true` if equivalent. (comparison of content). diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Settings/FrameSettingsHistory.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Settings/FrameSettingsHistory.cs index 459b3fe74ba..2bd7de012cb 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Settings/FrameSettingsHistory.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Settings/FrameSettingsHistory.cs @@ -222,7 +222,7 @@ static DebugUI.HistoryEnumField GenerateHistoryEnumField(HDRenderPipelineAsset d // Contrarily to other enum of DebugMenu, we do not need to stock index as // it can be computed again with data in the dedicated debug section of history getIndex = () => frameSettingsContainer.frameSettingsHistory.debug.IsEnabled(field) ? 1 : 0, - setIndex = (int a) => {}, + setIndex = (int a) => { }, historyIndexGetter = new Func[] { diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Settings/RenderPipelineSettings.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Settings/RenderPipelineSettings.cs index ce4622f6685..d4889331dfb 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Settings/RenderPipelineSettings.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Settings/RenderPipelineSettings.cs @@ -302,9 +302,9 @@ public PlanarReflectionAtlasResolutionScalableSetting(PlanarReflectionAtlasResol /// Global lighting quality settings. public GlobalLightingQualitySettings lightingQualitySettings; - #pragma warning disable 618 // Type or member is obsolete +#pragma warning disable 618 // Type or member is obsolete [Obsolete("For data migration")] internal bool m_ObsoleteincreaseSssSampleCount; - #pragma warning restore 618 +#pragma warning restore 618 } } diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Settings/ScalableSetting.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Settings/ScalableSetting.cs index 734d3c1764e..5c4834a132e 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Settings/ScalableSetting.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Settings/ScalableSetting.cs @@ -13,7 +13,7 @@ namespace UnityEngine.Rendering.HighDefinition /// /// The type of the scalable setting. [Serializable] - public class ScalableSetting: ISerializationCallbackReceiver + public class ScalableSetting : ISerializationCallbackReceiver { [SerializeField] private T[] m_Values; [SerializeField] private ScalableSettingSchemaId m_SchemaId; @@ -104,7 +104,7 @@ public class IntScalableSetting : ScalableSetting /// /// The values of the settings /// The schema of the setting. - public IntScalableSetting(int[] values, ScalableSettingSchemaId schemaId) : base(values, schemaId) {} + public IntScalableSetting(int[] values, ScalableSettingSchemaId schemaId) : base(values, schemaId) { } } /// . [Serializable] @@ -115,7 +115,7 @@ public class UintScalableSetting : ScalableSetting /// /// The values of the settings /// The schema of the setting. - public UintScalableSetting(uint[] values, ScalableSettingSchemaId schemaId) : base(values, schemaId) {} + public UintScalableSetting(uint[] values, ScalableSettingSchemaId schemaId) : base(values, schemaId) { } } /// . [Serializable] @@ -126,7 +126,7 @@ public class FloatScalableSetting : ScalableSetting /// /// The values of the settings /// The schema of the setting. - public FloatScalableSetting(float[] values, ScalableSettingSchemaId schemaId) : base(values, schemaId) {} + public FloatScalableSetting(float[] values, ScalableSettingSchemaId schemaId) : base(values, schemaId) { } } /// . [Serializable] @@ -137,7 +137,7 @@ public class BoolScalableSetting : ScalableSetting /// /// The values of the settings /// The schema of the setting. - public BoolScalableSetting(bool[] values, ScalableSettingSchemaId schemaId) : base(values, schemaId) {} + public BoolScalableSetting(bool[] values, ScalableSettingSchemaId schemaId) : base(values, schemaId) { } } #endregion } diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Settings/ScalableSettingValue.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Settings/ScalableSettingValue.cs index 0595a30e586..6165e30c5d7 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Settings/ScalableSettingValue.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Settings/ScalableSettingValue.cs @@ -66,12 +66,12 @@ public void CopyTo(ScalableSettingValue target) // Unity's serialization API. /// An int scalable setting value - [Serializable] public class IntScalableSettingValue : ScalableSettingValue {} + [Serializable] public class IntScalableSettingValue : ScalableSettingValue { } /// An uint scalable setting value - [Serializable] public class UintScalableSettingValue : ScalableSettingValue {} + [Serializable] public class UintScalableSettingValue : ScalableSettingValue { } /// An float scalable setting value - [Serializable] public class FloatScalableSettingValue : ScalableSettingValue {} + [Serializable] public class FloatScalableSettingValue : ScalableSettingValue { } /// An bool scalable setting value - [Serializable] public class BoolScalableSettingValue : ScalableSettingValue {} + [Serializable] public class BoolScalableSettingValue : ScalableSettingValue { } #endregion } diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Utility/HDUtils.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Utility/HDUtils.cs index bc65796eff1..9e2e39a37f3 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Utility/HDUtils.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Utility/HDUtils.cs @@ -138,7 +138,7 @@ internal static int GetRuntimeDebugPanelWidth(HDCamera hdCamera) /// /// internal static float ProjectionMatrixAspect(in Matrix4x4 matrix) - => - matrix.m11 / matrix.m00; + => -matrix.m11 / matrix.m00; internal static Matrix4x4 ComputePixelCoordToWorldSpaceViewDirectionMatrix(float verticalFoV, Vector2 lensShift, Vector4 screenSize, Matrix4x4 worldToViewMatrix, bool renderToCubemap, float aspectRatio = -1, bool isOrthographic = false) { @@ -929,15 +929,15 @@ internal static bool PostProcessIsFinalPass(HDCamera hdCamera) internal static Vector4 ConvertGUIDToVector4(string guid) { Vector4 vector; - byte[] bytes = new byte[16]; + byte[] bytes = new byte[16]; for (int i = 0; i < 16; i++) bytes[i] = byte.Parse(guid.Substring(i * 2, 2), System.Globalization.NumberStyles.HexNumber); unsafe { - fixed(byte * b = bytes) - vector = *(Vector4 *)b; + fixed (byte* b = bytes) + vector = *(Vector4*)b; } return vector; @@ -948,7 +948,7 @@ internal static string ConvertVector4ToGUID(Vector4 vector) System.Text.StringBuilder sb = new System.Text.StringBuilder(); unsafe { - byte * v = (byte *)&vector; + byte* v = (byte*)&vector; for (int i = 0; i < 16; i++) sb.Append(v[i].ToString("x2")); var guidBytes = new byte[16]; @@ -1068,7 +1068,7 @@ internal static UInt64 GetSceneCullingMaskFromCamera(Camera camera) if (camera.scene.IsValid()) return EditorSceneManager.GetSceneCullingMask(camera.scene); - #if UNITY_2020_1_OR_NEWER +#if UNITY_2020_1_OR_NEWER switch (camera.cameraType) { case CameraType.SceneView: @@ -1076,9 +1076,9 @@ internal static UInt64 GetSceneCullingMaskFromCamera(Camera camera) default: return SceneCullingMasks.GameViewObjects; } - #else +#else return 0; - #endif +#endif #else return 0; #endif diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Utility/PowerOfTwoTextureAtlas.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Utility/PowerOfTwoTextureAtlas.cs index 93278574b62..afcee0dfc23 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Utility/PowerOfTwoTextureAtlas.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Utility/PowerOfTwoTextureAtlas.cs @@ -231,7 +231,8 @@ public bool RelayoutEntries() ResetAllocator(); // Sort entries from biggest to smallest - entries.Sort((c1, c2) => { + entries.Sort((c1, c2) => + { return c2.size.magnitude.CompareTo(c1.size.magnitude); }); diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Utility/Texture2DAtlas.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Utility/Texture2DAtlas.cs index d59ebb3e906..22187623333 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Utility/Texture2DAtlas.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Utility/Texture2DAtlas.cs @@ -359,9 +359,9 @@ public Vector2Int GetCachedTextureSize(int id) public virtual bool NeedsUpdate(Texture texture, bool needMips = false) { - RenderTexture rt = texture as RenderTexture; - int key = GetTextureID(texture); - int textureHash = GetTextureHash(texture); + RenderTexture rt = texture as RenderTexture; + int key = GetTextureID(texture); + int textureHash = GetTextureHash(texture); // Update the render texture if needed if (rt != null) diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Utility/Texture2DAtlasDynamic.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Utility/Texture2DAtlasDynamic.cs index 7e8d83bf883..1880a9a2125 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Utility/Texture2DAtlasDynamic.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Utility/Texture2DAtlasDynamic.cs @@ -99,7 +99,7 @@ public void SetIsOccupied() public void ClearIsOccupied() { UInt16 isOccupiedMask = (UInt16)AtlasNodeFlags.IsOccupied; - m_Flags &= (UInt16) ~isOccupiedMask; + m_Flags &= (UInt16)~isOccupiedMask; } public bool IsLeafNode() diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Utility/Texture3DAtlasDynamic.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Utility/Texture3DAtlasDynamic.cs index df0b7e5e8fc..b377a0ce316 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Utility/Texture3DAtlasDynamic.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Utility/Texture3DAtlasDynamic.cs @@ -99,7 +99,7 @@ public void SetIsOccupied() public void ClearIsOccupied() { UInt16 isOccupiedMask = (UInt16)Atlas3DNodeFlags.IsOccupied; - m_Flags &= (UInt16) ~isOccupiedMask; + m_Flags &= (UInt16)~isOccupiedMask; } public bool IsLeafNode() @@ -487,7 +487,7 @@ public bool EnsureTextureSlot(out bool isUploadNeeded, out Vector3 scale, out Ve isUploadNeeded = true; scale.Scale(new Vector3(1.0f / m_Width, 1.0f / m_Height, 1.0f / m_Depth)); bias.Scale(new Vector3(1.0f / m_Width, 1.0f / m_Height, 1.0f / m_Depth)); - m_AllocationCache.Add(key, new Texture3DAtlasScaleBias { scale = scale, bias = bias}); + m_AllocationCache.Add(key, new Texture3DAtlasScaleBias { scale = scale, bias = bias }); return true; } diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/XR/XRPass.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/XR/XRPass.cs index 636e826e351..eed41a706a5 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/XR/XRPass.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/XR/XRPass.cs @@ -70,24 +70,24 @@ class XRPass { readonly List views = new List(2); - internal bool enabled { get => views.Count > 0; } + internal bool enabled { get => views.Count > 0; } internal bool xrSdkEnabled { get; private set; } - internal bool copyDepth { get; private set; } + internal bool copyDepth { get; private set; } - internal int multipassId { get; private set; } - internal int cullingPassId { get; private set; } + internal int multipassId { get; private set; } + internal int cullingPassId { get; private set; } // Ability to specify where to render the pass - internal RenderTargetIdentifier renderTarget { get; private set; } + internal RenderTargetIdentifier renderTarget { get; private set; } internal RenderTextureDescriptor renderTargetDesc { get; private set; } - static RenderTargetIdentifier invalidRT = -1; - internal bool renderTargetValid { get => renderTarget != invalidRT; } + static RenderTargetIdentifier invalidRT = -1; + internal bool renderTargetValid { get => renderTarget != invalidRT; } // Access to view information - internal Matrix4x4 GetProjMatrix(int viewIndex = 0) { return views[viewIndex].projMatrix; } - internal Matrix4x4 GetViewMatrix(int viewIndex = 0) { return views[viewIndex].viewMatrix; } + internal Matrix4x4 GetProjMatrix(int viewIndex = 0) { return views[viewIndex].projMatrix; } + internal Matrix4x4 GetViewMatrix(int viewIndex = 0) { return views[viewIndex].viewMatrix; } internal int GetTextureArraySlice(int viewIndex = 0) { return views[viewIndex].textureArraySlice; } - internal Rect GetViewport(int viewIndex = 0) { return views[viewIndex].viewport; } + internal Rect GetViewport(int viewIndex = 0) { return views[viewIndex].viewport; } // Combined projection and view matrices for culling internal ScriptableCullingParameters cullingParams { get; private set; } diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/XR/XRSystem.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/XR/XRSystem.cs index 7f8324d0b13..d2bcaffde30 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/XR/XRSystem.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/XR/XRSystem.cs @@ -69,11 +69,11 @@ internal static void XRSystemInit() if (GraphicsSettings.currentRenderPipeline == null) return; - #if UNITY_2020_2_OR_NEWER +#if UNITY_2020_2_OR_NEWER SubsystemManager.GetSubsystems(displayList); - #else +#else SubsystemManager.GetInstances(displayList); - #endif +#endif for (int i = 0; i < displayList.Count; i++) { @@ -182,11 +182,11 @@ bool RefreshXrSdk() { #if ENABLE_VR && ENABLE_XR_MODULE - #if UNITY_2020_2_OR_NEWER +#if UNITY_2020_2_OR_NEWER SubsystemManager.GetSubsystems(displayList); - #else +#else SubsystemManager.GetInstances(displayList); - #endif +#endif if (displayList.Count > 0) { diff --git a/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariablesGlobal.cs b/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariablesGlobal.cs index aeca030c6c3..709419918b4 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariablesGlobal.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariablesGlobal.cs @@ -29,11 +29,11 @@ enum ConstantRegister [GenerateHLSL(needAccessors = false, generateCBuffer = true, constantRegister = (int)ConstantRegister.Global)] unsafe struct ShaderVariablesGlobal { - public const int RenderingLightLayersMask = 0x000000FF; - public const int RenderingLightLayersMaskShift = 0; - public const int RenderingDecalLayersMask = 0x0000FF00; - public const int RenderingDecalLayersMaskShift = 8; - public const int DefaultRenderingLayerMask = 0x0101; + public const int RenderingLightLayersMask = 0x000000FF; + public const int RenderingLightLayersMaskShift = 0; + public const int RenderingDecalLayersMask = 0x0000FF00; + public const int RenderingDecalLayersMaskShift = 8; + public const int DefaultRenderingLayerMask = 0x0101; // TODO: put commonly used vars together (below), and then sort them by the frequency of use (descending). // Note: a matrix is 4 * 4 * 4 = 64 bytes (1x cache line), so no need to sort those. @@ -115,35 +115,35 @@ unsafe struct ShaderVariablesGlobal public Vector4 _LastTimeParameters; // { t, sin(t), cos(t) } // Volumetric lighting / Fog. - public int _FogEnabled; - public int _PBRFogEnabled; - public int _EnableVolumetricFog; - public float _MaxFogDistance; - public Vector4 _FogColor; // color in rgb - public float _FogColorMode; - public float _Pad0; - public float _Pad1; - public float _Pad2; - public Vector4 _MipFogParameters; - public Vector4 _HeightFogBaseScattering; - public float _HeightFogBaseExtinction; - public float _HeightFogBaseHeight; - public float _GlobalFogAnisotropy; - public int _VolumetricFilteringEnabled; - public Vector2 _HeightFogExponents; // { 1/H, H } - public float _Pad4; - public float _Pad5; + public int _FogEnabled; + public int _PBRFogEnabled; + public int _EnableVolumetricFog; + public float _MaxFogDistance; + public Vector4 _FogColor; // color in rgb + public float _FogColorMode; + public float _Pad0; + public float _Pad1; + public float _Pad2; + public Vector4 _MipFogParameters; + public Vector4 _HeightFogBaseScattering; + public float _HeightFogBaseExtinction; + public float _HeightFogBaseHeight; + public float _GlobalFogAnisotropy; + public int _VolumetricFilteringEnabled; + public Vector2 _HeightFogExponents; // { 1/H, H } + public float _Pad4; + public float _Pad5; // VBuffer - public Vector4 _VBufferViewportSize; // { w, h, 1/w, 1/h } - public Vector4 _VBufferLightingViewportScale; // Necessary us to work with sub-allocation (resource aliasing) in the RTHandle system - public Vector4 _VBufferLightingViewportLimit; // Necessary us to work with sub-allocation (resource aliasing) in the RTHandle system - public Vector4 _VBufferDistanceEncodingParams; // See the call site for description - public Vector4 _VBufferDistanceDecodingParams; // See the call site for description - public uint _VBufferSliceCount; - public float _VBufferRcpSliceCount; - public float _VBufferRcpInstancedViewCount; // Used to remap VBuffer coordinates for XR - public float _VBufferLastSliceDist; // The distance to the middle of the last slice + public Vector4 _VBufferViewportSize; // { w, h, 1/w, 1/h } + public Vector4 _VBufferLightingViewportScale; // Necessary us to work with sub-allocation (resource aliasing) in the RTHandle system + public Vector4 _VBufferLightingViewportLimit; // Necessary us to work with sub-allocation (resource aliasing) in the RTHandle system + public Vector4 _VBufferDistanceEncodingParams; // See the call site for description + public Vector4 _VBufferDistanceDecodingParams; // See the call site for description + public uint _VBufferSliceCount; + public float _VBufferRcpSliceCount; + public float _VBufferRcpInstancedViewCount; // Used to remap VBuffer coordinates for XR + public float _VBufferLastSliceDist; // The distance to the middle of the last slice // Light Loop public const int s_MaxEnv2DLight = 32; @@ -161,25 +161,25 @@ unsafe struct ShaderVariablesGlobal [HLSLArray(s_MaxEnv2DLight, typeof(Vector4))] public fixed float _Env2DAtlasScaleOffset[s_MaxEnv2DLight * 4]; - public uint _DirectionalLightCount; - public uint _PunctualLightCount; - public uint _AreaLightCount; - public uint _EnvLightCount; + public uint _DirectionalLightCount; + public uint _PunctualLightCount; + public uint _AreaLightCount; + public uint _EnvLightCount; - public int _EnvLightSkyEnabled; - public uint _CascadeShadowCount; - public int _DirectionalShadowIndex; - public uint _EnableLightLayers; + public int _EnvLightSkyEnabled; + public uint _CascadeShadowCount; + public int _DirectionalShadowIndex; + public uint _EnableLightLayers; - public uint _EnableSkyReflection; - public uint _EnableSSRefraction; - public float _SSRefractionInvScreenWeightDistance; // Distance for screen space smoothstep with fallback - public float _ColorPyramidLodCount; + public uint _EnableSkyReflection; + public uint _EnableSSRefraction; + public float _SSRefractionInvScreenWeightDistance; // Distance for screen space smoothstep with fallback + public float _ColorPyramidLodCount; - public float _DirectionalTransmissionMultiplier; - public float _ProbeExposureScale; - public float _ContactShadowOpacity; - public float _ReplaceDiffuseForIndirect; + public float _DirectionalTransmissionMultiplier; + public float _ProbeExposureScale; + public float _ContactShadowOpacity; + public float _ReplaceDiffuseForIndirect; public Vector4 _AmbientOcclusionParam; // xyz occlusion color, w directLightStrenght @@ -189,29 +189,29 @@ unsafe struct ShaderVariablesGlobal public uint _ReflectionLightingLayers; public float _MicroShadowOpacity; - public uint _EnableProbeVolumes; - public uint _ProbeVolumeCount; + public uint _EnableProbeVolumes; + public uint _ProbeVolumeCount; public float _Pad6; - public Vector4 _CookieAtlasSize; - public Vector4 _CookieAtlasData; - public Vector4 _PlanarAtlasData; + public Vector4 _CookieAtlasSize; + public Vector4 _CookieAtlasData; + public Vector4 _PlanarAtlasData; // Tile/Cluster - public uint _NumTileFtplX; - public uint _NumTileFtplY; - public float g_fClustScale; - public float g_fClustBase; + public uint _NumTileFtplX; + public uint _NumTileFtplY; + public float g_fClustScale; + public float g_fClustBase; - public float g_fNearPlane; - public float g_fFarPlane; - public int g_iLog2NumClusters; // We need to always define these to keep constant buffer layouts compatible - public uint g_isLogBaseBufferEnabled; + public float g_fNearPlane; + public float g_fFarPlane; + public int g_iLog2NumClusters; // We need to always define these to keep constant buffer layouts compatible + public uint g_isLogBaseBufferEnabled; - public uint _NumTileClusteredX; - public uint _NumTileClusteredY; - public int _EnvSliceSize; - public float _Pad7; + public uint _NumTileClusteredX; + public uint _NumTileClusteredY; + public int _EnvSliceSize; + public float _Pad7; // Subsurface scattering // Use float4 to avoid any packing issue between compute and pixel shaders @@ -233,42 +233,42 @@ unsafe struct ShaderVariablesGlobal public uint _DiffusionProfileCount; // Decals - public Vector2 _DecalAtlasResolution; - public uint _EnableDecals; - public uint _DecalCount; + public Vector2 _DecalAtlasResolution; + public uint _EnableDecals; + public uint _DecalCount; public uint _OffScreenRendering; public uint _OffScreenDownsampleFactor; public uint _XRViewCount; - public int _FrameCount; + public int _FrameCount; public Vector4 _CoarseStencilBufferSize; - public int _IndirectDiffuseMode; // Match IndirectDiffuseMode enum in LightLoop.cs - public int _EnableRayTracedReflections; - public int _RaytracingFrameIndex; // Index of the current frame [0, 7] - public uint _EnableRecursiveRayTracing; + public int _IndirectDiffuseMode; // Match IndirectDiffuseMode enum in LightLoop.cs + public int _EnableRayTracedReflections; + public int _RaytracingFrameIndex; // Index of the current frame [0, 7] + public uint _EnableRecursiveRayTracing; // Probe Volumes - public Vector4 _ProbeVolumeAtlasResolutionAndSliceCount; - public Vector4 _ProbeVolumeAtlasResolutionAndSliceCountInverse; - public Vector4 _ProbeVolumeAtlasOctahedralDepthResolutionAndInverse; + public Vector4 _ProbeVolumeAtlasResolutionAndSliceCount; + public Vector4 _ProbeVolumeAtlasResolutionAndSliceCountInverse; + public Vector4 _ProbeVolumeAtlasOctahedralDepthResolutionAndInverse; - public int _ProbeVolumeLeakMitigationMode; - public float _ProbeVolumeBilateralFilterWeightMin; - public float _ProbeVolumeBilateralFilterWeight; - public uint _EnableDecalLayers; + public int _ProbeVolumeLeakMitigationMode; + public float _ProbeVolumeBilateralFilterWeightMin; + public float _ProbeVolumeBilateralFilterWeight; + public uint _EnableDecalLayers; [HLSLArray(7, typeof(Vector4))] public fixed float _ProbeVolumeAmbientProbeFallbackPackedCoeffs[7 * 4]; // 3 bands of SH, packed for storing global ambient probe lighting as fallback to probe volumes. - public int _TransparentCameraOnlyMotionVectors; + public int _TransparentCameraOnlyMotionVectors; // Can be set to 0 to globally "disable" tessellation // Because the DepthPrepass doesn't have a DEBUG_DISPLAY variant, it is the only way to disable it for debug modes - public float _GlobalTessellationFactorMultiplier; + public float _GlobalTessellationFactorMultiplier; - public float _SpecularOcclusionBlend; - public float _DeExposureMultiplier; + public float _SpecularOcclusionBlend; + public float _DeExposureMultiplier; } } diff --git a/com.unity.render-pipelines.high-definition/Runtime/Sky/HDRISky/HDRISky.cs b/com.unity.render-pipelines.high-definition/Runtime/Sky/HDRISky/HDRISky.cs index 675e2dc6d82..97ced4c9400 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Sky/HDRISky/HDRISky.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Sky/HDRISky/HDRISky.cs @@ -13,79 +13,79 @@ public class HDRISky : SkySettings { /// Cubemap used to render the HDRI sky. [Tooltip("Specify the cubemap HDRP uses to render the sky.")] - public CubemapParameter hdriSky = new CubemapParameter(null); + public CubemapParameter hdriSky = new CubemapParameter(null); /// Enable to have sky distortion. [Tooltip("Enable or disable sky distortion.")] - public BoolParameter enableDistortion = new BoolParameter(false); + public BoolParameter enableDistortion = new BoolParameter(false); /// Enable to have a simple, procedural distorsion. [Tooltip("If enabled, the sky will be distorted by a constant wind.")] - public BoolParameter procedural = new BoolParameter(true); + public BoolParameter procedural = new BoolParameter(true); /// Texture used to distort the uv for the HDRI sky. [Tooltip("Specify the flowmap HDRP uses for sky distortion (in LatLong layout).")] - public TextureParameter flowmap = new TextureParameter(null); + public TextureParameter flowmap = new TextureParameter(null); /// Enable to affect only the upper part of the sky. [Tooltip("Check this box if the flowmap covers only the upper part of the sky.")] - public BoolParameter upperHemisphereOnly = new BoolParameter(true); + public BoolParameter upperHemisphereOnly = new BoolParameter(true); /// Direction of the distortion. [Tooltip("Sets the rotation of the distortion (in degrees).")] - public ClampedFloatParameter scrollDirection = new ClampedFloatParameter(0.0f, 0.0f, 360.0f); + public ClampedFloatParameter scrollDirection = new ClampedFloatParameter(0.0f, 0.0f, 360.0f); /// Speed of the distortion. [Tooltip("Sets the scrolling speed of the distortion.")] - public MinFloatParameter scrollSpeed = new MinFloatParameter(2.0f, 0.0f); + public MinFloatParameter scrollSpeed = new MinFloatParameter(2.0f, 0.0f); /// Enable Backplate to have it visible. [AdditionalProperty] [Tooltip("Enable or disable the backplate.")] - public BoolParameter enableBackplate = new BoolParameter(false); + public BoolParameter enableBackplate = new BoolParameter(false); /// Backplate Type {Disc, Rectangle, Ellipse, Infinite (Plane)}. [AdditionalProperty] [Tooltip("Backplate type.")] - public BackplateTypeParameter backplateType = new BackplateTypeParameter(BackplateType.Disc); + public BackplateTypeParameter backplateType = new BackplateTypeParameter(BackplateType.Disc); /// Define the ground level of the Backplate. [AdditionalProperty] [Tooltip("Define the ground level of the Backplate.")] - public FloatParameter groundLevel = new FloatParameter(0.0f); + public FloatParameter groundLevel = new FloatParameter(0.0f); /// Extent of the Backplate (if circle only the X value is considered). [AdditionalProperty] [Tooltip("Extent of the Backplate (if circle only the X value is considered).")] - public Vector2Parameter scale = new Vector2Parameter(Vector2.one * 32.0f); + public Vector2Parameter scale = new Vector2Parameter(Vector2.one * 32.0f); /// Backplate's projection distance to varying the cubemap projection on the plate. [AdditionalProperty] [Tooltip("Backplate's projection distance to varying the cubemap projection on the plate.")] - public MinFloatParameter projectionDistance = new MinFloatParameter(16.0f, 1e-7f); + public MinFloatParameter projectionDistance = new MinFloatParameter(16.0f, 1e-7f); /// Backplate rotation parameter for the geometry. [AdditionalProperty] [Tooltip("Backplate rotation parameter for the geometry.")] - public ClampedFloatParameter plateRotation = new ClampedFloatParameter(0.0f, 0.0f, 360.0f); + public ClampedFloatParameter plateRotation = new ClampedFloatParameter(0.0f, 0.0f, 360.0f); /// Backplate rotation parameter for the projected texture. [AdditionalProperty] [Tooltip("Backplate rotation parameter for the projected texture.")] - public ClampedFloatParameter plateTexRotation = new ClampedFloatParameter(0.0f, 0.0f, 360.0f); + public ClampedFloatParameter plateTexRotation = new ClampedFloatParameter(0.0f, 0.0f, 360.0f); /// Backplate projection offset on the plane. [AdditionalProperty] [Tooltip("Backplate projection offset on the plane.")] - public Vector2Parameter plateTexOffset = new Vector2Parameter(Vector2.zero); + public Vector2Parameter plateTexOffset = new Vector2Parameter(Vector2.zero); /// Backplate blend parameter to blend the edge of the backplate with the background. [AdditionalProperty] [Tooltip("Backplate blend parameter to blend the edge of the backplate with the background.")] - public ClampedFloatParameter blendAmount = new ClampedFloatParameter(0.0f, 0.0f, 100.0f); + public ClampedFloatParameter blendAmount = new ClampedFloatParameter(0.0f, 0.0f, 100.0f); /// Backplate Shadow Tint projected on the plane. [AdditionalProperty] [Tooltip("Backplate Shadow Tint projected on the plane.")] - public ColorParameter shadowTint = new ColorParameter(Color.grey); + public ColorParameter shadowTint = new ColorParameter(Color.grey); /// Allow backplate to receive shadow from point light. [AdditionalProperty] [Tooltip("Allow backplate to receive shadow from point light.")] - public BoolParameter pointLightShadow = new BoolParameter(false); + public BoolParameter pointLightShadow = new BoolParameter(false); /// Allow backplate to receive shadow from directional light. [AdditionalProperty] [Tooltip("Allow backplate to receive shadow from directional light.")] - public BoolParameter dirLightShadow = new BoolParameter(false); + public BoolParameter dirLightShadow = new BoolParameter(false); /// Allow backplate to receive shadow from Area light. [AdditionalProperty] [Tooltip("Allow backplate to receive shadow from Area light.")] - public BoolParameter rectLightShadow = new BoolParameter(false); + public BoolParameter rectLightShadow = new BoolParameter(false); /// /// Returns the hash code of the HDRI sky parameters. diff --git a/com.unity.render-pipelines.high-definition/Runtime/Sky/HDRISky/HDRISkyRenderer.cs b/com.unity.render-pipelines.high-definition/Runtime/Sky/HDRISky/HDRISkyRenderer.cs index 7079e7e263f..db019a8d78f 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Sky/HDRISky/HDRISkyRenderer.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Sky/HDRISky/HDRISkyRenderer.cs @@ -11,10 +11,10 @@ class HDRISkyRenderer : SkyRenderer float scrollFactor = 0.0f, lastTime = 0.0f; - private static int m_RenderCubemapID = 0; // FragBaking - private static int m_RenderFullscreenSkyID = 1; // FragRender - private static int m_RenderFullscreenSkyWithBackplateID = 2; // FragRenderBackplate - private static int m_RenderDepthOnlyFullscreenSkyWithBackplateID = 3; // FragRenderBackplateDepth + private static int m_RenderCubemapID = 0; // FragBaking + private static int m_RenderFullscreenSkyID = 1; // FragRender + private static int m_RenderFullscreenSkyWithBackplateID = 2; // FragRenderBackplate + private static int m_RenderDepthOnlyFullscreenSkyWithBackplateID = 3; // FragRenderBackplateDepth public HDRISkyRenderer() { @@ -34,9 +34,9 @@ public override void Cleanup() private void GetParameters(out float intensity, out float phi, out float backplatePhi, BuiltinSkyParameters builtinParams, HDRISky hdriSky) { - intensity = GetSkyIntensity(hdriSky, builtinParams.debugSettings); - phi = -Mathf.Deg2Rad * hdriSky.rotation.value; // -rotation to match Legacy... - backplatePhi = phi - Mathf.Deg2Rad * hdriSky.plateRotation.value; + intensity = GetSkyIntensity(hdriSky, builtinParams.debugSettings); + phi = -Mathf.Deg2Rad * hdriSky.rotation.value; // -rotation to match Legacy... + backplatePhi = phi - Mathf.Deg2Rad * hdriSky.plateRotation.value; } private Vector4 GetBackplateParameters0(HDRISky hdriSky) diff --git a/com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/PhysicallyBasedSky.cs b/com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/PhysicallyBasedSky.cs index 77b7d7aee30..7606d619d15 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/PhysicallyBasedSky.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/PhysicallyBasedSky.cs @@ -28,7 +28,7 @@ public sealed class PhysicallyBasedSkyModelParameter : VolumeParameterModel parameter. /// Initial override state. public PhysicallyBasedSkyModelParameter(PhysicallyBasedSkyModel value, bool overrideState = false) - : base(value, overrideState) {} + : base(value, overrideState) { } } /// @@ -40,14 +40,14 @@ public PhysicallyBasedSkyModelParameter(PhysicallyBasedSkyModel value, bool over public partial class PhysicallyBasedSky : SkySettings { /* We use the measurements from Earth as the defaults. */ - const float k_DefaultEarthRadius = 6.3781f * 1000000; - const float k_DefaultAirScatteringR = 5.8f / 1000000; // at 680 nm, without ozone + const float k_DefaultEarthRadius = 6.3781f * 1000000; + const float k_DefaultAirScatteringR = 5.8f / 1000000; // at 680 nm, without ozone const float k_DefaultAirScatteringG = 13.5f / 1000000; // at 550 nm, without ozone const float k_DefaultAirScatteringB = 33.1f / 1000000; // at 440 nm, without ozone const float k_DefaultAirScaleHeight = 8000; - const float k_DefaultAirAlbedoR = 0.9f; // BS values to account for absorption - const float k_DefaultAirAlbedoG = 0.9f; // due to the ozone layer. We assume that ozone - const float k_DefaultAirAlbedoB = 1.0f; // has the same height distribution as air (most certainly WRONG). + const float k_DefaultAirAlbedoR = 0.9f; // BS values to account for absorption + const float k_DefaultAirAlbedoG = 0.9f; // due to the ozone layer. We assume that ozone + const float k_DefaultAirAlbedoB = 1.0f; // has the same height distribution as air (most certainly WRONG). const float k_DefaultAerosolScaleHeight = 1200; static readonly float k_DefaultAerosolMaximumAltitude = LayerDepthFromScaleHeight(k_DefaultAerosolScaleHeight); @@ -186,7 +186,7 @@ static internal float LayerDepthFromScaleHeight(float H) static internal float ExtinctionFromZenithOpacityAndScaleHeight(float alpha, float H) { - float opacity = Mathf.Min(alpha, 0.999999f); + float opacity = Mathf.Min(alpha, 0.999999f); float optDepth = -Mathf.Log(1 - opacity, 2.71828183f); // product of extinction and H return optDepth / H; diff --git a/com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/PhysicallyBasedSkyRenderer.cs b/com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/PhysicallyBasedSkyRenderer.cs index 7dd17adf306..d4d4e2d80d8 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/PhysicallyBasedSkyRenderer.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/PhysicallyBasedSkyRenderer.cs @@ -290,14 +290,14 @@ public bool Update(BuiltinSkyParameters builtinParams, PhysicallyBasedSky pbrSky int m_LastPrecomputationParamHash; // Precomputed data below. - PrecomputationData m_PrecomputedData; + PrecomputationData m_PrecomputedData; - static ComputeShader s_GroundIrradiancePrecomputationCS; - static ComputeShader s_InScatteredRadiancePrecomputationCS; - Material m_PbrSkyMaterial; + static ComputeShader s_GroundIrradiancePrecomputationCS; + static ComputeShader s_InScatteredRadiancePrecomputationCS; + Material m_PbrSkyMaterial; static MaterialPropertyBlock s_PbrSkyMaterialProperties; - static PrecomputationCache s_PrecomputaionCache = new PrecomputationCache(); + static PrecomputationCache s_PrecomputaionCache = new PrecomputationCache(); ShaderVariablesPhysicallyBasedSky m_ConstantBuffer; int m_ShaderVariablesPhysicallyBasedSkyID = Shader.PropertyToID("ShaderVariablesPhysicallyBasedSky"); @@ -311,17 +311,17 @@ public PhysicallyBasedSkyRenderer() public override void Build() { - var hdrpAsset = HDRenderPipeline.currentAsset; + var hdrpAsset = HDRenderPipeline.currentAsset; var hdrpResources = HDRenderPipeline.defaultAsset.renderPipelineResources; // Shaders - s_GroundIrradiancePrecomputationCS = hdrpResources.shaders.groundIrradiancePrecomputationCS; + s_GroundIrradiancePrecomputationCS = hdrpResources.shaders.groundIrradiancePrecomputationCS; s_InScatteredRadiancePrecomputationCS = hdrpResources.shaders.inScatteredRadiancePrecomputationCS; - s_PbrSkyMaterialProperties = new MaterialPropertyBlock(); + s_PbrSkyMaterialProperties = new MaterialPropertyBlock(); m_PbrSkyMaterial = CoreUtils.CreateEngineMaterial(hdrpResources.shaders.physicallyBasedSkyPS); - Debug.Assert(s_GroundIrradiancePrecomputationCS != null); + Debug.Assert(s_GroundIrradiancePrecomputationCS != null); Debug.Assert(s_InScatteredRadiancePrecomputationCS != null); } @@ -366,8 +366,8 @@ void UpdateGlobalConstantBuffer(CommandBuffer cmd, BuiltinSkyParameters builtinP { var pbrSky = builtinParams.skySettings as PhysicallyBasedSky; - float R = pbrSky.GetPlanetaryRadius(); - float D = pbrSky.GetMaximumAltitude(); + float R = pbrSky.GetPlanetaryRadius(); + float D = pbrSky.GetMaximumAltitude(); float airH = pbrSky.GetAirScaleHeight(); float aerH = pbrSky.GetAerosolScaleHeight(); float aerA = pbrSky.GetAerosolAnisotropy(); @@ -375,45 +375,45 @@ void UpdateGlobalConstantBuffer(CommandBuffer cmd, BuiltinSkyParameters builtinP Vector2 expParams = ComputeExponentialInterpolationParams(pbrSky.horizonZenithShift.value); - m_ConstantBuffer._PlanetaryRadius = R; - m_ConstantBuffer._RcpPlanetaryRadius = 1.0f / R; - m_ConstantBuffer._AtmosphericDepth = D; - m_ConstantBuffer._RcpAtmosphericDepth = 1.0f / D; + m_ConstantBuffer._PlanetaryRadius = R; + m_ConstantBuffer._RcpPlanetaryRadius = 1.0f / R; + m_ConstantBuffer._AtmosphericDepth = D; + m_ConstantBuffer._RcpAtmosphericDepth = 1.0f / D; - m_ConstantBuffer._AtmosphericRadius = R + D; - m_ConstantBuffer._AerosolAnisotropy = aerA; - m_ConstantBuffer._AerosolPhasePartConstant = CornetteShanksPhasePartConstant(aerA); - m_ConstantBuffer._Unused = 0.0f; // Warning fix - m_ConstantBuffer._Unused2 = 0.0f; // Warning fix + m_ConstantBuffer._AtmosphericRadius = R + D; + m_ConstantBuffer._AerosolAnisotropy = aerA; + m_ConstantBuffer._AerosolPhasePartConstant = CornetteShanksPhasePartConstant(aerA); + m_ConstantBuffer._Unused = 0.0f; // Warning fix + m_ConstantBuffer._Unused2 = 0.0f; // Warning fix - m_ConstantBuffer._AirDensityFalloff = 1.0f / airH; - m_ConstantBuffer._AirScaleHeight = airH; - m_ConstantBuffer._AerosolDensityFalloff = 1.0f / aerH; - m_ConstantBuffer._AerosolScaleHeight = aerH; + m_ConstantBuffer._AirDensityFalloff = 1.0f / airH; + m_ConstantBuffer._AirScaleHeight = airH; + m_ConstantBuffer._AerosolDensityFalloff = 1.0f / aerH; + m_ConstantBuffer._AerosolScaleHeight = aerH; - m_ConstantBuffer._AirSeaLevelExtinction = pbrSky.GetAirExtinctionCoefficient(); + m_ConstantBuffer._AirSeaLevelExtinction = pbrSky.GetAirExtinctionCoefficient(); m_ConstantBuffer._AerosolSeaLevelExtinction = pbrSky.GetAerosolExtinctionCoefficient(); - m_ConstantBuffer._AirSeaLevelScattering = pbrSky.GetAirScatteringCoefficient(); - m_ConstantBuffer._IntensityMultiplier = iMul; + m_ConstantBuffer._AirSeaLevelScattering = pbrSky.GetAirScatteringCoefficient(); + m_ConstantBuffer._IntensityMultiplier = iMul; m_ConstantBuffer._AerosolSeaLevelScattering = pbrSky.GetAerosolScatteringCoefficient(); - m_ConstantBuffer._ColorSaturation = pbrSky.colorSaturation.value; + m_ConstantBuffer._ColorSaturation = pbrSky.colorSaturation.value; Vector3 groundAlbedo = new Vector3(pbrSky.groundTint.value.r, pbrSky.groundTint.value.g, pbrSky.groundTint.value.b); - m_ConstantBuffer._GroundAlbedo = groundAlbedo; - m_ConstantBuffer._AlphaSaturation = pbrSky.alphaSaturation.value; + m_ConstantBuffer._GroundAlbedo = groundAlbedo; + m_ConstantBuffer._AlphaSaturation = pbrSky.alphaSaturation.value; - m_ConstantBuffer._PlanetCenterPosition = pbrSky.GetPlanetCenterPosition(builtinParams.worldSpaceCameraPos); - m_ConstantBuffer._AlphaMultiplier = pbrSky.alphaMultiplier.value; + m_ConstantBuffer._PlanetCenterPosition = pbrSky.GetPlanetCenterPosition(builtinParams.worldSpaceCameraPos); + m_ConstantBuffer._AlphaMultiplier = pbrSky.alphaMultiplier.value; Vector3 horizonTint = new Vector3(pbrSky.horizonTint.value.r, pbrSky.horizonTint.value.g, pbrSky.horizonTint.value.b); - m_ConstantBuffer._HorizonTint = horizonTint; - m_ConstantBuffer._HorizonZenithShiftPower = expParams.x; + m_ConstantBuffer._HorizonTint = horizonTint; + m_ConstantBuffer._HorizonZenithShiftPower = expParams.x; Vector3 zenithTint = new Vector3(pbrSky.zenithTint.value.r, pbrSky.zenithTint.value.g, pbrSky.zenithTint.value.b); - m_ConstantBuffer._ZenithTint = zenithTint; - m_ConstantBuffer._HorizonZenithShiftScale = expParams.y; + m_ConstantBuffer._ZenithTint = zenithTint; + m_ConstantBuffer._HorizonZenithShiftScale = expParams.y; ConstantBuffer.PushGlobal(cmd, m_ConstantBuffer, m_ShaderVariablesPhysicallyBasedSkyID); } @@ -460,15 +460,15 @@ public override void RenderSky(BuiltinSkyParameters builtinParams, bool renderFo pbrSky.planetRotation.value.y, pbrSky.planetRotation.value.z); - Quaternion spaceRotation = Quaternion.Euler(pbrSky.spaceRotation.value.x, + Quaternion spaceRotation = Quaternion.Euler(pbrSky.spaceRotation.value.x, pbrSky.spaceRotation.value.y, pbrSky.spaceRotation.value.z); s_PbrSkyMaterialProperties.SetMatrix(HDShaderIDs._PixelCoordToViewDirWS, builtinParams.pixelCoordToViewDirMatrix); - s_PbrSkyMaterialProperties.SetVector(HDShaderIDs._WorldSpaceCameraPos1, cameraPos); - s_PbrSkyMaterialProperties.SetMatrix(HDShaderIDs._ViewMatrix1, builtinParams.viewMatrix); - s_PbrSkyMaterialProperties.SetMatrix(HDShaderIDs._PlanetRotation, Matrix4x4.Rotate(planetRotation)); - s_PbrSkyMaterialProperties.SetMatrix(HDShaderIDs._SpaceRotation, Matrix4x4.Rotate(spaceRotation)); + s_PbrSkyMaterialProperties.SetVector(HDShaderIDs._WorldSpaceCameraPos1, cameraPos); + s_PbrSkyMaterialProperties.SetMatrix(HDShaderIDs._ViewMatrix1, builtinParams.viewMatrix); + s_PbrSkyMaterialProperties.SetMatrix(HDShaderIDs._PlanetRotation, Matrix4x4.Rotate(planetRotation)); + s_PbrSkyMaterialProperties.SetMatrix(HDShaderIDs._SpaceRotation, Matrix4x4.Rotate(spaceRotation)); m_PrecomputedData.BindBuffers(cmd, s_PbrSkyMaterialProperties); @@ -486,7 +486,7 @@ public override void RenderSky(BuiltinSkyParameters builtinParams, bool renderFo if (pbrSky.groundEmissionTexture.value != null && !simpleEarthMode) { hasGroundEmissionTexture = 1; - s_PbrSkyMaterialProperties.SetTexture(HDShaderIDs._GroundEmissionTexture, pbrSky.groundEmissionTexture.value); + s_PbrSkyMaterialProperties.SetTexture(HDShaderIDs._GroundEmissionTexture, pbrSky.groundEmissionTexture.value); s_PbrSkyMaterialProperties.SetFloat(HDShaderIDs._GroundEmissionMultiplier, pbrSky.groundEmissionMultiplier.value); } s_PbrSkyMaterialProperties.SetInt(HDShaderIDs._HasGroundEmissionTexture, hasGroundEmissionTexture); @@ -496,7 +496,7 @@ public override void RenderSky(BuiltinSkyParameters builtinParams, bool renderFo if (pbrSky.spaceEmissionTexture.value != null && !simpleEarthMode) { hasSpaceEmissionTexture = 1; - s_PbrSkyMaterialProperties.SetTexture(HDShaderIDs._SpaceEmissionTexture, pbrSky.spaceEmissionTexture.value); + s_PbrSkyMaterialProperties.SetTexture(HDShaderIDs._SpaceEmissionTexture, pbrSky.spaceEmissionTexture.value); s_PbrSkyMaterialProperties.SetFloat(HDShaderIDs._SpaceEmissionMultiplier, pbrSky.spaceEmissionMultiplier.value); } s_PbrSkyMaterialProperties.SetInt(HDShaderIDs._HasSpaceEmissionTexture, hasSpaceEmissionTexture); diff --git a/com.unity.render-pipelines.high-definition/Runtime/Sky/SkyManager.cs b/com.unity.render-pipelines.high-definition/Runtime/Sky/SkyManager.cs index d5434d3fd19..45a2f14b2f2 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Sky/SkyManager.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Sky/SkyManager.cs @@ -44,39 +44,39 @@ public enum EnvironmentUpdateMode public class BuiltinSkyParameters { /// Camera used for rendering. - public HDCamera hdCamera; + public HDCamera hdCamera; /// Matrix mapping pixel coordinate to view direction. - public Matrix4x4 pixelCoordToViewDirMatrix; + public Matrix4x4 pixelCoordToViewDirMatrix; /// World space camera position. - public Vector3 worldSpaceCameraPos; + public Vector3 worldSpaceCameraPos; /// Camera view matrix. - public Matrix4x4 viewMatrix; + public Matrix4x4 viewMatrix; /// Screen size: Width, height, inverse width, inverse height. - public Vector4 screenSize; + public Vector4 screenSize; /// Command buffer used for rendering. - public CommandBuffer commandBuffer; + public CommandBuffer commandBuffer; /// Current sun light. - public Light sunLight; + public Light sunLight; /// Color buffer used for rendering. - public RTHandle colorBuffer; + public RTHandle colorBuffer; /// Depth buffer used for rendering. - public RTHandle depthBuffer; + public RTHandle depthBuffer; /// Current frame index. - public int frameIndex; + public int frameIndex; /// Current sky settings. - public SkySettings skySettings; + public SkySettings skySettings; /// Current debug dsplay settings. - public DebugDisplaySettings debugSettings; + public DebugDisplaySettings debugSettings; /// Null color buffer render target identifier. public static RenderTargetIdentifier nullRT = -1; } struct CachedSkyContext { - public Type type; - public SkyRenderingContext renderingContext; - public int hash; - public int refCount; + public Type type; + public SkyRenderingContext renderingContext; + public int hash; + public int refCount; public void Reset() { @@ -99,15 +99,15 @@ public void Cleanup() class SkyManager { - Material m_StandardSkyboxMaterial; // This is the Unity standard skybox material. Used to pass the correct cubemap to Enlighten. - Material m_BlitCubemapMaterial; - Material m_OpaqueAtmScatteringMaterial; + Material m_StandardSkyboxMaterial; // This is the Unity standard skybox material. Used to pass the correct cubemap to Enlighten. + Material m_BlitCubemapMaterial; + Material m_OpaqueAtmScatteringMaterial; - SphericalHarmonicsL2 m_BlackAmbientProbe = new SphericalHarmonicsL2(); + SphericalHarmonicsL2 m_BlackAmbientProbe = new SphericalHarmonicsL2(); - bool m_UpdateRequired = false; - bool m_StaticSkyUpdateRequired = false; - int m_Resolution; + bool m_UpdateRequired = false; + bool m_StaticSkyUpdateRequired = false; + int m_Resolution; // Sky used for static lighting. It will be used for ambient lighting if Ambient Mode is set to Static (even when realtime GI is enabled) // It will also be used for lightmap and light probe baking @@ -126,7 +126,7 @@ class SkyManager private static List m_StaticLightingSkies = new List(); // Only show the procedural sky upgrade message once - static bool logOnce = true; + static bool logOnce = true; // This boolean here is only to track the first frame after a domain reload or creation. bool m_RequireWaitForAsyncReadBackRequest = true; @@ -139,26 +139,26 @@ class SkyManager #endif // Shared resources for sky rendering. - IBLFilterBSDF[] m_IBLFilterArray; - RTHandle m_SkyboxBSDFCubemapIntermediate; - Vector4 m_CubemapScreenSize; - Matrix4x4[] m_facePixelCoordToViewDirMatrices = new Matrix4x4[6]; - Matrix4x4[] m_CameraRelativeViewMatrices = new Matrix4x4[6]; - BuiltinSkyParameters m_BuiltinParameters = new BuiltinSkyParameters(); - ComputeShader m_ComputeAmbientProbeCS; - readonly int m_AmbientProbeOutputBufferParam = Shader.PropertyToID("_AmbientProbeOutputBuffer"); - readonly int m_AmbientProbeInputCubemap = Shader.PropertyToID("_AmbientProbeInputCubemap"); - int m_ComputeAmbientProbeKernel; - CubemapArray m_BlackCubemapArray; + IBLFilterBSDF[] m_IBLFilterArray; + RTHandle m_SkyboxBSDFCubemapIntermediate; + Vector4 m_CubemapScreenSize; + Matrix4x4[] m_facePixelCoordToViewDirMatrices = new Matrix4x4[6]; + Matrix4x4[] m_CameraRelativeViewMatrices = new Matrix4x4[6]; + BuiltinSkyParameters m_BuiltinParameters = new BuiltinSkyParameters(); + ComputeShader m_ComputeAmbientProbeCS; + readonly int m_AmbientProbeOutputBufferParam = Shader.PropertyToID("_AmbientProbeOutputBuffer"); + readonly int m_AmbientProbeInputCubemap = Shader.PropertyToID("_AmbientProbeInputCubemap"); + int m_ComputeAmbientProbeKernel; + CubemapArray m_BlackCubemapArray; // 2 by default: Static sky + one dynamic. Will grow if needed. DynamicArray m_CachedSkyContexts = new DynamicArray(2); public SkyManager() - {} + { } ~SkyManager() - {} + { } internal static SkySettings GetSkySetting(VolumeStack stack) { @@ -689,15 +689,15 @@ internal void RequestStaticEnvironmentUpdate() m_RequireWaitForAsyncReadBackRequest = true; } - public void UpdateEnvironment(HDCamera hdCamera, + public void UpdateEnvironment(HDCamera hdCamera, ScriptableRenderContext renderContext, - SkyUpdateContext skyContext, - Light sunLight, - bool updateRequired, - bool updateAmbientProbe, - bool staticSky, - SkyAmbientMode ambientMode, - CommandBuffer cmd) + SkyUpdateContext skyContext, + Light sunLight, + bool updateRequired, + bool updateAmbientProbe, + bool staticSky, + SkyAmbientMode ambientMode, + CommandBuffer cmd) { if (skyContext.IsValid()) { diff --git a/com.unity.render-pipelines.high-definition/Runtime/Sky/SkyRenderer.cs b/com.unity.render-pipelines.high-definition/Runtime/Sky/SkyRenderer.cs index 203ea852c1b..93bf034fd72 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Sky/SkyRenderer.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Sky/SkyRenderer.cs @@ -43,7 +43,7 @@ public virtual void PreRenderSky(BuiltinSkyParameters builtinParams, bool render /// Preprocess for rendering the sky. Called before the DepthPrePass operations /// /// Engine parameters that you can use to render the sky. - public virtual void PreRenderSky(BuiltinSkyParameters builtinParams) {} + public virtual void PreRenderSky(BuiltinSkyParameters builtinParams) { } /// diff --git a/com.unity.render-pipelines.high-definition/Runtime/Sky/SkyRenderingContext.cs b/com.unity.render-pipelines.high-definition/Runtime/Sky/SkyRenderingContext.cs index 9016477b396..32f7e0a911b 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Sky/SkyRenderingContext.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Sky/SkyRenderingContext.cs @@ -5,7 +5,7 @@ namespace UnityEngine.Rendering.HighDefinition { internal class SkyRenderingContext { - SphericalHarmonicsL2 m_AmbientProbe; + SphericalHarmonicsL2 m_AmbientProbe; public SphericalHarmonicsL2 ambientProbe => m_AmbientProbe; diff --git a/com.unity.render-pipelines.high-definition/Runtime/Sky/SkySettings.cs b/com.unity.render-pipelines.high-definition/Runtime/Sky/SkySettings.cs index 441ad44f08c..4a043f065b0 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Sky/SkySettings.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Sky/SkySettings.cs @@ -35,7 +35,7 @@ public sealed class EnvUpdateParameter : VolumeParameter /// Environment Update Mode parameter. /// Initial override state. public EnvUpdateParameter(EnvironmentUpdateMode value, bool overrideState = false) - : base(value, overrideState) {} + : base(value, overrideState) { } } /// @@ -79,7 +79,7 @@ public sealed class BackplateTypeParameter : VolumeParameter /// Backplate Type parameter. /// Initial override state. public BackplateTypeParameter(BackplateType value, bool overrideState = false) - : base(value, overrideState) {} + : base(value, overrideState) { } } /// @@ -94,7 +94,7 @@ public sealed class SkyIntensityParameter : VolumeParameter /// Sky Intensity parameter. /// Initial override state. public SkyIntensityParameter(SkyIntensityMode value, bool overrideState = false) - : base(value, overrideState) {} + : base(value, overrideState) { } } /// @@ -104,37 +104,37 @@ public abstract class SkySettings : VolumeComponent { /// Rotation of the sky. [Tooltip("Sets the rotation of the sky.")] - public ClampedFloatParameter rotation = new ClampedFloatParameter(0.0f, 0.0f, 360.0f); + public ClampedFloatParameter rotation = new ClampedFloatParameter(0.0f, 0.0f, 360.0f); /// Intensity mode of the sky. [Tooltip("Specifies the intensity mode HDRP uses for the sky.")] - public SkyIntensityParameter skyIntensityMode = new SkyIntensityParameter(SkyIntensityMode.Exposure); + public SkyIntensityParameter skyIntensityMode = new SkyIntensityParameter(SkyIntensityMode.Exposure); /// Exposure of the sky. [Tooltip("Sets the exposure of the sky in EV.")] - public FloatParameter exposure = new FloatParameter(0.0f); + public FloatParameter exposure = new FloatParameter(0.0f); /// Intensity Multipler of the sky. [Tooltip("Sets the intensity multiplier for the sky.")] - public MinFloatParameter multiplier = new MinFloatParameter(1.0f, 0.0f); + public MinFloatParameter multiplier = new MinFloatParameter(1.0f, 0.0f); /// Informative helper that displays the relative intensity (in Lux) for the current HDR texture set in HDRI Sky. [Tooltip("Informative helper that displays the relative intensity (in Lux) for the current HDR texture set in HDRI Sky.")] - public MinFloatParameter upperHemisphereLuxValue = new MinFloatParameter(1.0f, 0.0f); + public MinFloatParameter upperHemisphereLuxValue = new MinFloatParameter(1.0f, 0.0f); /// Informative helper that displays Show the color of Shadow. [Tooltip("Informative helper that displays Show the color of Shadow.")] - public Vector3Parameter upperHemisphereLuxColor = new Vector3Parameter(new Vector3(0, 0, 0)); + public Vector3Parameter upperHemisphereLuxColor = new Vector3Parameter(new Vector3(0, 0, 0)); /// Absolute intensity (in lux) of the sky. [Tooltip("Sets the absolute intensity (in Lux) of the current HDR texture set in HDRI Sky. Functions as a Lux intensity multiplier for the sky.")] - public FloatParameter desiredLuxValue = new FloatParameter(20000); + public FloatParameter desiredLuxValue = new FloatParameter(20000); /// Update mode of the sky. [Tooltip("Specifies when HDRP updates the environment lighting. When set to OnDemand, use HDRenderPipeline.RequestSkyEnvironmentUpdate() to request an update.")] - public EnvUpdateParameter updateMode = new EnvUpdateParameter(EnvironmentUpdateMode.OnChanged); + public EnvUpdateParameter updateMode = new EnvUpdateParameter(EnvironmentUpdateMode.OnChanged); /// In case of real-time update mode, time between updates. 0 means every frame. [Tooltip("Sets the period, in seconds, at which HDRP updates the environment ligting (0 means HDRP updates it every frame).")] - public MinFloatParameter updatePeriod = new MinFloatParameter(0.0f, 0.0f); + public MinFloatParameter updatePeriod = new MinFloatParameter(0.0f, 0.0f); /// True if the sun disk should be included in the baking information (where available). [Tooltip("When enabled, HDRP uses the Sun Disk in baked lighting.")] - public BoolParameter includeSunInBaking = new BoolParameter(false); + public BoolParameter includeSunInBaking = new BoolParameter(false); - static Dictionary skyUniqueIDs = new Dictionary(); + static Dictionary skyUniqueIDs = new Dictionary(); /// /// Returns the hash code of the sky parameters. diff --git a/com.unity.render-pipelines.high-definition/Runtime/Sky/SkyUpdateContext.cs b/com.unity.render-pipelines.high-definition/Runtime/Sky/SkyUpdateContext.cs index c96e5894218..88fa86a8ca0 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Sky/SkyUpdateContext.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Sky/SkyUpdateContext.cs @@ -4,12 +4,12 @@ namespace UnityEngine.Rendering.HighDefinition { internal class SkyUpdateContext { - SkySettings m_SkySettings; - public SkyRenderer skyRenderer { get; private set; } - public int cachedSkyRenderingContextId = -1; + SkySettings m_SkySettings; + public SkyRenderer skyRenderer { get; private set; } + public int cachedSkyRenderingContextId = -1; - public int skyParametersHash = -1; - public float currentUpdateTime = 0.0f; + public int skyParametersHash = -1; + public float currentUpdateTime = 0.0f; public bool settingsHadBigDifferenceWithPrev { get; private set; } diff --git a/com.unity.render-pipelines.high-definition/Runtime/Sky/StaticLightingSky.cs b/com.unity.render-pipelines.high-definition/Runtime/Sky/StaticLightingSky.cs index c6185774709..cb58380001a 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Sky/StaticLightingSky.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Sky/StaticLightingSky.cs @@ -146,7 +146,7 @@ void UpdateCurrentStaticLightingSky() int parameterCount = m_SkySettings.parameters.Count; // Copy overridden parameters. - for (int i = 0; i < parameterCount; ++i) + for (int i = 0; i < parameterCount; ++i) { if (profileSkyParameters[i].overrideState == true) { diff --git a/com.unity.render-pipelines.high-definition/Runtime/Sky/VisualEnvironment.cs b/com.unity.render-pipelines.high-definition/Runtime/Sky/VisualEnvironment.cs index 99105738f70..f6619c61d8d 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Sky/VisualEnvironment.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Sky/VisualEnvironment.cs @@ -60,6 +60,6 @@ public sealed class SkyAmbientModeParameter : VolumeParameter /// Sky Ambient Mode parameter. /// Initial override value. public SkyAmbientModeParameter(SkyAmbientMode value, bool overrideState = false) - : base(value, overrideState) {} + : base(value, overrideState) { } } } diff --git a/com.unity.render-pipelines.high-definition/Runtime/Utilities/CameraCache.cs b/com.unity.render-pipelines.high-definition/Runtime/Utilities/CameraCache.cs index 94127ac2d81..32011d83ceb 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Utilities/CameraCache.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Utilities/CameraCache.cs @@ -11,7 +11,7 @@ namespace UnityEngine.Rendering.HighDefinition /// history buffers of the HDCamera are used. /// /// The type of the key. - class CameraCache: IDisposable + class CameraCache : IDisposable { Dictionary m_Cache = new Dictionary(); K[] cameraKeysCache = new K[0]; diff --git a/com.unity.render-pipelines.high-definition/Runtime/Utilities/CameraSettings.cs b/com.unity.render-pipelines.high-definition/Runtime/Utilities/CameraSettings.cs index c5aee297567..7d2dc7cb2cf 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Utilities/CameraSettings.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Utilities/CameraSettings.cs @@ -290,7 +290,7 @@ public static CameraSettings From(HDCamera hdCamera) settings.frustum.projectionMatrix = hdCamera.camera.projectionMatrix; settings.invertFaceCulling = false; - HDAdditionalCameraData add; + HDAdditionalCameraData add; if (hdCamera.camera.TryGetComponent(out add)) { settings.customRenderingSettings = add.customRenderingSettings; @@ -350,10 +350,14 @@ public static CameraSettings From(HDCamera hdCamera) // Marked as internal as it is here just for propagation purposes, the correct way to edit this value is through the probe itself. internal float probeRangeCompressionFactor; - [SerializeField][FormerlySerializedAs("renderingPath")][Obsolete("For data migration")] + [SerializeField] + [FormerlySerializedAs("renderingPath")] + [Obsolete("For data migration")] internal int m_ObsoleteRenderingPath; #pragma warning disable 618 // Type or member is obsolete - [SerializeField][FormerlySerializedAs("frameSettings")][Obsolete("For data migration")] + [SerializeField] + [FormerlySerializedAs("frameSettings")] + [Obsolete("For data migration")] internal ObsoleteFrameSettings m_ObsoleteFrameSettings; #pragma warning restore 618 diff --git a/com.unity.render-pipelines.high-definition/Runtime/Utilities/HDTextureUtilities.cs b/com.unity.render-pipelines.high-definition/Runtime/Utilities/HDTextureUtilities.cs index 213774f5246..9a5d3538381 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Utilities/HDTextureUtilities.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Utilities/HDTextureUtilities.cs @@ -70,7 +70,7 @@ public static Texture2D CopyRenderTextureToTexture2D(RenderTexture source) var result = RenderTexture.GetTemporary(resolution * 6, resolution, 0, source.format); var cmd = new CommandBuffer(); for (var i = 0; i < 6; ++i) - cmd.CopyTexture(source, i, 0, 0, 0, resolution, resolution, result, 0, 0, i * resolution, 0); + cmd.CopyTexture(source, i, 0, 0, 0, resolution, resolution, result, 0, 0, i * resolution, 0); Graphics.ExecuteCommandBuffer(cmd); var t2D = new Texture2D(resolution * 6, resolution, format, false); diff --git a/com.unity.render-pipelines.high-definition/Runtime/Utilities/ProbeSettings.cs b/com.unity.render-pipelines.high-definition/Runtime/Utilities/ProbeSettings.cs index 2edce1a4f97..14e9b18e5bf 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Utilities/ProbeSettings.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Utilities/ProbeSettings.cs @@ -266,7 +266,7 @@ public static ProbeSettings NewDefault() /// The proxy settings of the probe for the current volume. public ProxySettings proxySettings; /// An int scalable setting value - [Serializable] public class PlanarReflectionAtlasResolutionScalableSettingValue : ScalableSettingValue {} + [Serializable] public class PlanarReflectionAtlasResolutionScalableSettingValue : ScalableSettingValue { } /// Camera settings to use when capturing data. /// The resolution of the probe. public PlanarReflectionAtlasResolutionScalableSettingValue resolutionScalable; diff --git a/com.unity.render-pipelines.high-definition/Runtime/Utilities/TypeInfo.cs b/com.unity.render-pipelines.high-definition/Runtime/Utilities/TypeInfo.cs index a8fe368557d..2e3d33a1bf9 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Utilities/TypeInfo.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Utilities/TypeInfo.cs @@ -5,7 +5,7 @@ namespace UnityEngine.Rendering.HighDefinition static class TypeInfo { struct EnumInfoJITCache - // closest way to constraint to an enum without 'Enum' generic constraint + // closest way to constraint to an enum without 'Enum' generic constraint where TEnum : struct, IConvertible { public static readonly TEnum[] values; diff --git a/com.unity.render-pipelines.high-definition/Runtime/VFXGraph/Utility/PropertyBinders/HDRPCameraBinder.cs b/com.unity.render-pipelines.high-definition/Runtime/VFXGraph/Utility/PropertyBinders/HDRPCameraBinder.cs index a8fcbfb7b31..ace69693d2b 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/VFXGraph/Utility/PropertyBinders/HDRPCameraBinder.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/VFXGraph/Utility/PropertyBinders/HDRPCameraBinder.cs @@ -162,7 +162,7 @@ public override void UpdateBinding(VisualEffect component) /// String containing the binder information. public override string ToString() { - return string.Format($"HDRP Camera : '{(AdditionalData == null? "null" : AdditionalData.gameObject.name)}' -> {CameraProperty}"); + return string.Format($"HDRP Camera : '{(AdditionalData == null ? "null" : AdditionalData.gameObject.name)}' -> {CameraProperty}"); } } } diff --git a/com.unity.render-pipelines.high-definition/Tests/Editor/FrameSettingsTest.cs b/com.unity.render-pipelines.high-definition/Tests/Editor/FrameSettingsTest.cs index 51993aff79a..3b2927655e2 100644 --- a/com.unity.render-pipelines.high-definition/Tests/Editor/FrameSettingsTest.cs +++ b/com.unity.render-pipelines.high-definition/Tests/Editor/FrameSettingsTest.cs @@ -20,7 +20,7 @@ public void TearDown() CoreUtils.Destroy(m_ToClean); FrameSettingsHistory.containers?.Clear(); } - catch {} + catch { } } [Test] diff --git a/com.unity.render-pipelines.high-definition/Tests/Runtime/SampleRuntimeTests.cs b/com.unity.render-pipelines.high-definition/Tests/Runtime/SampleRuntimeTests.cs index 7785c6480c1..6c7e080cf34 100644 --- a/com.unity.render-pipelines.high-definition/Tests/Runtime/SampleRuntimeTests.cs +++ b/com.unity.render-pipelines.high-definition/Tests/Runtime/SampleRuntimeTests.cs @@ -13,7 +13,7 @@ class SampleRuntimeTests { const float k_Epsilon = 1e-4f; - static List s_Scenes = new List {}; + static List s_Scenes = new List { }; public IEnumerator SampleLoadSceneTest() { diff --git a/com.unity.render-pipelines.universal/Editor/2D/Light2DEditor.cs b/com.unity.render-pipelines.universal/Editor/2D/Light2DEditor.cs index 800f9592bc9..27457729124 100644 --- a/com.unity.render-pipelines.universal/Editor/2D/Light2DEditor.cs +++ b/com.unity.render-pipelines.universal/Editor/2D/Light2DEditor.cs @@ -117,12 +117,12 @@ private static class Styles public static string deprecatedParametricLightDialogCancel = "Cancel"; } - const float k_GlobalLightGizmoSize = 1.2f; - const float k_AngleCapSize = 0.16f * k_GlobalLightGizmoSize; - const float k_AngleCapOffset = 0.08f * k_GlobalLightGizmoSize; - const float k_AngleCapOffsetSecondary = -0.05f; - const float k_RangeCapSize = 0.025f * k_GlobalLightGizmoSize; - const float k_InnerRangeCapSize = 0.08f * k_GlobalLightGizmoSize; + const float k_GlobalLightGizmoSize = 1.2f; + const float k_AngleCapSize = 0.16f * k_GlobalLightGizmoSize; + const float k_AngleCapOffset = 0.08f * k_GlobalLightGizmoSize; + const float k_AngleCapOffsetSecondary = -0.05f; + const float k_RangeCapSize = 0.025f * k_GlobalLightGizmoSize; + const float k_InnerRangeCapSize = 0.08f * k_GlobalLightGizmoSize; SerializedProperty m_LightType; SerializedProperty m_LightColor; @@ -155,15 +155,15 @@ private static class Styles SerializedProperty m_ShapeLightParametricSides; SerializedProperty m_ShapeLightSprite; - SavedBool m_BlendingSettingsFoldout; - SavedBool m_ShadowsSettingsFoldout; - SavedBool m_VolumetricSettingsFoldout; - SavedBool m_NormalMapsSettingsFoldout; + SavedBool m_BlendingSettingsFoldout; + SavedBool m_ShadowsSettingsFoldout; + SavedBool m_VolumetricSettingsFoldout; + SavedBool m_NormalMapsSettingsFoldout; - int[] m_BlendStyleIndices; - GUIContent[] m_BlendStyleNames; - bool m_AnyBlendStyleEnabled = false; + int[] m_BlendStyleIndices; + GUIContent[] m_BlendStyleNames; + bool m_AnyBlendStyleEnabled = false; SortingLayerDropDown m_SortingLayerDropDown; diff --git a/com.unity.render-pipelines.universal/Editor/2D/Renderer2DAnalytics.cs b/com.unity.render-pipelines.universal/Editor/2D/Renderer2DAnalytics.cs index b00f2831829..481720f267f 100644 --- a/com.unity.render-pipelines.universal/Editor/2D/Renderer2DAnalytics.cs +++ b/com.unity.render-pipelines.universal/Editor/2D/Renderer2DAnalytics.cs @@ -11,7 +11,7 @@ struct AnalyticsDataTypes public const string k_Renderer2DDataString = "u2drendererdata"; } - internal interface IAnalyticsData {}; + internal interface IAnalyticsData { }; [Serializable] internal struct Light2DData : IAnalyticsData diff --git a/com.unity.render-pipelines.universal/Editor/2D/Renderer2DUpgrader.cs b/com.unity.render-pipelines.universal/Editor/2D/Renderer2DUpgrader.cs index d499c4397f6..74cb9b1b99d 100644 --- a/com.unity.render-pipelines.universal/Editor/2D/Renderer2DUpgrader.cs +++ b/com.unity.render-pipelines.universal/Editor/2D/Renderer2DUpgrader.cs @@ -44,7 +44,7 @@ public static void UpgradeParametricLight(Light2D light) float radius = light.shapeLightParametricRadius; float angle = light.shapeLightParametricAngleOffset; - int sides = light.shapeLightParametricSides; + int sides = light.shapeLightParametricSides; var angleOffset = Mathf.PI / 2.0f + Mathf.Deg2Rad * angle; if (sides < 3) diff --git a/com.unity.render-pipelines.universal/Editor/2D/ShadowCaster2DEditor.cs b/com.unity.render-pipelines.universal/Editor/2D/ShadowCaster2DEditor.cs index 7607be74e7f..65c4beb2fdd 100644 --- a/com.unity.render-pipelines.universal/Editor/2D/ShadowCaster2DEditor.cs +++ b/com.unity.render-pipelines.universal/Editor/2D/ShadowCaster2DEditor.cs @@ -49,7 +49,7 @@ public override void SetDefaultShape() internal class ShadowCaster2DEditor : PathComponentEditor { [EditorTool("Edit Shadow Caster Shape", typeof(ShadowCaster2D))] - class ShadowCaster2DShadowCasterShapeTool : ShadowCaster2DShapeTool {}; + class ShadowCaster2DShadowCasterShapeTool : ShadowCaster2DShapeTool { }; private static class Styles { diff --git a/com.unity.render-pipelines.universal/Editor/2D/ShapeEditor/EditablePath/EditablePathController.cs b/com.unity.render-pipelines.universal/Editor/2D/ShapeEditor/EditablePath/EditablePathController.cs index a12de0727f7..08831a43ad6 100644 --- a/com.unity.render-pipelines.universal/Editor/2D/ShapeEditor/EditablePath/EditablePathController.cs +++ b/com.unity.render-pipelines.universal/Editor/2D/ShapeEditor/EditablePath/EditablePathController.cs @@ -208,8 +208,8 @@ public void SetRightTangent(int index, Vector3 position, bool setToLinear, bool editablePath.SetPoint(index, controlPoint); } - public void ClearClosestPath() {} - public void AddClosestPath(float distance) {} + public void ClearClosestPath() { } + public void AddClosestPath(float distance) { } private Vector3 GetLeftTangentPosition(int index) { diff --git a/com.unity.render-pipelines.universal/Editor/2D/ShapeEditor/EditorTool/GenericScriptablePath.cs b/com.unity.render-pipelines.universal/Editor/2D/ShapeEditor/EditorTool/GenericScriptablePath.cs index b7dcac0735e..d31e9d2ca41 100644 --- a/com.unity.render-pipelines.universal/Editor/2D/ShapeEditor/EditorTool/GenericScriptablePath.cs +++ b/com.unity.render-pipelines.universal/Editor/2D/ShapeEditor/EditorTool/GenericScriptablePath.cs @@ -67,6 +67,6 @@ protected virtual T Create() return Activator.CreateInstance(); } - protected virtual void Destroy(T data) {} + protected virtual void Destroy(T data) { } } } diff --git a/com.unity.render-pipelines.universal/Editor/2D/ShapeEditor/EditorTool/PathEditorTool.cs b/com.unity.render-pipelines.universal/Editor/2D/ShapeEditor/EditorTool/PathEditorTool.cs index 494fe29a294..950a88632a6 100644 --- a/com.unity.render-pipelines.universal/Editor/2D/ShapeEditor/EditorTool/PathEditorTool.cs +++ b/com.unity.render-pipelines.universal/Editor/2D/ShapeEditor/EditorTool/PathEditorTool.cs @@ -489,11 +489,11 @@ private Vector3 GetRight(UnityObject target) } protected abstract IShape GetShape(UnityObject target); - protected virtual void Initialize(T path, SerializedObject serializedObject) {} + protected virtual void Initialize(T path, SerializedObject serializedObject) { } protected abstract void SetShape(T path, SerializedObject serializedObject); - protected virtual void OnActivate() {} - protected virtual void OnDeactivate() {} - protected virtual void OnCustomGUI(T path) {} + protected virtual void OnActivate() { } + protected virtual void OnDeactivate() { } + protected virtual void OnCustomGUI(T path) { } } } #pragma warning restore 0618 diff --git a/com.unity.render-pipelines.universal/Editor/2D/ShapeEditor/EditorTool/ScriptablePath.cs b/com.unity.render-pipelines.universal/Editor/2D/ShapeEditor/EditorTool/ScriptablePath.cs index 03b7a452963..1a011e58e7b 100644 --- a/com.unity.render-pipelines.universal/Editor/2D/ShapeEditor/EditorTool/ScriptablePath.cs +++ b/com.unity.render-pipelines.universal/Editor/2D/ShapeEditor/EditorTool/ScriptablePath.cs @@ -31,7 +31,7 @@ public ShapeType shapeType public IUndoObject undoObject { get { return this; } - set {} + set { } } public ISelection selection diff --git a/com.unity.render-pipelines.universal/Editor/2D/ShapeEditor/EditorTool/ScriptablePathInspector.cs b/com.unity.render-pipelines.universal/Editor/2D/ShapeEditor/EditorTool/ScriptablePathInspector.cs index e92932e6fc3..f4c2060dd1e 100644 --- a/com.unity.render-pipelines.universal/Editor/2D/ShapeEditor/EditorTool/ScriptablePathInspector.cs +++ b/com.unity.render-pipelines.universal/Editor/2D/ShapeEditor/EditorTool/ScriptablePathInspector.cs @@ -177,7 +177,7 @@ private bool GetMixedPosition(out Vector3 position) if (first) { - position = controlPoint.position; + position = controlPoint.position; first = false; } else if (position != controlPoint.position) diff --git a/com.unity.render-pipelines.universal/Editor/2D/ShapeEditor/GUIFramework/GUIState.cs b/com.unity.render-pipelines.universal/Editor/2D/ShapeEditor/GUIFramework/GUIState.cs index 7316e8ffa73..a2b65f70651 100644 --- a/com.unity.render-pipelines.universal/Editor/2D/ShapeEditor/GUIFramework/GUIState.cs +++ b/com.unity.render-pipelines.universal/Editor/2D/ShapeEditor/GUIFramework/GUIState.cs @@ -5,7 +5,7 @@ namespace UnityEditor.Experimental.Rendering.Universal.Path2D.GUIFramework { internal class GUIState : IGUIState { - private Handles.CapFunction nullCap = (int c, Vector3 p , Quaternion r, float s, EventType ev) => {}; + private Handles.CapFunction nullCap = (int c, Vector3 p, Quaternion r, float s, EventType ev) => { }; public Vector2 mousePosition { diff --git a/com.unity.render-pipelines.universal/Editor/2D/ShapeEditor/Selection/RectSelector.cs b/com.unity.render-pipelines.universal/Editor/2D/ShapeEditor/Selection/RectSelector.cs index 4c4ec7e15e3..988f573c42b 100644 --- a/com.unity.render-pipelines.universal/Editor/2D/ShapeEditor/Selection/RectSelector.cs +++ b/com.unity.render-pipelines.universal/Editor/2D/ShapeEditor/Selection/RectSelector.cs @@ -25,7 +25,7 @@ public Rect guiRect get { return m_GUIRect; } } - public RectSelector() : this(new GUISystem(new GUIState())) {} + public RectSelector() : this(new GUISystem(new GUIState())) { } public RectSelector(GUISystem guiSystem) { diff --git a/com.unity.render-pipelines.universal/Editor/2D/ShapeEditor/View/EditablePathView.cs b/com.unity.render-pipelines.universal/Editor/2D/ShapeEditor/View/EditablePathView.cs index 4a8726fee41..8ef9af99e1a 100644 --- a/com.unity.render-pipelines.universal/Editor/2D/ShapeEditor/View/EditablePathView.cs +++ b/com.unity.render-pipelines.universal/Editor/2D/ShapeEditor/View/EditablePathView.cs @@ -26,7 +26,7 @@ internal class EditablePathView : IEditablePathView private GUIAction m_MoveRightTangentAction; private IDrawer m_Drawer; - public EditablePathView() : this(new Drawer()) {} + public EditablePathView() : this(new Drawer()) { } public EditablePathView(IDrawer drawer) { @@ -200,7 +200,7 @@ public EditablePathView(IDrawer drawer) onSliderChanged = (guiState, control, position) => { var index = control.hotLayoutData.index; - var delta = position - GetPoint(index).position; + var delta = position - GetPoint(index).position; controller.MoveEdge(index, delta); } @@ -466,7 +466,7 @@ private void DrawEdge(IGUIState guiState, Control control, int index) private bool EnableCreatePointRepaint(IGUIState guiState, GUIAction action) { return guiState.nearestControl != m_PointControl.ID && - guiState.hotControl == 0 && + guiState.hotControl == 0 && (guiState.nearestControl != m_LeftTangentControl.ID) && (guiState.nearestControl != m_RightTangentControl.ID); } diff --git a/com.unity.render-pipelines.universal/Editor/2D/SortingLayerDropDown.cs b/com.unity.render-pipelines.universal/Editor/2D/SortingLayerDropDown.cs index 9284b61a800..c248acd220d 100644 --- a/com.unity.render-pipelines.universal/Editor/2D/SortingLayerDropDown.cs +++ b/com.unity.render-pipelines.universal/Editor/2D/SortingLayerDropDown.cs @@ -10,8 +10,8 @@ internal class SortingLayerDropDown private class LayerSelectionData { public SerializedObject serializedObject; - public Object[] targets; - public int layerID; + public Object[] targets; + public int layerID; public System.Action onSelectionChanged; public LayerSelectionData(SerializedObject so, int lid, Object[] tgts, System.Action selectionChangedCallback) diff --git a/com.unity.render-pipelines.universal/Editor/AssetPostProcessors/MaterialPostprocessor.cs b/com.unity.render-pipelines.universal/Editor/AssetPostProcessors/MaterialPostprocessor.cs index 0e05c256ec9..46c3f859dff 100644 --- a/com.unity.render-pipelines.universal/Editor/AssetPostProcessors/MaterialPostprocessor.cs +++ b/com.unity.render-pipelines.universal/Editor/AssetPostProcessors/MaterialPostprocessor.cs @@ -255,7 +255,7 @@ static void UpgradeV3(Material material, ShaderPathID shaderID) } static void UpgradeV4(Material material, ShaderPathID shaderID) - {} + { } } // Upgraders v1 @@ -338,7 +338,7 @@ public static void UpgradeToSimpleLit(Material material) throw new ArgumentNullException("material"); var smoothnessSource = 1 - (int)material.GetFloat("_GlossinessSource"); - material.SetFloat("_SmoothnessSource" , smoothnessSource); + material.SetFloat("_SmoothnessSource", smoothnessSource); if (material.GetTexture("_SpecGlossMap") == null) { var col = material.GetColor("_SpecColor"); diff --git a/com.unity.render-pipelines.universal/Editor/ForwardRendererDataEditor.cs b/com.unity.render-pipelines.universal/Editor/ForwardRendererDataEditor.cs index 26df19b9cc8..645d2c9dd1c 100644 --- a/com.unity.render-pipelines.universal/Editor/ForwardRendererDataEditor.cs +++ b/com.unity.render-pipelines.universal/Editor/ForwardRendererDataEditor.cs @@ -6,7 +6,8 @@ namespace UnityEditor.Rendering.Universal { [CustomEditor(typeof(ForwardRendererData), true)] - [MovedFrom("UnityEditor.Rendering.LWRP")] public class ForwardRendererDataEditor : ScriptableRendererDataEditor + [MovedFrom("UnityEditor.Rendering.LWRP")] + public class ForwardRendererDataEditor : ScriptableRendererDataEditor { private static class Styles { diff --git a/com.unity.render-pipelines.universal/Editor/LightExplorer.cs b/com.unity.render-pipelines.universal/Editor/LightExplorer.cs index 072f687caa9..9701a52c957 100644 --- a/com.unity.render-pipelines.universal/Editor/LightExplorer.cs +++ b/com.unity.render-pipelines.universal/Editor/LightExplorer.cs @@ -6,7 +6,8 @@ namespace UnityEditor { [LightingExplorerExtensionAttribute(typeof(UniversalRenderPipelineAsset))] - [MovedFrom("UnityEditor.Rendering.LWRP")] public class LightExplorer : DefaultLightingExplorerExtension + [MovedFrom("UnityEditor.Rendering.LWRP")] + public class LightExplorer : DefaultLightingExplorerExtension { private static class Styles { diff --git a/com.unity.render-pipelines.universal/Editor/Overrides/ChannelMixerEditor.cs b/com.unity.render-pipelines.universal/Editor/Overrides/ChannelMixerEditor.cs index 17c6794b381..491258da5bc 100644 --- a/com.unity.render-pipelines.universal/Editor/Overrides/ChannelMixerEditor.cs +++ b/com.unity.render-pipelines.universal/Editor/Overrides/ChannelMixerEditor.cs @@ -22,15 +22,15 @@ public override void OnEnable() { var o = new PropertyFetcher(serializedObject); - m_RedOutRedIn = Unpack(o.Find(x => x.redOutRedIn)); - m_RedOutGreenIn = Unpack(o.Find(x => x.redOutGreenIn)); - m_RedOutBlueIn = Unpack(o.Find(x => x.redOutBlueIn)); - m_GreenOutRedIn = Unpack(o.Find(x => x.greenOutRedIn)); + m_RedOutRedIn = Unpack(o.Find(x => x.redOutRedIn)); + m_RedOutGreenIn = Unpack(o.Find(x => x.redOutGreenIn)); + m_RedOutBlueIn = Unpack(o.Find(x => x.redOutBlueIn)); + m_GreenOutRedIn = Unpack(o.Find(x => x.greenOutRedIn)); m_GreenOutGreenIn = Unpack(o.Find(x => x.greenOutGreenIn)); - m_GreenOutBlueIn = Unpack(o.Find(x => x.greenOutBlueIn)); - m_BlueOutRedIn = Unpack(o.Find(x => x.blueOutRedIn)); - m_BlueOutGreenIn = Unpack(o.Find(x => x.blueOutGreenIn)); - m_BlueOutBlueIn = Unpack(o.Find(x => x.blueOutBlueIn)); + m_GreenOutBlueIn = Unpack(o.Find(x => x.greenOutBlueIn)); + m_BlueOutRedIn = Unpack(o.Find(x => x.blueOutRedIn)); + m_BlueOutGreenIn = Unpack(o.Find(x => x.blueOutGreenIn)); + m_BlueOutBlueIn = Unpack(o.Find(x => x.blueOutBlueIn)); m_SelectedChannel = new SavedInt($"{target.GetType()}.SelectedChannel", 0); } diff --git a/com.unity.render-pipelines.universal/Editor/Overrides/ShadowsMidtonesHighlightsEditor.cs b/com.unity.render-pipelines.universal/Editor/Overrides/ShadowsMidtonesHighlightsEditor.cs index 24d66280896..d22f6203176 100644 --- a/com.unity.render-pipelines.universal/Editor/Overrides/ShadowsMidtonesHighlightsEditor.cs +++ b/com.unity.render-pipelines.universal/Editor/Overrides/ShadowsMidtonesHighlightsEditor.cs @@ -28,13 +28,13 @@ public override void OnEnable() { var o = new PropertyFetcher(serializedObject); - m_Shadows = Unpack(o.Find(x => x.shadows)); - m_Midtones = Unpack(o.Find(x => x.midtones)); - m_Highlights = Unpack(o.Find(x => x.highlights)); - m_ShadowsStart = Unpack(o.Find(x => x.shadowsStart)); - m_ShadowsEnd = Unpack(o.Find(x => x.shadowsEnd)); + m_Shadows = Unpack(o.Find(x => x.shadows)); + m_Midtones = Unpack(o.Find(x => x.midtones)); + m_Highlights = Unpack(o.Find(x => x.highlights)); + m_ShadowsStart = Unpack(o.Find(x => x.shadowsStart)); + m_ShadowsEnd = Unpack(o.Find(x => x.shadowsEnd)); m_HighlightsStart = Unpack(o.Find(x => x.highlightsStart)); - m_HighlightsEnd = Unpack(o.Find(x => x.highlightsEnd)); + m_HighlightsEnd = Unpack(o.Find(x => x.highlightsEnd)); } public override void OnInspectorGUI() diff --git a/com.unity.render-pipelines.universal/Editor/SavedParameter.cs b/com.unity.render-pipelines.universal/Editor/SavedParameter.cs index e087abd33b2..cebcb996ace 100644 --- a/com.unity.render-pipelines.universal/Editor/SavedParameter.cs +++ b/com.unity.render-pipelines.universal/Editor/SavedParameter.cs @@ -61,24 +61,24 @@ public T value sealed class SavedBool : SavedParameter { public SavedBool(string key, bool value) - : base(key, value, EditorPrefs.GetBool, EditorPrefs.SetBool) {} + : base(key, value, EditorPrefs.GetBool, EditorPrefs.SetBool) { } } sealed class SavedInt : SavedParameter { public SavedInt(string key, int value) - : base(key, value, EditorPrefs.GetInt, EditorPrefs.SetInt) {} + : base(key, value, EditorPrefs.GetInt, EditorPrefs.SetInt) { } } sealed class SavedFloat : SavedParameter { public SavedFloat(string key, float value) - : base(key, value, EditorPrefs.GetFloat, EditorPrefs.SetFloat) {} + : base(key, value, EditorPrefs.GetFloat, EditorPrefs.SetFloat) { } } sealed class SavedString : SavedParameter { public SavedString(string key, string value) - : base(key, value, EditorPrefs.GetString, EditorPrefs.SetString) {} + : base(key, value, EditorPrefs.GetString, EditorPrefs.SetString) { } } } diff --git a/com.unity.render-pipelines.universal/Editor/ScriptableRendererDataEditor.cs b/com.unity.render-pipelines.universal/Editor/ScriptableRendererDataEditor.cs index 55a80ab575d..d02218b2fc9 100644 --- a/com.unity.render-pipelines.universal/Editor/ScriptableRendererDataEditor.cs +++ b/com.unity.render-pipelines.universal/Editor/ScriptableRendererDataEditor.cs @@ -10,7 +10,8 @@ namespace UnityEditor.Rendering.Universal { [CustomEditor(typeof(ScriptableRendererData), true)] - [MovedFrom("UnityEditor.Rendering.LWRP")] public class ScriptableRendererDataEditor : Editor + [MovedFrom("UnityEditor.Rendering.LWRP")] + public class ScriptableRendererDataEditor : Editor { class Styles { diff --git a/com.unity.render-pipelines.universal/Editor/ShaderGUI/BaseShaderGUI.cs b/com.unity.render-pipelines.universal/Editor/ShaderGUI/BaseShaderGUI.cs index 3ad8ec2f864..de7b2c1afe7 100644 --- a/com.unity.render-pipelines.universal/Editor/ShaderGUI/BaseShaderGUI.cs +++ b/com.unity.render-pipelines.universal/Editor/ShaderGUI/BaseShaderGUI.cs @@ -184,7 +184,7 @@ public virtual void OnOpenGUI(Material material, MaterialEditor materialEditor) m_SurfaceInputsFoldout = new SavedBool($"{m_HeaderStateKey}.SurfaceInputsFoldout", true); m_AdvancedFoldout = new SavedBool($"{m_HeaderStateKey}.AdvancedFoldout", false); - foreach (var obj in materialEditor.targets) + foreach (var obj in materialEditor.targets) MaterialChanged((Material)obj); } @@ -223,7 +223,7 @@ public void ShaderPropertiesGUI(Material material) if (EditorGUI.EndChangeCheck()) { - foreach (var obj in materialEditor.targets) + foreach (var obj in materialEditor.targets) MaterialChanged((Material)obj); } } @@ -299,7 +299,7 @@ protected void DrawQueueOffsetField() } } - public virtual void DrawAdditionalFoldouts(Material material) {} + public virtual void DrawAdditionalFoldouts(Material material) { } public virtual void DrawBaseProperties(Material material) { diff --git a/com.unity.render-pipelines.universal/Editor/ShaderGUI/ParticleGUI.cs b/com.unity.render-pipelines.universal/Editor/ShaderGUI/ParticleGUI.cs index 61d380ca5be..614eeb04263 100644 --- a/com.unity.render-pipelines.universal/Editor/ShaderGUI/ParticleGUI.cs +++ b/com.unity.render-pipelines.universal/Editor/ShaderGUI/ParticleGUI.cs @@ -8,7 +8,8 @@ namespace UnityEditor.Rendering.Universal.ShaderGUI { - [MovedFrom("UnityEditor.Rendering.LWRP.ShaderGUI")] public static class ParticleGUI + [MovedFrom("UnityEditor.Rendering.LWRP.ShaderGUI")] + public static class ParticleGUI { public enum ColorMode { @@ -312,7 +313,8 @@ public static void DoVertexStreamsArea(Material material, List { + vertexStreamList.drawHeaderCallback = (Rect rect) => + { EditorGUI.LabelField(rect, "Vertex Streams"); }; diff --git a/com.unity.render-pipelines.universal/Editor/ShaderGUI/ShadingModels/BakedLitGUI.cs b/com.unity.render-pipelines.universal/Editor/ShaderGUI/ShadingModels/BakedLitGUI.cs index 8c7807748e2..d7aa6b38449 100644 --- a/com.unity.render-pipelines.universal/Editor/ShaderGUI/ShadingModels/BakedLitGUI.cs +++ b/com.unity.render-pipelines.universal/Editor/ShaderGUI/ShadingModels/BakedLitGUI.cs @@ -5,7 +5,8 @@ namespace UnityEditor.Rendering.Universal.ShaderGUI { - [MovedFrom("UnityEditor.Rendering.LWRP.ShaderGUI")] public static class BakedLitGUI + [MovedFrom("UnityEditor.Rendering.LWRP.ShaderGUI")] + public static class BakedLitGUI { public struct BakedLitProperties { diff --git a/com.unity.render-pipelines.universal/Editor/ShaderGUI/ShadingModels/LitGUI.cs b/com.unity.render-pipelines.universal/Editor/ShaderGUI/ShadingModels/LitGUI.cs index eda388c2188..3f6f0d6b47c 100644 --- a/com.unity.render-pipelines.universal/Editor/ShaderGUI/ShadingModels/LitGUI.cs +++ b/com.unity.render-pipelines.universal/Editor/ShaderGUI/ShadingModels/LitGUI.cs @@ -5,7 +5,8 @@ namespace UnityEditor.Rendering.Universal.ShaderGUI { - [MovedFrom("UnityEditor.Rendering.LWRP.ShaderGUI")] public static class LitGUI + [MovedFrom("UnityEditor.Rendering.LWRP.ShaderGUI")] + public static class LitGUI { public enum WorkflowMode { @@ -50,14 +51,14 @@ public static class Styles public static GUIContent occlusionText = new GUIContent("Occlusion Map", "Sets an occlusion map to simulate shadowing from ambient lighting."); - public static readonly string[] metallicSmoothnessChannelNames = {"Metallic Alpha", "Albedo Alpha"}; - public static readonly string[] specularSmoothnessChannelNames = {"Specular Alpha", "Albedo Alpha"}; + public static readonly string[] metallicSmoothnessChannelNames = { "Metallic Alpha", "Albedo Alpha" }; + public static readonly string[] specularSmoothnessChannelNames = { "Specular Alpha", "Albedo Alpha" }; - public static GUIContent clearCoatText = new GUIContent("Clear Coat", + public static GUIContent clearCoatText = new GUIContent("Clear Coat", "A multi-layer material feature which simulates a thin layer of coating on top of the surface material." + "\nPerformance cost is considerable as the specular component is evaluated twice, once per layer."); - public static GUIContent clearCoatMaskText = new GUIContent("Mask", + public static GUIContent clearCoatMaskText = new GUIContent("Mask", "Specifies the amount of the coat blending." + "\nActs as a multiplier of the clear coat map mask value or as a direct mask value if no map is specified." + "\nThe map specifies clear coat mask in the red channel and clear coat smoothness in the green channel."); @@ -116,9 +117,9 @@ public LitProperties(MaterialProperty[] properties) highlights = BaseShaderGUI.FindProperty("_SpecularHighlights", properties, false); reflections = BaseShaderGUI.FindProperty("_EnvironmentReflections", properties, false); - clearCoat = BaseShaderGUI.FindProperty("_ClearCoat", properties, false); - clearCoatMap = BaseShaderGUI.FindProperty("_ClearCoatMap", properties, false); - clearCoatMask = BaseShaderGUI.FindProperty("_ClearCoatMask", properties, false); + clearCoat = BaseShaderGUI.FindProperty("_ClearCoat", properties, false); + clearCoatMap = BaseShaderGUI.FindProperty("_ClearCoatMap", properties, false); + clearCoatMask = BaseShaderGUI.FindProperty("_ClearCoatMask", properties, false); clearCoatSmoothness = BaseShaderGUI.FindProperty("_ClearCoatSmoothness", properties, false); } } @@ -190,7 +191,7 @@ public static void DoClearCoat(LitProperties properties, MaterialEditor material EditorGUI.indentLevel += 2; // Texture and HDR color controls - materialEditor.ShaderProperty(properties.clearCoatSmoothness , Styles.clearCoatSmoothnessText); + materialEditor.ShaderProperty(properties.clearCoatSmoothness, Styles.clearCoatSmoothnessText); EditorGUI.indentLevel -= 2; } diff --git a/com.unity.render-pipelines.universal/Editor/ShaderGUI/ShadingModels/SimpleLitGUI.cs b/com.unity.render-pipelines.universal/Editor/ShaderGUI/ShadingModels/SimpleLitGUI.cs index 89f9e193f74..f5b7af12869 100644 --- a/com.unity.render-pipelines.universal/Editor/ShaderGUI/ShadingModels/SimpleLitGUI.cs +++ b/com.unity.render-pipelines.universal/Editor/ShaderGUI/ShadingModels/SimpleLitGUI.cs @@ -5,7 +5,8 @@ namespace UnityEditor.Rendering.Universal.ShaderGUI { - [MovedFrom("UnityEditor.Rendering.LWRP.ShaderGUI")] public static class SimpleLitGUI + [MovedFrom("UnityEditor.Rendering.LWRP.ShaderGUI")] + public static class SimpleLitGUI { public enum SpecularSource { diff --git a/com.unity.render-pipelines.universal/Editor/ShaderGraph/AssetCallbacks/CreateLitShaderGraph.cs b/com.unity.render-pipelines.universal/Editor/ShaderGraph/AssetCallbacks/CreateLitShaderGraph.cs index 1b76bb4d2de..ac923157f2b 100644 --- a/com.unity.render-pipelines.universal/Editor/ShaderGraph/AssetCallbacks/CreateLitShaderGraph.cs +++ b/com.unity.render-pipelines.universal/Editor/ShaderGraph/AssetCallbacks/CreateLitShaderGraph.cs @@ -24,7 +24,7 @@ public static void CreateLitGraph() BlockFields.SurfaceDescription.Occlusion, }; - GraphUtil.CreateNewGraphWithOutputs(new[] {target}, blockDescriptors); + GraphUtil.CreateNewGraphWithOutputs(new[] { target }, blockDescriptors); } } } diff --git a/com.unity.render-pipelines.universal/Editor/ShaderGraph/AssetCallbacks/CreateSpriteLitShaderGraph.cs b/com.unity.render-pipelines.universal/Editor/ShaderGraph/AssetCallbacks/CreateSpriteLitShaderGraph.cs index 61383f08633..d3ce27e1482 100644 --- a/com.unity.render-pipelines.universal/Editor/ShaderGraph/AssetCallbacks/CreateSpriteLitShaderGraph.cs +++ b/com.unity.render-pipelines.universal/Editor/ShaderGraph/AssetCallbacks/CreateSpriteLitShaderGraph.cs @@ -22,7 +22,7 @@ public static void CreateSpriteLitGraph() BlockFields.SurfaceDescription.Alpha, }; - GraphUtil.CreateNewGraphWithOutputs(new[] {target}, blockDescriptors); + GraphUtil.CreateNewGraphWithOutputs(new[] { target }, blockDescriptors); } } } diff --git a/com.unity.render-pipelines.universal/Editor/ShaderGraph/AssetCallbacks/CreateSpriteUnlitShaderGraph.cs b/com.unity.render-pipelines.universal/Editor/ShaderGraph/AssetCallbacks/CreateSpriteUnlitShaderGraph.cs index bcbae228c35..5af31a34dc3 100644 --- a/com.unity.render-pipelines.universal/Editor/ShaderGraph/AssetCallbacks/CreateSpriteUnlitShaderGraph.cs +++ b/com.unity.render-pipelines.universal/Editor/ShaderGraph/AssetCallbacks/CreateSpriteUnlitShaderGraph.cs @@ -20,7 +20,7 @@ public static void CreateSpriteUnlitGraph() BlockFields.SurfaceDescription.Alpha, }; - GraphUtil.CreateNewGraphWithOutputs(new[] {target}, blockDescriptors); + GraphUtil.CreateNewGraphWithOutputs(new[] { target }, blockDescriptors); } } } diff --git a/com.unity.render-pipelines.universal/Editor/ShaderGraph/AssetCallbacks/CreateUnlitShaderGraph.cs b/com.unity.render-pipelines.universal/Editor/ShaderGraph/AssetCallbacks/CreateUnlitShaderGraph.cs index 8d93aa9245f..774a285c4d3 100644 --- a/com.unity.render-pipelines.universal/Editor/ShaderGraph/AssetCallbacks/CreateUnlitShaderGraph.cs +++ b/com.unity.render-pipelines.universal/Editor/ShaderGraph/AssetCallbacks/CreateUnlitShaderGraph.cs @@ -19,7 +19,7 @@ public static void CreateUnlitGraph() BlockFields.SurfaceDescription.BaseColor, }; - GraphUtil.CreateNewGraphWithOutputs(new[] {target}, blockDescriptors); + GraphUtil.CreateNewGraphWithOutputs(new[] { target }, blockDescriptors); } } } diff --git a/com.unity.render-pipelines.universal/Editor/ShaderGraph/Targets/UniversalLitSubTarget.cs b/com.unity.render-pipelines.universal/Editor/ShaderGraph/Targets/UniversalLitSubTarget.cs index 7945c35e131..197cd54a0a5 100644 --- a/com.unity.render-pipelines.universal/Editor/ShaderGraph/Targets/UniversalLitSubTarget.cs +++ b/com.unity.render-pipelines.universal/Editor/ShaderGraph/Targets/UniversalLitSubTarget.cs @@ -65,7 +65,7 @@ public override void Setup(ref TargetSetupContext context) // Process SubShaders SubShaderDescriptor[] litSubShaders = { SubShaders.LitComputeDOTS, SubShaders.LitGLES }; - SubShaderDescriptor[] complexLitSubShaders = { SubShaders.ComplexLitComputeDOTS, SubShaders.LitGLESForwardOnly}; + SubShaderDescriptor[] complexLitSubShaders = { SubShaders.ComplexLitComputeDOTS, SubShaders.LitGLESForwardOnly }; // TODO: In the future: // We could take a copy of subshaders and dynamically modify them here. @@ -91,19 +91,19 @@ public override void GetFields(ref TargetFieldContext context) var descs = context.blocks.Select(x => x.descriptor); // Surface Type & Blend Mode // These must be set per SubTarget as Sprite SubTargets override them - context.AddField(UniversalFields.SurfaceOpaque, target.surfaceType == SurfaceType.Opaque); - context.AddField(UniversalFields.SurfaceTransparent, target.surfaceType != SurfaceType.Opaque); - context.AddField(UniversalFields.BlendAdd, target.surfaceType != SurfaceType.Opaque && target.alphaMode == AlphaMode.Additive); - context.AddField(Fields.BlendAlpha, target.surfaceType != SurfaceType.Opaque && target.alphaMode == AlphaMode.Alpha); - context.AddField(UniversalFields.BlendMultiply, target.surfaceType != SurfaceType.Opaque && target.alphaMode == AlphaMode.Multiply); - context.AddField(UniversalFields.BlendPremultiply, target.surfaceType != SurfaceType.Opaque && target.alphaMode == AlphaMode.Premultiply); + context.AddField(UniversalFields.SurfaceOpaque, target.surfaceType == SurfaceType.Opaque); + context.AddField(UniversalFields.SurfaceTransparent, target.surfaceType != SurfaceType.Opaque); + context.AddField(UniversalFields.BlendAdd, target.surfaceType != SurfaceType.Opaque && target.alphaMode == AlphaMode.Additive); + context.AddField(Fields.BlendAlpha, target.surfaceType != SurfaceType.Opaque && target.alphaMode == AlphaMode.Alpha); + context.AddField(UniversalFields.BlendMultiply, target.surfaceType != SurfaceType.Opaque && target.alphaMode == AlphaMode.Multiply); + context.AddField(UniversalFields.BlendPremultiply, target.surfaceType != SurfaceType.Opaque && target.alphaMode == AlphaMode.Premultiply); // Lit - context.AddField(UniversalFields.NormalDropOffOS, normalDropOffSpace == NormalDropOffSpace.Object); - context.AddField(UniversalFields.NormalDropOffTS, normalDropOffSpace == NormalDropOffSpace.Tangent); - context.AddField(UniversalFields.NormalDropOffWS, normalDropOffSpace == NormalDropOffSpace.World); - context.AddField(UniversalFields.SpecularSetup, workflowMode == WorkflowMode.Specular); - context.AddField(UniversalFields.Normal, descs.Contains(BlockFields.SurfaceDescription.NormalOS) || + context.AddField(UniversalFields.NormalDropOffOS, normalDropOffSpace == NormalDropOffSpace.Object); + context.AddField(UniversalFields.NormalDropOffTS, normalDropOffSpace == NormalDropOffSpace.Tangent); + context.AddField(UniversalFields.NormalDropOffWS, normalDropOffSpace == NormalDropOffSpace.World); + context.AddField(UniversalFields.SpecularSetup, workflowMode == WorkflowMode.Specular); + context.AddField(UniversalFields.Normal, descs.Contains(BlockFields.SurfaceDescription.NormalOS) || descs.Contains(BlockFields.SurfaceDescription.NormalTS) || descs.Contains(BlockFields.SurfaceDescription.NormalWS)); // Complex Lit @@ -115,17 +115,17 @@ public override void GetFields(ref TargetFieldContext context) public override void GetActiveBlocks(ref TargetActiveBlockContext context) { context.AddBlock(BlockFields.SurfaceDescription.Smoothness); - context.AddBlock(BlockFields.SurfaceDescription.NormalOS, normalDropOffSpace == NormalDropOffSpace.Object); - context.AddBlock(BlockFields.SurfaceDescription.NormalTS, normalDropOffSpace == NormalDropOffSpace.Tangent); - context.AddBlock(BlockFields.SurfaceDescription.NormalWS, normalDropOffSpace == NormalDropOffSpace.World); + context.AddBlock(BlockFields.SurfaceDescription.NormalOS, normalDropOffSpace == NormalDropOffSpace.Object); + context.AddBlock(BlockFields.SurfaceDescription.NormalTS, normalDropOffSpace == NormalDropOffSpace.Tangent); + context.AddBlock(BlockFields.SurfaceDescription.NormalWS, normalDropOffSpace == NormalDropOffSpace.World); context.AddBlock(BlockFields.SurfaceDescription.Emission); context.AddBlock(BlockFields.SurfaceDescription.Occlusion); - context.AddBlock(BlockFields.SurfaceDescription.Specular, workflowMode == WorkflowMode.Specular); - context.AddBlock(BlockFields.SurfaceDescription.Metallic, workflowMode == WorkflowMode.Metallic); - context.AddBlock(BlockFields.SurfaceDescription.Alpha, target.surfaceType == SurfaceType.Transparent || target.alphaClip); + context.AddBlock(BlockFields.SurfaceDescription.Specular, workflowMode == WorkflowMode.Specular); + context.AddBlock(BlockFields.SurfaceDescription.Metallic, workflowMode == WorkflowMode.Metallic); + context.AddBlock(BlockFields.SurfaceDescription.Alpha, target.surfaceType == SurfaceType.Transparent || target.alphaClip); context.AddBlock(BlockFields.SurfaceDescription.AlphaClipThreshold, target.alphaClip); - context.AddBlock(BlockFields.SurfaceDescription.CoatMask, clearCoat); - context.AddBlock(BlockFields.SurfaceDescription.CoatSmoothness, clearCoat); + context.AddBlock(BlockFields.SurfaceDescription.CoatMask, clearCoat); + context.AddBlock(BlockFields.SurfaceDescription.CoatSmoothness, clearCoat); } public override void GetPropertiesGUI(ref TargetPropertyGUIContext context, Action onChange, Action registerUndo) @@ -383,7 +383,7 @@ static class LitPasses // Conditional State renderStates = CoreRenderStates.Default, - pragmas = CorePragmas.Forward, // NOTE: SM 2.0 only GL + pragmas = CorePragmas.Forward, // NOTE: SM 2.0 only GL keywords = LitKeywords.Forward, includes = LitIncludes.Forward, }; @@ -411,7 +411,7 @@ static class LitPasses // Conditional State renderStates = CoreRenderStates.Default, - pragmas = CorePragmas.Forward, // NOTE: SM 2.0 only GL + pragmas = CorePragmas.Forward, // NOTE: SM 2.0 only GL keywords = LitKeywords.Forward, includes = LitIncludes.Forward, }; diff --git a/com.unity.render-pipelines.universal/Editor/ShaderGraph/Targets/UniversalTarget.cs b/com.unity.render-pipelines.universal/Editor/ShaderGraph/Targets/UniversalTarget.cs index 3a92399290b..a7d01531f8b 100644 --- a/com.unity.render-pipelines.universal/Editor/ShaderGraph/Targets/UniversalTarget.cs +++ b/com.unity.render-pipelines.universal/Editor/ShaderGraph/Targets/UniversalTarget.cs @@ -182,12 +182,12 @@ public override void GetFields(ref TargetFieldContext context) { var descs = context.blocks.Select(x => x.descriptor); // Core fields - context.AddField(Fields.GraphVertex, descs.Contains(BlockFields.VertexDescription.Position) || + context.AddField(Fields.GraphVertex, descs.Contains(BlockFields.VertexDescription.Position) || descs.Contains(BlockFields.VertexDescription.Normal) || descs.Contains(BlockFields.VertexDescription.Tangent)); context.AddField(Fields.GraphPixel); - context.AddField(Fields.AlphaClip, alphaClip); - context.AddField(Fields.DoubleSided, twoSided); + context.AddField(Fields.AlphaClip, alphaClip); + context.AddField(Fields.DoubleSided, twoSided); // SubTarget fields m_ActiveSubTarget.value.GetFields(ref context); @@ -243,7 +243,7 @@ public override void GetPropertiesGUI(ref TargetPropertyGUIContext context, Acti customEditorGUI = m_CustomGUIField.value; onChange(); }); - context.AddProperty("Custom Editor GUI", m_CustomGUIField, (evt) => {}); + context.AddProperty("Custom Editor GUI", m_CustomGUIField, (evt) => { }); } public bool TrySetActiveSubTarget(Type subTargetType) diff --git a/com.unity.render-pipelines.universal/Editor/ShaderGraph/Targets/UniversalUnlitSubTarget.cs b/com.unity.render-pipelines.universal/Editor/ShaderGraph/Targets/UniversalUnlitSubTarget.cs index a4b2dad2eb4..7167090238c 100644 --- a/com.unity.render-pipelines.universal/Editor/ShaderGraph/Targets/UniversalUnlitSubTarget.cs +++ b/com.unity.render-pipelines.universal/Editor/ShaderGraph/Targets/UniversalUnlitSubTarget.cs @@ -42,17 +42,17 @@ public override void GetFields(ref TargetFieldContext context) { // Surface Type & Blend Mode // These must be set per SubTarget as Sprite SubTargets override them - context.AddField(UniversalFields.SurfaceOpaque, target.surfaceType == SurfaceType.Opaque); - context.AddField(UniversalFields.SurfaceTransparent, target.surfaceType != SurfaceType.Opaque); - context.AddField(UniversalFields.BlendAdd, target.surfaceType != SurfaceType.Opaque && target.alphaMode == AlphaMode.Additive); - context.AddField(Fields.BlendAlpha, target.surfaceType != SurfaceType.Opaque && target.alphaMode == AlphaMode.Alpha); - context.AddField(UniversalFields.BlendMultiply, target.surfaceType != SurfaceType.Opaque && target.alphaMode == AlphaMode.Multiply); - context.AddField(UniversalFields.BlendPremultiply, target.surfaceType != SurfaceType.Opaque && target.alphaMode == AlphaMode.Premultiply); + context.AddField(UniversalFields.SurfaceOpaque, target.surfaceType == SurfaceType.Opaque); + context.AddField(UniversalFields.SurfaceTransparent, target.surfaceType != SurfaceType.Opaque); + context.AddField(UniversalFields.BlendAdd, target.surfaceType != SurfaceType.Opaque && target.alphaMode == AlphaMode.Additive); + context.AddField(Fields.BlendAlpha, target.surfaceType != SurfaceType.Opaque && target.alphaMode == AlphaMode.Alpha); + context.AddField(UniversalFields.BlendMultiply, target.surfaceType != SurfaceType.Opaque && target.alphaMode == AlphaMode.Multiply); + context.AddField(UniversalFields.BlendPremultiply, target.surfaceType != SurfaceType.Opaque && target.alphaMode == AlphaMode.Premultiply); } public override void GetActiveBlocks(ref TargetActiveBlockContext context) { - context.AddBlock(BlockFields.SurfaceDescription.Alpha, target.surfaceType == SurfaceType.Transparent || target.alphaClip); + context.AddBlock(BlockFields.SurfaceDescription.Alpha, target.surfaceType == SurfaceType.Transparent || target.alphaClip); context.AddBlock(BlockFields.SurfaceDescription.AlphaClipThreshold, target.alphaClip); } diff --git a/com.unity.render-pipelines.universal/Editor/ShaderGraph/UniversalFields.cs b/com.unity.render-pipelines.universal/Editor/ShaderGraph/UniversalFields.cs index ca3906eb724..c0148855d24 100644 --- a/com.unity.render-pipelines.universal/Editor/ShaderGraph/UniversalFields.cs +++ b/com.unity.render-pipelines.universal/Editor/ShaderGraph/UniversalFields.cs @@ -12,21 +12,21 @@ internal static class UniversalFields #region Fields // TODO: figure which ones are actually URP only, leaver those here and put others shared/core Fields in Fields.cs - public static FieldDescriptor SurfaceOpaque = new FieldDescriptor(kSurfaceType, "Opaque", "_SURFACE_TYPE_OPAQUE 1"); - public static FieldDescriptor SurfaceTransparent = new FieldDescriptor(kSurfaceType, "Transparent", "_SURFACE_TYPE_TRANSPARENT 1"); - public static FieldDescriptor BlendAdd = new FieldDescriptor(kBlendMode, "Add", "_BLENDMODE_ADD 1"); - public static FieldDescriptor BlendPremultiply = new FieldDescriptor(kBlendMode, "Premultiply", "_ALPHAPREMULTIPLY_ON 1"); - public static FieldDescriptor BlendMultiply = new FieldDescriptor(kBlendMode, "Multiply", "_BLENDMODE_MULTIPLY 1"); - public static FieldDescriptor VelocityPrecomputed = new FieldDescriptor(string.Empty, "AddPrecomputedVelocity", "_ADD_PRECOMPUTED_VELOCITY"); - public static FieldDescriptor SpecularSetup = new FieldDescriptor(string.Empty, "SpecularSetup", "_SPECULAR_SETUP"); - public static FieldDescriptor Normal = new FieldDescriptor(string.Empty, "Normal", "_NORMALMAP 1"); - public static FieldDescriptor NormalDropOffTS = new FieldDescriptor(string.Empty, "NormalDropOffTS", "_NORMAL_DROPOFF_TS 1"); - public static FieldDescriptor NormalDropOffOS = new FieldDescriptor(string.Empty, "NormalDropOffOS", "_NORMAL_DROPOFF_OS 1"); - public static FieldDescriptor NormalDropOffWS = new FieldDescriptor(string.Empty, "NormalDropOffWS", "_NORMAL_DROPOFF_WS 1"); + public static FieldDescriptor SurfaceOpaque = new FieldDescriptor(kSurfaceType, "Opaque", "_SURFACE_TYPE_OPAQUE 1"); + public static FieldDescriptor SurfaceTransparent = new FieldDescriptor(kSurfaceType, "Transparent", "_SURFACE_TYPE_TRANSPARENT 1"); + public static FieldDescriptor BlendAdd = new FieldDescriptor(kBlendMode, "Add", "_BLENDMODE_ADD 1"); + public static FieldDescriptor BlendPremultiply = new FieldDescriptor(kBlendMode, "Premultiply", "_ALPHAPREMULTIPLY_ON 1"); + public static FieldDescriptor BlendMultiply = new FieldDescriptor(kBlendMode, "Multiply", "_BLENDMODE_MULTIPLY 1"); + public static FieldDescriptor VelocityPrecomputed = new FieldDescriptor(string.Empty, "AddPrecomputedVelocity", "_ADD_PRECOMPUTED_VELOCITY"); + public static FieldDescriptor SpecularSetup = new FieldDescriptor(string.Empty, "SpecularSetup", "_SPECULAR_SETUP"); + public static FieldDescriptor Normal = new FieldDescriptor(string.Empty, "Normal", "_NORMALMAP 1"); + public static FieldDescriptor NormalDropOffTS = new FieldDescriptor(string.Empty, "NormalDropOffTS", "_NORMAL_DROPOFF_TS 1"); + public static FieldDescriptor NormalDropOffOS = new FieldDescriptor(string.Empty, "NormalDropOffOS", "_NORMAL_DROPOFF_OS 1"); + public static FieldDescriptor NormalDropOffWS = new FieldDescriptor(string.Empty, "NormalDropOffWS", "_NORMAL_DROPOFF_WS 1"); #endregion -// A predicate is field that has a matching template command, for example: $ -// It is only used to enable/disable in the tempalate + // A predicate is field that has a matching template command, for example: $ + // It is only used to enable/disable in the tempalate #region Predicates //public static FieldDescriptor PredicateClearCoat = new FieldDescriptor(string.Empty, "ClearCoat", "_CLEARCOAT 1"); #endregion diff --git a/com.unity.render-pipelines.universal/Editor/Shadow/ShadowCascadeSplitGUI.cs b/com.unity.render-pipelines.universal/Editor/Shadow/ShadowCascadeSplitGUI.cs index dc8fe1b5e87..3b06805517e 100644 --- a/com.unity.render-pipelines.universal/Editor/Shadow/ShadowCascadeSplitGUI.cs +++ b/com.unity.render-pipelines.universal/Editor/Shadow/ShadowCascadeSplitGUI.cs @@ -22,7 +22,7 @@ static partial class ShadowCascadeSplitGUI // using a LODGroup skin private static readonly GUIStyle s_CascadeSliderBG = "LODSliderRange"; - private static readonly GUIStyle s_TextCenteredStyle = new GUIStyle(EditorStyles.whiteMiniLabel) + private static readonly GUIStyle s_TextCenteredStyle = new GUIStyle(EditorStyles.whiteMiniLabel) { alignment = TextAnchor.MiddleCenter }; @@ -30,9 +30,9 @@ static partial class ShadowCascadeSplitGUI // Internal struct to bundle drag information private class DragCache { - public int m_ActivePartition; // the cascade partition that we are currently dragging/resizing - public float m_NormalizedPartitionSize; // the normalized size of the partition (0.0f < size < 1.0f) - public Vector2 m_LastCachedMousePosition; // mouse position the last time we registered a drag or mouse down. + public int m_ActivePartition; // the cascade partition that we are currently dragging/resizing + public float m_NormalizedPartitionSize; // the normalized size of the partition (0.0f < size < 1.0f) + public Vector2 m_LastCachedMousePosition; // mouse position the last time we registered a drag or mouse down. public DragCache(int activePartition, float normalizedPartitionSize, Vector2 currentMousePos) { @@ -41,7 +41,7 @@ public DragCache(int activePartition, float normalizedPartitionSize, Vector2 cur m_LastCachedMousePosition = currentMousePos; } }; - private static DragCache s_DragCache; + private static DragCache s_DragCache; private static readonly int s_CascadeSliderId = "s_CascadeSliderId".GetHashCode(); @@ -113,12 +113,12 @@ public static void HandleCascadeSliderGUI(ref float[] normalizedCascadePartition if (unit == EditorUtils.Unit.Percent) { - cascadeText = $"{i+1}\n{currentPartition * 100.0f:F1}%"; + cascadeText = $"{i + 1}\n{currentPartition * 100.0f:F1}%"; } else { var m = currentPartition * distance; - cascadeText = $"{i+1}\n{m:F1}m"; + cascadeText = $"{i + 1}\n{m:F1}m"; } GUI.Label(textRect, cascadeText, s_TextCenteredStyle); diff --git a/com.unity.render-pipelines.universal/Editor/UniversalAdditionalLightDataEditor.cs b/com.unity.render-pipelines.universal/Editor/UniversalAdditionalLightDataEditor.cs index 6da3234e678..2ef1d41a4ba 100644 --- a/com.unity.render-pipelines.universal/Editor/UniversalAdditionalLightDataEditor.cs +++ b/com.unity.render-pipelines.universal/Editor/UniversalAdditionalLightDataEditor.cs @@ -5,7 +5,8 @@ namespace UnityEditor.Rendering.Universal { [CanEditMultipleObjects] [CustomEditor(typeof(UniversalAdditionalLightData))] - [MovedFrom("UnityEditor.Rendering.LWRP")] public class UniversalAdditionLightDataEditor : Editor + [MovedFrom("UnityEditor.Rendering.LWRP")] + public class UniversalAdditionLightDataEditor : Editor { public override void OnInspectorGUI() { diff --git a/com.unity.render-pipelines.universal/Editor/UniversalRenderPipelineAssetEditor.cs b/com.unity.render-pipelines.universal/Editor/UniversalRenderPipelineAssetEditor.cs index a804941c3c5..1c626715e67 100644 --- a/com.unity.render-pipelines.universal/Editor/UniversalRenderPipelineAssetEditor.cs +++ b/com.unity.render-pipelines.universal/Editor/UniversalRenderPipelineAssetEditor.cs @@ -7,7 +7,8 @@ namespace UnityEditor.Rendering.Universal { [CustomEditor(typeof(UniversalRenderPipelineAsset))] - [MovedFrom("UnityEditor.Rendering.LWRP")] public class UniversalRenderPipelineAssetEditor : Editor + [MovedFrom("UnityEditor.Rendering.LWRP")] + public class UniversalRenderPipelineAssetEditor : Editor { internal class Styles { @@ -94,7 +95,7 @@ internal class Styles // Dropdown menu options public static string[] mainLightOptions = { "Disabled", "Per Pixel" }; - public static string[] opaqueDownsamplingOptions = {"None", "2x (Bilinear)", "4x (Box)", "4x (Bilinear)"}; + public static string[] opaqueDownsamplingOptions = { "None", "2x (Bilinear)", "4x (Box)", "4x (Bilinear)" }; } SavedBool m_GeneralSettingsFoldout; @@ -363,7 +364,7 @@ void DrawShadowResolutionTierSettings() EditorGUI.BeginChangeCheck(); const int k_ShadowResolutionTiersCount = 3; - var values = new[] { m_AdditionalLightsShadowResolutionTierLowProp, m_AdditionalLightsShadowResolutionTierMediumProp, m_AdditionalLightsShadowResolutionTierHighProp}; + var values = new[] { m_AdditionalLightsShadowResolutionTierLowProp, m_AdditionalLightsShadowResolutionTierMediumProp, m_AdditionalLightsShadowResolutionTierHighProp }; var num = contentRect.width / (float)k_ShadowResolutionTiersCount; // space allocated for every field including the label diff --git a/com.unity.render-pipelines.universal/Editor/UniversalRenderPipelineCameraEditor.cs b/com.unity.render-pipelines.universal/Editor/UniversalRenderPipelineCameraEditor.cs index de46aba1a4a..56737da30a4 100644 --- a/com.unity.render-pipelines.universal/Editor/UniversalRenderPipelineCameraEditor.cs +++ b/com.unity.render-pipelines.universal/Editor/UniversalRenderPipelineCameraEditor.cs @@ -77,7 +77,7 @@ static class Styles new GUIContent("Uninitialized"), }; - public static int[] cameraBackgroundValues = { 0, 1, 2}; + public static int[] cameraBackgroundValues = { 0, 1, 2 }; // Using the pipeline Settings public static GUIContent[] displayedCameraOptions = @@ -99,7 +99,7 @@ static class Styles new GUIContent("Fast Approximate Anti-aliasing (FXAA)"), new GUIContent("Subpixel Morphological Anti-aliasing (SMAA)"), }; - public static int[] antialiasingValues = { 0, 1, 2}; + public static int[] antialiasingValues = { 0, 1, 2 }; } ReorderableList m_LayerList; @@ -109,7 +109,7 @@ static class Styles List validCameras = new List(); // This is the valid list of types, so if we need to add more types we just add it here. - List validCameraTypes = new List {CameraRenderType.Overlay}; + List validCameraTypes = new List { CameraRenderType.Overlay }; List errorCameras = new List(); Texture2D m_ErrorIcon; diff --git a/com.unity.render-pipelines.universal/Editor/UniversalRenderPipelineLightEditor.cs b/com.unity.render-pipelines.universal/Editor/UniversalRenderPipelineLightEditor.cs index 16cdd60dc05..cfbe40dde7c 100644 --- a/com.unity.render-pipelines.universal/Editor/UniversalRenderPipelineLightEditor.cs +++ b/com.unity.render-pipelines.universal/Editor/UniversalRenderPipelineLightEditor.cs @@ -71,7 +71,7 @@ class Styles public bool pointOptionsValue { get { return typeIsSame && lightProperty.type == LightType.Point; } } public bool dirOptionsValue { get { return typeIsSame && lightProperty.type == LightType.Directional; } } public bool areaOptionsValue { get { return typeIsSame && (lightProperty.type == LightType.Rectangle || lightProperty.type == LightType.Disc); } } - public bool shadowResolutionOptionsValue { get { return spotOptionsValue || pointOptionsValue; } } // Currently only additional punctual lights can specify per-light shadow resolution + public bool shadowResolutionOptionsValue { get { return spotOptionsValue || pointOptionsValue; } } // Currently only additional punctual lights can specify per-light shadow resolution // Area light shadows not supported public bool runtimeOptionsValue { get { return typeIsSame && (lightProperty.type != LightType.Rectangle && !settings.isCompletelyBaked); } } @@ -134,11 +134,11 @@ public override void OnInspectorGUI() // we want the fade group to stay hidden. using (var group = new EditorGUILayout.FadeGroupScope(1.0f - m_AnimDirOptions.faded)) if (group.visible) - #if UNITY_2020_1_OR_NEWER +#if UNITY_2020_1_OR_NEWER settings.DrawRange(); - #else +#else settings.DrawRange(m_AnimAreaOptions.target); - #endif +#endif // Spot angle using (var group = new EditorGUILayout.FadeGroupScope(m_AnimSpotOptions.faded)) diff --git a/com.unity.render-pipelines.universal/Editor/UniversalRenderPipelineMaterialUpgrader.cs b/com.unity.render-pipelines.universal/Editor/UniversalRenderPipelineMaterialUpgrader.cs index 86c9e9ba7e6..9825c5d77c8 100644 --- a/com.unity.render-pipelines.universal/Editor/UniversalRenderPipelineMaterialUpgrader.cs +++ b/com.unity.render-pipelines.universal/Editor/UniversalRenderPipelineMaterialUpgrader.cs @@ -164,7 +164,8 @@ private static void GetUpgraders(ref List upgraders) } } - [MovedFrom("UnityEditor.Rendering.LWRP")] public static class SupportedUpgradeParams + [MovedFrom("UnityEditor.Rendering.LWRP")] + public static class SupportedUpgradeParams { static public UpgradeParams diffuseOpaque = new UpgradeParams() { @@ -257,7 +258,8 @@ private static void GetUpgraders(ref List upgraders) }; } - [MovedFrom("UnityEditor.Rendering.LWRP")] public class StandardUpgrader : MaterialUpgrader + [MovedFrom("UnityEditor.Rendering.LWRP")] + public class StandardUpgrader : MaterialUpgrader { enum LegacyRenderingMode { @@ -416,7 +418,8 @@ private static void UpdateMaterialSpecularSource(Material material) } } - [MovedFrom("UnityEditor.Rendering.LWRP")] public class TerrainUpgrader : MaterialUpgrader + [MovedFrom("UnityEditor.Rendering.LWRP")] + public class TerrainUpgrader : MaterialUpgrader { public TerrainUpgrader(string oldShaderName) { @@ -446,7 +449,8 @@ internal SpeedTree8Upgrader(string oldShaderName) } } - [MovedFrom("UnityEditor.Rendering.LWRP")] public class ParticleUpgrader : MaterialUpgrader + [MovedFrom("UnityEditor.Rendering.LWRP")] + public class ParticleUpgrader : MaterialUpgrader { public ParticleUpgrader(string oldShaderName) { @@ -514,7 +518,8 @@ public static void UpdateSurfaceBlendModes(Material material) } } - [MovedFrom("UnityEditor.Rendering.LWRP")] public class AutodeskInteractiveUpgrader : MaterialUpgrader + [MovedFrom("UnityEditor.Rendering.LWRP")] + public class AutodeskInteractiveUpgrader : MaterialUpgrader { public AutodeskInteractiveUpgrader(string oldShaderName) { diff --git a/com.unity.render-pipelines.universal/Editor/UpgradeCommon.cs b/com.unity.render-pipelines.universal/Editor/UpgradeCommon.cs index 82319ffc289..010b362387e 100644 --- a/com.unity.render-pipelines.universal/Editor/UpgradeCommon.cs +++ b/com.unity.render-pipelines.universal/Editor/UpgradeCommon.cs @@ -2,13 +2,15 @@ namespace UnityEditor.Rendering.Universal { - [MovedFrom("UnityEditor.Rendering.LWRP")] public enum UpgradeSurfaceType + [MovedFrom("UnityEditor.Rendering.LWRP")] + public enum UpgradeSurfaceType { Opaque, Transparent } - [MovedFrom("UnityEditor.Rendering.LWRP")] public enum UpgradeBlendMode + [MovedFrom("UnityEditor.Rendering.LWRP")] + public enum UpgradeBlendMode { Alpha, Premultiply, @@ -16,19 +18,22 @@ namespace UnityEditor.Rendering.Universal Multiply } - [MovedFrom("UnityEditor.Rendering.LWRP")] public enum SpecularSource + [MovedFrom("UnityEditor.Rendering.LWRP")] + public enum SpecularSource { SpecularTextureAndColor, NoSpecular } - [MovedFrom("UnityEditor.Rendering.LWRP")] public enum SmoothnessSource + [MovedFrom("UnityEditor.Rendering.LWRP")] + public enum SmoothnessSource { BaseAlpha, SpecularAlpha } - [MovedFrom("UnityEditor.Rendering.LWRP")] public enum ReflectionSource + [MovedFrom("UnityEditor.Rendering.LWRP")] + public enum ReflectionSource { NoReflection, Cubemap, diff --git a/com.unity.render-pipelines.universal/Runtime/2D/Clipper.cs b/com.unity.render-pipelines.universal/Runtime/2D/Clipper.cs index 0b354eae917..1c98f197aab 100644 --- a/com.unity.render-pipelines.universal/Runtime/2D/Clipper.cs +++ b/com.unity.render-pipelines.universal/Runtime/2D/Clipper.cs @@ -233,14 +233,14 @@ public bool IsNegative() return hi < 0; } - public static bool operator==(Int128 val1, Int128 val2) + public static bool operator ==(Int128 val1, Int128 val2) { if ((object)val1 == (object)val2) return true; else if ((object)val1 == null || (object)val2 == null) return false; return (val1.hi == val2.hi && val1.lo == val2.lo); } - public static bool operator!=(Int128 val1, Int128 val2) + public static bool operator !=(Int128 val1, Int128 val2) { return !(val1 == val2); } @@ -258,7 +258,7 @@ public override int GetHashCode() return hi.GetHashCode() ^ lo.GetHashCode(); } - public static bool operator>(Int128 val1, Int128 val2) + public static bool operator >(Int128 val1, Int128 val2) { if (val1.hi != val2.hi) return val1.hi > val2.hi; @@ -266,7 +266,7 @@ public override int GetHashCode() return val1.lo > val2.lo; } - public static bool operator<(Int128 val1, Int128 val2) + public static bool operator <(Int128 val1, Int128 val2) { if (val1.hi != val2.hi) return val1.hi < val2.hi; @@ -274,7 +274,7 @@ public override int GetHashCode() return val1.lo < val2.lo; } - public static Int128 operator+(Int128 lhs, Int128 rhs) + public static Int128 operator +(Int128 lhs, Int128 rhs) { lhs.hi += rhs.hi; lhs.lo += rhs.lo; @@ -282,12 +282,12 @@ public override int GetHashCode() return lhs; } - public static Int128 operator-(Int128 lhs, Int128 rhs) + public static Int128 operator -(Int128 lhs, Int128 rhs) { return lhs + -rhs; } - public static Int128 operator-(Int128 val) + public static Int128 operator -(Int128 val) { if (val.lo == 0) return new Int128(-val.hi, 0); @@ -372,14 +372,14 @@ public IntPoint(IntPoint pt) this.N = pt.N; this.D = pt.D; } - public static bool operator==(IntPoint a, IntPoint b) + public static bool operator ==(IntPoint a, IntPoint b) { return a.X == b.X && a.Y == b.Y; } - public static bool operator!=(IntPoint a, IntPoint b) + public static bool operator !=(IntPoint a, IntPoint b) { - return a.X != b.X || a.Y != b.Y; + return a.X != b.X || a.Y != b.Y; } public override bool Equals(object obj) @@ -530,7 +530,7 @@ internal class ClipperBase internal const int Skip = -2; internal const int Unassigned = -1; internal const double tolerance = 1.0E-20; - internal static bool near_zero(double val) {return (val > -tolerance) && (val < tolerance); } + internal static bool near_zero(double val) { return (val > -tolerance) && (val < tolerance); } public const ClipInt loRange = 0x3FFFFFFF; public const ClipInt hiRange = 0x3FFFFFFFFFFFFFFFL; @@ -743,7 +743,7 @@ private void InitEdge2(TEdge e, PolyType polyType) private TEdge FindNextLocMin(TEdge E) { TEdge E2; - for (;;) + for (; ; ) { while (E.Bot != E.Prev.Bot || E.Curr == E.Top) E = E.Next; if (E.Dx != horizontal && E.Prev.Dx != horizontal) break; @@ -909,7 +909,7 @@ public bool AddPath(Path pg, PolyType polyType, bool Closed) //2. Remove duplicate vertices, and (when closed) collinear edges ... TEdge E = eStart, eLoopStop = eStart; - for (;;) + for (; ; ) { //nb: allows matching start and end points when not Closed ... if (E.Curr == E.Next.Curr && (Closed || E.Next != eStart)) @@ -975,7 +975,7 @@ public bool AddPath(Path pg, PolyType polyType, bool Closed) locMin.RightBound = E; locMin.RightBound.Side = EdgeSide.esRight; locMin.RightBound.WindDelta = 0; - for (;;) + for (; ; ) { if (E.Bot.X != E.Prev.Top.X) ReverseHorizontal(E); if (E.Next.OutIdx == Skip) break; @@ -995,7 +995,7 @@ public bool AddPath(Path pg, PolyType polyType, bool Closed) //open paths have matching start and end points ... if (E.Prev.Bot == E.Prev.Top) E = E.Next; - for (;;) + for (; ; ) { E = FindNextLocMin(E); if (E == EMin) break; @@ -1100,7 +1100,7 @@ private void InsertLocalMinima(LocalMinima newLm) else { LocalMinima tmpLm = m_MinimaList; - while (tmpLm.Next != null && (newLm.Y < tmpLm.Next.Y)) + while (tmpLm.Next != null && (newLm.Y < tmpLm.Next.Y)) tmpLm = tmpLm.Next; newLm.Next = tmpLm.Next; tmpLm.Next = newLm; @@ -2787,7 +2787,7 @@ private void ProcessHorizontal(TEdge horzEdge) } OutPt op1 = null; - for (;;) //loop through consec. horizontal edges + for (; ; ) //loop through consec. horizontal edges { bool IsLastHorz = (horzEdge == eLastHorz); TEdge e = GetNextInAEL(horzEdge, dir); @@ -3527,7 +3527,7 @@ private void FixupOutPolygon(OutRec outRec) outRec.BottomPt = null; OutPt pp = outRec.Pts; bool preserveCol = PreserveCollinear || StrictlySimple; - for (;;) + for (; ; ) { if (pp.Prev == pp || pp.Prev == pp.Next) { @@ -3584,12 +3584,12 @@ bool GetOverlap(ClipInt a1, ClipInt a2, ClipInt b1, ClipInt b2, out ClipInt Left { if (a1 < a2) { - if (b1 < b2) {Left = Math.Max(a1, b1); Right = Math.Min(a2, b2); } - else {Left = Math.Max(a1, b2); Right = Math.Min(a2, b1); } + if (b1 < b2) { Left = Math.Max(a1, b1); Right = Math.Min(a2, b2); } + else { Left = Math.Max(a1, b2); Right = Math.Min(a2, b1); } } else { - if (b1 < b2) {Left = Math.Max(a2, b1); Right = Math.Min(a1, b2); } + if (b1 < b2) { Left = Math.Max(a2, b1); Right = Math.Min(a1, b2); } else { Left = Math.Max(a2, b2); Right = Math.Min(a1, b1); } } return Left < Right; @@ -4277,7 +4277,7 @@ private static double DistanceFromLineSqrd(IntPoint pt, IntPoint ln1, IntPoint l //see http://en.wikipedia.org/wiki/Perpendicular_distance double A = ln1.Y - ln2.Y; double B = ln2.X - ln1.X; - double C = A * ln1.X + B * ln1.Y; + double C = A * ln1.X + B * ln1.Y; C = A * pt.X + B * pt.Y - C; return (C * C) / (A * A + B * B); } @@ -4925,7 +4925,7 @@ void OffsetPoint(int j, ref int k, JoinType jointype) { var item = new IntPoint(Round(m_srcPoly[j].X + m_normals[k].X * m_delta), Round(m_srcPoly[j].Y + m_normals[k].Y * m_delta)); - item.NX = m_normals[k].X; item.NY = m_normals[k].Y; item.N = j; item.D = 1; + item.NX = m_normals[k].X; item.NY = m_normals[k].Y; item.N = j; item.D = 1; m_destPoly.Add(item); return; } @@ -5018,7 +5018,7 @@ internal void DoRound(int j, int k) class ClipperException : Exception { - public ClipperException(string description) : base(description) {} + public ClipperException(string description) : base(description) { } } //------------------------------------------------------------------------------ } //end ClipperLib namespace diff --git a/com.unity.render-pipelines.universal/Runtime/2D/Light2D.cs b/com.unity.render-pipelines.universal/Runtime/2D/Light2D.cs index 3437f74603b..9df89ed9c56 100644 --- a/com.unity.render-pipelines.universal/Runtime/2D/Light2D.cs +++ b/com.unity.render-pipelines.universal/Runtime/2D/Light2D.cs @@ -205,7 +205,7 @@ public LightType lightType public float falloffIntensity => m_FalloffIntensity; [Obsolete] - public bool alphaBlendOnOverlap { get { return m_OverlapOperation == OverlapOperation.AlphaBlend; }} + public bool alphaBlendOnOverlap { get { return m_OverlapOperation == OverlapOperation.AlphaBlend; } } public OverlapOperation overlapOperation => m_OverlapOperation; public int lightOrder { get => m_LightOrder; set => m_LightOrder = value; } diff --git a/com.unity.render-pipelines.universal/Runtime/2D/Light2DBlendStyle.cs b/com.unity.render-pipelines.universal/Runtime/2D/Light2DBlendStyle.cs index d7a2af6f819..e1042ccd6c1 100644 --- a/com.unity.render-pipelines.universal/Runtime/2D/Light2DBlendStyle.cs +++ b/com.unity.render-pipelines.universal/Runtime/2D/Light2DBlendStyle.cs @@ -6,7 +6,8 @@ namespace UnityEngine.Experimental.Rendering.Universal { [Serializable] - [MovedFrom("UnityEngine.Experimental.Rendering.LWRP")] public struct Light2DBlendStyle + [MovedFrom("UnityEngine.Experimental.Rendering.LWRP")] + public struct Light2DBlendStyle { internal enum TextureChannel { diff --git a/com.unity.render-pipelines.universal/Runtime/2D/Light2DManager.cs b/com.unity.render-pipelines.universal/Runtime/2D/Light2DManager.cs index 415afb78570..1b8253f074d 100644 --- a/com.unity.render-pipelines.universal/Runtime/2D/Light2DManager.cs +++ b/com.unity.render-pipelines.universal/Runtime/2D/Light2DManager.cs @@ -42,7 +42,7 @@ public static void ErrorIfDuplicateGlobalLight(Light2D light) public static bool GetGlobalColor(int sortingLayerIndex, int blendStyleIndex, out Color color) { - var foundGlobalColor = false; + var foundGlobalColor = false; color = Color.black; // This should be rewritten to search only global lights diff --git a/com.unity.render-pipelines.universal/Runtime/2D/Light2DShape.cs b/com.unity.render-pipelines.universal/Runtime/2D/Light2DShape.cs index e9c49293374..2d8fbe4ef62 100644 --- a/com.unity.render-pipelines.universal/Runtime/2D/Light2DShape.cs +++ b/com.unity.render-pipelines.universal/Runtime/2D/Light2DShape.cs @@ -2,24 +2,24 @@ namespace UnityEngine.Experimental.Rendering.Universal { public sealed partial class Light2D { - [SerializeField] int m_ShapeLightParametricSides = 5; - [SerializeField] float m_ShapeLightParametricAngleOffset = 0.0f; - [SerializeField] float m_ShapeLightParametricRadius = 1.0f; - [SerializeField] float m_ShapeLightFalloffSize = 0.50f; - [SerializeField] Vector2 m_ShapeLightFalloffOffset = Vector2.zero; - [SerializeField] Vector3[] m_ShapePath = null; + [SerializeField] int m_ShapeLightParametricSides = 5; + [SerializeField] float m_ShapeLightParametricAngleOffset = 0.0f; + [SerializeField] float m_ShapeLightParametricRadius = 1.0f; + [SerializeField] float m_ShapeLightFalloffSize = 0.50f; + [SerializeField] Vector2 m_ShapeLightFalloffOffset = Vector2.zero; + [SerializeField] Vector3[] m_ShapePath = null; - float m_PreviousShapeLightFalloffSize = -1; - int m_PreviousShapeLightParametricSides = -1; - float m_PreviousShapeLightParametricAngleOffset = -1; - float m_PreviousShapeLightParametricRadius = -1; - int m_PreviousShapePathHash = -1; - LightType m_PreviousLightType = LightType.Parametric; + float m_PreviousShapeLightFalloffSize = -1; + int m_PreviousShapeLightParametricSides = -1; + float m_PreviousShapeLightParametricAngleOffset = -1; + float m_PreviousShapeLightParametricRadius = -1; + int m_PreviousShapePathHash = -1; + LightType m_PreviousLightType = LightType.Parametric; - public int shapeLightParametricSides => m_ShapeLightParametricSides; - public float shapeLightParametricAngleOffset => m_ShapeLightParametricAngleOffset; - public float shapeLightParametricRadius => m_ShapeLightParametricRadius; - public float shapeLightFalloffSize => m_ShapeLightFalloffSize; + public int shapeLightParametricSides => m_ShapeLightParametricSides; + public float shapeLightParametricAngleOffset => m_ShapeLightParametricAngleOffset; + public float shapeLightParametricRadius => m_ShapeLightParametricRadius; + public float shapeLightFalloffSize => m_ShapeLightFalloffSize; public Vector3[] shapePath { diff --git a/com.unity.render-pipelines.universal/Runtime/2D/Light2DStub.cs b/com.unity.render-pipelines.universal/Runtime/2D/Light2DStub.cs index 0093483a128..fee45d15027 100644 --- a/com.unity.render-pipelines.universal/Runtime/2D/Light2DStub.cs +++ b/com.unity.render-pipelines.universal/Runtime/2D/Light2DStub.cs @@ -4,5 +4,5 @@ namespace UnityEngine.Experimental.Rendering.LWRP { [Obsolete("LWRP -> Universal (UnityUpgradable) -> UnityEngine.Experimental.Rendering.Universal.Light2D", true)] public class Light2D - {} + { } } diff --git a/com.unity.render-pipelines.universal/Runtime/2D/LightUtility.cs b/com.unity.render-pipelines.universal/Runtime/2D/LightUtility.cs index eaf78fd1b39..728d1ea339a 100644 --- a/com.unity.render-pipelines.universal/Runtime/2D/LightUtility.cs +++ b/com.unity.render-pipelines.universal/Runtime/2D/LightUtility.cs @@ -71,7 +71,7 @@ static void Tessellate(Tess tess, ElementType boundaryType, NativeArray var prevCount = VCount; var tessIndices = tess.Elements.Select(i => i); var tessVertices = tess.Vertices.Select(v => - new LightMeshVertex() { position = new float3(v.Position.X, v.Position.Y, 0), color = c }); + new LightMeshVertex() { position = new float3(v.Position.X, v.Position.Y, 0), color = c }); foreach (var v in tessVertices) vertices[VCount++] = v; diff --git a/com.unity.render-pipelines.universal/Runtime/2D/Passes/Utility/Light2DLookupTexture.cs b/com.unity.render-pipelines.universal/Runtime/2D/Passes/Utility/Light2DLookupTexture.cs index 7b4d9567d6d..b386035e23a 100644 --- a/com.unity.render-pipelines.universal/Runtime/2D/Passes/Utility/Light2DLookupTexture.cs +++ b/com.unity.render-pipelines.universal/Runtime/2D/Passes/Utility/Light2DLookupTexture.cs @@ -67,30 +67,30 @@ private static Texture2D CreatePointLightLookupTexture() return texture; } -//#if UNITY_EDITOR -// [MenuItem("Light2D Debugging/Write Light Texture")] -// static public void WriteLightTexture() -// { -// var path = EditorUtility.SaveFilePanel("Save texture as PNG", "", "LightLookupTexture.exr", "png"); - -// CreatePointLightLookupTexture(); - -// byte[] imgData = s_PointLightLookupTexture.EncodeToEXR(Texture2D.EXRFlags.CompressRLE); -// if (imgData != null) -// File.WriteAllBytes(path, imgData); -// } - -// [MenuItem("Light2D Debugging/Write Falloff Texture")] -// static public void WriteCurveTexture() -// { -// var path = EditorUtility.SaveFilePanel("Save texture as PNG", "", "FalloffLookupTexture.png", "png"); - -// CreateFalloffLookupTexture(); - -// byte[] imgData = s_FalloffLookupTexture.EncodeToPNG(); -// if (imgData != null) -// File.WriteAllBytes(path, imgData); -// } -//#endif + //#if UNITY_EDITOR + // [MenuItem("Light2D Debugging/Write Light Texture")] + // static public void WriteLightTexture() + // { + // var path = EditorUtility.SaveFilePanel("Save texture as PNG", "", "LightLookupTexture.exr", "png"); + + // CreatePointLightLookupTexture(); + + // byte[] imgData = s_PointLightLookupTexture.EncodeToEXR(Texture2D.EXRFlags.CompressRLE); + // if (imgData != null) + // File.WriteAllBytes(path, imgData); + // } + + // [MenuItem("Light2D Debugging/Write Falloff Texture")] + // static public void WriteCurveTexture() + // { + // var path = EditorUtility.SaveFilePanel("Save texture as PNG", "", "FalloffLookupTexture.png", "png"); + + // CreateFalloffLookupTexture(); + + // byte[] imgData = s_FalloffLookupTexture.EncodeToPNG(); + // if (imgData != null) + // File.WriteAllBytes(path, imgData); + // } + //#endif } } diff --git a/com.unity.render-pipelines.universal/Runtime/2D/PixelPerfectCamera.cs b/com.unity.render-pipelines.universal/Runtime/2D/PixelPerfectCamera.cs index 903fbbccbd4..372ed09af22 100644 --- a/com.unity.render-pipelines.universal/Runtime/2D/PixelPerfectCamera.cs +++ b/com.unity.render-pipelines.universal/Runtime/2D/PixelPerfectCamera.cs @@ -115,14 +115,14 @@ public float CorrectCinemachineOrthoSize(float targetOrthoSize) return m_Internal.CorrectCinemachineOrthoSize(targetOrthoSize); } - [SerializeField] int m_AssetsPPU = 100; - [SerializeField] int m_RefResolutionX = 320; - [SerializeField] int m_RefResolutionY = 180; - [SerializeField] bool m_UpscaleRT; - [SerializeField] bool m_PixelSnapping; - [SerializeField] bool m_CropFrameX; - [SerializeField] bool m_CropFrameY; - [SerializeField] bool m_StretchFill; + [SerializeField] int m_AssetsPPU = 100; + [SerializeField] int m_RefResolutionX = 320; + [SerializeField] int m_RefResolutionY = 180; + [SerializeField] bool m_UpscaleRT; + [SerializeField] bool m_PixelSnapping; + [SerializeField] bool m_CropFrameX; + [SerializeField] bool m_CropFrameY; + [SerializeField] bool m_StretchFill; Camera m_Camera; PixelPerfectCameraInternal m_Internal; diff --git a/com.unity.render-pipelines.universal/Runtime/2D/PixelPerfectCameraInternal.cs b/com.unity.render-pipelines.universal/Runtime/2D/PixelPerfectCameraInternal.cs index d878268f2ad..46c19c3fa85 100644 --- a/com.unity.render-pipelines.universal/Runtime/2D/PixelPerfectCameraInternal.cs +++ b/com.unity.render-pipelines.universal/Runtime/2D/PixelPerfectCameraInternal.cs @@ -26,19 +26,19 @@ internal class PixelPerfectCameraInternal : ISerializationCallbackReceiver IPixelPerfectCamera m_Component; PixelPerfectCamera m_SerializableComponent; - internal float originalOrthoSize; - internal bool hasPostProcessLayer; - internal bool cropFrameXAndY = false; - internal bool cropFrameXOrY = false; - internal bool useStretchFill = false; - internal int zoom = 1; - internal bool useOffscreenRT = false; - internal int offscreenRTWidth = 0; - internal int offscreenRTHeight = 0; - internal Rect pixelRect = Rect.zero; - internal float orthoSize = 1.0f; - internal float unitsPerPixel = 0.0f; - internal int cinemachineVCamZoom = 1; + internal float originalOrthoSize; + internal bool hasPostProcessLayer; + internal bool cropFrameXAndY = false; + internal bool cropFrameXOrY = false; + internal bool useStretchFill = false; + internal int zoom = 1; + internal bool useOffscreenRT = false; + internal int offscreenRTWidth = 0; + internal int offscreenRTHeight = 0; + internal Rect pixelRect = Rect.zero; + internal float orthoSize = 1.0f; + internal float unitsPerPixel = 0.0f; + internal int cinemachineVCamZoom = 1; internal PixelPerfectCameraInternal(IPixelPerfectCamera component) { diff --git a/com.unity.render-pipelines.universal/Runtime/2D/Shadows/ShadowCaster2D.cs b/com.unity.render-pipelines.universal/Runtime/2D/Shadows/ShadowCaster2D.cs index b767dceec59..e4c9506314e 100644 --- a/com.unity.render-pipelines.universal/Runtime/2D/Shadows/ShadowCaster2D.cs +++ b/com.unity.render-pipelines.universal/Runtime/2D/Shadows/ShadowCaster2D.cs @@ -41,7 +41,7 @@ public class ShadowCaster2D : ShadowCasterGroup2D public bool useRendererSilhouette { set { m_UseRendererSilhouette = value; } - get { return m_UseRendererSilhouette && m_HasRenderer; } + get { return m_UseRendererSilhouette && m_HasRenderer; } } /// diff --git a/com.unity.render-pipelines.universal/Runtime/2D/Shadows/ShadowRendering.cs b/com.unity.render-pipelines.universal/Runtime/2D/Shadows/ShadowRendering.cs index d6013d2e652..9117cd65d5e 100644 --- a/com.unity.render-pipelines.universal/Runtime/2D/Shadows/ShadowRendering.cs +++ b/com.unity.render-pipelines.universal/Runtime/2D/Shadows/ShadowRendering.cs @@ -13,7 +13,7 @@ internal static class ShadowRendering private static readonly int k_ShadowRadiusID = Shader.PropertyToID("_ShadowRadius"); private static RenderTargetHandle[] m_RenderTargets = null; - public static uint maxTextureCount { get; private set; } + public static uint maxTextureCount { get; private set; } public static void InitializeBudget(uint maxTextureCount) { diff --git a/com.unity.render-pipelines.universal/Runtime/2D/Shadows/ShadowUtility.cs b/com.unity.render-pipelines.universal/Runtime/2D/Shadows/ShadowUtility.cs index 22173eadf46..84863ab7a86 100644 --- a/com.unity.render-pipelines.universal/Runtime/2D/Shadows/ShadowUtility.cs +++ b/com.unity.render-pipelines.universal/Runtime/2D/Shadows/ShadowUtility.cs @@ -141,7 +141,7 @@ public static void GenerateShadowMesh(Mesh mesh, Vector3[] shapePath) extrusionData = new Color(shapePath[i].x, shapePath[i].y, shapePath[nextPoint].x, shapePath[nextPoint].y); Vector2 midPoint = 0.5f * (shapePath[i] + shapePath[nextPoint]); - inputs[2 * i + 1] = new ContourVertex() { Position = new Vec3() { X = midPoint.x, Y = midPoint.y, Z = 0}, Data = extrusionData }; + inputs[2 * i + 1] = new ContourVertex() { Position = new Vec3() { X = midPoint.x, Y = midPoint.y, Z = 0 }, Data = extrusionData }; } Tess tessI = new Tess(); diff --git a/com.unity.render-pipelines.universal/Runtime/Data/RenderStateData.cs b/com.unity.render-pipelines.universal/Runtime/Data/RenderStateData.cs index 3b23f12b3db..941bcfc693a 100644 --- a/com.unity.render-pipelines.universal/Runtime/Data/RenderStateData.cs +++ b/com.unity.render-pipelines.universal/Runtime/Data/RenderStateData.cs @@ -3,7 +3,8 @@ namespace UnityEngine.Rendering.Universal { [System.Serializable] - [MovedFrom("UnityEngine.Rendering.LWRP")] public class StencilStateData + [MovedFrom("UnityEngine.Rendering.LWRP")] + public class StencilStateData { public bool overrideStencilState = false; public int stencilReference = 0; diff --git a/com.unity.render-pipelines.universal/Runtime/Data/UniversalRenderPipelineAsset.cs b/com.unity.render-pipelines.universal/Runtime/Data/UniversalRenderPipelineAsset.cs index c7637bf9e90..f978f9878f5 100644 --- a/com.unity.render-pipelines.universal/Runtime/Data/UniversalRenderPipelineAsset.cs +++ b/com.unity.render-pipelines.universal/Runtime/Data/UniversalRenderPipelineAsset.cs @@ -20,14 +20,16 @@ public class LightweightRenderPipelineAsset namespace UnityEngine.Rendering.Universal { - [MovedFrom("UnityEngine.Rendering.LWRP")] public enum ShadowQuality + [MovedFrom("UnityEngine.Rendering.LWRP")] + public enum ShadowQuality { Disabled, HardShadows, SoftShadows, } - [MovedFrom("UnityEngine.Rendering.LWRP")] public enum ShadowResolution + [MovedFrom("UnityEngine.Rendering.LWRP")] + public enum ShadowResolution { _256 = 256, _512 = 512, @@ -36,7 +38,8 @@ namespace UnityEngine.Rendering.Universal _4096 = 4096 } - [MovedFrom("UnityEngine.Rendering.LWRP")] public enum MsaaQuality + [MovedFrom("UnityEngine.Rendering.LWRP")] + public enum MsaaQuality { Disabled = 1, _2x = 2, @@ -44,7 +47,8 @@ namespace UnityEngine.Rendering.Universal _8x = 8 } - [MovedFrom("UnityEngine.Rendering.LWRP")] public enum Downsampling + [MovedFrom("UnityEngine.Rendering.LWRP")] + public enum Downsampling { None, _2xBilinear, @@ -61,14 +65,16 @@ internal enum DefaultMaterialType UnityBuiltinDefault } - [MovedFrom("UnityEngine.Rendering.LWRP")] public enum LightRenderingMode + [MovedFrom("UnityEngine.Rendering.LWRP")] + public enum LightRenderingMode { Disabled = 0, PerVertex = 2, PerPixel = 1, } - [MovedFrom("UnityEngine.Rendering.LWRP")] public enum ShaderVariantLogLevel + [MovedFrom("UnityEngine.Rendering.LWRP")] + public enum ShaderVariantLogLevel { Disabled, OnlyUniversalRPShaders, @@ -82,7 +88,8 @@ public enum PipelineDebugLevel Profiling, } - [MovedFrom("UnityEngine.Rendering.LWRP")] public enum RendererType + [MovedFrom("UnityEngine.Rendering.LWRP")] + public enum RendererType { Custom, ForwardRenderer, @@ -155,7 +162,7 @@ public partial class UniversalRenderPipelineAsset : RenderPipelineAsset, ISerial [SerializeField] bool m_UseSRPBatcher = true; [SerializeField] bool m_SupportsDynamicBatching = false; [SerializeField] bool m_MixedLightingSupported = true; - [SerializeField][Obsolete] PipelineDebugLevel m_DebugLevel; + [SerializeField] [Obsolete] PipelineDebugLevel m_DebugLevel; // Adaptive performance settings [SerializeField] bool m_UseAdaptivePerformance = true; diff --git a/com.unity.render-pipelines.universal/Runtime/Data/UniversalRenderPipelineEditorResources.cs b/com.unity.render-pipelines.universal/Runtime/Data/UniversalRenderPipelineEditorResources.cs index 3b246b45bd8..5c682821caf 100644 --- a/com.unity.render-pipelines.universal/Runtime/Data/UniversalRenderPipelineEditorResources.cs +++ b/com.unity.render-pipelines.universal/Runtime/Data/UniversalRenderPipelineEditorResources.cs @@ -12,7 +12,8 @@ public class LightweightRenderPipelineEditorResources namespace UnityEngine.Rendering.Universal { - [MovedFrom("UnityEngine.Rendering.LWRP")] public class UniversalRenderPipelineEditorResources : ScriptableObject + [MovedFrom("UnityEngine.Rendering.LWRP")] + public class UniversalRenderPipelineEditorResources : ScriptableObject { [Serializable, ReloadGroup] public sealed class ShaderResources diff --git a/com.unity.render-pipelines.universal/Runtime/DeferredLights.cs b/com.unity.render-pipelines.universal/Runtime/DeferredLights.cs index f94839518d7..21cd06518eb 100644 --- a/com.unity.render-pipelines.universal/Runtime/DeferredLights.cs +++ b/com.unity.render-pipelines.universal/Runtime/DeferredLights.cs @@ -30,11 +30,11 @@ internal static bool UseCBufferForDepthRange { get { - #if !UNITY_EDITOR && UNITY_SWITCH +#if !UNITY_EDITOR && UNITY_SWITCH return false; - #else +#else return IsOpenGL; - #endif +#endif } } @@ -42,11 +42,11 @@ internal static bool UseCBufferForTileList { get { - #if !UNITY_EDITOR && UNITY_SWITCH +#if !UNITY_EDITOR && UNITY_SWITCH return false; - #else +#else return IsOpenGL; - #endif +#endif } } @@ -62,11 +62,11 @@ internal static bool UseCBufferForLightList { get { - #if !UNITY_EDITOR && UNITY_SWITCH +#if !UNITY_EDITOR && UNITY_SWITCH return false; - #else +#else return IsOpenGL; - #endif +#endif } } @@ -185,11 +185,14 @@ internal static class ShaderConstants struct CullLightsJob : IJob { public DeferredTiler tiler; - [ReadOnly][Unity.Collections.LowLevel.Unsafe.NativeDisableContainerSafetyRestriction] + [ReadOnly] + [Unity.Collections.LowLevel.Unsafe.NativeDisableContainerSafetyRestriction] public NativeArray prePunctualLights; - [ReadOnly][Unity.Collections.LowLevel.Unsafe.NativeDisableContainerSafetyRestriction] + [ReadOnly] + [Unity.Collections.LowLevel.Unsafe.NativeDisableContainerSafetyRestriction] public NativeArray coarseTiles; - [ReadOnly][Unity.Collections.LowLevel.Unsafe.NativeDisableContainerSafetyRestriction] + [ReadOnly] + [Unity.Collections.LowLevel.Unsafe.NativeDisableContainerSafetyRestriction] public NativeArray coarseTileHeaders; public int coarseHeaderOffset; public int istart; @@ -328,7 +331,7 @@ internal GraphicsFormat GetGBufferFormat(int index) // This is an overlay camera being rendered. internal bool IsOverlay { get; set; } // Not all platforms support R8G8B8A8_SNorm, so we need to check for the support and force accurate GBuffer normals and relevant shader variants - private bool m_AccurateGbufferNormals; + private bool m_AccurateGbufferNormals; internal bool AccurateGbufferNormals { get { return m_AccurateGbufferNormals; } @@ -1410,7 +1413,7 @@ void RenderTileLights(ScriptableRenderContext context, CommandBuffer cmd, ref Re // Add light list for the tile. for (int l = 0; l < tileLightCount; ++l) { - ushort visLightIndex = tiles[tileOffset + l]; + ushort visLightIndex = tiles[tileOffset + l]; ushort relLightBitRange = tiles[tileOffset + tileLightCount + l]; ushort relLightIndex = visLightToRelLights[visLightIndex]; relLightList[relLightIndices++] = (uint)relLightIndex | (uint)(relLightBitRange << 16); @@ -1750,7 +1753,7 @@ bool IsTileLight(VisibleLight visibleLight) // tileDeferred might render a lot of point lights in the same draw call. // point light shadows require generating cube shadow maps in real-time, requiring extra CPU/GPU resources ; which can become expensive quickly return (visibleLight.lightType == LightType.Point && (visibleLight.light == null || visibleLight.light.shadows == LightShadows.None)) - || (visibleLight.lightType == LightType.Spot && (visibleLight.light == null || visibleLight.light.shadows == LightShadows.None)); + || (visibleLight.lightType == LightType.Spot && (visibleLight.light == null || visibleLight.light.shadows == LightShadows.None)); } static Mesh CreateSphereMesh() diff --git a/com.unity.render-pipelines.universal/Runtime/Deprecated.cs b/com.unity.render-pipelines.universal/Runtime/Deprecated.cs index 68a60d77afd..36ec4b4a04e 100644 --- a/com.unity.render-pipelines.universal/Runtime/Deprecated.cs +++ b/com.unity.render-pipelines.universal/Runtime/Deprecated.cs @@ -25,7 +25,8 @@ public partial class AdditionalLightsShadowCasterPass } [Obsolete("This is obsolete, please use shadowCascadeCount instead.", false)] - [MovedFrom("UnityEngine.Rendering.LWRP")] public enum ShadowCascadesOption + [MovedFrom("UnityEngine.Rendering.LWRP")] + public enum ShadowCascadesOption { NoCascades, TwoCascades, diff --git a/com.unity.render-pipelines.universal/Runtime/External/LibTessDotNet/MeshUtils.cs b/com.unity.render-pipelines.universal/Runtime/External/LibTessDotNet/MeshUtils.cs index 0f86d004f65..3bb7d66eeb9 100644 --- a/com.unity.render-pipelines.universal/Runtime/External/LibTessDotNet/MeshUtils.cs +++ b/com.unity.render-pipelines.universal/Runtime/External/LibTessDotNet/MeshUtils.cs @@ -61,7 +61,7 @@ public Real this[int index] if (index == 0) X = value; else if (index == 1) Y = value; else if (index == 2) Z = value; - else throw new IndexOutOfRangeException(); + else throw new IndexOutOfRangeException(); } } @@ -116,7 +116,7 @@ internal static class MeshUtils { private static Stack _stack; public abstract void Reset(); - public virtual void OnFree() {} + public virtual void OnFree() { } public static T Create() { @@ -229,7 +229,7 @@ public class Edge : Pooled internal int _winding; internal Face _Rface { get { return _Sym._Lface; } set { _Sym._Lface = value; } } - internal Vertex _Dst { get { return _Sym._Org; } set { _Sym._Org = value; } } + internal Vertex _Dst { get { return _Sym._Org; } set { _Sym._Org = value; } } internal Edge _Oprev { get { return _Sym._Lnext; } set { _Sym._Lnext = value; } } internal Edge _Lprev { get { return _Onext._Sym; } set { _Onext._Sym = value; } } diff --git a/com.unity.render-pipelines.universal/Runtime/ForwardRenderer.cs b/com.unity.render-pipelines.universal/Runtime/ForwardRenderer.cs index 85a53069161..2f4ca8c4995 100644 --- a/com.unity.render-pipelines.universal/Runtime/ForwardRenderer.cs +++ b/com.unity.render-pipelines.universal/Runtime/ForwardRenderer.cs @@ -30,9 +30,9 @@ private static class Profiling } // Rendering mode setup from UI. - internal RenderingMode renderingMode { get { return m_RenderingMode; } } + internal RenderingMode renderingMode { get { return m_RenderingMode; } } // Actual rendering mode, which may be different (ex: wireframe rendering, harware not capable of deferred rendering). - internal RenderingMode actualRenderingMode { get { return GL.wireframe || m_DeferredLights == null || !m_DeferredLights.IsRuntimeSupportedThisFrame() ? RenderingMode.Forward : this.renderingMode; } } + internal RenderingMode actualRenderingMode { get { return GL.wireframe || m_DeferredLights == null || !m_DeferredLights.IsRuntimeSupportedThisFrame() ? RenderingMode.Forward : this.renderingMode; } } internal bool accurateGbufferNormals { get { return m_DeferredLights != null ? m_DeferredLights.AccurateGbufferNormals : false; } } DepthOnlyPass m_DepthPrepass; DepthNormalOnlyPass m_DepthNormalPrepass; @@ -682,15 +682,15 @@ private RenderPassInputSummary GetRenderPassInputs(ref RenderingData renderingDa for (int i = 0; i < activeRenderPassQueue.Count; ++i) { ScriptableRenderPass pass = activeRenderPassQueue[i]; - bool needsDepth = (pass.input & ScriptableRenderPassInput.Depth) != ScriptableRenderPassInput.None; + bool needsDepth = (pass.input & ScriptableRenderPassInput.Depth) != ScriptableRenderPassInput.None; bool needsNormals = (pass.input & ScriptableRenderPassInput.Normal) != ScriptableRenderPassInput.None; - bool needsColor = (pass.input & ScriptableRenderPassInput.Color) != ScriptableRenderPassInput.None; + bool needsColor = (pass.input & ScriptableRenderPassInput.Color) != ScriptableRenderPassInput.None; bool eventBeforeOpaque = pass.renderPassEvent <= RenderPassEvent.BeforeRenderingOpaques; - inputSummary.requiresDepthTexture |= needsDepth; - inputSummary.requiresDepthPrepass |= needsNormals || needsDepth && eventBeforeOpaque; + inputSummary.requiresDepthTexture |= needsDepth; + inputSummary.requiresDepthPrepass |= needsNormals || needsDepth && eventBeforeOpaque; inputSummary.requiresNormalsTexture |= needsNormals; - inputSummary.requiresColorTexture |= needsColor; + inputSummary.requiresColorTexture |= needsColor; } return inputSummary; @@ -732,15 +732,15 @@ void CreateCameraRenderTarget(ScriptableRenderContext context, ref RenderTexture bool PlatformRequiresExplicitMsaaResolve() { - #if UNITY_EDITOR +#if UNITY_EDITOR // In the editor play-mode we use a Game View Render Texture, with // samples count forced to 1 so we always need to do an explicit MSAA resolve. return true; - #else +#else // On Metal/iOS the MSAA resolve is done implicitly as part of the renderpass, so we do not need an extra intermediate pass for the explicit autoresolve. return !SystemInfo.supportsMultisampleAutoResolve && SystemInfo.graphicsDeviceType != GraphicsDeviceType.Metal; - #endif +#endif } /// diff --git a/com.unity.render-pipelines.universal/Runtime/Overrides/ColorCurves.cs b/com.unity.render-pipelines.universal/Runtime/Overrides/ColorCurves.cs index a0c12cdc721..2b7985afc6b 100644 --- a/com.unity.render-pipelines.universal/Runtime/Overrides/ColorCurves.cs +++ b/com.unity.render-pipelines.universal/Runtime/Overrides/ColorCurves.cs @@ -10,10 +10,10 @@ public sealed class ColorCurves : VolumeComponent, IPostProcessComponent public TextureCurveParameter green = new TextureCurveParameter(new TextureCurve(new[] { new Keyframe(0f, 0f, 1f, 1f), new Keyframe(1f, 1f, 1f, 1f) }, 0f, false, new Vector2(0f, 1f))); public TextureCurveParameter blue = new TextureCurveParameter(new TextureCurve(new[] { new Keyframe(0f, 0f, 1f, 1f), new Keyframe(1f, 1f, 1f, 1f) }, 0f, false, new Vector2(0f, 1f))); - public TextureCurveParameter hueVsHue = new TextureCurveParameter(new TextureCurve(new Keyframe[] {}, 0.5f, true, new Vector2(0f, 1f))); - public TextureCurveParameter hueVsSat = new TextureCurveParameter(new TextureCurve(new Keyframe[] {}, 0.5f, true, new Vector2(0f, 1f))); - public TextureCurveParameter satVsSat = new TextureCurveParameter(new TextureCurve(new Keyframe[] {}, 0.5f, false, new Vector2(0f, 1f))); - public TextureCurveParameter lumVsSat = new TextureCurveParameter(new TextureCurve(new Keyframe[] {}, 0.5f, false, new Vector2(0f, 1f))); + public TextureCurveParameter hueVsHue = new TextureCurveParameter(new TextureCurve(new Keyframe[] { }, 0.5f, true, new Vector2(0f, 1f))); + public TextureCurveParameter hueVsSat = new TextureCurveParameter(new TextureCurve(new Keyframe[] { }, 0.5f, true, new Vector2(0f, 1f))); + public TextureCurveParameter satVsSat = new TextureCurveParameter(new TextureCurve(new Keyframe[] { }, 0.5f, false, new Vector2(0f, 1f))); + public TextureCurveParameter lumVsSat = new TextureCurveParameter(new TextureCurve(new Keyframe[] { }, 0.5f, false, new Vector2(0f, 1f))); public bool IsActive() => true; diff --git a/com.unity.render-pipelines.universal/Runtime/Overrides/DepthOfField.cs b/com.unity.render-pipelines.universal/Runtime/Overrides/DepthOfField.cs index 75cafe27288..3a8d7afae76 100644 --- a/com.unity.render-pipelines.universal/Runtime/Overrides/DepthOfField.cs +++ b/com.unity.render-pipelines.universal/Runtime/Overrides/DepthOfField.cs @@ -57,5 +57,5 @@ public bool IsActive() } [Serializable] - public sealed class DepthOfFieldModeParameter : VolumeParameter { public DepthOfFieldModeParameter(DepthOfFieldMode value, bool overrideState = false) : base(value, overrideState) {} } + public sealed class DepthOfFieldModeParameter : VolumeParameter { public DepthOfFieldModeParameter(DepthOfFieldMode value, bool overrideState = false) : base(value, overrideState) { } } } diff --git a/com.unity.render-pipelines.universal/Runtime/Overrides/FilmGrain.cs b/com.unity.render-pipelines.universal/Runtime/Overrides/FilmGrain.cs index fa0dd76b36d..bbaca2b74f6 100644 --- a/com.unity.render-pipelines.universal/Runtime/Overrides/FilmGrain.cs +++ b/com.unity.render-pipelines.universal/Runtime/Overrides/FilmGrain.cs @@ -38,5 +38,5 @@ public sealed class FilmGrain : VolumeComponent, IPostProcessComponent } [Serializable] - public sealed class FilmGrainLookupParameter : VolumeParameter { public FilmGrainLookupParameter(FilmGrainLookup value, bool overrideState = false) : base(value, overrideState) {} } + public sealed class FilmGrainLookupParameter : VolumeParameter { public FilmGrainLookupParameter(FilmGrainLookup value, bool overrideState = false) : base(value, overrideState) { } } } diff --git a/com.unity.render-pipelines.universal/Runtime/Overrides/MotionBlur.cs b/com.unity.render-pipelines.universal/Runtime/Overrides/MotionBlur.cs index 96dae158a1a..df01a4b13ec 100644 --- a/com.unity.render-pipelines.universal/Runtime/Overrides/MotionBlur.cs +++ b/com.unity.render-pipelines.universal/Runtime/Overrides/MotionBlur.cs @@ -36,8 +36,8 @@ public sealed class MotionBlur : VolumeComponent, IPostProcessComponent } [Serializable] - public sealed class MotionBlurModeParameter : VolumeParameter { public MotionBlurModeParameter(MotionBlurMode value, bool overrideState = false) : base(value, overrideState) {} } + public sealed class MotionBlurModeParameter : VolumeParameter { public MotionBlurModeParameter(MotionBlurMode value, bool overrideState = false) : base(value, overrideState) { } } [Serializable] - public sealed class MotionBlurQualityParameter : VolumeParameter { public MotionBlurQualityParameter(MotionBlurQuality value, bool overrideState = false) : base(value, overrideState) {} } + public sealed class MotionBlurQualityParameter : VolumeParameter { public MotionBlurQualityParameter(MotionBlurQuality value, bool overrideState = false) : base(value, overrideState) { } } } diff --git a/com.unity.render-pipelines.universal/Runtime/Overrides/Tonemapping.cs b/com.unity.render-pipelines.universal/Runtime/Overrides/Tonemapping.cs index 059d3a64d49..980554fe696 100644 --- a/com.unity.render-pipelines.universal/Runtime/Overrides/Tonemapping.cs +++ b/com.unity.render-pipelines.universal/Runtime/Overrides/Tonemapping.cs @@ -21,5 +21,5 @@ public sealed class Tonemapping : VolumeComponent, IPostProcessComponent } [Serializable] - public sealed class TonemappingModeParameter : VolumeParameter { public TonemappingModeParameter(TonemappingMode value, bool overrideState = false) : base(value, overrideState) {} } + public sealed class TonemappingModeParameter : VolumeParameter { public TonemappingModeParameter(TonemappingMode value, bool overrideState = false) : base(value, overrideState) { } } } diff --git a/com.unity.render-pipelines.universal/Runtime/Passes/AdditionalLightsShadowCasterPass.cs b/com.unity.render-pipelines.universal/Runtime/Passes/AdditionalLightsShadowCasterPass.cs index f02b43af1c1..ac3c3ed7cc7 100644 --- a/com.unity.render-pipelines.universal/Runtime/Passes/AdditionalLightsShadowCasterPass.cs +++ b/com.unity.render-pipelines.universal/Runtime/Passes/AdditionalLightsShadowCasterPass.cs @@ -32,7 +32,7 @@ internal struct ShadowResolutionRequest public int offsetY; // y coordinate of the square area allocated in the atlas for this shadow map public int allocatedResolution; // width of the square area allocated in the atlas for this shadow map - public ShadowResolutionRequest(int _visibleLightIndex, int _perLightShadowSliceIndex, int _requestedResolution, bool _softShadow , bool _pointLightShadow) + public ShadowResolutionRequest(int _visibleLightIndex, int _perLightShadowSliceIndex, int _requestedResolution, bool _softShadow, bool _pointLightShadow) { visibleLightIndex = _visibleLightIndex; perLightShadowSliceIndex = _perLightShadowSliceIndex; @@ -175,7 +175,7 @@ internal static float CalcGuardAngle(float frustumAngleInDegrees, float guardBan return guardAngleInDegree; } - private const int kMinimumPunctualLightHardShadowResolution = 8; + private const int kMinimumPunctualLightHardShadowResolution = 8; private const int kMinimumPunctualLightSoftShadowResolution = 16; // Minimal shadow map resolution required to have meaningful shadows visible during lighting int MinimalPunctualLightShadowResolution(bool softShadow) @@ -277,12 +277,12 @@ internal void InsertionSort(ShadowResolutionRequest[] array, int startIndex, int int j = i - 1; // Sort in priority order - while ((j >= 0) && ((curr.requestedResolution > array[j].requestedResolution) + while ((j >= 0) && ((curr.requestedResolution > array[j].requestedResolution) || (curr.requestedResolution == array[j].requestedResolution && !curr.softShadow && array[j].softShadow) - || (curr.requestedResolution == array[j].requestedResolution && curr.softShadow == array[j].softShadow && !curr.pointLightShadow && array[j].pointLightShadow) - || (curr.requestedResolution == array[j].requestedResolution && curr.softShadow == array[j].softShadow && curr.pointLightShadow == array[j].pointLightShadow && m_VisibleLightIndexToCameraSquareDistance[curr.visibleLightIndex] < m_VisibleLightIndexToCameraSquareDistance[array[j].visibleLightIndex]) - || (curr.requestedResolution == array[j].requestedResolution && curr.softShadow == array[j].softShadow && curr.pointLightShadow == array[j].pointLightShadow && m_VisibleLightIndexToCameraSquareDistance[curr.visibleLightIndex] == m_VisibleLightIndexToCameraSquareDistance[array[j].visibleLightIndex] && curr.visibleLightIndex < array[j].visibleLightIndex) - || (curr.requestedResolution == array[j].requestedResolution && curr.softShadow == array[j].softShadow && curr.pointLightShadow == array[j].pointLightShadow && m_VisibleLightIndexToCameraSquareDistance[curr.visibleLightIndex] == m_VisibleLightIndexToCameraSquareDistance[array[j].visibleLightIndex] && curr.visibleLightIndex == array[j].visibleLightIndex && curr.perLightShadowSliceIndex < array[j].perLightShadowSliceIndex))) + || (curr.requestedResolution == array[j].requestedResolution && curr.softShadow == array[j].softShadow && !curr.pointLightShadow && array[j].pointLightShadow) + || (curr.requestedResolution == array[j].requestedResolution && curr.softShadow == array[j].softShadow && curr.pointLightShadow == array[j].pointLightShadow && m_VisibleLightIndexToCameraSquareDistance[curr.visibleLightIndex] < m_VisibleLightIndexToCameraSquareDistance[array[j].visibleLightIndex]) + || (curr.requestedResolution == array[j].requestedResolution && curr.softShadow == array[j].softShadow && curr.pointLightShadow == array[j].pointLightShadow && m_VisibleLightIndexToCameraSquareDistance[curr.visibleLightIndex] == m_VisibleLightIndexToCameraSquareDistance[array[j].visibleLightIndex] && curr.visibleLightIndex < array[j].visibleLightIndex) + || (curr.requestedResolution == array[j].requestedResolution && curr.softShadow == array[j].softShadow && curr.pointLightShadow == array[j].pointLightShadow && m_VisibleLightIndexToCameraSquareDistance[curr.visibleLightIndex] == m_VisibleLightIndexToCameraSquareDistance[array[j].visibleLightIndex] && curr.visibleLightIndex == array[j].visibleLightIndex && curr.perLightShadowSliceIndex < array[j].perLightShadowSliceIndex))) { array[j + 1] = array[j]; j--; @@ -752,7 +752,7 @@ public bool Setup(ref RenderingData renderingData) additionalLightIndex = m_ShadowSliceToAdditionalLightIndex[globalShadowSliceIndex]; // We can skip the slice if strength is zero. - if (Mathf.Approximately(m_AdditionalLightIndexToShadowParams[additionalLightIndex].x, 0.0f) || Mathf.Approximately(m_AdditionalLightIndexToShadowParams[additionalLightIndex].w, -1.0f)) + if (Mathf.Approximately(m_AdditionalLightIndexToShadowParams[additionalLightIndex].x, 0.0f) || Mathf.Approximately(m_AdditionalLightIndexToShadowParams[additionalLightIndex].w, -1.0f)) continue; int visibleLightIndex = m_AdditionalLightIndexToVisibleLightIndex[additionalLightIndex]; @@ -841,7 +841,7 @@ void RenderAdditionalShadowmapAtlas(ref ScriptableRenderContext context, ref Cul // we do the shadow strength check here again here because we might have zero strength for non-shadow-casting lights. // In that case we need the shadow data buffer but we can skip rendering them to shadowmap. - if (Mathf.Approximately(m_AdditionalLightIndexToShadowParams[additionalLightIndex].x, 0.0f) || Mathf.Approximately(m_AdditionalLightIndexToShadowParams[additionalLightIndex].w, -1.0f)) + if (Mathf.Approximately(m_AdditionalLightIndexToShadowParams[additionalLightIndex].x, 0.0f) || Mathf.Approximately(m_AdditionalLightIndexToShadowParams[additionalLightIndex].w, -1.0f)) continue; int visibleLightIndex = m_AdditionalLightIndexToVisibleLightIndex[additionalLightIndex]; diff --git a/com.unity.render-pipelines.universal/Runtime/Passes/ColorGradingLutPass.cs b/com.unity.render-pipelines.universal/Runtime/Passes/ColorGradingLutPass.cs index 81267d899aa..f7f0fa6cc39 100644 --- a/com.unity.render-pipelines.universal/Runtime/Passes/ColorGradingLutPass.cs +++ b/com.unity.render-pipelines.universal/Runtime/Passes/ColorGradingLutPass.cs @@ -100,19 +100,19 @@ public override void Execute(ScriptableRenderContext context, ref RenderingData shadowsMidtonesHighlights.highlightsEnd.value ); - var(shadows, midtones, highlights) = ColorUtils.PrepareShadowsMidtonesHighlights( + var (shadows, midtones, highlights) = ColorUtils.PrepareShadowsMidtonesHighlights( shadowsMidtonesHighlights.shadows.value, shadowsMidtonesHighlights.midtones.value, shadowsMidtonesHighlights.highlights.value ); - var(lift, gamma, gain) = ColorUtils.PrepareLiftGammaGain( + var (lift, gamma, gain) = ColorUtils.PrepareLiftGammaGain( liftGammaGain.lift.value, liftGammaGain.gamma.value, liftGammaGain.gain.value ); - var(splitShadows, splitHighlights) = ColorUtils.PrepareSplitToning( + var (splitShadows, splitHighlights) = ColorUtils.PrepareSplitToning( splitToning.shadows.value, splitToning.highlights.value, splitToning.balance.value @@ -191,30 +191,30 @@ public void Cleanup() // Precomputed shader ids to same some CPU cycles (mostly affects mobile) static class ShaderConstants { - public static readonly int _Lut_Params = Shader.PropertyToID("_Lut_Params"); - public static readonly int _ColorBalance = Shader.PropertyToID("_ColorBalance"); - public static readonly int _ColorFilter = Shader.PropertyToID("_ColorFilter"); - public static readonly int _ChannelMixerRed = Shader.PropertyToID("_ChannelMixerRed"); + public static readonly int _Lut_Params = Shader.PropertyToID("_Lut_Params"); + public static readonly int _ColorBalance = Shader.PropertyToID("_ColorBalance"); + public static readonly int _ColorFilter = Shader.PropertyToID("_ColorFilter"); + public static readonly int _ChannelMixerRed = Shader.PropertyToID("_ChannelMixerRed"); public static readonly int _ChannelMixerGreen = Shader.PropertyToID("_ChannelMixerGreen"); - public static readonly int _ChannelMixerBlue = Shader.PropertyToID("_ChannelMixerBlue"); - public static readonly int _HueSatCon = Shader.PropertyToID("_HueSatCon"); - public static readonly int _Lift = Shader.PropertyToID("_Lift"); - public static readonly int _Gamma = Shader.PropertyToID("_Gamma"); - public static readonly int _Gain = Shader.PropertyToID("_Gain"); - public static readonly int _Shadows = Shader.PropertyToID("_Shadows"); - public static readonly int _Midtones = Shader.PropertyToID("_Midtones"); - public static readonly int _Highlights = Shader.PropertyToID("_Highlights"); - public static readonly int _ShaHiLimits = Shader.PropertyToID("_ShaHiLimits"); - public static readonly int _SplitShadows = Shader.PropertyToID("_SplitShadows"); - public static readonly int _SplitHighlights = Shader.PropertyToID("_SplitHighlights"); - public static readonly int _CurveMaster = Shader.PropertyToID("_CurveMaster"); - public static readonly int _CurveRed = Shader.PropertyToID("_CurveRed"); - public static readonly int _CurveGreen = Shader.PropertyToID("_CurveGreen"); - public static readonly int _CurveBlue = Shader.PropertyToID("_CurveBlue"); - public static readonly int _CurveHueVsHue = Shader.PropertyToID("_CurveHueVsHue"); - public static readonly int _CurveHueVsSat = Shader.PropertyToID("_CurveHueVsSat"); - public static readonly int _CurveLumVsSat = Shader.PropertyToID("_CurveLumVsSat"); - public static readonly int _CurveSatVsSat = Shader.PropertyToID("_CurveSatVsSat"); + public static readonly int _ChannelMixerBlue = Shader.PropertyToID("_ChannelMixerBlue"); + public static readonly int _HueSatCon = Shader.PropertyToID("_HueSatCon"); + public static readonly int _Lift = Shader.PropertyToID("_Lift"); + public static readonly int _Gamma = Shader.PropertyToID("_Gamma"); + public static readonly int _Gain = Shader.PropertyToID("_Gain"); + public static readonly int _Shadows = Shader.PropertyToID("_Shadows"); + public static readonly int _Midtones = Shader.PropertyToID("_Midtones"); + public static readonly int _Highlights = Shader.PropertyToID("_Highlights"); + public static readonly int _ShaHiLimits = Shader.PropertyToID("_ShaHiLimits"); + public static readonly int _SplitShadows = Shader.PropertyToID("_SplitShadows"); + public static readonly int _SplitHighlights = Shader.PropertyToID("_SplitHighlights"); + public static readonly int _CurveMaster = Shader.PropertyToID("_CurveMaster"); + public static readonly int _CurveRed = Shader.PropertyToID("_CurveRed"); + public static readonly int _CurveGreen = Shader.PropertyToID("_CurveGreen"); + public static readonly int _CurveBlue = Shader.PropertyToID("_CurveBlue"); + public static readonly int _CurveHueVsHue = Shader.PropertyToID("_CurveHueVsHue"); + public static readonly int _CurveHueVsSat = Shader.PropertyToID("_CurveHueVsSat"); + public static readonly int _CurveLumVsSat = Shader.PropertyToID("_CurveLumVsSat"); + public static readonly int _CurveSatVsSat = Shader.PropertyToID("_CurveSatVsSat"); } } } diff --git a/com.unity.render-pipelines.universal/Runtime/Passes/CopyDepthPass.cs b/com.unity.render-pipelines.universal/Runtime/Passes/CopyDepthPass.cs index c1fd7dac49a..7c811c5ad49 100644 --- a/com.unity.render-pipelines.universal/Runtime/Passes/CopyDepthPass.cs +++ b/com.unity.render-pipelines.universal/Runtime/Passes/CopyDepthPass.cs @@ -15,7 +15,7 @@ public class CopyDepthPass : ScriptableRenderPass { private RenderTargetHandle source { get; set; } private RenderTargetHandle destination { get; set; } - internal bool AllocateRT { get; set; } + internal bool AllocateRT { get; set; } Material m_CopyDepthMaterial; public CopyDepthPass(RenderPassEvent evt, Material copyDepthMaterial) { diff --git a/com.unity.render-pipelines.universal/Runtime/Passes/DrawObjectsPass.cs b/com.unity.render-pipelines.universal/Runtime/Passes/DrawObjectsPass.cs index 30c6cd821e6..4818f428e6c 100644 --- a/com.unity.render-pipelines.universal/Runtime/Passes/DrawObjectsPass.cs +++ b/com.unity.render-pipelines.universal/Runtime/Passes/DrawObjectsPass.cs @@ -44,9 +44,9 @@ public DrawObjectsPass(string profilerTag, ShaderTagId[] shaderTagIds, bool opaq public DrawObjectsPass(string profilerTag, bool opaque, RenderPassEvent evt, RenderQueueRange renderQueueRange, LayerMask layerMask, StencilState stencilState, int stencilReference) : this(profilerTag, - new ShaderTagId[] { new ShaderTagId("SRPDefaultUnlit"), new ShaderTagId("UniversalForward"), new ShaderTagId("UniversalForwardOnly"), new ShaderTagId("LightweightForward")}, + new ShaderTagId[] { new ShaderTagId("SRPDefaultUnlit"), new ShaderTagId("UniversalForward"), new ShaderTagId("UniversalForwardOnly"), new ShaderTagId("LightweightForward") }, opaque, evt, renderQueueRange, layerMask, stencilState, stencilReference) - {} + { } internal DrawObjectsPass(URPProfileId profileId, bool opaque, RenderPassEvent evt, RenderQueueRange renderQueueRange, LayerMask layerMask, StencilState stencilState, int stencilReference) : this(profileId.GetType().Name, opaque, evt, renderQueueRange, layerMask, stencilState, stencilReference) @@ -86,13 +86,13 @@ public override void Execute(ScriptableRenderContext context, ref RenderingData var drawSettings = CreateDrawingSettings(m_ShaderTagIdList, ref renderingData, sortFlags); var filterSettings = m_FilteringSettings; - #if UNITY_EDITOR +#if UNITY_EDITOR // When rendering the preview camera, we want the layer mask to be forced to Everything if (renderingData.cameraData.isPreviewCamera) { filterSettings.layerMask = -1; } - #endif +#endif context.DrawRenderers(renderingData.cullResults, ref drawSettings, ref filterSettings, ref m_RenderStateBlock); diff --git a/com.unity.render-pipelines.universal/Runtime/Passes/PostProcessPass.cs b/com.unity.render-pipelines.universal/Runtime/Passes/PostProcessPass.cs index 0cf9b9f66b0..f49c4a4533f 100644 --- a/com.unity.render-pipelines.universal/Runtime/Passes/PostProcessPass.cs +++ b/com.unity.render-pipelines.universal/Runtime/Passes/PostProcessPass.cs @@ -199,18 +199,18 @@ public override void Execute(ScriptableRenderContext context, ref RenderingData // Start by pre-fetching all builtin effect settings we need // Some of the color-grading settings are only used in the color grading lut pass var stack = VolumeManager.instance.stack; - m_DepthOfField = stack.GetComponent(); - m_MotionBlur = stack.GetComponent(); - m_PaniniProjection = stack.GetComponent(); - m_Bloom = stack.GetComponent(); - m_LensDistortion = stack.GetComponent(); + m_DepthOfField = stack.GetComponent(); + m_MotionBlur = stack.GetComponent(); + m_PaniniProjection = stack.GetComponent(); + m_Bloom = stack.GetComponent(); + m_LensDistortion = stack.GetComponent(); m_ChromaticAberration = stack.GetComponent(); - m_Vignette = stack.GetComponent(); - m_ColorLookup = stack.GetComponent(); - m_ColorAdjustments = stack.GetComponent(); - m_Tonemapping = stack.GetComponent(); - m_FilmGrain = stack.GetComponent(); - m_UseDrawProcedural = renderingData.cameraData.xr.enabled; + m_Vignette = stack.GetComponent(); + m_ColorLookup = stack.GetComponent(); + m_ColorAdjustments = stack.GetComponent(); + m_Tonemapping = stack.GetComponent(); + m_FilmGrain = stack.GetComponent(); + m_UseDrawProcedural = renderingData.cameraData.xr.enabled; m_UseFastSRGBLinearConversion = renderingData.postProcessingData.useFastSRGBLinearConversion; if (m_IsFinalPass) @@ -544,11 +544,14 @@ void DoSubpixelMorphologicalAntialiasing(ref CameraData cameraData, CommandBuffe switch (cameraData.antialiasingQuality) { - case AntialiasingQuality.Low: material.EnableKeyword(ShaderKeywordStrings.SmaaLow); + case AntialiasingQuality.Low: + material.EnableKeyword(ShaderKeywordStrings.SmaaLow); break; - case AntialiasingQuality.Medium: material.EnableKeyword(ShaderKeywordStrings.SmaaMedium); + case AntialiasingQuality.Medium: + material.EnableKeyword(ShaderKeywordStrings.SmaaMedium); break; - case AntialiasingQuality.High: material.EnableKeyword(ShaderKeywordStrings.SmaaHigh); + case AntialiasingQuality.High: + material.EnableKeyword(ShaderKeywordStrings.SmaaHigh); break; } @@ -1306,47 +1309,47 @@ internal void Cleanup() // Precomputed shader ids to same some CPU cycles (mostly affects mobile) static class ShaderConstants { - public static readonly int _TempTarget = Shader.PropertyToID("_TempTarget"); - public static readonly int _TempTarget2 = Shader.PropertyToID("_TempTarget2"); - - public static readonly int _StencilRef = Shader.PropertyToID("_StencilRef"); - public static readonly int _StencilMask = Shader.PropertyToID("_StencilMask"); - - public static readonly int _FullCoCTexture = Shader.PropertyToID("_FullCoCTexture"); - public static readonly int _HalfCoCTexture = Shader.PropertyToID("_HalfCoCTexture"); - public static readonly int _DofTexture = Shader.PropertyToID("_DofTexture"); - public static readonly int _CoCParams = Shader.PropertyToID("_CoCParams"); - public static readonly int _BokehKernel = Shader.PropertyToID("_BokehKernel"); - public static readonly int _PongTexture = Shader.PropertyToID("_PongTexture"); - public static readonly int _PingTexture = Shader.PropertyToID("_PingTexture"); - - public static readonly int _Metrics = Shader.PropertyToID("_Metrics"); - public static readonly int _AreaTexture = Shader.PropertyToID("_AreaTexture"); - public static readonly int _SearchTexture = Shader.PropertyToID("_SearchTexture"); - public static readonly int _EdgeTexture = Shader.PropertyToID("_EdgeTexture"); - public static readonly int _BlendTexture = Shader.PropertyToID("_BlendTexture"); - - public static readonly int _ColorTexture = Shader.PropertyToID("_ColorTexture"); - public static readonly int _Params = Shader.PropertyToID("_Params"); - public static readonly int _SourceTexLowMip = Shader.PropertyToID("_SourceTexLowMip"); - public static readonly int _Bloom_Params = Shader.PropertyToID("_Bloom_Params"); - public static readonly int _Bloom_RGBM = Shader.PropertyToID("_Bloom_RGBM"); - public static readonly int _Bloom_Texture = Shader.PropertyToID("_Bloom_Texture"); - public static readonly int _LensDirt_Texture = Shader.PropertyToID("_LensDirt_Texture"); - public static readonly int _LensDirt_Params = Shader.PropertyToID("_LensDirt_Params"); + public static readonly int _TempTarget = Shader.PropertyToID("_TempTarget"); + public static readonly int _TempTarget2 = Shader.PropertyToID("_TempTarget2"); + + public static readonly int _StencilRef = Shader.PropertyToID("_StencilRef"); + public static readonly int _StencilMask = Shader.PropertyToID("_StencilMask"); + + public static readonly int _FullCoCTexture = Shader.PropertyToID("_FullCoCTexture"); + public static readonly int _HalfCoCTexture = Shader.PropertyToID("_HalfCoCTexture"); + public static readonly int _DofTexture = Shader.PropertyToID("_DofTexture"); + public static readonly int _CoCParams = Shader.PropertyToID("_CoCParams"); + public static readonly int _BokehKernel = Shader.PropertyToID("_BokehKernel"); + public static readonly int _PongTexture = Shader.PropertyToID("_PongTexture"); + public static readonly int _PingTexture = Shader.PropertyToID("_PingTexture"); + + public static readonly int _Metrics = Shader.PropertyToID("_Metrics"); + public static readonly int _AreaTexture = Shader.PropertyToID("_AreaTexture"); + public static readonly int _SearchTexture = Shader.PropertyToID("_SearchTexture"); + public static readonly int _EdgeTexture = Shader.PropertyToID("_EdgeTexture"); + public static readonly int _BlendTexture = Shader.PropertyToID("_BlendTexture"); + + public static readonly int _ColorTexture = Shader.PropertyToID("_ColorTexture"); + public static readonly int _Params = Shader.PropertyToID("_Params"); + public static readonly int _SourceTexLowMip = Shader.PropertyToID("_SourceTexLowMip"); + public static readonly int _Bloom_Params = Shader.PropertyToID("_Bloom_Params"); + public static readonly int _Bloom_RGBM = Shader.PropertyToID("_Bloom_RGBM"); + public static readonly int _Bloom_Texture = Shader.PropertyToID("_Bloom_Texture"); + public static readonly int _LensDirt_Texture = Shader.PropertyToID("_LensDirt_Texture"); + public static readonly int _LensDirt_Params = Shader.PropertyToID("_LensDirt_Params"); public static readonly int _LensDirt_Intensity = Shader.PropertyToID("_LensDirt_Intensity"); public static readonly int _Distortion_Params1 = Shader.PropertyToID("_Distortion_Params1"); public static readonly int _Distortion_Params2 = Shader.PropertyToID("_Distortion_Params2"); - public static readonly int _Chroma_Params = Shader.PropertyToID("_Chroma_Params"); - public static readonly int _Vignette_Params1 = Shader.PropertyToID("_Vignette_Params1"); - public static readonly int _Vignette_Params2 = Shader.PropertyToID("_Vignette_Params2"); - public static readonly int _Lut_Params = Shader.PropertyToID("_Lut_Params"); - public static readonly int _UserLut_Params = Shader.PropertyToID("_UserLut_Params"); - public static readonly int _InternalLut = Shader.PropertyToID("_InternalLut"); - public static readonly int _UserLut = Shader.PropertyToID("_UserLut"); + public static readonly int _Chroma_Params = Shader.PropertyToID("_Chroma_Params"); + public static readonly int _Vignette_Params1 = Shader.PropertyToID("_Vignette_Params1"); + public static readonly int _Vignette_Params2 = Shader.PropertyToID("_Vignette_Params2"); + public static readonly int _Lut_Params = Shader.PropertyToID("_Lut_Params"); + public static readonly int _UserLut_Params = Shader.PropertyToID("_UserLut_Params"); + public static readonly int _InternalLut = Shader.PropertyToID("_InternalLut"); + public static readonly int _UserLut = Shader.PropertyToID("_UserLut"); public static readonly int _DownSampleScaleFactor = Shader.PropertyToID("_DownSampleScaleFactor"); - public static readonly int _FullscreenProjMat = Shader.PropertyToID("_FullscreenProjMat"); + public static readonly int _FullscreenProjMat = Shader.PropertyToID("_FullscreenProjMat"); public static int[] _BloomMipUp; public static int[] _BloomMipDown; diff --git a/com.unity.render-pipelines.universal/Runtime/Passes/RenderObjectsPass.cs b/com.unity.render-pipelines.universal/Runtime/Passes/RenderObjectsPass.cs index 4efdf2be7e8..a444ec847e8 100644 --- a/com.unity.render-pipelines.universal/Runtime/Passes/RenderObjectsPass.cs +++ b/com.unity.render-pipelines.universal/Runtime/Passes/RenderObjectsPass.cs @@ -5,7 +5,8 @@ namespace UnityEngine.Experimental.Rendering.Universal { - [MovedFrom("UnityEngine.Experimental.Rendering.LWRP")] public class RenderObjectsPass : ScriptableRenderPass + [MovedFrom("UnityEngine.Experimental.Rendering.LWRP")] + public class RenderObjectsPass : ScriptableRenderPass { RenderQueueType renderQueueType; FilteringSettings m_FilteringSettings; diff --git a/com.unity.render-pipelines.universal/Runtime/Passes/ScriptableRenderPass.cs b/com.unity.render-pipelines.universal/Runtime/Passes/ScriptableRenderPass.cs index f567373675c..1ea5ce64c72 100644 --- a/com.unity.render-pipelines.universal/Runtime/Passes/ScriptableRenderPass.cs +++ b/com.unity.render-pipelines.universal/Runtime/Passes/ScriptableRenderPass.cs @@ -24,7 +24,8 @@ public enum ScriptableRenderPassInput /// /// Controls when the render pass executes. /// - [MovedFrom("UnityEngine.Rendering.LWRP")] public enum RenderPassEvent + [MovedFrom("UnityEngine.Rendering.LWRP")] + public enum RenderPassEvent { /// /// Executes a ScriptableRenderPass before rendering any other passes in the pipeline. @@ -110,7 +111,8 @@ public enum ScriptableRenderPassInput /// /// ScriptableRenderPass implements a logical rendering pass that can be used to extend Universal RP renderer. /// - [MovedFrom("UnityEngine.Rendering.LWRP")] public abstract partial class ScriptableRenderPass + [MovedFrom("UnityEngine.Rendering.LWRP")] + public abstract partial class ScriptableRenderPass { public RenderPassEvent renderPassEvent { get; set; } @@ -153,7 +155,7 @@ public Color clearColor internal bool overrideCameraTarget { get; set; } internal bool isBlitRenderPass { get; set; } - RenderTargetIdentifier[] m_ColorAttachments = new RenderTargetIdentifier[] {BuiltinRenderTextureType.CameraTarget}; + RenderTargetIdentifier[] m_ColorAttachments = new RenderTargetIdentifier[] { BuiltinRenderTextureType.CameraTarget }; RenderTargetIdentifier m_DepthAttachment = BuiltinRenderTextureType.CameraTarget; ScriptableRenderPassInput m_Input = ScriptableRenderPassInput.None; ClearFlag m_ClearFlag = ClearFlag.None; @@ -162,7 +164,7 @@ public Color clearColor public ScriptableRenderPass() { renderPassEvent = RenderPassEvent.AfterRenderingOpaques; - m_ColorAttachments = new RenderTargetIdentifier[] {BuiltinRenderTextureType.CameraTarget, 0, 0, 0, 0, 0, 0, 0}; + m_ColorAttachments = new RenderTargetIdentifier[] { BuiltinRenderTextureType.CameraTarget, 0, 0, 0, 0, 0, 0, 0 }; m_DepthAttachment = BuiltinRenderTextureType.CameraTarget; m_ClearFlag = ClearFlag.None; m_ClearColor = Color.black; @@ -263,7 +265,7 @@ public void ConfigureClear(ClearFlag clearFlag, Color clearColor) /// /// public virtual void OnCameraSetup(CommandBuffer cmd, ref RenderingData renderingData) - {} + { } /// /// This method is called by the renderer before executing the render pass. @@ -276,7 +278,7 @@ public virtual void OnCameraSetup(CommandBuffer cmd, ref RenderingData rendering /// /// public virtual void Configure(CommandBuffer cmd, RenderTextureDescriptor cameraTextureDescriptor) - {} + { } /// @@ -299,7 +301,7 @@ public virtual void OnCameraCleanup(CommandBuffer cmd) /// /// Use this CommandBuffer to cleanup any generated data public virtual void OnFinishCameraStackRendering(CommandBuffer cmd) - {} + { } /// /// Execute the pass. This is where custom rendering occurs. Specific details are left to the implementation @@ -371,12 +373,12 @@ public DrawingSettings CreateDrawingSettings(List shaderTagIdList, return settings; } - public static bool operator<(ScriptableRenderPass lhs, ScriptableRenderPass rhs) + public static bool operator <(ScriptableRenderPass lhs, ScriptableRenderPass rhs) { return lhs.renderPassEvent < rhs.renderPassEvent; } - public static bool operator>(ScriptableRenderPass lhs, ScriptableRenderPass rhs) + public static bool operator >(ScriptableRenderPass lhs, ScriptableRenderPass rhs) { return lhs.renderPassEvent > rhs.renderPassEvent; } diff --git a/com.unity.render-pipelines.universal/Runtime/PostProcessUtils.cs b/com.unity.render-pipelines.universal/Runtime/PostProcessUtils.cs index e2722d24496..c82081d99fc 100644 --- a/com.unity.render-pipelines.universal/Runtime/PostProcessUtils.cs +++ b/com.unity.render-pipelines.universal/Runtime/PostProcessUtils.cs @@ -16,17 +16,17 @@ public static int ConfigureDithering(PostProcessData data, int index, int camera if (blueNoise == null || blueNoise.Length == 0) return 0; // Safe guard - #if LWRP_DEBUG_STATIC_POSTFX // Used by QA for automated testing +#if LWRP_DEBUG_STATIC_POSTFX // Used by QA for automated testing index = 0; float rndOffsetX = 0f; float rndOffsetY = 0f; - #else +#else if (++index >= blueNoise.Length) index = 0; float rndOffsetX = Random.value; float rndOffsetY = Random.value; - #endif +#endif // Ideally we would be sending a texture array once and an index to the slice to use // on every frame but these aren't supported on all Universal targets @@ -57,13 +57,13 @@ public static void ConfigureFilmGrain(PostProcessData data, FilmGrain settings, if (settings.type.value != FilmGrainLookup.Custom) texture = data.textures.filmGrainTex[(int)settings.type.value]; - #if LWRP_DEBUG_STATIC_POSTFX +#if LWRP_DEBUG_STATIC_POSTFX float offsetX = 0f; float offsetY = 0f; - #else +#else float offsetX = Random.value; float offsetY = Random.value; - #endif +#endif var tilingParams = texture == null ? Vector4.zero @@ -94,7 +94,7 @@ static class ShaderConstants public static readonly int _Grain_TilingParams = Shader.PropertyToID("_Grain_TilingParams"); public static readonly int _BlueNoise_Texture = Shader.PropertyToID("_BlueNoise_Texture"); - public static readonly int _Dithering_Params = Shader.PropertyToID("_Dithering_Params"); + public static readonly int _Dithering_Params = Shader.PropertyToID("_Dithering_Params"); public static readonly int _SourceSize = Shader.PropertyToID("_SourceSize"); } diff --git a/com.unity.render-pipelines.universal/Runtime/RenderTargetHandle.cs b/com.unity.render-pipelines.universal/Runtime/RenderTargetHandle.cs index b5ed37279b4..160996055c0 100644 --- a/com.unity.render-pipelines.universal/Runtime/RenderTargetHandle.cs +++ b/com.unity.render-pipelines.universal/Runtime/RenderTargetHandle.cs @@ -3,12 +3,13 @@ namespace UnityEngine.Rendering.Universal { // RenderTargetHandle can be thought of as a kind of ShaderProperty string hash - [MovedFrom("UnityEngine.Rendering.LWRP")] public struct RenderTargetHandle + [MovedFrom("UnityEngine.Rendering.LWRP")] + public struct RenderTargetHandle { public int id { set; get; } private RenderTargetIdentifier rtid { set; get; } - public static readonly RenderTargetHandle CameraTarget = new RenderTargetHandle {id = -1 }; + public static readonly RenderTargetHandle CameraTarget = new RenderTargetHandle { id = -1 }; public RenderTargetHandle(RenderTargetIdentifier renderTargetIdentifier) { @@ -75,12 +76,12 @@ public override int GetHashCode() return id; } - public static bool operator==(RenderTargetHandle c1, RenderTargetHandle c2) + public static bool operator ==(RenderTargetHandle c1, RenderTargetHandle c2) { return c1.Equals(c2); } - public static bool operator!=(RenderTargetHandle c1, RenderTargetHandle c2) + public static bool operator !=(RenderTargetHandle c1, RenderTargetHandle c2) { return !c1.Equals(c2); } diff --git a/com.unity.render-pipelines.universal/Runtime/RendererFeatures/RenderObjects.cs b/com.unity.render-pipelines.universal/Runtime/RendererFeatures/RenderObjects.cs index 249175785d1..ce73d96e5bf 100644 --- a/com.unity.render-pipelines.universal/Runtime/RendererFeatures/RenderObjects.cs +++ b/com.unity.render-pipelines.universal/Runtime/RendererFeatures/RenderObjects.cs @@ -5,14 +5,16 @@ namespace UnityEngine.Experimental.Rendering.Universal { - [MovedFrom("UnityEngine.Experimental.Rendering.LWRP")] public enum RenderQueueType + [MovedFrom("UnityEngine.Experimental.Rendering.LWRP")] + public enum RenderQueueType { Opaque, Transparent, } [ExcludeFromPreset] - [MovedFrom("UnityEngine.Experimental.Rendering.LWRP")] public class RenderObjects : ScriptableRendererFeature + [MovedFrom("UnityEngine.Experimental.Rendering.LWRP")] + public class RenderObjects : ScriptableRendererFeature { [System.Serializable] public class RenderObjectsSettings diff --git a/com.unity.render-pipelines.universal/Runtime/RendererFeatures/ScreenSpaceAmbientOcclusion.cs b/com.unity.render-pipelines.universal/Runtime/RendererFeatures/ScreenSpaceAmbientOcclusion.cs index 524bffbf9d2..98fe26d135c 100644 --- a/com.unity.render-pipelines.universal/Runtime/RendererFeatures/ScreenSpaceAmbientOcclusion.cs +++ b/com.unity.render-pipelines.universal/Runtime/RendererFeatures/ScreenSpaceAmbientOcclusion.cs @@ -164,9 +164,9 @@ internal bool Setup(ScreenSpaceAmbientOcclusionSettings featureSettings) throw new ArgumentOutOfRangeException(); } return material != null - && m_CurrentSettings.Intensity > 0.0f - && m_CurrentSettings.Radius > 0.0f - && m_CurrentSettings.SampleCount > 0; + && m_CurrentSettings.Intensity > 0.0f + && m_CurrentSettings.Radius > 0.0f + && m_CurrentSettings.SampleCount > 0; } /// diff --git a/com.unity.render-pipelines.universal/Runtime/RenderingUtils.cs b/com.unity.render-pipelines.universal/Runtime/RenderingUtils.cs index 5fdf6f3c522..f0655286027 100644 --- a/com.unity.render-pipelines.universal/Runtime/RenderingUtils.cs +++ b/com.unity.render-pipelines.universal/Runtime/RenderingUtils.cs @@ -9,7 +9,8 @@ namespace UnityEngine.Rendering.Universal /// /// Contains properties and helper functions that you can use when rendering. /// - [MovedFrom("UnityEngine.Rendering.LWRP")] public static class RenderingUtils + [MovedFrom("UnityEngine.Rendering.LWRP")] + public static class RenderingUtils { static List m_LegacyShaderPassNames = new List() { @@ -91,7 +92,7 @@ static Material errorMaterial { s_ErrorMaterial = new Material(Shader.Find("Hidden/Universal Render Pipeline/FallbackError")); } - catch {} + catch { } } return s_ErrorMaterial; diff --git a/com.unity.render-pipelines.universal/Runtime/SampleCount.cs b/com.unity.render-pipelines.universal/Runtime/SampleCount.cs index 65403186d56..71dc60949e3 100644 --- a/com.unity.render-pipelines.universal/Runtime/SampleCount.cs +++ b/com.unity.render-pipelines.universal/Runtime/SampleCount.cs @@ -2,7 +2,8 @@ namespace UnityEngine.Rendering.Universal { - [MovedFrom("UnityEngine.Rendering.LWRP")] public enum SampleCount + [MovedFrom("UnityEngine.Rendering.LWRP")] + public enum SampleCount { One = 1, Two = 2, diff --git a/com.unity.render-pipelines.universal/Runtime/ScriptableRenderer.cs b/com.unity.render-pipelines.universal/Runtime/ScriptableRenderer.cs index dc55d49d884..c1aa7e810a5 100644 --- a/com.unity.render-pipelines.universal/Runtime/ScriptableRenderer.cs +++ b/com.unity.render-pipelines.universal/Runtime/ScriptableRenderer.cs @@ -25,21 +25,21 @@ private static class Profiling { private const string k_Name = nameof(ScriptableRenderer); public static readonly ProfilingSampler setPerCameraShaderVariables = new ProfilingSampler($"{k_Name}.{nameof(SetPerCameraShaderVariables)}"); - public static readonly ProfilingSampler sortRenderPasses = new ProfilingSampler($"Sort Render Passes"); - public static readonly ProfilingSampler setupLights = new ProfilingSampler($"{k_Name}.{nameof(SetupLights)}"); - public static readonly ProfilingSampler setupCamera = new ProfilingSampler($"Setup Camera Parameters"); - public static readonly ProfilingSampler addRenderPasses = new ProfilingSampler($"{k_Name}.{nameof(AddRenderPasses)}"); - public static readonly ProfilingSampler clearRenderingState = new ProfilingSampler($"{k_Name}.{nameof(ClearRenderingState)}"); - public static readonly ProfilingSampler internalStartRendering = new ProfilingSampler($"{k_Name}.{nameof(InternalStartRendering)}"); - public static readonly ProfilingSampler internalFinishRendering = new ProfilingSampler($"{k_Name}.{nameof(InternalFinishRendering)}"); + public static readonly ProfilingSampler sortRenderPasses = new ProfilingSampler($"Sort Render Passes"); + public static readonly ProfilingSampler setupLights = new ProfilingSampler($"{k_Name}.{nameof(SetupLights)}"); + public static readonly ProfilingSampler setupCamera = new ProfilingSampler($"Setup Camera Parameters"); + public static readonly ProfilingSampler addRenderPasses = new ProfilingSampler($"{k_Name}.{nameof(AddRenderPasses)}"); + public static readonly ProfilingSampler clearRenderingState = new ProfilingSampler($"{k_Name}.{nameof(ClearRenderingState)}"); + public static readonly ProfilingSampler internalStartRendering = new ProfilingSampler($"{k_Name}.{nameof(InternalStartRendering)}"); + public static readonly ProfilingSampler internalFinishRendering = new ProfilingSampler($"{k_Name}.{nameof(InternalFinishRendering)}"); public static class RenderBlock { private const string k_Name = nameof(RenderPassBlock); - public static readonly ProfilingSampler beforeRendering = new ProfilingSampler($"{k_Name}.{nameof(RenderPassBlock.BeforeRendering)}"); - public static readonly ProfilingSampler mainRenderingOpaque = new ProfilingSampler($"{k_Name}.{nameof(RenderPassBlock.MainRenderingOpaque)}"); + public static readonly ProfilingSampler beforeRendering = new ProfilingSampler($"{k_Name}.{nameof(RenderPassBlock.BeforeRendering)}"); + public static readonly ProfilingSampler mainRenderingOpaque = new ProfilingSampler($"{k_Name}.{nameof(RenderPassBlock.MainRenderingOpaque)}"); public static readonly ProfilingSampler mainRenderingTransparent = new ProfilingSampler($"{k_Name}.{nameof(RenderPassBlock.MainRenderingTransparent)}"); - public static readonly ProfilingSampler afterRendering = new ProfilingSampler($"{k_Name}.{nameof(RenderPassBlock.AfterRendering)}"); + public static readonly ProfilingSampler afterRendering = new ProfilingSampler($"{k_Name}.{nameof(RenderPassBlock.AfterRendering)}"); } public static class RenderPass @@ -337,7 +337,7 @@ static class RenderPassBlock // This should be removed when early camera color target assignment is removed. internal bool isCameraColorTargetValid = false; - static RenderTargetIdentifier[] m_ActiveColorAttachments = new RenderTargetIdentifier[] {0, 0, 0, 0, 0, 0, 0, 0 }; + static RenderTargetIdentifier[] m_ActiveColorAttachments = new RenderTargetIdentifier[] { 0, 0, 0, 0, 0, 0, 0, 0 }; static RenderTargetIdentifier m_ActiveDepthAttachment; // CommandBuffer.SetRenderTarget(RenderTargetIdentifier[] colors, RenderTargetIdentifier depth, int mipLevel, CubemapFace cubemapFace, int depthSlice); @@ -832,7 +832,7 @@ void SetRenderPassAttachments(CommandBuffer cmd, ScriptableRenderPass renderPass trimmedAttachments[i] = renderPass.colorAttachments[i]; SetRenderTarget(cmd, trimmedAttachments, renderPass.depthAttachment, finalClearFlag, renderPass.clearColor); - #if ENABLE_VR && ENABLE_XR_MODULE +#if ENABLE_VR && ENABLE_XR_MODULE if (cameraData.xr.enabled) { // SetRenderTarget might alter the internal device state(winding order). @@ -841,7 +841,7 @@ void SetRenderPassAttachments(CommandBuffer cmd, ScriptableRenderPass renderPass bool isRenderToBackBufferTarget = (xrTargetIndex != -1) && !cameraData.xr.renderTargetIsRenderTexture; cameraData.xr.UpdateGPUViewAndProjectionMatrices(cmd, ref cameraData, !isRenderToBackBufferTarget); } - #endif +#endif } } } @@ -1148,14 +1148,14 @@ public BlockRange(int begin, int end) { Assertions.Assert.IsTrue(begin <= end); m_Current = begin < end ? begin : end; - m_End = end >= begin ? end : begin; + m_End = end >= begin ? end : begin; m_Current -= 1; } public BlockRange GetEnumerator() { return this; } public bool MoveNext() { return ++m_Current < m_End; } public int Current { get => m_Current; } - public void Dispose() {} + public void Dispose() { } } public BlockRange GetRange(int index) diff --git a/com.unity.render-pipelines.universal/Runtime/ScriptableRendererFeature.cs b/com.unity.render-pipelines.universal/Runtime/ScriptableRendererFeature.cs index 7010869d567..6ee2eaced0e 100644 --- a/com.unity.render-pipelines.universal/Runtime/ScriptableRendererFeature.cs +++ b/com.unity.render-pipelines.universal/Runtime/ScriptableRendererFeature.cs @@ -9,7 +9,8 @@ namespace UnityEngine.Rendering.Universal /// /// [ExcludeFromPreset] - [MovedFrom("UnityEngine.Rendering.LWRP")] public abstract class ScriptableRendererFeature : ScriptableObject, IDisposable + [MovedFrom("UnityEngine.Rendering.LWRP")] + public abstract class ScriptableRendererFeature : ScriptableObject, IDisposable { [SerializeField, HideInInspector] private bool m_Active = true; /// diff --git a/com.unity.render-pipelines.universal/Runtime/ShaderUtils.cs b/com.unity.render-pipelines.universal/Runtime/ShaderUtils.cs index b86968f1206..860cd7400fe 100644 --- a/com.unity.render-pipelines.universal/Runtime/ShaderUtils.cs +++ b/com.unity.render-pipelines.universal/Runtime/ShaderUtils.cs @@ -4,7 +4,8 @@ namespace UnityEngine.Rendering.Universal { - [MovedFrom("UnityEngine.Rendering.LWRP")] public enum ShaderPathID + [MovedFrom("UnityEngine.Rendering.LWRP")] + public enum ShaderPathID { Lit, SimpleLit, @@ -19,9 +20,10 @@ namespace UnityEngine.Rendering.Universal SpeedTree8, } - [MovedFrom("UnityEngine.Rendering.LWRP")] public static class ShaderUtils + [MovedFrom("UnityEngine.Rendering.LWRP")] + public static class ShaderUtils { - static readonly string[] s_ShaderPaths = + static readonly string[] s_ShaderPaths = { "Universal Render Pipeline/Lit", "Universal Render Pipeline/Simple Lit", diff --git a/com.unity.render-pipelines.universal/Runtime/ShadowUtils.cs b/com.unity.render-pipelines.universal/Runtime/ShadowUtils.cs index 01cfddbb785..c322ca91e1c 100644 --- a/com.unity.render-pipelines.universal/Runtime/ShadowUtils.cs +++ b/com.unity.render-pipelines.universal/Runtime/ShadowUtils.cs @@ -3,7 +3,8 @@ namespace UnityEngine.Rendering.Universal { - [MovedFrom("UnityEngine.Rendering.LWRP")] public struct ShadowSliceData + [MovedFrom("UnityEngine.Rendering.LWRP")] + public struct ShadowSliceData { public Matrix4x4 viewMatrix; public Matrix4x4 projectionMatrix; @@ -23,7 +24,8 @@ public void Clear() } } - [MovedFrom("UnityEngine.Rendering.LWRP")] public static class ShadowUtils + [MovedFrom("UnityEngine.Rendering.LWRP")] + public static class ShadowUtils { private static readonly RenderTextureFormat m_ShadowmapFormat; private static readonly bool m_ForceShadowPointSampling; diff --git a/com.unity.render-pipelines.universal/Runtime/StencilUsage.cs b/com.unity.render-pipelines.universal/Runtime/StencilUsage.cs index cda2dd1d719..f7d0dea3c5d 100644 --- a/com.unity.render-pipelines.universal/Runtime/StencilUsage.cs +++ b/com.unity.render-pipelines.universal/Runtime/StencilUsage.cs @@ -4,17 +4,17 @@ namespace UnityEngine.Rendering.Universal.Internal enum StencilUsage { // Bits [0,3] are reserved for users - UserMask = 0b_0000_1111, + UserMask = 0b_0000_1111, // Bit [4] is used for stenciling light shapes. - StencilLight = 0b_0001_0000, + StencilLight = 0b_0001_0000, // Bits [5,6] are used for material types. - MaterialMask = 0b_0110_0000, - MaterialUnlit = 0b_0000_0000, - MaterialLit = 0b_0010_0000, + MaterialMask = 0b_0110_0000, + MaterialUnlit = 0b_0000_0000, + MaterialLit = 0b_0010_0000, MaterialSimpleLit = 0b_0100_0000 - // Bit [7] is reserved. + // Bit [7] is reserved. } } diff --git a/com.unity.render-pipelines.universal/Runtime/UniversalAdditionalCameraData.cs b/com.unity.render-pipelines.universal/Runtime/UniversalAdditionalCameraData.cs index 5df08dd7b1d..e6c463082fd 100644 --- a/com.unity.render-pipelines.universal/Runtime/UniversalAdditionalCameraData.cs +++ b/com.unity.render-pipelines.universal/Runtime/UniversalAdditionalCameraData.cs @@ -23,7 +23,8 @@ namespace UnityEngine.Rendering.Universal /// When set to On option will be enabled regardless of what is set on the pipeline asset. /// When set to UsePipelineSetting value set in the . /// - [MovedFrom("UnityEngine.Rendering.LWRP")] public enum CameraOverrideOption + [MovedFrom("UnityEngine.Rendering.LWRP")] + public enum CameraOverrideOption { Off, On, @@ -31,7 +32,8 @@ namespace UnityEngine.Rendering.Universal } //[Obsolete("Renderer override is no longer used, renderers are referenced by index on the pipeline asset.")] - [MovedFrom("UnityEngine.Rendering.LWRP")] public enum RendererOverrideOption + [MovedFrom("UnityEngine.Rendering.LWRP")] + public enum RendererOverrideOption { Custom, UsePipelineSettings, @@ -111,7 +113,8 @@ public static string GetName(this CameraRenderType type) [DisallowMultipleComponent] [RequireComponent(typeof(Camera))] [ImageEffectAllowedInSceneView] - [MovedFrom("UnityEngine.Rendering.LWRP")] public class UniversalAdditionalCameraData : MonoBehaviour, ISerializationCallbackReceiver + [MovedFrom("UnityEngine.Rendering.LWRP")] + public class UniversalAdditionalCameraData : MonoBehaviour, ISerializationCallbackReceiver { [FormerlySerializedAs("renderShadows"), SerializeField] bool m_RenderShadows = true; @@ -145,7 +148,7 @@ public static string GetName(this CameraRenderType type) [FormerlySerializedAs("requiresColorTexture"), SerializeField] bool m_RequiresColorTexture = false; - [HideInInspector][SerializeField] float m_Version = 2; + [HideInInspector] [SerializeField] float m_Version = 2; public float version => m_Version; diff --git a/com.unity.render-pipelines.universal/Runtime/UniversalAdditionalLightData.cs b/com.unity.render-pipelines.universal/Runtime/UniversalAdditionalLightData.cs index 3053fce9acd..49106f6b926 100644 --- a/com.unity.render-pipelines.universal/Runtime/UniversalAdditionalLightData.cs +++ b/com.unity.render-pipelines.universal/Runtime/UniversalAdditionalLightData.cs @@ -25,16 +25,16 @@ public bool usePipelineSettings set { m_UsePipelineSettings = value; } } - public static readonly int AdditionalLightsShadowResolutionTierCustom = -1; - public static readonly int AdditionalLightsShadowResolutionTierLow = 0; - public static readonly int AdditionalLightsShadowResolutionTierMedium = 1; - public static readonly int AdditionalLightsShadowResolutionTierHigh = 2; - public static readonly int AdditionalLightsShadowDefaultResolutionTier = AdditionalLightsShadowResolutionTierHigh; + public static readonly int AdditionalLightsShadowResolutionTierCustom = -1; + public static readonly int AdditionalLightsShadowResolutionTierLow = 0; + public static readonly int AdditionalLightsShadowResolutionTierMedium = 1; + public static readonly int AdditionalLightsShadowResolutionTierHigh = 2; + public static readonly int AdditionalLightsShadowDefaultResolutionTier = AdditionalLightsShadowResolutionTierHigh; public static readonly int AdditionalLightsShadowDefaultCustomResolution = 128; - public static readonly int AdditionalLightsShadowMinimumResolution = 128; + public static readonly int AdditionalLightsShadowMinimumResolution = 128; [Tooltip("Controls if light shadow resolution uses pipeline settings.")] - [SerializeField] int m_AdditionalLightsShadowResolutionTier = AdditionalLightsShadowDefaultResolutionTier; + [SerializeField] int m_AdditionalLightsShadowResolutionTier = AdditionalLightsShadowDefaultResolutionTier; public int additionalLightsShadowResolutionTier { diff --git a/com.unity.render-pipelines.universal/Runtime/UniversalRenderPipeline.cs b/com.unity.render-pipelines.universal/Runtime/UniversalRenderPipeline.cs index fa708dac33e..10aabecfbf0 100644 --- a/com.unity.render-pipelines.universal/Runtime/UniversalRenderPipeline.cs +++ b/com.unity.render-pipelines.universal/Runtime/UniversalRenderPipeline.cs @@ -35,9 +35,9 @@ private static class Profiling // Specialization for camera loop to avoid allocations. public static ProfilingSampler TryGetOrAddCameraSampler(Camera camera) { - #if UNIVERSAL_PROFILING_NO_ALLOC +#if UNIVERSAL_PROFILING_NO_ALLOC return unknownSampler; - #else +#else ProfilingSampler ps = null; int cameraId = camera.GetHashCode(); bool exists = s_HashSamplerCache.TryGetValue(cameraId, out ps); @@ -48,7 +48,7 @@ public static ProfilingSampler TryGetOrAddCameraSampler(Camera camera) s_HashSamplerCache.Add(cameraId, ps); } return ps; - #endif +#endif } public static class Pipeline @@ -58,28 +58,28 @@ public static class Pipeline public static readonly ProfilingSampler beginContextRendering = new ProfilingSampler($"{nameof(RenderPipeline)}.{nameof(BeginContextRendering)}"); public static readonly ProfilingSampler endContextRendering = new ProfilingSampler($"{nameof(RenderPipeline)}.{nameof(EndContextRendering)}"); #else - public static readonly ProfilingSampler beginFrameRendering = new ProfilingSampler($"{nameof(RenderPipeline)}.{nameof(BeginFrameRendering)}"); - public static readonly ProfilingSampler endFrameRendering = new ProfilingSampler($"{nameof(RenderPipeline)}.{nameof(EndFrameRendering)}"); + public static readonly ProfilingSampler beginFrameRendering = new ProfilingSampler($"{nameof(RenderPipeline)}.{nameof(BeginFrameRendering)}"); + public static readonly ProfilingSampler endFrameRendering = new ProfilingSampler($"{nameof(RenderPipeline)}.{nameof(EndFrameRendering)}"); #endif public static readonly ProfilingSampler beginCameraRendering = new ProfilingSampler($"{nameof(RenderPipeline)}.{nameof(BeginCameraRendering)}"); - public static readonly ProfilingSampler endCameraRendering = new ProfilingSampler($"{nameof(RenderPipeline)}.{nameof(EndCameraRendering)}"); + public static readonly ProfilingSampler endCameraRendering = new ProfilingSampler($"{nameof(RenderPipeline)}.{nameof(EndCameraRendering)}"); const string k_Name = nameof(UniversalRenderPipeline); - public static readonly ProfilingSampler initializeCameraData = new ProfilingSampler($"{k_Name}.{nameof(InitializeCameraData)}"); - public static readonly ProfilingSampler initializeStackedCameraData = new ProfilingSampler($"{k_Name}.{nameof(InitializeStackedCameraData)}"); + public static readonly ProfilingSampler initializeCameraData = new ProfilingSampler($"{k_Name}.{nameof(InitializeCameraData)}"); + public static readonly ProfilingSampler initializeStackedCameraData = new ProfilingSampler($"{k_Name}.{nameof(InitializeStackedCameraData)}"); public static readonly ProfilingSampler initializeAdditionalCameraData = new ProfilingSampler($"{k_Name}.{nameof(InitializeAdditionalCameraData)}"); - public static readonly ProfilingSampler initializeRenderingData = new ProfilingSampler($"{k_Name}.{nameof(InitializeRenderingData)}"); - public static readonly ProfilingSampler initializeShadowData = new ProfilingSampler($"{k_Name}.{nameof(InitializeShadowData)}"); - public static readonly ProfilingSampler initializeLightData = new ProfilingSampler($"{k_Name}.{nameof(InitializeLightData)}"); - public static readonly ProfilingSampler getPerObjectLightFlags = new ProfilingSampler($"{k_Name}.{nameof(GetPerObjectLightFlags)}"); - public static readonly ProfilingSampler getMainLightIndex = new ProfilingSampler($"{k_Name}.{nameof(GetMainLightIndex)}"); - public static readonly ProfilingSampler setupPerFrameShaderConstants = new ProfilingSampler($"{k_Name}.{nameof(SetupPerFrameShaderConstants)}"); + public static readonly ProfilingSampler initializeRenderingData = new ProfilingSampler($"{k_Name}.{nameof(InitializeRenderingData)}"); + public static readonly ProfilingSampler initializeShadowData = new ProfilingSampler($"{k_Name}.{nameof(InitializeShadowData)}"); + public static readonly ProfilingSampler initializeLightData = new ProfilingSampler($"{k_Name}.{nameof(InitializeLightData)}"); + public static readonly ProfilingSampler getPerObjectLightFlags = new ProfilingSampler($"{k_Name}.{nameof(GetPerObjectLightFlags)}"); + public static readonly ProfilingSampler getMainLightIndex = new ProfilingSampler($"{k_Name}.{nameof(GetMainLightIndex)}"); + public static readonly ProfilingSampler setupPerFrameShaderConstants = new ProfilingSampler($"{k_Name}.{nameof(SetupPerFrameShaderConstants)}"); public static class Renderer { const string k_Name = nameof(ScriptableRenderer); public static readonly ProfilingSampler setupCullingParameters = new ProfilingSampler($"{k_Name}.{nameof(ScriptableRenderer.SetupCullingParameters)}"); - public static readonly ProfilingSampler setup = new ProfilingSampler($"{k_Name}.{nameof(ScriptableRenderer.Setup)}"); + public static readonly ProfilingSampler setup = new ProfilingSampler($"{k_Name}.{nameof(ScriptableRenderer.Setup)}"); }; public static class Context @@ -124,7 +124,7 @@ public static int maxPerObjectLights // These limits have to match same limits in Input.hlsl internal const int k_MaxVisibleAdditionalLightsMobileShaderLevelLessThan45 = 16; - internal const int k_MaxVisibleAdditionalLightsMobile = 32; + internal const int k_MaxVisibleAdditionalLightsMobile = 32; internal const int k_MaxVisibleAdditionalLightsNonMobile = 256; public static int maxVisibleAdditionalLights { diff --git a/com.unity.render-pipelines.universal/Runtime/UniversalRenderPipelineCore.cs b/com.unity.render-pipelines.universal/Runtime/UniversalRenderPipelineCore.cs index c18d3b3408a..dc1ca74a403 100644 --- a/com.unity.render-pipelines.universal/Runtime/UniversalRenderPipelineCore.cs +++ b/com.unity.render-pipelines.universal/Runtime/UniversalRenderPipelineCore.cs @@ -9,14 +9,16 @@ namespace UnityEngine.Rendering.Universal { - [MovedFrom("UnityEngine.Rendering.LWRP")] public enum MixedLightingSetup + [MovedFrom("UnityEngine.Rendering.LWRP")] + public enum MixedLightingSetup { None, ShadowMask, Subtractive, }; - [MovedFrom("UnityEngine.Rendering.LWRP")] public struct RenderingData + [MovedFrom("UnityEngine.Rendering.LWRP")] + public struct RenderingData { public CullingResults cullResults; public CameraData cameraData; @@ -32,7 +34,8 @@ namespace UnityEngine.Rendering.Universal public bool postProcessingEnabled; } - [MovedFrom("UnityEngine.Rendering.LWRP")] public struct LightData + [MovedFrom("UnityEngine.Rendering.LWRP")] + public struct LightData { public int mainLightIndex; public int additionalLightsCount; @@ -42,7 +45,8 @@ namespace UnityEngine.Rendering.Universal public bool supportsMixedLighting; } - [MovedFrom("UnityEngine.Rendering.LWRP")] public struct CameraData + [MovedFrom("UnityEngine.Rendering.LWRP")] + public struct CameraData { // Internal camera data as we are not yet sure how to expose View in stereo context. // We might change this API soon. @@ -193,7 +197,8 @@ public bool IsCameraProjectionMatrixFlipped() public bool resolveFinalTarget; } - [MovedFrom("UnityEngine.Rendering.LWRP")] public struct ShadowData + [MovedFrom("UnityEngine.Rendering.LWRP")] + public struct ShadowData { public bool supportsMainLightShadows; [Obsolete("Obsolete, this feature was replaced by new 'ScreenSpaceShadows' renderer feature")] @@ -513,7 +518,7 @@ static RenderTextureDescriptor CreateRenderTextureDescriptor(Camera camera, floa desc = camera.targetTexture.descriptor; desc.width = camera.pixelWidth; desc.height = camera.pixelHeight; - if (camera.cameraType == CameraType.SceneView && !isHdrEnabled) + if (camera.cameraType == CameraType.SceneView && !isHdrEnabled) { desc.graphicsFormat = renderTextureFormatDefault; } diff --git a/com.unity.render-pipelines.universal/Runtime/XR/XRPass.cs b/com.unity.render-pipelines.universal/Runtime/XR/XRPass.cs index 0607e8efdbb..c074998b077 100644 --- a/com.unity.render-pipelines.universal/Runtime/XR/XRPass.cs +++ b/com.unity.render-pipelines.universal/Runtime/XR/XRPass.cs @@ -463,10 +463,10 @@ internal class XRPass internal static readonly XRPass emptyPass = new XRPass(); internal bool enabled { get => false; } - internal void StartSinglePass(CommandBuffer cmd) {} - internal void StopSinglePass(CommandBuffer cmd) {} - internal void EndCamera(CommandBuffer cmd, CameraData camera) {} - internal void RenderOcclusionMesh(CommandBuffer cmd) {} + internal void StartSinglePass(CommandBuffer cmd) { } + internal void StopSinglePass(CommandBuffer cmd) { } + internal void EndCamera(CommandBuffer cmd, CameraData camera) { } + internal void RenderOcclusionMesh(CommandBuffer cmd) { } } } #endif diff --git a/com.unity.render-pipelines.universal/Shaders/Shaders.cs b/com.unity.render-pipelines.universal/Shaders/Shaders.cs index 0153ecdfd68..9895c6f9d18 100644 --- a/com.unity.render-pipelines.universal/Shaders/Shaders.cs +++ b/com.unity.render-pipelines.universal/Shaders/Shaders.cs @@ -1,3 +1,3 @@ // UniversalRP Shaders folder need an Assembly Definition files to create a .cs project // This is a dummy shader file so the Shaders assembly is not empty. -class ShadersDummy {} +class ShadersDummy { } diff --git a/com.unity.shaderanalysis/Editor/API/ShaderAnalysisReport.cs b/com.unity.shaderanalysis/Editor/API/ShaderAnalysisReport.cs index e4089e9f057..41eba027c7b 100644 --- a/com.unity.shaderanalysis/Editor/API/ShaderAnalysisReport.cs +++ b/com.unity.shaderanalysis/Editor/API/ShaderAnalysisReport.cs @@ -13,16 +13,16 @@ public static ShaderAnalysisReport New( bool logCommandLines = false ) => new ShaderAnalysisReport - { - asset = asset, - common = new ShaderAnalysisReport { - targetPlatform = currentPlatform, - filter = filter, - features = features, - logCommandLines = logCommandLines - } - }; + asset = asset, + common = new ShaderAnalysisReport + { + targetPlatform = currentPlatform, + filter = filter, + features = features, + logCommandLines = logCommandLines + } + }; public BuildTarget targetPlatform; public ShaderProgramFilter filter; @@ -38,9 +38,9 @@ public struct ShaderAnalysisReport public ShaderAnalysisReport Into() => new ShaderAnalysisReport - { - asset = (TAsset2)Convert.ChangeType(asset, typeof(TAsset2)), - common = common - }; + { + asset = (TAsset2)Convert.ChangeType(asset, typeof(TAsset2)), + common = common + }; } } diff --git a/com.unity.shaderanalysis/Editor/Internal/ShaderAnalysisInspectorWindow.cs b/com.unity.shaderanalysis/Editor/Internal/ShaderAnalysisInspectorWindow.cs index 322338e2235..bc6c8f673f9 100644 --- a/com.unity.shaderanalysis/Editor/Internal/ShaderAnalysisInspectorWindow.cs +++ b/com.unity.shaderanalysis/Editor/Internal/ShaderAnalysisInspectorWindow.cs @@ -679,14 +679,14 @@ void OnGUI_AsyncJob() EditorApplication.update += Repaint; } - #if !UNITY_2020_1_OR_NEWER +#if !UNITY_2020_1_OR_NEWER GUILayout.BeginHorizontal(EditorStyles.toolbar, GUILayout.Height(EditorGUIUtility.singleLineHeight)); var progressRect = GUILayoutUtility.GetRect(0, float.MaxValue, EditorGUIUtility.singleLineHeight, float.MaxValue); EditorGUI.ProgressBar(progressRect, m_CurrentJob.progress, m_CurrentJob.message); if (GUILayout.Button(UIUtils.Text("Cancel"), EditorStyles.toolbarButton)) m_CurrentJob.Cancel(); GUILayout.EndVertical(); - #endif +#endif if (m_CurrentJob.IsComplete()) m_CurrentJob = null; diff --git a/com.unity.shaderanalysis/Editor/Platforms/BuildReportJobAsync.cs b/com.unity.shaderanalysis/Editor/Platforms/BuildReportJobAsync.cs index 26f374dabb8..45d65d5e008 100644 --- a/com.unity.shaderanalysis/Editor/Platforms/BuildReportJobAsync.cs +++ b/com.unity.shaderanalysis/Editor/Platforms/BuildReportJobAsync.cs @@ -8,7 +8,7 @@ namespace UnityEditor.ShaderAnalysis { /// Derives from this class to make new report jobs. - public abstract class BuildReportJobAsync : AsyncBuildReportJob + public abstract class BuildReportJobAsync : AsyncBuildReportJob { bool m_HasReport; IEnumerator m_Enumerator; diff --git a/com.unity.shaderanalysis/Editor/Platforms/ReportBuildData.cs b/com.unity.shaderanalysis/Editor/Platforms/ReportBuildData.cs index 2b69fe3af37..1dd03f7cf94 100644 --- a/com.unity.shaderanalysis/Editor/Platforms/ReportBuildData.cs +++ b/com.unity.shaderanalysis/Editor/Platforms/ReportBuildData.cs @@ -173,7 +173,7 @@ protected IEnumerator CompileCompileUnits_Internal(ShaderCompiler compiler) // Try to enqueue jobs while (m_CompileJobMap.Count < k_MaxParallelCompilation && compileUnitToProcess.Count > 0) { - var(unit, unitIndex) = compileUnitToProcess[0]; + var (unit, unitIndex) = compileUnitToProcess[0]; compileUnitToProcess.RemoveAt(0); var job = compiler.Compile(unit.sourceCodeFile, temporaryDirectory, unit.compiledFile, unit.compileOptions, unit.compileProfile, unit.compileTarget); if (logCommandLine) diff --git a/com.unity.shaderanalysis/Editor/Platforms/ShaderCompiler.cs b/com.unity.shaderanalysis/Editor/Platforms/ShaderCompiler.cs index 4d107a4c219..c159b380bb9 100644 --- a/com.unity.shaderanalysis/Editor/Platforms/ShaderCompiler.cs +++ b/com.unity.shaderanalysis/Editor/Platforms/ShaderCompiler.cs @@ -128,7 +128,7 @@ void ProcessOnExited(object sender, EventArgs eventArgs) } /// Initialize the compiler. - public virtual void Initialize() {} + public virtual void Initialize() { } /// Start a compile operation. /// Path of the file to compile. diff --git a/com.unity.shadergraph/Editor/Data/Graphs/AbstractShaderProperty.cs b/com.unity.shadergraph/Editor/Data/Graphs/AbstractShaderProperty.cs index 0d8ed74bcda..c11d03f9ee7 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/AbstractShaderProperty.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/AbstractShaderProperty.cs @@ -19,7 +19,7 @@ public abstract class AbstractShaderProperty : ShaderInput public bool gpuInstanced { get { return false; } - set {} + set { } } internal virtual string GetHLSLVariableName(bool isSubgraphProperty) @@ -111,7 +111,7 @@ internal virtual string GetPropertyAsArgumentStringForVFX() public virtual string GetPropertyTypeString() { - string depString = $" (Deprecated{(ShaderGraphPreferences.allowDeprecatedBehaviors ? " V" + sgVersion : "" )})"; + string depString = $" (Deprecated{(ShaderGraphPreferences.allowDeprecatedBehaviors ? " V" + sgVersion : "")})"; return propertyType.ToString() + (sgVersion < latestVersion ? depString : ""); } } diff --git a/com.unity.shadergraph/Editor/Data/Graphs/BitangentMaterialSlot.cs b/com.unity.shadergraph/Editor/Data/Graphs/BitangentMaterialSlot.cs index 7c895693a47..5731b33e4eb 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/BitangentMaterialSlot.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/BitangentMaterialSlot.cs @@ -9,12 +9,12 @@ namespace UnityEditor.ShaderGraph class BitangentMaterialSlot : SpaceMaterialSlot, IMayRequireBitangent { public BitangentMaterialSlot() : base() - {} + { } public BitangentMaterialSlot(int slotId, string displayName, string shaderOutputName, CoordinateSpace space, ShaderStageCapability stageCapability = ShaderStageCapability.All, bool hidden = false) : base(slotId, displayName, shaderOutputName, space, stageCapability, hidden) - {} + { } public override VisualElement InstantiateControl() { diff --git a/com.unity.shadergraph/Editor/Data/Graphs/BooleanMaterialSlot.cs b/com.unity.shadergraph/Editor/Data/Graphs/BooleanMaterialSlot.cs index 0bdb479985a..92bff6f46a2 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/BooleanMaterialSlot.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/BooleanMaterialSlot.cs @@ -19,7 +19,7 @@ class BooleanMaterialSlot : MaterialSlot, IMaterialSlotHasValue private bool m_DefaultValue; public BooleanMaterialSlot() - {} + { } public BooleanMaterialSlot( int slotId, diff --git a/com.unity.shadergraph/Editor/Data/Graphs/ColorMaterialSlot.cs b/com.unity.shadergraph/Editor/Data/Graphs/ColorMaterialSlot.cs index 8c9c6781654..cb955386e94 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/ColorMaterialSlot.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/ColorMaterialSlot.cs @@ -11,7 +11,7 @@ namespace UnityEditor.ShaderGraph { class ColorRGBAMaterialSlot : Vector4MaterialSlot { - public ColorRGBAMaterialSlot() {} + public ColorRGBAMaterialSlot() { } public ColorRGBAMaterialSlot( int slotId, diff --git a/com.unity.shadergraph/Editor/Data/Graphs/ColorRGBMaterialSlot.cs b/com.unity.shadergraph/Editor/Data/Graphs/ColorRGBMaterialSlot.cs index f49ac8752c7..f934c613be3 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/ColorRGBMaterialSlot.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/ColorRGBMaterialSlot.cs @@ -17,7 +17,7 @@ class ColorRGBMaterialSlot : Vector3MaterialSlot [SerializeField] private Color m_DefaultColor = Color.grey; - public ColorRGBMaterialSlot() {} + public ColorRGBMaterialSlot() { } public ColorRGBMaterialSlot( int slotId, diff --git a/com.unity.shadergraph/Editor/Data/Graphs/CubemapInputMaterialSlot.cs b/com.unity.shadergraph/Editor/Data/Graphs/CubemapInputMaterialSlot.cs index 40fb0265c01..58a285908e8 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/CubemapInputMaterialSlot.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/CubemapInputMaterialSlot.cs @@ -25,7 +25,7 @@ public Cubemap cubemap public override bool isDefaultValue => cubemap == null; public CubemapInputMaterialSlot() - {} + { } public CubemapInputMaterialSlot( int slotId, @@ -34,7 +34,7 @@ public CubemapInputMaterialSlot( ShaderStageCapability stageCapability = ShaderStageCapability.All, bool hidden = false) : base(slotId, displayName, shaderOutputName, SlotType.Input, stageCapability, hidden) - {} + { } public override VisualElement InstantiateControl() { diff --git a/com.unity.shadergraph/Editor/Data/Graphs/CubemapMaterialSlot.cs b/com.unity.shadergraph/Editor/Data/Graphs/CubemapMaterialSlot.cs index 7fe4c25ff6d..f51167630ce 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/CubemapMaterialSlot.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/CubemapMaterialSlot.cs @@ -8,7 +8,7 @@ namespace UnityEditor.ShaderGraph class CubemapMaterialSlot : MaterialSlot { public CubemapMaterialSlot() - {} + { } public CubemapMaterialSlot( int slotId, @@ -18,7 +18,7 @@ public CubemapMaterialSlot( ShaderStageCapability stageCapability = ShaderStageCapability.All, bool hidden = false) : base(slotId, displayName, shaderOutputName, slotType, stageCapability, hidden) - {} + { } [SerializeField] bool m_BareResource = false; @@ -45,9 +45,9 @@ public override void AppendHLSLParameterDeclaration(ShaderStringBuilder sb, stri public override bool isDefaultValue => true; public override void AddDefaultProperty(PropertyCollector properties, GenerationMode generationMode) - {} + { } public override void CopyValuesFrom(MaterialSlot foundSlot) - {} + { } } } diff --git a/com.unity.shadergraph/Editor/Data/Graphs/DynamicValueMaterialSlot.cs b/com.unity.shadergraph/Editor/Data/Graphs/DynamicValueMaterialSlot.cs index 11922417639..9975fbd0185 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/DynamicValueMaterialSlot.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/DynamicValueMaterialSlot.cs @@ -19,7 +19,7 @@ class DynamicValueMaterialSlot : MaterialSlot, IMaterialSlotHasValue [SerializeField] private Matrix4x4 m_DefaultValue = Matrix4x4.identity; - static readonly string[] k_Labels = {"X", "Y", "Z", "W"}; + static readonly string[] k_Labels = { "X", "Y", "Z", "W" }; private ConcreteSlotValueType m_ConcreteValueType = ConcreteSlotValueType.Vector4; @@ -56,10 +56,22 @@ public override VisualElement InstantiateControl() return new MultiFloatSlotControlView(owner, labels, () => value.GetRow(0), (newValue) => value = new Matrix4x4() { - m00 = newValue.x, m01 = newValue.y, m02 = newValue.z, m03 = newValue.w, - m10 = value.m10, m11 = value.m11, m12 = value.m12, m13 = value.m13, - m20 = value.m20, m21 = value.m21, m22 = value.m22, m23 = value.m23, - m30 = value.m30, m31 = value.m31, m32 = value.m32, m33 = value.m33, + m00 = newValue.x, + m01 = newValue.y, + m02 = newValue.z, + m03 = newValue.w, + m10 = value.m10, + m11 = value.m11, + m12 = value.m12, + m13 = value.m13, + m20 = value.m20, + m21 = value.m21, + m22 = value.m22, + m23 = value.m23, + m30 = value.m30, + m31 = value.m31, + m32 = value.m32, + m33 = value.m33, }); } diff --git a/com.unity.shadergraph/Editor/Data/Graphs/DynamicVectorMaterialSlot.cs b/com.unity.shadergraph/Editor/Data/Graphs/DynamicVectorMaterialSlot.cs index a72c679ecda..73ea941657a 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/DynamicVectorMaterialSlot.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/DynamicVectorMaterialSlot.cs @@ -19,7 +19,7 @@ class DynamicVectorMaterialSlot : MaterialSlot, IMaterialSlotHasValue [SerializeField] private Vector4 m_DefaultValue = Vector4.zero; - static readonly string[] k_Labels = {"X", "Y", "Z", "W"}; + static readonly string[] k_Labels = { "X", "Y", "Z", "W" }; private ConcreteSlotValueType m_ConcreteValueType = ConcreteSlotValueType.Vector4; diff --git a/com.unity.shadergraph/Editor/Data/Graphs/GradientMaterialSlot.cs b/com.unity.shadergraph/Editor/Data/Graphs/GradientMaterialSlot.cs index 3bf12e01ac8..7e31aa6bffa 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/GradientMaterialSlot.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/GradientMaterialSlot.cs @@ -7,7 +7,7 @@ namespace UnityEditor.ShaderGraph class GradientMaterialSlot : MaterialSlot { public GradientMaterialSlot() - {} + { } public GradientMaterialSlot( int slotId, @@ -17,16 +17,16 @@ public GradientMaterialSlot( ShaderStageCapability stageCapability = ShaderStageCapability.All, bool hidden = false) : base(slotId, displayName, shaderOutputName, slotType, stageCapability, hidden) - {} + { } public override SlotValueType valueType { get { return SlotValueType.Gradient; } } public override ConcreteSlotValueType concreteValueType { get { return ConcreteSlotValueType.Gradient; } } public override bool isDefaultValue => true; public override void AddDefaultProperty(PropertyCollector properties, GenerationMode generationMode) - {} + { } public override void CopyValuesFrom(MaterialSlot foundSlot) - {} + { } } } diff --git a/com.unity.shadergraph/Editor/Data/Graphs/GroupData.cs b/com.unity.shadergraph/Editor/Data/Graphs/GroupData.cs index 55d2ba8f26f..acab2ec9abb 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/GroupData.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/GroupData.cs @@ -25,7 +25,7 @@ public Vector2 position set { m_Position = value; } } - public GroupData() : base() {} + public GroupData() : base() { } public GroupData(string title, Vector2 position) { diff --git a/com.unity.shadergraph/Editor/Data/Graphs/MaterialSlot.cs b/com.unity.shadergraph/Editor/Data/Graphs/MaterialSlot.cs index f89e529d298..a8256cbff8e 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/MaterialSlot.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/MaterialSlot.cs @@ -13,7 +13,7 @@ namespace UnityEditor.ShaderGraph [Serializable] abstract class MaterialSlot : JsonObject { - const string k_NotInit = "Not Initilaized"; + const string k_NotInit = "Not Initilaized"; [SerializeField] int m_Id; @@ -35,7 +35,7 @@ abstract class MaterialSlot : JsonObject bool m_HasError; - protected MaterialSlot() {} + protected MaterialSlot() { } protected MaterialSlot(int slotId, string displayName, string shaderOutputName, SlotType slotType, ShaderStageCapability stageCapability = ShaderStageCapability.All, bool hidden = false) { @@ -323,7 +323,7 @@ public override int GetHashCode() // this tracks old CustomFunctionNode slots that are expecting the old bare resource inputs // rather than the new structure-based inputs - internal virtual bool bareResource { get { return false; } set {} } + internal virtual bool bareResource { get { return false; } set { } } public virtual void CopyDefaultValue(MaterialSlot other) { diff --git a/com.unity.shadergraph/Editor/Data/Graphs/NormalMaterialSlot.cs b/com.unity.shadergraph/Editor/Data/Graphs/NormalMaterialSlot.cs index 9b3e8b8a99e..71588cf2f2b 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/NormalMaterialSlot.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/NormalMaterialSlot.cs @@ -9,12 +9,12 @@ namespace UnityEditor.ShaderGraph class NormalMaterialSlot : SpaceMaterialSlot, IMayRequireNormal { public NormalMaterialSlot() - {} + { } public NormalMaterialSlot(int slotId, string displayName, string shaderOutputName, CoordinateSpace space, ShaderStageCapability stageCapability = ShaderStageCapability.All, bool hidden = false) : base(slotId, displayName, shaderOutputName, space, stageCapability, hidden) - {} + { } public override VisualElement InstantiateControl() { diff --git a/com.unity.shadergraph/Editor/Data/Graphs/PositionMaterialSlot.cs b/com.unity.shadergraph/Editor/Data/Graphs/PositionMaterialSlot.cs index 927147649db..cb090bdce38 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/PositionMaterialSlot.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/PositionMaterialSlot.cs @@ -9,12 +9,12 @@ namespace UnityEditor.ShaderGraph class PositionMaterialSlot : SpaceMaterialSlot, IMayRequirePosition { public PositionMaterialSlot() - {} + { } public PositionMaterialSlot(int slotId, string displayName, string shaderOutputName, CoordinateSpace space, ShaderStageCapability stageCapability = ShaderStageCapability.All, bool hidden = false) : base(slotId, displayName, shaderOutputName, space, stageCapability, hidden) - {} + { } public override VisualElement InstantiateControl() { diff --git a/com.unity.shadergraph/Editor/Data/Graphs/SamplerStateMaterialSlot.cs b/com.unity.shadergraph/Editor/Data/Graphs/SamplerStateMaterialSlot.cs index 1160b4b4f9b..2a59939c0fb 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/SamplerStateMaterialSlot.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/SamplerStateMaterialSlot.cs @@ -80,7 +80,7 @@ public override void AddDefaultProperty(PropertyCollector properties, Generation } public override void CopyValuesFrom(MaterialSlot foundSlot) - {} + { } public override void CopyDefaultValue(MaterialSlot other) { diff --git a/com.unity.shadergraph/Editor/Data/Graphs/ScreenPositionMaterialSlot.cs b/com.unity.shadergraph/Editor/Data/Graphs/ScreenPositionMaterialSlot.cs index 8a82b84b6e0..29963a4ad8a 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/ScreenPositionMaterialSlot.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/ScreenPositionMaterialSlot.cs @@ -21,7 +21,7 @@ public ScreenSpaceType screenSpaceType public override bool isDefaultValue => screenSpaceType == ScreenSpaceType.Default; public ScreenPositionMaterialSlot() - {} + { } public ScreenPositionMaterialSlot(int slotId, string displayName, string shaderOutputName, ScreenSpaceType screenSpaceType, ShaderStageCapability stageCapability = ShaderStageCapability.All, bool hidden = false) diff --git a/com.unity.shadergraph/Editor/Data/Graphs/SerializableCubemap.cs b/com.unity.shadergraph/Editor/Data/Graphs/SerializableCubemap.cs index 074f261313d..407998a1cbf 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/SerializableCubemap.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/SerializableCubemap.cs @@ -28,14 +28,14 @@ class CubemapHelper class MinimalCubemapHelper { // these variables are only ever populated by serialization, disable the C# warning that checks if they are ever assigned - #pragma warning disable 0649 +#pragma warning disable 0649 [Serializable] public struct MinimalTextureRef { public string guid; } public MinimalTextureRef cubemap; - #pragma warning restore 0649 +#pragma warning restore 0649 } internal string guid diff --git a/com.unity.shadergraph/Editor/Data/Graphs/SerializableTexture.cs b/com.unity.shadergraph/Editor/Data/Graphs/SerializableTexture.cs index cf08ccf173d..aa8cf5fc7c9 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/SerializableTexture.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/SerializableTexture.cs @@ -28,14 +28,14 @@ class TextureHelper class MinimalTextureHelper { // these variables are only ever populated by serialization, disable the C# warning that checks if they are ever assigned - #pragma warning disable 0649 +#pragma warning disable 0649 [Serializable] public struct MinimalTextureRef { public string guid; } public MinimalTextureRef texture; - #pragma warning restore 0649 +#pragma warning restore 0649 } internal string guid diff --git a/com.unity.shadergraph/Editor/Data/Graphs/SerializableTextureArray.cs b/com.unity.shadergraph/Editor/Data/Graphs/SerializableTextureArray.cs index 6d926ad0d27..cc9f8588942 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/SerializableTextureArray.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/SerializableTextureArray.cs @@ -28,14 +28,14 @@ class TextureHelper class MinimalTextureHelper { // these variables are only ever populated by serialization, disable the C# warning that checks if they are ever assigned - #pragma warning disable 0649 +#pragma warning disable 0649 [Serializable] public struct MinimalTextureRef { public string guid; } public MinimalTextureRef textureArray; - #pragma warning restore 0649 +#pragma warning restore 0649 } internal string guid diff --git a/com.unity.shadergraph/Editor/Data/Graphs/SpaceMaterialSlot.cs b/com.unity.shadergraph/Editor/Data/Graphs/SpaceMaterialSlot.cs index 33fd1cac819..bc63e160b52 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/SpaceMaterialSlot.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/SpaceMaterialSlot.cs @@ -18,7 +18,7 @@ public CoordinateSpace space } protected SpaceMaterialSlot() - {} + { } protected SpaceMaterialSlot(int slotId, string displayName, string shaderOutputName, CoordinateSpace space, ShaderStageCapability stageCapability = ShaderStageCapability.All, bool hidden = false) diff --git a/com.unity.shadergraph/Editor/Data/Graphs/StickyNoteData.cs b/com.unity.shadergraph/Editor/Data/Graphs/StickyNoteData.cs index 7b760194f68..a969166bce9 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/StickyNoteData.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/StickyNoteData.cs @@ -77,7 +77,7 @@ public GroupData group } - public StickyNoteData() : base() {} + public StickyNoteData() : base() { } public StickyNoteData(string title, string content, Rect position) { m_Title = title; diff --git a/com.unity.shadergraph/Editor/Data/Graphs/TangentMaterialSlot.cs b/com.unity.shadergraph/Editor/Data/Graphs/TangentMaterialSlot.cs index 2fa9e29df3f..025960537e0 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/TangentMaterialSlot.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/TangentMaterialSlot.cs @@ -9,12 +9,12 @@ namespace UnityEditor.ShaderGraph class TangentMaterialSlot : SpaceMaterialSlot, IMayRequireTangent { public TangentMaterialSlot() - {} + { } public TangentMaterialSlot(int slotId, string displayName, string shaderOutputName, CoordinateSpace space, ShaderStageCapability stageCapability = ShaderStageCapability.All, bool hidden = false) : base(slotId, displayName, shaderOutputName, space, stageCapability, hidden) - {} + { } public override VisualElement InstantiateControl() { diff --git a/com.unity.shadergraph/Editor/Data/Graphs/Texture2DArrayInputMaterialSlot.cs b/com.unity.shadergraph/Editor/Data/Graphs/Texture2DArrayInputMaterialSlot.cs index 0adeb029b5a..c09a04ed2fc 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/Texture2DArrayInputMaterialSlot.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/Texture2DArrayInputMaterialSlot.cs @@ -24,7 +24,7 @@ public Texture2DArray textureArray public override bool isDefaultValue => textureArray == null; public Texture2DArrayInputMaterialSlot() - {} + { } public Texture2DArrayInputMaterialSlot( int slotId, @@ -33,7 +33,7 @@ public Texture2DArrayInputMaterialSlot( ShaderStageCapability shaderStageCapability = ShaderStageCapability.All, bool hidden = false) : base(slotId, displayName, shaderOutputName, SlotType.Input, shaderStageCapability, hidden) - {} + { } public override VisualElement InstantiateControl() { diff --git a/com.unity.shadergraph/Editor/Data/Graphs/Texture2DArrayMaterialSlot.cs b/com.unity.shadergraph/Editor/Data/Graphs/Texture2DArrayMaterialSlot.cs index 86190a9966f..daea4a969cc 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/Texture2DArrayMaterialSlot.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/Texture2DArrayMaterialSlot.cs @@ -8,7 +8,7 @@ namespace UnityEditor.ShaderGraph class Texture2DArrayMaterialSlot : MaterialSlot { public Texture2DArrayMaterialSlot() - {} + { } public Texture2DArrayMaterialSlot( int slotId, @@ -18,7 +18,7 @@ public Texture2DArrayMaterialSlot( ShaderStageCapability shaderStageCapability = ShaderStageCapability.All, bool hidden = false) : base(slotId, displayName, shaderOutputName, slotType, shaderStageCapability, hidden) - {} + { } [SerializeField] bool m_BareResource = false; @@ -45,7 +45,7 @@ public override void AppendHLSLParameterDeclaration(ShaderStringBuilder sb, stri public override bool isDefaultValue => true; public override void AddDefaultProperty(PropertyCollector properties, GenerationMode generationMode) - {} + { } public override void CopyValuesFrom(MaterialSlot foundSlot) { diff --git a/com.unity.shadergraph/Editor/Data/Graphs/Texture2DInputMaterialSlot.cs b/com.unity.shadergraph/Editor/Data/Graphs/Texture2DInputMaterialSlot.cs index f2928f85431..368f0e2c6e0 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/Texture2DInputMaterialSlot.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/Texture2DInputMaterialSlot.cs @@ -33,7 +33,7 @@ public Texture2DShaderProperty.DefaultType defaultType public override bool isDefaultValue => texture == null; public Texture2DInputMaterialSlot() - {} + { } public Texture2DInputMaterialSlot( int slotId, @@ -42,7 +42,7 @@ public Texture2DInputMaterialSlot( ShaderStageCapability stageCapability = ShaderStageCapability.All, bool hidden = false) : base(slotId, displayName, shaderOutputName, SlotType.Input, stageCapability, hidden) - {} + { } public override VisualElement InstantiateControl() { diff --git a/com.unity.shadergraph/Editor/Data/Graphs/Texture2DMaterialSlot.cs b/com.unity.shadergraph/Editor/Data/Graphs/Texture2DMaterialSlot.cs index 1d15c8c8e58..2062085373f 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/Texture2DMaterialSlot.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/Texture2DMaterialSlot.cs @@ -8,7 +8,7 @@ namespace UnityEditor.ShaderGraph class Texture2DMaterialSlot : MaterialSlot { public Texture2DMaterialSlot() - {} + { } public Texture2DMaterialSlot( int slotId, @@ -18,7 +18,7 @@ public Texture2DMaterialSlot( ShaderStageCapability stageCapability = ShaderStageCapability.All, bool hidden = false) : base(slotId, displayName, shaderOutputName, slotType, stageCapability, hidden) - {} + { } [SerializeField] bool m_BareResource = false; @@ -45,7 +45,7 @@ public override void AppendHLSLParameterDeclaration(ShaderStringBuilder sb, stri public override bool isDefaultValue => true; public override void AddDefaultProperty(PropertyCollector properties, GenerationMode generationMode) - {} + { } public override void CopyValuesFrom(MaterialSlot foundSlot) { diff --git a/com.unity.shadergraph/Editor/Data/Graphs/Texture3DInputMaterialSlot.cs b/com.unity.shadergraph/Editor/Data/Graphs/Texture3DInputMaterialSlot.cs index bfbd714fc26..7bf364c0832 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/Texture3DInputMaterialSlot.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/Texture3DInputMaterialSlot.cs @@ -24,7 +24,7 @@ public Texture texture public override bool isDefaultValue => texture == null; public Texture3DInputMaterialSlot() - {} + { } public Texture3DInputMaterialSlot( int slotId, @@ -33,7 +33,7 @@ public Texture3DInputMaterialSlot( ShaderStageCapability shaderStageCapability = ShaderStageCapability.All, bool hidden = false) : base(slotId, displayName, shaderOutputName, SlotType.Input, shaderStageCapability, hidden) - {} + { } public override VisualElement InstantiateControl() { diff --git a/com.unity.shadergraph/Editor/Data/Graphs/Texture3DMaterialSlot.cs b/com.unity.shadergraph/Editor/Data/Graphs/Texture3DMaterialSlot.cs index eb29e94c198..572cd5fdb68 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/Texture3DMaterialSlot.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/Texture3DMaterialSlot.cs @@ -8,7 +8,7 @@ namespace UnityEditor.ShaderGraph class Texture3DMaterialSlot : MaterialSlot { public Texture3DMaterialSlot() - {} + { } public Texture3DMaterialSlot( int slotId, @@ -18,7 +18,7 @@ public Texture3DMaterialSlot( ShaderStageCapability shaderStageCapability = ShaderStageCapability.All, bool hidden = false) : base(slotId, displayName, shaderOutputName, slotType, shaderStageCapability, hidden) - {} + { } [SerializeField] bool m_BareResource = false; @@ -45,7 +45,7 @@ public override void AppendHLSLParameterDeclaration(ShaderStringBuilder sb, stri public override bool isDefaultValue => true; public override void AddDefaultProperty(PropertyCollector properties, GenerationMode generationMode) - {} + { } public override void CopyValuesFrom(MaterialSlot foundSlot) { diff --git a/com.unity.shadergraph/Editor/Data/Graphs/UVMaterialSlot.cs b/com.unity.shadergraph/Editor/Data/Graphs/UVMaterialSlot.cs index f67169c78cb..c8b34e0082d 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/UVMaterialSlot.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/UVMaterialSlot.cs @@ -22,7 +22,7 @@ public UVChannel channel public override bool isDefaultValue => channel == UVChannel.UV0; public UVMaterialSlot() - {} + { } public UVMaterialSlot(int slotId, string displayName, string shaderOutputName, UVChannel channel, ShaderStageCapability stageCapability = ShaderStageCapability.All, bool hidden = false) diff --git a/com.unity.shadergraph/Editor/Data/Graphs/VertexColorMaterialSlot.cs b/com.unity.shadergraph/Editor/Data/Graphs/VertexColorMaterialSlot.cs index 1d0de43b6e9..8fe0410feff 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/VertexColorMaterialSlot.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/VertexColorMaterialSlot.cs @@ -12,7 +12,7 @@ class VertexColorMaterialSlot : Vector4MaterialSlot, IMayRequireScreenPosition public VertexColorMaterialSlot(int slotId, string displayName, string shaderOutputName, ShaderStageCapability stageCapability = ShaderStageCapability.All, bool hidden = false) : base(slotId, displayName, shaderOutputName, SlotType.Input, Vector3.zero, stageCapability, hidden: hidden) - {} + { } public override VisualElement InstantiateControl() { diff --git a/com.unity.shadergraph/Editor/Data/Graphs/ViewDirectionMaterialSlot.cs b/com.unity.shadergraph/Editor/Data/Graphs/ViewDirectionMaterialSlot.cs index 59f92756812..6d8296720f5 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/ViewDirectionMaterialSlot.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/ViewDirectionMaterialSlot.cs @@ -9,12 +9,12 @@ namespace UnityEditor.ShaderGraph class ViewDirectionMaterialSlot : SpaceMaterialSlot, IMayRequireViewDirection { public ViewDirectionMaterialSlot() - {} + { } public ViewDirectionMaterialSlot(int slotId, string displayName, string shaderOutputName, CoordinateSpace space, ShaderStageCapability stageCapability = ShaderStageCapability.All, bool hidden = false) : base(slotId, displayName, shaderOutputName, space, stageCapability, hidden) - {} + { } public override VisualElement InstantiateControl() { return new LabelSlotControlView(space + " Space"); diff --git a/com.unity.shadergraph/Editor/Data/Graphs/VirtualTextureMaterialSlot.cs b/com.unity.shadergraph/Editor/Data/Graphs/VirtualTextureMaterialSlot.cs index a9b343a16f7..2ff759f4200 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/VirtualTextureMaterialSlot.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/VirtualTextureMaterialSlot.cs @@ -7,7 +7,7 @@ namespace UnityEditor.ShaderGraph class VirtualTextureMaterialSlot : MaterialSlot { public VirtualTextureMaterialSlot() - {} + { } public VirtualTextureMaterialSlot( int slotId, @@ -17,7 +17,7 @@ public VirtualTextureMaterialSlot( ShaderStageCapability stageCapability = ShaderStageCapability.All, bool hidden = false) : base(slotId, displayName, shaderOutputName, slotType, stageCapability, hidden) - {} + { } public override SlotValueType valueType { get { return SlotValueType.VirtualTexture; } } public override ConcreteSlotValueType concreteValueType { get { return ConcreteSlotValueType.VirtualTexture; } } diff --git a/com.unity.shadergraph/Editor/Data/Graphs/VirtualTextureShaderProperty.cs b/com.unity.shadergraph/Editor/Data/Graphs/VirtualTextureShaderProperty.cs index db3eadf5bed..be9ffc57805 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/VirtualTextureShaderProperty.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/VirtualTextureShaderProperty.cs @@ -166,7 +166,7 @@ internal override PreviewProperty GetPreviewMaterialProperty() internal override ShaderInput Copy() { - var vt = new VirtualTextureShaderProperty + var vt = new VirtualTextureShaderProperty { displayName = displayName, value = new SerializableVirtualTexture(), diff --git a/com.unity.shadergraph/Editor/Data/Implementation/Edge.cs b/com.unity.shadergraph/Editor/Data/Implementation/Edge.cs index cbdfb3285fc..1fe2f3d5cc9 100644 --- a/com.unity.shadergraph/Editor/Data/Implementation/Edge.cs +++ b/com.unity.shadergraph/Editor/Data/Implementation/Edge.cs @@ -12,7 +12,7 @@ class Edge : IEdge, IComparable private SlotReference m_InputSlot; public Edge() - {} + { } public Edge(SlotReference outputSlot, SlotReference inputSlot) { diff --git a/com.unity.shadergraph/Editor/Data/Implementation/GraphObject.cs b/com.unity.shadergraph/Editor/Data/Implementation/GraphObject.cs index 245007c9597..6020ad9b6ad 100644 --- a/com.unity.shadergraph/Editor/Data/Implementation/GraphObject.cs +++ b/com.unity.shadergraph/Editor/Data/Implementation/GraphObject.cs @@ -84,7 +84,7 @@ public void HandleUndoRedo() GraphData DeserializeGraph() { var json = m_SerializedGraph.JSONnodeData; - var deserializedGraph = new GraphData {isSubGraph = m_IsSubGraph, assetGuid = m_AssetGuid}; + var deserializedGraph = new GraphData { isSubGraph = m_IsSubGraph, assetGuid = m_AssetGuid }; MultiJson.Deserialize(deserializedGraph, json); m_DeserializedVersion = m_SerializedVersion; m_SerializedGraph = default; diff --git a/com.unity.shadergraph/Editor/Data/Implementation/NodeUtils.cs b/com.unity.shadergraph/Editor/Data/Implementation/NodeUtils.cs index 3f323cd69e6..c39a4dcca10 100644 --- a/com.unity.shadergraph/Editor/Data/Implementation/NodeUtils.cs +++ b/com.unity.shadergraph/Editor/Data/Implementation/NodeUtils.cs @@ -14,7 +14,7 @@ class SlotConfigurationException : Exception { public SlotConfigurationException(string message) : base(message) - {} + { } } static class NodeUtils diff --git a/com.unity.shadergraph/Editor/Data/Nodes/AbstractMaterialNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/AbstractMaterialNode.cs index 3b19db1fa11..2735956ec1f 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/AbstractMaterialNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/AbstractMaterialNode.cs @@ -433,7 +433,7 @@ public AbstractShaderProperty GetSlotProperty(int inputSlotId) return null; } - protected internal virtual string GetOutputForSlot(SlotReference fromSocketRef, ConcreteSlotValueType valueType, GenerationMode generationMode) + protected internal virtual string GetOutputForSlot(SlotReference fromSocketRef, ConcreteSlotValueType valueType, GenerationMode generationMode) { var slot = FindOutputSlot(fromSocketRef.slotId); if (slot == null) @@ -913,7 +913,7 @@ public void SetupSlots() } public virtual void UpdateNodeAfterDeserialization() - {} + { } public bool IsSlotConnected(int slotId) { @@ -921,7 +921,7 @@ public bool IsSlotConnected(int slotId) return slot != null && owner.GetEdges(slot.slotReference).Any(); } - public virtual void Setup() {} + public virtual void Setup() { } protected void EnqueSlotsForSerialization() { diff --git a/com.unity.shadergraph/Editor/Data/Nodes/BlockNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/BlockNode.cs index a416d7f42b0..55cb1603ba6 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/BlockNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/BlockNode.cs @@ -62,7 +62,7 @@ public void Init(BlockFieldDescriptor fieldDescriptor) { var newSlot = customSlotDescriptor.createSlot(); AddSlot(newSlot); - RemoveSlotsNameNotMatching(new int[] {0}); + RemoveSlotsNameNotMatching(new int[] { 0 }); return; } @@ -101,7 +101,7 @@ void AddSlotFromControlType() AddSlot(new Vector3MaterialSlot(0, descriptor.displayName, descriptor.name, SlotType.Input, vector3Control.value, stageCapability)); break; } - RemoveSlotsNameNotMatching(new int[] {0}); + RemoveSlotsNameNotMatching(new int[] { 0 }); } public override string GetVariableNameForNode() diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Channel/SplitNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Channel/SplitNode.cs index a9e31d596b3..427f2df551f 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Channel/SplitNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Channel/SplitNode.cs @@ -36,7 +36,7 @@ public sealed override void UpdateNodeAfterDeserialization() RemoveSlotsNameNotMatching(new int[] { InputSlotId, OutputSlotRId, OutputSlotGId, OutputSlotBId, OutputSlotAId }); } - static int[] s_OutputSlots = {OutputSlotRId, OutputSlotGId, OutputSlotBId, OutputSlotAId}; + static int[] s_OutputSlots = { OutputSlotRId, OutputSlotGId, OutputSlotBId, OutputSlotAId }; public void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode generationMode) { diff --git a/com.unity.shadergraph/Editor/Data/Nodes/CodeFunctionNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/CodeFunctionNode.cs index b278561e5f9..446f1d56068 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/CodeFunctionNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/CodeFunctionNode.cs @@ -35,43 +35,43 @@ protected CodeFunctionNode() } protected struct Boolean - {} + { } protected struct Vector1 - {} + { } protected struct Texture2D - {} + { } protected struct Texture2DArray - {} + { } protected struct Texture3D - {} + { } protected struct SamplerState - {} + { } protected struct Gradient - {} + { } protected struct DynamicDimensionVector - {} + { } protected struct ColorRGBA - {} + { } protected struct ColorRGB - {} + { } protected struct Matrix3x3 - {} + { } protected struct Matrix2x2 - {} + { } protected struct DynamicDimensionMatrix - {} + { } protected enum Binding { diff --git a/com.unity.shadergraph/Editor/Data/Nodes/GeometryNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/GeometryNode.cs index 7be20b0f326..ee190969ecb 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/GeometryNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/GeometryNode.cs @@ -16,7 +16,7 @@ public GeometryNode() m_PreviewMode = PreviewMode.Preview3D; } - public virtual List validSpaces => new List {CoordinateSpace.Object, CoordinateSpace.View, CoordinateSpace.World, CoordinateSpace.Tangent}; + public virtual List validSpaces => new List { CoordinateSpace.Object, CoordinateSpace.View, CoordinateSpace.World, CoordinateSpace.Tangent }; [SerializeField] private CoordinateSpace m_Space = CoordinateSpace.World; diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Input/Basic/Vector1Node.cs b/com.unity.shadergraph/Editor/Data/Nodes/Input/Basic/Vector1Node.cs index 7fd91f47609..daf988837c9 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Input/Basic/Vector1Node.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Input/Basic/Vector1Node.cs @@ -22,7 +22,7 @@ class Vector1Node : AbstractMaterialNode, IGeneratesBodyCode, IPropertyFromNode public Vector1Node() { name = "Float"; - synonyms = new string[] {"Vector 1"}; + synonyms = new string[] { "Vector 1" }; UpdateNodeAfterDeserialization(); } diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Input/Geometry/PositionNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Input/Geometry/PositionNode.cs index 87f1595d7da..8d40526130e 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Input/Geometry/PositionNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Input/Geometry/PositionNode.cs @@ -16,7 +16,7 @@ class PositionNode : GeometryNode, IMayRequirePosition public override int latestVersion => 1; private const int kOutputSlotId = 0; public const string kOutputSlotName = "Out"; - public override List validSpaces => new List {CoordinateSpace.Object, CoordinateSpace.View, CoordinateSpace.World, CoordinateSpace.Tangent, CoordinateSpace.AbsoluteWorld}; + public override List validSpaces => new List { CoordinateSpace.Object, CoordinateSpace.View, CoordinateSpace.World, CoordinateSpace.Tangent, CoordinateSpace.AbsoluteWorld }; public PositionNode() { diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Input/PropertyNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Input/PropertyNode.cs index f6200cd3cac..0a7f1d4b5fc 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Input/PropertyNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Input/PropertyNode.cs @@ -88,19 +88,19 @@ void AddOutputSlot() break; case ConcreteSlotValueType.Vector1: AddSlot(new Vector1MaterialSlot(OutputSlotId, property.displayName, "Out", SlotType.Output, 0)); - RemoveSlotsNameNotMatching(new[] {OutputSlotId}); + RemoveSlotsNameNotMatching(new[] { OutputSlotId }); break; case ConcreteSlotValueType.Vector2: AddSlot(new Vector2MaterialSlot(OutputSlotId, property.displayName, "Out", SlotType.Output, Vector4.zero)); - RemoveSlotsNameNotMatching(new[] {OutputSlotId}); + RemoveSlotsNameNotMatching(new[] { OutputSlotId }); break; case ConcreteSlotValueType.Vector3: AddSlot(new Vector3MaterialSlot(OutputSlotId, property.displayName, "Out", SlotType.Output, Vector4.zero)); - RemoveSlotsNameNotMatching(new[] {OutputSlotId}); + RemoveSlotsNameNotMatching(new[] { OutputSlotId }); break; case ConcreteSlotValueType.Vector4: AddSlot(new Vector4MaterialSlot(OutputSlotId, property.displayName, "Out", SlotType.Output, Vector4.zero)); - RemoveSlotsNameNotMatching(new[] {OutputSlotId}); + RemoveSlotsNameNotMatching(new[] { OutputSlotId }); break; case ConcreteSlotValueType.Matrix2: AddSlot(new Matrix2MaterialSlot(OutputSlotId, property.displayName, "Out", SlotType.Output)); @@ -116,15 +116,15 @@ void AddOutputSlot() break; case ConcreteSlotValueType.Texture2D: AddSlot(new Texture2DMaterialSlot(OutputSlotId, property.displayName, "Out", SlotType.Output)); - RemoveSlotsNameNotMatching(new[] {OutputSlotId}); + RemoveSlotsNameNotMatching(new[] { OutputSlotId }); break; case ConcreteSlotValueType.Texture2DArray: AddSlot(new Texture2DArrayMaterialSlot(OutputSlotId, property.displayName, "Out", SlotType.Output)); - RemoveSlotsNameNotMatching(new[] {OutputSlotId}); + RemoveSlotsNameNotMatching(new[] { OutputSlotId }); break; case ConcreteSlotValueType.Texture3D: AddSlot(new Texture3DMaterialSlot(OutputSlotId, property.displayName, "Out", SlotType.Output)); - RemoveSlotsNameNotMatching(new[] {OutputSlotId}); + RemoveSlotsNameNotMatching(new[] { OutputSlotId }); break; case ConcreteSlotValueType.Cubemap: AddSlot(new CubemapMaterialSlot(OutputSlotId, property.displayName, "Out", SlotType.Output)); diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleVirtualTextureNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleVirtualTextureNode.cs index 01572353d48..17fe629364e 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleVirtualTextureNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleVirtualTextureNode.cs @@ -162,7 +162,7 @@ public bool noFeedback } public SampleVirtualTextureNode() : this(false, false) - {} + { } public SampleVirtualTextureNode(bool isLod = false, bool noResolve = false) { @@ -328,10 +328,10 @@ void AppendVtSample(ShaderStringBuilder sb, string propertiesName, string vtInpu sb.AppendIndentation(); sb.Append(outputVariableName); sb.Append(" = "); sb.Append("SampleVTLayerWithTextureType("); - sb.Append(propertiesName); sb.Append(", "); - sb.Append(vtInputVariable); sb.Append(", "); - sb.Append(infoVariable); sb.Append(", "); - sb.Append(layerIndex.ToString()); sb.Append(");"); + sb.Append(propertiesName); sb.Append(", "); + sb.Append(vtInputVariable); sb.Append(", "); + sb.Append(infoVariable); sb.Append(", "); + sb.Append(layerIndex.ToString()); sb.Append(");"); sb.AppendNewLine(); } diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SamplerStateNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SamplerStateNode.cs index 6d0f66d5748..ebe228267c4 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SamplerStateNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SamplerStateNode.cs @@ -85,7 +85,7 @@ public override void CollectShaderProperties(PropertyCollector properties, Gener value = new TextureSamplerState() { filter = m_filter, - wrap = m_wrap + wrap = m_wrap } }); } diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Math/Matrix/MatrixSplitNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Math/Matrix/MatrixSplitNode.cs index 911b6c32e37..e61b14eb682 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Math/Matrix/MatrixSplitNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Math/Matrix/MatrixSplitNode.cs @@ -64,7 +64,7 @@ public sealed override void UpdateNodeAfterDeserialization() RemoveSlotsNameNotMatching(new int[] { InputSlotId, OutputSlotRId, OutputSlotGId, OutputSlotBId, OutputSlotAId }); } - static int[] s_OutputSlots = {OutputSlotRId, OutputSlotGId, OutputSlotBId, OutputSlotAId}; + static int[] s_OutputSlots = { OutputSlotRId, OutputSlotGId, OutputSlotBId, OutputSlotAId }; public void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode generationMode) { diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Utility/KeywordNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Utility/KeywordNode.cs index cb3e4c4c53d..7b7fd90fbae 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Utility/KeywordNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Utility/KeywordNode.cs @@ -81,7 +81,7 @@ void UpdatePorts() AddSlot(new DynamicVectorMaterialSlot(OutputSlotId, "Out", "Out", SlotType.Output, Vector4.zero)); AddSlot(new DynamicVectorMaterialSlot(1, "On", "On", SlotType.Input, Vector4.zero)); AddSlot(new DynamicVectorMaterialSlot(2, "Off", "Off", SlotType.Input, Vector4.zero)); - RemoveSlotsNameNotMatching(new int[] {0, 1, 2}); + RemoveSlotsNameNotMatching(new int[] { 0, 1, 2 }); break; } case KeywordType.Enum: diff --git a/com.unity.shadergraph/Editor/Data/Util/FunctionRegistry.cs b/com.unity.shadergraph/Editor/Data/Util/FunctionRegistry.cs index ac8a07c6743..b7958e12127 100644 --- a/com.unity.shadergraph/Editor/Data/Util/FunctionRegistry.cs +++ b/com.unity.shadergraph/Editor/Data/Util/FunctionRegistry.cs @@ -52,7 +52,7 @@ public void ProvideFunction(string name, Action generator) generator(builder); var length = builder.length - startIndex; var code = m_Validate ? builder.ToString(startIndex, length) : string.Empty; - m_Sources.Add(name, new FunctionSource { code = code, nodes = new HashSet {builder.currentNode} }); + m_Sources.Add(name, new FunctionSource { code = code, nodes = new HashSet { builder.currentNode } }); names.Add(name); } } diff --git a/com.unity.shadergraph/Editor/Data/Util/GraphUtil.cs b/com.unity.shadergraph/Editor/Data/Util/GraphUtil.cs index 60d3f5d4194..4b7fdb420f2 100644 --- a/com.unity.shadergraph/Editor/Data/Util/GraphUtil.cs +++ b/com.unity.shadergraph/Editor/Data/Util/GraphUtil.cs @@ -354,15 +354,15 @@ static ProcessStartInfo CreateProcessStartInfo(string filePath) psi.UseShellExecute = false; - #if UNITY_EDITOR_OSX +#if UNITY_EDITOR_OSX string arg = string.Format("-a \"{0}\" -n --args \"{1}\"", externalScriptEditor, Path.GetFullPath(filePath)); psi.FileName = "open"; psi.Arguments = arg; - #else +#else psi.Arguments = Path.GetFileName(filePath); psi.WorkingDirectory = Path.GetDirectoryName(filePath); psi.FileName = externalScriptEditor; - #endif +#endif return psi; } diff --git a/com.unity.shadergraph/Editor/Data/Util/KeywordUtil.cs b/com.unity.shadergraph/Editor/Data/Util/KeywordUtil.cs index 96fb305dc55..bffcdb8d9e8 100644 --- a/com.unity.shadergraph/Editor/Data/Util/KeywordUtil.cs +++ b/com.unity.shadergraph/Editor/Data/Util/KeywordUtil.cs @@ -37,7 +37,7 @@ public static IEnumerable GetBuiltinKeywordDescriptors() => TypeCache.GetMethodsWithAttribute() .Where(method => method.IsStatic && method.ReturnType == typeof(KeywordDescriptor)) .Select(method => - (KeywordDescriptor)method.Invoke(null, new object[0] {})); + (KeywordDescriptor)method.Invoke(null, new object[0] { })); public static ConcreteSlotValueType ToConcreteSlotValueType(this KeywordType keywordType) { diff --git a/com.unity.shadergraph/Editor/Data/Util/PooledHashSet.cs b/com.unity.shadergraph/Editor/Data/Util/PooledHashSet.cs index c8460f4c5bc..6aab0b5c297 100644 --- a/com.unity.shadergraph/Editor/Data/Util/PooledHashSet.cs +++ b/com.unity.shadergraph/Editor/Data/Util/PooledHashSet.cs @@ -9,7 +9,7 @@ class PooledHashSet : HashSet, IDisposable static Stack> s_Pool = new Stack>(); bool m_Active; - PooledHashSet() {} + PooledHashSet() { } public static PooledHashSet Get() { @@ -37,7 +37,7 @@ public void Dispose() #endif } -// Destructor causes some GC alloc so only do this sanity check in debug build + // Destructor causes some GC alloc so only do this sanity check in debug build #if DEBUG ~PooledHashSet() { diff --git a/com.unity.shadergraph/Editor/Data/Util/PooledList.cs b/com.unity.shadergraph/Editor/Data/Util/PooledList.cs index ea2be0fb6fb..2b0be80b0d5 100644 --- a/com.unity.shadergraph/Editor/Data/Util/PooledList.cs +++ b/com.unity.shadergraph/Editor/Data/Util/PooledList.cs @@ -9,7 +9,7 @@ class PooledList : List, IDisposable static Stack> s_Pool = new Stack>(); bool m_Active; - PooledList() {} + PooledList() { } public static PooledList Get() { @@ -37,7 +37,7 @@ public void Dispose() #endif } -// Destructor causes some GC alloc so only do this sanity check in debug build + // Destructor causes some GC alloc so only do this sanity check in debug build #if DEBUG ~PooledList() { diff --git a/com.unity.shadergraph/Editor/Data/Util/SerializationHelper.cs b/com.unity.shadergraph/Editor/Data/Util/SerializationHelper.cs index 0a0f25c82a0..eb621c6cfdf 100644 --- a/com.unity.shadergraph/Editor/Data/Util/SerializationHelper.cs +++ b/com.unity.shadergraph/Editor/Data/Util/SerializationHelper.cs @@ -95,7 +95,7 @@ static TypeSerializationInfo DoTypeRemap(TypeSerializationInfo info, Dictionary< return info; } - public static T Deserialize(JSONSerializedElement item, Dictionary remapper, params object[] constructorArgs) where T : class + public static T Deserialize(JSONSerializedElement item, Dictionary remapper, params object[] constructorArgs) where T : class { T instance; if (typeof(T) == typeof(JsonObject) || typeof(T).IsSubclassOf(typeof(JsonObject))) diff --git a/com.unity.shadergraph/Editor/Data/Util/ShaderGraphRequirementsPerKeyword.cs b/com.unity.shadergraph/Editor/Data/Util/ShaderGraphRequirementsPerKeyword.cs index fde0129aed8..c63ffa4cfdd 100644 --- a/com.unity.shadergraph/Editor/Data/Util/ShaderGraphRequirementsPerKeyword.cs +++ b/com.unity.shadergraph/Editor/Data/Util/ShaderGraphRequirementsPerKeyword.cs @@ -18,7 +18,7 @@ public interface IRequirements : KeywordDependentCollection.IInstance, KeywordDe { void SetRequirements(ShaderGraphRequirements value); - ShaderGraphRequirements requirements { get; set; } + ShaderGraphRequirements requirements { get; set; } } public interface IRequirementsSet : KeywordDependentCollection.ISet @@ -55,7 +55,7 @@ public struct Base : IRequirements, IRequirementsSet private ShaderGraphRequirementsPerKeyword m_Source; public int instanceCount => 1; - public int permutationIndex => - 1; + public int permutationIndex => -1; public KeywordDependentCollection.KeywordPermutationInstanceType type => KeywordDependentCollection.KeywordPermutationInstanceType.Base; public IEnumerable instances => Enumerable.Repeat(this, 1); diff --git a/com.unity.shadergraph/Editor/Drawing/Blackboard/BlackboardProvider.cs b/com.unity.shadergraph/Editor/Drawing/Blackboard/BlackboardProvider.cs index 857469d8756..a2af09c7202 100644 --- a/com.unity.shadergraph/Editor/Drawing/Blackboard/BlackboardProvider.cs +++ b/com.unity.shadergraph/Editor/Drawing/Blackboard/BlackboardProvider.cs @@ -213,7 +213,8 @@ void AddPropertyItems(GenericMenu gm) var shaderInputTypes = TypeCache.GetTypesWithAttribute().ToList(); // Sort the ShaderInput by priority using the BlackboardInputInfo attribute - shaderInputTypes.Sort((s1, s2) => { + shaderInputTypes.Sort((s1, s2) => + { var info1 = Attribute.GetCustomAttribute(s1, typeof(BlackboardInputInfo)) as BlackboardInputInfo; var info2 = Attribute.GetCustomAttribute(s2, typeof(BlackboardInputInfo)) as BlackboardInputInfo; @@ -371,7 +372,7 @@ void UpdateField() { var icon = (m_Graph.isSubGraph || keyword.isExposed) ? exposedIcon : null; - string typeText = keyword.keywordType.ToString() + " Keyword"; + string typeText = keyword.keywordType.ToString() + " Keyword"; typeText = keyword.isBuiltIn ? "Built-in " + typeText : typeText; field = new BlackboardFieldView(m_Graph, keyword, icon, keyword.displayName, typeText) { userData = keyword }; diff --git a/com.unity.shadergraph/Editor/Drawing/Blackboard/SGBlackboard.cs b/com.unity.shadergraph/Editor/Drawing/Blackboard/SGBlackboard.cs index 55b7a3e2377..7949c69f981 100644 --- a/com.unity.shadergraph/Editor/Drawing/Blackboard/SGBlackboard.cs +++ b/com.unity.shadergraph/Editor/Drawing/Blackboard/SGBlackboard.cs @@ -31,7 +31,8 @@ public SGBlackboard(GraphView associatedGraphView) : base(associatedGraphView) windowDockingLayout.dockingLeft = true; var addButton = m_MainContainer.Q(name: "addButton") as Button; - addButton.clickable.clicked += () => { + addButton.clickable.clicked += () => + { if (addItemRequested != null) { addItemRequested(this); diff --git a/com.unity.shadergraph/Editor/Drawing/Colors/CustomColorData.cs b/com.unity.shadergraph/Editor/Drawing/Colors/CustomColorData.cs index dc23a0340d0..bd7de1b3ee6 100644 --- a/com.unity.shadergraph/Editor/Drawing/Colors/CustomColorData.cs +++ b/com.unity.shadergraph/Editor/Drawing/Colors/CustomColorData.cs @@ -14,7 +14,7 @@ class SerializableUserColor public SerializableUserColor(KeyValuePair pair) { Key = pair.Key; Value = pair.Value; } // Empty constructor required by serialization system - public SerializableUserColor() {} + public SerializableUserColor() { } } [Serializable] diff --git a/com.unity.shadergraph/Editor/Drawing/Controls/ButtonControl.cs b/com.unity.shadergraph/Editor/Drawing/Controls/ButtonControl.cs index be970bf30ac..d0922960e69 100644 --- a/com.unity.shadergraph/Editor/Drawing/Controls/ButtonControl.cs +++ b/com.unity.shadergraph/Editor/Drawing/Controls/ButtonControl.cs @@ -41,7 +41,7 @@ public ButtonControlView(AbstractMaterialNode node, PropertyInfo propertyInfo) } var value = (ButtonConfig)propertyInfo.GetValue(m_Node, null); - Add(new Button(value.action) { text = value.text}); + Add(new Button(value.action) { text = value.text }); } } } diff --git a/com.unity.shadergraph/Editor/Drawing/Controls/DielectricSpecularControl.cs b/com.unity.shadergraph/Editor/Drawing/Controls/DielectricSpecularControl.cs index c2eba2b5e09..97245cf48a2 100644 --- a/com.unity.shadergraph/Editor/Drawing/Controls/DielectricSpecularControl.cs +++ b/com.unity.shadergraph/Editor/Drawing/Controls/DielectricSpecularControl.cs @@ -171,7 +171,7 @@ void RedrawIORControls(float value) { value = Mathf.Max(Mathf.Min(value, 5), 1); m_IORPanel.Remove(m_IORSlider); - m_IORSlider = new Slider(1, 2.5f) { value = value }; + m_IORSlider = new Slider(1, 2.5f) { value = value }; m_IORSlider.RegisterValueChangedCallback((evt) => OnChangeIORSlider(evt.newValue)); m_IORPanel.Add(m_IORSlider); diff --git a/com.unity.shadergraph/Editor/Drawing/Controls/GradientControl.cs b/com.unity.shadergraph/Editor/Drawing/Controls/GradientControl.cs index ce88cbea047..27db49fca50 100644 --- a/com.unity.shadergraph/Editor/Drawing/Controls/GradientControl.cs +++ b/com.unity.shadergraph/Editor/Drawing/Controls/GradientControl.cs @@ -66,7 +66,7 @@ public GradientControlView(string label, AbstractMaterialNode node, PropertyInfo if (!string.IsNullOrEmpty(label)) gradientPanel.Add(new Label(label)); - var gradientField = new GradientField() { value = m_GradientObject.gradient , colorSpace = ColorSpace.Linear}; + var gradientField = new GradientField() { value = m_GradientObject.gradient, colorSpace = ColorSpace.Linear }; gradientField.RegisterValueChangedCallback(OnValueChanged); gradientPanel.Add(gradientField); diff --git a/com.unity.shadergraph/Editor/Drawing/Controls/ObjectControl.cs b/com.unity.shadergraph/Editor/Drawing/Controls/ObjectControl.cs index af3173f44f2..4d75b201245 100644 --- a/com.unity.shadergraph/Editor/Drawing/Controls/ObjectControl.cs +++ b/com.unity.shadergraph/Editor/Drawing/Controls/ObjectControl.cs @@ -37,7 +37,7 @@ public ObjectControlView(string label, AbstractMaterialNode node, PropertyInfo p label = label ?? propertyInfo.Name; if (!string.IsNullOrEmpty(label)) - Add(new Label {text = label}); + Add(new Label { text = label }); var value = (Object)m_PropertyInfo.GetValue(m_Node, null); var objectField = new ObjectField { objectType = propertyInfo.PropertyType, value = value }; diff --git a/com.unity.shadergraph/Editor/Drawing/Inspector/InspectorView.cs b/com.unity.shadergraph/Editor/Drawing/Inspector/InspectorView.cs index 73313eab9e8..8bda178a293 100644 --- a/com.unity.shadergraph/Editor/Drawing/Inspector/InspectorView.cs +++ b/com.unity.shadergraph/Editor/Drawing/Inspector/InspectorView.cs @@ -182,7 +182,7 @@ internal static void GatherInspectorContent( if (attribute == null) continue; - var propertyType = propertyInfo.GetGetMethod(true).Invoke(inspectable, new object[] {}).GetType(); + var propertyType = propertyInfo.GetGetMethod(true).Invoke(inspectable, new object[] { }).GetType(); if (IsPropertyTypeHandled(propertyDrawerList, propertyType, out var propertyDrawerTypeToUse)) { diff --git a/com.unity.shadergraph/Editor/Drawing/Inspector/MasterPreviewView.cs b/com.unity.shadergraph/Editor/Drawing/Inspector/MasterPreviewView.cs index 63ff22f2ef2..4a0245b7d8b 100644 --- a/com.unity.shadergraph/Editor/Drawing/Inspector/MasterPreviewView.cs +++ b/com.unity.shadergraph/Editor/Drawing/Inspector/MasterPreviewView.cs @@ -50,7 +50,7 @@ public VisualElement preview get { return m_Preview; } } - List m_DoNotShowPrimitives = new List(new string[] {PrimitiveType.Plane.ToString()}); + List m_DoNotShowPrimitives = new List(new string[] { PrimitiveType.Plane.ToString() }); static Type s_ContextualMenuManipulator = AppDomain.CurrentDomain.GetAssemblies().SelectMany(x => x.GetTypesOrNothing()).FirstOrDefault(t => t.FullName == "UnityEngine.UIElements.ContextualMenuManipulator"); static Type s_ObjectSelector = AppDomain.CurrentDomain.GetAssemblies().SelectMany(x => x.GetTypesOrNothing()).FirstOrDefault(t => t.FullName == "UnityEditor.ObjectSelector"); @@ -84,7 +84,7 @@ public MasterPreviewView(PreviewManager previewManager, GraphData graph) } Add(topContainer); - m_Preview = new VisualElement {name = "middle"}; + m_Preview = new VisualElement { name = "middle" }; { m_PreviewTextureView = CreatePreview(Texture2D.blackTexture); m_PreviewScrollPosition = new Vector2(0f, 0f); @@ -174,7 +174,7 @@ void OnMeshChanged(Object obj) void ChangeMeshCustom() { - MethodInfo ShowMethod = s_ObjectSelector.GetMethod("Show", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly, Type.DefaultBinder, new[] {typeof(Object), typeof(Type), typeof(Object), typeof(bool), typeof(List), typeof(Action), typeof(Action)}, new ParameterModifier[7]); + MethodInfo ShowMethod = s_ObjectSelector.GetMethod("Show", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly, Type.DefaultBinder, new[] { typeof(Object), typeof(Type), typeof(Object), typeof(bool), typeof(List), typeof(Action), typeof(Action) }, new ParameterModifier[7]); m_PreviousMesh = m_Graph.previewData.serializedMesh.mesh; ShowMethod.Invoke(Get(), new object[] { null, typeof(Mesh), null, false, null, (Action)OnMeshChanged, (Action)OnMeshChanged }); } diff --git a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/AbstractMaterialNodePropertyDrawer.cs b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/AbstractMaterialNodePropertyDrawer.cs index 40dc8358a81..b2cc4b4166d 100644 --- a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/AbstractMaterialNodePropertyDrawer.cs +++ b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/AbstractMaterialNodePropertyDrawer.cs @@ -10,7 +10,7 @@ using UnityEditor.Graphing.Util; using UnityEngine; -namespace UnityEditor.ShaderGraph.Drawing.Inspector.PropertyDrawers +namespace UnityEditor.ShaderGraph.Drawing.Inspector.PropertyDrawers { internal interface IGetNodePropertyDrawerPropertyData { diff --git a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/BoolPropertyDrawer.cs b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/BoolPropertyDrawer.cs index 57b4fb70017..67622f49b43 100644 --- a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/BoolPropertyDrawer.cs +++ b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/BoolPropertyDrawer.cs @@ -46,7 +46,7 @@ public VisualElement DrawProperty( { return this.CreateGUI( // Use the setter from the provided property as the callback - newBoolValue => propertyInfo.GetSetMethod(true).Invoke(actualObject, new object[] {newBoolValue}), + newBoolValue => propertyInfo.GetSetMethod(true).Invoke(actualObject, new object[] { newBoolValue }), (bool)propertyInfo.GetValue(actualObject), attribute.labelName, out var propertyVisualElement); diff --git a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/ColorPropertyDrawer.cs b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/ColorPropertyDrawer.cs index 37f121f740e..490ec11ee9e 100644 --- a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/ColorPropertyDrawer.cs +++ b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/ColorPropertyDrawer.cs @@ -39,7 +39,7 @@ public VisualElement DrawProperty(PropertyInfo propertyInfo, object actualObject { return this.CreateGUI( // Use the setter from the provided property as the callback - newValue => propertyInfo.GetSetMethod(true).Invoke(actualObject, new object[] {newValue}), + newValue => propertyInfo.GetSetMethod(true).Invoke(actualObject, new object[] { newValue }), (Color)propertyInfo.GetValue(actualObject), attribute.labelName, out var propertyVisualElement); diff --git a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/CubemapPropertyDrawer.cs b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/CubemapPropertyDrawer.cs index 095df8dc999..f3c9d0ea9dc 100644 --- a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/CubemapPropertyDrawer.cs +++ b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/CubemapPropertyDrawer.cs @@ -19,7 +19,7 @@ internal VisualElement CreateGUI( out VisualElement propertyCubemapField, int indentLevel = 0) { - var objectField = new ObjectField { value = fieldToDraw, objectType = typeof(Cubemap)}; + var objectField = new ObjectField { value = fieldToDraw, objectType = typeof(Cubemap) }; if (valueChangedCallback != null) { @@ -40,7 +40,7 @@ public VisualElement DrawProperty(PropertyInfo propertyInfo, object actualObject { return this.CreateGUI( // Use the setter from the provided property as the callback - newValue => propertyInfo.GetSetMethod(true).Invoke(actualObject, new object[] {newValue}), + newValue => propertyInfo.GetSetMethod(true).Invoke(actualObject, new object[] { newValue }), (Cubemap)propertyInfo.GetValue(actualObject), attribute.labelName, out var propertyVisualElement); diff --git a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/CustomFunctionNodePropertyDrawer.cs b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/CustomFunctionNodePropertyDrawer.cs index 2bc6503bb43..22cdd5b5643 100644 --- a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/CustomFunctionNodePropertyDrawer.cs +++ b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/CustomFunctionNodePropertyDrawer.cs @@ -7,7 +7,7 @@ using UnityEngine.UIElements; using UnityEngine; -namespace UnityEditor.ShaderGraph.Drawing.Inspector.PropertyDrawers +namespace UnityEditor.ShaderGraph.Drawing.Inspector.PropertyDrawers { [SGPropertyDrawer(typeof(CustomFunctionNode))] public class CustomFunctionNodePropertyDrawer : IPropertyDrawer, IGetNodePropertyDrawerPropertyData diff --git a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/DropdownPropertyDrawer.cs b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/DropdownPropertyDrawer.cs index d335bd2a37c..806229b30e5 100644 --- a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/DropdownPropertyDrawer.cs +++ b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/DropdownPropertyDrawer.cs @@ -40,7 +40,7 @@ public VisualElement DrawProperty(PropertyInfo propertyInfo, object actualObject { return this.CreateGUI( // Use the setter from the provided property as the callback - newSelectedIndex => propertyInfo.GetSetMethod(true).Invoke(actualObject, new object[] {newSelectedIndex}), + newSelectedIndex => propertyInfo.GetSetMethod(true).Invoke(actualObject, new object[] { newSelectedIndex }), (IEnumerable)propertyInfo.GetValue(actualObject), attribute.labelName, out var textArrayField); diff --git a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/EnumPropertyDrawer.cs b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/EnumPropertyDrawer.cs index d24b0233895..fdcf7c715a1 100644 --- a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/EnumPropertyDrawer.cs +++ b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/EnumPropertyDrawer.cs @@ -44,7 +44,7 @@ public VisualElement DrawProperty( InspectableAttribute attribute) { return this.CreateGUI(newEnumValue => - propertyInfo.GetSetMethod(true).Invoke(actualObject, new object[] {newEnumValue}), + propertyInfo.GetSetMethod(true).Invoke(actualObject, new object[] { newEnumValue }), (Enum)propertyInfo.GetValue(actualObject), attribute.labelName, (Enum)attribute.defaultValue, diff --git a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/FloatPropertyDrawer.cs b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/FloatPropertyDrawer.cs index bd65b8c6e16..f32c86fbb39 100644 --- a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/FloatPropertyDrawer.cs +++ b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/FloatPropertyDrawer.cs @@ -18,7 +18,7 @@ internal VisualElement CreateGUI( out VisualElement propertyFloatField, int indentLevel = 0) { - var floatField = new FloatField {label = "X", value = fieldToDraw}; + var floatField = new FloatField { label = "X", value = fieldToDraw }; floatField.labelElement.style.minWidth = 15; if (valueChangedCallback != null) @@ -40,7 +40,7 @@ public VisualElement DrawProperty(PropertyInfo propertyInfo, object actualObject { return this.CreateGUI( // Use the setter from the provided property as the callback - newValue => propertyInfo.GetSetMethod(true).Invoke(actualObject, new object[] {newValue}), + newValue => propertyInfo.GetSetMethod(true).Invoke(actualObject, new object[] { newValue }), (float)propertyInfo.GetValue(actualObject), attribute.labelName, out var propertyVisualElement); diff --git a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/GradientPropertyDrawer.cs b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/GradientPropertyDrawer.cs index e9e215d22e7..c76497386ce 100644 --- a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/GradientPropertyDrawer.cs +++ b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/GradientPropertyDrawer.cs @@ -19,7 +19,7 @@ internal VisualElement CreateGUI( out VisualElement propertyGradientField, int indentLevel = 0) { - var objectField = new GradientField { value = fieldToDraw, colorSpace = ColorSpace.Linear}; + var objectField = new GradientField { value = fieldToDraw, colorSpace = ColorSpace.Linear }; if (valueChangedCallback != null) { @@ -41,7 +41,7 @@ public VisualElement DrawProperty(PropertyInfo propertyInfo, object actualObject { return this.CreateGUI( // Use the setter from the provided property as the callback - newValue => propertyInfo.GetSetMethod(true).Invoke(actualObject, new object[] {newValue}), + newValue => propertyInfo.GetSetMethod(true).Invoke(actualObject, new object[] { newValue }), (Gradient)propertyInfo.GetValue(actualObject), attribute.labelName, out var propertyVisualElement); diff --git a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/GraphDataPropertyDrawer.cs b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/GraphDataPropertyDrawer.cs index 949dc0a156c..55478962e73 100644 --- a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/GraphDataPropertyDrawer.cs +++ b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/GraphDataPropertyDrawer.cs @@ -112,7 +112,7 @@ void RegisterActionToUndo(string actionName) internal VisualElement CreateGUI(GraphData graphData) { - var propertySheet = new VisualElement() {name = "graphSettings"}; + var propertySheet = new VisualElement() { name = "graphSettings" }; if (graphData == null) { diff --git a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/IntegerPropertyDrawer.cs b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/IntegerPropertyDrawer.cs index 1bdfed9f3ed..fe6159ded8f 100644 --- a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/IntegerPropertyDrawer.cs +++ b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/IntegerPropertyDrawer.cs @@ -19,7 +19,7 @@ internal VisualElement CreateGUI( out VisualElement propertyFloatField, int indentLevel = 0) { - var integerField = new IntegerField {value = fieldToDraw}; + var integerField = new IntegerField { value = fieldToDraw }; if (valueChangedCallback != null) { @@ -41,7 +41,7 @@ public VisualElement DrawProperty(PropertyInfo propertyInfo, object actualObject { return this.CreateGUI( // Use the setter from the provided property as the callback - newValue => propertyInfo.GetSetMethod(true).Invoke(actualObject, new object[] {newValue}), + newValue => propertyInfo.GetSetMethod(true).Invoke(actualObject, new object[] { newValue }), (int)propertyInfo.GetValue(actualObject), attribute.labelName, out var propertyVisualElement); diff --git a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/MatrixPropertyDrawer.cs b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/MatrixPropertyDrawer.cs index ec18f3419d7..451aa23b5d5 100644 --- a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/MatrixPropertyDrawer.cs +++ b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/MatrixPropertyDrawer.cs @@ -363,7 +363,7 @@ public VisualElement DrawProperty(PropertyInfo propertyInfo, object actualObject { return this.CreateGUI( // Use the setter from the provided property as the callback - newValue => propertyInfo.GetSetMethod(true).Invoke(actualObject, new object[] {newValue}), + newValue => propertyInfo.GetSetMethod(true).Invoke(actualObject, new object[] { newValue }), (Matrix4x4)propertyInfo.GetValue(actualObject), attribute.labelName, out var propertyVisualElement); diff --git a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/SampleVirtualTextureNodePropertyDrawer.cs b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/SampleVirtualTextureNodePropertyDrawer.cs index bb4eff6d014..baffa4ea4a6 100644 --- a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/SampleVirtualTextureNodePropertyDrawer.cs +++ b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/SampleVirtualTextureNodePropertyDrawer.cs @@ -12,7 +12,7 @@ using UnityEngine.Rendering; using UnityEngine.UIElements; -namespace UnityEditor.ShaderGraph.Drawing.Inspector.PropertyDrawers +namespace UnityEditor.ShaderGraph.Drawing.Inspector.PropertyDrawers { [SGPropertyDrawer(typeof(SampleVirtualTextureNode))] public class SampleVirtualTextureNodePropertyDrawer : IPropertyDrawer diff --git a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/ShaderInputPropertyDrawer.cs b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/ShaderInputPropertyDrawer.cs index 7990dc5215e..863cc6e3bd2 100644 --- a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/ShaderInputPropertyDrawer.cs +++ b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/ShaderInputPropertyDrawer.cs @@ -23,7 +23,7 @@ namespace UnityEditor.ShaderGraph.Drawing.Inspector.PropertyDrawers class ShaderInputPropertyDrawer : IPropertyDrawer { internal delegate void ChangeExposedFieldCallback(bool newValue); - internal delegate void ChangeDisplayNameCallback(string newValue); + internal delegate void ChangeDisplayNameCallback(string newValue); internal delegate void ChangeReferenceNameCallback(string newValue); internal delegate void ChangeValueCallback(object newValue); internal delegate void PreChangeValueCallback(string actionName); @@ -63,7 +63,7 @@ public ShaderInputPropertyDrawer() } GraphData graphData; - bool isSubGraph { get; set; } + bool isSubGraph { get; set; } ChangeExposedFieldCallback _exposedFieldChangedCallback; Action _precisionChangedCallback; Action _keywordChangedCallback; @@ -682,7 +682,7 @@ out var texture2DArrayField #region VT reorderable list handler void HandleVirtualTextureProperty(PropertySheet propertySheet, VirtualTextureShaderProperty virtualTextureProperty) { - var container = new IMGUIContainer(() => OnVTGUIHandler(virtualTextureProperty)) {name = "ListContainer"}; + var container = new IMGUIContainer(() => OnVTGUIHandler(virtualTextureProperty)) { name = "ListContainer" }; AddPropertyRowToSheet(propertySheet, container, "Layers"); m_VTLayer_Name = new TextField(); @@ -1149,7 +1149,7 @@ void BuildEnumKeywordField(PropertySheet propertySheet, ShaderKeyword keyword) AddPropertyRowToSheet(propertySheet, field, "Default"); - var container = new IMGUIContainer(() => OnKeywordGUIHandler()) {name = "ListContainer"}; + var container = new IMGUIContainer(() => OnKeywordGUIHandler()) { name = "ListContainer" }; AddPropertyRowToSheet(propertySheet, container, "Entries"); container.SetEnabled(!keyword.isBuiltIn); } diff --git a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/SubGraphOutputNodePropertyDrawer.cs b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/SubGraphOutputNodePropertyDrawer.cs index ba12718c7a1..cae89f82263 100644 --- a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/SubGraphOutputNodePropertyDrawer.cs +++ b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/SubGraphOutputNodePropertyDrawer.cs @@ -7,7 +7,7 @@ using UnityEngine.UIElements; using UnityEngine; -namespace UnityEditor.ShaderGraph.Drawing.Inspector.PropertyDrawers +namespace UnityEditor.ShaderGraph.Drawing.Inspector.PropertyDrawers { [SGPropertyDrawer(typeof(SubGraphOutputNode))] public class SubGraphOutputNodePropertyDrawer : IPropertyDrawer diff --git a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/TextPropertyDrawer.cs b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/TextPropertyDrawer.cs index 1674d9dd184..d3a1f941252 100644 --- a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/TextPropertyDrawer.cs +++ b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/TextPropertyDrawer.cs @@ -45,7 +45,7 @@ public VisualElement DrawProperty(PropertyInfo propertyInfo, object actualObject { return this.CreateGUI( // Use the setter from the provided property as the callback - newStringValue => propertyInfo.GetSetMethod(true).Invoke(actualObject, new object[] {newStringValue}), + newStringValue => propertyInfo.GetSetMethod(true).Invoke(actualObject, new object[] { newStringValue }), (string)propertyInfo.GetValue(actualObject), attribute.labelName); } diff --git a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/Texture2DArrayPropertyDrawer.cs b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/Texture2DArrayPropertyDrawer.cs index d6cf498b952..75cd5369761 100644 --- a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/Texture2DArrayPropertyDrawer.cs +++ b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/Texture2DArrayPropertyDrawer.cs @@ -19,7 +19,7 @@ internal VisualElement CreateGUI( out VisualElement propertyColorField, int indentLevel = 0) { - var objectField = new ObjectField { value = fieldToDraw, objectType = typeof(Texture2DArray)}; + var objectField = new ObjectField { value = fieldToDraw, objectType = typeof(Texture2DArray) }; if (valueChangedCallback != null) { @@ -40,7 +40,7 @@ public VisualElement DrawProperty(PropertyInfo propertyInfo, object actualObject { return this.CreateGUI( // Use the setter from the provided property as the callback - newValue => propertyInfo.GetSetMethod(true).Invoke(actualObject, new object[] {newValue}), + newValue => propertyInfo.GetSetMethod(true).Invoke(actualObject, new object[] { newValue }), (Texture2DArray)propertyInfo.GetValue(actualObject), attribute.labelName, out var propertyVisualElement); diff --git a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/Texture2DPropertyDrawer.cs b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/Texture2DPropertyDrawer.cs index 79e0a841860..27c12373e22 100644 --- a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/Texture2DPropertyDrawer.cs +++ b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/Texture2DPropertyDrawer.cs @@ -19,7 +19,7 @@ internal VisualElement CreateGUI( out VisualElement propertyColorField, int indentLevel = 0) { - var objectField = new ObjectField { value = fieldToDraw, objectType = typeof(Texture)}; + var objectField = new ObjectField { value = fieldToDraw, objectType = typeof(Texture) }; if (valueChangedCallback != null) { @@ -40,7 +40,7 @@ public VisualElement DrawProperty(PropertyInfo propertyInfo, object actualObject { return this.CreateGUI( // Use the setter from the provided property as the callback - newValue => propertyInfo.GetSetMethod(true).Invoke(actualObject, new object[] {newValue}), + newValue => propertyInfo.GetSetMethod(true).Invoke(actualObject, new object[] { newValue }), (Texture)propertyInfo.GetValue(actualObject), attribute.labelName, out var propertyVisualElement); diff --git a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/Texture3DPropertyDrawer.cs b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/Texture3DPropertyDrawer.cs index 922086d9bfa..ea2bb0cbb3f 100644 --- a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/Texture3DPropertyDrawer.cs +++ b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/Texture3DPropertyDrawer.cs @@ -19,7 +19,7 @@ internal VisualElement CreateGUI( out VisualElement propertyColorField, int indentLevel = 0) { - var objectField = new ObjectField { value = fieldToDraw, objectType = typeof(Texture3D)}; + var objectField = new ObjectField { value = fieldToDraw, objectType = typeof(Texture3D) }; if (valueChangedCallback != null) { @@ -40,7 +40,7 @@ public VisualElement DrawProperty(PropertyInfo propertyInfo, object actualObject { return this.CreateGUI( // Use the setter from the provided property as the callback - newValue => propertyInfo.GetSetMethod(true).Invoke(actualObject, new object[] {newValue}), + newValue => propertyInfo.GetSetMethod(true).Invoke(actualObject, new object[] { newValue }), (Texture3D)propertyInfo.GetValue(actualObject), attribute.labelName, out var propertyVisualElement); diff --git a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/ToggleDataPropertyDrawer.cs b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/ToggleDataPropertyDrawer.cs index 9512a370fcc..fd8a7e2871c 100644 --- a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/ToggleDataPropertyDrawer.cs +++ b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/ToggleDataPropertyDrawer.cs @@ -47,7 +47,7 @@ public VisualElement DrawProperty( { return this.CreateGUI( // Use the setter from the provided property as the callback - newBoolValue => propertyInfo.GetSetMethod(true).Invoke(actualObject, new object[] {newBoolValue}), + newBoolValue => propertyInfo.GetSetMethod(true).Invoke(actualObject, new object[] { newBoolValue }), (ToggleData)propertyInfo.GetValue(actualObject), attribute.labelName, out var propertyVisualElement); diff --git a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/Vector2PropertyDrawer.cs b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/Vector2PropertyDrawer.cs index 008f0901f37..2e2b19094d7 100644 --- a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/Vector2PropertyDrawer.cs +++ b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/Vector2PropertyDrawer.cs @@ -61,7 +61,7 @@ internal VisualElement CreateGUI( out VisualElement propertyVec2Field, int indentLevel = 0) { - var vector2Field = new Vector2Field {value = fieldToDraw}; + var vector2Field = new Vector2Field { value = fieldToDraw }; var inputFields = vector2Field.Query("unity-text-input").ToList(); foreach (var inputField in inputFields) @@ -95,7 +95,7 @@ public VisualElement DrawProperty(PropertyInfo propertyInfo, object actualObject { return this.CreateGUI( // Use the setter from the provided property as the callback - newValue => propertyInfo.GetSetMethod(true).Invoke(actualObject, new object[] {newValue}), + newValue => propertyInfo.GetSetMethod(true).Invoke(actualObject, new object[] { newValue }), (Vector2)propertyInfo.GetValue(actualObject), attribute.labelName, out var propertyVisualElement); diff --git a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/Vector3PropertyDrawer.cs b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/Vector3PropertyDrawer.cs index 8fccd632d2c..e13b5509f8d 100644 --- a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/Vector3PropertyDrawer.cs +++ b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/Vector3PropertyDrawer.cs @@ -62,7 +62,7 @@ internal VisualElement CreateGUI( out VisualElement propertyVec3Field, int indentLevel = 0) { - var vector3Field = new Vector3Field {value = fieldToDraw}; + var vector3Field = new Vector3Field { value = fieldToDraw }; var inputFields = vector3Field.Query("unity-text-input").ToList(); foreach (var inputField in inputFields) @@ -96,7 +96,7 @@ public VisualElement DrawProperty(PropertyInfo propertyInfo, object actualObject { return this.CreateGUI( // Use the setter from the provided property as the callback - newValue => propertyInfo.GetSetMethod(true).Invoke(actualObject, new object[] {newValue}), + newValue => propertyInfo.GetSetMethod(true).Invoke(actualObject, new object[] { newValue }), (Vector3)propertyInfo.GetValue(actualObject), attribute.labelName, out var propertyVisualElement); diff --git a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/Vector4PropertyDrawer.cs b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/Vector4PropertyDrawer.cs index 322b1ecbfe3..480785967b0 100644 --- a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/Vector4PropertyDrawer.cs +++ b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/Vector4PropertyDrawer.cs @@ -61,7 +61,7 @@ internal VisualElement CreateGUI( out VisualElement propertyVec4Field, int indentLevel = 0) { - var vector4Field = new Vector4Field {value = fieldToDraw}; + var vector4Field = new Vector4Field { value = fieldToDraw }; var inputFields = vector4Field.Query("unity-text-input").ToList(); foreach (var inputField in inputFields) @@ -95,7 +95,7 @@ public VisualElement DrawProperty(PropertyInfo propertyInfo, object actualObject { return this.CreateGUI( // Use the setter from the provided property as the callback - newValue => propertyInfo.GetSetMethod(true).Invoke(actualObject, new object[] {newValue}), + newValue => propertyInfo.GetSetMethod(true).Invoke(actualObject, new object[] { newValue }), (Vector4)propertyInfo.GetValue(actualObject), attribute.labelName, out var propertyVisualElement); diff --git a/com.unity.shadergraph/Editor/Drawing/Inspector/TabbedView/TabButton.cs b/com.unity.shadergraph/Editor/Drawing/Inspector/TabbedView/TabButton.cs index 35e9e8fb5b2..418dc4edd2c 100644 --- a/com.unity.shadergraph/Editor/Drawing/Inspector/TabbedView/TabButton.cs +++ b/com.unity.shadergraph/Editor/Drawing/Inspector/TabbedView/TabButton.cs @@ -4,7 +4,7 @@ public class TabButton : VisualElement { - internal new class UxmlFactory : UxmlFactory {} + internal new class UxmlFactory : UxmlFactory { } internal new class UxmlTraits : VisualElement.UxmlTraits { diff --git a/com.unity.shadergraph/Editor/Drawing/Inspector/TabbedView/TabbedView.cs b/com.unity.shadergraph/Editor/Drawing/Inspector/TabbedView/TabbedView.cs index d79e941a73f..6ec28ae8117 100644 --- a/com.unity.shadergraph/Editor/Drawing/Inspector/TabbedView/TabbedView.cs +++ b/com.unity.shadergraph/Editor/Drawing/Inspector/TabbedView/TabbedView.cs @@ -5,7 +5,7 @@ public class TabbedView : VisualElement { - public new class UxmlFactory : UxmlFactory {} + public new class UxmlFactory : UxmlFactory { } private const string k_styleName = "TabbedView"; private const string s_UssClassName = "unity-tabbed-view"; diff --git a/com.unity.shadergraph/Editor/Drawing/Inspector/WindowDockingLayout.cs b/com.unity.shadergraph/Editor/Drawing/Inspector/WindowDockingLayout.cs index 636434a6c2a..2aa508502a5 100644 --- a/com.unity.shadergraph/Editor/Drawing/Inspector/WindowDockingLayout.cs +++ b/com.unity.shadergraph/Editor/Drawing/Inspector/WindowDockingLayout.cs @@ -113,7 +113,7 @@ public void ApplyPosition(VisualElement target) } } - public void ApplySize(VisualElement target) + public void ApplySize(VisualElement target) { target.style.width = size.x; target.style.height = size.y; diff --git a/com.unity.shadergraph/Editor/Drawing/MaterialGraphEditWindow.cs b/com.unity.shadergraph/Editor/Drawing/MaterialGraphEditWindow.cs index 00318ec96b1..fa5edf410de 100644 --- a/com.unity.shadergraph/Editor/Drawing/MaterialGraphEditWindow.cs +++ b/com.unity.shadergraph/Editor/Drawing/MaterialGraphEditWindow.cs @@ -703,7 +703,7 @@ public void ToSubGraph() if (deserialized == null) return; - var subGraph = new GraphData {isSubGraph = true, path = "Sub Graphs"}; + var subGraph = new GraphData { isSubGraph = true, path = "Sub Graphs" }; var subGraphOutputNode = new SubGraphOutputNode(); { var drawState = subGraphOutputNode.drawState; @@ -1012,8 +1012,8 @@ public void ToSubGraph() graphObject.graph.RemoveElements( graphView.selection.OfType().Select(x => x.node).Where(x => !(x is PropertyNode || x is SubGraphOutputNode) && x.allowedInSubGraph).ToArray(), - new IEdge[] {}, - new GroupData[] {}, + new IEdge[] { }, + new GroupData[] { }, graphView.selection.OfType().Select(x => x.userData).ToArray()); List moved = new List(); @@ -1135,7 +1135,9 @@ public void Initialize(string assetGuid) graphObject.hideFlags = HideFlags.HideAndDontSave; graphObject.graph = new GraphData { - assetGuid = assetGuid, isSubGraph = isSubGraph, messageManager = messageManager + assetGuid = assetGuid, + isSubGraph = isSubGraph, + messageManager = messageManager }; MultiJson.Deserialize(graphObject.graph, m_LastSerializedFileContents); graphObject.graph.OnEnable(); diff --git a/com.unity.shadergraph/Editor/Drawing/PreviewManager.cs b/com.unity.shadergraph/Editor/Drawing/PreviewManager.cs index d3a7971f73b..dc6c4d689fa 100644 --- a/com.unity.shadergraph/Editor/Drawing/PreviewManager.cs +++ b/com.unity.shadergraph/Editor/Drawing/PreviewManager.cs @@ -107,9 +107,9 @@ void AddMasterPreview() previewName = "Master Preview", renderTexture = new RenderTexture(400, 400, 16, RenderTextureFormat.ARGB32, RenderTextureReadWrite.Default) - { - hideFlags = HideFlags.HideAndDontSave - }, + { + hideFlags = HideFlags.HideAndDontSave + }, previewMode = PreviewMode.Preview3D, }; @@ -169,9 +169,9 @@ void AddPreview(AbstractMaterialNode node) previewName = node.name ?? "UNNAMED NODE", renderTexture = new RenderTexture(200, 200, 16, RenderTextureFormat.ARGB32, RenderTextureReadWrite.Default) - { - hideFlags = HideFlags.HideAndDontSave - } + { + hideFlags = HideFlags.HideAndDontSave + } }; renderData.renderTexture.Create(); diff --git a/com.unity.shadergraph/Editor/Drawing/Views/GraphEditorView.cs b/com.unity.shadergraph/Editor/Drawing/Views/GraphEditorView.cs index f8972884350..64a39258586 100644 --- a/com.unity.shadergraph/Editor/Drawing/Views/GraphEditorView.cs +++ b/com.unity.shadergraph/Editor/Drawing/Views/GraphEditorView.cs @@ -375,7 +375,7 @@ void UnregisterGraphViewCallbacks() void CreateMasterPreview() { - m_MasterPreviewView = new MasterPreviewView(previewManager, m_Graph) {name = "masterPreview"}; + m_MasterPreviewView = new MasterPreviewView(previewManager, m_Graph) { name = "masterPreview" }; var masterPreviewViewDraggable = new WindowDraggable(null, this); m_MasterPreviewView.AddManipulator(masterPreviewViewDraggable); @@ -902,14 +902,14 @@ void AddNode(AbstractMaterialNode node, bool usePrebuiltVisualGroupMap = false) } else if (node is RedirectNodeData redirectNodeData) { - var redirectNodeView = new RedirectNodeView {userData = redirectNodeData}; + var redirectNodeView = new RedirectNodeView { userData = redirectNodeData }; m_GraphView.AddElement(redirectNodeView); redirectNodeView.ConnectToData(materialNode, m_EdgeConnectorListener); nodeView = redirectNodeView; } else { - var materialNodeView = new MaterialNodeView {userData = materialNode}; + var materialNodeView = new MaterialNodeView { userData = materialNode }; m_GraphView.AddElement(materialNodeView); materialNodeView.Initialize(materialNode, m_PreviewManager, m_EdgeConnectorListener, graphView); m_ColorManager.UpdateNodeView(materialNodeView); diff --git a/com.unity.shadergraph/Editor/Drawing/Views/GraphSubWindow.cs b/com.unity.shadergraph/Editor/Drawing/Views/GraphSubWindow.cs index b509704b2bf..7d5a0511d54 100644 --- a/com.unity.shadergraph/Editor/Drawing/Views/GraphSubWindow.cs +++ b/com.unity.shadergraph/Editor/Drawing/Views/GraphSubWindow.cs @@ -161,7 +161,7 @@ protected float scrollableWidth protected float scrollableHeight { - get { return contentContainer.layout.height - m_ScrollView.contentViewport.layout.height; } + get { return contentContainer.layout.height - m_ScrollView.contentViewport.layout.height; } } void HandleScrollingBehavior(bool scrollable) @@ -309,7 +309,7 @@ public void DeserializeLayout() protected void AddStyleSheetFromPath(string styleSheetPath) { - StyleSheet sheetAsset = Resources.Load(styleSheetPath);; + StyleSheet sheetAsset = Resources.Load(styleSheetPath); ; if (sheetAsset == null) { diff --git a/com.unity.shadergraph/Editor/Drawing/Views/HelpBoxRow.cs b/com.unity.shadergraph/Editor/Drawing/Views/HelpBoxRow.cs index f883a64d513..3e537ed0979 100644 --- a/com.unity.shadergraph/Editor/Drawing/Views/HelpBoxRow.cs +++ b/com.unity.shadergraph/Editor/Drawing/Views/HelpBoxRow.cs @@ -19,9 +19,9 @@ public override VisualElement contentContainer public HelpBoxRow(MessageType type) { styleSheets.Add(Resources.Load("Styles/HelpBoxRow")); - VisualElement container = new VisualElement {name = "container"}; - m_ContentContainer = new VisualElement { name = "content" }; - m_LabelContainer = new VisualElement {name = "label" }; + VisualElement container = new VisualElement { name = "container" }; + m_ContentContainer = new VisualElement { name = "content" }; + m_LabelContainer = new VisualElement { name = "label" }; switch (type) { @@ -52,7 +52,7 @@ public static VisualElement TryGetDeprecatedHelpBoxRow(string deprecatedTypeName string depString = $"The {deprecatedTypeName} has new updates. This version maintains the old behavior. " + $"If you update a {deprecatedTypeName}, you can use Undo to change it back. See the {deprecatedTypeName} " + $"documentation for more information."; - Button upgradeButton = new Button(upgradeAction) { text = "Update" , tooltip = depString}; + Button upgradeButton = new Button(upgradeAction) { text = "Update", tooltip = depString }; if (!ShaderGraphPreferences.allowDeprecatedBehaviors) { HelpBoxRow help = new HelpBoxRow(MessageType.Warning); diff --git a/com.unity.shadergraph/Editor/Drawing/Views/HlslFunctionView.cs b/com.unity.shadergraph/Editor/Drawing/Views/HlslFunctionView.cs index c17484ed045..05c42304fa4 100644 --- a/com.unity.shadergraph/Editor/Drawing/Views/HlslFunctionView.cs +++ b/com.unity.shadergraph/Editor/Drawing/Views/HlslFunctionView.cs @@ -65,7 +65,7 @@ private void Draw(CustomFunctionNode node) }); string path = AssetDatabase.GUIDToAssetPath(node.functionSource); - m_FunctionSource = new ObjectField() { value = AssetDatabase.LoadAssetAtPath(path), objectType = typeof(TextAsset)}; + m_FunctionSource = new ObjectField() { value = AssetDatabase.LoadAssetAtPath(path), objectType = typeof(TextAsset) }; m_FunctionSource.RegisterValueChangedCallback(s => { long localId; @@ -92,7 +92,7 @@ private void Draw(CustomFunctionNode node) }); m_FunctionBody.RegisterCallback(s => { - if (m_FunctionBody.value == "") + if (m_FunctionBody.value == "") m_FunctionBody.value = CustomFunctionNode.defaultFunctionBody; if (m_FunctionBody.value != node.functionBody) diff --git a/com.unity.shadergraph/Editor/Drawing/Views/IdentifierField.cs b/com.unity.shadergraph/Editor/Drawing/Views/IdentifierField.cs index f0945829ce8..e5a80f2b2fb 100644 --- a/com.unity.shadergraph/Editor/Drawing/Views/IdentifierField.cs +++ b/com.unity.shadergraph/Editor/Drawing/Views/IdentifierField.cs @@ -13,8 +13,8 @@ public class IdentifierField : UIElements.TextValueField { IdentifierInput tsInput => (IdentifierInput)textInputBase; - public new class UxmlFactory : UxmlFactory {} - public new class UxmlTraits : UIElements.TextValueFieldTraits {} + public new class UxmlFactory : UxmlFactory { } + public new class UxmlTraits : UIElements.TextValueFieldTraits { } protected override string ValueToString(string v) { @@ -43,7 +43,7 @@ protected override string StringToValue(string str) public new static readonly string labelUssClassName = ussClassName + "__label"; public new static readonly string inputUssClassName = ussClassName + "__input"; - public IdentifierField() : this((string)null) {} + public IdentifierField() : this((string)null) { } public IdentifierField(string label) : base(label, -1, new IdentifierInput()) { diff --git a/com.unity.shadergraph/Editor/Drawing/Views/MaterialGraphView.cs b/com.unity.shadergraph/Editor/Drawing/Views/MaterialGraphView.cs index b272d41c570..d4e16b8d898 100644 --- a/com.unity.shadergraph/Editor/Drawing/Views/MaterialGraphView.cs +++ b/com.unity.shadergraph/Editor/Drawing/Views/MaterialGraphView.cs @@ -457,7 +457,7 @@ private void RemoveNodesInsideGroup(DropdownMenuAction action, GroupData data) { graph.owner.RegisterCompleteObjectUndo("Delete Group and Contents"); var groupItems = graph.GetItemsInGroup(data); - graph.RemoveElements(groupItems.OfType().ToArray(), new IEdge[] {}, new[] {data}, groupItems.OfType().ToArray()); + graph.RemoveElements(groupItems.OfType().ToArray(), new IEdge[] { }, new[] { data }, groupItems.OfType().ToArray()); } private void InitializePrecisionSubMenu(ContextualMenuPopulateEvent evt) @@ -537,7 +537,7 @@ void ChangeCustomNodeColor(DropdownMenuAction menuAction) { // Color Picker is internal :( var t = typeof(EditorWindow).Assembly.GetTypes().FirstOrDefault(ty => ty.Name == "ColorPicker"); - var m = t?.GetMethod("Show", new[] {typeof(Action), typeof(Color), typeof(bool), typeof(bool)}); + var m = t?.GetMethod("Show", new[] { typeof(Action), typeof(Color), typeof(bool), typeof(bool) }); if (m == null) { Debug.LogWarning("Could not invoke Color Picker for ShaderGraph."); @@ -565,7 +565,7 @@ void ApplyColor(Color pickedColor) } graph.owner.RegisterCompleteObjectUndo("Change Node Color"); - m.Invoke(null, new object[] {(Action)ApplyColor, defaultColor, true, false}); + m.Invoke(null, new object[] { (Action)ApplyColor, defaultColor, true, false }); } protected override bool canDeleteSelection @@ -598,7 +598,7 @@ public void AddStickyNote(Vector2 position) position = contentViewContainer.WorldToLocal(position); string title = "New Note"; string content = "Write something here"; - var stickyNoteData = new StickyNoteData(title, content, new Rect(position.x, position.y, 200, 160)); + var stickyNoteData = new StickyNoteData(title, content, new Rect(position.x, position.y, 200, 160)); graph.owner.RegisterCompleteObjectUndo("Create Sticky Note"); graph.AddStickyNote(stickyNoteData); } @@ -955,7 +955,7 @@ public static List GetIndicesToInsert(SGBlackboard blackboard, int numberOf continue; int rowAfterIndex = section.IndexOf(row) + 1; - if (rowAfterIndex > indexPerSection[sectionIndex]) + if (rowAfterIndex > indexPerSection[sectionIndex]) { indexPerSection[sectionIndex] = rowAfterIndex; } @@ -1161,7 +1161,7 @@ void CreateNode(object obj, Vector2 nodePosition) var node = new PropertyNode(); var drawState = node.drawState; - drawState.position = new Rect(nodePosition, drawState.position.size); + drawState.position = new Rect(nodePosition, drawState.position.size); node.drawState = drawState; graph.AddNode(node); @@ -1179,7 +1179,7 @@ void CreateNode(object obj, Vector2 nodePosition) var node = new KeywordNode(); var drawState = node.drawState; - drawState.position = new Rect(nodePosition, drawState.position.size); + drawState.position = new Rect(nodePosition, drawState.position.size); node.drawState = drawState; graph.AddNode(node); diff --git a/com.unity.shadergraph/Editor/Drawing/Views/PropertyRow.cs b/com.unity.shadergraph/Editor/Drawing/Views/PropertyRow.cs index 28aeb2d2af0..2e32899e38e 100644 --- a/com.unity.shadergraph/Editor/Drawing/Views/PropertyRow.cs +++ b/com.unity.shadergraph/Editor/Drawing/Views/PropertyRow.cs @@ -30,9 +30,9 @@ public VisualElement label public PropertyRow(VisualElement label = null) { styleSheets.Add(Resources.Load("Styles/PropertyRow")); - VisualElement container = new VisualElement {name = "container"}; - m_ContentContainer = new VisualElement { name = "content" }; - m_LabelContainer = new VisualElement {name = "label" }; + VisualElement container = new VisualElement { name = "container" }; + m_ContentContainer = new VisualElement { name = "content" }; + m_LabelContainer = new VisualElement { name = "label" }; m_LabelContainer.Add(label); container.Add(m_LabelContainer); diff --git a/com.unity.shadergraph/Editor/Drawing/Views/PropertySheet.cs b/com.unity.shadergraph/Editor/Drawing/Views/PropertySheet.cs index f98f4724eaf..143a5708e17 100644 --- a/com.unity.shadergraph/Editor/Drawing/Views/PropertySheet.cs +++ b/com.unity.shadergraph/Editor/Drawing/Views/PropertySheet.cs @@ -35,7 +35,7 @@ public PropertySheet(Label header = null) styleSheets.Add(Resources.Load("Styles/PropertySheet")); m_ContentContainer = new VisualElement { name = "content" }; m_HeaderContainer = new VisualElement { name = "header" }; - m_WarningContainer = new VisualElement {name = "error"}; + m_WarningContainer = new VisualElement { name = "error" }; m_WarningContainer.Add(new Label("")); if (header != null) m_HeaderContainer.Add(header); diff --git a/com.unity.shadergraph/Editor/Drawing/Views/ReorderableSlotListView.cs b/com.unity.shadergraph/Editor/Drawing/Views/ReorderableSlotListView.cs index 5555f672ec1..0b8a0c632a3 100644 --- a/com.unity.shadergraph/Editor/Drawing/Views/ReorderableSlotListView.cs +++ b/com.unity.shadergraph/Editor/Drawing/Views/ReorderableSlotListView.cs @@ -19,7 +19,7 @@ internal class ReorderableSlotListView : VisualElement bool m_AllowBareResources; internal delegate void ListRecreatedDelegate(); - ListRecreatedDelegate m_OnListRecreatedCallback = new ListRecreatedDelegate(() => {}); + ListRecreatedDelegate m_OnListRecreatedCallback = new ListRecreatedDelegate(() => { }); string label => string.Format("{0}s", m_SlotType.ToString()); diff --git a/com.unity.shadergraph/Editor/Drawing/Views/ReorderableTextListView.cs b/com.unity.shadergraph/Editor/Drawing/Views/ReorderableTextListView.cs index ec1ea103249..3f41d6762d0 100644 --- a/com.unity.shadergraph/Editor/Drawing/Views/ReorderableTextListView.cs +++ b/com.unity.shadergraph/Editor/Drawing/Views/ReorderableTextListView.cs @@ -63,7 +63,7 @@ internal ReorderableListView( // should we set up a new style sheet? allow user overrides? styleSheets.Add(Resources.Load("Styles/ReorderableSlotListView")); - m_Container = new IMGUIContainer(() => OnGUIHandler()) {name = "ListContainer"}; + m_Container = new IMGUIContainer(() => OnGUIHandler()) { name = "ListContainer" }; Add(m_Container); } diff --git a/com.unity.shadergraph/Editor/Drawing/Views/ResizableElement.cs b/com.unity.shadergraph/Editor/Drawing/Views/ResizableElement.cs index 124e04ef753..baf31ee309e 100644 --- a/com.unity.shadergraph/Editor/Drawing/Views/ResizableElement.cs +++ b/com.unity.shadergraph/Editor/Drawing/Views/ResizableElement.cs @@ -6,7 +6,7 @@ namespace UnityEditor.ShaderGraph.Drawing { class ResizableElementFactory : UxmlFactory - {} + { } class ResizableElement : VisualElement { @@ -26,7 +26,7 @@ public ResizableElement(string uiFile) tpl.CloneTree(this); - foreach (Resizer direction in new[] {Resizer.Top, Resizer.Bottom, Resizer.Left, Resizer.Right}) + foreach (Resizer direction in new[] { Resizer.Top, Resizer.Bottom, Resizer.Left, Resizer.Right }) { VisualElement resizer = this.Q(direction.ToString().ToLower() + "-resize"); if (resizer != null) @@ -38,8 +38,8 @@ public ResizableElement(string uiFile) m_Resizers[direction] = resizer; } - foreach (Resizer vertical in new[] {Resizer.Top, Resizer.Bottom}) - foreach (Resizer horizontal in new[] {Resizer.Left, Resizer.Right}) + foreach (Resizer vertical in new[] { Resizer.Top, Resizer.Bottom }) + foreach (Resizer horizontal in new[] { Resizer.Left, Resizer.Right }) { VisualElement resizer = this.Q(vertical.ToString().ToLower() + "-" + horizontal.ToString().ToLower() + "-resize"); if (resizer != null) @@ -73,11 +73,11 @@ public void SetResizeRules(Resizer allowedResizeDirections) public enum Resizer { - None = 0, - Top = 1 << 0, - Bottom = 1 << 1, - Left = 1 << 2, - Right = 1 << 3, + None = 0, + Top = 1 << 0, + Bottom = 1 << 1, + Left = 1 << 2, + Right = 1 << 3, } // Lets visual element owners bind a callback to when any resize operation is completed diff --git a/com.unity.shadergraph/Editor/Drawing/Views/Slots/ColorRGBSlotControlView.cs b/com.unity.shadergraph/Editor/Drawing/Views/Slots/ColorRGBSlotControlView.cs index b889cf0dbe3..65a6049a255 100644 --- a/com.unity.shadergraph/Editor/Drawing/Views/Slots/ColorRGBSlotControlView.cs +++ b/com.unity.shadergraph/Editor/Drawing/Views/Slots/ColorRGBSlotControlView.cs @@ -18,7 +18,9 @@ public ColorRGBSlotControlView(ColorRGBMaterialSlot slot) var colorField = new ColorField { value = new Color(slot.value.x, slot.value.y, slot.value.z, 0), - showEyeDropper = false, showAlpha = false, hdr = (slot.colorMode == ColorMode.HDR) + showEyeDropper = false, + showAlpha = false, + hdr = (slot.colorMode == ColorMode.HDR) }; colorField.RegisterValueChangedCallback(OnValueChanged); Add(colorField); diff --git a/com.unity.shadergraph/Editor/Drawing/Views/Slots/GradientSlotControlView.cs b/com.unity.shadergraph/Editor/Drawing/Views/Slots/GradientSlotControlView.cs index 525734017b8..dc6b15dd850 100644 --- a/com.unity.shadergraph/Editor/Drawing/Views/Slots/GradientSlotControlView.cs +++ b/com.unity.shadergraph/Editor/Drawing/Views/Slots/GradientSlotControlView.cs @@ -33,7 +33,7 @@ public GradientSlotControlView(GradientInputMaterialSlot slot) m_GradientObject.gradient.SetKeys(m_Slot.value.colorKeys, m_Slot.value.alphaKeys); m_GradientObject.gradient.mode = m_Slot.value.mode; - var gradientField = new GradientField() { value = m_GradientObject.gradient , colorSpace = ColorSpace.Linear}; + var gradientField = new GradientField() { value = m_GradientObject.gradient, colorSpace = ColorSpace.Linear }; gradientField.RegisterValueChangedCallback(OnValueChanged); Add(gradientField); } diff --git a/com.unity.shadergraph/Editor/Drawing/Views/StickyNote.cs b/com.unity.shadergraph/Editor/Drawing/Views/StickyNote.cs index 861a0c6f758..de176ea7622 100644 --- a/com.unity.shadergraph/Editor/Drawing/Views/StickyNote.cs +++ b/com.unity.shadergraph/Editor/Drawing/Views/StickyNote.cs @@ -24,7 +24,7 @@ public enum Change textSize, } - public Change change {get; protected set; } + public Change change { get; protected set; } } class StickyNote : GraphElement, ISGResizable @@ -77,7 +77,7 @@ public enum TextSize public TextSize textSize { - get {return m_TextSize; } + get { return m_TextSize; } set { if (m_TextSize != value) @@ -272,7 +272,7 @@ public void BuildContextualMenu(ContextualMenuPopulateEvent evt) evt.menu.AppendAction("Fit To Text", OnFitToText, e => DropdownMenuAction.Status.Normal); evt.menu.AppendSeparator(); - evt.menu.AppendAction("Delete", OnDelete, e => DropdownMenuAction.Status.Normal); + evt.menu.AppendAction("Delete", OnDelete, e => DropdownMenuAction.Status.Normal); evt.menu.AppendSeparator(); } } @@ -313,7 +313,7 @@ public override Rect GetPosition() public string contents { - get {return m_Contents.text; } + get { return m_Contents.text; } set { if (m_Contents != null) @@ -324,7 +324,7 @@ public string contents } public new string title { - get {return m_Title.text; } + get { return m_Title.text; } set { if (m_Title != null) diff --git a/com.unity.shadergraph/Editor/Generation/Collections/AssetCollection.cs b/com.unity.shadergraph/Editor/Generation/Collections/AssetCollection.cs index ed09e1f5526..e91f098c496 100644 --- a/com.unity.shadergraph/Editor/Generation/Collections/AssetCollection.cs +++ b/com.unity.shadergraph/Editor/Generation/Collections/AssetCollection.cs @@ -13,10 +13,10 @@ internal class AssetCollection [Flags] public enum Flags { - SourceDependency = 1 << 0, // ShaderGraph directly reads the source file in the Assets directory - ArtifactDependency = 1 << 1, // ShaderGraph reads the import result artifact (i.e. subgraph import) - IsSubGraph = 1 << 2, // This asset is a SubGraph (used when we need to get multiple levels of dependencies) - IncludeInExportPackage = 1 << 3 // This asset should be pulled into any .unitypackages built via "Export Package.." + SourceDependency = 1 << 0, // ShaderGraph directly reads the source file in the Assets directory + ArtifactDependency = 1 << 1, // ShaderGraph reads the import result artifact (i.e. subgraph import) + IsSubGraph = 1 << 2, // This asset is a SubGraph (used when we need to get multiple levels of dependencies) + IncludeInExportPackage = 1 << 3 // This asset should be pulled into any .unitypackages built via "Export Package.." } internal Dictionary assets = new Dictionary(); diff --git a/com.unity.shadergraph/Editor/Generation/Contexts/TargetPropertyGUIContext.cs b/com.unity.shadergraph/Editor/Generation/Contexts/TargetPropertyGUIContext.cs index 094dda1138b..c6f0d0bf606 100644 --- a/com.unity.shadergraph/Editor/Generation/Contexts/TargetPropertyGUIContext.cs +++ b/com.unity.shadergraph/Editor/Generation/Contexts/TargetPropertyGUIContext.cs @@ -12,7 +12,7 @@ internal class TargetPropertyGUIContext : VisualElement { const int kIndentWidthInPixel = 15; - public int globalIndentLevel {get; set;} = 0; + public int globalIndentLevel { get; set; } = 0; public TargetPropertyGUIContext() { diff --git a/com.unity.shadergraph/Editor/Generation/Data/KeywordEntry.cs b/com.unity.shadergraph/Editor/Generation/Data/KeywordEntry.cs index bfa489b69bf..41bc0e3787e 100644 --- a/com.unity.shadergraph/Editor/Generation/Data/KeywordEntry.cs +++ b/com.unity.shadergraph/Editor/Generation/Data/KeywordEntry.cs @@ -2,7 +2,8 @@ namespace UnityEditor.ShaderGraph { - [Serializable][GenerationAPI] + [Serializable] + [GenerationAPI] internal struct KeywordEntry { public int id; // Used to determine what MaterialSlot an entry belongs to diff --git a/com.unity.shadergraph/Editor/Generation/Processors/ActiveFields.cs b/com.unity.shadergraph/Editor/Generation/Processors/ActiveFields.cs index 262fc1f9a3e..9b824712c65 100644 --- a/com.unity.shadergraph/Editor/Generation/Processors/ActiveFields.cs +++ b/com.unity.shadergraph/Editor/Generation/Processors/ActiveFields.cs @@ -65,7 +65,7 @@ public struct Base : IActiveFields, IActiveFieldsSet public IEnumerable fields => m_Source.baseStorage; public int instanceCount => 1; - public int permutationIndex => - 1; + public int permutationIndex => -1; public KeywordDependentCollection.KeywordPermutationInstanceType type => KeywordDependentCollection.KeywordPermutationInstanceType.Base; public IEnumerable instances => Enumerable.Repeat(this, 1); @@ -142,7 +142,7 @@ public struct NoPermutation : IActiveFields, IActiveFieldsSet public IEnumerable fields => m_Source.baseStorage; public int instanceCount => 1; - public int permutationIndex => - 1; + public int permutationIndex => -1; public KeywordDependentCollection.KeywordPermutationInstanceType type => KeywordDependentCollection.KeywordPermutationInstanceType.Base; internal NoPermutation(ActiveFields source) diff --git a/com.unity.shadergraph/Editor/Generation/Processors/GenerationUtils.cs b/com.unity.shadergraph/Editor/Generation/Processors/GenerationUtils.cs index dae94afd5fe..dd30242f78c 100644 --- a/com.unity.shadergraph/Editor/Generation/Processors/GenerationUtils.cs +++ b/com.unity.shadergraph/Editor/Generation/Processors/GenerationUtils.cs @@ -117,9 +117,12 @@ internal static void GenerateShaderStruct(StructDescriptor shaderStruct, ActiveF internal static void GeneratePackedStruct(StructDescriptor shaderStruct, ActiveFields activeFields, out StructDescriptor packStruct) { - packStruct = new StructDescriptor() { - name = "Packed" + shaderStruct.name, packFields = true, - fields = new FieldDescriptor[] {} }; + packStruct = new StructDescriptor() + { + name = "Packed" + shaderStruct.name, + packFields = true, + fields = new FieldDescriptor[] { } + }; List packedSubscripts = new List(); List packedCounts = new List(); @@ -266,7 +269,7 @@ internal static void GetUpstreamNodesForShaderPass(AbstractMaterialNode outputNo } internal static void GetActiveFieldsAndPermutationsForNodes(PassDescriptor pass, - KeywordCollector keywordCollector, List vertexNodes, List pixelNodes, + KeywordCollector keywordCollector, List vertexNodes, List pixelNodes, List[] vertexNodePermutations, List[] pixelNodePermutations, ActiveFields activeFields, out ShaderGraphRequirementsPerKeyword graphRequirements) { diff --git a/com.unity.shadergraph/Editor/Generation/Processors/Generator.cs b/com.unity.shadergraph/Editor/Generation/Processors/Generator.cs index 30f84b9f889..c36e79f81f6 100644 --- a/com.unity.shadergraph/Editor/Generation/Processors/Generator.cs +++ b/com.unity.shadergraph/Editor/Generation/Processors/Generator.cs @@ -775,7 +775,7 @@ void ProcessStackForPass(ContextData contextData, BlockFieldDescriptor[] passBlo // Hybrid Renderer V1 requires some magic defines to work, which we enable // if the shader graph has a nonzero amount of DOTS instanced properties. // This can be removed once Hybrid V1 is removed. - #if !ENABLE_HYBRID_RENDERER_V2 +#if !ENABLE_HYBRID_RENDERER_V2 if (hasDotsProperties) { dotsInstancingOptionsBuilder.AppendLine("#if SHADER_TARGET >= 35 && (defined(SHADER_API_D3D11) || defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE) || defined(SHADER_API_XBOXONE) || defined(SHADER_API_GAMECORE) || defined(SHADER_API_PSSL) || defined(SHADER_API_VULKAN) || defined(SHADER_API_METAL))"); @@ -785,7 +785,7 @@ void ProcessStackForPass(ContextData contextData, BlockFieldDescriptor[] passBlo dotsInstancingOptionsBuilder.AppendLine(" #define UNITY_HYBRID_V1_INSTANCING_ENABLED"); dotsInstancingOptionsBuilder.AppendLine("#endif"); } - #endif +#endif if (dotsInstancingOptionsBuilder.length == 0) dotsInstancingOptionsBuilder.AppendLine("// DotsInstancingOptions: "); diff --git a/com.unity.shadergraph/Editor/Generation/Processors/PropertyCollector.cs b/com.unity.shadergraph/Editor/Generation/Processors/PropertyCollector.cs index df19347f13e..bb4d9966390 100644 --- a/com.unity.shadergraph/Editor/Generation/Processors/PropertyCollector.cs +++ b/com.unity.shadergraph/Editor/Generation/Processors/PropertyCollector.cs @@ -124,7 +124,7 @@ private List BuildHLSLPropertyList() { // check if same property if (!h.ValueEquals(m_HLSLProperties[index])) - Debug.LogError("Two different HLSL Properties declared with the same name: " + h.name + " and " + m_HLSLProperties[index].name); + Debug.LogError("Two different HLSL Properties declared with the same name: " + h.name + " and " + m_HLSLProperties[index].name); return; } dict.Add(h.name, m_HLSLProperties.Count); diff --git a/com.unity.shadergraph/Editor/Generation/Processors/ShaderGeneratorNames.cs b/com.unity.shadergraph/Editor/Generation/Processors/ShaderGeneratorNames.cs index 1960342028f..2b7d4280569 100644 --- a/com.unity.shadergraph/Editor/Generation/Processors/ShaderGeneratorNames.cs +++ b/com.unity.shadergraph/Editor/Generation/Processors/ShaderGeneratorNames.cs @@ -5,7 +5,7 @@ namespace UnityEditor.ShaderGraph { static class ShaderGeneratorNames { - private static string[] UV = {"uv0", "uv1", "uv2", "uv3"}; + private static string[] UV = { "uv0", "uv1", "uv2", "uv3" }; public static int UVCount = 4; public const string ScreenPosition = "ScreenPosition"; diff --git a/com.unity.shadergraph/Editor/Generation/Processors/ShaderStringBuilder.cs b/com.unity.shadergraph/Editor/Generation/Processors/ShaderStringBuilder.cs index a0e3eec3188..6209975d69c 100644 --- a/com.unity.shadergraph/Editor/Generation/Processors/ShaderStringBuilder.cs +++ b/com.unity.shadergraph/Editor/Generation/Processors/ShaderStringBuilder.cs @@ -10,7 +10,7 @@ namespace UnityEditor.ShaderGraph struct ShaderStringMapping { public AbstractMaterialNode node { get; set; } -// public List nodes { get; set; } + // public List nodes { get; set; } public int startIndex { get; set; } public int count { get; set; } } diff --git a/com.unity.shadergraph/Editor/Generation/ShaderGraphVfxAsset.cs b/com.unity.shadergraph/Editor/Generation/ShaderGraphVfxAsset.cs index d352343655f..c2de01b1e51 100644 --- a/com.unity.shadergraph/Editor/Generation/ShaderGraphVfxAsset.cs +++ b/com.unity.shadergraph/Editor/Generation/ShaderGraphVfxAsset.cs @@ -153,7 +153,7 @@ void EnsureProperties() if ((m_Data == null || m_Data.m_Properties == null || !m_Data.m_Properties.Any()) && !String.IsNullOrEmpty(m_SerializedVfxAssetData.JSONnodeData)) { m_Data = new ShaderGraphVfxAssetData(); - MultiJson.Deserialize(m_Data , m_SerializedVfxAssetData.JSONnodeData); + MultiJson.Deserialize(m_Data, m_SerializedVfxAssetData.JSONnodeData); } foreach (var property in m_Data.m_Properties.SelectValue()) @@ -167,7 +167,7 @@ void ISerializationCallbackReceiver.OnAfterDeserialize() m_Data = null; } - void ISerializationCallbackReceiver.OnBeforeSerialize() {} + void ISerializationCallbackReceiver.OnBeforeSerialize() { } public GraphCode GetCode(OutputMetadata[] outputs) { diff --git a/com.unity.shadergraph/Editor/Generation/SubTarget.cs b/com.unity.shadergraph/Editor/Generation/SubTarget.cs index ad8b312c906..d7ee0739266 100644 --- a/com.unity.shadergraph/Editor/Generation/SubTarget.cs +++ b/com.unity.shadergraph/Editor/Generation/SubTarget.cs @@ -19,8 +19,8 @@ internal abstract class SubTarget : JsonObject public abstract void GetActiveBlocks(ref TargetActiveBlockContext context); public abstract void GetPropertiesGUI(ref TargetPropertyGUIContext context, Action onChange, Action registerUndo); - public virtual void CollectShaderProperties(PropertyCollector collector, GenerationMode generationMode) {} - public virtual void ProcessPreviewMaterial(Material material) {} + public virtual void CollectShaderProperties(PropertyCollector collector, GenerationMode generationMode) { } + public virtual void ProcessPreviewMaterial(Material material) { } public virtual object saveContext => null; } diff --git a/com.unity.shadergraph/Editor/Generation/Target.cs b/com.unity.shadergraph/Editor/Generation/Target.cs index 45973eba3b6..4bd93b5c707 100644 --- a/com.unity.shadergraph/Editor/Generation/Target.cs +++ b/com.unity.shadergraph/Editor/Generation/Target.cs @@ -18,8 +18,8 @@ internal abstract class Target : JsonObject public abstract void GetActiveBlocks(ref TargetActiveBlockContext context); public abstract void GetPropertiesGUI(ref TargetPropertyGUIContext context, Action onChange, Action registerUndo); - public virtual void CollectShaderProperties(PropertyCollector collector, GenerationMode generationMode) {} - public virtual void ProcessPreviewMaterial(Material material) {} + public virtual void CollectShaderProperties(PropertyCollector collector, GenerationMode generationMode) { } + public virtual void ProcessPreviewMaterial(Material material) { } public virtual object saveContext => null; public virtual bool IsNodeAllowedByTarget(Type nodeType) { diff --git a/com.unity.shadergraph/Editor/Generation/TargetResources/BlockFields.cs b/com.unity.shadergraph/Editor/Generation/TargetResources/BlockFields.cs index 1b4d7675860..0d3f96d43e3 100644 --- a/com.unity.shadergraph/Editor/Generation/TargetResources/BlockFields.cs +++ b/com.unity.shadergraph/Editor/Generation/TargetResources/BlockFields.cs @@ -9,11 +9,11 @@ internal static class BlockFields public struct VertexDescription { public static string name = "VertexDescription"; - public static BlockFieldDescriptor Position = new BlockFieldDescriptor(VertexDescription.name, "Position", "VERTEXDESCRIPTION_POSITION", + public static BlockFieldDescriptor Position = new BlockFieldDescriptor(VertexDescription.name, "Position", "VERTEXDESCRIPTION_POSITION", new PositionControl(CoordinateSpace.Object), ShaderStage.Vertex); - public static BlockFieldDescriptor Normal = new BlockFieldDescriptor(VertexDescription.name, "Normal", "VERTEXDESCRIPTION_NORMAL", + public static BlockFieldDescriptor Normal = new BlockFieldDescriptor(VertexDescription.name, "Normal", "VERTEXDESCRIPTION_NORMAL", new NormalControl(CoordinateSpace.Object), ShaderStage.Vertex); - public static BlockFieldDescriptor Tangent = new BlockFieldDescriptor(VertexDescription.name, "Tangent", "VERTEXDESCRIPTION_TANGENT", + public static BlockFieldDescriptor Tangent = new BlockFieldDescriptor(VertexDescription.name, "Tangent", "VERTEXDESCRIPTION_TANGENT", new TangentControl(CoordinateSpace.Object), ShaderStage.Vertex); } @@ -21,29 +21,29 @@ public struct VertexDescription public struct SurfaceDescription { public static string name = "SurfaceDescription"; - public static BlockFieldDescriptor BaseColor = new BlockFieldDescriptor(SurfaceDescription.name, "BaseColor", "Base Color", "SURFACEDESCRIPTION_BASECOLOR", + public static BlockFieldDescriptor BaseColor = new BlockFieldDescriptor(SurfaceDescription.name, "BaseColor", "Base Color", "SURFACEDESCRIPTION_BASECOLOR", new ColorControl(UnityEngine.Color.grey, false), ShaderStage.Fragment); - public static BlockFieldDescriptor NormalTS = new BlockFieldDescriptor(SurfaceDescription.name, "NormalTS", "Normal (Tangent Space)", "SURFACEDESCRIPTION_NORMALTS", + public static BlockFieldDescriptor NormalTS = new BlockFieldDescriptor(SurfaceDescription.name, "NormalTS", "Normal (Tangent Space)", "SURFACEDESCRIPTION_NORMALTS", new NormalControl(CoordinateSpace.Tangent), ShaderStage.Fragment); - public static BlockFieldDescriptor NormalOS = new BlockFieldDescriptor(SurfaceDescription.name, "NormalOS", "Normal (Object Space)", "SURFACEDESCRIPTION_NORMALOS", + public static BlockFieldDescriptor NormalOS = new BlockFieldDescriptor(SurfaceDescription.name, "NormalOS", "Normal (Object Space)", "SURFACEDESCRIPTION_NORMALOS", new NormalControl(CoordinateSpace.Object), ShaderStage.Fragment); - public static BlockFieldDescriptor NormalWS = new BlockFieldDescriptor(SurfaceDescription.name, "NormalWS", "Normal (World Space)", "SURFACEDESCRIPTION_NORMALWS", + public static BlockFieldDescriptor NormalWS = new BlockFieldDescriptor(SurfaceDescription.name, "NormalWS", "Normal (World Space)", "SURFACEDESCRIPTION_NORMALWS", new NormalControl(CoordinateSpace.World), ShaderStage.Fragment); - public static BlockFieldDescriptor Metallic = new BlockFieldDescriptor(SurfaceDescription.name, "Metallic", "SURFACEDESCRIPTION_METALLIC", + public static BlockFieldDescriptor Metallic = new BlockFieldDescriptor(SurfaceDescription.name, "Metallic", "SURFACEDESCRIPTION_METALLIC", new FloatControl(0.0f), ShaderStage.Fragment); - public static BlockFieldDescriptor Specular = new BlockFieldDescriptor(SurfaceDescription.name, "Specular", "Specular Color", "SURFACEDESCRIPTION_SPECULAR", + public static BlockFieldDescriptor Specular = new BlockFieldDescriptor(SurfaceDescription.name, "Specular", "Specular Color", "SURFACEDESCRIPTION_SPECULAR", new ColorControl(UnityEngine.Color.grey, false), ShaderStage.Fragment); - public static BlockFieldDescriptor Smoothness = new BlockFieldDescriptor(SurfaceDescription.name, "Smoothness", "SURFACEDESCRIPTION_SMOOTHNESS", + public static BlockFieldDescriptor Smoothness = new BlockFieldDescriptor(SurfaceDescription.name, "Smoothness", "SURFACEDESCRIPTION_SMOOTHNESS", new FloatControl(0.5f), ShaderStage.Fragment); - public static BlockFieldDescriptor Occlusion = new BlockFieldDescriptor(SurfaceDescription.name, "Occlusion", "Ambient Occlusion", "SURFACEDESCRIPTION_OCCLUSION", + public static BlockFieldDescriptor Occlusion = new BlockFieldDescriptor(SurfaceDescription.name, "Occlusion", "Ambient Occlusion", "SURFACEDESCRIPTION_OCCLUSION", new FloatControl(1.0f), ShaderStage.Fragment); - public static BlockFieldDescriptor Emission = new BlockFieldDescriptor(SurfaceDescription.name, "Emission", "SURFACEDESCRIPTION_EMISSION", + public static BlockFieldDescriptor Emission = new BlockFieldDescriptor(SurfaceDescription.name, "Emission", "SURFACEDESCRIPTION_EMISSION", new ColorControl(UnityEngine.Color.black, true), ShaderStage.Fragment); - public static BlockFieldDescriptor Alpha = new BlockFieldDescriptor(SurfaceDescription.name, "Alpha", "SURFACEDESCRIPTION_ALPHA", + public static BlockFieldDescriptor Alpha = new BlockFieldDescriptor(SurfaceDescription.name, "Alpha", "SURFACEDESCRIPTION_ALPHA", new FloatControl(1.0f), ShaderStage.Fragment); public static BlockFieldDescriptor AlphaClipThreshold = new BlockFieldDescriptor(SurfaceDescription.name, "AlphaClipThreshold", "Alpha Clip Threshold", "SURFACEDESCRIPTION_ALPHACLIPTHRESHOLD", new FloatControl(0.5f), ShaderStage.Fragment); - public static BlockFieldDescriptor CoatMask = new BlockFieldDescriptor(SurfaceDescription.name, "CoatMask", "Coat Mask", "SURFACEDESCRIPTION_COATMASK", + public static BlockFieldDescriptor CoatMask = new BlockFieldDescriptor(SurfaceDescription.name, "CoatMask", "Coat Mask", "SURFACEDESCRIPTION_COATMASK", new FloatControl(0.0f), ShaderStage.Fragment); public static BlockFieldDescriptor CoatSmoothness = new BlockFieldDescriptor(SurfaceDescription.name, "CoatSmoothness", "Coat Smoothness", "SURFACEDESCRIPTION_COATSMOOTHNESS", new FloatControl(1.0f), ShaderStage.Fragment); @@ -53,7 +53,7 @@ public struct SurfaceDescription public struct SurfaceDescriptionLegacy { public static string name = "SurfaceDescription"; - public static BlockFieldDescriptor SpriteColor = new BlockFieldDescriptor(SurfaceDescription.name, "SpriteColor", "SURFACEDESCRIPTION_SPRITECOLOR", + public static BlockFieldDescriptor SpriteColor = new BlockFieldDescriptor(SurfaceDescription.name, "SpriteColor", "SURFACEDESCRIPTION_SPRITECOLOR", new ColorRGBAControl(UnityEngine.Color.white), ShaderStage.Fragment, isHidden: true); } } diff --git a/com.unity.shadergraph/Editor/Generation/TargetResources/Fields.cs b/com.unity.shadergraph/Editor/Generation/TargetResources/Fields.cs index abaff406a7b..30c8b5d2bcf 100644 --- a/com.unity.shadergraph/Editor/Generation/TargetResources/Fields.cs +++ b/com.unity.shadergraph/Editor/Generation/TargetResources/Fields.cs @@ -11,15 +11,15 @@ internal static class Fields #region Fields // These are core Fields shared between URP and HDRP etc. - public static FieldDescriptor GraphVertex = new FieldDescriptor(kFeatures, "graphVertex", "FEATURES_GRAPH_VERTEX"); - public static FieldDescriptor GraphPixel = new FieldDescriptor(kFeatures, "graphPixel", "FEATURES_GRAPH_PIXEL"); - public static FieldDescriptor AlphaClip = new FieldDescriptor(string.Empty, "AlphaClip", "_AlphaClip 1"); - public static FieldDescriptor AlphaTest = new FieldDescriptor(string.Empty, "AlphaTest", "_ALPHA_TEST 1"); - public static FieldDescriptor BlendAlpha = new FieldDescriptor(kBlendMode, "Alpha", "_BLENDMODE_ALPHA 1"); // Universal, vfx: HDRP? - public static FieldDescriptor DoubleSided = new FieldDescriptor(string.Empty, "DoubleSided", "_DOUBLE_SIDED 1"); // Universal, duplicated in HD - public static FieldDescriptor IsPreview = new FieldDescriptor(string.Empty, "isPreview", "SHADERGRAPH_PREVIEW"); - public static FieldDescriptor LodCrossFade = new FieldDescriptor(string.Empty, "LodCrossFade", "_LODCROSSFADE 1"); // HD only - public static FieldDescriptor AlphaToMask = new FieldDescriptor(string.Empty, "AlphaToMask", "_ALPHATOMASK_ON 1"); // HD only + public static FieldDescriptor GraphVertex = new FieldDescriptor(kFeatures, "graphVertex", "FEATURES_GRAPH_VERTEX"); + public static FieldDescriptor GraphPixel = new FieldDescriptor(kFeatures, "graphPixel", "FEATURES_GRAPH_PIXEL"); + public static FieldDescriptor AlphaClip = new FieldDescriptor(string.Empty, "AlphaClip", "_AlphaClip 1"); + public static FieldDescriptor AlphaTest = new FieldDescriptor(string.Empty, "AlphaTest", "_ALPHA_TEST 1"); + public static FieldDescriptor BlendAlpha = new FieldDescriptor(kBlendMode, "Alpha", "_BLENDMODE_ALPHA 1"); // Universal, vfx: HDRP? + public static FieldDescriptor DoubleSided = new FieldDescriptor(string.Empty, "DoubleSided", "_DOUBLE_SIDED 1"); // Universal, duplicated in HD + public static FieldDescriptor IsPreview = new FieldDescriptor(string.Empty, "isPreview", "SHADERGRAPH_PREVIEW"); + public static FieldDescriptor LodCrossFade = new FieldDescriptor(string.Empty, "LodCrossFade", "_LODCROSSFADE 1"); // HD only + public static FieldDescriptor AlphaToMask = new FieldDescriptor(string.Empty, "AlphaToMask", "_ALPHATOMASK_ON 1"); // HD only #endregion } } diff --git a/com.unity.shadergraph/Editor/Importers/ShaderGraphImporter.cs b/com.unity.shadergraph/Editor/Importers/ShaderGraphImporter.cs index 4364992bc7a..344597af06e 100644 --- a/com.unity.shadergraph/Editor/Importers/ShaderGraphImporter.cs +++ b/com.unity.shadergraph/Editor/Importers/ShaderGraphImporter.cs @@ -123,7 +123,8 @@ public override void OnImportAsset(AssetImportContext ctx) var textGraph = File.ReadAllText(path, Encoding.UTF8); var graph = new GraphData { - messageManager = new MessageManager(), assetGuid = AssetDatabase.AssetPathToGUID(path) + messageManager = new MessageManager(), + assetGuid = AssetDatabase.AssetPathToGUID(path) }; MultiJson.Deserialize(graph, textGraph); graph.OnEnable(); @@ -299,7 +300,8 @@ internal static string GetShaderText(string path, out List r.requiresTime, $"float3 {ShaderGeneratorNames.TimeParameters}"); - #endregion + #endregion sharedCodeIndices.Add(codeSnippets.Count); codeSnippets.Add($"}};{nl}{nl}"); - #endregion + #endregion // VFX Code heavily relies on the slotId from the original MasterNodes // Since we keep these around for upgrades anyway, for now it is simpler to use them @@ -621,7 +624,7 @@ void AddCoordinateSpaceSnippets(InterpolatorType interpolatorType, Func {}); + registry.ProvideFunction(asset.functionName, sb => { }); return; } diff --git a/com.unity.shadergraph/Editor/Serialization/JsonData.cs b/com.unity.shadergraph/Editor/Serialization/JsonData.cs index 976ac1fc9d7..defae3abebb 100644 --- a/com.unity.shadergraph/Editor/Serialization/JsonData.cs +++ b/com.unity.shadergraph/Editor/Serialization/JsonData.cs @@ -80,52 +80,52 @@ public override int GetHashCode() return EqualityComparer.Default.GetHashCode(m_Value); } - public static bool operator==(JsonData left, JsonData right) + public static bool operator ==(JsonData left, JsonData right) { return left.value == right.value; } - public static bool operator!=(JsonData left, JsonData right) + public static bool operator !=(JsonData left, JsonData right) { return left.value != right.value; } - public static bool operator==(JsonData left, T right) + public static bool operator ==(JsonData left, T right) { return left.value == right; } - public static bool operator!=(JsonData left, T right) + public static bool operator !=(JsonData left, T right) { return left.value != right; } - public static bool operator==(T left, JsonData right) + public static bool operator ==(T left, JsonData right) { return left == right.value; } - public static bool operator!=(T left, JsonData right) + public static bool operator !=(T left, JsonData right) { return left != right.value; } - public static bool operator==(JsonData left, JsonRef right) + public static bool operator ==(JsonData left, JsonRef right) { return left.value == right.value; } - public static bool operator!=(JsonData left, JsonRef right) + public static bool operator !=(JsonData left, JsonRef right) { return left.value != right.value; } - public static bool operator==(JsonRef left, JsonData right) + public static bool operator ==(JsonRef left, JsonData right) { return left.value == right.value; } - public static bool operator!=(JsonRef left, JsonData right) + public static bool operator !=(JsonRef left, JsonData right) { return left.value != right.value; } diff --git a/com.unity.shadergraph/Editor/Serialization/JsonObject.cs b/com.unity.shadergraph/Editor/Serialization/JsonObject.cs index 0b89d009204..1bc1069be4e 100644 --- a/com.unity.shadergraph/Editor/Serialization/JsonObject.cs +++ b/com.unity.shadergraph/Editor/Serialization/JsonObject.cs @@ -70,15 +70,15 @@ void ISerializationCallbackReceiver.OnBeforeSerialize() public virtual string Serialize() { return EditorJsonUtility.ToJson(this, true); } public virtual void Deserailize(string typeInfo, string jsonData) { EditorJsonUtility.FromJsonOverwrite(jsonData, this); } - public virtual void OnBeforeSerialize() {} + public virtual void OnBeforeSerialize() { } - public virtual void OnBeforeDeserialize() {} + public virtual void OnBeforeDeserialize() { } - public virtual void OnAfterDeserialize() {} + public virtual void OnAfterDeserialize() { } - public virtual void OnAfterDeserialize(string json) {} + public virtual void OnAfterDeserialize(string json) { } - public virtual void OnAfterMultiDeserialize(string json) {} + public virtual void OnAfterMultiDeserialize(string json) { } internal static Guid GenerateNamespaceUUID(string Namespace, string Name) { diff --git a/com.unity.shadergraph/Editor/Serialization/JsonRef.cs b/com.unity.shadergraph/Editor/Serialization/JsonRef.cs index aab1dde901d..810f6c80c55 100644 --- a/com.unity.shadergraph/Editor/Serialization/JsonRef.cs +++ b/com.unity.shadergraph/Editor/Serialization/JsonRef.cs @@ -74,32 +74,32 @@ public override int GetHashCode() return EqualityComparer.Default.GetHashCode(m_Value); } - public static bool operator==(JsonRef left, JsonRef right) + public static bool operator ==(JsonRef left, JsonRef right) { return left.value == right.value; } - public static bool operator!=(JsonRef left, JsonRef right) + public static bool operator !=(JsonRef left, JsonRef right) { return left.value != right.value; } - public static bool operator==(JsonRef left, T right) + public static bool operator ==(JsonRef left, T right) { return left.value == right; } - public static bool operator!=(JsonRef left, T right) + public static bool operator !=(JsonRef left, T right) { return left.value != right; } - public static bool operator==(T left, JsonRef right) + public static bool operator ==(T left, JsonRef right) { return left == right.value; } - public static bool operator!=(T left, JsonRef right) + public static bool operator !=(T left, JsonRef right) { return left != right.value; } diff --git a/com.unity.shadergraph/Editor/Serialization/MultiJsonInternal.cs b/com.unity.shadergraph/Editor/Serialization/MultiJsonInternal.cs index 8963dba0a18..3992032f716 100644 --- a/com.unity.shadergraph/Editor/Serialization/MultiJsonInternal.cs +++ b/com.unity.shadergraph/Editor/Serialization/MultiJsonInternal.cs @@ -265,8 +265,8 @@ internal override ShaderInput Copy() } public override PropertyType propertyType => PropertyType.Float; - internal override void GetPropertyReferenceNames(List result) {} - internal override void GetPropertyDisplayNames(List result) {} + internal override void GetPropertyReferenceNames(List result) { } + internal override void GetPropertyDisplayNames(List result) { } internal override string GetPropertyBlockString() { return ""; } internal override void AppendPropertyBlockStrings(ShaderStringBuilder builder) { @@ -348,7 +348,7 @@ public override string Serialize() public override ConcreteSlotValueType concreteValueType => ConcreteSlotValueType.Vector1; - public override void AddDefaultProperty(PropertyCollector properties, GenerationMode generationMode) {} + public override void AddDefaultProperty(PropertyCollector properties, GenerationMode generationMode) { } public override void CopyValuesFrom(MaterialSlot foundSlot) { @@ -677,7 +677,7 @@ public static string Serialize(JsonObject mainObject) const string k_NewLineString = "\n"; var sb = new StringBuilder(); - foreach (var(id, json) in idJsonList) + foreach (var (id, json) in idJsonList) { sb.Append(json); sb.Append(k_NewLineString); diff --git a/com.unity.shadergraph/Editor/Util/CopyPasteGraph.cs b/com.unity.shadergraph/Editor/Util/CopyPasteGraph.cs index 51145a2f04e..8e742a307f1 100644 --- a/com.unity.shadergraph/Editor/Util/CopyPasteGraph.cs +++ b/com.unity.shadergraph/Editor/Util/CopyPasteGraph.cs @@ -44,7 +44,7 @@ sealed class CopyPasteGraph : JsonObject [SerializeField] List m_MetaKeywordIds = new List(); - public CopyPasteGraph() {} + public CopyPasteGraph() { } public CopyPasteGraph(IEnumerable groups, IEnumerable nodes, IEnumerable edges, IEnumerable inputs, IEnumerable metaProperties, IEnumerable metaKeywords, IEnumerable notes, diff --git a/com.unity.shadergraph/Editor/Util/IndexSet.cs b/com.unity.shadergraph/Editor/Util/IndexSet.cs index b7ba755ab95..09a3befad9a 100644 --- a/com.unity.shadergraph/Editor/Util/IndexSet.cs +++ b/com.unity.shadergraph/Editor/Util/IndexSet.cs @@ -8,7 +8,7 @@ sealed class IndexSet : ICollection { List m_Masks = new List(); - public IndexSet() {} + public IndexSet() { } public IndexSet(IEnumerable indices) { diff --git a/com.unity.shadergraph/Editor/Util/MessageManager.cs b/com.unity.shadergraph/Editor/Util/MessageManager.cs index 1585ac98bdb..4b57438939a 100644 --- a/com.unity.shadergraph/Editor/Util/MessageManager.cs +++ b/com.unity.shadergraph/Editor/Util/MessageManager.cs @@ -34,7 +34,7 @@ public void AddOrAppendError(object errorProvider, string nodeId, ShaderMessage } else { - messages[nodeId] = new List() {error}; + messages[nodeId] = new List() { error }; } nodeMessagesChanged = true; diff --git a/com.unity.shadergraph/Editor/Utilities/GenerationAPIAttribute.cs b/com.unity.shadergraph/Editor/Utilities/GenerationAPIAttribute.cs index 6befcb38705..7b9b5a2e628 100644 --- a/com.unity.shadergraph/Editor/Utilities/GenerationAPIAttribute.cs +++ b/com.unity.shadergraph/Editor/Utilities/GenerationAPIAttribute.cs @@ -6,6 +6,6 @@ namespace UnityEditor.ShaderGraph [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Interface, Inherited = true, AllowMultiple = false)] internal class GenerationAPIAttribute : Attribute { - public GenerationAPIAttribute() {} + public GenerationAPIAttribute() { } } } diff --git a/com.unity.shadergraph/Tests/Editor/IntegrationTests/SerializationTests.cs b/com.unity.shadergraph/Tests/Editor/IntegrationTests/SerializationTests.cs index 2f164265e58..681d6cc09d8 100644 --- a/com.unity.shadergraph/Tests/Editor/IntegrationTests/SerializationTests.cs +++ b/com.unity.shadergraph/Tests/Editor/IntegrationTests/SerializationTests.cs @@ -27,7 +27,7 @@ public DummyJsonHolder(List materialSlots) } } interface ITestInterface - {} + { } [Serializable] class SimpleSerializeClass : ITestInterface @@ -53,7 +53,7 @@ public static SimpleSerializeClass instance stringValue = "ABCD", intValue = 5, floatValue = 7.7f, - arrayValue = new[] {1, 2, 3, 4} + arrayValue = new[] { 1, 2, 3, 4 } }; } } @@ -84,7 +84,7 @@ class ChildClassA : SimpleSerializeClass stringValue = "qwee", intValue = 5, floatValue = 6f, - arrayValue = new[] {5, 6, 7, 8}, + arrayValue = new[] { 5, 6, 7, 8 }, childString = "CHILD" }; } @@ -117,7 +117,7 @@ class ChildClassB : SimpleSerializeClass stringValue = "qwee", intValue = 5, floatValue = 6f, - arrayValue = new[] {5, 6, 7, 8}, + arrayValue = new[] { 5, 6, 7, 8 }, childInt = 666 }; } diff --git a/com.unity.shadergraph/Tests/Editor/TestSlot.cs b/com.unity.shadergraph/Tests/Editor/TestSlot.cs index 55e7a4e536f..83d85faf893 100644 --- a/com.unity.shadergraph/Tests/Editor/TestSlot.cs +++ b/com.unity.shadergraph/Tests/Editor/TestSlot.cs @@ -4,10 +4,10 @@ namespace UnityEditor.ShaderGraph { class TestSlot : MaterialSlot { - public TestSlot() {} + public TestSlot() { } public TestSlot(int slotId, string displayName, SlotType slotType, ShaderStageCapability stageCapability = ShaderStageCapability.All, bool hidden = false) - : base(slotId, displayName, displayName, slotType, stageCapability, hidden) {} + : base(slotId, displayName, displayName, slotType, stageCapability, hidden) { } public override SlotValueType valueType { diff --git a/com.unity.shadergraph/Tests/Editor/UnitTests/AbstractMaterialGraphTests.cs b/com.unity.shadergraph/Tests/Editor/UnitTests/AbstractMaterialGraphTests.cs index 28c2db1eeda..bb26bd3d803 100644 --- a/com.unity.shadergraph/Tests/Editor/UnitTests/AbstractMaterialGraphTests.cs +++ b/com.unity.shadergraph/Tests/Editor/UnitTests/AbstractMaterialGraphTests.cs @@ -9,7 +9,7 @@ namespace UnityEditor.ShaderGraph.UnitTests class AbstractMaterialGraphTests { private class TestableMNode : AbstractMaterialNode - {} + { } [OneTimeSetUp] public void RunBeforeAnyTests() diff --git a/com.unity.shadergraph/Tests/Editor/UnitTests/SerializedGraphTests.cs b/com.unity.shadergraph/Tests/Editor/UnitTests/SerializedGraphTests.cs index fe23a67e923..86d5e3f5da3 100644 --- a/com.unity.shadergraph/Tests/Editor/UnitTests/SerializedGraphTests.cs +++ b/com.unity.shadergraph/Tests/Editor/UnitTests/SerializedGraphTests.cs @@ -246,7 +246,7 @@ public void TestCanRemoveSlotsWithNonMathingNameFromTestNode() Assert.AreEqual(3, node.GetInputSlots().Count()); Assert.AreEqual(3, node.GetOutputSlots().Count()); - node.RemoveSlotsNameNotMatching(new[] {TestableNode.Input1}); + node.RemoveSlotsNameNotMatching(new[] { TestableNode.Input1 }); Assert.AreEqual(1, node.GetSlots().Count()); Assert.AreEqual(1, node.GetInputSlots().Count()); @@ -420,8 +420,8 @@ public void TestExceptionIfBadNodeConfigurationWorks() () => NodeUtils.SlotConfigurationExceptionIfBadConfiguration( node, - new[] {TestableNode.Input0, TestableNode.Input1, TestableNode.Input2}, - new[] {TestableNode.Output0, TestableNode.Output1, TestableNode.Output2, }) + new[] { TestableNode.Input0, TestableNode.Input1, TestableNode.Input2 }, + new[] { TestableNode.Output0, TestableNode.Output1, TestableNode.Output2, }) ); @@ -429,24 +429,24 @@ public void TestExceptionIfBadNodeConfigurationWorks() () => NodeUtils.SlotConfigurationExceptionIfBadConfiguration( node, - new[] {666, TestableNode.Input1, TestableNode.Input2}, - new[] {TestableNode.Output0, TestableNode.Output1, TestableNode.Output2, }) + new[] { 666, TestableNode.Input1, TestableNode.Input2 }, + new[] { TestableNode.Output0, TestableNode.Output1, TestableNode.Output2, }) ); Assert.Throws( () => NodeUtils.SlotConfigurationExceptionIfBadConfiguration( node, - new[] {TestableNode.Input0, TestableNode.Input1, TestableNode.Input2}, - new[] {666, TestableNode.Output1, TestableNode.Output2, }) + new[] { TestableNode.Input0, TestableNode.Input1, TestableNode.Input2 }, + new[] { 666, TestableNode.Output1, TestableNode.Output2, }) ); Assert.DoesNotThrow( () => NodeUtils.SlotConfigurationExceptionIfBadConfiguration( node, - new[] {TestableNode.Input0}, - new[] {TestableNode.Output0}) + new[] { TestableNode.Input0 }, + new[] { TestableNode.Output0 }) ); } @@ -600,7 +600,7 @@ public void TestRemovingElementsFromBaseMaterialGraph() graph.Connect(outputNode.GetSlotReference(TestableNode.Output0), inputNode.GetSlotReference(TestableNode.Input0)); Assert.AreEqual(1, graph.edges.Count()); - graph.RemoveElements(graph.GetNodes().ToArray(), graph.edges.ToArray(), new GroupData[] {}, new StickyNoteData[] {}); + graph.RemoveElements(graph.GetNodes().ToArray(), graph.edges.ToArray(), new GroupData[] { }, new StickyNoteData[] { }); Assert.AreEqual(0, graph.GetNodes().Count()); Assert.AreEqual(0, graph.edges.Count()); } diff --git a/com.unity.shadergraph/Tests/Editor/UnitTests/StackTests.cs b/com.unity.shadergraph/Tests/Editor/UnitTests/StackTests.cs index 9b7d8f76699..027e8ab73cd 100644 --- a/com.unity.shadergraph/Tests/Editor/UnitTests/StackTests.cs +++ b/com.unity.shadergraph/Tests/Editor/UnitTests/StackTests.cs @@ -81,7 +81,7 @@ public void CanFilterBlockNodeByShaderStage() node.Init(s_DescriptorA); var contextView = new ContextView("Test", graph.vertexContext, null); - var methodInfo = typeof(StackNode).GetMethod("AcceptsElement", BindingFlags.Instance | BindingFlags.NonPublic, null, new[] {typeof(GraphElement), typeof(int).MakeByRefType(), typeof(int)}, null); + var methodInfo = typeof(StackNode).GetMethod("AcceptsElement", BindingFlags.Instance | BindingFlags.NonPublic, null, new[] { typeof(GraphElement), typeof(int).MakeByRefType(), typeof(int) }, null); Assert.IsNotNull(methodInfo); var acceptsElement = (bool)methodInfo.Invoke(contextView, new object[] { new MaterialNodeView() { userData = node }, 0, 0 }); diff --git a/com.unity.template-hd/Assets/SampleSceneAssets/Scripts/SimpleCameraController.cs b/com.unity.template-hd/Assets/SampleSceneAssets/Scripts/SimpleCameraController.cs index 5bb58871577..a6e723ba34b 100644 --- a/com.unity.template-hd/Assets/SampleSceneAssets/Scripts/SimpleCameraController.cs +++ b/com.unity.template-hd/Assets/SampleSceneAssets/Scripts/SimpleCameraController.cs @@ -170,9 +170,9 @@ void Update() if (IsEscapePressed()) { Application.Quit(); - #if UNITY_EDITOR +#if UNITY_EDITOR UnityEditor.EditorApplication.isPlaying = false; - #endif +#endif } // Hide and lock cursor when right mouse button pressed diff --git a/com.unity.template-hd/Assets/SampleSceneAssets/TutorialInfo/Scripts/Editor/ReadmeEditor.cs b/com.unity.template-hd/Assets/SampleSceneAssets/TutorialInfo/Scripts/Editor/ReadmeEditor.cs index 00408ef2da4..373792fb51b 100644 --- a/com.unity.template-hd/Assets/SampleSceneAssets/TutorialInfo/Scripts/Editor/ReadmeEditor.cs +++ b/com.unity.template-hd/Assets/SampleSceneAssets/TutorialInfo/Scripts/Editor/ReadmeEditor.cs @@ -39,7 +39,7 @@ static void LoadLayout() var assembly = typeof(EditorApplication).Assembly; var windowLayoutType = assembly.GetType("UnityEditor.WindowLayout", true); var method = windowLayoutType.GetMethod("LoadWindowLayout", BindingFlags.Public | BindingFlags.Static); - method.Invoke(null, new object[] {Path.Combine(Application.dataPath, "TutorialInfo/Layout.wlt"), false}); + method.Invoke(null, new object[] { Path.Combine(Application.dataPath, "TutorialInfo/Layout.wlt"), false }); } [MenuItem("Tutorial/Show Tutorial Instructions")] @@ -50,7 +50,7 @@ static Readme SelectReadme() { var readmeObject = AssetDatabase.LoadMainAssetAtPath(AssetDatabase.GUIDToAssetPath(ids[0])); - Selection.objects = new UnityEngine.Object[] {readmeObject}; + Selection.objects = new UnityEngine.Object[] { readmeObject }; return (Readme)readmeObject; } diff --git a/com.unity.template-universal/Assets/Scripts/SimpleCameraController.cs b/com.unity.template-universal/Assets/Scripts/SimpleCameraController.cs index 0d788d77806..cbde1b9335b 100644 --- a/com.unity.template-universal/Assets/Scripts/SimpleCameraController.cs +++ b/com.unity.template-universal/Assets/Scripts/SimpleCameraController.cs @@ -167,9 +167,9 @@ void Update() if (IsEscapePressed()) { Application.Quit(); - #if UNITY_EDITOR +#if UNITY_EDITOR UnityEditor.EditorApplication.isPlaying = false; - #endif +#endif } // Hide and lock cursor when right mouse button pressed diff --git a/com.unity.template-universal/Assets/TutorialInfo/Scripts/Editor/ReadmeEditor.cs b/com.unity.template-universal/Assets/TutorialInfo/Scripts/Editor/ReadmeEditor.cs index 75f71891507..5ed52f52ce8 100644 --- a/com.unity.template-universal/Assets/TutorialInfo/Scripts/Editor/ReadmeEditor.cs +++ b/com.unity.template-universal/Assets/TutorialInfo/Scripts/Editor/ReadmeEditor.cs @@ -39,7 +39,7 @@ static void LoadLayout() var assembly = typeof(EditorApplication).Assembly; var windowLayoutType = assembly.GetType("UnityEditor.WindowLayout", true); var method = windowLayoutType.GetMethod("LoadWindowLayout", BindingFlags.Public | BindingFlags.Static); - method.Invoke(null, new object[] {Path.Combine(Application.dataPath, "TutorialInfo/Layout.wlt"), false}); + method.Invoke(null, new object[] { Path.Combine(Application.dataPath, "TutorialInfo/Layout.wlt"), false }); } [MenuItem("Tutorial/Show Tutorial Instructions")] @@ -50,7 +50,7 @@ static Readme SelectReadme() { var readmeObject = AssetDatabase.LoadMainAssetAtPath(AssetDatabase.GUIDToAssetPath(ids[0])); - Selection.objects = new UnityEngine.Object[] {readmeObject}; + Selection.objects = new UnityEngine.Object[] { readmeObject }; return (Readme)readmeObject; } diff --git a/com.unity.visualeffectgraph/Editor/Compiler/VFXCodeGenerator.cs b/com.unity.visualeffectgraph/Editor/Compiler/VFXCodeGenerator.cs index b95f9d0905e..c5c4b2ffae4 100644 --- a/com.unity.visualeffectgraph/Editor/Compiler/VFXCodeGenerator.cs +++ b/com.unity.visualeffectgraph/Editor/Compiler/VFXCodeGenerator.cs @@ -217,9 +217,9 @@ static private string FormatPath(string path) { return Path.GetFullPath(path) .TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar) - #if !UNITY_EDITOR_LINUX +#if !UNITY_EDITOR_LINUX .ToLowerInvariant() - #endif +#endif ; } @@ -286,7 +286,7 @@ static private StringBuilder GetFlattenedTemplateContent(string path, List 3 && !String.IsNullOrEmpty(groups[2].Value)) { - var allDefines = groups[3].Value.Split(new char[] {',', ' ', '\t'}, StringSplitOptions.RemoveEmptyEntries); + var allDefines = groups[3].Value.Split(new char[] { ',', ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries); var neededDefines = allDefines.Where(d => d[0] != '!'); var forbiddenDefines = allDefines.Except(neededDefines).Select(d => d.Substring(1)); if (!neededDefines.All(d => defines.Contains(d)) || forbiddenDefines.Any(d => defines.Contains(d))) diff --git a/com.unity.visualeffectgraph/Editor/Compiler/VFXExpressionGraph.cs b/com.unity.visualeffectgraph/Editor/Compiler/VFXExpressionGraph.cs index a2d87aa4221..f5cf5c2b657 100644 --- a/com.unity.visualeffectgraph/Editor/Compiler/VFXExpressionGraph.cs +++ b/com.unity.visualeffectgraph/Editor/Compiler/VFXExpressionGraph.cs @@ -25,7 +25,7 @@ private struct ExpressionData } public VFXExpressionGraph() - {} + { } private void AddExpressionDataRecursively(Dictionary dst, VFXExpression exp, int depth = 0) { diff --git a/com.unity.visualeffectgraph/Editor/Compiler/VFXGraphCompiledData.cs b/com.unity.visualeffectgraph/Editor/Compiler/VFXGraphCompiledData.cs index 1794ef816df..8fe0a066800 100644 --- a/com.unity.visualeffectgraph/Editor/Compiler/VFXGraphCompiledData.cs +++ b/com.unity.visualeffectgraph/Editor/Compiler/VFXGraphCompiledData.cs @@ -715,7 +715,7 @@ private static void FillEvent(List outEventDesc, Dictionary(), stopSystems = allStopNotLinked }, }.ToList(); - var specialNames = new HashSet(new string[] {VisualEffectAsset.PlayEventName, VisualEffectAsset.StopEventName}); + var specialNames = new HashSet(new string[] { VisualEffectAsset.PlayEventName, VisualEffectAsset.StopEventName }); var events = contexts.Where(o => o.contextType == VFXContextType.Event); @@ -928,7 +928,7 @@ private class VFXImplicitContextOfExposedExpression : VFXContext { private VFXExpressionMapper mapper; - public VFXImplicitContextOfExposedExpression() : base(VFXContextType.None, VFXDataType.None, VFXDataType.None) {} + public VFXImplicitContextOfExposedExpression() : base(VFXContextType.None, VFXDataType.None, VFXDataType.None) { } private static void CollectExposedExpression(List expressions, VFXSlot slot) { @@ -967,7 +967,7 @@ static Action Find_FnVFXResource_SetCompileInitialVa var property = typeof(VisualEffectResource).GetProperty("compileInitialVariants"); if (property != null) { - return delegate(VisualEffectResource rsc, bool value) + return delegate (VisualEffectResource rsc, bool value) { property.SetValue(rsc, value, null); }; @@ -998,7 +998,7 @@ public void Compile(VFXCompilationMode compilationMode, bool forceShaderValidati m_Graph.visualEffectResource.ClearRuntimeData(); m_ExpressionGraph = new VFXExpressionGraph(); - m_ExpressionValues = new VFXExpressionValueContainerDesc[] {}; + m_ExpressionValues = new VFXExpressionValueContainerDesc[] { }; return; } @@ -1194,7 +1194,7 @@ public void Compile(VFXCompilationMode compilationMode, bool forceShaderValidati m_Graph.visualEffectResource.ClearRuntimeData(); m_ExpressionGraph = new VFXExpressionGraph(); - m_ExpressionValues = new VFXExpressionValueContainerDesc[] {}; + m_ExpressionValues = new VFXExpressionValueContainerDesc[] { }; } finally { diff --git a/com.unity.visualeffectgraph/Editor/Compiler/VFXShaderWriter.cs b/com.unity.visualeffectgraph/Editor/Compiler/VFXShaderWriter.cs index ed329aba5a5..951ac0fc10c 100644 --- a/com.unity.visualeffectgraph/Editor/Compiler/VFXShaderWriter.cs +++ b/com.unity.visualeffectgraph/Editor/Compiler/VFXShaderWriter.cs @@ -28,7 +28,7 @@ public static string GeneratePrefix(uint index) class VFXShaderWriter { public VFXShaderWriter() - {} + { } public VFXShaderWriter(string initialValue) { @@ -107,13 +107,13 @@ public static string GetMultilineWithPrefix(string str, string linePrefix) return dst.ToString(0, dst.Length - 1); // Remove the last line terminator } - public void WriteFormat(string str, object arg0) { m_Builder.AppendFormat(str, arg0); } - public void WriteFormat(string str, object arg0, object arg1) { m_Builder.AppendFormat(str, arg0, arg1); } - public void WriteFormat(string str, object arg0, object arg1, object arg2) { m_Builder.AppendFormat(str, arg0, arg1, arg2); } + public void WriteFormat(string str, object arg0) { m_Builder.AppendFormat(str, arg0); } + public void WriteFormat(string str, object arg0, object arg1) { m_Builder.AppendFormat(str, arg0, arg1); } + public void WriteFormat(string str, object arg0, object arg1, object arg2) { m_Builder.AppendFormat(str, arg0, arg1, arg2); } - public void WriteLineFormat(string str, object arg0) { WriteFormat(str, arg0); WriteLine(); } - public void WriteLineFormat(string str, object arg0, object arg1) { WriteFormat(str, arg0, arg1); WriteLine(); } - public void WriteLineFormat(string str, object arg0, object arg1, object arg2) { WriteFormat(str, arg0, arg1, arg2); WriteLine(); } + public void WriteLineFormat(string str, object arg0) { WriteFormat(str, arg0); WriteLine(); } + public void WriteLineFormat(string str, object arg0, object arg1) { WriteFormat(str, arg0, arg1); WriteLine(); } + public void WriteLineFormat(string str, object arg0, object arg1, object arg2) { WriteFormat(str, arg0, arg1, arg2); WriteLine(); } // Generic builder method public void Write(T t) diff --git a/com.unity.visualeffectgraph/Editor/Compiler/VFXUniformMapper.cs b/com.unity.visualeffectgraph/Editor/Compiler/VFXUniformMapper.cs index 094913606c0..6490738c950 100644 --- a/com.unity.visualeffectgraph/Editor/Compiler/VFXUniformMapper.cs +++ b/com.unity.visualeffectgraph/Editor/Compiler/VFXUniformMapper.cs @@ -122,7 +122,8 @@ public Dictionary expressionToCode { get { - return m_UniformToName.Select(s => { + return m_UniformToName.Select(s => + { string code = null; string firstName = s.Value.First(); switch (s.Key.valueType) diff --git a/com.unity.visualeffectgraph/Editor/Controls/VFXBitField.cs b/com.unity.visualeffectgraph/Editor/Controls/VFXBitField.cs index 990a5b1b25c..6a8ebe91607 100644 --- a/com.unity.visualeffectgraph/Editor/Controls/VFXBitField.cs +++ b/com.unity.visualeffectgraph/Editor/Controls/VFXBitField.cs @@ -30,7 +30,7 @@ public VFXBitField() Add(m_Label); Add(m_Background); - var buttonContainer = new VisualElement() { name = "button-container" , pickingMode = PickingMode.Ignore}; + var buttonContainer = new VisualElement() { name = "button-container", pickingMode = PickingMode.Ignore }; Add(buttonContainer); for (int i = 0; i < m_Buttons.Length; ++i) { diff --git a/com.unity.visualeffectgraph/Editor/Controls/VFXColorField.cs b/com.unity.visualeffectgraph/Editor/Controls/VFXColorField.cs index c46068aa414..6f123a6bc60 100644 --- a/com.unity.visualeffectgraph/Editor/Controls/VFXColorField.cs +++ b/com.unity.visualeffectgraph/Editor/Controls/VFXColorField.cs @@ -53,12 +53,14 @@ VisualElement CreateColorContainer() m_AlphaDisplay.AddManipulator(new Clickable(OnColorClick)); - m_HDRLabel = new Label() { + m_HDRLabel = new Label() + { pickingMode = PickingMode.Ignore, text = "HDR" }; - m_IndeterminateLabel = new Label() { + m_IndeterminateLabel = new Label() + { pickingMode = PickingMode.Ignore, name = "indeterminate", text = VFXControlConstants.indeterminateText @@ -195,7 +197,7 @@ void OnColorChanged(Color color) public bool indeterminate { - get {return m_Indeterminate; } + get { return m_Indeterminate; } set { m_Indeterminate = value; diff --git a/com.unity.visualeffectgraph/Editor/Controls/VFXControl.cs b/com.unity.visualeffectgraph/Editor/Controls/VFXControl.cs index e19fbab257d..f15fdd77207 100644 --- a/com.unity.visualeffectgraph/Editor/Controls/VFXControl.cs +++ b/com.unity.visualeffectgraph/Editor/Controls/VFXControl.cs @@ -51,7 +51,7 @@ public void ForceUpdate() ValueToGUI(true); } - public abstract bool indeterminate {get; set; } + public abstract bool indeterminate { get; set; } protected abstract void ValueToGUI(bool force); diff --git a/com.unity.visualeffectgraph/Editor/Controls/VFXLabeledField.cs b/com.unity.visualeffectgraph/Editor/Controls/VFXLabeledField.cs index 1f119c53965..4b5de97f2f7 100644 --- a/com.unity.visualeffectgraph/Editor/Controls/VFXLabeledField.cs +++ b/com.unity.visualeffectgraph/Editor/Controls/VFXLabeledField.cs @@ -124,7 +124,7 @@ public VFXLabeledField(Label existingLabel) public bool indeterminate { - get {return m_Control.parent == null; } + get { return m_Control.parent == null; } set { diff --git a/com.unity.visualeffectgraph/Editor/Controls/VFXMatrix4x4Field.cs b/com.unity.visualeffectgraph/Editor/Controls/VFXMatrix4x4Field.cs index 1692b63dc2b..6741edf6310 100644 --- a/com.unity.visualeffectgraph/Editor/Controls/VFXMatrix4x4Field.cs +++ b/com.unity.visualeffectgraph/Editor/Controls/VFXMatrix4x4Field.cs @@ -113,7 +113,7 @@ public VFXMatrix4x4Field() for (int i = 0; i < m_FloatFields.GetLength(0); ++i) { - var line = new VisualElement() {name = "matrixLine"}; + var line = new VisualElement() { name = "matrixLine" }; line.style.flexDirection = FlexDirection.Row; for (int j = 0; j < m_FloatFields.GetLength(1); ++j) diff --git a/com.unity.visualeffectgraph/Editor/Controls/VFXReorderableList.cs b/com.unity.visualeffectgraph/Editor/Controls/VFXReorderableList.cs index 0fa0716002d..a12cd555e5c 100644 --- a/com.unity.visualeffectgraph/Editor/Controls/VFXReorderableList.cs +++ b/com.unity.visualeffectgraph/Editor/Controls/VFXReorderableList.cs @@ -280,11 +280,11 @@ protected virtual void ElementMoved(int movedIndex, int targetIndex) public VFXReorderableList() { - m_ListContainer = new VisualElement() {name = "ListContainer"}; + m_ListContainer = new VisualElement() { name = "ListContainer" }; Add(m_ListContainer); - m_Toolbar = new VisualElement() { name = "Toolbar"}; + m_Toolbar = new VisualElement() { name = "Toolbar" }; var add = new VisualElement() { name = "Add" }; add.Add(new VisualElement() { name = "icon" }); @@ -339,7 +339,7 @@ void RemoveDragFromItem(VisualElement item) public bool toolbar { - get {return m_Toolbar.parent != null; } + get { return m_Toolbar.parent != null; } set { diff --git a/com.unity.visualeffectgraph/Editor/Controls/VFXSliderField.cs b/com.unity.visualeffectgraph/Editor/Controls/VFXSliderField.cs index 066ce339845..06f0a792a34 100644 --- a/com.unity.visualeffectgraph/Editor/Controls/VFXSliderField.cs +++ b/com.unity.visualeffectgraph/Editor/Controls/VFXSliderField.cs @@ -228,7 +228,7 @@ void ValueChanged(float newValue) public bool indeterminate { - get {return m_FloatField.parent == null; } + get { return m_FloatField.parent == null; } set { diff --git a/com.unity.visualeffectgraph/Editor/Controls/VFXStringFieldPushButton.cs b/com.unity.visualeffectgraph/Editor/Controls/VFXStringFieldPushButton.cs index aff5498cff2..8f5e4edced4 100644 --- a/com.unity.visualeffectgraph/Editor/Controls/VFXStringFieldPushButton.cs +++ b/com.unity.visualeffectgraph/Editor/Controls/VFXStringFieldPushButton.cs @@ -17,13 +17,13 @@ public Action pushButtonProvider public VFXStringFieldPushButton(string label, Action fnClicked, string buttonName) : base(label) { m_fnOnClicked = fnClicked; - Add(new Button(() => m_fnOnClicked(m_TextField.text)) {text = buttonName}); + Add(new Button(() => m_fnOnClicked(m_TextField.text)) { text = buttonName }); } public VFXStringFieldPushButton(Label existingLabel, Action fnClicked, string buttonName) : base(existingLabel) { m_fnOnClicked = fnClicked; - Add(new Button(() => m_fnOnClicked(m_TextField.text)) {text = buttonName}); + Add(new Button(() => m_fnOnClicked(m_TextField.text)) { text = buttonName }); } } } diff --git a/com.unity.visualeffectgraph/Editor/Controls/VFXVector2Field.cs b/com.unity.visualeffectgraph/Editor/Controls/VFXVector2Field.cs index 0844bdea280..dff726cc196 100644 --- a/com.unity.visualeffectgraph/Editor/Controls/VFXVector2Field.cs +++ b/com.unity.visualeffectgraph/Editor/Controls/VFXVector2Field.cs @@ -9,7 +9,7 @@ namespace UnityEditor.VFX.UI { class VFXVector2Field : VFXVectorNField { - protected override int componentCount {get {return 2; }} + protected override int componentCount { get { return 2; } } protected override void SetValueComponent(ref Vector2 value, int i, float componentValue) { switch (i) diff --git a/com.unity.visualeffectgraph/Editor/Controls/VFXVector3Field.cs b/com.unity.visualeffectgraph/Editor/Controls/VFXVector3Field.cs index 722019e80b1..a045baeaf64 100644 --- a/com.unity.visualeffectgraph/Editor/Controls/VFXVector3Field.cs +++ b/com.unity.visualeffectgraph/Editor/Controls/VFXVector3Field.cs @@ -13,7 +13,7 @@ abstract class VFXVectorNField : VFXControl VisualElement[] m_FieldParents; VisualElement[] m_TooltipHolders; - protected abstract int componentCount {get; } + protected abstract int componentCount { get; } public virtual string GetComponentName(int i) { switch (i) @@ -79,10 +79,10 @@ void CreateTextField() m_Fields[i].onValueDragFinished = t => ValueDragFinished(); m_Fields[i].onValueDragStarted = t => ValueDragStarted(); - m_FieldParents[i] = new VisualElement {name = "FieldParent" }; + m_FieldParents[i] = new VisualElement { name = "FieldParent" }; m_FieldParents[i].Add(m_Fields[i]); m_FieldParents[i].style.flexGrow = 1; - m_TooltipHolders[i] = new VisualElement {name = "TooltipHolder" }; + m_TooltipHolders[i] = new VisualElement { name = "TooltipHolder" }; m_TooltipHolders[i].style.position = UnityEngine.UIElements.Position.Absolute; m_TooltipHolders[i].style.top = 0; m_TooltipHolders[i].style.left = 0; @@ -142,7 +142,7 @@ protected override void ValueToGUI(bool force) } class VFXVector3Field : VFXVectorNField { - protected override int componentCount {get {return 3; }} + protected override int componentCount { get { return 3; } } protected override void SetValueComponent(ref Vector3 value, int i, float componentValue) { switch (i) diff --git a/com.unity.visualeffectgraph/Editor/Controls/VFXVector4Field.cs b/com.unity.visualeffectgraph/Editor/Controls/VFXVector4Field.cs index 690cdbc2c7e..75019364904 100644 --- a/com.unity.visualeffectgraph/Editor/Controls/VFXVector4Field.cs +++ b/com.unity.visualeffectgraph/Editor/Controls/VFXVector4Field.cs @@ -6,7 +6,7 @@ namespace UnityEditor.VFX.UI { class VFXVector4Field : VFXVectorNField { - protected override int componentCount {get {return 4; }} + protected override int componentCount { get { return 4; } } protected override void SetValueComponent(ref Vector4 value, int i, float componentValue) { switch (i) diff --git a/com.unity.visualeffectgraph/Editor/Core/VFXEnums.cs b/com.unity.visualeffectgraph/Editor/Core/VFXEnums.cs index 6466ec66996..f813446257c 100644 --- a/com.unity.visualeffectgraph/Editor/Core/VFXEnums.cs +++ b/com.unity.visualeffectgraph/Editor/Core/VFXEnums.cs @@ -3,34 +3,34 @@ namespace UnityEditor.VFX // TODO Tmp Just map the task types from bindings so that the enum is accessible from outside the package (For HDRP) enum VFXTaskType { - None = UnityEngine.VFX.VFXTaskType.None, + None = UnityEngine.VFX.VFXTaskType.None, - Spawner = UnityEngine.VFX.VFXTaskType.Spawner, - Initialize = UnityEngine.VFX.VFXTaskType.Initialize, - Update = UnityEngine.VFX.VFXTaskType.Update, - Output = UnityEngine.VFX.VFXTaskType.Output, + Spawner = UnityEngine.VFX.VFXTaskType.Spawner, + Initialize = UnityEngine.VFX.VFXTaskType.Initialize, + Update = UnityEngine.VFX.VFXTaskType.Update, + Output = UnityEngine.VFX.VFXTaskType.Output, // updates - CameraSort = UnityEngine.VFX.VFXTaskType.CameraSort, - PerCameraUpdate = UnityEngine.VFX.VFXTaskType.PerCameraUpdate, - PerCameraSort = UnityEngine.VFX.VFXTaskType.PerCameraSort, + CameraSort = UnityEngine.VFX.VFXTaskType.CameraSort, + PerCameraUpdate = UnityEngine.VFX.VFXTaskType.PerCameraUpdate, + PerCameraSort = UnityEngine.VFX.VFXTaskType.PerCameraSort, // outputs - ParticlePointOutput = UnityEngine.VFX.VFXTaskType.ParticlePointOutput, - ParticleLineOutput = UnityEngine.VFX.VFXTaskType.ParticleLineOutput, - ParticleQuadOutput = UnityEngine.VFX.VFXTaskType.ParticleQuadOutput, - ParticleHexahedronOutput = UnityEngine.VFX.VFXTaskType.ParticleHexahedronOutput, - ParticleMeshOutput = UnityEngine.VFX.VFXTaskType.ParticleMeshOutput, - ParticleTriangleOutput = UnityEngine.VFX.VFXTaskType.ParticleTriangleOutput, - ParticleOctagonOutput = UnityEngine.VFX.VFXTaskType.ParticleOctagonOutput, + ParticlePointOutput = UnityEngine.VFX.VFXTaskType.ParticlePointOutput, + ParticleLineOutput = UnityEngine.VFX.VFXTaskType.ParticleLineOutput, + ParticleQuadOutput = UnityEngine.VFX.VFXTaskType.ParticleQuadOutput, + ParticleHexahedronOutput = UnityEngine.VFX.VFXTaskType.ParticleHexahedronOutput, + ParticleMeshOutput = UnityEngine.VFX.VFXTaskType.ParticleMeshOutput, + ParticleTriangleOutput = UnityEngine.VFX.VFXTaskType.ParticleTriangleOutput, + ParticleOctagonOutput = UnityEngine.VFX.VFXTaskType.ParticleOctagonOutput, // spawners - ConstantRateSpawner = UnityEngine.VFX.VFXTaskType.ConstantRateSpawner, - BurstSpawner = UnityEngine.VFX.VFXTaskType.BurstSpawner, - PeriodicBurstSpawner = UnityEngine.VFX.VFXTaskType.PeriodicBurstSpawner, - VariableRateSpawner = UnityEngine.VFX.VFXTaskType.VariableRateSpawner, - CustomCallbackSpawner = UnityEngine.VFX.VFXTaskType.CustomCallbackSpawner, - SetAttributeSpawner = UnityEngine.VFX.VFXTaskType.SetAttributeSpawner, + ConstantRateSpawner = UnityEngine.VFX.VFXTaskType.ConstantRateSpawner, + BurstSpawner = UnityEngine.VFX.VFXTaskType.BurstSpawner, + PeriodicBurstSpawner = UnityEngine.VFX.VFXTaskType.PeriodicBurstSpawner, + VariableRateSpawner = UnityEngine.VFX.VFXTaskType.VariableRateSpawner, + CustomCallbackSpawner = UnityEngine.VFX.VFXTaskType.CustomCallbackSpawner, + SetAttributeSpawner = UnityEngine.VFX.VFXTaskType.SetAttributeSpawner, } } diff --git a/com.unity.visualeffectgraph/Editor/Core/VFXLibrary.cs b/com.unity.visualeffectgraph/Editor/Core/VFXLibrary.cs index 1879ed257ea..c89c8ba8611 100644 --- a/com.unity.visualeffectgraph/Editor/Core/VFXLibrary.cs +++ b/com.unity.visualeffectgraph/Editor/Core/VFXLibrary.cs @@ -160,7 +160,7 @@ abstract class VFXSRPBinder abstract public string SRPAssetTypeStr { get; } abstract public Type SRPOutputDataType { get; } - public virtual void SetupMaterial(Material mat) {} + public virtual void SetupMaterial(Material mat) { } } // Not in Universal package because we dont want to add a dependency on VFXGraph diff --git a/com.unity.visualeffectgraph/Editor/Core/VFXSerializer.cs b/com.unity.visualeffectgraph/Editor/Core/VFXSerializer.cs index f8196691bac..58e05d91021 100644 --- a/com.unity.visualeffectgraph/Editor/Core/VFXSerializer.cs +++ b/com.unity.visualeffectgraph/Editor/Core/VFXSerializer.cs @@ -24,7 +24,7 @@ public static implicit operator Type(SerializableType value) return !ReferenceEquals(value, null) ? value.m_Type : null; } - private SerializableType() {} + private SerializableType() { } public SerializableType(Type type) { m_Type = type; @@ -68,7 +68,7 @@ public override bool Equals(object obj) return m_Type == otherType; } - public static bool operator==(SerializableType left, SerializableType right) + public static bool operator ==(SerializableType left, SerializableType right) { if (!ReferenceEquals(left, null)) return left.Equals(right); @@ -78,7 +78,7 @@ public override bool Equals(object obj) return true; // both null } - public static bool operator!=(SerializableType left, SerializableType right) + public static bool operator !=(SerializableType left, SerializableType right) { return !(left == right); } @@ -102,7 +102,7 @@ public string text [Serializable] class VFXSerializableObject { - private VFXSerializableObject() {} + private VFXSerializableObject() { } public VFXSerializableObject(Type type, object obj) : this(type) { diff --git a/com.unity.visualeffectgraph/Editor/Data/VFXData.cs b/com.unity.visualeffectgraph/Editor/Data/VFXData.cs index 9b383d6399e..86e68f078a0 100644 --- a/com.unity.visualeffectgraph/Editor/Data/VFXData.cs +++ b/com.unity.visualeffectgraph/Editor/Data/VFXData.cs @@ -70,7 +70,7 @@ public static VFXData CreateDataType(VFXGraph graph, VFXDataType type) case VFXDataType.OutputEvent: newVFXData = ScriptableObject.CreateInstance(); break; - default: return null; + default: return null; } newVFXData.m_Parent = graph; return newVFXData; @@ -160,23 +160,23 @@ public void OnContextRemoved(VFXContext context) throw new ArgumentException(string.Format("{0} is not in the owner list of {1}", context, this)); } - public bool IsCurrentAttributeRead(VFXAttribute attrib) { return (GetAttributeMode(attrib) & VFXAttributeMode.Read) != 0; } - public bool IsCurrentAttributeWritten(VFXAttribute attrib) { return (GetAttributeMode(attrib) & VFXAttributeMode.Write) != 0; } + public bool IsCurrentAttributeRead(VFXAttribute attrib) { return (GetAttributeMode(attrib) & VFXAttributeMode.Read) != 0; } + public bool IsCurrentAttributeWritten(VFXAttribute attrib) { return (GetAttributeMode(attrib) & VFXAttributeMode.Write) != 0; } - public bool IsCurrentAttributeRead(VFXAttribute attrib, VFXContext context) { return (GetAttributeMode(attrib, context) & VFXAttributeMode.Read) != 0; } + public bool IsCurrentAttributeRead(VFXAttribute attrib, VFXContext context) { return (GetAttributeMode(attrib, context) & VFXAttributeMode.Read) != 0; } public bool IsCurrentAttributeWritten(VFXAttribute attrib, VFXContext context) { return (GetAttributeMode(attrib, context) & VFXAttributeMode.Write) != 0; } - public bool IsAttributeUsed(VFXAttribute attrib) { return GetAttributeMode(attrib) != VFXAttributeMode.None; } - public bool IsAttributeUsed(VFXAttribute attrib, VFXContext context) { return GetAttributeMode(attrib, context) != VFXAttributeMode.None; } + public bool IsAttributeUsed(VFXAttribute attrib) { return GetAttributeMode(attrib) != VFXAttributeMode.None; } + public bool IsAttributeUsed(VFXAttribute attrib, VFXContext context) { return GetAttributeMode(attrib, context) != VFXAttributeMode.None; } - public bool IsCurrentAttributeUsed(VFXAttribute attrib) { return (GetAttributeMode(attrib) & VFXAttributeMode.ReadWrite) != 0; } - public bool IsCurrentAttributeUsed(VFXAttribute attrib, VFXContext context) { return (GetAttributeMode(attrib, context) & VFXAttributeMode.ReadWrite) != 0; } + public bool IsCurrentAttributeUsed(VFXAttribute attrib) { return (GetAttributeMode(attrib) & VFXAttributeMode.ReadWrite) != 0; } + public bool IsCurrentAttributeUsed(VFXAttribute attrib, VFXContext context) { return (GetAttributeMode(attrib, context) & VFXAttributeMode.ReadWrite) != 0; } - public bool IsSourceAttributeUsed(VFXAttribute attrib) { return (GetAttributeMode(attrib) & VFXAttributeMode.ReadSource) != 0; } - public bool IsSourceAttributeUsed(VFXAttribute attrib, VFXContext context) { return (GetAttributeMode(attrib, context) & VFXAttributeMode.ReadSource) != 0; } + public bool IsSourceAttributeUsed(VFXAttribute attrib) { return (GetAttributeMode(attrib) & VFXAttributeMode.ReadSource) != 0; } + public bool IsSourceAttributeUsed(VFXAttribute attrib, VFXContext context) { return (GetAttributeMode(attrib, context) & VFXAttributeMode.ReadSource) != 0; } - public bool IsAttributeLocal(VFXAttribute attrib) { return m_LocalCurrentAttributes.Contains(attrib); } - public bool IsAttributeStored(VFXAttribute attrib) { return m_StoredCurrentAttributes.ContainsKey(attrib); } + public bool IsAttributeLocal(VFXAttribute attrib) { return m_LocalCurrentAttributes.Contains(attrib); } + public bool IsAttributeStored(VFXAttribute attrib) { return m_StoredCurrentAttributes.ContainsKey(attrib); } public VFXAttributeMode GetAttributeMode(VFXAttribute attrib, VFXContext context) { @@ -423,7 +423,7 @@ private void ProcessAttributes() { var context = kvp2.Key; if (context.contextType == VFXContextType.Init - && (kvp2.Value & VFXAttributeMode.ReadSource) != 0) + && (kvp2.Value & VFXAttributeMode.ReadSource) != 0) { readSourceInInit = true; } diff --git a/com.unity.visualeffectgraph/Editor/Data/VFXDataParticle.cs b/com.unity.visualeffectgraph/Editor/Data/VFXDataParticle.cs index 29e6e3ab55f..eb76b153b8e 100644 --- a/com.unity.visualeffectgraph/Editor/Data/VFXDataParticle.cs +++ b/com.unity.visualeffectgraph/Editor/Data/VFXDataParticle.cs @@ -203,7 +203,8 @@ internal enum DataType [VFXSetting(VFXSettingAttribute.VisibleFlags.InInspector), SerializeField] protected DataType dataType = DataType.Particle; - [VFXSetting, Delayed, SerializeField, FormerlySerializedAs("m_Capacity")][Tooltip("Sets the maximum particle capacity of this system. Particles spawned after the capacity has been reached are discarded.")] + [VFXSetting, Delayed, SerializeField, FormerlySerializedAs("m_Capacity")] + [Tooltip("Sets the maximum particle capacity of this system. Particles spawned after the capacity has been reached are discarded.")] protected uint capacity = 128; [VFXSetting, Delayed, SerializeField] protected uint stripCapacity = 1; @@ -863,7 +864,7 @@ public override void FillDescs( { if (mapping.index < 0) { - reporter?.RegisterError(context.GetSlotByPath(true, mapping.name), "GPUNodeLinkedTOCPUSlot", VFXErrorType.Error, "Can not link a GPU operator to a system wide (CPU) input.");; + reporter?.RegisterError(context.GetSlotByPath(true, mapping.name), "GPUNodeLinkedTOCPUSlot", VFXErrorType.Error, "Can not link a GPU operator to a system wide (CPU) input."); ; throw new InvalidOperationException("Unable to compute CPU expression for mapping : " + mapping.name); } } diff --git a/com.unity.visualeffectgraph/Editor/Debug/VFXUIDebug.cs b/com.unity.visualeffectgraph/Editor/Debug/VFXUIDebug.cs index 0fee7ff7783..6b4ade13bb9 100644 --- a/com.unity.visualeffectgraph/Editor/Debug/VFXUIDebug.cs +++ b/com.unity.visualeffectgraph/Editor/Debug/VFXUIDebug.cs @@ -172,14 +172,14 @@ private static Func GetWorldClipRect() var worldClipProp = typeof(VisualElement).GetMethod("get_worldClip", BindingFlags.NonPublic | BindingFlags.Instance); if (worldClipProp != null) { - return delegate(VisualElement elt) + return delegate (VisualElement elt) { return (Rect)worldClipProp.Invoke(elt, null); }; } Debug.LogError("could not retrieve get_worldClip"); - return delegate(VisualElement elt) + return delegate (VisualElement elt) { return new Rect(); }; @@ -923,7 +923,7 @@ Action FocusParticleSystem(string systemName) } } - return () => {}; + return () => { }; } Action CapacitySetter(string systemName, out bool isSystemInSubGraph) @@ -947,7 +947,7 @@ Action CapacitySetter(string systemName, out bool isSystemInSubGraph) } } isSystemInSubGraph = false; - return (e) => {}; + return (e) => { }; } void UpdateSystemInfoEntry(int systemId, VFXParticleSystemInfo stat) diff --git a/com.unity.visualeffectgraph/Editor/Expressions/VFXAttributeExpression.cs b/com.unity.visualeffectgraph/Editor/Expressions/VFXAttributeExpression.cs index 1646612bad3..b9a82dcd083 100644 --- a/com.unity.visualeffectgraph/Editor/Expressions/VFXAttributeExpression.cs +++ b/com.unity.visualeffectgraph/Editor/Expressions/VFXAttributeExpression.cs @@ -20,84 +20,84 @@ struct VFXAttribute { public static readonly float kDefaultSize = 0.1f; [Tooltip("Outputs a unique, constant, per-particle random value.")] - public static readonly VFXAttribute Seed = new VFXAttribute("seed", VFXValueType.Uint32); + public static readonly VFXAttribute Seed = new VFXAttribute("seed", VFXValueType.Uint32); [Tooltip("No special function at the moment, can be used as a custom Vector3 to store additional per-particle data.")] - public static readonly VFXAttribute OldPosition = new VFXAttribute("oldPosition", VFXValueType.Float3, VFXVariadic.False, SpaceableType.Position); + public static readonly VFXAttribute OldPosition = new VFXAttribute("oldPosition", VFXValueType.Float3, VFXVariadic.False, SpaceableType.Position); [Tooltip("The current position of the particle.")] - public static readonly VFXAttribute Position = new VFXAttribute("position", VFXValueType.Float3, VFXVariadic.False, SpaceableType.Position); + public static readonly VFXAttribute Position = new VFXAttribute("position", VFXValueType.Float3, VFXVariadic.False, SpaceableType.Position); [Tooltip("The velocity of the particle.")] - public static readonly VFXAttribute Velocity = new VFXAttribute("velocity", VFXValueType.Float3, VFXVariadic.False, SpaceableType.Vector); + public static readonly VFXAttribute Velocity = new VFXAttribute("velocity", VFXValueType.Float3, VFXVariadic.False, SpaceableType.Vector); [Tooltip("The direction the particle is moving in.")] - public static readonly VFXAttribute Direction = new VFXAttribute("direction", VFXValue.Constant(new Vector3(0.0f, 0.0f, 1.0f)), VFXVariadic.False, SpaceableType.Vector); + public static readonly VFXAttribute Direction = new VFXAttribute("direction", VFXValue.Constant(new Vector3(0.0f, 0.0f, 1.0f)), VFXVariadic.False, SpaceableType.Vector); [Tooltip("The color of the particle.")] - public static readonly VFXAttribute Color = new VFXAttribute("color", VFXValue.Constant(Vector3.one)); + public static readonly VFXAttribute Color = new VFXAttribute("color", VFXValue.Constant(Vector3.one)); [Tooltip("The transparency value of the particle. Transparent particles with a value of 0 or less are invisible.")] - public static readonly VFXAttribute Alpha = new VFXAttribute("alpha", VFXValue.Constant(1.0f)); + public static readonly VFXAttribute Alpha = new VFXAttribute("alpha", VFXValue.Constant(1.0f)); [Tooltip("The uniform size of the particle.")] - public static readonly VFXAttribute Size = new VFXAttribute("size", VFXValue.Constant(kDefaultSize)); + public static readonly VFXAttribute Size = new VFXAttribute("size", VFXValue.Constant(kDefaultSize)); [Tooltip("The scale of the particle along the X axis, as a multiplier to its size.")] - public static readonly VFXAttribute ScaleX = new VFXAttribute("scaleX", VFXValue.Constant(1.0f), VFXVariadic.BelongsToVariadic); + public static readonly VFXAttribute ScaleX = new VFXAttribute("scaleX", VFXValue.Constant(1.0f), VFXVariadic.BelongsToVariadic); [Tooltip("The per-axis scale of the particle along the Y axis, as a multiplier to its size.")] - public static readonly VFXAttribute ScaleY = new VFXAttribute("scaleY", VFXValue.Constant(1.0f), VFXVariadic.BelongsToVariadic); + public static readonly VFXAttribute ScaleY = new VFXAttribute("scaleY", VFXValue.Constant(1.0f), VFXVariadic.BelongsToVariadic); [Tooltip("The per-axis scale of the particle along the Z axis, as a multiplier to its size.")] - public static readonly VFXAttribute ScaleZ = new VFXAttribute("scaleZ", VFXValue.Constant(1.0f), VFXVariadic.BelongsToVariadic); + public static readonly VFXAttribute ScaleZ = new VFXAttribute("scaleZ", VFXValue.Constant(1.0f), VFXVariadic.BelongsToVariadic); [Tooltip("Indicates how long the particle can stay alive. If the particle’s age exceeds its lifetime, the particle is destroyed.")] - public static readonly VFXAttribute Lifetime = new VFXAttribute("lifetime", VFXValue.Constant(1.0f)); + public static readonly VFXAttribute Lifetime = new VFXAttribute("lifetime", VFXValue.Constant(1.0f)); [Tooltip("The age of the particle. If a particle’s age exceeds its lifetime, it gets destroyed.")] - public static readonly VFXAttribute Age = new VFXAttribute("age", VFXValueType.Float); + public static readonly VFXAttribute Age = new VFXAttribute("age", VFXValueType.Float); [Tooltip("The particle angle per axis. For Camera-facing billboard particles, the Z axis is most likely the desired axis of rotation.")] - public static readonly VFXAttribute AngleX = new VFXAttribute("angleX", VFXValueType.Float, VFXVariadic.BelongsToVariadic); + public static readonly VFXAttribute AngleX = new VFXAttribute("angleX", VFXValueType.Float, VFXVariadic.BelongsToVariadic); [Tooltip("The particle angle per axis. For Camera-facing billboard particles, the Z axis is most likely the desired axis of rotation.")] - public static readonly VFXAttribute AngleY = new VFXAttribute("angleY", VFXValueType.Float, VFXVariadic.BelongsToVariadic); + public static readonly VFXAttribute AngleY = new VFXAttribute("angleY", VFXValueType.Float, VFXVariadic.BelongsToVariadic); [Tooltip("The particle angle per axis. For Camera-facing billboard particles, the Z axis is most likely the desired axis of rotation.")] - public static readonly VFXAttribute AngleZ = new VFXAttribute("angleZ", VFXValueType.Float, VFXVariadic.BelongsToVariadic); + public static readonly VFXAttribute AngleZ = new VFXAttribute("angleZ", VFXValueType.Float, VFXVariadic.BelongsToVariadic); [Tooltip("The angular rotation of the particle, in degrees per second.")] - public static readonly VFXAttribute AngularVelocityX = new VFXAttribute("angularVelocityX", VFXValueType.Float, VFXVariadic.BelongsToVariadic); + public static readonly VFXAttribute AngularVelocityX = new VFXAttribute("angularVelocityX", VFXValueType.Float, VFXVariadic.BelongsToVariadic); [Tooltip("The angular rotation of the particle, in degrees per second.")] - public static readonly VFXAttribute AngularVelocityY = new VFXAttribute("angularVelocityY", VFXValueType.Float, VFXVariadic.BelongsToVariadic); + public static readonly VFXAttribute AngularVelocityY = new VFXAttribute("angularVelocityY", VFXValueType.Float, VFXVariadic.BelongsToVariadic); [Tooltip("The angular rotation of the particle, in degrees per second.")] - public static readonly VFXAttribute AngularVelocityZ = new VFXAttribute("angularVelocityZ", VFXValueType.Float, VFXVariadic.BelongsToVariadic); + public static readonly VFXAttribute AngularVelocityZ = new VFXAttribute("angularVelocityZ", VFXValueType.Float, VFXVariadic.BelongsToVariadic); [Tooltip("The current index of the flipbook. This attribute is used if ‘UV Mode’ in the output is set to use flipbooks.")] - public static readonly VFXAttribute TexIndex = new VFXAttribute("texIndex", VFXValueType.Float); + public static readonly VFXAttribute TexIndex = new VFXAttribute("texIndex", VFXValueType.Float); [Tooltip("The current index of the mesh. This attribute is used with multi mesh outputs.")] - public static readonly VFXAttribute MeshIndex = new VFXAttribute("meshIndex", VFXValueType.Uint32); + public static readonly VFXAttribute MeshIndex = new VFXAttribute("meshIndex", VFXValueType.Uint32); [Tooltip("The point around which the particle rotates, moves, or is scaled. By default, this is the center of the particle.")] - public static readonly VFXAttribute PivotX = new VFXAttribute("pivotX", VFXValue.Constant(0.0f), VFXVariadic.BelongsToVariadic); + public static readonly VFXAttribute PivotX = new VFXAttribute("pivotX", VFXValue.Constant(0.0f), VFXVariadic.BelongsToVariadic); [Tooltip("The point around which the particle rotates, moves, or is scaled. By default, this is the center of the particle.")] - public static readonly VFXAttribute PivotY = new VFXAttribute("pivotY", VFXValue.Constant(0.0f), VFXVariadic.BelongsToVariadic); + public static readonly VFXAttribute PivotY = new VFXAttribute("pivotY", VFXValue.Constant(0.0f), VFXVariadic.BelongsToVariadic); [Tooltip("The point around which the particle rotates, moves, or is scaled. By default, this is the center of the particle.")] - public static readonly VFXAttribute PivotZ = new VFXAttribute("pivotZ", VFXValue.Constant(0.0f), VFXVariadic.BelongsToVariadic); + public static readonly VFXAttribute PivotZ = new VFXAttribute("pivotZ", VFXValue.Constant(0.0f), VFXVariadic.BelongsToVariadic); [Tooltip("Outputs the ID of the particle. Each particle gets assigned an incremental unique ID value when it is created.")] - public static readonly VFXAttribute ParticleId = new VFXAttribute("particleId", VFXValueType.Uint32); + public static readonly VFXAttribute ParticleId = new VFXAttribute("particleId", VFXValueType.Uint32); [Tooltip("Determines which is the X (right-left) axis of the particle.")] - public static readonly VFXAttribute AxisX = new VFXAttribute("axisX", VFXValue.Constant(Vector3.right), VFXVariadic.False, SpaceableType.Vector); + public static readonly VFXAttribute AxisX = new VFXAttribute("axisX", VFXValue.Constant(Vector3.right), VFXVariadic.False, SpaceableType.Vector); [Tooltip("Determines which is the Y (up-down) axis of the particle.")] - public static readonly VFXAttribute AxisY = new VFXAttribute("axisY", VFXValue.Constant(Vector3.up), VFXVariadic.False, SpaceableType.Vector); + public static readonly VFXAttribute AxisY = new VFXAttribute("axisY", VFXValue.Constant(Vector3.up), VFXVariadic.False, SpaceableType.Vector); [Tooltip("Determines which is the Z (forward-back) axis of the particle.")] - public static readonly VFXAttribute AxisZ = new VFXAttribute("axisZ", VFXValue.Constant(Vector3.forward), VFXVariadic.False, SpaceableType.Vector); + public static readonly VFXAttribute AxisZ = new VFXAttribute("axisZ", VFXValue.Constant(Vector3.forward), VFXVariadic.False, SpaceableType.Vector); [Tooltip("Indicates whether a particle is alive or should be destroyed. Can also be used within an output to toggle the rendering of that particle, without destroying it.")] - public static readonly VFXAttribute Alive = new VFXAttribute("alive", VFXValue.Constant(true)); + public static readonly VFXAttribute Alive = new VFXAttribute("alive", VFXValue.Constant(true)); [Tooltip("The mass of the particle, which is used in many physics calculations.")] - public static readonly VFXAttribute Mass = new VFXAttribute("mass", VFXValue.Constant(1.0f)); + public static readonly VFXAttribute Mass = new VFXAttribute("mass", VFXValue.Constant(1.0f)); [Tooltip("The position where the particle is aiming to go. This value is used by the line output, but it can also be used to store any desired value for a custom simulation.")] - public static readonly VFXAttribute TargetPosition = new VFXAttribute("targetPosition", VFXValueType.Float3, VFXVariadic.False, SpaceableType.Position); + public static readonly VFXAttribute TargetPosition = new VFXAttribute("targetPosition", VFXValueType.Float3, VFXVariadic.False, SpaceableType.Position); [Tooltip("")] - public static readonly VFXAttribute EventCount = new VFXAttribute("eventCount", VFXValueType.Uint32); + public static readonly VFXAttribute EventCount = new VFXAttribute("eventCount", VFXValueType.Uint32); [Tooltip("Outputs the time since the Spawn context was triggered. To use, add a 'Set Spawn Time' block to the desired Spawn Context.")] - public static readonly VFXAttribute SpawnTime = new VFXAttribute("spawnTime", VFXValueType.Float); + public static readonly VFXAttribute SpawnTime = new VFXAttribute("spawnTime", VFXValueType.Float); [Tooltip("Outputs the index of the particle within its particle strip. Each particle gets assigned an incremental index value for the strip within which it is created. This attribute is available in systems using the 'Particle Strip' data type.")] - public static readonly VFXAttribute ParticleIndexInStrip = new VFXAttribute("particleIndexInStrip", VFXValueType.Uint32); + public static readonly VFXAttribute ParticleIndexInStrip = new VFXAttribute("particleIndexInStrip", VFXValueType.Uint32); [Tooltip("Outputs the index of the particle within all the particles spawned in the current frame.")] - public static readonly VFXAttribute SpawnIndex = new VFXAttribute("spawnIndex", VFXValueType.Uint32); + public static readonly VFXAttribute SpawnIndex = new VFXAttribute("spawnIndex", VFXValueType.Uint32); [Tooltip("Outputs the index of the current strip. Each strip gets assigned an incremental value when it is created. This attribute is available in systems using the 'Particle Strip' data type.")] - public static readonly VFXAttribute StripIndex = new VFXAttribute("stripIndex", VFXValueType.Uint32); + public static readonly VFXAttribute StripIndex = new VFXAttribute("stripIndex", VFXValueType.Uint32); [Tooltip("Outputs the total particle count within the current strip. This attribute is available in systems using the 'Particle Strip' data type.")] - public static readonly VFXAttribute ParticleCountInStrip = new VFXAttribute("particleCountInStrip", VFXValueType.Uint32); + public static readonly VFXAttribute ParticleCountInStrip = new VFXAttribute("particleCountInStrip", VFXValueType.Uint32); [Tooltip("Outputs the spawn index of the particle within its strip. This attribute is available in systems using the 'Particle Strip' data type.")] - public static readonly VFXAttribute SpawnIndexInStrip = new VFXAttribute("spawnIndexInStrip", VFXValueType.Uint32); + public static readonly VFXAttribute SpawnIndexInStrip = new VFXAttribute("spawnIndexInStrip", VFXValueType.Uint32); // Internal as we dont want it to appear in the graph - internal static readonly VFXAttribute StripAlive = new VFXAttribute("stripAlive", VFXValue.Constant(true)); // Internal attribute used to keep track of the state of the attached strip (TODO: Use a number to handle more tha 1 strip) + internal static readonly VFXAttribute StripAlive = new VFXAttribute("stripAlive", VFXValue.Constant(true)); // Internal attribute used to keep track of the state of the attached strip (TODO: Use a number to handle more tha 1 strip) public static readonly VFXAttribute[] AllAttribute = VFXReflectionHelper.CollectStaticReadOnlyExpression(typeof(VFXAttribute)); public static readonly VFXAttribute[] AllAttributeReadOnly = new VFXAttribute[] { Seed, ParticleId, SpawnTime, ParticleIndexInStrip, SpawnIndex, StripIndex, ParticleCountInStrip, SpawnIndexInStrip }; @@ -353,5 +353,5 @@ public override IEnumerable GetNeededAttributes() protected override int[] additionnalOperands => new int[] { (int)m_elementOffset, (int)m_attribute.type }; } - #pragma warning restore 0659 +#pragma warning restore 0659 } diff --git a/com.unity.visualeffectgraph/Editor/Expressions/VFXBuiltInExpression.cs b/com.unity.visualeffectgraph/Editor/Expressions/VFXBuiltInExpression.cs index 9e8cdf27876..9d475b64ea2 100644 --- a/com.unity.visualeffectgraph/Editor/Expressions/VFXBuiltInExpression.cs +++ b/com.unity.visualeffectgraph/Editor/Expressions/VFXBuiltInExpression.cs @@ -5,7 +5,7 @@ namespace UnityEditor.VFX { - #pragma warning disable 0659 +#pragma warning disable 0659 sealed class VFXBuiltInExpression : VFXExpression { public static readonly VFXExpression FrameIndex = new VFXBuiltInExpression(VFXExpressionOperation.FrameIndex); @@ -70,5 +70,5 @@ protected sealed override VFXExpression Evaluate(VFXExpression[] constParents) return this; } } - #pragma warning restore 0659 +#pragma warning restore 0659 } diff --git a/com.unity.visualeffectgraph/Editor/Expressions/VFXExpressionAbstract.cs b/com.unity.visualeffectgraph/Editor/Expressions/VFXExpressionAbstract.cs index 12a925a217d..20c5ac6e188 100644 --- a/com.unity.visualeffectgraph/Editor/Expressions/VFXExpressionAbstract.cs +++ b/com.unity.visualeffectgraph/Editor/Expressions/VFXExpressionAbstract.cs @@ -76,15 +76,15 @@ public int[] ToArray() [Flags] public enum Flags { - None = 0, - Value = 1 << 0, // Expression is a value, get/set can be called on it - Foldable = 1 << 1, // Expression is not a constant but can be folded anyway - Constant = 1 << 2, // Expression is a constant, it can be folded - InvalidOnGPU = 1 << 3, // Expression can be evaluated on GPU - InvalidOnCPU = 1 << 4, // Expression can be evaluated on CPU + None = 0, + Value = 1 << 0, // Expression is a value, get/set can be called on it + Foldable = 1 << 1, // Expression is not a constant but can be folded anyway + Constant = 1 << 2, // Expression is a constant, it can be folded + InvalidOnGPU = 1 << 3, // Expression can be evaluated on GPU + InvalidOnCPU = 1 << 4, // Expression can be evaluated on CPU InvalidConstant = 1 << 5, // Expression can be folded (for UI) but constant folding is forbidden - PerElement = 1 << 6, // Expression is per element - PerSpawn = 1 << 7, // Expression relies on event attribute or spawn context + PerElement = 1 << 6, // Expression is per element + PerSpawn = 1 << 7, // Expression relies on event attribute or spawn context NotCompilableOnCPU = InvalidOnCPU | PerElement //Helper to filter out invalid expression on CPU } @@ -370,7 +370,7 @@ private static VFXExpression CreateNewInstance(Type expressionType) if (allconstructors.Length == 0) return null; //Only static readonly expression allowed, constructors are private (attribute or builtIn) - var constructor = allconstructors + var constructor = allconstructors .OrderBy(o => o.GetParameters().Count()) //promote simplest (or default) constructors .First(); var param = constructor.GetParameters().Select(o => @@ -432,8 +432,8 @@ public virtual IEnumerable GetNeededAttributes() return Enumerable.Empty(); } - public bool Is(Flags flag) { return (m_Flags & flag) == flag; } - public bool IsAny(Flags flag) { return (m_Flags & flag) != 0; } + public bool Is(Flags flag) { return (m_Flags & flag) == flag; } + public bool IsAny(Flags flag) { return (m_Flags & flag) != 0; } public virtual VFXValueType valueType { @@ -570,23 +570,23 @@ private void PropagateParentsFlags() } } - public static VFXExpression operator*(VFXExpression a, VFXExpression b) { return new VFXExpressionMul(a, b); } - public static VFXExpression operator/(VFXExpression a, VFXExpression b) { return new VFXExpressionDivide(a, b); } - public static VFXExpression operator+(VFXExpression a, VFXExpression b) { return new VFXExpressionAdd(a, b); } - public static VFXExpression operator-(VFXExpression a, VFXExpression b) { return new VFXExpressionSubtract(a, b); } + public static VFXExpression operator *(VFXExpression a, VFXExpression b) { return new VFXExpressionMul(a, b); } + public static VFXExpression operator /(VFXExpression a, VFXExpression b) { return new VFXExpressionDivide(a, b); } + public static VFXExpression operator +(VFXExpression a, VFXExpression b) { return new VFXExpressionAdd(a, b); } + public static VFXExpression operator -(VFXExpression a, VFXExpression b) { return new VFXExpressionSubtract(a, b); } - public static VFXExpression operator|(VFXExpression a, VFXExpression b) { return new VFXExpressionBitwiseOr(a, b); } - public static VFXExpression operator&(VFXExpression a, VFXExpression b) { return new VFXExpressionBitwiseAnd(a, b); } - public static VFXExpression operator|(VFXExpression a, uint b) { return new VFXExpressionBitwiseOr(a, VFXValue.Constant(b)); } - public static VFXExpression operator&(VFXExpression a, uint b) { return new VFXExpressionBitwiseAnd(a, VFXValue.Constant(b)); } - public static VFXExpression operator<<(VFXExpression a, int shift) { return new VFXExpressionBitwiseLeftShift(a, VFXValue.Constant((uint)shift)); } - public static VFXExpression operator>>(VFXExpression a, int shift) { return new VFXExpressionBitwiseRightShift(a, VFXValue.Constant((uint)shift)); } + public static VFXExpression operator |(VFXExpression a, VFXExpression b) { return new VFXExpressionBitwiseOr(a, b); } + public static VFXExpression operator &(VFXExpression a, VFXExpression b) { return new VFXExpressionBitwiseAnd(a, b); } + public static VFXExpression operator |(VFXExpression a, uint b) { return new VFXExpressionBitwiseOr(a, VFXValue.Constant(b)); } + public static VFXExpression operator &(VFXExpression a, uint b) { return new VFXExpressionBitwiseAnd(a, VFXValue.Constant(b)); } + public static VFXExpression operator <<(VFXExpression a, int shift) { return new VFXExpressionBitwiseLeftShift(a, VFXValue.Constant((uint)shift)); } + public static VFXExpression operator >>(VFXExpression a, int shift) { return new VFXExpressionBitwiseRightShift(a, VFXValue.Constant((uint)shift)); } public VFXExpression this[int index] { get { return new VFXExpressionExtractComponent(this, index); } } - public VFXExpression x { get { return new VFXExpressionExtractComponent(this, 0); } } - public VFXExpression y { get { return new VFXExpressionExtractComponent(this, 1); } } - public VFXExpression z { get { return new VFXExpressionExtractComponent(this, 2); } } - public VFXExpression w { get { return new VFXExpressionExtractComponent(this, 3); } } + public VFXExpression x { get { return new VFXExpressionExtractComponent(this, 0); } } + public VFXExpression y { get { return new VFXExpressionExtractComponent(this, 1); } } + public VFXExpression z { get { return new VFXExpressionExtractComponent(this, 2); } } + public VFXExpression w { get { return new VFXExpressionExtractComponent(this, 3); } } public VFXExpression xxx { get { return new VFXExpressionCombine(x, x, x); } } public VFXExpression yyy { get { return new VFXExpressionCombine(y, y, y); } } public VFXExpression zzz { get { return new VFXExpressionCombine(z, z, z); } } diff --git a/com.unity.visualeffectgraph/Editor/Expressions/VFXExpressionAbstractNumericOperation.cs b/com.unity.visualeffectgraph/Editor/Expressions/VFXExpressionAbstractNumericOperation.cs index 9bc99e2c9c0..ce73fa36c26 100644 --- a/com.unity.visualeffectgraph/Editor/Expressions/VFXExpressionAbstractNumericOperation.cs +++ b/com.unity.visualeffectgraph/Editor/Expressions/VFXExpressionAbstractNumericOperation.cs @@ -11,7 +11,7 @@ abstract class VFXExpressionNumericOperation : VFXExpression protected VFXExpressionNumericOperation(VFXExpression[] parents) : base(Flags.None, parents) { - m_additionnalOperands = new int[] {}; + m_additionnalOperands = new int[] { }; } static private object[] ToObjectArray(float input) { return new object[] { input }; } diff --git a/com.unity.visualeffectgraph/Editor/Expressions/VFXExpressionAbstractValues.cs b/com.unity.visualeffectgraph/Editor/Expressions/VFXExpressionAbstractValues.cs index 945c156d3c5..36670a00ef0 100644 --- a/com.unity.visualeffectgraph/Editor/Expressions/VFXExpressionAbstractValues.cs +++ b/com.unity.visualeffectgraph/Editor/Expressions/VFXExpressionAbstractValues.cs @@ -7,7 +7,7 @@ namespace UnityEditor.VFX { - #pragma warning disable 0659 +#pragma warning disable 0659 abstract class VFXValue : VFXExpression { public enum Mode diff --git a/com.unity.visualeffectgraph/Editor/Expressions/VFXExpressionCamera.cs b/com.unity.visualeffectgraph/Editor/Expressions/VFXExpressionCamera.cs index bf5f1ab7218..a17c4e6eb02 100644 --- a/com.unity.visualeffectgraph/Editor/Expressions/VFXExpressionCamera.cs +++ b/com.unity.visualeffectgraph/Editor/Expressions/VFXExpressionCamera.cs @@ -147,14 +147,14 @@ sealed protected override VFXExpression Evaluate(VFXExpression[] constParents) class VFXExpressionGetBufferFromMainCamera : VFXExpression { public VFXExpressionGetBufferFromMainCamera() : this(VFXCameraBufferTypes.None) - {} + { } public VFXExpressionGetBufferFromMainCamera(VFXCameraBufferTypes bufferType) : base(VFXExpression.Flags.InvalidOnGPU) { m_BufferType = bufferType; } - public override VFXExpressionOperation operation { get { return VFXExpressionOperation.GetBufferFromMainCamera; }} + public override VFXExpressionOperation operation { get { return VFXExpressionOperation.GetBufferFromMainCamera; } } sealed protected override VFXExpression Evaluate(VFXExpression[] constParents) { return VFXValue.Constant(null); } protected override VFXExpression Reduce(VFXExpression[] reducedParents) diff --git a/com.unity.visualeffectgraph/Editor/Expressions/VFXExpressionCombine.cs b/com.unity.visualeffectgraph/Editor/Expressions/VFXExpressionCombine.cs index 58ae87f33b1..d411f88a02b 100644 --- a/com.unity.visualeffectgraph/Editor/Expressions/VFXExpressionCombine.cs +++ b/com.unity.visualeffectgraph/Editor/Expressions/VFXExpressionCombine.cs @@ -10,7 +10,7 @@ namespace UnityEditor.VFX class VFXExpressionCombine : VFXExpressionNumericOperation { public VFXExpressionCombine() : this(VFXValue.Default, VFXValue.Default) - {} + { } public VFXExpressionCombine(params VFXExpression[] parents) : base(parents) diff --git a/com.unity.visualeffectgraph/Editor/Expressions/VFXExpressionContext.cs b/com.unity.visualeffectgraph/Editor/Expressions/VFXExpressionContext.cs index 5715090b089..b4854039555 100644 --- a/com.unity.visualeffectgraph/Editor/Expressions/VFXExpressionContext.cs +++ b/com.unity.visualeffectgraph/Editor/Expressions/VFXExpressionContext.cs @@ -202,9 +202,9 @@ public VFXExpression Compile(VFXExpression expression) var parents = expression.parents.Select(e => { var parent = Compile(e); - bool currentGPUTransformation = gpuTransformation - && expression.IsAny(VFXExpression.Flags.NotCompilableOnCPU) - && !parent.IsAny(VFXExpression.Flags.NotCompilableOnCPU); + bool currentGPUTransformation = gpuTransformation + && expression.IsAny(VFXExpression.Flags.NotCompilableOnCPU) + && !parent.IsAny(VFXExpression.Flags.NotCompilableOnCPU); parent = PatchVFXExpression(parent, expression, currentGPUTransformation, patchReadAttributeForSpawn, m_GlobalEventAttribute); return parent; }).ToArray(); diff --git a/com.unity.visualeffectgraph/Editor/Expressions/VFXExpressionExtractComponent.cs b/com.unity.visualeffectgraph/Editor/Expressions/VFXExpressionExtractComponent.cs index eff57be7031..560dc9ccc82 100644 --- a/com.unity.visualeffectgraph/Editor/Expressions/VFXExpressionExtractComponent.cs +++ b/com.unity.visualeffectgraph/Editor/Expressions/VFXExpressionExtractComponent.cs @@ -5,7 +5,7 @@ namespace UnityEditor.VFX { class VFXExpressionExtractComponent : VFXExpressionNumericOperation { - public VFXExpressionExtractComponent() : this(VFXValue.Default, 0) {} + public VFXExpressionExtractComponent() : this(VFXValue.Default, 0) { } public VFXExpressionExtractComponent(VFXExpression parent, int iChannel) : base(new VFXExpression[1] { parent }) diff --git a/com.unity.visualeffectgraph/Editor/Expressions/VFXExpressionFlow.cs b/com.unity.visualeffectgraph/Editor/Expressions/VFXExpressionFlow.cs index 196fb5b5f8a..6792611a51a 100644 --- a/com.unity.visualeffectgraph/Editor/Expressions/VFXExpressionFlow.cs +++ b/com.unity.visualeffectgraph/Editor/Expressions/VFXExpressionFlow.cs @@ -18,7 +18,7 @@ class VFXExpressionCondition : VFXExpression { public VFXExpressionCondition() : this(VFXValueType.Float, VFXCondition.Equal, VFXValue.Constant(0.0f), VFXValue.Constant(0.0f)) - {} + { } public VFXExpressionCondition(VFXValueType type, VFXCondition cond, VFXExpression left, VFXExpression right) : base(VFXExpression.Flags.None, new VFXExpression[] { left, right }) { @@ -49,12 +49,12 @@ private VFXValue Evaluate(VFXExpression[] constParents) where T : IComp bool res = false; switch (condition) { - case VFXCondition.Equal: res = comp == 0; break; - case VFXCondition.NotEqual: res = comp != 0; break; - case VFXCondition.Less: res = comp < 0; break; - case VFXCondition.LessOrEqual: res = comp <= 0; break; - case VFXCondition.Greater: res = comp > 0; break; - case VFXCondition.GreaterOrEqual: res = comp >= 0; break; + case VFXCondition.Equal: res = comp == 0; break; + case VFXCondition.NotEqual: res = comp != 0; break; + case VFXCondition.Less: res = comp < 0; break; + case VFXCondition.LessOrEqual: res = comp <= 0; break; + case VFXCondition.Greater: res = comp > 0; break; + case VFXCondition.GreaterOrEqual: res = comp >= 0; break; default: throw new NotImplementedException("Invalid VFXCondition: " + condition); } @@ -65,9 +65,9 @@ sealed protected override VFXExpression Evaluate(VFXExpression[] constParents) { switch (type) { - case VFXValueType.Float: return Evaluate(constParents); - case VFXValueType.Int32: return Evaluate(constParents); - case VFXValueType.Uint32: return Evaluate(constParents); + case VFXValueType.Float: return Evaluate(constParents); + case VFXValueType.Int32: return Evaluate(constParents); + case VFXValueType.Uint32: return Evaluate(constParents); default: throw new NotImplementedException("This type is not handled by condition expression: " + type); } } @@ -77,12 +77,12 @@ public override string GetCodeString(string[] parents) string comparator = null; switch (condition) { - case VFXCondition.Equal: comparator = "=="; break; - case VFXCondition.NotEqual: comparator = "!="; break; - case VFXCondition.Less: comparator = "<"; break; - case VFXCondition.LessOrEqual: comparator = "<="; break; - case VFXCondition.Greater: comparator = ">"; break; - case VFXCondition.GreaterOrEqual: comparator = ">="; break; + case VFXCondition.Equal: comparator = "=="; break; + case VFXCondition.NotEqual: comparator = "!="; break; + case VFXCondition.Less: comparator = "<"; break; + case VFXCondition.LessOrEqual: comparator = "<="; break; + case VFXCondition.Greater: comparator = ">"; break; + case VFXCondition.GreaterOrEqual: comparator = ">="; break; } return string.Format("{0} {1} {2}", parents[0], comparator, parents[1]); @@ -105,7 +105,7 @@ class VFXExpressionBranch : VFXExpression { public VFXExpressionBranch() : this(VFXValue.Constant(true), VFXValue.Constant(0.0f), VFXValue.Constant(0.0f)) - {} + { } public VFXExpressionBranch(VFXExpression pred, VFXExpression trueExp, VFXExpression falseExp) : base(VFXExpression.Flags.None, new VFXExpression[] { pred, trueExp, falseExp }) diff --git a/com.unity.visualeffectgraph/Editor/Expressions/VFXExpressionLoadTexture.cs b/com.unity.visualeffectgraph/Editor/Expressions/VFXExpressionLoadTexture.cs index d8891853e51..92beafd3114 100644 --- a/com.unity.visualeffectgraph/Editor/Expressions/VFXExpressionLoadTexture.cs +++ b/com.unity.visualeffectgraph/Editor/Expressions/VFXExpressionLoadTexture.cs @@ -13,8 +13,8 @@ public VFXExpressionLoadTexture2D() : this(VFXTexture2DValue.Default, VFXValue.Default) {} + public VFXExpressionCos() : this(VFXValue.Default) { } public VFXExpressionCos(VFXExpression parent) : base(parent, VFXExpressionOperation.Cos) { @@ -27,7 +27,7 @@ sealed protected override float ProcessUnaryOperation(float input) class VFXExpressionSin : VFXExpressionUnaryFloatOperation { - public VFXExpressionSin() : this(VFXValue.Default) {} + public VFXExpressionSin() : this(VFXValue.Default) { } public VFXExpressionSin(VFXExpression parent) : base(parent, VFXExpressionOperation.Sin) { @@ -46,7 +46,7 @@ sealed protected override float ProcessUnaryOperation(float input) class VFXExpressionTan : VFXExpressionUnaryFloatOperation { - public VFXExpressionTan() : this(VFXValue.Default) {} + public VFXExpressionTan() : this(VFXValue.Default) { } public VFXExpressionTan(VFXExpression parent) : base(parent, VFXExpressionOperation.Tan) { @@ -65,7 +65,7 @@ sealed protected override float ProcessUnaryOperation(float input) class VFXExpressionACos : VFXExpressionUnaryFloatOperation { - public VFXExpressionACos() : this(VFXValue.Default) {} + public VFXExpressionACos() : this(VFXValue.Default) { } public VFXExpressionACos(VFXExpression parent) : base(parent, VFXExpressionOperation.ACos) { @@ -84,7 +84,7 @@ sealed protected override float ProcessUnaryOperation(float input) class VFXExpressionASin : VFXExpressionUnaryFloatOperation { - public VFXExpressionASin() : this(VFXValue.Default) {} + public VFXExpressionASin() : this(VFXValue.Default) { } public VFXExpressionASin(VFXExpression parent) : base(parent, VFXExpressionOperation.ASin) { @@ -103,7 +103,7 @@ sealed protected override float ProcessUnaryOperation(float input) class VFXExpressionATan : VFXExpressionUnaryFloatOperation { - public VFXExpressionATan() : this(VFXValue.Default) {} + public VFXExpressionATan() : this(VFXValue.Default) { } public VFXExpressionATan(VFXExpression parent) : base(parent, VFXExpressionOperation.ATan) { @@ -122,7 +122,7 @@ sealed protected override float ProcessUnaryOperation(float input) class VFXExpressionLog2 : VFXExpressionUnaryFloatOperation { - public VFXExpressionLog2() : this(VFXValue.Default) {} + public VFXExpressionLog2() : this(VFXValue.Default) { } public VFXExpressionLog2(VFXExpression parent) : base(parent, VFXExpressionOperation.Log2) { @@ -141,7 +141,7 @@ sealed protected override float ProcessUnaryOperation(float input) class VFXExpressionAbs : VFXExpressionUnaryNumericOperation { - public VFXExpressionAbs() : this(VFXValue.Default) {} + public VFXExpressionAbs() : this(VFXValue.Default) { } public VFXExpressionAbs(VFXExpression parent) : base(parent, VFXExpressionOperation.Abs) { @@ -179,7 +179,7 @@ sealed protected override float ProcessUnaryOperation(float input) class VFXExpressionSign : VFXExpressionUnaryNumericOperation { - public VFXExpressionSign() : this(VFXValue.Default) {} + public VFXExpressionSign() : this(VFXValue.Default) { } public VFXExpressionSign(VFXExpression parent) : base(parent, VFXExpressionOperation.Sign) { @@ -217,7 +217,7 @@ protected override bool ProcessUnaryOperation(bool input) class VFXExpressionSaturate : VFXExpressionUnaryFloatOperation { - public VFXExpressionSaturate() : this(VFXValue.Default) {} + public VFXExpressionSaturate() : this(VFXValue.Default) { } public VFXExpressionSaturate(VFXExpression parent) : base(parent, VFXExpressionOperation.Saturate) { @@ -238,7 +238,7 @@ sealed protected override float ProcessUnaryOperation(float input) class VFXExpressionCeil : VFXExpressionUnaryFloatOperation { - public VFXExpressionCeil() : this(VFXValue.Default) {} + public VFXExpressionCeil() : this(VFXValue.Default) { } public VFXExpressionCeil(VFXExpression parent) : base(parent, VFXExpressionOperation.Ceil) { @@ -259,7 +259,7 @@ sealed protected override float ProcessUnaryOperation(float input) class VFXExpressionRound : VFXExpressionUnaryFloatOperation { - public VFXExpressionRound() : this(VFXValue.Default) {} + public VFXExpressionRound() : this(VFXValue.Default) { } public VFXExpressionRound(VFXExpression parent) : base(parent, VFXExpressionOperation.Round) { @@ -280,7 +280,7 @@ sealed protected override float ProcessUnaryOperation(float input) class VFXExpressionFrac : VFXExpressionUnaryFloatOperation { - public VFXExpressionFrac() : this(VFXValue.Default) {} + public VFXExpressionFrac() : this(VFXValue.Default) { } public VFXExpressionFrac(VFXExpression parent) : base(parent, VFXExpressionOperation.Frac) { @@ -301,7 +301,7 @@ sealed protected override float ProcessUnaryOperation(float input) class VFXExpressionFloor : VFXExpressionUnaryFloatOperation { - public VFXExpressionFloor() : this(VFXValue.Default) {} + public VFXExpressionFloor() : this(VFXValue.Default) { } public VFXExpressionFloor(VFXExpression parent) : base(parent, VFXExpressionOperation.Floor) { @@ -379,7 +379,7 @@ public VFXExpressionMul(VFXExpression parentLeft, VFXExpression parentRight) : b protected override VFXExpression Reduce(VFXExpression[] reducedParents) { - var zero = VFXOperatorUtility.ZeroExpression[reducedParents[0].valueType]; + var zero = VFXOperatorUtility.ZeroExpression[reducedParents[0].valueType]; if (zero.Equals(reducedParents[0]) || zero.Equals(reducedParents[1])) return zero; diff --git a/com.unity.visualeffectgraph/Editor/Expressions/VFXExpressionNoise.cs b/com.unity.visualeffectgraph/Editor/Expressions/VFXExpressionNoise.cs index 39df4ec228d..fcb7eea464d 100644 --- a/com.unity.visualeffectgraph/Editor/Expressions/VFXExpressionNoise.cs +++ b/com.unity.visualeffectgraph/Editor/Expressions/VFXExpressionNoise.cs @@ -8,8 +8,8 @@ namespace UnityEditor.VFX { class VFXExpressionValueNoise1D : VFXExpression { - public VFXExpressionValueNoise1D() : this(VFXValue.Default, VFXValue.Default, VFXValue.Default) {} - public VFXExpressionValueNoise1D(params VFXExpression[] parents) : base(VFXExpression.Flags.None, parents) {} + public VFXExpressionValueNoise1D() : this(VFXValue.Default, VFXValue.Default, VFXValue.Default) { } + public VFXExpressionValueNoise1D(params VFXExpression[] parents) : base(VFXExpression.Flags.None, parents) { } public override VFXExpressionOperation operation { get { return VFXExpressionOperation.ValueNoise1D; } } @@ -30,8 +30,8 @@ public override string GetCodeString(string[] parents) class VFXExpressionValueNoise2D : VFXExpression { - public VFXExpressionValueNoise2D() : this(VFXValue.Default, VFXValue.Default, VFXValue.Default) {} - public VFXExpressionValueNoise2D(params VFXExpression[] parents) : base(VFXExpression.Flags.None, parents) {} + public VFXExpressionValueNoise2D() : this(VFXValue.Default, VFXValue.Default, VFXValue.Default) { } + public VFXExpressionValueNoise2D(params VFXExpression[] parents) : base(VFXExpression.Flags.None, parents) { } public override VFXExpressionOperation operation { get { return VFXExpressionOperation.ValueNoise2D; } } @@ -52,8 +52,8 @@ public override string GetCodeString(string[] parents) class VFXExpressionValueNoise3D : VFXExpression { - public VFXExpressionValueNoise3D() : this(VFXValue.Default, VFXValue.Default, VFXValue.Default) {} - public VFXExpressionValueNoise3D(params VFXExpression[] parents) : base(VFXExpression.Flags.None, parents) {} + public VFXExpressionValueNoise3D() : this(VFXValue.Default, VFXValue.Default, VFXValue.Default) { } + public VFXExpressionValueNoise3D(params VFXExpression[] parents) : base(VFXExpression.Flags.None, parents) { } public override VFXExpressionOperation operation { get { return VFXExpressionOperation.ValueNoise3D; } } @@ -74,8 +74,8 @@ public override string GetCodeString(string[] parents) class VFXExpressionPerlinNoise1D : VFXExpression { - public VFXExpressionPerlinNoise1D() : this(VFXValue.Default, VFXValue.Default, VFXValue.Default) {} - public VFXExpressionPerlinNoise1D(params VFXExpression[] parents) : base(VFXExpression.Flags.None, parents) {} + public VFXExpressionPerlinNoise1D() : this(VFXValue.Default, VFXValue.Default, VFXValue.Default) { } + public VFXExpressionPerlinNoise1D(params VFXExpression[] parents) : base(VFXExpression.Flags.None, parents) { } public override VFXExpressionOperation operation { get { return VFXExpressionOperation.PerlinNoise1D; } } @@ -96,8 +96,8 @@ public override string GetCodeString(string[] parents) class VFXExpressionPerlinNoise2D : VFXExpression { - public VFXExpressionPerlinNoise2D() : this(VFXValue.Default, VFXValue.Default, VFXValue.Default) {} - public VFXExpressionPerlinNoise2D(params VFXExpression[] parents) : base(VFXExpression.Flags.None, parents) {} + public VFXExpressionPerlinNoise2D() : this(VFXValue.Default, VFXValue.Default, VFXValue.Default) { } + public VFXExpressionPerlinNoise2D(params VFXExpression[] parents) : base(VFXExpression.Flags.None, parents) { } public override VFXExpressionOperation operation { get { return VFXExpressionOperation.PerlinNoise2D; } } @@ -118,8 +118,8 @@ public override string GetCodeString(string[] parents) class VFXExpressionPerlinNoise3D : VFXExpression { - public VFXExpressionPerlinNoise3D() : this(VFXValue.Default, VFXValue.Default, VFXValue.Default) {} - public VFXExpressionPerlinNoise3D(params VFXExpression[] parents) : base(VFXExpression.Flags.None, parents) {} + public VFXExpressionPerlinNoise3D() : this(VFXValue.Default, VFXValue.Default, VFXValue.Default) { } + public VFXExpressionPerlinNoise3D(params VFXExpression[] parents) : base(VFXExpression.Flags.None, parents) { } public override VFXExpressionOperation operation { get { return VFXExpressionOperation.PerlinNoise3D; } } @@ -140,8 +140,8 @@ public override string GetCodeString(string[] parents) class VFXExpressionCellularNoise1D : VFXExpression { - public VFXExpressionCellularNoise1D() : this(VFXValue.Default, VFXValue.Default, VFXValue.Default) {} - public VFXExpressionCellularNoise1D(params VFXExpression[] parents) : base(VFXExpression.Flags.None, parents) {} + public VFXExpressionCellularNoise1D() : this(VFXValue.Default, VFXValue.Default, VFXValue.Default) { } + public VFXExpressionCellularNoise1D(params VFXExpression[] parents) : base(VFXExpression.Flags.None, parents) { } public override VFXExpressionOperation operation { get { return VFXExpressionOperation.CellularNoise1D; } } @@ -162,8 +162,8 @@ public override string GetCodeString(string[] parents) class VFXExpressionCellularNoise2D : VFXExpression { - public VFXExpressionCellularNoise2D() : this(VFXValue.Default, VFXValue.Default, VFXValue.Default) {} - public VFXExpressionCellularNoise2D(params VFXExpression[] parents) : base(VFXExpression.Flags.None, parents) {} + public VFXExpressionCellularNoise2D() : this(VFXValue.Default, VFXValue.Default, VFXValue.Default) { } + public VFXExpressionCellularNoise2D(params VFXExpression[] parents) : base(VFXExpression.Flags.None, parents) { } public override VFXExpressionOperation operation { get { return VFXExpressionOperation.CellularNoise2D; } } @@ -184,8 +184,8 @@ public override string GetCodeString(string[] parents) class VFXExpressionCellularNoise3D : VFXExpression { - public VFXExpressionCellularNoise3D() : this(VFXValue.Default, VFXValue.Default, VFXValue.Default) {} - public VFXExpressionCellularNoise3D(params VFXExpression[] parents) : base(VFXExpression.Flags.None, parents) {} + public VFXExpressionCellularNoise3D() : this(VFXValue.Default, VFXValue.Default, VFXValue.Default) { } + public VFXExpressionCellularNoise3D(params VFXExpression[] parents) : base(VFXExpression.Flags.None, parents) { } public override VFXExpressionOperation operation { get { return VFXExpressionOperation.CellularNoise3D; } } @@ -206,8 +206,8 @@ public override string GetCodeString(string[] parents) class VFXExpressionValueCurlNoise2D : VFXExpression { - public VFXExpressionValueCurlNoise2D() : this(VFXValue.Default, VFXValue.Default, VFXValue.Default) {} - public VFXExpressionValueCurlNoise2D(params VFXExpression[] parents) : base(VFXExpression.Flags.None, parents) {} + public VFXExpressionValueCurlNoise2D() : this(VFXValue.Default, VFXValue.Default, VFXValue.Default) { } + public VFXExpressionValueCurlNoise2D(params VFXExpression[] parents) : base(VFXExpression.Flags.None, parents) { } public override VFXExpressionOperation operation { get { return VFXExpressionOperation.ValueCurlNoise2D; } } @@ -228,8 +228,8 @@ public override string GetCodeString(string[] parents) class VFXExpressionValueCurlNoise3D : VFXExpression { - public VFXExpressionValueCurlNoise3D() : this(VFXValue.Default, VFXValue.Default, VFXValue.Default) {} - public VFXExpressionValueCurlNoise3D(params VFXExpression[] parents) : base(VFXExpression.Flags.None, parents) {} + public VFXExpressionValueCurlNoise3D() : this(VFXValue.Default, VFXValue.Default, VFXValue.Default) { } + public VFXExpressionValueCurlNoise3D(params VFXExpression[] parents) : base(VFXExpression.Flags.None, parents) { } public override VFXExpressionOperation operation { get { return VFXExpressionOperation.ValueCurlNoise3D; } } @@ -250,8 +250,8 @@ public override string GetCodeString(string[] parents) class VFXExpressionPerlinCurlNoise2D : VFXExpression { - public VFXExpressionPerlinCurlNoise2D() : this(VFXValue.Default, VFXValue.Default, VFXValue.Default) {} - public VFXExpressionPerlinCurlNoise2D(params VFXExpression[] parents) : base(VFXExpression.Flags.None, parents) {} + public VFXExpressionPerlinCurlNoise2D() : this(VFXValue.Default, VFXValue.Default, VFXValue.Default) { } + public VFXExpressionPerlinCurlNoise2D(params VFXExpression[] parents) : base(VFXExpression.Flags.None, parents) { } public override VFXExpressionOperation operation { get { return VFXExpressionOperation.PerlinCurlNoise2D; } } @@ -272,8 +272,8 @@ public override string GetCodeString(string[] parents) class VFXExpressionPerlinCurlNoise3D : VFXExpression { - public VFXExpressionPerlinCurlNoise3D() : this(VFXValue.Default, VFXValue.Default, VFXValue.Default) {} - public VFXExpressionPerlinCurlNoise3D(params VFXExpression[] parents) : base(VFXExpression.Flags.None, parents) {} + public VFXExpressionPerlinCurlNoise3D() : this(VFXValue.Default, VFXValue.Default, VFXValue.Default) { } + public VFXExpressionPerlinCurlNoise3D(params VFXExpression[] parents) : base(VFXExpression.Flags.None, parents) { } public override VFXExpressionOperation operation { get { return VFXExpressionOperation.PerlinCurlNoise3D; } } @@ -294,8 +294,8 @@ public override string GetCodeString(string[] parents) class VFXExpressionCellularCurlNoise2D : VFXExpression { - public VFXExpressionCellularCurlNoise2D() : this(VFXValue.Default, VFXValue.Default, VFXValue.Default) {} - public VFXExpressionCellularCurlNoise2D(params VFXExpression[] parents) : base(VFXExpression.Flags.None, parents) {} + public VFXExpressionCellularCurlNoise2D() : this(VFXValue.Default, VFXValue.Default, VFXValue.Default) { } + public VFXExpressionCellularCurlNoise2D(params VFXExpression[] parents) : base(VFXExpression.Flags.None, parents) { } public override VFXExpressionOperation operation { get { return VFXExpressionOperation.CellularCurlNoise2D; } } @@ -316,8 +316,8 @@ public override string GetCodeString(string[] parents) class VFXExpressionCellularCurlNoise3D : VFXExpression { - public VFXExpressionCellularCurlNoise3D() : this(VFXValue.Default, VFXValue.Default, VFXValue.Default) {} - public VFXExpressionCellularCurlNoise3D(params VFXExpression[] parents) : base(VFXExpression.Flags.None, parents) {} + public VFXExpressionCellularCurlNoise3D() : this(VFXValue.Default, VFXValue.Default, VFXValue.Default) { } + public VFXExpressionCellularCurlNoise3D(params VFXExpression[] parents) : base(VFXExpression.Flags.None, parents) { } public override VFXExpressionOperation operation { get { return VFXExpressionOperation.CellularCurlNoise3D; } } @@ -338,8 +338,8 @@ public override string GetCodeString(string[] parents) class VFXExpressionVoroNoise2D : VFXExpression { - public VFXExpressionVoroNoise2D() : this(VFXValue.Default, VFXValue.Default) {} - public VFXExpressionVoroNoise2D(params VFXExpression[] parents) : base(VFXExpression.Flags.InvalidOnCPU, parents) {} + public VFXExpressionVoroNoise2D() : this(VFXValue.Default, VFXValue.Default) { } + public VFXExpressionVoroNoise2D(params VFXExpression[] parents) : base(VFXExpression.Flags.InvalidOnCPU, parents) { } sealed public override VFXValueType valueType { get { return VFXValueType.Float; } } public override VFXExpressionOperation operation { get { return VFXExpressionOperation.None; } } diff --git a/com.unity.visualeffectgraph/Editor/Expressions/VFXExpressionRandom.cs b/com.unity.visualeffectgraph/Editor/Expressions/VFXExpressionRandom.cs index 248345c44a0..8eccc633ea2 100644 --- a/com.unity.visualeffectgraph/Editor/Expressions/VFXExpressionRandom.cs +++ b/com.unity.visualeffectgraph/Editor/Expressions/VFXExpressionRandom.cs @@ -34,7 +34,7 @@ public override int GetHashCode() int id; } - #pragma warning disable 0659 +#pragma warning disable 0659 class VFXExpressionRandom : VFXExpression { public VFXExpressionRandom(bool perElement, RandId id) : base(perElement ? VFXExpression.Flags.PerElement : VFXExpression.Flags.None) @@ -82,10 +82,10 @@ public override IEnumerable GetNeededAttributes() class VFXExpressionFixedRandom : VFXExpression { - public VFXExpressionFixedRandom() : this(VFXValue.Default) {} - public VFXExpressionFixedRandom(VFXExpression hash) : base(VFXExpression.Flags.None, hash) {} + public VFXExpressionFixedRandom() : this(VFXValue.Default) { } + public VFXExpressionFixedRandom(VFXExpression hash) : base(VFXExpression.Flags.None, hash) { } - public override VFXExpressionOperation operation { get { return VFXExpressionOperation.GenerateFixedRandom; }} + public override VFXExpressionOperation operation { get { return VFXExpressionOperation.GenerateFixedRandom; } } sealed protected override VFXExpression Evaluate(VFXExpression[] constParents) { @@ -104,5 +104,5 @@ public override string GetCodeString(string[] parents) return string.Format("FixedRand({0})", parents[0]); } } - #pragma warning restore 0659 +#pragma warning restore 0659 } diff --git a/com.unity.visualeffectgraph/Editor/Expressions/VFXExpressionSampleAttributeMap.cs b/com.unity.visualeffectgraph/Editor/Expressions/VFXExpressionSampleAttributeMap.cs index 35498d75ab2..78f7f5c8616 100644 --- a/com.unity.visualeffectgraph/Editor/Expressions/VFXExpressionSampleAttributeMap.cs +++ b/com.unity.visualeffectgraph/Editor/Expressions/VFXExpressionSampleAttributeMap.cs @@ -14,7 +14,7 @@ public VFXExpressionSampleAttributeMap() : this(VFXTexture2DValue.Default, VFXVa public VFXExpressionSampleAttributeMap(VFXExpression texture, VFXExpression x, VFXExpression y) : base(Flags.InvalidOnCPU, new VFXExpression[3] { texture, x, y }) - {} + { } sealed public override VFXExpressionOperation operation { get { return VFXExpressionOperation.None; } } sealed public override VFXValueType valueType { get { return VFXExpression.GetVFXValueTypeFromType(typeof(T)); } } diff --git a/com.unity.visualeffectgraph/Editor/Expressions/VFXExpressionSampleCurve.cs b/com.unity.visualeffectgraph/Editor/Expressions/VFXExpressionSampleCurve.cs index e691a17e2e9..6a1b9edc786 100644 --- a/com.unity.visualeffectgraph/Editor/Expressions/VFXExpressionSampleCurve.cs +++ b/com.unity.visualeffectgraph/Editor/Expressions/VFXExpressionSampleCurve.cs @@ -14,7 +14,7 @@ public VFXExpressionSampleCurve() : this(VFXValue.Default, VFXVa public VFXExpressionSampleCurve(VFXExpression curve, VFXExpression time) : base(Flags.None, new VFXExpression[2] { curve, time }) - {} + { } sealed public override VFXExpressionOperation operation { get { return VFXExpressionOperation.SampleCurve; } } diff --git a/com.unity.visualeffectgraph/Editor/Expressions/VFXExpressionSampleGradient.cs b/com.unity.visualeffectgraph/Editor/Expressions/VFXExpressionSampleGradient.cs index 1371de4f3a0..decab4c5181 100644 --- a/com.unity.visualeffectgraph/Editor/Expressions/VFXExpressionSampleGradient.cs +++ b/com.unity.visualeffectgraph/Editor/Expressions/VFXExpressionSampleGradient.cs @@ -14,7 +14,7 @@ public VFXExpressionSampleGradient() : this(VFXValue.Default, VFXValue public VFXExpressionSampleGradient(VFXExpression gradient, VFXExpression time) : base(Flags.None, new VFXExpression[2] { gradient, time }) - {} + { } sealed public override VFXExpressionOperation operation { get { return VFXExpressionOperation.SampleGradient; } } protected sealed override VFXExpression Evaluate(VFXExpression[] constParents) diff --git a/com.unity.visualeffectgraph/Editor/Expressions/VFXExpressionSampleSDF.cs b/com.unity.visualeffectgraph/Editor/Expressions/VFXExpressionSampleSDF.cs index 725e555fc5a..d002cc4845d 100644 --- a/com.unity.visualeffectgraph/Editor/Expressions/VFXExpressionSampleSDF.cs +++ b/com.unity.visualeffectgraph/Editor/Expressions/VFXExpressionSampleSDF.cs @@ -16,7 +16,7 @@ public VFXExpressionSampleSDF() : this(VFXTexture3DValue.Default, VFXValue VFXValueType.Float3; public override VFXExpressionOperation operation => VFXExpressionOperation.None; diff --git a/com.unity.visualeffectgraph/Editor/Expressions/VFXExpressionTextureDim.cs b/com.unity.visualeffectgraph/Editor/Expressions/VFXExpressionTextureDim.cs index c58112f3c78..d31389da430 100644 --- a/com.unity.visualeffectgraph/Editor/Expressions/VFXExpressionTextureDim.cs +++ b/com.unity.visualeffectgraph/Editor/Expressions/VFXExpressionTextureDim.cs @@ -9,11 +9,11 @@ namespace UnityEditor.VFX class VFXExpressionTextureWidth : VFXExpression { public VFXExpressionTextureWidth() : this(VFXTexture2DValue.Default) - {} + { } public VFXExpressionTextureWidth(VFXExpression texture) : base(Flags.InvalidOnGPU, new VFXExpression[1] { texture }) - {} + { } sealed public override VFXExpressionOperation operation { get { return VFXExpressionOperation.TextureWidth; } } sealed public override VFXValueType valueType { get { return VFXValueType.Uint32; } } @@ -28,11 +28,11 @@ sealed protected override VFXExpression Evaluate(VFXExpression[] constParents) class VFXExpressionTextureHeight : VFXExpression { public VFXExpressionTextureHeight() : this(VFXTexture2DValue.Default) - {} + { } public VFXExpressionTextureHeight(VFXExpression texture) : base(Flags.InvalidOnGPU, new VFXExpression[1] { texture }) - {} + { } sealed public override VFXExpressionOperation operation { get { return VFXExpressionOperation.TextureHeight; } } sealed public override VFXValueType valueType { get { return VFXValueType.Uint32; } } @@ -47,11 +47,11 @@ sealed protected override VFXExpression Evaluate(VFXExpression[] constParents) class VFXExpressionTextureDepth : VFXExpression { public VFXExpressionTextureDepth() : this(VFXTexture2DValue.Default) - {} + { } public VFXExpressionTextureDepth(VFXExpression texture) : base(Flags.InvalidOnGPU, new VFXExpression[1] { texture }) - {} + { } sealed public override VFXExpressionOperation operation { get { return VFXExpressionOperation.TextureDepth; } } sealed public override VFXValueType valueType { get { return VFXValueType.Uint32; } } diff --git a/com.unity.visualeffectgraph/Editor/Expressions/VFXExpressionTransform.cs b/com.unity.visualeffectgraph/Editor/Expressions/VFXExpressionTransform.cs index 8691195d134..80357ea3cba 100644 --- a/com.unity.visualeffectgraph/Editor/Expressions/VFXExpressionTransform.cs +++ b/com.unity.visualeffectgraph/Editor/Expressions/VFXExpressionTransform.cs @@ -52,10 +52,10 @@ public override string GetCodeString(string[] parents) class VFXExpressionInverseMatrix : VFXExpression { public VFXExpressionInverseMatrix() : this(VFXValue.Default) - {} + { } public VFXExpressionInverseMatrix(VFXExpression parent) : base(VFXExpression.Flags.InvalidOnGPU, parent) - {} + { } sealed public override VFXExpressionOperation operation { @@ -75,10 +75,10 @@ sealed protected override VFXExpression Evaluate(VFXExpression[] constParents) class VFXExpressionTransposeMatrix : VFXExpression { public VFXExpressionTransposeMatrix() : this(VFXValue.Default) - {} + { } public VFXExpressionTransposeMatrix(VFXExpression parent) : base(Flags.None, parent) - {} + { } public sealed override VFXExpressionOperation operation { @@ -103,10 +103,10 @@ public override string GetCodeString(string[] parents) class VFXExpressionInverseTRSMatrix : VFXExpression { public VFXExpressionInverseTRSMatrix() : this(VFXValue.Default) - {} + { } public VFXExpressionInverseTRSMatrix(VFXExpression parent) : base(VFXExpression.Flags.None, parent) - {} + { } sealed public override VFXExpressionOperation operation { @@ -134,19 +134,19 @@ static bool inputvertMatrix4x4_General3D(Matrix4x4 input, ref Matrix4x4 output) // Calculate the determinant of upper left 3x3 sub-matrix and // determine if the matrix is singular. pos = neg = 0.0f; - t = input[0, 0] * input[1, 1] * input[2, 2]; + t = input[0, 0] * input[1, 1] * input[2, 2]; if (t >= 0.0f) pos += t; else neg += t; - t = input[1, 0] * input[2, 1] * input[0, 2]; + t = input[1, 0] * input[2, 1] * input[0, 2]; if (t >= 0.0f) pos += t; else neg += t; - t = input[2, 0] * input[0, 1] * input[1, 2]; + t = input[2, 0] * input[0, 1] * input[1, 2]; if (t >= 0.0f) pos += t; else diff --git a/com.unity.visualeffectgraph/Editor/FilterPopup/VFXBlockProvider.cs b/com.unity.visualeffectgraph/Editor/FilterPopup/VFXBlockProvider.cs index 4bb042e328b..8a38dc9dcd0 100644 --- a/com.unity.visualeffectgraph/Editor/FilterPopup/VFXBlockProvider.cs +++ b/com.unity.visualeffectgraph/Editor/FilterPopup/VFXBlockProvider.cs @@ -146,19 +146,19 @@ protected override string GetName(VFXBlockProvider.Descriptor desc) protected override string title { - get {return "Block"; } + get { return "Block"; } } protected override IEnumerable GetDescriptors() { var blocks = new List>(VFXLibrary.GetBlocks()); - var filteredBlocks = blocks.Where(b => b.AcceptParent(m_ContextController.model)).Select(t => (Descriptor) new NewBlockDescriptor(t)); + var filteredBlocks = blocks.Where(b => b.AcceptParent(m_ContextController.model)).Select(t => (Descriptor)new NewBlockDescriptor(t)); filteredBlocks = filteredBlocks.Concat(SubGraphCache.GetItems(typeof(VisualEffectSubgraphBlock)).Where(t => - (((SubGraphCache.AdditionalBlockInfo)t.additionalInfos).compatibleType & m_ContextController.model.contextType) != 0 && + (((SubGraphCache.AdditionalBlockInfo)t.additionalInfos).compatibleType & m_ContextController.model.contextType) != 0 && (((SubGraphCache.AdditionalBlockInfo)t.additionalInfos).compatibleData & m_ContextController.model.ownedType) != 0 - ).Select(t => (Descriptor) new SubgraphBlockDescriptor(t))); + ).Select(t => (Descriptor)new SubgraphBlockDescriptor(t))); var blockList = filteredBlocks.ToList(); diff --git a/com.unity.visualeffectgraph/Editor/Gizmo/VFXGizmo.cs b/com.unity.visualeffectgraph/Editor/Gizmo/VFXGizmo.cs index 0558502dc6d..39a3c1279d0 100644 --- a/com.unity.visualeffectgraph/Editor/Gizmo/VFXGizmo.cs +++ b/com.unity.visualeffectgraph/Editor/Gizmo/VFXGizmo.cs @@ -42,7 +42,7 @@ public interface IContext public VFXCoordinateSpace currentSpace { get; set; } public bool spaceLocalByDefault { get; set; } - public VisualEffect component {get; set; } + public VisualEffect component { get; set; } public bool PositionGizmo(ref Vector3 position, bool always) { @@ -60,7 +60,7 @@ public bool ScaleGizmo(Vector3 position, ref Vector3 scale, Quaternion rotation, if (always || Tools.current == Tool.Scale || Tools.current == Tool.Transform || Tools.current == Tool.None) { EditorGUI.BeginChangeCheck(); - scale = Handles.ScaleHandle(scale, position , rotation, Tools.current == Tool.Transform || Tools.current == Tool.None ? HandleUtility.GetHandleSize(position) * 0.75f : HandleUtility.GetHandleSize(position)); + scale = Handles.ScaleHandle(scale, position, rotation, Tools.current == Tool.Transform || Tools.current == Tool.None ? HandleUtility.GetHandleSize(position) * 0.75f : HandleUtility.GetHandleSize(position)); return EditorGUI.EndChangeCheck(); } return false; @@ -130,7 +130,7 @@ public bool ArcGizmo(Vector3 center, float radius, float degArc, IProperty, IVFXMovable { @@ -362,7 +362,7 @@ void OnDragUpdatedEvent(DragUpdatedEvent e) SetDragIndicatorVisible(true); - m_DragIndicator.style.top = indicatorY - m_DragIndicator.resolvedStyle.height * 0.5f; + m_DragIndicator.style.top = indicatorY - m_DragIndicator.resolvedStyle.height * 0.5f; DragAndDrop.visualMode = DragAndDropVisualMode.Move; } @@ -621,7 +621,7 @@ void IControlledElement.OnControllerChanged(ref ControllerChangedEvent e) VFXBlackboardCategory cat = null; if (!m_Categories.TryGetValue(catModel.name, out cat)) { - cat = new VFXBlackboardCategory() {title = catModel.name }; + cat = new VFXBlackboardCategory() { title = catModel.name }; cat.SetSelectable(); m_Categories.Add(catModel.name, cat); } diff --git a/com.unity.visualeffectgraph/Editor/GraphView/Blackboard/VFXBlackboardCategory.cs b/com.unity.visualeffectgraph/Editor/GraphView/Blackboard/VFXBlackboardCategory.cs index 2eeab0615ef..2dfc8e87d7d 100644 --- a/com.unity.visualeffectgraph/Editor/GraphView/Blackboard/VFXBlackboardCategory.cs +++ b/com.unity.visualeffectgraph/Editor/GraphView/Blackboard/VFXBlackboardCategory.cs @@ -129,14 +129,14 @@ public void SetSelectable() capabilities |= Capabilities.Selectable | Capabilities.Droppable | Capabilities.Deletable; styleSheets.Add(VFXView.LoadStyleSheet("Selectable")); AddToClassList("selectable"); - hierarchy.Add(new VisualElement() {name = "selection-border", pickingMode = PickingMode.Ignore}); + hierarchy.Add(new VisualElement() { name = "selection-border", pickingMode = PickingMode.Ignore }); //RegisterCallback(OnHeaderClicked); pickingMode = PickingMode.Position; this.AddManipulator(new SelectionDropper()); - m_NameField = new TextField() {name = "name-field"}; + m_NameField = new TextField() { name = "name-field" }; m_Header.Add(m_NameField); m_Header.RegisterCallback(OnMouseDownEvent); m_NameField.Q("unity-text-input").RegisterCallback(e => { OnEditTextSucceded(); }); diff --git a/com.unity.visualeffectgraph/Editor/GraphView/Blackboard/VFXBlackboardField.cs b/com.unity.visualeffectgraph/Editor/GraphView/Blackboard/VFXBlackboardField.cs index ca602b525f9..9c95265ffb3 100644 --- a/com.unity.visualeffectgraph/Editor/GraphView/Blackboard/VFXBlackboardField.cs +++ b/com.unity.visualeffectgraph/Editor/GraphView/Blackboard/VFXBlackboardField.cs @@ -12,7 +12,7 @@ using UnityEditor.Graphs; using UnityEditor.SceneManagement; -namespace UnityEditor.VFX.UI +namespace UnityEditor.VFX.UI { class VFXBlackboardField : BlackboardField, IControlledElement { @@ -55,7 +55,7 @@ public VFXParameterController controller { get { return owner.controller; } } - void IControlledElement.OnControllerChanged(ref ControllerChangedEvent e) {} + void IControlledElement.OnControllerChanged(ref ControllerChangedEvent e) { } public void SelfChange() { diff --git a/com.unity.visualeffectgraph/Editor/GraphView/Blackboard/VFXBlackboardPropertyView.cs b/com.unity.visualeffectgraph/Editor/GraphView/Blackboard/VFXBlackboardPropertyView.cs index 96c6d9ef669..032260495f6 100644 --- a/com.unity.visualeffectgraph/Editor/GraphView/Blackboard/VFXBlackboardPropertyView.cs +++ b/com.unity.visualeffectgraph/Editor/GraphView/Blackboard/VFXBlackboardPropertyView.cs @@ -12,7 +12,7 @@ using UnityEditor.Graphs; using UnityEditor.SceneManagement; -namespace UnityEditor.VFX.UI +namespace UnityEditor.VFX.UI { class ValueFilterEnumPropertyRMProvider : SimplePropertyRMProvider { @@ -22,11 +22,11 @@ public ValueFilterEnumPropertyRMProvider(string name, System.Func filteredOutEnumerators + public override IEnumerable filteredOutEnumerators { get { - return m_NoEnum ? new int[] {2 } : null; + return m_NoEnum ? new int[] { 2 } : null; } } } diff --git a/com.unity.visualeffectgraph/Editor/GraphView/Blackboard/VFXBlackboardRow.cs b/com.unity.visualeffectgraph/Editor/GraphView/Blackboard/VFXBlackboardRow.cs index 14e5b803469..d078a23ffef 100644 --- a/com.unity.visualeffectgraph/Editor/GraphView/Blackboard/VFXBlackboardRow.cs +++ b/com.unity.visualeffectgraph/Editor/GraphView/Blackboard/VFXBlackboardRow.cs @@ -12,7 +12,7 @@ using UnityEditor.Graphs; using UnityEditor.SceneManagement; -namespace UnityEditor.VFX.UI +namespace UnityEditor.VFX.UI { class VFXBlackboardRow : BlackboardRow, IControlledElement { diff --git a/com.unity.visualeffectgraph/Editor/GraphView/Controllers/Controller.cs b/com.unity.visualeffectgraph/Editor/GraphView/Controllers/Controller.cs index 2f5a8ac229c..10ef9059e92 100644 --- a/com.unity.visualeffectgraph/Editor/GraphView/Controllers/Controller.cs +++ b/com.unity.visualeffectgraph/Editor/GraphView/Controllers/Controller.cs @@ -98,7 +98,7 @@ public void SendEvent(ControllerEvent e) public abstract void ApplyChanges(); - public virtual IEnumerable allChildren + public virtual IEnumerable allChildren { get { return Enumerable.Empty(); } } @@ -141,7 +141,7 @@ public VFXController(VFXViewController viewController, T model) : base(model) m_ViewController.RegisterNotification(model, OnModelChanged); } - public VFXViewController viewController {get {return m_ViewController; }} + public VFXViewController viewController { get { return m_ViewController; } } public override void OnDisable() { diff --git a/com.unity.visualeffectgraph/Editor/GraphView/Elements/Controllers/VFXDataAnchorController.cs b/com.unity.visualeffectgraph/Editor/GraphView/Elements/Controllers/VFXDataAnchorController.cs index ce3708661ad..9c415daa2d7 100644 --- a/com.unity.visualeffectgraph/Editor/GraphView/Elements/Controllers/VFXDataAnchorController.cs +++ b/com.unity.visualeffectgraph/Editor/GraphView/Elements/Controllers/VFXDataAnchorController.cs @@ -203,7 +203,7 @@ public virtual VFXParameter.NodeLinkedSlot CreateLinkTo(VFXDataAnchorController if (slotInput != null && slotOutput != null && slotInput.Link(slotOutput)) { - return new VFXParameter.NodeLinkedSlot() {inputSlot = slotInput, outputSlot = slotOutput}; + return new VFXParameter.NodeLinkedSlot() { inputSlot = slotInput, outputSlot = slotOutput }; } return new VFXParameter.NodeLinkedSlot(); @@ -330,7 +330,7 @@ public object[] customAttributes { get { - return new object[] {}; + return new object[] { }; } } @@ -558,7 +558,7 @@ public override Direction direction public override bool editable { - get {return true; } + get { return true; } } public override bool expandedSelf { @@ -569,7 +569,7 @@ public override bool expandedSelf } public override bool expandable { - get {return false; } + get { return false; } } public override bool HasLink() { @@ -636,7 +636,7 @@ public override VFXParameter.NodeLinkedSlot CreateLinkTo(VFXDataAnchorController var slotInput = op.GetInputSlot(op.GetNbInputSlots() - 1); if (slotInput != null && slotOutput != null && slotInput.Link(slotOutput)) { - return new VFXParameter.NodeLinkedSlot() {inputSlot = slotInput, outputSlot = slotOutput}; + return new VFXParameter.NodeLinkedSlot() { inputSlot = slotInput, outputSlot = slotOutput }; } return new VFXParameter.NodeLinkedSlot(); @@ -655,7 +655,7 @@ internal VFXDataAnchorGizmoContext(VFXDataAnchorController controller) public override Type portType { - get {return m_Controller.portType; } + get { return m_Controller.portType; } } List stack = new List(); @@ -745,7 +745,7 @@ public override VFXGizmo.IProperty RegisterProperty(string member) object result; if (m_PropertyCache.TryGetValue(member, out result)) { - if (result is VFXGizmo.IProperty ) + if (result is VFXGizmo.IProperty) return result as VFXGizmo.IProperty; else return VFXGizmoUtility.NullProperty.defaultProperty; diff --git a/com.unity.visualeffectgraph/Editor/GraphView/Elements/Controllers/VFXFlowAnchorController.cs b/com.unity.visualeffectgraph/Editor/GraphView/Elements/Controllers/VFXFlowAnchorController.cs index 243c5e0306c..4c71758902b 100644 --- a/com.unity.visualeffectgraph/Editor/GraphView/Elements/Controllers/VFXFlowAnchorController.cs +++ b/com.unity.visualeffectgraph/Editor/GraphView/Elements/Controllers/VFXFlowAnchorController.cs @@ -55,7 +55,7 @@ public override void ApplyChanges() public virtual string title { - get {return ""; } + get { return ""; } } static private IEnumerable GetFlowAncestor(VFXContext from) diff --git a/com.unity.visualeffectgraph/Editor/GraphView/Elements/Controllers/VFXGroupNodeController.cs b/com.unity.visualeffectgraph/Editor/GraphView/Elements/Controllers/VFXGroupNodeController.cs index 895d2442782..1d32a37a945 100644 --- a/com.unity.visualeffectgraph/Editor/GraphView/Elements/Controllers/VFXGroupNodeController.cs +++ b/com.unity.visualeffectgraph/Editor/GraphView/Elements/Controllers/VFXGroupNodeController.cs @@ -20,7 +20,7 @@ public void Remove() m_Index = -1; } - abstract protected T[] infos {get; } + abstract protected T[] infos { get; } protected VFXViewController m_ViewController; @@ -155,7 +155,7 @@ public IEnumerable nodes } - override protected VFXUI.GroupInfo[] infos {get {return m_UI.groupInfos; }} + override protected VFXUI.GroupInfo[] infos { get { return m_UI.groupInfos; } } void AddNodeID(VFXNodeID nodeID) diff --git a/com.unity.visualeffectgraph/Editor/GraphView/Elements/Controllers/VFXNodeController.cs b/com.unity.visualeffectgraph/Editor/GraphView/Elements/Controllers/VFXNodeController.cs index 3ec8b2420ac..40af80c34f9 100644 --- a/com.unity.visualeffectgraph/Editor/GraphView/Elements/Controllers/VFXNodeController.cs +++ b/com.unity.visualeffectgraph/Editor/GraphView/Elements/Controllers/VFXNodeController.cs @@ -141,7 +141,7 @@ public override IEnumerable allChildren public virtual int id { - get {return 0; } + get { return 0; } } bool m_SyncingSlots; diff --git a/com.unity.visualeffectgraph/Editor/GraphView/Elements/Controllers/VFXOperatorController.cs b/com.unity.visualeffectgraph/Editor/GraphView/Elements/Controllers/VFXOperatorController.cs index f6bbd0fab7b..9ad5ebfb2b6 100644 --- a/com.unity.visualeffectgraph/Editor/GraphView/Elements/Controllers/VFXOperatorController.cs +++ b/com.unity.visualeffectgraph/Editor/GraphView/Elements/Controllers/VFXOperatorController.cs @@ -53,7 +53,7 @@ public VFXOperatorController(VFXOperator model, VFXViewController viewController public virtual bool isEditable { - get {return false; } + get { return false; } } public void ConvertToProperty(bool exposed = false) @@ -109,7 +109,7 @@ protected override bool CouldLinkMyInputTo(VFXDataAnchorController myInput, VFXD public override bool isEditable { - get {return true; } + get { return true; } } } diff --git a/com.unity.visualeffectgraph/Editor/GraphView/Elements/Controllers/VFXParameterController.cs b/com.unity.visualeffectgraph/Editor/GraphView/Elements/Controllers/VFXParameterController.cs index f82736a3ed4..86e27a30542 100644 --- a/com.unity.visualeffectgraph/Editor/GraphView/Elements/Controllers/VFXParameterController.cs +++ b/com.unity.visualeffectgraph/Editor/GraphView/Elements/Controllers/VFXParameterController.cs @@ -97,7 +97,7 @@ bool IPropertyRMProvider.IsSpaceInherited() bool IPropertyRMProvider.expanded { - get { return expanded;} + get { return expanded; } } bool IPropertyRMProvider.editable { @@ -231,8 +231,8 @@ void IPropertyRMProvider.RetractPath() throw new NotImplementedException(); } - void IPropertyRMProvider.StartLiveModification() {} - void IPropertyRMProvider.EndLiveModification() {} + void IPropertyRMProvider.StartLiveModification() { } + void IPropertyRMProvider.EndLiveModification() { } } class VFXMinMaxParameterController : IPropertyRMProvider @@ -335,8 +335,8 @@ public void RetractPath() throw new NotImplementedException(); } - void IPropertyRMProvider.StartLiveModification() {} - void IPropertyRMProvider.EndLiveModification() {} + void IPropertyRMProvider.StartLiveModification() { } + void IPropertyRMProvider.EndLiveModification() { } } class VFXParameterController : VFXController, IPropertyRMProvider, IGizmoController, IGizmoable { @@ -392,7 +392,7 @@ public VFXParameterController(VFXParameter model, VFXViewController viewControll if (VFXGizmoUtility.HasGizmo(model.type)) m_Gizmoables = new IGizmoable[] { this }; else - m_Gizmoables = new IGizmoable[] {}; + m_Gizmoables = new IGizmoable[] { }; } string IGizmoable.name @@ -841,14 +841,14 @@ public ReadOnlyCollection gizmoables } } - public IGizmoable currentGizmoable { get { return this; } set {} } + public IGizmoable currentGizmoable { get { return this; } set { } } Dictionary m_Controllers = new Dictionary(); public int nodeCount { - get {return m_Controllers.Count(); } + get { return m_Controllers.Count(); } } @@ -915,7 +915,7 @@ public bool editable public override string name { get { return "Value"; } } - public object[] customAttributes { get { return new object[] {}; } } + public object[] customAttributes { get { return new object[] { }; } } public VFXPropertyAttributes attributes { @@ -991,7 +991,7 @@ internal ParameterGizmoContext(VFXParameterController controller) public override Type portType { - get {return m_Controller.portType; } + get { return m_Controller.portType; } } public override object value @@ -1007,14 +1007,14 @@ public override VFXCoordinateSpace space } } - protected override void InternalPrepare() {} + protected override void InternalPrepare() { } public override VFXGizmo.IProperty RegisterProperty(string member) { object result; if (m_PropertyCache.TryGetValue(member, out result)) { - if (result is VFXGizmo.IProperty ) + if (result is VFXGizmo.IProperty) return result as VFXGizmo.IProperty; else return VFXGizmoUtility.NullProperty.defaultProperty; diff --git a/com.unity.visualeffectgraph/Editor/GraphView/Elements/Controllers/VFXParameterNodeController.cs b/com.unity.visualeffectgraph/Editor/GraphView/Elements/Controllers/VFXParameterNodeController.cs index bac19c8653a..475459db635 100644 --- a/com.unity.visualeffectgraph/Editor/GraphView/Elements/Controllers/VFXParameterNodeController.cs +++ b/com.unity.visualeffectgraph/Editor/GraphView/Elements/Controllers/VFXParameterNodeController.cs @@ -242,7 +242,7 @@ public object value string IPropertyRMProvider.name { get { return "Value"; } } - object[] IPropertyRMProvider.customAttributes { get { return new object[] {}; } } + object[] IPropertyRMProvider.customAttributes { get { return new object[] { }; } } VFXPropertyAttributes IPropertyRMProvider.attributes { get { return new VFXPropertyAttributes(); } } @@ -266,8 +266,8 @@ void IPropertyRMProvider.RetractPath() throw new NotImplementedException(); } - void IPropertyRMProvider.StartLiveModification() {} - void IPropertyRMProvider.EndLiveModification() {} + void IPropertyRMProvider.StartLiveModification() { } + void IPropertyRMProvider.EndLiveModification() { } public override void DrawGizmos(VisualEffect component) { diff --git a/com.unity.visualeffectgraph/Editor/GraphView/Elements/VFXContextUI.cs b/com.unity.visualeffectgraph/Editor/GraphView/Elements/VFXContextUI.cs index 8c4e57cad2c..cce61ff7ae5 100644 --- a/com.unity.visualeffectgraph/Editor/GraphView/Elements/VFXContextUI.cs +++ b/com.unity.visualeffectgraph/Editor/GraphView/Elements/VFXContextUI.cs @@ -758,7 +758,7 @@ public IEnumerable GetFlowAnchors(bool input, bool output) public class VFXContextOnlyVFXNodeProvider : VFXNodeProvider { public VFXContextOnlyVFXNodeProvider(VFXViewController controller, Action onAddBlock, Func filter) : - base(controller, onAddBlock, filter, new Type[] { typeof(VFXContext)}) + base(controller, onAddBlock, filter, new Type[] { typeof(VFXContext) }) { } diff --git a/com.unity.visualeffectgraph/Editor/GraphView/Elements/VFXDataAnchor.cs b/com.unity.visualeffectgraph/Editor/GraphView/Elements/VFXDataAnchor.cs index bb512db0b2b..5ec6f5895f6 100644 --- a/com.unity.visualeffectgraph/Editor/GraphView/Elements/VFXDataAnchor.cs +++ b/com.unity.visualeffectgraph/Editor/GraphView/Elements/VFXDataAnchor.cs @@ -42,7 +42,7 @@ public VFXDataAnchorController controller public new VFXNodeUI node { - get {return m_Node; } + get { return m_Node; } } protected VFXDataAnchor(Orientation anchorOrientation, Direction anchorDirection, Type type, VFXNodeUI node) : base(anchorOrientation, anchorDirection, Capacity.Multi, type) @@ -240,7 +240,7 @@ void IEdgeConnectorListener.OnDropOutsidePort(Edge edge, Vector2 position) } - VFXDataEdge dataEdge = edge as VFXDataEdge; + VFXDataEdge dataEdge = edge as VFXDataEdge; bool exists = false; if (dataEdge.controller != null) { @@ -292,7 +292,7 @@ void IEdgeConnectorListener.OnDropOutsidePort(Edge edge, Vector2 position) else if (!exists) { if (direction == Direction.Input || viewController.model.visualEffectObject is VisualEffectSubgraphOperator || viewController.model.visualEffectObject is VisualEffectSubgraphBlock) // no context for subgraph operators. - VFXFilterWindow.Show(VFXViewWindow.currentWindow, Event.current.mousePosition, view.ViewToScreenPosition(Event.current.mousePosition), new VFXNodeProvider(viewController, AddLinkedNode, ProviderFilter, new Type[] { typeof(VFXOperator), typeof(VFXParameter)})); + VFXFilterWindow.Show(VFXViewWindow.currentWindow, Event.current.mousePosition, view.ViewToScreenPosition(Event.current.mousePosition), new VFXNodeProvider(viewController, AddLinkedNode, ProviderFilter, new Type[] { typeof(VFXOperator), typeof(VFXParameter) })); else VFXFilterWindow.Show(VFXViewWindow.currentWindow, Event.current.mousePosition, view.ViewToScreenPosition(Event.current.mousePosition), new VFXNodeProvider(viewController, AddLinkedNode, ProviderFilter, new Type[] { typeof(VFXOperator), typeof(VFXParameter), typeof(VFXContext) })); } @@ -331,7 +331,7 @@ bool ProviderFilter(VFXNodeProvider.Descriptor d) return false; if (direction == Direction.Output - && mySlot != null + && mySlot != null && container is VFXOperatorDynamicOperand && (container as VFXOperatorDynamicOperand).validTypes.Contains(mySlot.property.type)) return true; diff --git a/com.unity.visualeffectgraph/Editor/GraphView/Elements/VFXEditableDataAnchor.cs b/com.unity.visualeffectgraph/Editor/GraphView/Elements/VFXEditableDataAnchor.cs index d5944990f2c..cbeebed9dca 100644 --- a/com.unity.visualeffectgraph/Editor/GraphView/Elements/VFXEditableDataAnchor.cs +++ b/com.unity.visualeffectgraph/Editor/GraphView/Elements/VFXEditableDataAnchor.cs @@ -9,7 +9,7 @@ namespace UnityEditor.VFX.UI { partial class VFXEditableDataAnchor : VFXDataAnchor { - PropertyRM m_PropertyRM; + PropertyRM m_PropertyRM; VFXView m_View; diff --git a/com.unity.visualeffectgraph/Editor/GraphView/Elements/VFXFlowAnchor.cs b/com.unity.visualeffectgraph/Editor/GraphView/Elements/VFXFlowAnchor.cs index 3f2e19b754e..df42a1a47c2 100644 --- a/com.unity.visualeffectgraph/Editor/GraphView/Elements/VFXFlowAnchor.cs +++ b/com.unity.visualeffectgraph/Editor/GraphView/Elements/VFXFlowAnchor.cs @@ -180,7 +180,7 @@ void IEdgeConnectorListener.OnDropOutsidePort(Edge edge, Vector2 position) } } - VFXFlowEdge flowEdge = edge as VFXFlowEdge; + VFXFlowEdge flowEdge = edge as VFXFlowEdge; bool exists = false; if (flowEdge.controller != null) { @@ -223,7 +223,7 @@ void IEdgeConnectorListener.OnDropOutsidePort(Edge edge, Vector2 position) } else if (!exists) { - VFXFilterWindow.Show(VFXViewWindow.currentWindow, Event.current.mousePosition - new Vector2(376 * 0.5f * VFXViewWindow.currentWindow.graphView.scale, 0), view.ViewToScreenPosition(Event.current.mousePosition), new VFXNodeProvider(viewController, AddLinkedContext, ProviderFilter, new Type[] { typeof(VFXContext)})); + VFXFilterWindow.Show(VFXViewWindow.currentWindow, Event.current.mousePosition - new Vector2(376 * 0.5f * VFXViewWindow.currentWindow.graphView.scale, 0), view.ViewToScreenPosition(Event.current.mousePosition), new VFXNodeProvider(viewController, AddLinkedContext, ProviderFilter, new Type[] { typeof(VFXContext) })); } } } diff --git a/com.unity.visualeffectgraph/Editor/GraphView/Elements/VFXGroupNode.cs b/com.unity.visualeffectgraph/Editor/GraphView/Elements/VFXGroupNode.cs index 82a0eb956f4..baa53a53bf0 100644 --- a/com.unity.visualeffectgraph/Editor/GraphView/Elements/VFXGroupNode.cs +++ b/com.unity.visualeffectgraph/Editor/GraphView/Elements/VFXGroupNode.cs @@ -152,7 +152,7 @@ public void SelfChange() bool m_ModificationFromController; - public static bool inRemoveElement {get; set; } + public static bool inRemoveElement { get; set; } public void ElementsAddedToGroupNode(IEnumerable elements) { diff --git a/com.unity.visualeffectgraph/Editor/GraphView/Elements/VFXNodeUI.cs b/com.unity.visualeffectgraph/Editor/GraphView/Elements/VFXNodeUI.cs index 9de4b54f5ad..c33ea740db4 100644 --- a/com.unity.visualeffectgraph/Editor/GraphView/Elements/VFXNodeUI.cs +++ b/com.unity.visualeffectgraph/Editor/GraphView/Elements/VFXNodeUI.cs @@ -64,7 +64,7 @@ public void OnSelectionMouseDown(MouseDownEvent e) } } - public VisualElement settingsContainer {get; private set; } + public VisualElement settingsContainer { get; private set; } private List m_Settings = new List(); diff --git a/com.unity.visualeffectgraph/Editor/GraphView/Elements/VFXOperatorUI.cs b/com.unity.visualeffectgraph/Editor/GraphView/Elements/VFXOperatorUI.cs index dad55fa743c..1cd3148166a 100644 --- a/com.unity.visualeffectgraph/Editor/GraphView/Elements/VFXOperatorUI.cs +++ b/com.unity.visualeffectgraph/Editor/GraphView/Elements/VFXOperatorUI.cs @@ -22,7 +22,7 @@ public VFXOperatorUI() m_Middle.name = "middle"; inputContainer.parent.Insert(1, m_Middle); - m_EditButton = new VisualElement() {name = "edit"}; + m_EditButton = new VisualElement() { name = "edit" }; m_EditButton.Add(new VisualElement() { name = "icon" }); m_EditButton.AddManipulator(new Clickable(OnEdit)); this.AddManipulator(new SuperCollapser()); diff --git a/com.unity.visualeffectgraph/Editor/GraphView/Elements/VFXStickyNote.cs b/com.unity.visualeffectgraph/Editor/GraphView/Elements/VFXStickyNote.cs index 3e7870fb62b..9c9634745cc 100644 --- a/com.unity.visualeffectgraph/Editor/GraphView/Elements/VFXStickyNote.cs +++ b/com.unity.visualeffectgraph/Editor/GraphView/Elements/VFXStickyNote.cs @@ -30,7 +30,7 @@ public string contents Modified(); } } - override protected VFXUI.StickyNoteInfo[] infos {get {return m_UI.stickyNoteInfos; }} + override protected VFXUI.StickyNoteInfo[] infos { get { return m_UI.stickyNoteInfos; } } public string theme { get diff --git a/com.unity.visualeffectgraph/Editor/GraphView/VFXComponentBoard.cs b/com.unity.visualeffectgraph/Editor/GraphView/VFXComponentBoard.cs index 4a98d2f0916..4bb9f465d3f 100644 --- a/com.unity.visualeffectgraph/Editor/GraphView/VFXComponentBoard.cs +++ b/com.unity.visualeffectgraph/Editor/GraphView/VFXComponentBoard.cs @@ -680,14 +680,14 @@ public void OnMoved() BoardPreferenceHelper.SavePosition(BoardPreferenceHelper.Board.componentBoard, GetPosition()); } - void IVFXResizable.OnStartResize() {} + void IVFXResizable.OnStartResize() { } public void OnResized() { BoardPreferenceHelper.SavePosition(BoardPreferenceHelper.Board.componentBoard, GetPosition()); } } class VFXComponentBoardEventUIFactory : UxmlFactory - {} + { } class VFXComponentBoardEventUI : VisualElement { public VFXComponentBoardEventUI() @@ -735,9 +735,9 @@ public bool nameHasFocus } } - string m_Name; - TextField m_EventName; - Button m_EventSend; + string m_Name; + TextField m_EventName; + Button m_EventSend; void OnSend() { diff --git a/com.unity.visualeffectgraph/Editor/GraphView/VFXViewWindow.cs b/com.unity.visualeffectgraph/Editor/GraphView/VFXViewWindow.cs index 064abca3f3c..fdb0670d54e 100644 --- a/com.unity.visualeffectgraph/Editor/GraphView/VFXViewWindow.cs +++ b/com.unity.visualeffectgraph/Editor/GraphView/VFXViewWindow.cs @@ -13,7 +13,7 @@ using System.IO; using UnityEditor.VersionControl; -namespace UnityEditor.VFX.UI +namespace UnityEditor.VFX.UI { [Serializable] class VFXViewWindow : EditorWindow diff --git a/com.unity.visualeffectgraph/Editor/GraphView/Views/Controller/VFXGraphValidation.cs b/com.unity.visualeffectgraph/Editor/GraphView/Views/Controller/VFXGraphValidation.cs index d9cb60bcfb6..8fcd7067b55 100644 --- a/com.unity.visualeffectgraph/Editor/GraphView/Views/Controller/VFXGraphValidation.cs +++ b/com.unity.visualeffectgraph/Editor/GraphView/Views/Controller/VFXGraphValidation.cs @@ -70,7 +70,7 @@ bool ValidateVFXModel(VFXModel model, VFXModel expectedParent) { LogError("Model error : wrong parent. expected:" + GetVFXModelDesc(expectedParent) + " actual:" + GetVFXModelDesc(model.GetParent())); } - if (!(model is VFXSlot) && model.GetGraph() != m_Graph) + if (!(model is VFXSlot) && model.GetGraph() != m_Graph) { LogError("Model error : " + GetVFXModelDesc(model) + " wrong graph. expected:" + GetVFXModelDesc(m_Graph) + " actual:" + GetVFXModelDesc(model.GetParent())); } diff --git a/com.unity.visualeffectgraph/Editor/GraphView/Views/Controller/VFXViewController.cs b/com.unity.visualeffectgraph/Editor/GraphView/Views/Controller/VFXViewController.cs index 5cafda57173..bb756f2a093 100644 --- a/com.unity.visualeffectgraph/Editor/GraphView/Views/Controller/VFXViewController.cs +++ b/com.unity.visualeffectgraph/Editor/GraphView/Views/Controller/VFXViewController.cs @@ -123,10 +123,10 @@ public void RegisterNotification(VFXObject target, Action action) List notifieds; if (m_Notified.TryGetValue(target, out notifieds)) { - #if NOTIFICATION_VALIDATION +#if NOTIFICATION_VALIDATION if (notifieds.Contains(action)) Debug.LogError("Adding the same notification twice on:" + target.name); - #endif +#endif notifieds.Add(action); } else @@ -147,10 +147,10 @@ public void UnRegisterNotification(VFXObject target, Action action) List notifieds; if (m_Notified.TryGetValue(target, out notifieds)) { - #if NOTIFICATION_VALIDATION +#if NOTIFICATION_VALIDATION if (!notifieds.Contains(action)) Debug.LogError("Removing a non existent notification" + target.name); - #endif +#endif notifieds.Remove(action); if (m_CurrentlyNotified == target) @@ -257,7 +257,7 @@ public void NotifyUpdate() } } - public VFXGraph graph { get {return model != null ? model.graph as VFXGraph : null; }} + public VFXGraph graph { get { return model != null ? model.graph as VFXGraph : null; } } List m_FlowAnchorController = new List(); @@ -857,7 +857,7 @@ protected override void ModelChanged(UnityObject obj) { Clear(); } - m_Graph = model.GetOrCreateGraph(); + m_Graph = model.GetOrCreateGraph(); m_Graph.SanitizeGraph(); if (m_Graph != null) @@ -1403,11 +1403,11 @@ void Sanitize() public ReadOnlyCollection groupNodes { - get {return m_GroupNodeControllers.AsReadOnly(); } + get { return m_GroupNodeControllers.AsReadOnly(); } } public ReadOnlyCollection stickyNotes { - get {return m_StickyNoteControllers.AsReadOnly(); } + get { return m_StickyNoteControllers.AsReadOnly(); } } List m_GroupNodeControllers = new List(); @@ -1505,7 +1505,7 @@ public void ValidateCategoryList() if (missingCategories.Length > 0) { - categories.AddRange(missingCategories.Select(t => new VFXUI.CategoryInfo { name = t})); + categories.AddRange(missingCategories.Select(t => new VFXUI.CategoryInfo { name = t })); ui.categories = categories; ui.Modified(true); } diff --git a/com.unity.visualeffectgraph/Editor/GraphView/Views/Controller/VFXViewControllerExpressions.cs b/com.unity.visualeffectgraph/Editor/GraphView/Views/Controller/VFXViewControllerExpressions.cs index be84d96cb55..ee52136fb17 100644 --- a/com.unity.visualeffectgraph/Editor/GraphView/Views/Controller/VFXViewControllerExpressions.cs +++ b/com.unity.visualeffectgraph/Editor/GraphView/Views/Controller/VFXViewControllerExpressions.cs @@ -12,7 +12,7 @@ namespace UnityEditor.VFX.UI { class VFXRecompileEvent : ControllerEvent { - public bool valueOnly {get; set; } + public bool valueOnly { get; set; } public static VFXRecompileEvent Default = new VFXRecompileEvent(); public VFXViewController controller = null; diff --git a/com.unity.visualeffectgraph/Editor/GraphView/Views/Controller/VFXViewControllerUndo.cs b/com.unity.visualeffectgraph/Editor/GraphView/Views/Controller/VFXViewControllerUndo.cs index 11e7aec5a0c..9b61c767c17 100644 --- a/com.unity.visualeffectgraph/Editor/GraphView/Views/Controller/VFXViewControllerUndo.cs +++ b/com.unity.visualeffectgraph/Editor/GraphView/Views/Controller/VFXViewControllerUndo.cs @@ -20,7 +20,7 @@ public VFXGraphUndoStack(VFXGraph initialState) m_graphUndoCursor.index = 0; m_lastGraphUndoCursor = 0; - m_undoStack.Add(0, new SerializedState() {serializedGraph = initialState.Backup()}); + m_undoStack.Add(0, new SerializedState() { serializedGraph = initialState.Backup() }); m_Graph = initialState; } @@ -46,7 +46,7 @@ public void FlushAndPushGraphState(VFXGraph graph) m_undoStack.Remove(lastCursorInStack); lastCursorInStack = m_undoStack.Last().Key; } - m_undoStack.Add(m_graphUndoCursor.index, new SerializedState() {serializedGraph = graph.Backup()}); + m_undoStack.Add(m_graphUndoCursor.index, new SerializedState() { serializedGraph = graph.Backup() }); } public void CleanDirtyState() diff --git a/com.unity.visualeffectgraph/Editor/GraphView/Views/Properties/BoolPropertyRM.cs b/com.unity.visualeffectgraph/Editor/GraphView/Views/Properties/BoolPropertyRM.cs index cc01cc122d6..0b54432f545 100644 --- a/com.unity.visualeffectgraph/Editor/GraphView/Views/Properties/BoolPropertyRM.cs +++ b/com.unity.visualeffectgraph/Editor/GraphView/Views/Properties/BoolPropertyRM.cs @@ -14,7 +14,7 @@ class BoolPropertyRM : PropertyRM { public BoolPropertyRM(IPropertyRMProvider controller, float labelWidth) : base(controller, labelWidth) { - m_Toggle = new Toggle(); + m_Toggle = new Toggle(); m_Toggle.RegisterCallback>(OnValueChanged); Add(m_Toggle); } diff --git a/com.unity.visualeffectgraph/Editor/GraphView/Views/Properties/NumericPropertiesRM.cs b/com.unity.visualeffectgraph/Editor/GraphView/Views/Properties/NumericPropertiesRM.cs index c42d08f87ce..7d29c21e8a7 100644 --- a/com.unity.visualeffectgraph/Editor/GraphView/Views/Properties/NumericPropertiesRM.cs +++ b/com.unity.visualeffectgraph/Editor/GraphView/Views/Properties/NumericPropertiesRM.cs @@ -30,7 +30,7 @@ protected virtual bool RangeShouldCreateSlider(Vector2 range) } protected VFXBaseSliderField m_Slider; - protected TextValueField m_TextField; + protected TextValueField m_TextField; protected abstract INotifyValueChanged CreateSimpleField(out TextValueField textField); protected abstract INotifyValueChanged CreateSliderField(out VFXBaseSliderField slider); @@ -236,7 +236,7 @@ protected override INotifyValueChanged CreateSimpleField(out TextValueFiel textField = null; return bitfield; } - var field = new VFXLabeledField(m_Label); + var field = new VFXLabeledField(m_Label); field.onValueDragFinished = t => ValueDragFinished(); field.onValueDragStarted = t => ValueDragStarted(); diff --git a/com.unity.visualeffectgraph/Editor/GraphView/Views/Properties/PropertyRM.cs b/com.unity.visualeffectgraph/Editor/GraphView/Views/Properties/PropertyRM.cs index 3c2153dc45c..72789ae11bd 100644 --- a/com.unity.visualeffectgraph/Editor/GraphView/Views/Properties/PropertyRM.cs +++ b/com.unity.visualeffectgraph/Editor/GraphView/Views/Properties/PropertyRM.cs @@ -26,7 +26,7 @@ interface IPropertyRMProvider VFXPropertyAttributes attributes { get; } object[] customAttributes { get; } Type portType { get; } - int depth {get; } + int depth { get; } bool editable { get; } IEnumerable filteredOutEnumerators { get; } @@ -52,7 +52,7 @@ public SimplePropertyRMProvider(string name, System.Func getter, System.Actio m_Name = name; } - VFXCoordinateSpace IPropertyRMProvider.space { get { return VFXCoordinateSpace.Local; } set {} } + VFXCoordinateSpace IPropertyRMProvider.space { get { return VFXCoordinateSpace.Local; } set { } } bool IPropertyRMProvider.IsSpaceInherited() { return false; } @@ -74,7 +74,7 @@ object IPropertyRMProvider.value } } - public virtual IEnumerable filteredOutEnumerators { get { return null; } } + public virtual IEnumerable filteredOutEnumerators { get { return null; } } string IPropertyRMProvider.name { @@ -92,20 +92,20 @@ Type IPropertyRMProvider.portType int IPropertyRMProvider.depth { get { return 0; } } bool IPropertyRMProvider.editable { get { return true; } } void IPropertyRMProvider.RetractPath() - {} + { } void IPropertyRMProvider.ExpandPath() - {} + { } - void IPropertyRMProvider.StartLiveModification() {} - void IPropertyRMProvider.EndLiveModification() {} + void IPropertyRMProvider.StartLiveModification() { } + void IPropertyRMProvider.EndLiveModification() { } } abstract class PropertyRM : VisualElement { public abstract void SetValue(object obj); public abstract object GetValue(); - public virtual void SetMultiplier(object obj) {} + public virtual void SetMultiplier(object obj) { } public VisualElement m_Icon; Clickable m_IconClickable; @@ -306,7 +306,7 @@ public PropertyRM(IPropertyRMProvider provider, float labelWidth) VisualElement line = new VisualElement(); line.style.width = 1; line.name = "line"; - line.style.marginLeft = depthOffset + (i == 0 ? -2 : 0); + line.style.marginLeft = depthOffset + (i == 0 ? -2 : 0); line.style.marginRight = ((i == provider.depth - 1) ? 2 : 0); Add(line); @@ -346,7 +346,7 @@ public virtual float effectiveLabelWidth } } - static readonly Dictionary m_TypeDictionary = new Dictionary + static readonly Dictionary m_TypeDictionary = new Dictionary { {typeof(Vector), typeof(VectorPropertyRM)}, {typeof(Position), typeof(PositionPropertyRM)}, @@ -460,7 +460,7 @@ void OnExpand() abstract class PropertyRM : PropertyRM { public PropertyRM(IPropertyRMProvider controller, float labelWidth) : base(controller, labelWidth) - {} + { } public override void SetValue(object obj) { if (obj != null) @@ -477,7 +477,7 @@ public override void SetValue(object obj) } catch (System.Exception) { - Debug.Log("Error Trying to convert" + (obj != null ? obj.GetType().Name : "null") + " to " + typeof(T).Name); + Debug.Log("Error Trying to convert" + (obj != null ? obj.GetType().Name : "null") + " to " + typeof(T).Name); } } } diff --git a/com.unity.visualeffectgraph/Editor/GraphView/Views/Properties/SpaceablePropertiesRM.cs b/com.unity.visualeffectgraph/Editor/GraphView/Views/Properties/SpaceablePropertiesRM.cs index b041648797f..d09df830b90 100644 --- a/com.unity.visualeffectgraph/Editor/GraphView/Views/Properties/SpaceablePropertiesRM.cs +++ b/com.unity.visualeffectgraph/Editor/GraphView/Views/Properties/SpaceablePropertiesRM.cs @@ -10,7 +10,7 @@ class SpaceablePropertyRM : PropertyRM { public SpaceablePropertyRM(IPropertyRMProvider controller, float labelWidth) : base(controller, labelWidth) { - m_Button = new VisualElement() {name = "spacebutton"}; + m_Button = new VisualElement() { name = "spacebutton" }; m_Button.AddManipulator(new Clickable(OnButtonClick)); Add(m_Button); AddToClassList("spaceablepropertyrm"); diff --git a/com.unity.visualeffectgraph/Editor/GraphView/Views/Properties/StringPropertyRM.cs b/com.unity.visualeffectgraph/Editor/GraphView/Views/Properties/StringPropertyRM.cs index ee44aaf39c6..be802a4e648 100644 --- a/com.unity.visualeffectgraph/Editor/GraphView/Views/Properties/StringPropertyRM.cs +++ b/com.unity.visualeffectgraph/Editor/GraphView/Views/Properties/StringPropertyRM.cs @@ -99,7 +99,7 @@ public static StringPushButtonInfo FindPushButtonBehavior(object[] customAttribu { var instance = Activator.CreateInstance((attribute as PushButtonAttribute).pushButtonProvider); var pushButtonBehavior = instance as IPushButtonBehavior; - return new StringPushButtonInfo() {action = (a) => pushButtonBehavior.OnClicked(a), buttonName = (attribute as PushButtonAttribute).buttonName}; + return new StringPushButtonInfo() { action = (a) => pushButtonBehavior.OnClicked(a), buttonName = (attribute as PushButtonAttribute).buttonName }; } } } diff --git a/com.unity.visualeffectgraph/Editor/GraphView/Views/VFXCopy.cs b/com.unity.visualeffectgraph/Editor/GraphView/Views/VFXCopy.cs index ee5727548aa..79b1e5c41c4 100644 --- a/com.unity.visualeffectgraph/Editor/GraphView/Views/VFXCopy.cs +++ b/com.unity.visualeffectgraph/Editor/GraphView/Views/VFXCopy.cs @@ -143,7 +143,7 @@ void CopyGroupNodesAndStickyNotes(ref SerializableGraph serializableGraph, IEnum VFXGroupNodeController groupNode = groupNodes[i]; VFXUI.GroupInfo info = groupNode.model.groupInfos[groupNode.index]; - serializableGraph.groupNodes[i] = new GroupNode { infos = new VFXUI.UIInfo(info)}; + serializableGraph.groupNodes[i] = new GroupNode { infos = new VFXUI.UIInfo(info) }; // only keep nodes and sticky notes that are copied because a element can not be in two groups at the same time. if (info.contents != null) diff --git a/com.unity.visualeffectgraph/Editor/GraphView/Views/VFXNodeProvider.cs b/com.unity.visualeffectgraph/Editor/GraphView/Views/VFXNodeProvider.cs index 8e7b974c48f..1f3e89e0519 100644 --- a/com.unity.visualeffectgraph/Editor/GraphView/Views/VFXNodeProvider.cs +++ b/com.unity.visualeffectgraph/Editor/GraphView/Views/VFXNodeProvider.cs @@ -146,7 +146,7 @@ protected override string GetName(Descriptor desc) protected override string title { - get {return "Node"; } + get { return "Node"; } } string ComputeCategory(string type, VFXModelDescriptor model) where T : VFXModel diff --git a/com.unity.visualeffectgraph/Editor/GraphView/Views/VFXView.cs b/com.unity.visualeffectgraph/Editor/GraphView/Views/VFXView.cs index 669570c4eae..2d0adbe5867 100644 --- a/com.unity.visualeffectgraph/Editor/GraphView/Views/VFXView.cs +++ b/com.unity.visualeffectgraph/Editor/GraphView/Views/VFXView.cs @@ -492,7 +492,7 @@ public VFXView() // End Toolbar - m_NoAssetLabel = new Label("\n\n\nTo begin creating Visual Effects, create a new Visual Effect Graph Asset.\n(or double-click an existing Visual Effect Graph in the project view)") { name = "no-asset"}; + m_NoAssetLabel = new Label("\n\n\nTo begin creating Visual Effects, create a new Visual Effect Graph Asset.\n(or double-click an existing Visual Effect Graph in the project view)") { name = "no-asset" }; m_NoAssetLabel.style.position = PositionType.Absolute; m_NoAssetLabel.style.left = new StyleLength(40f); m_NoAssetLabel.style.right = new StyleLength(40f); @@ -1601,7 +1601,7 @@ public override List GetCompatiblePorts(Port startAnchor, NodeAdapter node if (startAnchor is VFXDataAnchor) { - var controllers = controller.GetCompatiblePorts((startAnchor as VFXDataAnchor).controller, nodeAdapter); + var controllers = controller.GetCompatiblePorts((startAnchor as VFXDataAnchor).controller, nodeAdapter); return controllers.Select(t => (Port)GetDataAnchorByController(t as VFXDataAnchorController)).ToList(); } else @@ -1973,7 +1973,7 @@ public void AddParameterToSelection(VFXParameter parameter) void CopyInputLinks(VFXNodeController sourceController, VFXNodeController targetController) { - foreach (var st in sourceController.inputPorts.Zip(targetController.inputPorts, (s, t) => new { source = s, target = t})) + foreach (var st in sourceController.inputPorts.Zip(targetController.inputPorts, (s, t) => new { source = s, target = t })) { CopyInputLinks(st.source, st.target); } @@ -2033,7 +2033,7 @@ public void PushUnderContext(VFXContextUI context, float size) { VFXContextUI topContext = flowEdge.output.GetFirstAncestorOfType(); VFXContextUI bottomContext = flowEdge.input.GetFirstAncestorOfType(); - if (contexts.Contains(topContext) && !contexts.Contains(bottomContext)) + if (contexts.Contains(topContext) && !contexts.Contains(bottomContext)) { float topContextBottom = topContext.layout.yMax; float newTopContextBottom = topContext.layout.yMax + size; @@ -2140,7 +2140,7 @@ void OnEnterSubgraph(DropdownMenuAction e) void OnCreateNodeOnEdge(DropdownMenuAction e) { - VFXFilterWindow.Show(VFXViewWindow.currentWindow, e.eventInfo.mousePosition, ViewToScreenPosition(e.eventInfo.mousePosition), new VFXNodeProvider(controller, (d, v) => AddNodeOnEdge(d, v, e.userData as VFXDataEdgeController), null, new Type[] { typeof(VFXOperator)})); + VFXFilterWindow.Show(VFXViewWindow.currentWindow, e.eventInfo.mousePosition, ViewToScreenPosition(e.eventInfo.mousePosition), new VFXNodeProvider(controller, (d, v) => AddNodeOnEdge(d, v, e.userData as VFXDataEdgeController), null, new Type[] { typeof(VFXOperator) })); } void AddNodeOnEdge(VFXNodeProvider.Descriptor desc, Vector2 position, VFXDataEdgeController edge) @@ -2243,7 +2243,7 @@ public override void BuildContextualMenu(ContextualMenuPopulateEvent evt) } if (evt.target is GraphView || evt.target is Node || evt.target is Group) { - evt.menu.AppendAction("Duplicate with edges" , (a) => { DuplicateSelectionWithEdges(); }, + evt.menu.AppendAction("Duplicate with edges", (a) => { DuplicateSelectionWithEdges(); }, (a) => { return canDuplicateSelection ? DropdownMenuAction.Status.Normal : DropdownMenuAction.Status.Disabled; }); evt.menu.AppendSeparator(); } diff --git a/com.unity.visualeffectgraph/Editor/Inspector/AdvancedVisualEffectEditor.cs b/com.unity.visualeffectgraph/Editor/Inspector/AdvancedVisualEffectEditor.cs index 6d31346ebac..f7a4341410c 100644 --- a/com.unity.visualeffectgraph/Editor/Inspector/AdvancedVisualEffectEditor.cs +++ b/com.unity.visualeffectgraph/Editor/Inspector/AdvancedVisualEffectEditor.cs @@ -361,7 +361,7 @@ public GizmoContext(SerializedObject obj, VFXParameter parameter) public override System.Type portType { - get {return m_Parameter.type; } + get { return m_Parameter.type; } } public override VFXCoordinateSpace space @@ -401,7 +401,7 @@ public override object value public override VFXGizmo.IProperty RegisterProperty(string memberPath) { var cmdList = new List, object>>(); - bool succeeded = BuildPropertyValue(cmdList, m_Parameter.type, m_Parameter.exposedName, memberPath.Split(new char[] {separator[0]}, StringSplitOptions.RemoveEmptyEntries), 0); + bool succeeded = BuildPropertyValue(cmdList, m_Parameter.type, m_Parameter.exposedName, memberPath.Split(new char[] { separator[0] }, StringSplitOptions.RemoveEmptyEntries), 0); if (succeeded) { return new Property(m_SerializedObject, cmdList); @@ -495,7 +495,8 @@ bool BuildPropertyValue(List, object>> cmdList, Type type if (specialSpacableVector3CaseField != null) { cmdList.Add( - (l, o) => { + (l, o) => + { object vector3Property = specialSpacableVector3CaseField.GetValue(o); SetObjectValue(property, vector3Property); }); @@ -528,7 +529,7 @@ bool BuildPropertyValue(List, object>> cmdList, Type type FieldInfo vector3Field = type.GetFields(BindingFlags.Instance | BindingFlags.Public).First(t => t.FieldType == typeof(Vector3)); string name = vector3Field.Name; - return BuildPropertyValue(cmdList, typeof(Vector3), propertyPath + "_" + name, new string[] {name}, 1, vector3Field); + return BuildPropertyValue(cmdList, typeof(Vector3), propertyPath + "_" + name, new string[] { name }, 1, vector3Field); } Debug.LogError("Setting A value across multiple property is not yet supported"); @@ -650,7 +651,7 @@ public Property(SerializedObject serilializedObject, List, o m_CmdList = cmdlist; } - public bool isEditable { get {return true; } } + public bool isEditable { get { return true; } } List, object>> m_CmdList; diff --git a/com.unity.visualeffectgraph/Editor/Inspector/VFXAssetEditor.cs b/com.unity.visualeffectgraph/Editor/Inspector/VFXAssetEditor.cs index 10425ccec4a..7cc36ecc421 100644 --- a/com.unity.visualeffectgraph/Editor/Inspector/VFXAssetEditor.cs +++ b/com.unity.visualeffectgraph/Editor/Inspector/VFXAssetEditor.cs @@ -655,7 +655,7 @@ public override void OnInspectorGUI() m_ReorderableList.DoLayoutList(); - VisualEffectEditor.ShowHeader(EditorGUIUtility.TrTextContent("Shaders"), false, false); + VisualEffectEditor.ShowHeader(EditorGUIUtility.TrTextContent("Shaders"), false, false); string assetPath = AssetDatabase.GetAssetPath(asset); UnityObject[] objects = AssetDatabase.LoadAllAssetsAtPath(assetPath); diff --git a/com.unity.visualeffectgraph/Editor/Inspector/VFXManagerEditor.cs b/com.unity.visualeffectgraph/Editor/Inspector/VFXManagerEditor.cs index be5662b0524..092e363df37 100644 --- a/com.unity.visualeffectgraph/Editor/Inspector/VFXManagerEditor.cs +++ b/com.unity.visualeffectgraph/Editor/Inspector/VFXManagerEditor.cs @@ -95,10 +95,10 @@ public static void CheckVFXManager() SerializedObject obj = new SerializedObject(vfxmanager); bool shaderModified = false; - shaderModified |= SetBuiltInShaderIfNeeded(obj, "m_IndirectShader", "Packages/com.unity.visualeffectgraph/Shaders/VFXFillIndirectArgs.compute"); - shaderModified |= SetBuiltInShaderIfNeeded(obj, "m_CopyBufferShader", "Packages/com.unity.visualeffectgraph/Shaders/VFXCopyBuffer.compute"); - shaderModified |= SetBuiltInShaderIfNeeded(obj, "m_SortShader", "Packages/com.unity.visualeffectgraph/Shaders/Sort.compute"); - shaderModified |= SetBuiltInShaderIfNeeded(obj, "m_StripUpdateShader", "Packages/com.unity.visualeffectgraph/Shaders/UpdateStrips.compute"); + shaderModified |= SetBuiltInShaderIfNeeded(obj, "m_IndirectShader", "Packages/com.unity.visualeffectgraph/Shaders/VFXFillIndirectArgs.compute"); + shaderModified |= SetBuiltInShaderIfNeeded(obj, "m_CopyBufferShader", "Packages/com.unity.visualeffectgraph/Shaders/VFXCopyBuffer.compute"); + shaderModified |= SetBuiltInShaderIfNeeded(obj, "m_SortShader", "Packages/com.unity.visualeffectgraph/Shaders/Sort.compute"); + shaderModified |= SetBuiltInShaderIfNeeded(obj, "m_StripUpdateShader", "Packages/com.unity.visualeffectgraph/Shaders/UpdateStrips.compute"); if (shaderModified) obj.ApplyModifiedPropertiesWithoutUndo(); diff --git a/com.unity.visualeffectgraph/Editor/Inspector/VFXSlotContainerEditor.cs b/com.unity.visualeffectgraph/Editor/Inspector/VFXSlotContainerEditor.cs index cf9aefc156d..c790be45db8 100644 --- a/com.unity.visualeffectgraph/Editor/Inspector/VFXSlotContainerEditor.cs +++ b/com.unity.visualeffectgraph/Editor/Inspector/VFXSlotContainerEditor.cs @@ -324,7 +324,7 @@ static Styles() { VFXValueType.Uint32, new Color32(125, 110, 191, 255) }, }; - internal static void DataTypeLabel(Rect r , string Label, VFXValueType type, GUIStyle style) + internal static void DataTypeLabel(Rect r, string Label, VFXValueType type, GUIStyle style) { Color backup = GUI.color; GUI.color = valueTypeColors[type]; diff --git a/com.unity.visualeffectgraph/Editor/Inspector/VisualEffectEditor.cs b/com.unity.visualeffectgraph/Editor/Inspector/VisualEffectEditor.cs index c4a1a39ebb6..eccd43a972d 100644 --- a/com.unity.visualeffectgraph/Editor/Inspector/VisualEffectEditor.cs +++ b/com.unity.visualeffectgraph/Editor/Inspector/VisualEffectEditor.cs @@ -547,7 +547,7 @@ protected virtual void SceneViewGUICallback(UnityObject target, SceneView sceneV void SetPlayRate(object value) { - float rate = (float)((int)value) * VisualEffectControl.valueToPlayRate; + float rate = (float)((int)value) * VisualEffectControl.valueToPlayRate; VisualEffect effect = ((VisualEffect)targets[0]); effect.playRate = rate; } @@ -1132,7 +1132,7 @@ protected virtual void DrawParameters(VisualEffectResource resource) GUILayout.Space(1); // Space for the line if the last category is closed. } - protected virtual void PropertyOverrideChanged() {} + protected virtual void PropertyOverrideChanged() { } private void DrawRendererProperties() { @@ -1316,37 +1316,37 @@ public void OnInspectorGUI() private static class Contents { - public static readonly GUIContent renderingLayerMaskStyle = EditorGUIUtility.TrTextContent("Rendering Layer Mask", "Mask that can be used with SRP DrawRenderers command to filter renderers outside of the normal layering system."); - public static readonly GUIContent rendererPriorityStyle = EditorGUIUtility.TrTextContent("Priority", "Priority used for sorting objects on top of material render queue."); - public static readonly GUIContent lightProbeUsageStyle = EditorGUIUtility.TrTextContent("Light Probes", "Specifies how Light Probes will handle the interpolation of lighting and occlusion."); - public static readonly GUIContent reflectionProbeUsageStyle = EditorGUIUtility.TrTextContent("Reflection Probes", "Specifies if or how the object is affected by reflections in the Scene. This property cannot be disabled in deferred rendering modes."); - public static readonly GUIContent lightProbeVolumeOverrideStyle = EditorGUIUtility.TrTextContent("Proxy Volume Override", "If set, the Renderer will use the Light Probe Proxy Volume component from another GameObject."); - public static readonly GUIContent lightProbeAnchorStyle = EditorGUIUtility.TrTextContent("Anchor Override", "Specifies the Transform position that will be used for sampling the light probes and reflection probes."); + public static readonly GUIContent renderingLayerMaskStyle = EditorGUIUtility.TrTextContent("Rendering Layer Mask", "Mask that can be used with SRP DrawRenderers command to filter renderers outside of the normal layering system."); + public static readonly GUIContent rendererPriorityStyle = EditorGUIUtility.TrTextContent("Priority", "Priority used for sorting objects on top of material render queue."); + public static readonly GUIContent lightProbeUsageStyle = EditorGUIUtility.TrTextContent("Light Probes", "Specifies how Light Probes will handle the interpolation of lighting and occlusion."); + public static readonly GUIContent reflectionProbeUsageStyle = EditorGUIUtility.TrTextContent("Reflection Probes", "Specifies if or how the object is affected by reflections in the Scene. This property cannot be disabled in deferred rendering modes."); + public static readonly GUIContent lightProbeVolumeOverrideStyle = EditorGUIUtility.TrTextContent("Proxy Volume Override", "If set, the Renderer will use the Light Probe Proxy Volume component from another GameObject."); + public static readonly GUIContent lightProbeAnchorStyle = EditorGUIUtility.TrTextContent("Anchor Override", "Specifies the Transform position that will be used for sampling the light probes and reflection probes."); public static readonly GUIContent lightProbeVolumeUnsupportedNote = EditorGUIUtility.TrTextContent("The Light Probe Proxy Volume feature is unsupported by the current graphics hardware or API configuration. Simple 'Blend Probes' mode will be used instead."); - public static readonly GUIContent probeSettings = EditorGUIUtility.TrTextContent("Probes"); - public static readonly GUIContent otherSettings = EditorGUIUtility.TrTextContent("Additional Settings"); + public static readonly GUIContent probeSettings = EditorGUIUtility.TrTextContent("Probes"); + public static readonly GUIContent otherSettings = EditorGUIUtility.TrTextContent("Additional Settings"); } } protected static class Contents { - public static readonly GUIContent headerPlayControls = EditorGUIUtility.TrTextContent("Play Controls"); - public static readonly GUIContent headerGeneral = EditorGUIUtility.TrTextContent("General"); - public static readonly GUIContent headerProperties = EditorGUIUtility.TrTextContent("Properties"); - public static readonly GUIContent headerRenderer = EditorGUIUtility.TrTextContent("Renderer"); - - public static readonly GUIContent assetPath = EditorGUIUtility.TrTextContent("Asset Template", "Sets the Visual Effect Graph asset to be used in this component."); - public static readonly GUIContent randomSeed = EditorGUIUtility.TrTextContent("Random Seed", "Sets the value used when determining the randomness of the graph. Using the same seed will make the Visual Effect play identically each time."); - public static readonly GUIContent reseedOnPlay = EditorGUIUtility.TrTextContent("Reseed on play", "When enabled, a new random seed value will be used each time the effect is played. Enable to randomize the look of this Visual Effect."); - public static readonly GUIContent openEditor = EditorGUIUtility.TrTextContent("Edit", "Opens the currently assigned template for editing within the Visual Effect Graph window."); - public static readonly GUIContent createAsset = EditorGUIUtility.TrTextContent("New", "Creates a new Visual Effect Graph and opens it for editing within the Visual Effect Graph window."); - public static readonly GUIContent setRandomSeed = EditorGUIUtility.TrTextContent("Reseed", "When clicked, if ‘Reseed on play’ is disabled a new random seed will be generated."); - public static readonly GUIContent resetInitialEvent = EditorGUIUtility.TrTextContent("Default"); - public static readonly GUIContent setPlayRate = EditorGUIUtility.TrTextContent("Set"); - public static readonly GUIContent playRate = EditorGUIUtility.TrTextContent("Rate"); - - public static readonly GUIContent graphInBundle = EditorGUIUtility.TrTextContent("Exposed properties are hidden in the Inspector when Visual Effect Assets are stored in Asset Bundles."); + public static readonly GUIContent headerPlayControls = EditorGUIUtility.TrTextContent("Play Controls"); + public static readonly GUIContent headerGeneral = EditorGUIUtility.TrTextContent("General"); + public static readonly GUIContent headerProperties = EditorGUIUtility.TrTextContent("Properties"); + public static readonly GUIContent headerRenderer = EditorGUIUtility.TrTextContent("Renderer"); + + public static readonly GUIContent assetPath = EditorGUIUtility.TrTextContent("Asset Template", "Sets the Visual Effect Graph asset to be used in this component."); + public static readonly GUIContent randomSeed = EditorGUIUtility.TrTextContent("Random Seed", "Sets the value used when determining the randomness of the graph. Using the same seed will make the Visual Effect play identically each time."); + public static readonly GUIContent reseedOnPlay = EditorGUIUtility.TrTextContent("Reseed on play", "When enabled, a new random seed value will be used each time the effect is played. Enable to randomize the look of this Visual Effect."); + public static readonly GUIContent openEditor = EditorGUIUtility.TrTextContent("Edit", "Opens the currently assigned template for editing within the Visual Effect Graph window."); + public static readonly GUIContent createAsset = EditorGUIUtility.TrTextContent("New", "Creates a new Visual Effect Graph and opens it for editing within the Visual Effect Graph window."); + public static readonly GUIContent setRandomSeed = EditorGUIUtility.TrTextContent("Reseed", "When clicked, if ‘Reseed on play’ is disabled a new random seed will be generated."); + public static readonly GUIContent resetInitialEvent = EditorGUIUtility.TrTextContent("Default"); + public static readonly GUIContent setPlayRate = EditorGUIUtility.TrTextContent("Set"); + public static readonly GUIContent playRate = EditorGUIUtility.TrTextContent("Rate"); + + public static readonly GUIContent graphInBundle = EditorGUIUtility.TrTextContent("Exposed properties are hidden in the Inspector when Visual Effect Assets are stored in Asset Bundles."); static readonly GUIContent[] m_Icons; diff --git a/com.unity.visualeffectgraph/Editor/Models/Blocks/Implementations/Attribute/AttributeFromMap.cs b/com.unity.visualeffectgraph/Editor/Models/Blocks/Implementations/Attribute/AttributeFromMap.cs index 673f2c2c254..50b8d2e76a6 100644 --- a/com.unity.visualeffectgraph/Editor/Models/Blocks/Implementations/Attribute/AttributeFromMap.cs +++ b/com.unity.visualeffectgraph/Editor/Models/Blocks/Implementations/Attribute/AttributeFromMap.cs @@ -185,11 +185,11 @@ public override IEnumerable parameters } else { - var particleIdExpr = new VFXAttributeExpression(VFXAttribute.ParticleId); + var particleIdExpr = new VFXAttributeExpression(VFXAttribute.ParticleId); var attribMapExpr = GetExpressionsFromSlots(this).First(o => o.name == "attributeMap").exp; var height = new VFXExpressionTextureHeight(attribMapExpr); - var width = new VFXExpressionTextureWidth(attribMapExpr); - var countExpr = height * width; + var width = new VFXExpressionTextureWidth(attribMapExpr); + var countExpr = height * width; VFXExpression samplePos = VFXValue.Constant(0); switch (SampleMode) @@ -212,16 +212,16 @@ public override IEnumerable parameters samplePos = new VFXExpressionCastFloatToUint(randExpr * new VFXExpressionCastUintToFloat(countExpr)); break; case AttributeMapSampleMode.RandomConstantPerParticle: - var seedExpr = GetExpressionsFromSlots(this).First(o => o.name == "Seed").exp; + var seedExpr = GetExpressionsFromSlots(this).First(o => o.name == "Seed").exp; var randFixedExpr = VFXOperatorUtility.BuildRandom(VFXSeedMode.PerParticle, true, new RandId(this), seedExpr); - samplePos = new VFXExpressionCastFloatToUint(randFixedExpr * new VFXExpressionCastUintToFloat(countExpr)); + samplePos = new VFXExpressionCastFloatToUint(randFixedExpr * new VFXExpressionCastUintToFloat(countExpr)); break; } var y = samplePos / width; var x = samplePos - (y * width); var outputType = VFXExpression.TypeToType(currentAttribute.type); var type = typeof(VFXExpressionSampleAttributeMap<>).MakeGenericType(outputType); - var outputExpr = Activator.CreateInstance(type, new object[] {attribMapExpr, x, y }); + var outputExpr = Activator.CreateInstance(type, new object[] { attribMapExpr, x, y }); yield return new VFXNamedExpression((VFXExpression)outputExpr, "value"); } diff --git a/com.unity.visualeffectgraph/Editor/Models/Blocks/Implementations/Collision/CollisionSDF.cs b/com.unity.visualeffectgraph/Editor/Models/Blocks/Implementations/Collision/CollisionSDF.cs index db2b4c4f877..a0ed33d27d6 100644 --- a/com.unity.visualeffectgraph/Editor/Models/Blocks/Implementations/Collision/CollisionSDF.cs +++ b/com.unity.visualeffectgraph/Editor/Models/Blocks/Implementations/Collision/CollisionSDF.cs @@ -29,7 +29,7 @@ public override IEnumerable parameters if (input.name == "FieldTransform") { yield return new VFXNamedExpression(new VFXExpressionInverseTRSMatrix(input.exp), "InvFieldTransform"); - yield return new VFXNamedExpression(VFXOperatorUtility.Max3(new VFXExpressionExtractScaleFromMatrix(input.exp)) , "scalingFactor"); + yield return new VFXNamedExpression(VFXOperatorUtility.Max3(new VFXExpressionExtractScaleFromMatrix(input.exp)), "scalingFactor"); } } } diff --git a/com.unity.visualeffectgraph/Editor/Models/Blocks/Implementations/Position/PositionAABox.cs b/com.unity.visualeffectgraph/Editor/Models/Blocks/Implementations/Position/PositionAABox.cs index 532904f957d..5c6b447cd3a 100644 --- a/com.unity.visualeffectgraph/Editor/Models/Blocks/Implementations/Position/PositionAABox.cs +++ b/com.unity.visualeffectgraph/Editor/Models/Blocks/Implementations/Position/PositionAABox.cs @@ -9,7 +9,7 @@ namespace UnityEditor.VFX.Block [VFXInfo(category = "Position", variantProvider = typeof(PositionBaseProvider))] class PositionAABox : PositionBase { - public override string name { get { return string.Format(base.name, "AABox");; } } + public override string name { get { return string.Format(base.name, "AABox"); ; } } public class InputProperties { diff --git a/com.unity.visualeffectgraph/Editor/Models/Blocks/Implementations/Position/PositionTorus.cs b/com.unity.visualeffectgraph/Editor/Models/Blocks/Implementations/Position/PositionTorus.cs index 429e74b8798..b81d1e787c4 100644 --- a/com.unity.visualeffectgraph/Editor/Models/Blocks/Implementations/Position/PositionTorus.cs +++ b/com.unity.visualeffectgraph/Editor/Models/Blocks/Implementations/Position/PositionTorus.cs @@ -13,7 +13,7 @@ class PositionTorus : PositionBase public class InputProperties { [Tooltip("Sets the torus used for positioning the particles.")] - public ArcTorus ArcTorus = ArcTorus.defaultValue; + public ArcTorus ArcTorus = ArcTorus.defaultValue; } public class CustomProperties diff --git a/com.unity.visualeffectgraph/Editor/Models/Blocks/Implementations/Size/ScreenSpaceSize.cs b/com.unity.visualeffectgraph/Editor/Models/Blocks/Implementations/Size/ScreenSpaceSize.cs index b1ef0d15034..95b68ecb024 100644 --- a/com.unity.visualeffectgraph/Editor/Models/Blocks/Implementations/Size/ScreenSpaceSize.cs +++ b/com.unity.visualeffectgraph/Editor/Models/Blocks/Implementations/Size/ScreenSpaceSize.cs @@ -109,11 +109,11 @@ public override string source string sizeString = string.Empty; switch (sizeMode) { - case SizeMode.PixelAbsolute: sizeString = "float2(PixelSize, PixelSize)"; break; - case SizeMode.PixelRelativeToResolution: sizeString = "float2(PixelSize, PixelSize) * (_ScreenParams.xy/ReferenceResolution)"; break; - case SizeMode.RatioRelativeToWidth: sizeString = "float2(_ScreenParams.x, _ScreenParams.x) * RelativeSize"; break; - case SizeMode.RatioRelativeToHeight: sizeString = "float2(_ScreenParams.y, _ScreenParams.y) * RelativeSize"; break; - case SizeMode.RatioRelativeToHeightAndWidth: sizeString = "float2(_ScreenParams.x, _ScreenParams.y) * RelativeSize"; break; + case SizeMode.PixelAbsolute: sizeString = "float2(PixelSize, PixelSize)"; break; + case SizeMode.PixelRelativeToResolution: sizeString = "float2(PixelSize, PixelSize) * (_ScreenParams.xy/ReferenceResolution)"; break; + case SizeMode.RatioRelativeToWidth: sizeString = "float2(_ScreenParams.x, _ScreenParams.x) * RelativeSize"; break; + case SizeMode.RatioRelativeToHeight: sizeString = "float2(_ScreenParams.y, _ScreenParams.y) * RelativeSize"; break; + case SizeMode.RatioRelativeToHeightAndWidth: sizeString = "float2(_ScreenParams.x, _ScreenParams.y) * RelativeSize"; break; default: throw new NotImplementedException(string.Format("Not Implemented SizeMode: {0}", sizeMode)); } @@ -130,10 +130,10 @@ public override string source switch (sizeZMode) { case SizeZMode.Ignore: break; // should not happen - case SizeZMode.SameAsSizeX: Source += "scaleZ = scaleX;"; break; - case SizeZMode.SameAsSizeY: Source += "scaleZ = scaleY;"; break; - case SizeZMode.MinOfSizeXY: Source += "scaleZ = min(scaleX,scaleY);"; break; - case SizeZMode.MaxOfSizeXY: Source += "scaleZ = max(scaleX,scaleY);"; break; + case SizeZMode.SameAsSizeX: Source += "scaleZ = scaleX;"; break; + case SizeZMode.SameAsSizeY: Source += "scaleZ = scaleY;"; break; + case SizeZMode.MinOfSizeXY: Source += "scaleZ = min(scaleX,scaleY);"; break; + case SizeZMode.MaxOfSizeXY: Source += "scaleZ = max(scaleX,scaleY);"; break; case SizeZMode.AverageOfSizeXY: Source += "scaleZ = (scaleX + scaleY) * 0.5;"; break; } } diff --git a/com.unity.visualeffectgraph/Editor/Models/Blocks/Implementations/Spawn/VFXSpawnerBurst.cs b/com.unity.visualeffectgraph/Editor/Models/Blocks/Implementations/Spawn/VFXSpawnerBurst.cs index a854699e8ca..bf304f9ce87 100644 --- a/com.unity.visualeffectgraph/Editor/Models/Blocks/Implementations/Spawn/VFXSpawnerBurst.cs +++ b/com.unity.visualeffectgraph/Editor/Models/Blocks/Implementations/Spawn/VFXSpawnerBurst.cs @@ -40,7 +40,7 @@ public enum RandomMode private RepeatMode repeat = RepeatMode.Single; [VFXSetting, SerializeField, Tooltip("Specifies whether a constant number of particles is spawned, or a random number within the chosen range.")] - private RandomMode spawnMode = RandomMode.Constant; + private RandomMode spawnMode = RandomMode.Constant; [VFXSetting, SerializeField, Tooltip("Specifies whether a constant delay is applied between bursts, or a random one within the chosen range.")] private RandomMode delayMode = RandomMode.Constant; diff --git a/com.unity.visualeffectgraph/Editor/Models/Blocks/Implementations/Spawn/VFXSpawnerSetAttribute.cs b/com.unity.visualeffectgraph/Editor/Models/Blocks/Implementations/Spawn/VFXSpawnerSetAttribute.cs index 83d27069768..36eb8547fef 100644 --- a/com.unity.visualeffectgraph/Editor/Models/Blocks/Implementations/Spawn/VFXSpawnerSetAttribute.cs +++ b/com.unity.visualeffectgraph/Editor/Models/Blocks/Implementations/Spawn/VFXSpawnerSetAttribute.cs @@ -79,7 +79,7 @@ public override IEnumerable parameters var min = base.parameters.First(o => o.name == "Min"); var max = base.parameters.First(o => o.name == "Max"); - return new[] { new VFXNamedExpression(VFXOperatorUtility.Lerp(min.exp, max.exp, random), currentAttribute.name)}; + return new[] { new VFXNamedExpression(VFXOperatorUtility.Lerp(min.exp, max.exp, random), currentAttribute.name) }; } } diff --git a/com.unity.visualeffectgraph/Editor/Models/Blocks/Implementations/Velocity/VelocitySpherical.cs b/com.unity.visualeffectgraph/Editor/Models/Blocks/Implementations/Velocity/VelocitySpherical.cs index 3ce7ad235e8..a2854d168f2 100644 --- a/com.unity.visualeffectgraph/Editor/Models/Blocks/Implementations/Velocity/VelocitySpherical.cs +++ b/com.unity.visualeffectgraph/Editor/Models/Blocks/Implementations/Velocity/VelocitySpherical.cs @@ -9,7 +9,7 @@ namespace UnityEditor.VFX.Block class VelocitySpherical : VelocityBase { public override string name { get { return string.Format(base.name, "Spherical"); } } - protected override bool altersDirection { get { return true; } } + protected override bool altersDirection { get { return true; } } public override IEnumerable attributes { diff --git a/com.unity.visualeffectgraph/Editor/Models/Blocks/Implementations/Velocity/VelocityTangent.cs b/com.unity.visualeffectgraph/Editor/Models/Blocks/Implementations/Velocity/VelocityTangent.cs index bf1623926e0..12463ab14d4 100644 --- a/com.unity.visualeffectgraph/Editor/Models/Blocks/Implementations/Velocity/VelocityTangent.cs +++ b/com.unity.visualeffectgraph/Editor/Models/Blocks/Implementations/Velocity/VelocityTangent.cs @@ -9,7 +9,7 @@ namespace UnityEditor.VFX.Block class VelocityTangent : VelocityBase { public override string name { get { return string.Format(base.name, "Tangent"); } } - protected override bool altersDirection { get { return true; } } + protected override bool altersDirection { get { return true; } } public override IEnumerable attributes { diff --git a/com.unity.visualeffectgraph/Editor/Models/Blocks/VFXSubgraphBlock.cs b/com.unity.visualeffectgraph/Editor/Models/Blocks/VFXSubgraphBlock.cs index 8b9ea08cc10..267cf7d52a9 100644 --- a/com.unity.visualeffectgraph/Editor/Models/Blocks/VFXSubgraphBlock.cs +++ b/com.unity.visualeffectgraph/Editor/Models/Blocks/VFXSubgraphBlock.cs @@ -210,7 +210,7 @@ public IEnumerable recursiveSubBlocks { get { - return m_SubBlocks == null || !isActive? Enumerable.Empty() : (m_SubBlocks.SelectMany(t => t is VFXSubgraphBlock ? (t as VFXSubgraphBlock).recursiveSubBlocks : Enumerable.Repeat(t, 1))); + return m_SubBlocks == null || !isActive ? Enumerable.Empty() : (m_SubBlocks.SelectMany(t => t is VFXSubgraphBlock ? (t as VFXSubgraphBlock).recursiveSubBlocks : Enumerable.Repeat(t, 1))); } } public override bool isValid diff --git a/com.unity.visualeffectgraph/Editor/Models/Contexts/Implementations/VFXAbstractParticleOutput.cs b/com.unity.visualeffectgraph/Editor/Models/Contexts/Implementations/VFXAbstractParticleOutput.cs index c410af6a50f..7810b8abc11 100644 --- a/com.unity.visualeffectgraph/Editor/Models/Contexts/Implementations/VFXAbstractParticleOutput.cs +++ b/com.unity.visualeffectgraph/Editor/Models/Contexts/Implementations/VFXAbstractParticleOutput.cs @@ -123,8 +123,8 @@ protected enum FlipbookLayout private bool hasExposure { get { return needsExposureWeight && subOutput.supportsExposure; } } - public bool HasIndirectDraw() { return (indirectDraw || HasSorting() || VFXOutputUpdate.HasFeature(outputUpdateFeatures, VFXOutputUpdate.Features.IndirectDraw)) && !HasStrips(true); } - public bool HasSorting() { return (sort == SortMode.On || (sort == SortMode.Auto && (blendMode == BlendMode.Alpha || blendMode == BlendMode.AlphaPremultiplied))) && !HasStrips(true); } + public bool HasIndirectDraw() { return (indirectDraw || HasSorting() || VFXOutputUpdate.HasFeature(outputUpdateFeatures, VFXOutputUpdate.Features.IndirectDraw)) && !HasStrips(true); } + public bool HasSorting() { return (sort == SortMode.On || (sort == SortMode.Auto && (blendMode == BlendMode.Alpha || blendMode == BlendMode.AlphaPremultiplied))) && !HasStrips(true); } public bool HasComputeCulling() { return computeCulling && !HasStrips(true); } public bool HasFrustumCulling() { return frustumCulling && !HasStrips(true); } public bool NeedsOutputUpdate() { return outputUpdateFeatures != VFXOutputUpdate.Features.None; } @@ -165,7 +165,7 @@ int IVFXSubRenderer.sortPriority public bool HasStrips(bool data = false) { return (data ? GetData().type : ownedType) == VFXDataType.ParticleStrip; } - protected VFXAbstractParticleOutput(bool strip = false) : base(strip ? VFXDataType.ParticleStrip : VFXDataType.Particle) {} + protected VFXAbstractParticleOutput(bool strip = false) : base(strip ? VFXDataType.ParticleStrip : VFXDataType.Particle) { } public override bool codeGeneratorCompute { get { return false; } } @@ -254,11 +254,11 @@ protected virtual IEnumerable CollectGPUExpressions(IEnumera VFXNamedExpression mainTextureExp; try { - mainTextureExp = slotExpressions.First(o => (o.name == "mainTexture") | (o.name == "baseColorMap") | (o.name == "distortionBlurMap") | (o.name == "normalMap")); + mainTextureExp = slotExpressions.First(o => (o.name == "mainTexture") | (o.name == "baseColorMap") | (o.name == "distortionBlurMap") | (o.name == "normalMap")); } catch (InvalidOperationException) { - throw new NotImplementedException("Trying to fetch an inexistent slot Main Texture or Base Color Map or Distortion Blur Map or Normal Map. "); + throw new NotImplementedException("Trying to fetch an inexistent slot Main Texture or Base Color Map or Distortion Blur Map or Normal Map. "); } yield return new VFXNamedExpression(new VFXExpressionCastUintToFloat(new VFXExpressionTextureDepth(mainTextureExp.exp)), "flipBookSize"); } diff --git a/com.unity.visualeffectgraph/Editor/Models/Contexts/Implementations/VFXAbstractRenderedOutput.cs b/com.unity.visualeffectgraph/Editor/Models/Contexts/Implementations/VFXAbstractRenderedOutput.cs index 8db3f3eabd6..200b87503a3 100644 --- a/com.unity.visualeffectgraph/Editor/Models/Contexts/Implementations/VFXAbstractRenderedOutput.cs +++ b/com.unity.visualeffectgraph/Editor/Models/Contexts/Implementations/VFXAbstractRenderedOutput.cs @@ -47,7 +47,7 @@ public virtual bool hasMotionVector public virtual bool hasExcludeFromTAA => subOutput.supportsExcludeFromTAA && excludeFromTAA; - protected VFXAbstractRenderedOutput(VFXDataType dataType) : base(VFXContextType.Output, dataType, VFXDataType.None) {} + protected VFXAbstractRenderedOutput(VFXDataType dataType) : base(VFXContextType.Output, dataType, VFXDataType.None) { } public override IEnumerable GetFilteredOutEnumerators(string name) @@ -67,7 +67,7 @@ public VFXSRPSubOutput subOutput private VFXSRPSubOutput CreateDefaultSubOutput() { - var defaultSubOutput = ScriptableObject.CreateInstance(); + var defaultSubOutput = ScriptableObject.CreateInstance(); defaultSubOutput.Init(this); return defaultSubOutput; } diff --git a/com.unity.visualeffectgraph/Editor/Models/Contexts/Implementations/VFXBasicEvent.cs b/com.unity.visualeffectgraph/Editor/Models/Contexts/Implementations/VFXBasicEvent.cs index 78941e20598..5a9392cbaed 100644 --- a/com.unity.visualeffectgraph/Editor/Models/Contexts/Implementations/VFXBasicEvent.cs +++ b/com.unity.visualeffectgraph/Editor/Models/Contexts/Implementations/VFXBasicEvent.cs @@ -23,7 +23,7 @@ class VFXBasicEvent : VFXContext [VFXSetting, PushButton(typeof(LaunchEventBehavior), "Send"), Delayed] public string eventName = VisualEffectAsset.PlayEventName; - public VFXBasicEvent() : base(VFXContextType.Event, VFXDataType.None, VFXDataType.SpawnEvent) {} + public VFXBasicEvent() : base(VFXContextType.Event, VFXDataType.None, VFXDataType.SpawnEvent) { } public override string name { get { return "Event"; } } public override VFXExpressionMapper GetExpressionMapper(VFXDeviceTarget target) diff --git a/com.unity.visualeffectgraph/Editor/Models/Contexts/Implementations/VFXBasicGPUEvent.cs b/com.unity.visualeffectgraph/Editor/Models/Contexts/Implementations/VFXBasicGPUEvent.cs index c249caecdff..80262d281f9 100644 --- a/com.unity.visualeffectgraph/Editor/Models/Contexts/Implementations/VFXBasicGPUEvent.cs +++ b/com.unity.visualeffectgraph/Editor/Models/Contexts/Implementations/VFXBasicGPUEvent.cs @@ -13,7 +13,7 @@ struct GPUEvent [VFXInfo(experimental = true)] class VFXBasicGPUEvent : VFXContext { - public VFXBasicGPUEvent() : base(VFXContextType.SpawnerGPU, VFXDataType.None, VFXDataType.SpawnEvent) {} + public VFXBasicGPUEvent() : base(VFXContextType.SpawnerGPU, VFXDataType.None, VFXDataType.SpawnEvent) { } public override string name { get { return "GPUEvent"; } } public class InputProperties diff --git a/com.unity.visualeffectgraph/Editor/Models/Contexts/Implementations/VFXBasicInitialize.cs b/com.unity.visualeffectgraph/Editor/Models/Contexts/Implementations/VFXBasicInitialize.cs index 297169e294e..efa9c97d50b 100644 --- a/com.unity.visualeffectgraph/Editor/Models/Contexts/Implementations/VFXBasicInitialize.cs +++ b/com.unity.visualeffectgraph/Editor/Models/Contexts/Implementations/VFXBasicInitialize.cs @@ -23,7 +23,7 @@ protected override sealed Dictionary variants [VFXInfo(variantProvider = typeof(InitializeVariantProvider))] class VFXBasicInitialize : VFXContext { - public VFXBasicInitialize() : base(VFXContextType.Init, VFXDataType.SpawnEvent, VFXDataType.None) {} + public VFXBasicInitialize() : base(VFXContextType.Init, VFXDataType.SpawnEvent, VFXDataType.None) { } public override string name { get { return "Initialize " + ObjectNames.NicifyVariableName(ownedType.ToString()); } } public override string codeGeneratorTemplate { get { return VisualEffectGraphPackageInfo.assetPackagePath + "/Shaders/VFXInit"; } } public override bool codeGeneratorCompute { get { return true; } } diff --git a/com.unity.visualeffectgraph/Editor/Models/Contexts/Implementations/VFXBasicSpawner.cs b/com.unity.visualeffectgraph/Editor/Models/Contexts/Implementations/VFXBasicSpawner.cs index 172fac8efa6..8ff371b6845 100644 --- a/com.unity.visualeffectgraph/Editor/Models/Contexts/Implementations/VFXBasicSpawner.cs +++ b/com.unity.visualeffectgraph/Editor/Models/Contexts/Implementations/VFXBasicSpawner.cs @@ -187,7 +187,7 @@ public enum LoopMode [VFXSetting(VFXSettingAttribute.VisibleFlags.InInspector), SerializeField] private DelayMode delayAfterLoop = DelayMode.None; - public VFXBasicSpawner() : base(VFXContextType.Spawner, VFXDataType.SpawnEvent, VFXDataType.SpawnEvent) {} + public VFXBasicSpawner() : base(VFXContextType.Spawner, VFXDataType.SpawnEvent, VFXDataType.SpawnEvent) { } public override string name { get { return "Spawn"; } } protected override int inputFlowCount diff --git a/com.unity.visualeffectgraph/Editor/Models/Contexts/Implementations/VFXBasicUpdate.cs b/com.unity.visualeffectgraph/Editor/Models/Contexts/Implementations/VFXBasicUpdate.cs index f914ff225ff..4da48e685a7 100644 --- a/com.unity.visualeffectgraph/Editor/Models/Contexts/Implementations/VFXBasicUpdate.cs +++ b/com.unity.visualeffectgraph/Editor/Models/Contexts/Implementations/VFXBasicUpdate.cs @@ -38,7 +38,7 @@ class UpdateStyles m_SkipZeroDeltaTimeProperty = serializedObject.FindProperty("skipZeroDeltaUpdate"); } - private static Func> s_fnGetFilteredOutSettings = delegate(VFXBasicUpdate context) + private static Func> s_fnGetFilteredOutSettings = delegate (VFXBasicUpdate context) { var property = typeof(VFXBasicUpdate).GetProperty("filteredOutSettings", BindingFlags.Instance | BindingFlags.NonPublic); return property.GetValue(context) as IEnumerable; @@ -146,7 +146,7 @@ public enum VFXIntegrationMode [SerializeField, VFXSetting(VFXSettingAttribute.VisibleFlags.InInspector), Tooltip("When enabled, filters out block execution if deltaTime is equal to 0.")] private bool skipZeroDeltaUpdate = false; - public VFXBasicUpdate() : base(VFXContextType.Update, VFXDataType.None, VFXDataType.None) {} + public VFXBasicUpdate() : base(VFXContextType.Update, VFXDataType.None, VFXDataType.None) { } public override string name { get { return "Update " + ObjectNames.NicifyVariableName(ownedType.ToString()); } } public override string codeGeneratorTemplate { get { return VisualEffectGraphPackageInfo.assetPackagePath + "/Shaders/VFXUpdate"; } } public override bool codeGeneratorCompute { get { return true; } } @@ -181,7 +181,7 @@ protected override IEnumerable filteredOutSettings var lifeTime = data.IsCurrentAttributeWritten(VFXAttribute.Lifetime); var age = data.IsCurrentAttributeUsed(VFXAttribute.Age); var positionVelocity = data.IsCurrentAttributeWritten(VFXAttribute.Velocity); - var angularVelocity = data.IsCurrentAttributeWritten(VFXAttribute.AngularVelocityX) || + var angularVelocity = data.IsCurrentAttributeWritten(VFXAttribute.AngularVelocityX) || data.IsCurrentAttributeWritten(VFXAttribute.AngularVelocityY) || data.IsCurrentAttributeWritten(VFXAttribute.AngularVelocityZ); diff --git a/com.unity.visualeffectgraph/Editor/Models/Contexts/Implementations/VFXLineOutput.cs b/com.unity.visualeffectgraph/Editor/Models/Contexts/Implementations/VFXLineOutput.cs index c888df3ee51..6f6ade3e2ce 100644 --- a/com.unity.visualeffectgraph/Editor/Models/Contexts/Implementations/VFXLineOutput.cs +++ b/com.unity.visualeffectgraph/Editor/Models/Contexts/Implementations/VFXLineOutput.cs @@ -41,9 +41,9 @@ public override IEnumerable attributes { get { - yield return new VFXAttributeInfo(VFXAttribute.Color, VFXAttributeMode.Read); - yield return new VFXAttributeInfo(VFXAttribute.Alpha, VFXAttributeMode.Read); - yield return new VFXAttributeInfo(VFXAttribute.Alive, VFXAttributeMode.Read); + yield return new VFXAttributeInfo(VFXAttribute.Color, VFXAttributeMode.Read); + yield return new VFXAttributeInfo(VFXAttribute.Alpha, VFXAttributeMode.Read); + yield return new VFXAttributeInfo(VFXAttribute.Alive, VFXAttributeMode.Read); if (useTargetOffset) { diff --git a/com.unity.visualeffectgraph/Editor/Models/Contexts/Implementations/VFXLineStripOutput.cs b/com.unity.visualeffectgraph/Editor/Models/Contexts/Implementations/VFXLineStripOutput.cs index 5fa8dc31bdd..186538eefc8 100644 --- a/com.unity.visualeffectgraph/Editor/Models/Contexts/Implementations/VFXLineStripOutput.cs +++ b/com.unity.visualeffectgraph/Editor/Models/Contexts/Implementations/VFXLineStripOutput.cs @@ -7,7 +7,7 @@ namespace UnityEditor.VFX [VFXInfo(experimental = true)] class VFXLineStripOutput : VFXAbstractParticleOutput { - protected VFXLineStripOutput() : base(true) {} + protected VFXLineStripOutput() : base(true) { } public override string name { get { return "Output ParticleStrip Line"; } } public override string codeGeneratorTemplate { get { return RenderPipeTemplate("VFXParticleLinesHW"); } } public override VFXTaskType taskType { get { return VFXTaskType.ParticleLineOutput; } } diff --git a/com.unity.visualeffectgraph/Editor/Models/Contexts/Implementations/VFXMeshOutput.cs b/com.unity.visualeffectgraph/Editor/Models/Contexts/Implementations/VFXMeshOutput.cs index 5ef457db70b..33c5c7e2675 100644 --- a/com.unity.visualeffectgraph/Editor/Models/Contexts/Implementations/VFXMeshOutput.cs +++ b/com.unity.visualeffectgraph/Editor/Models/Contexts/Implementations/VFXMeshOutput.cs @@ -14,7 +14,7 @@ class VFXMeshOutput : VFXShaderGraphParticleOutput, IVFXMultiMeshOutput public override VFXTaskType taskType { get { return VFXTaskType.ParticleMeshOutput; } } public override bool supportsUV { get { return GetOrRefreshShaderGraphObject() == null; } } public override bool implementsMotionVector { get { return true; } } - public override CullMode defaultCullMode { get { return CullMode.Back; } } + public override CullMode defaultCullMode { get { return CullMode.Back; } } [VFXSetting(VFXSettingAttribute.VisibleFlags.InInspector), Range(1, 4), Tooltip("Specifies the number of different meshes (up to 4). Mesh per particle can be specified with the meshIndex attribute."), SerializeField] private uint MeshCount = 1; diff --git a/com.unity.visualeffectgraph/Editor/Models/Contexts/Implementations/VFXQuadStripOutput.cs b/com.unity.visualeffectgraph/Editor/Models/Contexts/Implementations/VFXQuadStripOutput.cs index 6654cabe93a..bb194b6307b 100644 --- a/com.unity.visualeffectgraph/Editor/Models/Contexts/Implementations/VFXQuadStripOutput.cs +++ b/com.unity.visualeffectgraph/Editor/Models/Contexts/Implementations/VFXQuadStripOutput.cs @@ -18,7 +18,7 @@ class VFXQuadStripOutput : VFXShaderGraphParticleOutput [VFXSetting(VFXSettingAttribute.VisibleFlags.None), SerializeField, Tooltip("When enabled, the axisZ attribute is used to orient the strip instead of facing the Camera.")] private bool UseCustomZAxis = false; - protected VFXQuadStripOutput() : base(true) {} + protected VFXQuadStripOutput() : base(true) { } public override string name { get { return "Output ParticleStrip Quad"; } } public override string codeGeneratorTemplate { get { return RenderPipeTemplate("VFXParticlePlanarPrimitive"); } } public override VFXTaskType taskType { get { return VFXTaskType.ParticleQuadOutput; } } diff --git a/com.unity.visualeffectgraph/Editor/Models/Contexts/Implementations/VFXStaticMeshOutput.cs b/com.unity.visualeffectgraph/Editor/Models/Contexts/Implementations/VFXStaticMeshOutput.cs index f7054576af5..5b47741388d 100644 --- a/com.unity.visualeffectgraph/Editor/Models/Contexts/Implementations/VFXStaticMeshOutput.cs +++ b/com.unity.visualeffectgraph/Editor/Models/Contexts/Implementations/VFXStaticMeshOutput.cs @@ -41,7 +41,7 @@ int IVFXSubRenderer.sortPriority } } - protected VFXStaticMeshOutput() : base(VFXContextType.Output, VFXDataType.Mesh, VFXDataType.None) {} + protected VFXStaticMeshOutput() : base(VFXContextType.Output, VFXDataType.Mesh, VFXDataType.None) { } public override void OnEnable() { diff --git a/com.unity.visualeffectgraph/Editor/Models/Contexts/VFXCameraSort.cs b/com.unity.visualeffectgraph/Editor/Models/Contexts/VFXCameraSort.cs index 848b104f005..17c48580c1d 100644 --- a/com.unity.visualeffectgraph/Editor/Models/Contexts/VFXCameraSort.cs +++ b/com.unity.visualeffectgraph/Editor/Models/Contexts/VFXCameraSort.cs @@ -9,7 +9,7 @@ namespace UnityEditor.VFX { class VFXCameraSort : VFXContext { - public VFXCameraSort() : base(VFXContextType.Filter, VFXDataType.Particle, VFXDataType.Particle) {} + public VFXCameraSort() : base(VFXContextType.Filter, VFXDataType.Particle, VFXDataType.Particle) { } public override string name { get { return "CameraSort"; } } public override string codeGeneratorTemplate { get { return VisualEffectGraphPackageInfo.assetPackagePath + "/Shaders/VFXCameraSort"; } } public override bool codeGeneratorCompute { get { return true; } } diff --git a/com.unity.visualeffectgraph/Editor/Models/Contexts/VFXContext.cs b/com.unity.visualeffectgraph/Editor/Models/Contexts/VFXContext.cs index 714d168d18d..216a4913560 100644 --- a/com.unity.visualeffectgraph/Editor/Models/Contexts/VFXContext.cs +++ b/com.unity.visualeffectgraph/Editor/Models/Contexts/VFXContext.cs @@ -34,11 +34,11 @@ enum VFXContextType [Flags] enum VFXDataType { - None = 0, - SpawnEvent = 1 << 0, - OutputEvent = 1 << 1, - Particle = 1 << 2, - Mesh = 1 << 3, + None = 0, + SpawnEvent = 1 << 0, + OutputEvent = 1 << 1, + Particle = 1 << 2, + Mesh = 1 << 3, ParticleStrip = 1 << 4 | Particle, // strips }; @@ -88,7 +88,7 @@ public VFXContext(VFXContextType contextType, VFXDataType inputType, VFXDataType } public VFXContext(VFXContextType contextType) : this(contextType, VFXDataType.None, VFXDataType.None) - {} + { } // Called by VFXData public static T CreateImplicitContext(VFXData data) where T : VFXContext @@ -124,21 +124,21 @@ public override void OnEnable() base.OnEnable(); } - public bool doesGenerateShader { get { return codeGeneratorTemplate != null; } } - public virtual string codeGeneratorTemplate { get { return null; } } - public virtual bool codeGeneratorCompute { get { return true; } } - public virtual bool doesIncludeCommonCompute { get { return codeGeneratorCompute; } } - public virtual VFXContextType contextType { get { return m_ContextType; } } - public virtual VFXDataType inputType { get { return m_InputType; } } - public virtual VFXDataType outputType { get { return m_OutputType; } } - public virtual VFXDataType ownedType { get { return contextType == VFXContextType.Output ? inputType : outputType; } } - public virtual VFXTaskType taskType { get { return VFXTaskType.None; } } - public virtual IEnumerable attributes { get { return Enumerable.Empty(); } } - public virtual IEnumerable additionalMappings { get { return Enumerable.Empty(); } } - public virtual IEnumerable additionalDataHeaders { get { return GetData().additionalHeaders; } } - public virtual IEnumerable additionalDefines { get { return Enumerable.Empty(); } } + public bool doesGenerateShader { get { return codeGeneratorTemplate != null; } } + public virtual string codeGeneratorTemplate { get { return null; } } + public virtual bool codeGeneratorCompute { get { return true; } } + public virtual bool doesIncludeCommonCompute { get { return codeGeneratorCompute; } } + public virtual VFXContextType contextType { get { return m_ContextType; } } + public virtual VFXDataType inputType { get { return m_InputType; } } + public virtual VFXDataType outputType { get { return m_OutputType; } } + public virtual VFXDataType ownedType { get { return contextType == VFXContextType.Output ? inputType : outputType; } } + public virtual VFXTaskType taskType { get { return VFXTaskType.None; } } + public virtual IEnumerable attributes { get { return Enumerable.Empty(); } } + public virtual IEnumerable additionalMappings { get { return Enumerable.Empty(); } } + public virtual IEnumerable additionalDataHeaders { get { return GetData().additionalHeaders; } } + public virtual IEnumerable additionalDefines { get { return Enumerable.Empty(); } } public virtual IEnumerable> additionalReplacements { get { return Enumerable.Empty>(); } } - public virtual IEnumerable fragmentParameters { get { return Enumerable.Empty(); } } + public virtual IEnumerable fragmentParameters { get { return Enumerable.Empty(); } } public virtual bool CanBeCompiled() { @@ -193,7 +193,7 @@ protected override void OnInvalidate(VFXModel model, InvalidationCause cause) } public virtual bool SetupCompilation() { return true; } - public virtual void EndCompilation() {} + public virtual void EndCompilation() { } public void DetachAllInputFlowSlots(bool notify = true) @@ -255,7 +255,7 @@ public static bool CanLink(VFXContext from, VFXContext to, int fromIndex = 0, in return false; //If link already present, returns false - if (from.m_OutputFlowSlot[fromIndex].link.Any(o => o.context == to && o.slotIndex == toIndex) || + if (from.m_OutputFlowSlot[fromIndex].link.Any(o => o.context == to && o.slotIndex == toIndex) || to.m_InputFlowSlot[toIndex].link.Any(o => o.context == from && o.slotIndex == fromIndex)) return false; @@ -323,7 +323,7 @@ private bool CanLinkFromMany() || contextType == VFXContextType.OutputEvent || contextType == VFXContextType.Spawner || contextType == VFXContextType.Subgraph - || contextType == VFXContextType.Init; + || contextType == VFXContextType.Init; } private static bool IsExclusiveLink(VFXContextType from, VFXContextType to) @@ -386,13 +386,13 @@ private static void InnerUnlink(VFXContext from, VFXContext to, int fromIndex = } } - public VFXContextSlot[] inputFlowSlot { get { return m_InputFlowSlot == null ? new VFXContextSlot[] {} : m_InputFlowSlot; } } - public VFXContextSlot[] outputFlowSlot { get { return m_OutputFlowSlot == null ? new VFXContextSlot[] {} : m_OutputFlowSlot; } } + public VFXContextSlot[] inputFlowSlot { get { return m_InputFlowSlot == null ? new VFXContextSlot[] { } : m_InputFlowSlot; } } + public VFXContextSlot[] outputFlowSlot { get { return m_OutputFlowSlot == null ? new VFXContextSlot[] { } : m_OutputFlowSlot; } } protected virtual int inputFlowCount { get { return 1; } } protected virtual int outputFlowCount { get { return 1; } } - public IEnumerable inputContexts { get { return m_InputFlowSlot.SelectMany(l => l.link.Select(o => o.context)); } } - public IEnumerable outputContexts { get { return m_OutputFlowSlot.SelectMany(l => l.link.Select(o => o.context)); } } + public IEnumerable inputContexts { get { return m_InputFlowSlot.SelectMany(l => l.link.Select(o => o.context)); } } + public IEnumerable outputContexts { get { return m_OutputFlowSlot.SelectMany(l => l.link.Select(o => o.context)); } } public virtual VFXExpressionMapper GetExpressionMapper(VFXDeviceTarget target) { diff --git a/com.unity.visualeffectgraph/Editor/Models/Contexts/VFXOutputUpdate.cs b/com.unity.visualeffectgraph/Editor/Models/Contexts/VFXOutputUpdate.cs index 9dfcf69bac5..b131b20cd0a 100644 --- a/com.unity.visualeffectgraph/Editor/Models/Contexts/VFXOutputUpdate.cs +++ b/com.unity.visualeffectgraph/Editor/Models/Contexts/VFXOutputUpdate.cs @@ -11,16 +11,16 @@ class VFXOutputUpdate : VFXContext public enum Features { None = 0, - MotionVector = 1 << 0, - IndirectDraw = 1 << 1, - Culling = 1 << 2 | IndirectDraw, - MultiMesh = 1 << 3 | Culling, - LOD = 1 << 4 | Culling, - Sort = 1 << 5 | IndirectDraw, - FrustumCulling = 1 << 6 | IndirectDraw, + MotionVector = 1 << 0, + IndirectDraw = 1 << 1, + Culling = 1 << 2 | IndirectDraw, + MultiMesh = 1 << 3 | Culling, + LOD = 1 << 4 | Culling, + Sort = 1 << 5 | IndirectDraw, + FrustumCulling = 1 << 6 | IndirectDraw, } - public VFXOutputUpdate() : base(VFXContextType.Filter, VFXDataType.Particle, VFXDataType.Particle) {} + public VFXOutputUpdate() : base(VFXContextType.Filter, VFXDataType.Particle, VFXDataType.Particle) { } public override string name => "OutputUpdate"; private VFXAbstractParticleOutput m_Output; diff --git a/com.unity.visualeffectgraph/Editor/Models/Contexts/VFXSRPSubOutput.cs b/com.unity.visualeffectgraph/Editor/Models/Contexts/VFXSRPSubOutput.cs index bef614b74c2..36e335e8de0 100644 --- a/com.unity.visualeffectgraph/Editor/Models/Contexts/VFXSRPSubOutput.cs +++ b/com.unity.visualeffectgraph/Editor/Models/Contexts/VFXSRPSubOutput.cs @@ -27,7 +27,7 @@ public void Init(VFXAbstractRenderedOutput owner) public virtual bool supportsExcludeFromTAA { get { return false; } } // Sealed override as SRP suboutputs cannot have dependencies - public sealed override void CollectDependencies(HashSet objs, bool ownedOnly = true) {} + public sealed override void CollectDependencies(HashSet objs, bool ownedOnly = true) { } public virtual string GetBlendModeStr() { diff --git a/com.unity.visualeffectgraph/Editor/Models/Contexts/VFXSubgraphContext.cs b/com.unity.visualeffectgraph/Editor/Models/Contexts/VFXSubgraphContext.cs index b6b3a8b5e48..28149c7e933 100644 --- a/com.unity.visualeffectgraph/Editor/Models/Contexts/VFXSubgraphContext.cs +++ b/com.unity.visualeffectgraph/Editor/Models/Contexts/VFXSubgraphContext.cs @@ -269,7 +269,7 @@ public void RecreateCopy() // Don't notify while doing this else asset is considered dirty after each call at RecreateCopy if (m_InputFlowNames == null || !newInputFlowNames.SequenceEqual(m_InputFlowNames) || inputFlowSlot.Length != inputFlowCount) { - var oldLinks = new Dictionary>(); + var oldLinks = new Dictionary>(); for (int i = 0; i < inputFlowSlot.Count() && i < m_InputFlowNames.Count; ++i) { diff --git a/com.unity.visualeffectgraph/Editor/Models/Operators/Implementations/AppendVector.cs b/com.unity.visualeffectgraph/Editor/Models/Operators/Implementations/AppendVector.cs index c3edb7c93c5..5aecc890f05 100644 --- a/com.unity.visualeffectgraph/Editor/Models/Operators/Implementations/AppendVector.cs +++ b/com.unity.visualeffectgraph/Editor/Models/Operators/Implementations/AppendVector.cs @@ -52,7 +52,7 @@ protected override sealed VFXExpression[] BuildExpression(VFXExpression[] inputE if (allComponent.Length == 0) { - return new VFXExpression[] {}; + return new VFXExpression[] { }; } else if (allComponent.Length == 1) { diff --git a/com.unity.visualeffectgraph/Editor/Models/Operators/Implementations/GetSpawnCount.cs b/com.unity.visualeffectgraph/Editor/Models/Operators/Implementations/GetSpawnCount.cs index 063fbbdd7b1..4a3fc538103 100644 --- a/com.unity.visualeffectgraph/Editor/Models/Operators/Implementations/GetSpawnCount.cs +++ b/com.unity.visualeffectgraph/Editor/Models/Operators/Implementations/GetSpawnCount.cs @@ -6,7 +6,7 @@ [VFXInfo(category = "Spawn", experimental = true)] class GetSpawnCount : VFXOperator { - public override string name { get { return "Get Spawn Count"; } } + public override string name { get { return "Get Spawn Count"; } } public class OutputProperties { @@ -16,6 +16,6 @@ public class OutputProperties protected override VFXExpression[] BuildExpression(VFXExpression[] inputExpression) { - return new VFXExpression[] { new VFXExpressionCastFloatToUint(new VFXAttributeExpression(new VFXAttribute("spawnCount", UnityEngine.VFX.VFXValueType.Float), VFXAttributeLocation.Source)) }; + return new VFXExpression[] { new VFXExpressionCastFloatToUint(new VFXAttributeExpression(new VFXAttribute("spawnCount", UnityEngine.VFX.VFXValueType.Float), VFXAttributeLocation.Source)) }; } } diff --git a/com.unity.visualeffectgraph/Editor/Models/Operators/Implementations/Normalize.cs b/com.unity.visualeffectgraph/Editor/Models/Operators/Implementations/Normalize.cs index 0e2ab31df4f..5a8d8f57c63 100644 --- a/com.unity.visualeffectgraph/Editor/Models/Operators/Implementations/Normalize.cs +++ b/com.unity.visualeffectgraph/Editor/Models/Operators/Implementations/Normalize.cs @@ -31,7 +31,7 @@ public class InputProperties bool safeNormalize = false; - protected override sealed string operatorName { get {return safeNormalize ? "Safe Normalize" : "Normalize"; } } + protected override sealed string operatorName { get { return safeNormalize ? "Safe Normalize" : "Normalize"; } } protected override sealed VFXExpression[] BuildExpression(VFXExpression[] inputExpression) { diff --git a/com.unity.visualeffectgraph/Editor/Models/Operators/Implementations/SampleAttributeMap.cs b/com.unity.visualeffectgraph/Editor/Models/Operators/Implementations/SampleAttributeMap.cs index 1b65078da1d..648144fd289 100644 --- a/com.unity.visualeffectgraph/Editor/Models/Operators/Implementations/SampleAttributeMap.cs +++ b/com.unity.visualeffectgraph/Editor/Models/Operators/Implementations/SampleAttributeMap.cs @@ -82,9 +82,9 @@ protected override sealed VFXExpression[] BuildExpression(VFXExpression[] inputE Type outputType = GetOperandType(); var type = typeof(VFXExpressionSampleAttributeMap<>).MakeGenericType(outputType); - var outputExpr = Activator.CreateInstance(type, new object[] {inputExpression[1], x, y }); + var outputExpr = Activator.CreateInstance(type, new object[] { inputExpression[1], x, y }); - return new[] { (VFXExpression)outputExpr}; + return new[] { (VFXExpression)outputExpr }; } } } diff --git a/com.unity.visualeffectgraph/Editor/Models/Operators/Implementations/SampleBezier.cs b/com.unity.visualeffectgraph/Editor/Models/Operators/Implementations/SampleBezier.cs index d380e22110b..cb3b49be3e6 100644 --- a/com.unity.visualeffectgraph/Editor/Models/Operators/Implementations/SampleBezier.cs +++ b/com.unity.visualeffectgraph/Editor/Models/Operators/Implementations/SampleBezier.cs @@ -51,7 +51,7 @@ protected override sealed VFXExpression[] BuildExpression(VFXExpression[] inputE var D = posD * vt * vt * vt; // Derivative - var dA = three * vtc * vtc * (posB - posA); + var dA = three * vtc * vtc * (posB - posA); var dB = six * vtc * vt * (posC - posB); var dC = three * vt * vt * (posD - posC); diff --git a/com.unity.visualeffectgraph/Editor/Models/Operators/Implementations/SamplePointCache.cs b/com.unity.visualeffectgraph/Editor/Models/Operators/Implementations/SamplePointCache.cs index 29b1bf7ab5a..17f259f4504 100644 --- a/com.unity.visualeffectgraph/Editor/Models/Operators/Implementations/SamplePointCache.cs +++ b/com.unity.visualeffectgraph/Editor/Models/Operators/Implementations/SamplePointCache.cs @@ -76,7 +76,7 @@ protected override sealed VFXExpression[] BuildExpression(VFXExpression[] inputE Type outputType = GetOutputType(asset.surfaces[i]); var type = typeof(VFXExpressionSampleAttributeMap<>).MakeGenericType(outputType); - var outputExpr = Activator.CreateInstance(type, new object[] {surfaceExpr, x, y }); + var outputExpr = Activator.CreateInstance(type, new object[] { surfaceExpr, x, y }); expressions[i + 1] = (VFXExpression)outputExpr; } diff --git a/com.unity.visualeffectgraph/Editor/Models/Operators/Implementations/SampleSDF.cs b/com.unity.visualeffectgraph/Editor/Models/Operators/Implementations/SampleSDF.cs index f2a14ca466e..5de7ddb71b7 100644 --- a/com.unity.visualeffectgraph/Editor/Models/Operators/Implementations/SampleSDF.cs +++ b/com.unity.visualeffectgraph/Editor/Models/Operators/Implementations/SampleSDF.cs @@ -13,7 +13,7 @@ public class InputProperties [Tooltip("Sets the Signed Distance Field texture to sample from.")] public Texture3D texture = null; [Tooltip("Sets the oriented box containing the SDF.")] - public OrientedBox orientedBox = OrientedBox.defaultValue; + public OrientedBox orientedBox = OrientedBox.defaultValue; [Tooltip("Sets the position from which to sample.")] public Position position = Position.defaultValue; [Min(0), Tooltip("Sets the mip level to sample from.")] @@ -33,7 +33,7 @@ protected override sealed VFXExpression[] BuildExpression(VFXExpression[] inputE VFXExpression inverseTRS = new VFXExpressionInverseTRSMatrix(inputExpression[1]); VFXExpression scale = new VFXExpressionExtractScaleFromMatrix(inputExpression[1]); VFXExpression uvw = new VFXExpressionTransformPosition(inverseTRS, inputExpression[2]) + VFXValue.Constant(new Vector3(0.5f, 0.5f, 0.5f)); - VFXExpression distanceExpr = new VFXExpressionSampleSDF(inputExpression[0], uvw, scale, inputExpression[3]); + VFXExpression distanceExpr = new VFXExpressionSampleSDF(inputExpression[0], uvw, scale, inputExpression[3]); VFXExpression directionExpr = new VFXExpressionSampleSDFNormal(inputExpression[0], inverseTRS, uvw, inputExpression[3]) * VFXValue.Constant(new Vector3(-1.0f, -1.0f, -1.0f)); return new[] { distanceExpr, directionExpr }; diff --git a/com.unity.visualeffectgraph/Editor/Models/Operators/Implementations/Swizzle.cs b/com.unity.visualeffectgraph/Editor/Models/Operators/Implementations/Swizzle.cs index 1aa76cbb304..24be7264e62 100644 --- a/com.unity.visualeffectgraph/Editor/Models/Operators/Implementations/Swizzle.cs +++ b/com.unity.visualeffectgraph/Editor/Models/Operators/Implementations/Swizzle.cs @@ -57,7 +57,7 @@ protected override ValidTypeRule typeFilter protected override sealed VFXExpression[] BuildExpression(VFXExpression[] inputExpression) { if (mask.Length == 0) - return new VFXExpression[] {}; + return new VFXExpression[] { }; var inputComponents = (inputExpression.Length > 0) ? VFXOperatorUtility.ExtractComponents(inputExpression[0]).ToArray() : new VFXExpression[0]; diff --git a/com.unity.visualeffectgraph/Editor/Models/Operators/VFXAbstractOperatorNew.cs b/com.unity.visualeffectgraph/Editor/Models/Operators/VFXAbstractOperatorNew.cs index ec35d72ef06..44f4c3e36d5 100644 --- a/com.unity.visualeffectgraph/Editor/Models/Operators/VFXAbstractOperatorNew.cs +++ b/com.unity.visualeffectgraph/Editor/Models/Operators/VFXAbstractOperatorNew.cs @@ -443,7 +443,7 @@ abstract class VFXOperatorNumericUnified : VFXOperatorNumeric, IVFXOperatorNumer } public int operandCount { - get {return m_Type.Length; } + get { return m_Type.Length; } } public Type GetOperandType(int index) { diff --git a/com.unity.visualeffectgraph/Editor/Models/Operators/VFXOperatorUtility.cs b/com.unity.visualeffectgraph/Editor/Models/Operators/VFXOperatorUtility.cs index e280e8965ca..7b5ddcd69af 100644 --- a/com.unity.visualeffectgraph/Editor/Models/Operators/VFXOperatorUtility.cs +++ b/com.unity.visualeffectgraph/Editor/Models/Operators/VFXOperatorUtility.cs @@ -47,9 +47,9 @@ static private VFXExpression BaseToConstant(Base _base, VFXValueType type) { switch (_base) { - case Base.Base2: return TwoExpression[type]; - case Base.Base10: return TenExpression[type]; - case Base.BaseE: return E_NapierConstantExpression[type]; + case Base.Base2: return TwoExpression[type]; + case Base.Base10: return TenExpression[type]; + case Base.BaseE: return E_NapierConstantExpression[type]; default: throw new NotImplementedException(); } @@ -658,10 +658,10 @@ static public VFXExpression GetPerspectiveMatrix(VFXExpression fov, VFXExpressio var deltaZ = zNear - zFar; var zero = ZeroExpression[VFXValueType.Float]; - var m0 = new VFXExpressionCombine(cotangent / aspect, zero, zero, zero); - var m1 = new VFXExpressionCombine(zero, cotangent, zero, zero); - var m2 = new VFXExpressionCombine(zero, zero, MinusOneExpression[VFXValueType.Float] * (zFar + zNear) / deltaZ, OneExpression[VFXValueType.Float]); - var m3 = new VFXExpressionCombine(zero, zero, TwoExpression[VFXValueType.Float] * zNear * zFar / deltaZ, zero); + var m0 = new VFXExpressionCombine(cotangent / aspect, zero, zero, zero); + var m1 = new VFXExpressionCombine(zero, cotangent, zero, zero); + var m2 = new VFXExpressionCombine(zero, zero, MinusOneExpression[VFXValueType.Float] * (zFar + zNear) / deltaZ, OneExpression[VFXValueType.Float]); + var m3 = new VFXExpressionCombine(zero, zero, TwoExpression[VFXValueType.Float] * zNear * zFar / deltaZ, zero); return new VFXExpressionVector4sToMatrix(m0, m1, m2, m3); } diff --git a/com.unity.visualeffectgraph/Editor/Models/Parameters/Deprecated/VFXBuiltInParameter.cs b/com.unity.visualeffectgraph/Editor/Models/Parameters/Deprecated/VFXBuiltInParameter.cs index c9e02406d7a..fdc044b8b86 100644 --- a/com.unity.visualeffectgraph/Editor/Models/Parameters/Deprecated/VFXBuiltInParameter.cs +++ b/com.unity.visualeffectgraph/Editor/Models/Parameters/Deprecated/VFXBuiltInParameter.cs @@ -45,7 +45,7 @@ protected override VFXExpression[] BuildExpression(VFXExpression[] inputExpressi { var expression = VFXBuiltInExpression.Find(m_expressionOp); if (expression == null) - return new VFXExpression[] {}; + return new VFXExpression[] { }; return new VFXExpression[] { expression }; } diff --git a/com.unity.visualeffectgraph/Editor/Models/Parameters/VFXAttributeParameter.cs b/com.unity.visualeffectgraph/Editor/Models/Parameters/VFXAttributeParameter.cs index ea3ec391dc2..dbdcab978f1 100644 --- a/com.unity.visualeffectgraph/Editor/Models/Parameters/VFXAttributeParameter.cs +++ b/com.unity.visualeffectgraph/Editor/Models/Parameters/VFXAttributeParameter.cs @@ -139,7 +139,7 @@ override public string name if (attrib.variadic == VFXVariadic.True) result += "." + mask; } - catch {} // Must not throw in name getter + catch { } // Must not throw in name getter return result; } diff --git a/com.unity.visualeffectgraph/Editor/Models/Parameters/VFXDynamicBuiltInParameter.cs b/com.unity.visualeffectgraph/Editor/Models/Parameters/VFXDynamicBuiltInParameter.cs index 4a7b183d908..9685e18bc87 100644 --- a/com.unity.visualeffectgraph/Editor/Models/Parameters/VFXDynamicBuiltInParameter.cs +++ b/com.unity.visualeffectgraph/Editor/Models/Parameters/VFXDynamicBuiltInParameter.cs @@ -40,30 +40,30 @@ class VFXDynamicBuiltInParameter : VFXOperator [Flags] public enum BuiltInFlag { - None = 0, + None = 0, //VFX Time - VfxDeltaTime = 1 << 0, - VfxUnscaledDeltaTime = 1 << 1, - VfxTotalTime = 1 << 2, - VfxFrameIndex = 1 << 3, - VfxPlayRate = 1 << 4, - VfxManagerFixedTimeStep = 1 << 5, - VfxManagerMaxDeltaTime = 1 << 6, + VfxDeltaTime = 1 << 0, + VfxUnscaledDeltaTime = 1 << 1, + VfxTotalTime = 1 << 2, + VfxFrameIndex = 1 << 3, + VfxPlayRate = 1 << 4, + VfxManagerFixedTimeStep = 1 << 5, + VfxManagerMaxDeltaTime = 1 << 6, //Game Time - GameDeltaTime = 1 << 7, - GameUnscaledDeltaTime = 1 << 8, - GameSmoothDeltaTime = 1 << 9, - GameTotalTime = 1 << 10, - GameUnscaledTotalTime = 1 << 11, + GameDeltaTime = 1 << 7, + GameUnscaledDeltaTime = 1 << 8, + GameSmoothDeltaTime = 1 << 9, + GameTotalTime = 1 << 10, + GameUnscaledTotalTime = 1 << 11, GameTotalTimeSinceSceneLoad = 1 << 12, - GameTimeScale = 1 << 13, + GameTimeScale = 1 << 13, //Other - LocalToWorld = 1 << 14, - WorldToLocal = 1 << 15, - SystemSeed = 1 << 16, + LocalToWorld = 1 << 14, + WorldToLocal = 1 << 15, + SystemSeed = 1 << 16, } public static readonly BuiltInFlag s_allVFXTime = BuiltInFlag.VfxDeltaTime | BuiltInFlag.VfxUnscaledDeltaTime | BuiltInFlag.VfxTotalTime | BuiltInFlag.VfxFrameIndex | BuiltInFlag.VfxPlayRate | BuiltInFlag.VfxManagerFixedTimeStep | BuiltInFlag.VfxManagerMaxDeltaTime; diff --git a/com.unity.visualeffectgraph/Editor/Models/Slots/Implementations/VFXSlotFlipBook.cs b/com.unity.visualeffectgraph/Editor/Models/Slots/Implementations/VFXSlotFlipBook.cs index 7c4bf2b9d14..7b38967386a 100644 --- a/com.unity.visualeffectgraph/Editor/Models/Slots/Implementations/VFXSlotFlipBook.cs +++ b/com.unity.visualeffectgraph/Editor/Models/Slots/Implementations/VFXSlotFlipBook.cs @@ -3,5 +3,5 @@ namespace UnityEditor.VFX { [VFXInfo(type = typeof(FlipBook))] - class VFXSlotFlipBook : VFXSlot {} + class VFXSlotFlipBook : VFXSlot { } } diff --git a/com.unity.visualeffectgraph/Editor/Models/Slots/Implementations/VFXSlotFloat.cs b/com.unity.visualeffectgraph/Editor/Models/Slots/Implementations/VFXSlotFloat.cs index f3540f7e93c..88fd669d585 100644 --- a/com.unity.visualeffectgraph/Editor/Models/Slots/Implementations/VFXSlotFloat.cs +++ b/com.unity.visualeffectgraph/Editor/Models/Slots/Implementations/VFXSlotFloat.cs @@ -10,12 +10,12 @@ class VFXSlotFloat : VFXSlot sealed protected override bool CanConvertFrom(Type type) { return base.CanConvertFrom(type) - || type == typeof(uint) - || type == typeof(int) - || type == typeof(Vector2) - || type == typeof(Vector3) - || type == typeof(Vector4) - || type == typeof(Color); + || type == typeof(uint) + || type == typeof(int) + || type == typeof(Vector2) + || type == typeof(Vector3) + || type == typeof(Vector4) + || type == typeof(Color); } sealed protected override VFXExpression ConvertExpression(VFXExpression expression, VFXSlot sourceSlot) @@ -30,8 +30,8 @@ sealed protected override VFXExpression ConvertExpression(VFXExpression expressi return new VFXExpressionCastUintToFloat(expression); if (expression.valueType == VFXValueType.Float2 - || expression.valueType == VFXValueType.Float3 - || expression.valueType == VFXValueType.Float4) + || expression.valueType == VFXValueType.Float3 + || expression.valueType == VFXValueType.Float4) { return expression.x; } diff --git a/com.unity.visualeffectgraph/Editor/Models/Slots/Implementations/VFXSlotFloat2.cs b/com.unity.visualeffectgraph/Editor/Models/Slots/Implementations/VFXSlotFloat2.cs index 70b00d9a4ce..5a7dfd9fa1b 100644 --- a/com.unity.visualeffectgraph/Editor/Models/Slots/Implementations/VFXSlotFloat2.cs +++ b/com.unity.visualeffectgraph/Editor/Models/Slots/Implementations/VFXSlotFloat2.cs @@ -10,12 +10,12 @@ class VFXSlotFloat2 : VFXSlot sealed protected override bool CanConvertFrom(Type type) { return base.CanConvertFrom(type) - || type == typeof(float) - || type == typeof(uint) - || type == typeof(int) - || type == typeof(Vector3) - || type == typeof(Vector4) - || type == typeof(Color); + || type == typeof(float) + || type == typeof(uint) + || type == typeof(int) + || type == typeof(Vector3) + || type == typeof(Vector4) + || type == typeof(Color); } sealed public override VFXValue DefaultExpression(VFXValue.Mode mode) diff --git a/com.unity.visualeffectgraph/Editor/Models/Slots/Implementations/VFXSlotInt.cs b/com.unity.visualeffectgraph/Editor/Models/Slots/Implementations/VFXSlotInt.cs index 47ab60df5aa..d939de18178 100644 --- a/com.unity.visualeffectgraph/Editor/Models/Slots/Implementations/VFXSlotInt.cs +++ b/com.unity.visualeffectgraph/Editor/Models/Slots/Implementations/VFXSlotInt.cs @@ -36,8 +36,8 @@ sealed protected override VFXExpression ConvertExpression(VFXExpression expressi } if (expression.valueType == VFXValueType.Float2 - || expression.valueType == VFXValueType.Float3 - || expression.valueType == VFXValueType.Float4) + || expression.valueType == VFXValueType.Float3 + || expression.valueType == VFXValueType.Float4) { return new VFXExpressionCastFloatToInt(expression.x); } diff --git a/com.unity.visualeffectgraph/Editor/Models/Slots/Implementations/VFXSlotOrientedBox.cs b/com.unity.visualeffectgraph/Editor/Models/Slots/Implementations/VFXSlotOrientedBox.cs index c37e92062cb..e9c27ed5d81 100644 --- a/com.unity.visualeffectgraph/Editor/Models/Slots/Implementations/VFXSlotOrientedBox.cs +++ b/com.unity.visualeffectgraph/Editor/Models/Slots/Implementations/VFXSlotOrientedBox.cs @@ -8,5 +8,5 @@ namespace UnityEditor.VFX { [VFXInfo(type = typeof(OrientedBox))] class VFXSlotOrientedBox : VFXSlotTransform - {} + { } } diff --git a/com.unity.visualeffectgraph/Editor/Models/Slots/Implementations/VFXSlotUint.cs b/com.unity.visualeffectgraph/Editor/Models/Slots/Implementations/VFXSlotUint.cs index 299283a6e71..5b89830e0f6 100644 --- a/com.unity.visualeffectgraph/Editor/Models/Slots/Implementations/VFXSlotUint.cs +++ b/com.unity.visualeffectgraph/Editor/Models/Slots/Implementations/VFXSlotUint.cs @@ -36,8 +36,8 @@ sealed protected override VFXExpression ConvertExpression(VFXExpression expressi } if (expression.valueType == VFXValueType.Float2 - || expression.valueType == VFXValueType.Float3 - || expression.valueType == VFXValueType.Float4) + || expression.valueType == VFXValueType.Float3 + || expression.valueType == VFXValueType.Float4) { return new VFXExpressionCastFloatToUint(expression.x); } diff --git a/com.unity.visualeffectgraph/Editor/Models/Slots/VFXSlot.cs b/com.unity.visualeffectgraph/Editor/Models/Slots/VFXSlot.cs index 248e968ec55..e0601b8c30a 100644 --- a/com.unity.visualeffectgraph/Editor/Models/Slots/VFXSlot.cs +++ b/com.unity.visualeffectgraph/Editor/Models/Slots/VFXSlot.cs @@ -17,9 +17,9 @@ public enum Direction kOutput, } - public Direction direction { get { return m_Direction; } } - public VFXProperty property { get { return m_Property; } } - public override string name { get { return m_Property.name; } } + public Direction direction { get { return m_Direction; } } + public VFXProperty property { get { return m_Property; } } + public override string name { get { return m_Property.name; } } private FieldInfo m_FieldInfoCache; @@ -308,9 +308,9 @@ public VFXSlot refSlot public IVFXSlotContainer owner { get { return GetMasterData().m_Owner as IVFXSlotContainer; } } - public bool IsMasterSlot() { return m_MasterSlot == this; } - public VFXSlot GetMasterSlot() { return m_MasterSlot; } - private MasterData GetMasterData() { return GetMasterSlot().m_MasterData; } + public bool IsMasterSlot() { return m_MasterSlot == this; } + public VFXSlot GetMasterSlot() { return m_MasterSlot; } + private MasterData GetMasterData() { return GetMasterSlot().m_MasterData; } // Never call this directly ! Called only by VFXSlotContainerModel public void SetOwner(VFXModel owner) @@ -935,7 +935,8 @@ private void RecomputeExpressionTree() { var inExpressionPatched = ApplySpaceConversion(startSlot.m_LinkedInExpression, startSlot, startSlot.m_LinkedInSlot); startSlot.m_InExpression = startSlot.ConvertExpression(inExpressionPatched, startSlot.m_LinkedInSlot); // TODO Handle structural modification - startSlot.PropagateToChildren(s => { + startSlot.PropagateToChildren(s => + { var exp = s.ExpressionToChildren(s.m_InExpression); for (int i = 0; i < s.GetNbChildren(); ++i) s[i].m_InExpression = exp != null ? exp[i] : s.refSlot[i].GetExpression(); // Not sure about that @@ -964,7 +965,7 @@ private static VFXExpression ApplySpaceConversion(VFXExpression exp, VFXSlot des { if (sourceSlot != null && destSlot.spaceable && sourceSlot.spaceable - && destSlot.space != sourceSlot.space) + && destSlot.space != sourceSlot.space) { var destSpaceableType = destSlot.GetSpaceTransformationType(); var sourceSpaceableType = sourceSlot.GetSpaceTransformationType(); @@ -1021,7 +1022,8 @@ public void InvalidateExpressionTree() { var masterSlot = GetMasterSlot(); - masterSlot.PropagateToChildren(s => { + masterSlot.PropagateToChildren(s => + { if (s.m_ExpressionTreeUpToDate) { s.m_ExpressionTreeUpToDate = false; @@ -1119,7 +1121,7 @@ protected virtual VFXExpression ConvertExpression(VFXExpression expression, VFXS return expression; } - protected virtual VFXExpression[] ExpressionToChildren(VFXExpression exp) { return null; } + protected virtual VFXExpression[] ExpressionToChildren(VFXExpression exp) { return null; } protected virtual VFXExpression ExpressionFromChildren(VFXExpression[] exp) { return null; } public virtual VFXValue DefaultExpression(VFXValue.Mode mode) diff --git a/com.unity.visualeffectgraph/Editor/Models/VFXGraph.cs b/com.unity.visualeffectgraph/Editor/Models/VFXGraph.cs index 0d32f650d82..6f165cfbc6c 100644 --- a/com.unity.visualeffectgraph/Editor/Models/VFXGraph.cs +++ b/com.unity.visualeffectgraph/Editor/Models/VFXGraph.cs @@ -373,7 +373,7 @@ public void SanitizeGraph() } catch (Exception e) { - Debug.LogError(string.Format("Exception while sanitizing VFXUI: : {0} {1}", e , e.StackTrace)); + Debug.LogError(string.Format("Exception while sanitizing VFXUI: : {0} {1}", e, e.StackTrace)); } systemNames.Sync(this); diff --git a/com.unity.visualeffectgraph/Editor/Models/VFXModel.cs b/com.unity.visualeffectgraph/Editor/Models/VFXModel.cs index 96bf2765285..614a824f276 100644 --- a/com.unity.visualeffectgraph/Editor/Models/VFXModel.cs +++ b/com.unity.visualeffectgraph/Editor/Models/VFXModel.cs @@ -54,8 +54,8 @@ public enum InvalidationCause kEnableChanged, // Node has been enabled/disabled } - public new virtual string name { get { return string.Empty; } } - public virtual string libraryName { get { return name; } } + public new virtual string name { get { return string.Empty; } } + public virtual string libraryName { get { return name; } } public delegate void InvalidateEvent(VFXModel model, InvalidationCause cause); @@ -78,9 +78,9 @@ public virtual void OnEnable() } } - public virtual void Sanitize(int version) {} + public virtual void Sanitize(int version) { } - public virtual void CheckGraphBeforeImport() {} + public virtual void CheckGraphBeforeImport() { } public virtual void OnUnknownChange() { @@ -145,8 +145,8 @@ public void RefreshErrors(VFXGraph graph) } } - protected virtual void OnAdded() {} - protected virtual void OnRemoved() {} + protected virtual void OnAdded() { } + protected virtual void OnRemoved() { } public virtual bool AcceptChild(VFXModel model, int index = -1) { @@ -339,7 +339,7 @@ private bool SetSettingValueAndReturnIfChanged(string name, object value) // Override this method to update other settings based on a setting modification // Use OnIvalidate with KSettingChanged and not this method to handle other side effects - public virtual void OnSettingModified(VFXSetting setting) {} + public virtual void OnSettingModified(VFXSetting setting) { } public virtual IEnumerable GetFilteredOutEnumerators(string name) { return null; } public virtual VFXSetting GetSetting(string name) diff --git a/com.unity.visualeffectgraph/Editor/Models/VFXSlotContainerModel.cs b/com.unity.visualeffectgraph/Editor/Models/VFXSlotContainerModel.cs index a241e9e572d..51999229685 100644 --- a/com.unity.visualeffectgraph/Editor/Models/VFXSlotContainerModel.cs +++ b/com.unity.visualeffectgraph/Editor/Models/VFXSlotContainerModel.cs @@ -11,8 +11,8 @@ namespace UnityEditor.VFX { interface IVFXSlotContainer { - ReadOnlyCollection inputSlots { get; } - ReadOnlyCollection outputSlots { get; } + ReadOnlyCollection inputSlots { get; } + ReadOnlyCollection outputSlots { get; } int GetNbInputSlots(); int GetNbOutputSlots(); @@ -48,13 +48,13 @@ abstract class VFXSlotContainerModel : VFXModel inputSlots { get { return m_InputSlots.AsReadOnly(); } } + public virtual ReadOnlyCollection inputSlots { get { return m_InputSlots.AsReadOnly(); } } public virtual ReadOnlyCollection outputSlots { get { return m_OutputSlots.AsReadOnly(); } } - public virtual int GetNbInputSlots() { return m_InputSlots.Count; } - public virtual int GetNbOutputSlots() { return m_OutputSlots.Count; } + public virtual int GetNbInputSlots() { return m_InputSlots.Count; } + public virtual int GetNbOutputSlots() { return m_OutputSlots.Count; } - public virtual VFXSlot GetInputSlot(int index) { return m_InputSlots[index]; } + public virtual VFXSlot GetInputSlot(int index) { return m_InputSlots[index]; } public virtual VFXSlot GetOutputSlot(int index) { return m_OutputSlots[index]; } protected virtual IEnumerable inputProperties { get { return PropertiesFromType(GetInputPropertiesTypeName()); } } @@ -76,7 +76,8 @@ protected static IEnumerable PropertiesFromType(Type type) var instance = System.Activator.CreateInstance(type); return type.GetFields() .Where(f => !f.IsStatic) - .Select(f => { + .Select(f => + { var p = new VFXPropertyWithValue(); p.property = new VFXProperty(f); p.value = f.GetValue(instance); @@ -175,7 +176,7 @@ public int GetSlotIndex(VFXSlot slot) } protected VFXSlotContainerModel() - {} + { } public override void OnEnable() { @@ -423,7 +424,7 @@ public bool IsPathExpanded(string fieldPath) return m_expandedPaths.Contains(fieldPath); } - public virtual void UpdateOutputExpressions() {} + public virtual void UpdateOutputExpressions() { } public virtual VFXCoordinateSpace GetOutputSpaceFromSlot(VFXSlot slot) { diff --git a/com.unity.visualeffectgraph/Editor/ShaderGraph/VFXShaderGraphParticleOutput.cs b/com.unity.visualeffectgraph/Editor/ShaderGraph/VFXShaderGraphParticleOutput.cs index 26835442a58..f9212a6f23b 100644 --- a/com.unity.visualeffectgraph/Editor/ShaderGraph/VFXShaderGraphParticleOutput.cs +++ b/com.unity.visualeffectgraph/Editor/ShaderGraph/VFXShaderGraphParticleOutput.cs @@ -47,7 +47,7 @@ public override void GetImportDependentAssets(HashSet dependencies) dependencies.Add(shaderGraph.GetInstanceID()); } - protected VFXShaderGraphParticleOutput(bool strip = false) : base(strip) {} + protected VFXShaderGraphParticleOutput(bool strip = false) : base(strip) { } static Type GetSGPropertyType(AbstractShaderProperty property) { switch (property.propertyType) diff --git a/com.unity.visualeffectgraph/Editor/Types/VFXBoxGizmos.cs b/com.unity.visualeffectgraph/Editor/Types/VFXBoxGizmos.cs index 7880f0a5bff..1d560b2175c 100644 --- a/com.unity.visualeffectgraph/Editor/Types/VFXBoxGizmos.cs +++ b/com.unity.visualeffectgraph/Editor/Types/VFXBoxGizmos.cs @@ -30,7 +30,7 @@ public override void OnDrawSpacedGizmo(OrientedBox box) Matrix4x4 rotate = Matrix4x4.Rotate(Quaternion.Euler(box.angles)); Matrix4x4 fullTranform = Matrix4x4.Translate(box.center) * rotate * Matrix4x4.Translate(-box.center); - VFXAABoxGizmo.DrawBoxSizeDataAnchorGizmo(new AABox() {center = box.center, size = box.size}, component, this, m_CenterProperty, m_SizeXProperty, m_SizeYProperty, m_SizeZProperty, fullTranform); + VFXAABoxGizmo.DrawBoxSizeDataAnchorGizmo(new AABox() { center = box.center, size = box.size }, component, this, m_CenterProperty, m_SizeXProperty, m_SizeYProperty, m_SizeZProperty, fullTranform); RotationGizmo(box.center, box.angles, m_AnglesProperty, true); } diff --git a/com.unity.visualeffectgraph/Editor/Types/VFXConeGizmos.cs b/com.unity.visualeffectgraph/Editor/Types/VFXConeGizmos.cs index 47120819a31..94a1f931cc2 100644 --- a/com.unity.visualeffectgraph/Editor/Types/VFXConeGizmos.cs +++ b/com.unity.visualeffectgraph/Editor/Types/VFXConeGizmos.cs @@ -27,7 +27,7 @@ public override void RegisterEditableMembers(IContext context) float topRadiusScreen; float baseRadiusScreen; - bool m_Dragging; + bool m_Dragging; public struct Extremities diff --git a/com.unity.visualeffectgraph/Editor/Types/VFXProperty.cs b/com.unity.visualeffectgraph/Editor/Types/VFXProperty.cs index 6d6b6e62b80..5a09f53e307 100644 --- a/com.unity.visualeffectgraph/Editor/Types/VFXProperty.cs +++ b/com.unity.visualeffectgraph/Editor/Types/VFXProperty.cs @@ -48,8 +48,8 @@ public VFXProperty(Type type, string name, VFXPropertyAttributes attributes) this.attributes = attributes; } - public VFXProperty(Type type, string name, params object[] attributes) : this(type, name, new VFXPropertyAttributes(attributes)) {} - public VFXProperty(FieldInfo info) : this(info.FieldType, info.Name, new VFXPropertyAttributes(info.GetCustomAttributes(true))) {} + public VFXProperty(Type type, string name, params object[] attributes) : this(type, name, new VFXPropertyAttributes(attributes)) { } + public VFXProperty(FieldInfo info) : this(info.FieldType, info.Name, new VFXPropertyAttributes(info.GetCustomAttributes(true))) { } public override int GetHashCode() { diff --git a/com.unity.visualeffectgraph/Editor/Types/VFXTypes.cs b/com.unity.visualeffectgraph/Editor/Types/VFXTypes.cs index f16f93b20c2..e2f4f63a412 100644 --- a/com.unity.visualeffectgraph/Editor/Types/VFXTypes.cs +++ b/com.unity.visualeffectgraph/Editor/Types/VFXTypes.cs @@ -9,7 +9,7 @@ namespace UnityEditor.VFX { [AttributeUsage(AttributeTargets.Struct)] class VFXTypeAttribute : Attribute - {} + { } enum SpaceableType { @@ -31,7 +31,7 @@ public VFXSpaceAttribute(SpaceableType type) } class ShowAsColorAttribute : Attribute - {} + { } class CoordinateSpaceInfo { @@ -160,7 +160,7 @@ struct ArcCone [Angle, Range(0, Mathf.PI * 2.0f), Tooltip("Controls how much of the cone is used. The value is in radians.")] public float arc; - public static ArcCone defaultValue = new ArcCone { radius0 = 1.0f, radius1 = 0.1f, height = 1.0f, arc = 2.0f * Mathf.PI}; + public static ArcCone defaultValue = new ArcCone { radius0 = 1.0f, radius1 = 0.1f, height = 1.0f, arc = 2.0f * Mathf.PI }; } [VFXType, Serializable] @@ -188,7 +188,7 @@ struct ArcTorus [Angle, Range(0, Mathf.PI * 2.0f), Tooltip("Controls how much of the torus is used.")] public float arc; - public static ArcTorus defaultValue = new ArcTorus { majorRadius = 1.0f, minorRadius = 0.1f, arc = 2.0f * Mathf.PI}; + public static ArcTorus defaultValue = new ArcTorus { majorRadius = 1.0f, minorRadius = 0.1f, arc = 2.0f * Mathf.PI }; } [VFXType, Serializable] diff --git a/com.unity.visualeffectgraph/Editor/Utilities/DotGraph/DotAttribute.cs b/com.unity.visualeffectgraph/Editor/Utilities/DotGraph/DotAttribute.cs index 9fc6b54408c..16b2e772120 100644 --- a/com.unity.visualeffectgraph/Editor/Utilities/DotGraph/DotAttribute.cs +++ b/com.unity.visualeffectgraph/Editor/Utilities/DotGraph/DotAttribute.cs @@ -2,42 +2,42 @@ namespace UnityEditor.Dot { static class DotAttribute { - public static readonly string Label = "label"; - public static readonly string HeadLabel = "headlabel"; - public static readonly string TailLabel = "taillabel"; - public static readonly string Shape = "shape"; - public static readonly string Color = "color"; - public static readonly string Style = "style"; + public static readonly string Label = "label"; + public static readonly string HeadLabel = "headlabel"; + public static readonly string TailLabel = "taillabel"; + public static readonly string Shape = "shape"; + public static readonly string Color = "color"; + public static readonly string Style = "style"; } static class DotShape { - public static readonly string None = "plaintext"; - public static readonly string Box = "box"; - public static readonly string Ellipse = "ellipse"; - public static readonly string Square = "square"; + public static readonly string None = "plaintext"; + public static readonly string Box = "box"; + public static readonly string Ellipse = "ellipse"; + public static readonly string Square = "square"; } static class DotColor { - public static readonly string Black = "black"; - public static readonly string White = "white"; - public static readonly string Red = "red"; - public static readonly string Green = "green"; - public static readonly string Blue = "blue"; - public static readonly string Cyan = "cyan"; - public static readonly string Yellow = "yellow"; - public static readonly string Orange = "orange"; - public static readonly string SlateGray = "lightslategray"; - public static readonly string Gray = "gray"; - public static readonly string LightGray = "lightgray"; - public static readonly string SteelBlue = "steelblue"; + public static readonly string Black = "black"; + public static readonly string White = "white"; + public static readonly string Red = "red"; + public static readonly string Green = "green"; + public static readonly string Blue = "blue"; + public static readonly string Cyan = "cyan"; + public static readonly string Yellow = "yellow"; + public static readonly string Orange = "orange"; + public static readonly string SlateGray = "lightslategray"; + public static readonly string Gray = "gray"; + public static readonly string LightGray = "lightgray"; + public static readonly string SteelBlue = "steelblue"; } static class DotStyle { - public static readonly string Filled = "filled"; - public static readonly string Solid = "solid"; - public static readonly string Dotted = "dotted"; + public static readonly string Filled = "filled"; + public static readonly string Solid = "solid"; + public static readonly string Dotted = "dotted"; } } diff --git a/com.unity.visualeffectgraph/Editor/Utilities/DotGraph/DotElement.cs b/com.unity.visualeffectgraph/Editor/Utilities/DotGraph/DotElement.cs index 6e29cbd1674..5b3600e1be4 100644 --- a/com.unity.visualeffectgraph/Editor/Utilities/DotGraph/DotElement.cs +++ b/com.unity.visualeffectgraph/Editor/Utilities/DotGraph/DotElement.cs @@ -30,7 +30,7 @@ public bool HasAttributes() class DotNode : DotElement { - public DotNode() {} + public DotNode() { } public DotNode(string name) { Label = name; @@ -50,7 +50,7 @@ public DotEdge(DotNode from, DotNode to) public override string Name { get { return "edge"; } } public DotNode From { get { return m_From; } } - public DotNode To { get { return m_To; } } + public DotNode To { get { return m_To; } } private DotNode m_From; private DotNode m_To; diff --git a/com.unity.visualeffectgraph/Editor/Utilities/PropertyBinding/VFXBinderEditor.cs b/com.unity.visualeffectgraph/Editor/Utilities/PropertyBinding/VFXBinderEditor.cs index 312a7b52e59..a00a15c46d0 100644 --- a/com.unity.visualeffectgraph/Editor/Utilities/PropertyBinding/VFXBinderEditor.cs +++ b/com.unity.visualeffectgraph/Editor/Utilities/PropertyBinding/VFXBinderEditor.cs @@ -1,4 +1,4 @@ namespace UnityEditor.Experimental.VFX.Utility { - class VFXBinderEditor : Editor {} + class VFXBinderEditor : Editor { } } diff --git a/com.unity.visualeffectgraph/Editor/Utilities/PropertyBinding/VFXPropertyBinderEditor.cs b/com.unity.visualeffectgraph/Editor/Utilities/PropertyBinding/VFXPropertyBinderEditor.cs index 14bd91d0ae7..4e1aa1e312a 100644 --- a/com.unity.visualeffectgraph/Editor/Utilities/PropertyBinding/VFXPropertyBinderEditor.cs +++ b/com.unity.visualeffectgraph/Editor/Utilities/PropertyBinding/VFXPropertyBinderEditor.cs @@ -40,7 +40,7 @@ static class Styles public static GUIStyle labelStyle; static Styles() { - labelStyle = new GUIStyle(EditorStyles.label) { padding = new RectOffset(20, 0, 2, 0), richText = true}; + labelStyle = new GUIStyle(EditorStyles.label) { padding = new RectOffset(20, 0, 2, 0), richText = true }; } } diff --git a/com.unity.visualeffectgraph/Editor/Utilities/VectorFieldImporter/Editor/VectorFieldImporter.cs b/com.unity.visualeffectgraph/Editor/Utilities/VectorFieldImporter/Editor/VectorFieldImporter.cs index 632469d23c5..dc98001538c 100644 --- a/com.unity.visualeffectgraph/Editor/Utilities/VectorFieldImporter/Editor/VectorFieldImporter.cs +++ b/com.unity.visualeffectgraph/Editor/Utilities/VectorFieldImporter/Editor/VectorFieldImporter.cs @@ -66,9 +66,9 @@ public override void OnImportAsset(AssetImportContext ctx) if (bytes.Length < 10) throw new Exception("Malformed VF File, invalid header (less than 10 bytes)"); - width = BitConverter.ToUInt16(bytes, 4); - height = BitConverter.ToUInt16(bytes, 6); - depth = BitConverter.ToUInt16(bytes, 8); + width = BitConverter.ToUInt16(bytes, 4); + height = BitConverter.ToUInt16(bytes, 6); + depth = BitConverter.ToUInt16(bytes, 8); int requiredLength = 10 + (4 * channels * (width * height * depth)); diff --git a/com.unity.visualeffectgraph/Editor/Utilities/pCache/BakeTool/PointCacheBakeTool.Mesh.cs b/com.unity.visualeffectgraph/Editor/Utilities/pCache/BakeTool/PointCacheBakeTool.Mesh.cs index fc3e53ac32c..dabd4ceb01b 100644 --- a/com.unity.visualeffectgraph/Editor/Utilities/pCache/BakeTool/PointCacheBakeTool.Mesh.cs +++ b/com.unity.visualeffectgraph/Editor/Utilities/pCache/BakeTool/PointCacheBakeTool.Mesh.cs @@ -103,7 +103,7 @@ public struct Vertex public Vector4 tangent; public Vector4[] uvs; - public static Vertex operator+(Vertex a, Vertex b) + public static Vertex operator +(Vertex a, Vertex b) { if (a.uvs.Length != b.uvs.Length) throw new InvalidOperationException("Adding compatible vertex"); @@ -123,7 +123,7 @@ public struct Vertex return r; } - public static Vertex operator*(float a, Vertex b) + public static Vertex operator *(float a, Vertex b) { var r = new Vertex() { @@ -214,7 +214,7 @@ protected Picker(MeshData data) } //See http://inis.jinr.ru/sl/vol1/CMC/Graphics_Gems_1,ed_A.Glassner.pdf (p24) uniform distribution from two numbers in triangle generating barycentric coordinate - protected readonly static Vector2 center_of_sampling = new Vector2(4.0f / 9.0f, 3.0f / 4.0f); + protected readonly static Vector2 center_of_sampling = new Vector2(4.0f / 9.0f, 3.0f / 4.0f); protected MeshData.Vertex Interpolate(MeshData.Triangle triangle, Vector2 p) { return Interpolate(m_cacheData.vertices[triangle.a], m_cacheData.vertices[triangle.b], m_cacheData.vertices[triangle.c], p); diff --git a/com.unity.visualeffectgraph/Editor/Utilities/pCache/PCache.cs b/com.unity.visualeffectgraph/Editor/Utilities/pCache/PCache.cs index e11ea6ddd5c..2ac824c4b18 100644 --- a/com.unity.visualeffectgraph/Editor/Utilities/pCache/PCache.cs +++ b/com.unity.visualeffectgraph/Editor/Utilities/pCache/PCache.cs @@ -452,14 +452,14 @@ public static PCache FromFile(string filename) var prop = data.properties[j]; switch (prop.Type) { - case "short": data.buckets[j].Add(binaryReader.ReadInt16()); break; - case "ushort": data.buckets[j].Add(binaryReader.ReadUInt16()); break; - case "int": data.buckets[j].Add(binaryReader.ReadInt32()); break; - case "uint": data.buckets[j].Add(binaryReader.ReadUInt32()); break; - case "char": data.buckets[j].Add(binaryReader.ReadSByte()); break; - case "uchar": data.buckets[j].Add(binaryReader.ReadByte()); break; - case "float": data.buckets[j].Add(binaryReader.ReadSingle()); break; - case "double": data.buckets[j].Add(binaryReader.ReadDouble()); break; + case "short": data.buckets[j].Add(binaryReader.ReadInt16()); break; + case "ushort": data.buckets[j].Add(binaryReader.ReadUInt16()); break; + case "int": data.buckets[j].Add(binaryReader.ReadInt32()); break; + case "uint": data.buckets[j].Add(binaryReader.ReadUInt32()); break; + case "char": data.buckets[j].Add(binaryReader.ReadSByte()); break; + case "uchar": data.buckets[j].Add(binaryReader.ReadByte()); break; + case "float": data.buckets[j].Add(binaryReader.ReadSingle()); break; + case "double": data.buckets[j].Add(binaryReader.ReadDouble()); break; } } } diff --git a/com.unity.visualeffectgraph/Editor/Utils/VFXContextBorder.cs b/com.unity.visualeffectgraph/Editor/Utils/VFXContextBorder.cs index cf99bd05f7b..c63e0f319da 100644 --- a/com.unity.visualeffectgraph/Editor/Utils/VFXContextBorder.cs +++ b/com.unity.visualeffectgraph/Editor/Utils/VFXContextBorder.cs @@ -9,7 +9,7 @@ namespace UnityEditor.VFX.UI { class VFXContextBorderFactory : UxmlFactory - {} + { } class VFXContextBorder : ImmediateModeElement, IDisposable { @@ -108,7 +108,7 @@ protected override void ImmediateRepaint() Vector4 size = new Vector4(layout.width * .5f, layout.height * 0.5f, 0, 0); m_Mat.SetVector("_Size", size); - m_Mat.SetFloat("_Border", realBorder < 1.75f ? 1.75f / view.scale : style.borderLeftWidth.value); + m_Mat.SetFloat("_Border", realBorder < 1.75f ? 1.75f / view.scale : style.borderLeftWidth.value); m_Mat.SetFloat("_Radius", radius); m_Mat.SetColor("_ColorStart", (QualitySettings.activeColorSpace == ColorSpace.Linear) ? startColor.gamma : startColor); diff --git a/com.unity.visualeffectgraph/Editor/Utils/VFXSystemBorder.cs b/com.unity.visualeffectgraph/Editor/Utils/VFXSystemBorder.cs index ce8e75aab70..a74d0f97ebe 100644 --- a/com.unity.visualeffectgraph/Editor/Utils/VFXSystemBorder.cs +++ b/com.unity.visualeffectgraph/Editor/Utils/VFXSystemBorder.cs @@ -11,7 +11,7 @@ namespace UnityEditor.VFX.UI { class VFXSystemBorderFactory : UxmlFactory - {} + { } class VFXSystemBorder : GraphElement, IControlledElement, IDisposable @@ -236,7 +236,7 @@ public void RecomputeBounds() if (!m_WaitingRecompute) { m_WaitingRecompute = true; - schedule.Execute(() => { m_WaitingRecompute = false; RecomputeBounds(); }).ExecuteLater(0); // title height might have changed if width have changed + schedule.Execute(() => { m_WaitingRecompute = false; RecomputeBounds(); }).ExecuteLater(0); // title height might have changed if width have changed } } else diff --git a/com.unity.visualeffectgraph/Editor/VisualElementExtensions.cs b/com.unity.visualeffectgraph/Editor/VisualElementExtensions.cs index 42268a119e9..dc2f67fe133 100644 --- a/com.unity.visualeffectgraph/Editor/VisualElementExtensions.cs +++ b/com.unity.visualeffectgraph/Editor/VisualElementExtensions.cs @@ -17,7 +17,7 @@ public static void InternalValidateLayout(this IPanel panel) if (m_ValidateLayoutMethod == null) m_ValidateLayoutMethod = panel.GetType().GetMethod("ValidateLayout", BindingFlags.Instance | BindingFlags.FlattenHierarchy | BindingFlags.NonPublic | BindingFlags.Public); - m_ValidateLayoutMethod.Invoke(panel, new object[] {}); + m_ValidateLayoutMethod.Invoke(panel, new object[] { }); } static PropertyInfo m_OwnerPropertyInfo; @@ -28,7 +28,7 @@ public static GUIView InternalGetGUIView(this IPanel panel) m_OwnerPropertyInfo = panel.GetType().GetProperty("ownerObject", BindingFlags.Instance | BindingFlags.FlattenHierarchy | BindingFlags.NonPublic | BindingFlags.Public); - return (GUIView)m_OwnerPropertyInfo.GetValue(panel, new object[] {}); + return (GUIView)m_OwnerPropertyInfo.GetValue(panel, new object[] { }); } public static bool HasFocus(this VisualElement visualElement) diff --git a/com.unity.visualeffectgraph/Runtime/Utilities/EventBinding/Implementation/VFXMouseEventBinder.cs b/com.unity.visualeffectgraph/Runtime/Utilities/EventBinding/Implementation/VFXMouseEventBinder.cs index 5f316823b2e..fc0412efe29 100644 --- a/com.unity.visualeffectgraph/Runtime/Utilities/EventBinding/Implementation/VFXMouseEventBinder.cs +++ b/com.unity.visualeffectgraph/Runtime/Utilities/EventBinding/Implementation/VFXMouseEventBinder.cs @@ -1,6 +1,6 @@ #if VFX_HAS_PHYSICS #if ENABLE_INPUT_SYSTEM && VFX_HAS_INPUT_SYSTEM_PACKAGE - #define USE_INPUT_SYSTEM +#define USE_INPUT_SYSTEM using UnityEngine.InputSystem; using System.Linq; #endif diff --git a/com.unity.visualeffectgraph/Runtime/Utilities/EventBinding/Implementation/VFXVisibilityEventBinder.cs b/com.unity.visualeffectgraph/Runtime/Utilities/EventBinding/Implementation/VFXVisibilityEventBinder.cs index a9a830413fe..1d9528b3c1e 100644 --- a/com.unity.visualeffectgraph/Runtime/Utilities/EventBinding/Implementation/VFXVisibilityEventBinder.cs +++ b/com.unity.visualeffectgraph/Runtime/Utilities/EventBinding/Implementation/VFXVisibilityEventBinder.cs @@ -15,7 +15,7 @@ public enum Activation public Activation activation = Activation.OnBecameVisible; - protected override void SetEventAttribute(object[] parameters) {} + protected override void SetEventAttribute(object[] parameters) { } private void OnBecameVisible() { diff --git a/com.unity.visualeffectgraph/Runtime/Utilities/PropertyBinding/ExposedProperty.cs b/com.unity.visualeffectgraph/Runtime/Utilities/PropertyBinding/ExposedProperty.cs index 2afefd5dc13..9838f43cd47 100644 --- a/com.unity.visualeffectgraph/Runtime/Utilities/PropertyBinding/ExposedProperty.cs +++ b/com.unity.visualeffectgraph/Runtime/Utilities/PropertyBinding/ExposedProperty.cs @@ -70,7 +70,7 @@ public static implicit operator int(ExposedProperty parameter) /// /// /// - public static ExposedProperty operator+(ExposedProperty self, ExposedProperty other) + public static ExposedProperty operator +(ExposedProperty self, ExposedProperty other) { return new ExposedProperty(self.m_Name + other.m_Name); } diff --git a/com.unity.visualeffectgraph/Runtime/Utilities/PropertyBinding/Implementation/VFXInputMouseBinder.cs b/com.unity.visualeffectgraph/Runtime/Utilities/PropertyBinding/Implementation/VFXInputMouseBinder.cs index 6fa208cf5d0..65932075f49 100644 --- a/com.unity.visualeffectgraph/Runtime/Utilities/PropertyBinding/Implementation/VFXInputMouseBinder.cs +++ b/com.unity.visualeffectgraph/Runtime/Utilities/PropertyBinding/Implementation/VFXInputMouseBinder.cs @@ -1,5 +1,5 @@ #if ENABLE_INPUT_SYSTEM && VFX_HAS_INPUT_SYSTEM_PACKAGE - #define USE_INPUT_SYSTEM +#define USE_INPUT_SYSTEM using UnityEngine.InputSystem; #endif diff --git a/com.unity.visualeffectgraph/Runtime/Utilities/PropertyBinding/Implementation/VFXInputTouchBinder.cs b/com.unity.visualeffectgraph/Runtime/Utilities/PropertyBinding/Implementation/VFXInputTouchBinder.cs index 5cfa6ac1100..d27a5a46398 100644 --- a/com.unity.visualeffectgraph/Runtime/Utilities/PropertyBinding/Implementation/VFXInputTouchBinder.cs +++ b/com.unity.visualeffectgraph/Runtime/Utilities/PropertyBinding/Implementation/VFXInputTouchBinder.cs @@ -1,5 +1,5 @@ #if ENABLE_INPUT_SYSTEM && VFX_HAS_INPUT_SYSTEM_PACKAGE - #define USE_INPUT_SYSTEM +#define USE_INPUT_SYSTEM using UnityEngine.InputSystem; using System.Linq; #endif