#include "common.hlsl" struct input { float2 pos : pos; // given as world float2 uv : uv; // always a quad float4 color : color; }; // Output structure from the vertex shader to the pixel shader struct output { float4 pos : SV_Position; // Clip-space position float2 uv : TEXCOORD0; // Texture coordinates float4 color : COLOR0; // Interpolated vertex color }; cbuffer model : register(b1, space1) { float4x4 model; float4 color; }; output main(input i) { output o; float4 worldpos = mul(model, float4(i.pos,0,1)); o.pos = mul(world_to_projection, worldpos); o.uv = i.uv; o.color = i.color * color; return o; }