Skip to content

Commit c0008b4

Browse files
2 parents 0ee4c2f + 3350501 commit c0008b4

File tree

4 files changed

+11
-26
lines changed

4 files changed

+11
-26
lines changed

Assets/BasicRenderLoopTutorial/BasicRenderLoop.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using UnityEngine;
22
using UnityEngine.Rendering;
33
using UnityEngine.Experimental.Rendering;
4-
using UnityEngine.Experimental.ScriptableRenderLoop;
54

65
// Very basic scriptable rendering loop example:
76
// - Use with BasicRenderLoopShader.shader (the loop expects "BasicPass" pass type to exist)
@@ -11,7 +10,7 @@
1110
// - This loop also does not setup lightmaps, light probes, reflection probes or light cookies
1211

1312
[ExecuteInEditMode]
14-
public class BasicRenderLoop : ScriptableRenderLoop
13+
public class BasicRenderLoop : RenderPipeline
1514
{
1615

1716
#if UNITY_EDITOR

Assets/Editor/Tests/RenderloopTests/RenderloopTestFixture.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
using UnityEngine.Rendering;
99

1010
[ExecuteInEditMode]
11-
public class RenderLoopTestFixture : ScriptableRenderLoop
11+
public class RenderLoopTestFixture : RenderPipeline
1212
{
1313
public delegate void TestDelegate(Camera camera, CullResults cullResults, RenderLoop renderLoop);
1414
private static TestDelegate s_Callback;
@@ -42,7 +42,7 @@ public static void Run(TestDelegate renderCallback)
4242
var sceneCamera = Camera.main;
4343
var camObject = sceneCamera.gameObject;
4444

45-
GraphicsSettings.SetScriptableRenderLoop(m_Instance);
45+
GraphicsSettings.SetRenderPipeline(m_Instance);
4646
s_Callback = renderCallback;
4747
Transform t = camObject.transform;
4848

@@ -53,6 +53,6 @@ public static void Run(TestDelegate renderCallback)
5353
SceneView.lastActiveSceneView.LookAtDirect(t.position + t.forward * camDist, t.rotation, size);
5454

5555
sceneCamera.Render();
56-
GraphicsSettings.SetScriptableRenderLoop(null);
56+
GraphicsSettings.SetRenderPipeline(null);
5757
}
5858
}

Assets/ScriptableRenderLoop/HDRenderLoop/HDRenderLoop.cs

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace UnityEngine.Experimental.ScriptableRenderLoop
77
{
88
[ExecuteInEditMode]
99
// This HDRenderLoop assume linear lighting. Don't work with gamma.
10-
public partial class HDRenderLoop : ScriptableRenderLoop
10+
public partial class HDRenderLoop : RenderPipeline
1111
{
1212
const string k_HDRenderLoopPath = "Assets/ScriptableRenderLoop/HDRenderLoop/HDRenderLoop.asset";
1313

@@ -226,17 +226,9 @@ public TilePass.LightLoop tilePassLightLoop
226226
TextureCache2D m_CookieTexArray;
227227
TextureCacheCubemap m_CubeCookieTexArray;
228228

229-
private void OnEnable()
229+
private void OnValidate()
230230
{
231-
// TODO: Design workaround for OnValidate being missing on ScriptableObject
232231
m_Dirty = true;
233-
Rebuild();
234-
}
235-
236-
private void OnDisable()
237-
{
238-
// TODO: Rework ScriptableRenderLoop Lifecycle
239-
//CleanUp();
240232
}
241233

242234
public override void Rebuild()
@@ -314,7 +306,7 @@ public override void Initialize()
314306
Rebuild();
315307
}
316308

317-
public override void CleanUp()
309+
public override void Cleanup()
318310
{
319311
m_LitRenderLoop.OnDisable();
320312
m_SinglePassLightLoop.OnDisable();

Assets/ScriptableRenderLoop/fptl/FptlLighting.cs

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
namespace UnityEngine.Experimental.ScriptableRenderLoop
77
{
88
[ExecuteInEditMode]
9-
public class FptlLighting : ScriptableRenderLoop
9+
public class FptlLighting : RenderPipeline
1010
{
1111
#if UNITY_EDITOR
1212
[UnityEditor.MenuItem("Renderloop/CreateRenderLoopFPTL")]
@@ -113,23 +113,17 @@ static void CreateRenderLoopFPTL()
113113
private Texture2D m_LightAttentuationTexture;
114114
private int m_shadowBufferID;
115115

116-
public override void Initialize()
116+
private void OnValidate()
117117
{
118118
Rebuild();
119119
}
120120

121-
private void OnEnable()
121+
public override void Initialize()
122122
{
123123
Rebuild();
124124
}
125125

126-
private void OnDisable()
127-
{
128-
// TODO: Rework ScriptableRenderLoop Lifecycle
129-
//CleanUp();
130-
}
131-
132-
public override void CleanUp()
126+
public override void Cleanup()
133127
{
134128
// RenderLoop.renderLoopDelegate -= ExecuteRenderLoop;
135129
if (m_DeferredMaterial) DestroyImmediate(m_DeferredMaterial);

0 commit comments

Comments
 (0)