• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#include <metal_stdlib>
2#include <simd/simd.h>
3using namespace metal;
4struct Uniforms {
5    float a;
6    float b;
7    float c;
8    float4 d;
9    float4 e;
10};
11struct Inputs {
12};
13struct Outputs {
14    float4 sk_FragColor [[color(0)]];
15};
16
17fragment Outputs fragmentMain(Inputs _in [[stage_in]], constant Uniforms& _uniforms [[buffer(0)]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
18    Outputs _out;
19    (void)_out;
20    _out.sk_FragColor.x = (refract(float2(_uniforms.a, 0), float2(_uniforms.b, 0), _uniforms.c).x);
21    _out.sk_FragColor = refract(_uniforms.d, _uniforms.e, _uniforms.c);
22    return _out;
23}
24