SRPBlog icon indicating copy to clipboard operation
SRPBlog copied to clipboard

which project template has used for this project?

Open MuhammadFaizanKhan opened this issue 7 years ago • 0 comments

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?

MuhammadFaizanKhan avatar Oct 30 '18 06:10 MuhammadFaizanKhan