parent
8e98d10f74
commit
8c376121c3
16 changed files with 46 additions and 16 deletions
|
|
@ -14,7 +14,9 @@ struct UBO
|
|||
float4x4 view;
|
||||
float4x4 model;
|
||||
float4x4 lightSpace;
|
||||
float3 lightPos;
|
||||
float4 lightPos;
|
||||
float zNear;
|
||||
float zFar;
|
||||
};
|
||||
|
||||
cbuffer ubo : register(b0) { UBO ubo; }
|
||||
|
|
@ -45,7 +47,7 @@ VSOutput main(VSInput input)
|
|||
|
||||
float4 pos = mul(ubo.model, float4(input.Pos, 1.0));
|
||||
output.Normal = mul((float3x3)ubo.model, input.Normal);
|
||||
output.LightVec = normalize(ubo.lightPos - input.Pos);
|
||||
output.LightVec = normalize(ubo.lightPos.xyz - input.Pos);
|
||||
output.ViewVec = -pos.xyz;
|
||||
|
||||
output.ShadowCoord = mul(biasMat, mul(ubo.lightSpace, mul(ubo.model, float4(input.Pos, 1.0))));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue