1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include <metal_stdlib>
using namespace metal;
struct _shade_Input {
float4 __luma_frag_coord [[position]];
bool __luma_frag_front_facing [[front_facing]];
};
struct _shade_Output {
float4 color [[user(locn0)]];
};
fragment _shade_Output shade(_shade_Input input [[stage_in]]) {
_shade_Output __luma_output;
float2 coord = input.__luma_frag_coord.xy;
bool facing = input.__luma_frag_front_facing;
float face = select(0.25, 1.0, facing);
__luma_output.color = float4((coord.x * 0.0), (coord.y * 0.0), face, 1.0);
return __luma_output;
}