diff --git a/Terrain.xcodeproj/project.pbxproj b/Terrain.xcodeproj/project.pbxproj index d308154..4fc2f30 100644 --- a/Terrain.xcodeproj/project.pbxproj +++ b/Terrain.xcodeproj/project.pbxproj @@ -11,7 +11,6 @@ C018AD3B219518480094BE3C /* AlgorithmsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C018AD3A219518480094BE3C /* AlgorithmsTests.swift */; }; C018AD4021978E690094BE3C /* Queue.swift in Sources */ = {isa = PBXBuildFile; fileRef = C018AD3F21978E690094BE3C /* Queue.swift */; }; C018AD422197907B0094BE3C /* QueueTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C018AD412197907B0094BE3C /* QueueTests.swift */; }; - C019C8512191CE7100EAD5BB /* Uniforms.m in Sources */ = {isa = PBXBuildFile; fileRef = C019C8502191CE7100EAD5BB /* Uniforms.m */; }; C028A6A221A46796005DE718 /* Math.swift in Sources */ = {isa = PBXBuildFile; fileRef = C028A6A121A46796005DE718 /* Math.swift */; }; C08C58A0218F46F000EAFC2D /* Algorithms.swift in Sources */ = {isa = PBXBuildFile; fileRef = C08C589F218F46F000EAFC2D /* Algorithms.swift */; }; C08C58A2218F474E00EAFC2D /* TerrainAlgorithms.metal in Sources */ = {isa = PBXBuildFile; fileRef = C08C58A1218F474E00EAFC2D /* TerrainAlgorithms.metal */; }; @@ -51,7 +50,6 @@ C018AD3A219518480094BE3C /* AlgorithmsTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AlgorithmsTests.swift; sourceTree = ""; }; C018AD3F21978E690094BE3C /* Queue.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Queue.swift; sourceTree = ""; }; C018AD412197907B0094BE3C /* QueueTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QueueTests.swift; sourceTree = ""; }; - C019C8502191CE7100EAD5BB /* Uniforms.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Uniforms.m; sourceTree = ""; }; C028A6A121A46796005DE718 /* Math.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Math.swift; sourceTree = ""; }; C08C589F218F46F000EAFC2D /* Algorithms.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Algorithms.swift; sourceTree = ""; }; C08C58A1218F474E00EAFC2D /* TerrainAlgorithms.metal */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.metal; path = TerrainAlgorithms.metal; sourceTree = ""; }; @@ -187,7 +185,6 @@ C018AD3F21978E690094BE3C /* Queue.swift */, C018AD3E219728890094BE3C /* Shaders */, C0C15ABA218E2A90007494E2 /* ShaderTypes.h */, - C019C8502191CE7100EAD5BB /* Uniforms.m */, C0C15ABB218E2A90007494E2 /* Assets.xcassets */, C0C15ABD218E2A90007494E2 /* Main.storyboard */, C0C15AC0218E2A90007494E2 /* Info.plist */, @@ -355,7 +352,6 @@ C0C15AC6218E32B3007494E2 /* Terrain.swift in Sources */, C0C15AB7218E2A90007494E2 /* Renderer.swift in Sources */, C0C15AB3218E2A90007494E2 /* AppDelegate.swift in Sources */, - C019C8512191CE7100EAD5BB /* Uniforms.m in Sources */, C018AD4021978E690094BE3C /* Queue.swift in Sources */, C08C58A0218F46F000EAFC2D /* Algorithms.swift in Sources */, C028A6A221A46796005DE718 /* Math.swift in Sources */, diff --git a/Terrain2/ShaderTypes.h b/Terrain2/ShaderTypes.h index 2bc734c..5e7f919 100644 --- a/Terrain2/ShaderTypes.h +++ b/Terrain2/ShaderTypes.h @@ -70,15 +70,5 @@ typedef struct { packed_uint2 terrainSegments; } Uniforms; -#define kRandomAlgorithmUniforms_RandomCount (41) - -typedef struct { - uint randoms[kRandomAlgorithmUniforms_RandomCount]; -} RandomAlgorithmUniforms; - -#ifndef __METAL_VERSION__ -extern void RandomAlgorithmUniforms_refreshRandoms(RandomAlgorithmUniforms *uniforms); -#endif - #endif /* ShaderTypes_h */ diff --git a/Terrain2/Shaders/Shaders.metal b/Terrain2/Shaders/Shaders.metal index 5348d42..20bda79 100644 --- a/Terrain2/Shaders/Shaders.metal +++ b/Terrain2/Shaders/Shaders.metal @@ -43,6 +43,7 @@ vertex ColorInOut vertexShader(Vertex in [[stage_in]], out.position = uniforms.projectionMatrix * eyeCoords; out.eyeCoords = eyeCoords; + // TODO: Use the face normal. out.normal = normalize(in.normal); out.texCoord = in.texCoord; diff --git a/Terrain2/Uniforms.m b/Terrain2/Uniforms.m deleted file mode 100644 index 0aca68e..0000000 --- a/Terrain2/Uniforms.m +++ /dev/null @@ -1,16 +0,0 @@ -// -// Uniforms.c -// Terrain2 -// -// Created by Eryn Wells on 11/6/18. -// Copyright © 2018 Eryn Wells. All rights reserved. -// - -#include -#include "ShaderTypes.h" - -void RandomAlgorithmUniforms_refreshRandoms(RandomAlgorithmUniforms *uniforms) { - for (int i = 0; i < kRandomAlgorithmUniforms_RandomCount; i++) { - uniforms->randoms[i] = arc4random(); - } -}