Source

infoh503_starterkit / media / shaders / green.cg

Full commit
// Data structs ---------------------------------------------------------------
struct AppData
{
    float2 position : POSITION;
};
//-----------------------------------------------------------------------------
struct VertexOutput 
{
    float4 position : POSITION;
    float4 color : COLOR;
};
//-----------------------------------------------------------------------------
struct FragmentInput 
{
    float4 color : COLOR;
};
//-----------------------------------------------------------------------------
struct FragmentOutput 
{
    float4 color : COLOR;
};


// Entry points ---------------------------------------------------------------
VertexOutput main_vp(AppData IN)
{
    VertexOutput OUT;
    OUT.position = float4(IN.position.xy, 0, 1);
    OUT.color = float4(0.0f, 1.0f, 0.0f ,1.0f);
    
    return OUT;
}
//-----------------------------------------------------------------------------
FragmentOutput main_fp(FragmentInput IN)
{
    FragmentOutput OUT;
    OUT.color = IN.color;
    return OUT;
}
//-----------------------------------------------------------------------------