浏览代码
Remove camera provider (pass from C++ again) + update loops to match new unity side code.
/main
Remove camera provider (pass from C++ again) + update loops to match new unity side code.
/main
Tim Cooper
8 年前
当前提交
2a19f5f7
共有 7 个文件被更改,包括 31 次插入 和 125 次删除
-
18Assets/BasicRenderLoopTutorial/BasicRenderLoop.cs
-
21Assets/Editor/Tests/RenderloopTests/RenderloopTestFixture.cs
-
21Assets/ScriptableRenderLoop/HDRenderLoop/HDRenderLoop.cs
-
31Assets/ScriptableRenderLoop/core/RenderPipeline.cs
-
20Assets/ScriptableRenderLoop/fptl/FptlLighting.cs
-
33Assets/ScriptableRenderLoop/core/DefaultCameraProvider.cs
-
12Assets/ScriptableRenderLoop/core/DefaultCameraProvider.cs.meta
|
|||
using System; |
|||
public abstract class RenderPipeline : BaseRenderPipeline |
|||
public abstract class RenderPipeline : IRenderPipeline |
|||
private ICameraProvider m_CameraProvider; |
|||
|
|||
public override ICameraProvider cameraProvider |
|||
public virtual void Render(ScriptableRenderContext renderContext, Camera[] cameras) |
|||
get |
|||
{ |
|||
if (m_CameraProvider == null) |
|||
m_CameraProvider = ConstructCameraProvider(); |
|||
|
|||
return m_CameraProvider; |
|||
} |
|||
set { m_CameraProvider = value; } |
|||
if (disposed) |
|||
throw new ObjectDisposedException(string.Format("{0} has been disposed. Do not call Render on disposed RenderLoops.", this)); |
|||
|
|||
public override ICameraProvider ConstructCameraProvider() |
|||
|
|||
public bool disposed { get; private set; } |
|||
|
|||
public virtual void Dispose() |
|||
return new DefaultCameraProvider(); |
|||
} |
|||
|
|||
public static void CleanCameras(IEnumerable<Camera> cameras) |
|||
{ |
|||
foreach (var camera in cameras) |
|||
camera.ClearIntermediateRenderers(); |
|||
disposed = true; |
|||
} |
|||
} |
|||
} |
|
|||
using System.Collections.Generic; |
|||
using UnityEngine.Experimental.Rendering; |
|||
|
|||
namespace UnityEngine.ScriptableRenderPipeline |
|||
{ |
|||
public class DefaultCameraProvider : ICameraProvider |
|||
{ |
|||
public Camera overrideCamera { get; set; } |
|||
|
|||
public static void GetCamerasToRenderDefault(List<Camera> cameras) |
|||
{ |
|||
cameras.Clear(); |
|||
foreach (var c in Camera.allCameras) |
|||
{ |
|||
if (c.enabled) |
|||
cameras.Add(c); |
|||
} |
|||
} |
|||
|
|||
public void GetCamerasToRender(List<Camera> cameras) |
|||
{ |
|||
if (overrideCamera != null) |
|||
{ |
|||
cameras.Clear(); |
|||
cameras.Add(overrideCamera); |
|||
} |
|||
else |
|||
{ |
|||
GetCamerasToRenderDefault(cameras); |
|||
} |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 3ac0b0f83d74a194f8578dc2907cacf6 |
|||
timeCreated: 1483007679 |
|||
licenseType: Pro |
|||
MonoImporter: |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
撰写
预览
正在加载...
取消
保存
Reference in new issue