浏览代码

Added SSAO Debug View to Pipeline

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

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


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

3
ScriptableRenderPipeline/LightweightPipeline/LWRP/LightweightPipeline.cs


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

4
ScriptableRenderPipeline/LightweightPipeline/LWRP/LightweightShaderUtils.cs


METALNESS,
NORMALS,
SMOOTHNESS,
OCCLUSION,
NUM_VIEWS
}

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

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


debug = sqrt(inputData.normalWS);
#elif defined(_DEBUG_SMOOTHNESS)
debug = surfaceData.smoothness;
#elif defined(_DEBUG_OCCLUSION)
ApplySSAO(surfaceData.occlusion, IN.shadowCoord);
debug = surfaceData.occlusion;
#endif
return half4(debug, 1);
}

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


// GPU Instancing
#pragma multi_compile_instancing
#pragma multi_compile _ _DEBUG_ALBEDO _DEBUG_METALNESS _DEBUG_NORMALS _DEBUG_SMOOTHNESS
#pragma multi_compile _ _DEBUG_ALBEDO _DEBUG_METALNESS _DEBUG_NORMALS _DEBUG_SMOOTHNESS _DEBUG_OCCLUSION
//#include "LWRP/ShaderLibrary/LightweightPassDebug.hlsl"
#include "LWRP/ShaderLibrary/LightweightPassLit.hlsl"
ENDHLSL
}

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
#pragma multi_compile _ _DEBUG_ALBEDO _DEBUG_METALNESS _DEBUG_NORMALS _DEBUG_SMOOTHNESS _DEBUG_OCCLUSION
#pragma vertex LitPassVertex
#pragma fragment DebugPassFragment

正在加载...
取消
保存