36 lines
766 B
C
36 lines
766 B
C
// ShaderTypes.h
|
|
// Shared between Metal shaders and Swift via bridging header.
|
|
|
|
#pragma once
|
|
|
|
#include <simd/simd.h>
|
|
|
|
typedef struct {
|
|
simd_float4x4 modelMatrix;
|
|
simd_float4x4 viewMatrix;
|
|
simd_float4x4 projectionMatrix;
|
|
simd_float4x4 normalMatrix;
|
|
} Uniforms;
|
|
|
|
typedef struct {
|
|
simd_float3 position;
|
|
simd_float3 normal;
|
|
simd_float4 color;
|
|
} VertexIn;
|
|
|
|
typedef struct {
|
|
simd_float3 cameraPosition;
|
|
simd_float3 lightDirection;
|
|
float ambientIntensity;
|
|
float diffuseIntensity;
|
|
float time;
|
|
float _pad;
|
|
} SceneConstants;
|
|
|
|
typedef struct {
|
|
simd_float4 color;
|
|
float gridSpacing;
|
|
float gridLineWidth;
|
|
float gridFadeDistance;
|
|
float _pad;
|
|
} GridConstants;
|