浏览代码

Added shadows debug view

/projects-TheLastStand
John Parsaie 6 年前
当前提交
bba8b22a
共有 6 个文件被更改,包括 12 次插入4 次删除
  1. 3
      ScriptableRenderPipeline/LightweightPipeline/LWRP/Data/LightweightPipelineAsset.cs
  2. 3
      ScriptableRenderPipeline/LightweightPipeline/LWRP/LightweightPipeline.cs
  3. 4
      ScriptableRenderPipeline/LightweightPipeline/LWRP/LightweightShaderUtils.cs
  4. 2
      ScriptableRenderPipeline/LightweightPipeline/LWRP/ShaderLibrary/LightweightPassLit.hlsl
  5. 2
      ScriptableRenderPipeline/LightweightPipeline/LWRP/Shaders/LightweightStandard.shader
  6. 2
      ScriptableRenderPipeline/LightweightPipeline/LWRP/Shaders/Subsurface/LightweightSubsurface.shader

3
ScriptableRenderPipeline/LightweightPipeline/LWRP/Data/LightweightPipelineAsset.cs


Normals,
Metallness,
Smoothness,
Occlusion
Occlusion,
Shadows
};
public class LightweightPipelineAsset : RenderPipelineAsset

3
ScriptableRenderPipeline/LightweightPipeline/LWRP/LightweightPipeline.cs


case DebugViewMode.Occlusion:
LightweightShaderUtils.SetDebugMode(cmd, DebugViewKeyword.OCCLUSION);
break;
case DebugViewMode.Shadows:
LightweightShaderUtils.SetDebugMode(cmd, DebugViewKeyword.SHADOWS);
break;
}
context.ExecuteCommandBuffer(cmd);
CommandBufferPool.Release(cmd);

4
ScriptableRenderPipeline/LightweightPipeline/LWRP/LightweightShaderUtils.cs


NORMALS,
SMOOTHNESS,
OCCLUSION,
SHADOWS,
NUM_VIEWS
}

"_DEBUG_METALNESS",
"_DEBUG_NORMALS",
"_DEBUG_SMOOTHNESS",
"_DEBUG_OCCLUSION"
"_DEBUG_OCCLUSION",
"_DEBUG_SHADOWS"
};
public static string GetShaderPath(ShaderPathID id)

2
ScriptableRenderPipeline/LightweightPipeline/LWRP/ShaderLibrary/LightweightPassLit.hlsl


#elif defined(_DEBUG_OCCLUSION)
ApplySSAO(surfaceData.occlusion, IN.shadowCoord);
debug = surfaceData.occlusion;
#elif defined(_DEBUG_SHADOWS)
debug = RealtimeShadowAttenuation(IN.shadowCoord);
#endif
return half4(debug, 1);
}

2
ScriptableRenderPipeline/LightweightPipeline/LWRP/Shaders/LightweightStandard.shader


// GPU Instancing
#pragma multi_compile_instancing
#pragma multi_compile _ _DEBUG_ALBEDO _DEBUG_METALNESS _DEBUG_NORMALS _DEBUG_SMOOTHNESS _DEBUG_OCCLUSION
#pragma multi_compile _ _DEBUG_ALBEDO _DEBUG_METALNESS _DEBUG_NORMALS _DEBUG_SMOOTHNESS _DEBUG_OCCLUSION _DEBUG_SHADOWS
#pragma vertex LitPassVertex
#pragma fragment DebugPassFragment

2
ScriptableRenderPipeline/LightweightPipeline/LWRP/Shaders/Subsurface/LightweightSubsurface.shader


// GPU Instancing
#pragma multi_compile_instancing
#pragma multi_compile _ _DEBUG_ALBEDO _DEBUG_METALNESS _DEBUG_NORMALS _DEBUG_SMOOTHNESS _DEBUG_OCCLUSION
#pragma multi_compile _ _DEBUG_ALBEDO _DEBUG_METALNESS _DEBUG_NORMALS _DEBUG_SMOOTHNESS _DEBUG_OCCLUSION _DEBUG_SHADOWS
#pragma vertex LitPassVertex
#pragma fragment DebugPassFragment

正在加载...
取消
保存