浏览代码

Add two sided support for shadow pass

/main
Matt Dean 7 年前
当前提交
de80e921
共有 4 个文件被更改,包括 12 次插入3 次删除
  1. 6
      com.unity.shadergraph/Editor/Data/LightweightPipeline/LightWeightPBRSubShader.cs
  2. 7
      com.unity.shadergraph/Editor/Data/LightweightPipeline/LightWeightUnlitSubShader.cs
  3. 1
      com.unity.shadergraph/Editor/Templates/lightweightPBRExtraPasses.template
  4. 1
      com.unity.shadergraph/Editor/Templates/lightweightUnlitExtraPasses.template

6
com.unity.shadergraph/Editor/Data/LightweightPipeline/LightWeightPBRSubShader.cs


var extraPassesTemplateLocation = ShaderGenerator.GetTemplatePath("lightweightPBRExtraPasses.template");
if (File.Exists(extraPassesTemplateLocation))
subShader.AddShaderChunk(File.ReadAllText(extraPassesTemplateLocation), true);
{
var extraPassesTemplate = File.ReadAllText(extraPassesTemplateLocation);
extraPassesTemplate = extraPassesTemplate.Replace("${Culling}", materialOptions.cullMode.ToString());
subShader.AddShaderChunk(extraPassesTemplate, true);
}
subShader.Deindent();
subShader.AddShaderChunk("}", true);

7
com.unity.shadergraph/Editor/Data/LightweightPipeline/LightWeightUnlitSubShader.cs


var extraPassesTemplateLocation = ShaderGenerator.GetTemplatePath("lightweightUnlitExtraPasses.template");
if (File.Exists(extraPassesTemplateLocation))
subShader.AddShaderChunk(File.ReadAllText(extraPassesTemplateLocation), true);
{
var extraPassesTemplate = File.ReadAllText(extraPassesTemplateLocation);
extraPassesTemplate = extraPassesTemplate.Replace("${Culling}", materialOptions.cullMode.ToString());
subShader.AddShaderChunk(extraPassesTemplate, true);
}
subShader.Deindent();
subShader.AddShaderChunk("}", true);

1
com.unity.shadergraph/Editor/Templates/lightweightPBRExtraPasses.template


ZWrite On
ZTest LEqual
Cull ${Culling}
HLSLPROGRAM
// Required to compile gles 2.0 with standard srp library

1
com.unity.shadergraph/Editor/Templates/lightweightUnlitExtraPasses.template


ZWrite On
ZTest LEqual
Cull ${Culling}
HLSLPROGRAM
// Required to compile gles 2.0 with standard srp library

正在加载...
取消
保存