浏览代码

update github project to reflect refactored SRL changes in engine code.

/main
Felipe Lira 8 年前
当前提交
65f8427b
共有 4 个文件被更改,包括 8 次插入9 次删除
  1. 3
      Assets/BasicRenderLoopTutorial/BasicRenderLoop.cs
  2. 6
      Assets/Editor/Tests/RenderloopTests/RenderloopTestFixture.cs
  3. 4
      Assets/ScriptableRenderLoop/HDRenderLoop/HDRenderLoop.cs
  4. 4
      Assets/ScriptableRenderLoop/fptl/FptlLighting.cs

3
Assets/BasicRenderLoopTutorial/BasicRenderLoop.cs


using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Experimental.Rendering;
using UnityEngine.Experimental.ScriptableRenderLoop;
// Very basic scriptable rendering loop example:
// - Use with BasicRenderLoopShader.shader (the loop expects "BasicPass" pass type to exist)

// - This loop also does not setup lightmaps, light probes, reflection probes or light cookies
[ExecuteInEditMode]
public class BasicRenderLoop : ScriptableRenderLoop
public class BasicRenderLoop : RenderPipeline
{
#if UNITY_EDITOR

6
Assets/Editor/Tests/RenderloopTests/RenderloopTestFixture.cs


using UnityEngine.Rendering;
[ExecuteInEditMode]
public class RenderLoopTestFixture : ScriptableRenderLoop
public class RenderLoopTestFixture : RenderPipeline
{
public delegate void TestDelegate(Camera camera, CullResults cullResults, RenderLoop renderLoop);
private static TestDelegate s_Callback;

var sceneCamera = Camera.main;
var camObject = sceneCamera.gameObject;
GraphicsSettings.SetScriptableRenderLoop(m_Instance);
GraphicsSettings.SetRenderPipeline(m_Instance);
s_Callback = renderCallback;
Transform t = camObject.transform;

SceneView.lastActiveSceneView.LookAtDirect(t.position + t.forward * camDist, t.rotation, size);
sceneCamera.Render();
GraphicsSettings.SetScriptableRenderLoop(null);
GraphicsSettings.SetRenderPipeline(null);
}
}

4
Assets/ScriptableRenderLoop/HDRenderLoop/HDRenderLoop.cs


{
[ExecuteInEditMode]
// This HDRenderLoop assume linear lighting. Don't work with gamma.
public partial class HDRenderLoop : ScriptableRenderLoop
public partial class HDRenderLoop : RenderPipeline
{
const string k_HDRenderLoopPath = "Assets/ScriptableRenderLoop/HDRenderLoop/HDRenderLoop.asset";

Rebuild();
}
public override void CleanUp()
public override void Cleanup()
{
m_LitRenderLoop.OnDisable();
m_SinglePassLightLoop.OnDisable();

4
Assets/ScriptableRenderLoop/fptl/FptlLighting.cs


namespace UnityEngine.Experimental.ScriptableRenderLoop
{
[ExecuteInEditMode]
public class FptlLighting : ScriptableRenderLoop
public class FptlLighting : RenderPipeline
{
#if UNITY_EDITOR
[UnityEditor.MenuItem("Renderloop/CreateRenderLoopFPTL")]

//CleanUp();
}
public override void CleanUp()
public override void Cleanup()
{
// RenderLoop.renderLoopDelegate -= ExecuteRenderLoop;
if (m_DeferredMaterial) DestroyImmediate(m_DeferredMaterial);

正在加载...
取消
保存