浏览代码

removed RenderPipeline.RenderSceneView()

/main
vlad-andreev 8 年前
当前提交
0e28d55a
共有 2 个文件被更改,包括 25 次插入23 次删除
  1. 18
      Assets/ScriptableRenderLoop/HDRenderLoop/HDRenderLoop.cs
  2. 30
      Assets/ScriptableRenderLoop/fptl/FptlLighting.cs

18
Assets/ScriptableRenderLoop/HDRenderLoop/HDRenderLoop.cs


}
}
#if UNITY_EDITOR
public override void RenderSceneView(Camera camera, RenderLoop renderLoop)
{
base.RenderSceneView(camera, renderLoop);
renderLoop.PrepareForEditorRendering(camera, m_CameraDepthBufferRT);
renderLoop.Submit();
}
#endif
void FinalPass(RenderLoop renderLoop)
{
using (new Utilities.ProfilingSample("Final Pass", renderLoop))

// RenderDistortion(cullResults, camera, renderLoop);
FinalPass(renderLoop);
}
// bind depth surface for editor grid/gizmo/selection rendering
if (camera.cameraType == CameraType.SceneView)
{
var cmd = new CommandBuffer();
cmd.SetRenderTarget(BuiltinRenderTextureType.CameraTarget, m_CameraDepthBufferRT);
renderLoop.ExecuteCommandBuffer(cmd);
cmd.Dispose();
}
renderLoop.Submit();

30
Assets/ScriptableRenderLoop/fptl/FptlLighting.cs


cmd.GetTemporaryRT(s_GBufferZ, width, height, 24, FilterMode.Point, RenderTextureFormat.Depth);
cmd.GetTemporaryRT(s_CameraDepthTexture, width, height, 24, FilterMode.Point, RenderTextureFormat.Depth);
cmd.GetTemporaryRT(s_CameraTarget, width, height, 0, FilterMode.Point, formatHDR, RenderTextureReadWrite.Default, 1, true); // rtv/uav
var colorMRTs = new RenderTargetIdentifier[4] { s_GBufferAlbedo, s_GBufferSpecRough, s_GBufferNormal, s_GBufferEmission };
cmd.SetRenderTarget(colorMRTs, new RenderTargetIdentifier(s_GBufferZ));
cmd.ClearRenderTarget(true, true, new Color(0, 0, 0, 0));

return !disableFptl;
}
}
static void CopyDepthAfterGBuffer(RenderLoop loop)
{
var cmd = new CommandBuffer { name = "Copy depth" };

}
else
{
cmd.Blit(0, s_CameraTarget, m_DeferredMaterial, 0);
cmd.Blit(0, s_CameraTarget, m_DeferredReflectionMaterial, 0);
cmd.Blit(BuiltinRenderTextureType.CameraTarget, s_CameraTarget, m_DeferredMaterial, 0);
cmd.Blit(BuiltinRenderTextureType.CameraTarget, s_CameraTarget, m_DeferredReflectionMaterial, 0);
}

return numLightsOut + numProbesOut;
}
#if UNITY_EDITOR
public override void RenderSceneView(Camera camera, RenderLoop renderLoop)
{
base.RenderSceneView(camera, renderLoop);
renderLoop.PrepareForEditorRendering(camera, new RenderTargetIdentifier(s_CameraDepthTexture));
renderLoop.Submit();
}
#endif
public override void Render(Camera[] cameras, RenderLoop renderLoop)
{
foreach (var camera in cameras)

// debug views.
if (enableDrawLightBoundsDebug) DrawLightBoundsDebug(loop, cullResults.visibleLights.Length);
// bind depth surface for editor grid/gizmo/selection rendering
if (camera.cameraType == CameraType.SceneView)
{
var cmd = new CommandBuffer();
cmd.SetRenderTarget(BuiltinRenderTextureType.CameraTarget, new RenderTargetIdentifier(s_CameraDepthTexture));
loop.ExecuteCommandBuffer(cmd);
cmd.Dispose();
}
loop.Submit();
}
void DrawLightBoundsDebug(RenderLoop loop, int numLights)

正在加载...
取消
保存