From d72992c26fcc9a2964a0e142892abd257ca13754 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Wed, 21 Nov 2018 08:58:31 -0700 Subject: [PATCH] Add Light and Material objects to ShaderTypes.h --- Terrain2/ShaderTypes.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/Terrain2/ShaderTypes.h b/Terrain2/ShaderTypes.h index 6a45da6..3ea3f57 100644 --- a/Terrain2/ShaderTypes.h +++ b/Terrain2/ShaderTypes.h @@ -62,6 +62,28 @@ typedef NS_ENUM(NSInteger, GeneratorTextureIndex) { GeneratorTextureIndexOut = 1, }; +typedef struct { + bool enabled; +#ifdef __METAL_VERSION__ + simd::float4 position; + simd::float3 color; +#else + simd_float4 position; + simd_float3 color; +#endif +} Light; + +struct Material { +#ifdef __METAL_VERSION__ + simd::float3 diffuseColor; + simd::float3 specularColor; +#else + simd_float3 diffuseColor; + simd_float3 specularColor; +#endif + float specularExponent; +}; + typedef struct { matrix_float4x4 projectionMatrix; matrix_float4x4 modelViewMatrix;