Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //
- // Shaders.metal
- // engine
- //
- // Created by Vilem Otte on 09.05.2022.
- //
- #include <metal_stdlib>
- using namespace metal;
- struct VertexIn {
- float3 position;
- float4 color;
- };
- struct VertexOut {
- float4 position [[ position ]];
- float4 color;
- };
- vertex VertexOut basic_vertex_function(const device VertexIn* vertices [[ buffer(0) ]],
- uint vertexID [[ vertex_id ]]) {
- VertexOut out;
- out.position = float4(vertices[vertexID].position, 1.0);
- out.color = vertices[vertexID].color;
- return out;
- }
- fragment float4 basic_fragment_function(VertexOut in [[ stage_in ]]) {
- return in.color;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement