Created
May 9, 2018 17:20
-
-
Save rtroe/c112c848a89bb3743aa32b5d431ee7f6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#if OPENGL | |
#define SV_POSITION POSITION | |
#define VS_SHADERMODEL vs_3_0 | |
#define PS_SHADERMODEL ps_3_0 | |
#else | |
#define VS_SHADERMODEL vs_4_0_level_9_1 | |
#define PS_SHADERMODEL ps_4_0_level_9_1 | |
#endif | |
matrix WorldViewProjection; | |
struct VertexShaderInput | |
{ | |
float4 Position : POSITION0; | |
float4 Color : COLOR0; | |
}; | |
struct VertexShaderOutput | |
{ | |
float4 Position : SV_POSITION; | |
float4 Color : COLOR0; | |
}; | |
VertexShaderOutput MainVS(in VertexShaderInput input) | |
{ | |
VertexShaderOutput output = (VertexShaderOutput)0; | |
output.Position = mul(input.Position, WorldViewProjection); | |
output.Color = input.Color; | |
return output; | |
} | |
float4 MainPS(VertexShaderOutput input) : COLOR | |
{ | |
return input.Color; | |
} | |
technique BasicColorDrawing | |
{ | |
pass P0 | |
{ | |
VertexShader = compile VS_SHADERMODEL MainVS(); | |
PixelShader = compile PS_SHADERMODEL MainPS(); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment