-
Notifications
You must be signed in to change notification settings - Fork 0
/
Shader
45 lines (35 loc) · 906 Bytes
/
Shader
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
41
42
43
44
#include "resources/Hlgfx/Shaders/Common/Macros.hlsl"
#include "resources/Hlgfx/Shaders/Common/Bindings.h"
struct PSInput
{
vec4 Position : SV_POSITION;
};
cbuffer Camera : register(b0)
{
float FOV;
float AspectRatio;
float NearClip;
float FarClip;
mat4 ProjectionMatrix;
mat4 ViewMatrix;
mat4 ViewProjectionMatrix;
vec4 CameraPosition;
};
cbuffer Model : register(b1)
{
mat4 ModelMatrix;
mat4 NormalMatrix;
};
PSInput VSMain(vec4 PositionUvX : POSITION0, vec4 NormalUvY : POSITION1, vec4 Tangent : POSITION2)
{
PSInput Output;
mat4 ModelViewProjection = mul(ViewProjectionMatrix , ModelMatrix);
vec4 OutPosition = mul(ModelViewProjection, vec4(PositionUvX.xyz, 1.0));
Output.Position = OutPosition;
return Output;
}
vec4 PSMain(PSInput Input) : SV_TARGET
{
vec4 OutputColor = vec4(1,0,0,0);
return OutputColor;
}