summaryrefslogtreecommitdiff
path: root/assets/shaders/triangle.metal
blob: 6522360ed3cf9b1ee2b5bd8dcc41c7ed8940ea09 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include <metal_stdlib>
using namespace metal;

vertex float4
vertexShader(uint vertexID [[vertex_id]],
             constant simd::float3* vertexPositions)
{
    float4 vertexOutPositions = float4(vertexPositions[vertexID][0],
                                       vertexPositions[vertexID][1],
                                       vertexPositions[vertexID][2],
                                       1.0f);
    return vertexOutPositions;
}

fragment float4 fragmentShader(float4 vertexOutPositions [[stage_in]]) {
    return float4(182.0f/255.0f, 240.0f/255.0f, 228.0f/255.0f, 1.0f);
}