42 lines
762 B
HLSL
42 lines
762 B
HLSL
struct VSInput // vertex shader bemeneti struktúra
|
|
{
|
|
float3 position_D : POSITION;
|
|
float3 color : COLOR;
|
|
};
|
|
|
|
struct VSOutput // vertex shader kimeneti struktúra
|
|
{
|
|
float4 position_H : SV_Position;
|
|
float3 color : COLOR;
|
|
};
|
|
|
|
cbuffer CBuf : register(b0)
|
|
{
|
|
float4x4 transformMatrix;
|
|
};
|
|
|
|
VSOutput vs_main(VSInput input)
|
|
{
|
|
VSOutput output; // vertex shader kimenete
|
|
|
|
output.position_H = mul(transformMatrix, float4(input.position_D, 1.0));
|
|
output.color = input.color;
|
|
|
|
return output;
|
|
}
|
|
|
|
struct PSOutput
|
|
{
|
|
float4 color : SV_Target;
|
|
};
|
|
|
|
PSOutput ps_main(VSOutput input)
|
|
{
|
|
PSOutput output;
|
|
|
|
//output.color = float4(0.0f, 1.0f, 0.0f, 1.0f);
|
|
output.color = float4(input.color, 1.0f);
|
|
|
|
return output;
|
|
}
|