浏览代码

Fix paths and imports for HD sub-shader

/main
Peter Bay Bastian 7 年前
当前提交
0780c903
共有 5 个文件被更改,包括 15 次插入10 次删除
  1. 8
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/ShaderGraph/HDPBRSubShader.cs
  2. 4
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/ShaderGraph/HDSubShaderUtilities.cs
  3. 5
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/ShaderGraph/HDUnlitSubShader.cs
  4. 3
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/com.unity.render-pipelines.high-definition.Editor.asmdef
  5. 5
      ScriptableRenderPipeline/HDRenderPipeline/sub-package.json

8
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/ShaderGraph/HDPBRSubShader.cs


using System.IO;
using System.Linq;
using UnityEditor.Graphing;
using UnityEditor.ShaderGraph;
namespace UnityEditor.ShaderGraph
namespace UnityEditor.Experimental.Rendering.HDPipeline
{
public class HDPBRSubShader : IPBRSubShader
{

private static bool GenerateShaderPass(PBRMasterNode masterNode, Pass pass, GenerationMode mode, SurfaceMaterialOptions materialOptions, ShaderGenerator result)
{
var templateLocation = ShaderGenerator.GetTemplatePath(pass.TemplateName);
var templateLocation = Path.Combine(Path.Combine(Path.Combine(HDEditorUtils.GetHDRenderPipelinePath(), "Editor"), "ShaderGraph"), pass.TemplateName);
if (!File.Exists(templateLocation))
{
// TODO: produce error here

return subShader.GetShaderString(0);
}
}
}
}

4
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/ShaderGraph/HDSubShaderUtilities.cs


using UnityEngine; // Vector3,4
using UnityEditor.ShaderGraph;
namespace UnityEditor.ShaderGraph
namespace UnityEditor.Experimental.Rendering.HDPipeline
{
public static class HDRPShaderStructs
{

return materialOptions;
}
}
}
}

5
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/ShaderGraph/HDUnlitSubShader.cs


using System.IO;
using System.Linq;
using UnityEditor.Graphing;
using UnityEditor.ShaderGraph;
namespace UnityEditor.ShaderGraph
namespace UnityEditor.Experimental.Rendering.HDPipeline
{
// [Serializable] ??
public class HDUnlitSubShader : IUnlitSubShader

return subShader.GetShaderString(0);
}
}
}
}

3
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/com.unity.render-pipelines.high-definition.Editor.asmdef


"com.unity.render-pipelines.core.Editor",
"com.unity.render-pipelines.high-definition.Runtime",
"com.unity.postprocessing.Runtime",
"com.unity.postprocessing.Editor"
"com.unity.postprocessing.Editor",
"Unity.ShaderGraph.Editor"
],
"optionalUnityReferences": [],
"includePlatforms": [

5
ScriptableRenderPipeline/HDRenderPipeline/sub-package.json


"description": "HD Render Pipeline for Unity.",
"subDependencies": [
"com.unity.render-pipelines.core"
]
],
"dependencies": {
"com.unity.shadergraph": "0.1.19"
}
}
正在加载...
取消
保存