24 lines
407 B
Plaintext
24 lines
407 B
Plaintext
p :: properties {
|
|
texture : Texture2D;
|
|
sampler : Sampler;
|
|
}
|
|
|
|
PS_Input :: struct {
|
|
uv : float2 @uv;
|
|
pos : float4 @position;
|
|
}
|
|
|
|
vertex main :: (pos : float4 @position, uv : float2 @uv) -> PS_Input {
|
|
result : PS_Input;
|
|
|
|
result.uv = uv;
|
|
result.pos = pos;
|
|
|
|
return result;
|
|
}
|
|
|
|
pixel main :: (input : PS_Input) -> float4 @target {
|
|
color : float4 = sample(p.texture, input.uv, p.sampler);
|
|
return color;
|
|
}
|