浏览代码

Add Shadow / depth passes to lightweight unlit master node.

/main
Tim Cooper 7 年前
当前提交
3b150ad9
共有 3 个文件被更改,包括 61 次插入0 次删除
  1. 5
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/LightweightPipeline/LightWeightUnlitSubShader.cs
  2. 49
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Templates/lightweightUnlitExtraPasses.template
  3. 7
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Templates/lightweightUnlitExtraPasses.template.meta

5
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/LightweightPipeline/LightWeightUnlitSubShader.cs


materialOptions),
true);
var extraPassesTemplateLocation = ShaderGenerator.GetTemplatePath("lightweightUnlitExtraPasses.template");
if (File.Exists(extraPassesTemplateLocation))
subShader.AddShaderChunk(File.ReadAllText(extraPassesTemplateLocation), true);
subShader.Deindent();
subShader.AddShaderChunk("}", true);

49
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Templates/lightweightUnlitExtraPasses.template


Pass
{
Tags{"LightMode" = "ShadowCaster"}
ZWrite On ZTest LEqual
HLSLPROGRAM
// Required to compile gles 2.0 with standard srp library
#pragma prefer_hlslcc gles
#pragma target 2.0
//--------------------------------------
// GPU Instancing
#pragma multi_compile_instancing
#pragma vertex ShadowPassVertex
#pragma fragment ShadowPassFragment
#include "LWRP/ShaderLibrary/LightweightPassShadow.hlsl"
ENDHLSL
}
Pass
{
Tags{"LightMode" = "DepthOnly"}
ZWrite On
ColorMask 0
HLSLPROGRAM
// Required to compile gles 2.0 with standard srp library
#pragma prefer_hlslcc gles
#pragma target 2.0
#pragma vertex vert
#pragma fragment frag
#include "LWRP/ShaderLibrary/Core.hlsl"
float4 vert(float4 pos : POSITION) : SV_POSITION
{
return TransformObjectToHClip(pos.xyz);
}
half4 frag() : SV_TARGET
{
return 0;
}
ENDHLSL
}

7
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Templates/lightweightUnlitExtraPasses.template.meta


fileFormatVersion: 2
guid: 0474c29971caa2a40ae1719012fbe90a
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
正在加载...
取消
保存