Commits

Cliff Biffle committed c6d2d92

Added a rudimentary fragment shader.

  • Participants
  • Parent commits 7c7c96b
  • Branches shaders

Comments (0)

Files changed (3)

File KVDepthView.m

 - (void) markAsDirty;
 
 @property GLuint vertexShader;
+@property GLuint fragmentShader;
 @property GLuint program;
 
 @end
 @implementation KVDepthView
 #pragma mark --- Properties ---
 
-@synthesize vertexShader, program;
+@synthesize vertexShader, fragmentShader, program;
 @synthesize updateQueued;
 
 @synthesize textured;
 
 - (void) prepareOpenGL {
   vertexShader = [self loadShader: @"kinect_project" ofType: GL_VERTEX_SHADER];
+  fragmentShader = [self loadShader: @"main" ofType: GL_FRAGMENT_SHADER];
   
   program = glCreateProgram();
   glAttachShader(program, vertexShader);
+  glAttachShader(program, fragmentShader);
   glLinkProgram(program);
   glUseProgram(program);
   

File KinectViewer.xcodeproj/project.pbxproj

 		C7759C0712A97873003479EF /* KVDepthRecorder.m in Sources */ = {isa = PBXBuildFile; fileRef = C7759C0612A97873003479EF /* KVDepthRecorder.m */; };
 		C7759C1012A97A3B003479EF /* KVDepthPlayer.m in Sources */ = {isa = PBXBuildFile; fileRef = C7759C0F12A97A3B003479EF /* KVDepthPlayer.m */; };
 		C775A0F812AC111E003479EF /* kinect_project.vs in Resources */ = {isa = PBXBuildFile; fileRef = C775A0D512AC0942003479EF /* kinect_project.vs */; };
+		C775A13312AC18EB003479EF /* main.fs in Resources */ = {isa = PBXBuildFile; fileRef = C775A11F12AC1749003479EF /* main.fs */; };
 /* End PBXBuildFile section */
 
 /* Begin PBXContainerItemProxy section */
 		C7759C0E12A97A3B003479EF /* KVDepthPlayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KVDepthPlayer.h; sourceTree = "<group>"; };
 		C7759C0F12A97A3B003479EF /* KVDepthPlayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KVDepthPlayer.m; sourceTree = "<group>"; };
 		C775A0D512AC0942003479EF /* kinect_project.vs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = kinect_project.vs; sourceTree = "<group>"; };
+		C775A11F12AC1749003479EF /* main.fs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = main.fs; sourceTree = "<group>"; };
 /* End PBXFileReference section */
 
 /* Begin PBXFrameworksBuildPhase section */
 			isa = PBXGroup;
 			children = (
 				C775A0D512AC0942003479EF /* kinect_project.vs */,
+				C775A11F12AC1749003479EF /* main.fs */,
 			);
 			name = Shaders;
 			sourceTree = "<group>";
 			isa = PBXResourcesBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
+				C775A13312AC18EB003479EF /* main.fs in Resources */,
 				C775A0F812AC111E003479EF /* kinect_project.vs in Resources */,
 				8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */,
 				1DDD58160DA1D0A300B32029 /* MainMenu.xib in Resources */,
+void main() {
+  gl_FragColor = gl_Color;
+}