diff options
| author | lbavoil <[email protected]> | 2016-03-25 13:01:54 +0100 |
|---|---|---|
| committer | lbavoil <[email protected]> | 2016-03-25 13:01:54 +0100 |
| commit | 99174e4e5fb4b7079da80b35a6dfd68f3fd56a1c (patch) | |
| tree | fbcd4260d6c953d569a887505336a1c3f202e10f /samples/D3D12/src/Viewer.hlsl | |
| download | hbaoplus-99174e4e5fb4b7079da80b35a6dfd68f3fd56a1c.tar.xz hbaoplus-99174e4e5fb4b7079da80b35a6dfd68f3fd56a1c.zip | |
GFSDK_HBAO+_distro_r3.0_cl20573789
Diffstat (limited to 'samples/D3D12/src/Viewer.hlsl')
| -rw-r--r-- | samples/D3D12/src/Viewer.hlsl | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/samples/D3D12/src/Viewer.hlsl b/samples/D3D12/src/Viewer.hlsl new file mode 100644 index 0000000..b3b418c --- /dev/null +++ b/samples/D3D12/src/Viewer.hlsl @@ -0,0 +1,40 @@ +struct VSIn +{ + float3 pos : POSITION; + float3 normal : NORMAL; +}; + +struct VSOut +{ + float4 pos : SV_POSITION; + float3 normal : TEXCOORD; +}; + +cbuffer Scene +{ + float4x4 worldViewProjMatrix; + float4x4 worldMatrix; +}; + +VSOut VSMain(VSIn vsIn) +{ + VSOut output; + output.pos = mul(float4(vsIn.pos.xyz, 1), worldViewProjMatrix); + output.normal = mul(vsIn.normal.xyz, (float3x3)(worldMatrix)); + return output; +} + +struct PSOutputDepthTextures +{ + float4 WorldNormal : SV_Target0; +}; + +PSOutputDepthTextures PSMain(VSOut vsOut) +{ + PSOutputDepthTextures OUT; + + float3 worldNormal = normalize(vsOut.normal); + OUT.WorldNormal = float4(worldNormal.xyz, 1.f); + + return OUT; +}
\ No newline at end of file |