Skip to content

which project template has used for this project? #3

@MuhammadFaizanKhan

Description

@MuhammadFaizanKhan

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

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions