浏览代码

Fix forward pass (wip, state aren't plugged)

/scriptablerenderloop-materialgraph
Paul Demeulenaere 8 年前
当前提交
68c59d86
共有 1 个文件被更改,包括 58 次插入6 次删除
  1. 64
      Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/Lit/Lit.template

64
Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/Lit/Lit.template


// ------------------------------------------------------------------
// Debug pass
// ------------------------------------------------------------------
//TODO
Pass
{
Name "Debug"
Tags{ "LightMode" = "DebugViewMaterial" }
Cull[_CullMode]
HLSLPROGRAM
#pragma vertex VertDefault
#pragma fragment Frag
#define SHADERPASS SHADERPASS_DEBUG_VIEW_MATERIAL
#include "Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/Material.hlsl"
//Generated code : Begin
#{LitTemplate|useDataInput:{.*}|needFragInput:{.*}}
void GetVaryingsDataDebug(uint paramId, FragInput input, inout float3 result, inout bool needLinearToSRGB)
{
result = float3(1,0,1); //TODO
}
//Generated code : End
#include "Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/ShaderPass/ShaderPassDebugViewMaterial.hlsl"
ENDHLSL
}
// ------------------------------------------------------------------
// Extracts information for lightmapping, GI (emission, albedo, ...)

// ------------------------------------------------------------------
// Depth only
// ------------------------------------------------------------------
//TODO
Pass
{
Name "ShadowCaster"
Tags{ "LightMode" = "ShadowCaster" }
Cull[_CullMode]
ZWrite On ZTest LEqual
HLSLPROGRAM
#pragma vertex VertDefault
#pragma fragment Frag
#define SHADERPASS SHADERPASS_DEPTH_ONLY
#include "Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/Material.hlsl"
//Generated code : Begin
#{LitTemplate|useDataInput:{opacity}|needFragInput:{}}
//Generated code : End
#include "Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/ShaderPass/ShaderPassDepthOnly.hlsl"
ENDHLSL
}
// ------------------------------------------------------------------
// forward pass

Name "Forward" // Name is not used
Tags{ "LightMode" = "Forward" } // This will be only for transparent object based on the RenderQueue index
Blend[_SrcBlend][_DstBlend]
ZWrite[_ZWrite]
Cull[_CullMode]
//TODO
//Blend[_SrcBlend][_DstBlend]
//ZWrite[_ZWrite]
//Cull[_CullMode]
HLSLPROGRAM

// TEMP until pragma work in include
// #include "../../Lighting/Forward.hlsl"
#pragma multi_compile LIGHTLOOP_SINGLE_PASS
#pragma multi_compile SHADOWFILTERING_FIXED_SIZE_PCF
//#pragma multi_compile SHADOWFILTERING_FIXED_SIZE_PCF
#include "Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Lighting/Lighting.hlsl"

正在加载...
取消
保存