-
Notifications
You must be signed in to change notification settings - Fork 109
Open
Description
I am following SRP overview tutorial which directs me to this github repo. I don't want to use this project and want to write all the tut code, please tell me which unity template you have used for this? I tried
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Experimental.Rendering;
using UnityEngine.Rendering;
public class BasicAssetPipe : RenderPipelineAsset {
public Color clearColour = Color.green;
#if UNITY_EDITOR
[UnityEditor.MenuItem("SRP-Demo/01 - Create Basic Asset Pipeline")]
static void CreateBasicAssetPipeline() {
var instance = ScriptableObject.CreateInstance<BasicAssetPipe>();
UnityEditor.AssetDatabase.CreateAsset(instance, "Assets/1-BasicAssetPipe.asset");
}
#endif
protected override IRenderPipeline InternalCreatePipeline()
{
// throw new System.NotImplementedException();
return new CustomBuildPipeline(clearColour);
}
}
public class CustomBuildPipeline : RenderPipeline
{
private Color m_clearColour = Color.black;
public CustomBuildPipeline(Color c)
{
m_clearColour = c;
}
public override void Render(ScriptableRenderContext renderContext, Camera[] cameras)
{
base.Render(renderContext, cameras);
var cmd = new CommandBuffer();
cmd.ClearRenderTarget(true, true, m_clearColour);
renderContext.ExecuteCommandBuffer(cmd);
cmd.Release();
renderContext.Submit();
}
}
above code in template 3D but it didn't do anything?
Metadata
Metadata
Assignees
Labels
No labels