Files
prosperon/shaders/msl/sprite2d.frag.msl
2025-12-22 16:21:21 -06:00

18 lines
346 B
Plaintext

#include <metal_stdlib>
using namespace metal;
struct FragmentIn {
float4 position [[position]];
float2 uv;
float4 color;
};
fragment float4 fragment_main(
FragmentIn in [[stage_in]],
texture2d<float> tex [[texture(0)]],
sampler samp [[sampler(0)]]
) {
float4 tex_color = tex.sample(samp, in.uv);
return tex_color * in.color;
}