コード例 #1
0
        private void SetupRendererPipeline()
        {
            UnityEngine.Rendering.Universal.UniversalRenderPipelineAsset lwrpa = ScriptableObject.Instantiate(GraphicsSettings.renderPipelineAsset) as UnityEngine.Rendering.Universal.UniversalRenderPipelineAsset;

            if (lwrpa != null)
            {
                lwrpa.shadowDepthBias = 3;
                lwrpa.shadowDistance  = 80f;
                GraphicsSettings.renderPipelineAsset = lwrpa;
            }
        }
コード例 #2
0
ファイル: Installer.cs プロジェクト: ailoving00/_Wendy
        //If the PPS is installed using URP in 2019.3 or LTS, the pipeline does need to be configured
        public static void ConfigureURPIfNeeded()
        {
#if URP && PPS && (UNITY_2019_3_OR_NEWER && !UNITY_2020_1_OR_NEWER)
            UnityEngine.Rendering.Universal.UniversalRenderPipelineAsset pipeline = UnityEngine.Rendering.Universal.UniversalRenderPipeline.asset;

            if (pipeline.postProcessingFeatureSet != UnityEngine.Rendering.Universal.PostProcessingFeatureSet.PostProcessingV2)
            {
                pipeline.postProcessingFeatureSet = UnityEngine.Rendering.Universal.PostProcessingFeatureSet.PostProcessingV2;

                Installer.Log.Write("URP Post processing feature set was switched to PostProcessingV2");
            }
#endif
        }
コード例 #3
0
        public CullingController(UniversalRenderPipelineAsset urpAsset, CullingControllerSettings settings, ICullingObjectsTracker cullingObjectsTracker = null)
        {
            if (cullingObjectsTracker == null)
            {
                objectsTracker = new CullingObjectsTracker();
            }
            else
            {
                objectsTracker = cullingObjectsTracker;
            }

            this.urpAsset = urpAsset;
            this.settings = settings;
        }
        static void OnLoad()
        {
            if (null != GraphicsSettings.renderPipelineAsset)
            {
                return;
            }

            var allAssetPaths = AssetDatabase.GetAllAssetPaths();

            foreach (var curAssetPath in allAssetPaths)
            {
                if (curAssetPath.EndsWith("UniversalRenderPipelineAsset.asset"))
                {
                    UnityEngine.Rendering.Universal.UniversalRenderPipelineAsset pipelineAsset =
                        AssetDatabase.LoadAssetAtPath <UnityEngine.Rendering.Universal.UniversalRenderPipelineAsset>(
                            curAssetPath);
                    GraphicsSettings.renderPipelineAsset = pipelineAsset;
                    PlayerSettings.colorSpace            = ColorSpace.Linear;
                }
            }
        }
コード例 #5
0
        static void FindErrors()
        {
            activeRendererIcon.style.backgroundImage = Background.FromTexture2D(neutral);
            depthTextureIcon.style.backgroundImage   = Background.FromTexture2D(neutral);
            opaqueTextureIcon.style.backgroundImage  = Background.FromTexture2D(neutral);

            int planarReflectionComponents = 0;

            PlanarReflections[] planarReflections = FindObjectsOfType <PlanarReflections>();
            foreach (PlanarReflections planarReflection in planarReflections)
            {
                if (planarReflection.enabled)
                {
                    planarReflectionComponents += 1;
                }
            }

            if (planarReflectionComponents == 1)
            {
                planarReflectionsLabel.text = "Enabled";
                planarReflectionsIcon.style.backgroundImage = Background.FromTexture2D(positive);
            }

            else if (planarReflectionComponents > 1)
            {
                planarReflectionsLabel.text = "Multiple";
                planarReflectionsIcon.style.backgroundImage = Background.FromTexture2D(negative);
            }

            else if (planarReflectionComponents == 0)
            {
                planarReflectionsLabel.text = "Disabled";
                planarReflectionsIcon.style.backgroundImage = Background.FromTexture2D(neutral);
                if (Camera.main != null)
                {
                    planarReflectionsFix.style.visibility = Visibility.Visible;
                }
            }

            switch (SystemInfo.graphicsDeviceType)
            {
            case GraphicsDeviceType.Vulkan:
                graphicsAPILabel.text = "Vulkan";
                graphicsAPIIcon.style.backgroundImage = Background.FromTexture2D(positive);
                break;

            case GraphicsDeviceType.Direct3D11:
                graphicsAPILabel.text = "Direct3D11";
                graphicsAPIIcon.style.backgroundImage = Background.FromTexture2D(positive);
                break;

            case GraphicsDeviceType.OpenGLES3:
                graphicsAPILabel.text = "OpenGLES3";
                graphicsAPIIcon.style.backgroundImage = Background.FromTexture2D(neutral);
                break;

            case GraphicsDeviceType.Direct3D12:
                graphicsAPILabel.text = "Direct3D12";
                graphicsAPIIcon.style.backgroundImage = Background.FromTexture2D(neutral);
                break;

            case GraphicsDeviceType.OpenGLES2:
                graphicsAPILabel.text = "OpenGLES2";
                graphicsAPIIcon.style.backgroundImage = Background.FromTexture2D(negative);
                break;

            case GraphicsDeviceType.Null:
                graphicsAPILabel.text = "Null";
                graphicsAPIIcon.style.backgroundImage = Background.FromTexture2D(neutral);
                break;

            case GraphicsDeviceType.PlayStation4:
                graphicsAPILabel.text = "PlayStation4";
                graphicsAPIIcon.style.backgroundImage = Background.FromTexture2D(neutral);
                break;

            case GraphicsDeviceType.XboxOne:
                graphicsAPILabel.text = "XboxOne";
                graphicsAPIIcon.style.backgroundImage = Background.FromTexture2D(neutral);
                break;

            case GraphicsDeviceType.Metal:
                graphicsAPILabel.text = "Metal";
                graphicsAPIIcon.style.backgroundImage = Background.FromTexture2D(neutral);
                break;

            case GraphicsDeviceType.OpenGLCore:
                graphicsAPILabel.text = "OpenGLCore";
                graphicsAPIIcon.style.backgroundImage = Background.FromTexture2D(neutral);
                break;

            case GraphicsDeviceType.XboxOneD3D12:
                graphicsAPILabel.text = "XboxOneD3D12";
                graphicsAPIIcon.style.backgroundImage = Background.FromTexture2D(neutral);
                break;

            case GraphicsDeviceType.Switch:
                graphicsAPILabel.text = "Switch";
                graphicsAPIIcon.style.backgroundImage = Background.FromTexture2D(neutral);
                break;
            }

            switch (DetectPipeline())
            {
            case PipelineType.Custom:
                activeRendererLabel.text = "Custom";
                depthTextureLabel.text   = "Not tested";
                opaqueTextureLabel.text  = "Not tested";

                activeRendererIcon.style.backgroundImage = Background.FromTexture2D(negative);
                depthTextureIcon.style.backgroundImage   = Background.FromTexture2D(neutral);
                opaqueTextureIcon.style.backgroundImage  = Background.FromTexture2D(neutral);

                depthTextureFix.style.visibility   = Visibility.Hidden;
                activeRendererFix.style.visibility = Visibility.Hidden;
                opaqueTextureFix.style.visibility  = Visibility.Hidden;
                break;

            case PipelineType.Default:
                activeRendererLabel.text = "Default";
                depthTextureLabel.text   = "Not tested";
                opaqueTextureLabel.text  = "Not tested";

                activeRendererIcon.style.backgroundImage = Background.FromTexture2D(negative);
                depthTextureIcon.style.backgroundImage   = Background.FromTexture2D(neutral);
                opaqueTextureIcon.style.backgroundImage  = Background.FromTexture2D(neutral);

                depthTextureFix.style.visibility   = Visibility.Hidden;
                activeRendererFix.style.visibility = Visibility.Hidden;
                opaqueTextureFix.style.visibility  = Visibility.Hidden;
                break;

            case PipelineType.Lightweight:
                activeRendererLabel.text = "Lightweight";
                depthTextureLabel.text   = "Not tested";
                opaqueTextureLabel.text  = "Not tested";

                activeRendererIcon.style.backgroundImage = Background.FromTexture2D(negative);
                depthTextureIcon.style.backgroundImage   = Background.FromTexture2D(neutral);
                opaqueTextureIcon.style.backgroundImage  = Background.FromTexture2D(neutral);

                depthTextureFix.style.visibility   = Visibility.Hidden;
                activeRendererFix.style.visibility = Visibility.Hidden;
                opaqueTextureFix.style.visibility  = Visibility.Hidden;
                break;

            case PipelineType.Universal:
#if UNIVERSAL_RENDERER
                UnityEngine.Rendering.Universal.UniversalRenderPipelineAsset pipeline = GraphicsSettings.currentRenderPipeline as UnityEngine.Rendering.Universal.UniversalRenderPipelineAsset;

#if UNIVERSAL_731 // GetRenderer() was introduced in 7.3.1
                if (pipeline.GetRenderer(0).GetType().ToString().Contains("Renderer2D"))
                {
                    activeRendererLabel.text = "2D Renderer";
                    activeRendererIcon.style.backgroundImage = Background.FromTexture2D(negative);
                    activeRendererFix.style.visibility       = Visibility.Visible;
                }

                else
                {
                    activeRendererLabel.text = "Universal";
                    activeRendererIcon.style.backgroundImage = Background.FromTexture2D(positive);
                    activeRendererFix.style.visibility       = Visibility.Hidden;
                }
#else
                activeRendererLabel.text = "Universal";
                activeRendererIcon.style.backgroundImage = Background.FromTexture2D(positive);
                activeRendererFix.style.visibility       = Visibility.Hidden;
#endif

                if (pipeline.supportsCameraDepthTexture)
                {
                    depthTextureLabel.text = "Enabled";
                    depthTextureIcon.style.backgroundImage = Background.FromTexture2D(positive);
                    depthTextureFix.style.visibility       = Visibility.Hidden;
                }

                else
                {
                    depthTextureLabel.text = "Disabled";
                    depthTextureIcon.style.backgroundImage = Background.FromTexture2D(negative);
                    depthTextureFix.style.visibility       = Visibility.Visible;
                }

                if (pipeline.supportsCameraOpaqueTexture)
                {
                    opaqueTextureLabel.text = "Enabled";
                    opaqueTextureIcon.style.backgroundImage = Background.FromTexture2D(positive);
                    opaqueTextureFix.style.visibility       = Visibility.Hidden;
                }

                else
                {
                    opaqueTextureLabel.text = "Disabled";
                    opaqueTextureIcon.style.backgroundImage = Background.FromTexture2D(negative);
                    opaqueTextureFix.style.visibility       = Visibility.Visible;
                }
#endif
                break;

            case PipelineType.HighDefinition:
                activeRendererLabel.text = "High Definition";
                depthTextureLabel.text   = "Not tested";
                opaqueTextureLabel.text  = "Not tested";

                activeRendererIcon.style.backgroundImage = Background.FromTexture2D(negative);
                depthTextureIcon.style.backgroundImage   = Background.FromTexture2D(neutral);
                opaqueTextureIcon.style.backgroundImage  = Background.FromTexture2D(neutral);

                activeRendererFix.style.visibility = Visibility.Hidden;
                depthTextureFix.style.visibility   = Visibility.Hidden;
                opaqueTextureFix.style.visibility  = Visibility.Hidden;
                break;
            }
        }
コード例 #6
0
        private void Clickedbutton(EventBase tab)
        {
            Button button = tab.target as Button;

            if (button.name == "SupportButton")
            {
                supportTab.style.display          = DisplayStyle.Flex;
                aboutTab.style.display            = DisplayStyle.None;
                errorsTab.style.display           = DisplayStyle.None;
                acknowledgementsTab.style.display = DisplayStyle.None;
            }

            else if (button.name == "AboutButton")
            {
                supportTab.style.display          = DisplayStyle.None;
                aboutTab.style.display            = DisplayStyle.Flex;
                errorsTab.style.display           = DisplayStyle.None;
                acknowledgementsTab.style.display = DisplayStyle.None;
            }

            else if (button.name == "ConfigureButton")
            {
                supportTab.style.display          = DisplayStyle.None;
                aboutTab.style.display            = DisplayStyle.None;
                errorsTab.style.display           = DisplayStyle.Flex;
                acknowledgementsTab.style.display = DisplayStyle.None;
            }

            else if (button.name == "AcknowledgementsButton")
            {
                supportTab.style.display          = DisplayStyle.None;
                aboutTab.style.display            = DisplayStyle.None;
                errorsTab.style.display           = DisplayStyle.None;
                acknowledgementsTab.style.display = DisplayStyle.Flex;
            }

            else if (button.name == "Check")
            {
                SetUnchecked();
                CheckUnityVersion();
            }

            else if (button.name == "Manual")
            {
                Application.OpenURL("https://alexander-ameye.gitbook.io/stylized-water/support/troubleshooting");
            }

            else if (button.name == "Forum")
            {
                Application.OpenURL("https://forum.unity.com/threads/stylized-water-for-urp-desktop-mobile-released.846313/");
            }

            else if (button.name == "Contact")
            {
                Application.OpenURL("https://discord.gg/6QQ5JCc");
            }

            else if (button.name == "Review")
            {
                Application.OpenURL("https://assetstore.unity.com/packages/vfx/shaders/stylized-water-for-urp-162025");
            }

            else if (button.name == "Twitter")
            {
                Application.OpenURL("https://twitter.com/alexanderameye");
            }

            else if (button.name == "Website")
            {
                Application.OpenURL("https://alexanderameye.github.io/");
            }

            else if (button.name == "Unity Version Fix")
            {
                Application.OpenURL("https://unity3d.com/get-unity/download");
            }

            else if (button.name == "Active Renderer Fix")
            {
                SettingsService.OpenProjectSettings("Project/Graphics");
            }

            else if (button.name == "Shader_Variant_Limit_Fix")
            {
                EditorPrefs.SetInt("UnityEditor.ShaderGraph.VariantLimit", (int)(object)256);
                FindErrors();
            }

            else if (button.name == "Planar_Reflections_Fix")
            {
                if (Camera.main != null)
                {
                    Selection.activeGameObject = Camera.main.gameObject;
                    EditorGUIUtility.PingObject(Camera.main);
                }
            }

            else if (button.name == "Depth Texture Fix")
            {
                RenderPipelineAsset activeRenderer = GraphicsSettings.currentRenderPipeline;
                UnityEngine.Rendering.Universal.UniversalRenderPipelineAsset pipeline = activeRenderer as UnityEngine.Rendering.Universal.UniversalRenderPipelineAsset;
                EditorGUIUtility.PingObject(pipeline);
            }

            else if (button.name == "Opaque Texture Fix")
            {
                RenderPipelineAsset activeRenderer = GraphicsSettings.currentRenderPipeline;
                UnityEngine.Rendering.Universal.UniversalRenderPipelineAsset pipeline = activeRenderer as UnityEngine.Rendering.Universal.UniversalRenderPipelineAsset;
                EditorGUIUtility.PingObject(pipeline);
            }

            else if (button.name == "KeenanWoodall")
            {
                Application.OpenURL("https://twitter.com/keenanwoodall");
            }

            else if (button.name == "JoshSauter")
            {
                Application.OpenURL("https://github.com/JoshSauter");
            }
        }
コード例 #7
0
 /// <summary>
 /// Auto-assign reference. Replace it in the editor if it was incorrect.
 /// </summary>
 protected override void Reset()
 {
     pipelineAsset = Resources.FindObjectsOfTypeAll <UnityEngine.Rendering.Universal.UniversalRenderPipelineAsset>()[0];
     base.Reset();
 }
コード例 #8
0
        static void FindErrors()
        {
            activeRendererIcon.style.backgroundImage = Background.FromTexture2D(neutral);
            depthTextureIcon.style.backgroundImage   = Background.FromTexture2D(neutral);
            opaqueTextureIcon.style.backgroundImage  = Background.FromTexture2D(neutral);

            RenderPipelineAsset activeRenderer = GraphicsSettings.currentRenderPipeline;

            if (activeRenderer == null)
            {
                activeRendererLabel.text = "Default";
                depthTextureLabel.text   = "Untested";
                opaqueTextureLabel.text  = "Untested";

                activeRendererIcon.style.backgroundImage = Background.FromTexture2D(negative);
                activeRendererFix.style.visibility       = Visibility.Visible;

                depthTextureIcon.style.backgroundImage = Background.FromTexture2D(neutral);
                depthTextureFix.style.visibility       = Visibility.Hidden;

                opaqueTextureIcon.style.backgroundImage = Background.FromTexture2D(neutral);
                opaqueTextureFix.style.visibility       = Visibility.Hidden;
            }

#if UNIVERSAL_RENDERER
            else if (activeRenderer.GetType().Name.Contains("UniversalRenderPipelineAsset"))
            {
                activeRendererLabel.text = "Universal";
                activeRendererIcon.style.backgroundImage = Background.FromTexture2D(positive);
                activeRendererFix.style.visibility       = Visibility.Hidden;

                UnityEngine.Rendering.Universal.UniversalRenderPipelineAsset pipeline = activeRenderer as UnityEngine.Rendering.Universal.UniversalRenderPipelineAsset;
                if (pipeline.supportsCameraDepthTexture)
                {
                    depthTextureLabel.text = "Enabled";
                    depthTextureIcon.style.backgroundImage = Background.FromTexture2D(positive);
                    depthTextureFix.style.visibility       = Visibility.Hidden;
                }

                else
                {
                    depthTextureLabel.text = "Disabled";
                    depthTextureIcon.style.backgroundImage = Background.FromTexture2D(negative);
                    depthTextureFix.style.visibility       = Visibility.Visible;
                }

                if (pipeline.supportsCameraOpaqueTexture)
                {
                    opaqueTextureLabel.text = "Enabled";
                    opaqueTextureIcon.style.backgroundImage = Background.FromTexture2D(positive);
                    opaqueTextureFix.style.visibility       = Visibility.Hidden;
                }

                else
                {
                    opaqueTextureLabel.text = "Disabled";
                    opaqueTextureIcon.style.backgroundImage = Background.FromTexture2D(negative);
                    opaqueTextureFix.style.visibility       = Visibility.Visible;
                }
            }
#endif
            else
            {
                activeRendererLabel.text = "High-Definition";
                depthTextureLabel.text   = "Untested";
                opaqueTextureLabel.text  = "Untested";

                activeRendererIcon.style.backgroundImage = Background.FromTexture2D(negative);
                activeRendererFix.style.visibility       = Visibility.Hidden;

                depthTextureIcon.style.backgroundImage = Background.FromTexture2D(neutral);
                depthTextureFix.style.visibility       = Visibility.Hidden;

                opaqueTextureIcon.style.backgroundImage = Background.FromTexture2D(neutral);
                opaqueTextureFix.style.visibility       = Visibility.Hidden;
            }
        }
コード例 #9
0
        private void Clickedbutton(EventBase tab)
        {
            Button button = tab.target as Button;

            if (button.name == "SupportButton")
            {
                supportTab.style.display          = DisplayStyle.Flex;
                aboutTab.style.display            = DisplayStyle.None;
                errorsTab.style.display           = DisplayStyle.None;
                acknowledgementsTab.style.display = DisplayStyle.None;
            }

            else if (button.name == "AboutButton")
            {
                supportTab.style.display          = DisplayStyle.None;
                aboutTab.style.display            = DisplayStyle.Flex;
                errorsTab.style.display           = DisplayStyle.None;
                acknowledgementsTab.style.display = DisplayStyle.None;
            }

            else if (button.name == "ConfigureButton")
            {
                supportTab.style.display          = DisplayStyle.None;
                aboutTab.style.display            = DisplayStyle.None;
                errorsTab.style.display           = DisplayStyle.Flex;
                acknowledgementsTab.style.display = DisplayStyle.None;
            }

            else if (button.name == "AcknowledgementsButton")
            {
                supportTab.style.display          = DisplayStyle.None;
                aboutTab.style.display            = DisplayStyle.None;
                errorsTab.style.display           = DisplayStyle.None;
                acknowledgementsTab.style.display = DisplayStyle.Flex;
            }

            else if (button.name == "Check")
            {
                SetUnchecked();
                CheckUnityVersion();
            }

            else if (button.name == "Manual")
            {
                Application.OpenURL("https://alexander-ameye.gitbook.io/stylized-water-for-urp/support/troubleshooting");
            }

            else if (button.name == "Forum")
            {
                Application.OpenURL("https://forum.unity.com/threads/stylized-water-for-urp-desktop-mobile-released.846313/");
            }

            else if (button.name == "Contact")
            {
                Application.OpenURL("https://alexander-ameye.gitbook.io/stylized-water-for-urp/");
            }

            else if (button.name == "Review")
            {
                Application.OpenURL("https://assetstore.unity.com/packages/vfx/shaders/stylized-water-for-urp-162025");
            }

            else if (button.name == "Twitter")
            {
                Application.OpenURL("https://twitter.com/alexanderameye");
            }

            else if (button.name == "Website")
            {
                Application.OpenURL("https://alexanderameye.github.io/");
            }

            else if (button.name == "Unity Version Fix")
            {
                Application.OpenURL("https://unity3d.com/get-unity/download");
            }

            else if (button.name == "Active Renderer Fix")
            {
                SettingsService.OpenProjectSettings("Project/Graphics");
            }

            else if (button.name == "Depth Texture Fix")
            {
#if UNIVERSAL_RENDERER
                RenderPipelineAsset activeRenderer = GraphicsSettings.currentRenderPipeline;
                UnityEngine.Rendering.Universal.UniversalRenderPipelineAsset pipeline = activeRenderer as UnityEngine.Rendering.Universal.UniversalRenderPipelineAsset;

                EditorGUIUtility.PingObject(pipeline);
#endif
            }

            else if (button.name == "Opaque Texture Fix")
            {
#if UNIVERSAL_RENDERER
                RenderPipelineAsset activeRenderer = GraphicsSettings.currentRenderPipeline;
                UnityEngine.Rendering.Universal.UniversalRenderPipelineAsset pipeline = activeRenderer as UnityEngine.Rendering.Universal.UniversalRenderPipelineAsset;

                EditorGUIUtility.PingObject(pipeline);
#endif
            }

            else if (button.name == "URP Version Fix")
            {
                addRequest = Client.Add("com.unity.render-pipelines.universal");
                EditorApplication.update += InstallURP;

                activeRendererIcon.style.backgroundImage = Background.FromTexture2D(neutral);
                activeRendererFix.style.visibility       = Visibility.Hidden;

                depthTextureIcon.style.backgroundImage = Background.FromTexture2D(neutral);
                depthTextureFix.style.visibility       = Visibility.Hidden;

                opaqueTextureIcon.style.backgroundImage = Background.FromTexture2D(neutral);
                opaqueTextureFix.style.visibility       = Visibility.Hidden;
            }

            else if (button.name == "KeenanWoodall")
            {
                Application.OpenURL("https://twitter.com/keenanwoodall");
            }

            else if (button.name == "JoshSauter")
            {
                Application.OpenURL("https://github.com/JoshSauter");
            }
        }