浏览代码

SRP PostProcess renaming.

/fptl_cleanup
Torbjorn Laedre 8 年前
当前提交
4a41f355
共有 4 个文件被更改,包括 15 次插入15 次删除
  1. 2
      Assets/ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipeline.cs
  2. 20
      Assets/ScriptableRenderPipeline/HDRenderPipeline/PostProcess/Editor/PostProcessingSRPEditor.cs
  3. 2
      Assets/ScriptableRenderPipeline/HDRenderPipeline/PostProcess/PostProcessingSRP.Settings.cs
  4. 6
      Assets/ScriptableRenderPipeline/HDRenderPipeline/PostProcess/PostProcessingSRP.cs

2
Assets/ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipeline.cs


// All of this is temporary, sub-optimal and quickly hacked together but is necessary
// for artists to do lighting work until the fully-featured framework is ready
var localPostProcess = camera.GetComponent<PostProcessing>();
var localPostProcess = camera.GetComponent<PostProcessingSRP>();
bool localActive = localPostProcess != null && localPostProcess.enabled;

20
Assets/ScriptableRenderPipeline/HDRenderPipeline/PostProcess/Editor/PostProcessingSRPEditor.cs


namespace UnityEditor.Experimental.Rendering.HDPipeline
{
using GradingType = PostProcessing.ColorGradingSettings.GradingType;
using EyeAdaptationType = PostProcessing.EyeAdaptationSettings.EyeAdaptationType;
using GradingType = PostProcessingSRP.ColorGradingSettings.GradingType;
using EyeAdaptationType = PostProcessingSRP.EyeAdaptationSettings.EyeAdaptationType;
[CustomEditor(typeof(PostProcessing))]
[CustomEditor(typeof(PostProcessingSRP))]
public class PostProcessingEditor : Editor
{
#region Serialized settings

public VignetteSettings vignetteSettings;
public SerializedProperty globalDithering;
SerializedProperty FindProperty<TValue>(Expression<Func<PostProcessing, TValue>> expr)
SerializedProperty FindProperty<TValue>(Expression<Func<PostProcessingSRP, TValue>> expr)
{
var path = Utilities.GetFieldPath(expr);
return serializedObject.FindProperty(path);

void ColorGradingUI()
{
var camera = (target as PostProcessing).GetComponent<Camera>();
var camera = (target as PostProcessingSRP).GetComponent<Camera>();
if (camera != null)
{
using (new EditorGUILayout.HorizontalScope())

#region Color grading stuff
void SetLUTImportSettings()
{
var lut = (target as PostProcessing).colorGrading.logLut;
var lut = (target as PostProcessingSRP).colorGrading.logLut;
var importer = (TextureImporter)AssetImporter.GetAtPath(AssetDatabase.GetAssetPath(lut));
importer.textureType = TextureImporterType.Default;
importer.filterMode = FilterMode.Bilinear;

bool ValidateLutImportSettings()
{
var lut = (target as PostProcessing).colorGrading.logLut;
var lut = (target as PostProcessingSRP).colorGrading.logLut;
if (lut == null)
return true;

var targetRt = RenderTexture.GetTemporary(width, height, 0, RenderTextureFormat.ARGBHalf, RenderTextureReadWrite.Linear);
// Render the current frame without post processing
var oldPPState = (target as PostProcessing).enabled;
(target as PostProcessing).enabled = false;
var oldPPState = (target as PostProcessingSRP).enabled;
(target as PostProcessingSRP).enabled = false;
var oldTarget = camera.targetTexture;
var oldActive = RenderTexture.active;
camera.targetTexture = targetRt;

texture.ReadPixels(new Rect(0, 0, targetRt.width, targetRt.height), 0, 0);
camera.targetTexture = oldTarget;
RenderTexture.active = oldActive;
(target as PostProcessing).enabled = oldPPState;
(target as PostProcessingSRP).enabled = oldPPState;
// Cleanup
RenderTexture.ReleaseTemporary(stampRt);

2
Assets/ScriptableRenderPipeline/HDRenderPipeline/PostProcess/PostProcessingSRP.Settings.cs


namespace UnityEngine.Experimental.Rendering.HDPipeline
{
partial class PostProcessing
partial class PostProcessingSRP
{
[Serializable]
public sealed class ColorGradingSettings

6
Assets/ScriptableRenderPipeline/HDRenderPipeline/PostProcess/PostProcessingSRP.cs


namespace UnityEngine.Experimental.Rendering.HDPipeline
{
using GradingType = PostProcessing.ColorGradingSettings.GradingType;
using EyeAdaptationType = PostProcessing.EyeAdaptationSettings.EyeAdaptationType;
using GradingType = PostProcessingSRP.ColorGradingSettings.GradingType;
using EyeAdaptationType = PostProcessingSRP.EyeAdaptationSettings.EyeAdaptationType;
public sealed partial class PostProcessing : MonoBehaviour
public sealed partial class PostProcessingSRP : MonoBehaviour
{
public EyeAdaptationSettings eyeAdaptation = new EyeAdaptationSettings();
public ColorGradingSettings colorGrading = new ColorGradingSettings();

正在加载...
取消
保存