Unity3D修改LWRP,HDRP的几项小问题及解决

最近在看Book of the Dead的demo,其中对HDPR进行修改以构建本身的SRP,因而本身尝试了下。。git

 

通常直接去Github下载对应unity版本的SRP工程:github

https://github.com/Unity-Technologies/ScriptableRenderPipeline函数

 

将com.unity.render-pipelines.core和你须要的管线放到统一目录中,它们对PostProcessing有依赖,也须要去github下载一份对应的版本。测试

下载好后在对应管线的Editor目录下有一个ShaderGraph的文件夹,若是用不到ShaderGraph能够直接删去(旧版本的demo也是删去的)。spa

注意Assembly Definition的连接可能有丢失,从新绑定一下便可。3d

目录以下:code

 

下面是重点,shader的连接此时会报错 failed to open source file: 'LWRP/...blog

 

 

本觉得2018版本的项目配置里能够配置shader的相对根位置,结果发现是在脚本里。。。。ip

这个也是Book of the Dead demo里的,因此想要了解管线推荐多看下那个demo。get

static class ShaderPathIncludeConfig
{
    [ShaderIncludePath]
    public static string[] ShaderPaths()
    {
        return new string[]
        {
            "Assets/LocalPipe/com.unity.render-pipelines.core",
            "Assets/LocalPipe/com.unity.render-pipelines.lightweight",
        };
    }
}

写一个Editor类,函数挂上ShaderIncludePath特性便可。

 

 

这样就能够使用并进行修改了,关掉skybox的绘制测试下,ok:

相关文章
相关标签/搜索