fxvIntroWindowURP.cs 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using System.IO;
  4. using System.Reflection;
  5. using UnityEditor;
  6. using UnityEngine;
  7. using UnityEngine.Rendering;
  8. using UnityEngine.Rendering.Universal;
  9. namespace FXV.VolumetricFogEditorUtils
  10. {
  11. public partial class fxvIntroWindow : EditorWindow
  12. {
  13. #pragma warning disable CS0414
  14. static string urpVersion = "version 1.0.11";
  15. #pragma warning restore CS0414
  16. void Setup_URP_AfterImport()
  17. {
  18. FXV.Internal.fxvFogAssetConfig.UpdateShadersForActiveRenderPipeline();
  19. }
  20. void GUI_URP_AfterImport()
  21. {
  22. UniversalRenderPipelineAsset currentRP = (UniversalRenderPipelineAsset)GraphicsSettings.currentRenderPipeline;
  23. GUILine(Color.gray);
  24. GUILayout.BeginHorizontal();
  25. {
  26. if (currentRP.supportsCameraDepthTexture)
  27. {
  28. GUILayout.Label(" Depth texture enabled.", greenStyle);
  29. }
  30. else
  31. {
  32. GUILayout.Label(" Enable depth texture in pipeline asset for fog to work.\n Alternatively you can do this for specific camera in it's component on scene.", redStyle);
  33. if (GUILayout.Button("Show Asset", GUILayout.Width(buttonWidth)))
  34. {
  35. Selection.activeObject = AssetDatabase.LoadMainAssetAtPath(AssetDatabase.GetAssetPath(currentRP));
  36. }
  37. if (GUILayout.Button("Fix", GUILayout.Width(buttonWidth)))
  38. {
  39. currentRP.supportsCameraDepthTexture = true;
  40. }
  41. }
  42. }
  43. GUILayout.EndHorizontal();
  44. GUILine(Color.gray);
  45. GUILayout.BeginHorizontal();
  46. {
  47. GUILayout.Label("Check demo scenes for fog examples.");
  48. if (GUILayout.Button("Show", GUILayout.Width(buttonWidth)))
  49. {
  50. Selection.activeObject = AssetDatabase.LoadMainAssetAtPath(assetPath + "/URP/Demo/Demo1_URP.unity");
  51. }
  52. }
  53. GUILayout.EndHorizontal();
  54. GUILine(Color.gray);
  55. GUILayout.BeginHorizontal();
  56. {
  57. GUILayout.Label("To quickly add fog to scene [RightClick -> FXV -> Fog (type)] in Hierarchy panel.");
  58. }
  59. GUILayout.EndHorizontal();
  60. GUILine(Color.gray);
  61. GUILayout.BeginHorizontal();
  62. {
  63. GUILayout.Label("When adding big fog groups consider parenting them under object with VolumeFogGroup component.");
  64. if (GUILayout.Button("Show", GUILayout.Width(buttonWidth)))
  65. {
  66. Selection.activeObject = AssetDatabase.LoadMainAssetAtPath(assetPath + "/Scripts/VolumeFogGroup.cs");
  67. }
  68. }
  69. GUILayout.EndHorizontal();
  70. GUILine(Color.gray);
  71. GUILayout.BeginHorizontal();
  72. {
  73. GUILayout.Label("Please read documentation for implementation guidelines.");
  74. if (GUILayout.Button("Show", GUILayout.Width(buttonWidth)))
  75. {
  76. Selection.activeObject = AssetDatabase.LoadMainAssetAtPath(assetPath + "/Documentation.pdf");
  77. }
  78. }
  79. GUILayout.EndHorizontal();
  80. GUILine(Color.gray);
  81. }
  82. }
  83. }