Questions tagged [glkit]

GLKit is a high-level framework for OS X and iOS that assists with development of OpenGL and OpenGL ES apps.

The GLKit framework provides four key feature areas making it easier to develop modern OpenGL and OpenGL ES apps on OS X and iOS:

  • The GLKView and GLKViewController classes in iOS provide a standard implementation of a UIKit view that draws its content using OpenGL ES and a view controller for managing animation in that view.
  • The GLKTextureLoader class allows your app to easily load textures from a variety of sources. Textures can even be loaded asynchronously in the background with just a few lines of code.
  • Effects, in GLKBaseEffect and related classes, provide shader-based versions of common rendering techniques, analogous to features of the fixed-function pipeline in legacy OpenGL and OpenGL ES.
  • Vector, matrix, and quaternion math libraries, optimized for fast performance on Apple devices, provide functions and data types useful for graphics programming and replace features found only in legacy OpenGL and OpenGL ES versions.

See the GLKit Framework Reference for details.

436 questions
0
votes
1 answer

How to use multiple textures in OpenGL ES 2.0

I would like to set up a texture array to use for my shape. I have researched this topic on the internet but there are hardly any references a newbie like me can make use of. Again, what I am trying to achieve, is a texture array that I can use to…
the_critic
  • 12,720
  • 19
  • 67
  • 115
0
votes
2 answers

Using GLKit and OpenGL-ES, How To Draw Two Triangles, One Textured, Another Solid

I'm new to OpenGL-ES and have started working my way through Buck's Learning OpenGL ES for iOS book. Chapter 2 covers drawing triangles with a solid color, and chapter 3 moves on to use textures. As a personal learning exercise, I'm trying to alter…
Max MacLeod
  • 26,115
  • 13
  • 104
  • 132
0
votes
1 answer

GL_LINES drawing back to first point at the end of verticies

Using GLKit (OpenGLES 2.0) on iOS. I'm modifying some code that renders cubes in a 3d environment so that it will render waveforms in 2 dimensions in a 3d scene. I have it working great except for one problem which is: Suppose I render n x/y…
VaporwareWolf
  • 10,143
  • 10
  • 54
  • 80
0
votes
1 answer

GLKTextureLoader loads transparent textures unexpectedly

I generate text as image using UIKit (simplified): UIGraphicsBeginImageContextWithOptions(textureSize, NO, 0); [variant.text drawInRect:CGRectIntegral(necessaryRect) withFont:textFont lineBreakMode:UILineBreakModeWordWrap…
kpower
  • 3,871
  • 4
  • 42
  • 62
0
votes
5 answers

How can I apply different textures to different objects using GLKit?

I am displaying 3 objects with the help of GLKit. However, when I am applying textures to these objects, only one texture is being used for all three. The code I am using is as follows: - (void)setUpGL{ NSLog(@"i : %d, %d, %d",i,j,k); …
iPhoneBuddy
  • 49
  • 10
0
votes
1 answer

Detect -snapshot call in -glkView:drawInRect: using GLKit

I'm looking if -glkView:drawInRect: can detect that it's drawing for -snapshot method, rather than the normal way, where the view will be displayed to the user. It's so I can detect how to draw the view correctly. My attempt at detecting the…
Basil Al-Dajane
  • 427
  • 6
  • 16
0
votes
1 answer

Relation between shader and UV texture mapping

I'm using OpenGL ES + GLKit. I've never been this low-level before in my life so I still have to learn a lot of things. I've developed a Unity games before and you just give it a .obj file and corresponding texture and it's done. (UV mapping happens…
5argon
  • 3,683
  • 3
  • 31
  • 57
0
votes
1 answer

GLKit quaternion code not agreeing with matrix code?

I must be misunderstanding something about GLKit's handling of quaternions and rotation matrices. In the following snippet, I would expect matrices a and b to end up with identical contents (subject to floating point errors)... GLKQuaternion q =…
Chuck
  • 1,850
  • 2
  • 17
  • 28
0
votes
2 answers

GLKBaseEffect not loading texture (texture appears black on object)

I'm using GLKit in an OpenGL project. Everything is based on GLKView and GLKBaseEffect (no custom shaders). In my project I have several views that have GLKViews for showing 3D objects, and occasionally several of those view can be "open" at once…
Or Sharir
  • 1,607
  • 12
  • 21
0
votes
1 answer

Source code of GLKBaseEffect's standard shaders

My understanding of GLKBaseEffect is that it comes with some kind of general-purpose vertex and fragment shaders, and when [baseEffect prepareToDraw] is called, the effect passes its property values like transform and fog to OpenGL uniforms and…
Jonas Sourlier
  • 13,684
  • 16
  • 77
  • 148
0
votes
1 answer

How to use GLKMathProject? [GLKit - iOS]

I tried: int viewport[4]; viewport[0] = 0; viewport[1] = 480; viewport[2] = 320; viewport[3] = 480; GLKVector3 x = GLKMathProject(position, effect.transform.modelviewMatrix, effect.transform.projectionMatrix, viewport); NSLog(@"%@",…
Davide
  • 764
  • 1
  • 6
  • 18
0
votes
1 answer

OpenGL-ES shared vertices vs duplicate vertices rendering issue

Im having a strange problem where all my models but one are rendering properly. When i changed my models from using shared vertices (set of vertices + indexing array) to using duplicated vertices (needed to do this to be able to texture my models),…
Fonix
  • 11,447
  • 3
  • 45
  • 74
0
votes
1 answer

What's the best practice when implement scrolling in a 2D GLKit/iOS game?

I have a nice scene set up, and everything is rendering fine, and now I want to pan over the world, similar to how I'd adjust the origin of a UIScrollView or a CAScrollLayer with scrollToPoint(). I have determined that I can continually adjust the…
Mason Cloud
  • 1,266
  • 1
  • 15
  • 20
0
votes
3 answers

Detect Touch on image Texture in OpenGl

I am trying to develop a game using openGL where i have used GLTextureLoader class to load images and these sprites are moving from left to right with some calculated velocity , i need to detect touch on these images.
ankit
  • 113
  • 2
  • 8
0
votes
1 answer

GLKTextureLoader textureWithContentsOfFile: fails for the first time

I am using GLKTextureLoader to load image textures into a sprite. When I run the following code and load two sprites... NSString *pathToImage = [NSString stringWithFormat:@"%@/defaultProject/images/%@", [Util applicationDocumentsDirectory],…
Chris
  • 3,057
  • 5
  • 37
  • 63