44 lines
836 B
HLSL
44 lines
836 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;
|
|
float4x4 viewMatrix;
|
|
float4x4 projMatrix;
|
|
};
|
|
|
|
VSOutput vs_main(VSInput input)
|
|
{
|
|
VSOutput output; // vertex shader kimenete
|
|
|
|
output.position_H = mul(float4(input.position_D, 1.0), mul(viewMatrix, projMatrix));
|
|
output.color = float3(1.0, 1.0, 1.0);
|
|
|
|
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;
|
|
}
|