#if UNITY_EDITOR
using UnityEditor;
using UnityEditor.ProjectWindowCallback;
#endif
using System;
namespace UnityEngine.Rendering.Universal
{
///
/// Class containing shader and texture resources needed for Post Processing in URP.
///
///
///
[Serializable]
public class PostProcessData : ScriptableObject
{
#if UNITY_EDITOR
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1812")]
internal class CreatePostProcessDataAsset : EndNameEditAction
{
public override void Action(int instanceId, string pathName, string resourceFile)
{
var instance = CreateInstance();
AssetDatabase.CreateAsset(instance, pathName);
ResourceReloader.ReloadAllNullIn(instance, UniversalRenderPipelineAsset.packagePath);
Selection.activeObject = instance;
}
}
[MenuItem("Assets/Create/Rendering/URP Post-process Data", priority = CoreUtils.Sections.section5 + CoreUtils.Priorities.assetsCreateRenderingMenuPriority)]
static void CreatePostProcessData()
{
ProjectWindowUtil.StartNameEditingIfProjectWindowExists(0, CreateInstance(), "CustomPostProcessData.asset", null, null);
}
internal static PostProcessData GetDefaultPostProcessData()
{
var path = System.IO.Path.Combine(UniversalRenderPipelineAsset.packagePath, "Runtime/Data/PostProcessData.asset");
return AssetDatabase.LoadAssetAtPath(path);
}
#endif
///
/// Class containing shader resources used for Post Processing in URP.
///
[Serializable, ReloadGroup]
public sealed class ShaderResources
{
///
/// The StopNan Post Processing shader.
///
[Reload("Shaders/PostProcessing/StopNaN.shader")]
public Shader stopNanPS;
///
/// The SubpixelMorphologicalAntiAliasing SMAA Post Processing shader.
///
[Reload("Shaders/PostProcessing/SubpixelMorphologicalAntialiasing.shader")]
public Shader subpixelMorphologicalAntialiasingPS;
///
/// The Gaussian Depth Of Field Post Processing shader.
///
[Reload("Shaders/PostProcessing/GaussianDepthOfField.shader")]
public Shader gaussianDepthOfFieldPS;
///
/// The Bokeh Depth Of Field Post Processing shader.
///
[Reload("Shaders/PostProcessing/BokehDepthOfField.shader")]
public Shader bokehDepthOfFieldPS;
///
/// The Motion Blur Post Processing shader.
///
[Reload("Shaders/PostProcessing/CameraMotionBlur.shader")]
public Shader cameraMotionBlurPS;
///
/// The Panini Projection Post Processing shader.
///
[Reload("Shaders/PostProcessing/PaniniProjection.shader")]
public Shader paniniProjectionPS;
///
/// The LUT Builder LDR Post Processing shader.
///
[Reload("Shaders/PostProcessing/LutBuilderLdr.shader")]
public Shader lutBuilderLdrPS;
///
/// The LUT Builder HDR Post Processing shader.
///
[Reload("Shaders/PostProcessing/LutBuilderHdr.shader")]
public Shader lutBuilderHdrPS;
///
/// The Bloom Post Processing shader.
///
[Reload("Shaders/PostProcessing/Bloom.shader")]
public Shader bloomPS;
///
/// The Temporal-antialiasing Post Processing shader.
///
[Reload("Shaders/PostProcessing/TemporalAA.shader")]
public Shader temporalAntialiasingPS;
///
/// The Lens Flare Post Processing shader.
///
[Reload("Shaders/PostProcessing/LensFlareDataDriven.shader")]
public Shader LensFlareDataDrivenPS;
///
/// The Lens Flare Screen Space shader.
///
[Reload("Shaders/PostProcessing/LensFlareScreenSpace.shader")]
public Shader LensFlareScreenSpacePS;
///
/// The Scaling Setup Post Processing shader.
///
[Reload("Shaders/PostProcessing/ScalingSetup.shader")]
public Shader scalingSetupPS;
///
/// The Edge Adaptive Spatial Upsampling shader.
///
[Reload("Shaders/PostProcessing/EdgeAdaptiveSpatialUpsampling.shader")]
public Shader easuPS;
///
/// The Uber Post Processing shader.
///
[Reload("Shaders/PostProcessing/UberPost.shader")]
public Shader uberPostPS;
///
/// The Final Post Processing shader.
///
[Reload("Shaders/PostProcessing/FinalPost.shader")]
public Shader finalPostPassPS;
}
///
/// Class containing texture resources used for Post Processing in URP.
///
[Serializable, ReloadGroup]
public sealed class TextureResources
{
///
/// Pre-baked Blue noise textures.
///
[Reload("Textures/BlueNoise16/L/LDR_LLL1_{0}.png", 0, 32)]
public Texture2D[] blueNoise16LTex;
///
/// Film Grain textures.
///
[Reload(new[]
{
"Textures/FilmGrain/Thin01.png",
"Textures/FilmGrain/Thin02.png",
"Textures/FilmGrain/Medium01.png",
"Textures/FilmGrain/Medium02.png",
"Textures/FilmGrain/Medium03.png",
"Textures/FilmGrain/Medium04.png",
"Textures/FilmGrain/Medium05.png",
"Textures/FilmGrain/Medium06.png",
"Textures/FilmGrain/Large01.png",
"Textures/FilmGrain/Large02.png"
})]
public Texture2D[] filmGrainTex;
///
/// SubpixelMorphologicalAntiAliasing SMAA area texture.
///
[Reload("Textures/SMAA/AreaTex.tga")]
public Texture2D smaaAreaTex;
///
/// SubpixelMorphologicalAntiAliasing SMAA search texture.
///
[Reload("Textures/SMAA/SearchTex.tga")]
public Texture2D smaaSearchTex;
}
///
/// Shader resources used for Post Processing in URP.
///
public ShaderResources shaders;
///
/// Texture resources used for Post Processing in URP.
///
public TextureResources textures;
}
}