Implemented loading shaders from file.
This commit is contained in:
12
assets/shaders/hlsl/green.ps
Normal file
12
assets/shaders/hlsl/green.ps
Normal file
@@ -0,0 +1,12 @@
|
||||
|
||||
struct PS_OUTPUT
|
||||
{
|
||||
float4 color : COLOR0;
|
||||
};
|
||||
|
||||
PS_OUTPUT main() : SV_TARGET
|
||||
{
|
||||
PS_OUTPUT output;
|
||||
output.color = float4(0.0, 1.0, 0.0, 1.0);
|
||||
return output;
|
||||
}
|
||||
19
assets/shaders/hlsl/triangle.vs
Normal file
19
assets/shaders/hlsl/triangle.vs
Normal file
@@ -0,0 +1,19 @@
|
||||
|
||||
struct VS_OUTPUT
|
||||
{
|
||||
float4 vPosition : POSITION;
|
||||
};
|
||||
|
||||
static const float2 vertices[3] =
|
||||
{
|
||||
float2(-0.5, 0.5),
|
||||
float2( 0.5, 0.5),
|
||||
float2( 0.0, -0.5)
|
||||
};
|
||||
|
||||
VS_OUTPUT main(uint vertexID : SV_VertexID)
|
||||
{
|
||||
VS_OUTPUT output;
|
||||
output.vPosition = float4(vertices[vertexID], 0.0, 1.0);
|
||||
return output;
|
||||
}
|
||||
Reference in New Issue
Block a user