浏览代码

PostProcessing integration

Currently missing opaque-only effects, should be an easy addition
/Branch_batcher
Chman 8 年前
当前提交
3f710860
共有 3 个文件被更改,包括 54 次插入5 次删除
  1. 31
      Assets/ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipeline.cs
  2. 19
      Assets/TestScenes/HDTest/HDRenderLoopTest.unity
  3. 9
      Assets/ScriptableRenderPipeline/PostProcessing.meta

31
Assets/ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipeline.cs


using UnityEngine.Rendering;
using System;
using System.Linq;
using UnityEngine.Experimental.PostProcessing;
using UnityEngine.Experimental.Rendering.HDPipeline.TilePass;
#if UNITY_EDITOR

private RenderTargetIdentifier m_CameraDepthStencilBufferRT;
private RenderTargetIdentifier m_CameraDepthStencilBufferCopyRT;
// Post-processing context (recycled on every frame to avoid GC alloc)
readonly PostProcessRenderContext m_PostProcessContext;
// Detect when windows size is changing
int m_CurrentWidth;
int m_CurrentHeight;

m_SkyManager.Build();
m_SkyManager.skySettings = owner.skySettingsToUse;
m_PostProcessContext = new PostProcessRenderContext();
}
void InitializeDebugMaterials()

void FinalPass(Camera camera, ScriptableRenderContext renderContext)
{
using (new Utilities.ProfilingSample("Final", renderContext))
using (new Utilities.ProfilingSample("Final Pass", renderContext))
var postProcessLayer = camera.GetComponent<PostProcessLayer>();
cmd.Blit(m_CameraColorBufferRT, BuiltinRenderTextureType.CameraTarget);
if (postProcessLayer != null && postProcessLayer.enabled)
{
cmd.SetGlobalTexture("_CameraDepthTexture", GetDepthTexture());
var context = m_PostProcessContext;
context.Reset();
context.source = m_CameraColorBufferRT;
context.destination = BuiltinRenderTextureType.CameraTarget;
context.command = cmd;
context.camera = camera;
context.sourceFormat = RenderTextureFormat.ARGBHalf; // ?
context.flip = true;
postProcessLayer.Render(context);
}
else
{
cmd.Blit(m_CameraColorBufferRT, BuiltinRenderTextureType.CameraTarget);
}
renderContext.ExecuteCommandBuffer(cmd);
cmd.Dispose();
}

19
Assets/TestScenes/HDTest/HDRenderLoopTest.unity


- component: {fileID: 1828470162}
- component: {fileID: 1828470161}
- component: {fileID: 1828470160}
- component: {fileID: 1828470165}
- component: {fileID: 1828470165}
m_Layer: 0
m_Name: Main Camera
m_TagString: MainCamera

m_TargetDisplay: 0
m_TargetEye: 3
m_HDR: 1
m_AllowMSAA: 1
m_AllowMSAA: 0
m_ForceIntoRT: 0
m_OcclusionCulling: 1
m_StereoConvergence: 10

m_GameObject: {fileID: 1828470159}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 92bb16b4ee20841929b24d6bd771738d, type: 3}
m_Script: {fileID: 11500000, guid: 948f4100a11a5c24981795d21301da5c, type: 3}
volumeTrigger: {fileID: 1828470164}
volumeLayer:
serializedVersion: 2
m_Bits: 1
antialiasingMode: 0
temporalAntialiasing:
jitterSpread: 0.75
sharpen: 0.25
stationaryBlending: 0.95
motionBlending: 0.85
showDebugUI: 0
debugView:
monitor: 1
--- !u!114 &1828470166
MonoBehaviour:
m_ObjectHideFlags: 0

9
Assets/ScriptableRenderPipeline/PostProcessing.meta


fileFormatVersion: 2
guid: f9e0215129f26be429b86e3119cc9a5c
folderAsset: yes
timeCreated: 1493295523
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
正在加载...
取消
保存