Skip to content

Commit

Permalink
Add model loading project
Browse files Browse the repository at this point in the history
  • Loading branch information
ArnavMehta3000 committed Aug 27, 2024
1 parent 54885c4 commit f6bba66
Show file tree
Hide file tree
Showing 8 changed files with 189,843 additions and 1 deletion.
18 changes: 18 additions & 0 deletions Samples/ModelLoading/Assets/DirectX/ModelLoadingPS.hlsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
struct PS_INPUT
{
float4 Position : SV_Position;
float3 Normal : NORMAL;
float3 Color : COLOR0;
};

struct PS_OUTPUT
{
float4 Color : SV_Target0;
};

PS_OUTPUT main(PS_INPUT input)
{
PS_OUTPUT output = (PS_OUTPUT)0;
output.Color = float4(input.Normal, 1.0);
return output;
}
35 changes: 35 additions & 0 deletions Samples/ModelLoading/Assets/DirectX/ModelLoadingVS.hlsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
cbuffer FrameData : register(b0)
{
matrix WorldMatrix;
matrix ViewMatrix;
matrix ProjMatrix;
};

struct VS_INPUT
{
float4 Position : POSITION;
float3 Normal : NORMAL;
float3 Color : COLOR0;
};

struct VS_OUTPUT
{
float4 Position : SV_Position;
float3 Normal : NORMAL;
float3 Color : COLOR0;
};

VS_OUTPUT main(VS_INPUT input)
{
VS_OUTPUT output = (VS_OUTPUT)0;

output.Position = input.Position;
output.Position = mul(output.Position, WorldMatrix);
output.Position = mul(output.Position, ViewMatrix);
output.Position = mul(output.Position, ProjMatrix);

output.Normal = input.Normal;
output.Color = input.Color;

return output;
}
Loading

0 comments on commit f6bba66

Please sign in to comment.