Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

which project template has used for this project? #3

Open
MuhammadFaizanKhan opened this issue Oct 30, 2018 · 0 comments
Open

which project template has used for this project? #3

MuhammadFaizanKhan opened this issue Oct 30, 2018 · 0 comments

Comments

@MuhammadFaizanKhan
Copy link

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 MuhammadFaizanKhan changed the title which project tempate has used for this project? which project template has used for this project? Oct 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant