51 lines
943 B
HLSL
51 lines
943 B
HLSL
struct VSInput // vertex shader bemeneti struktúra
|
|
{
|
|
float3 position_D : POSITION;
|
|
float3 normal : NORMAL;
|
|
};
|
|
|
|
struct VSOutput // vertex shader kimeneti struktúra
|
|
{
|
|
float4 position_H : SV_Position;
|
|
float3 color : COLOR;
|
|
};
|
|
|
|
cbuffer CFrame : register(b0)
|
|
{
|
|
float4x4 transformMatrix;
|
|
float4x4 viewMatrix;
|
|
float4x4 projMatrix;
|
|
};
|
|
cbuffer CEntity : register(b1)
|
|
{
|
|
float4x4 worldMatrix;
|
|
float4 color;
|
|
}
|
|
|
|
VSOutput vs_main(VSInput input)
|
|
{
|
|
VSOutput output; // vertex shader kimenete
|
|
|
|
output.position_H = mul(float4(input.position_D, 1.0), mul(worldMatrix, mul(viewMatrix, projMatrix)));
|
|
output.color = color;
|
|
|
|
// TODO fények
|
|
|
|
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;
|
|
}
|