File tree Expand file tree Collapse file tree 4 files changed +11
-26
lines changed
Editor/Tests/RenderloopTests Expand file tree Collapse file tree 4 files changed +11
-26
lines changed Original file line number Diff line number Diff line change 1
1
using UnityEngine ;
2
2
using UnityEngine . Rendering ;
3
3
using UnityEngine . Experimental . Rendering ;
4
- using UnityEngine . Experimental . ScriptableRenderLoop ;
5
4
6
5
// Very basic scriptable rendering loop example:
7
6
// - Use with BasicRenderLoopShader.shader (the loop expects "BasicPass" pass type to exist)
11
10
// - This loop also does not setup lightmaps, light probes, reflection probes or light cookies
12
11
13
12
[ ExecuteInEditMode ]
14
- public class BasicRenderLoop : ScriptableRenderLoop
13
+ public class BasicRenderLoop : RenderPipeline
15
14
{
16
15
17
16
#if UNITY_EDITOR
Original file line number Diff line number Diff line change 8
8
using UnityEngine . Rendering ;
9
9
10
10
[ ExecuteInEditMode ]
11
- public class RenderLoopTestFixture : ScriptableRenderLoop
11
+ public class RenderLoopTestFixture : RenderPipeline
12
12
{
13
13
public delegate void TestDelegate ( Camera camera , CullResults cullResults , RenderLoop renderLoop ) ;
14
14
private static TestDelegate s_Callback ;
@@ -42,7 +42,7 @@ public static void Run(TestDelegate renderCallback)
42
42
var sceneCamera = Camera . main ;
43
43
var camObject = sceneCamera . gameObject ;
44
44
45
- GraphicsSettings . SetScriptableRenderLoop ( m_Instance ) ;
45
+ GraphicsSettings . SetRenderPipeline ( m_Instance ) ;
46
46
s_Callback = renderCallback ;
47
47
Transform t = camObject . transform ;
48
48
@@ -53,6 +53,6 @@ public static void Run(TestDelegate renderCallback)
53
53
SceneView . lastActiveSceneView . LookAtDirect ( t . position + t . forward * camDist , t . rotation , size ) ;
54
54
55
55
sceneCamera . Render ( ) ;
56
- GraphicsSettings . SetScriptableRenderLoop ( null ) ;
56
+ GraphicsSettings . SetRenderPipeline ( null ) ;
57
57
}
58
58
}
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ namespace UnityEngine.Experimental.ScriptableRenderLoop
7
7
{
8
8
[ ExecuteInEditMode ]
9
9
// This HDRenderLoop assume linear lighting. Don't work with gamma.
10
- public partial class HDRenderLoop : ScriptableRenderLoop
10
+ public partial class HDRenderLoop : RenderPipeline
11
11
{
12
12
const string k_HDRenderLoopPath = "Assets/ScriptableRenderLoop/HDRenderLoop/HDRenderLoop.asset" ;
13
13
@@ -226,17 +226,9 @@ public TilePass.LightLoop tilePassLightLoop
226
226
TextureCache2D m_CookieTexArray ;
227
227
TextureCacheCubemap m_CubeCookieTexArray ;
228
228
229
- private void OnEnable ( )
229
+ private void OnValidate ( )
230
230
{
231
- // TODO: Design workaround for OnValidate being missing on ScriptableObject
232
231
m_Dirty = true ;
233
- Rebuild ( ) ;
234
- }
235
-
236
- private void OnDisable ( )
237
- {
238
- // TODO: Rework ScriptableRenderLoop Lifecycle
239
- //CleanUp();
240
232
}
241
233
242
234
public override void Rebuild ( )
@@ -314,7 +306,7 @@ public override void Initialize()
314
306
Rebuild ( ) ;
315
307
}
316
308
317
- public override void CleanUp ( )
309
+ public override void Cleanup ( )
318
310
{
319
311
m_LitRenderLoop . OnDisable ( ) ;
320
312
m_SinglePassLightLoop . OnDisable ( ) ;
Original file line number Diff line number Diff line change 6
6
namespace UnityEngine . Experimental . ScriptableRenderLoop
7
7
{
8
8
[ ExecuteInEditMode ]
9
- public class FptlLighting : ScriptableRenderLoop
9
+ public class FptlLighting : RenderPipeline
10
10
{
11
11
#if UNITY_EDITOR
12
12
[ UnityEditor . MenuItem ( "Renderloop/CreateRenderLoopFPTL" ) ]
@@ -113,23 +113,17 @@ static void CreateRenderLoopFPTL()
113
113
private Texture2D m_LightAttentuationTexture ;
114
114
private int m_shadowBufferID ;
115
115
116
- public override void Initialize ( )
116
+ private void OnValidate ( )
117
117
{
118
118
Rebuild ( ) ;
119
119
}
120
120
121
- private void OnEnable ( )
121
+ public override void Initialize ( )
122
122
{
123
123
Rebuild ( ) ;
124
124
}
125
125
126
- private void OnDisable ( )
127
- {
128
- // TODO: Rework ScriptableRenderLoop Lifecycle
129
- //CleanUp();
130
- }
131
-
132
- public override void CleanUp ( )
126
+ public override void Cleanup ( )
133
127
{
134
128
// RenderLoop.renderLoopDelegate -= ExecuteRenderLoop;
135
129
if ( m_DeferredMaterial ) DestroyImmediate ( m_DeferredMaterial ) ;
You can’t perform that action at this time.
0 commit comments