blob: b3b418cab3f4969a37fe5ba55e58e05e3391b778 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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;
}
|