opengl-es

Opengl-es Drawing to texture

余生颓废 提交于 2019-12-12 02:26:34
问题 In opengl-es 2.0 can a fbo rendering to a texture, use a texture target that is larger than the screen? If so, is it possible to draw a textured quad, filling up the fbo-texture corner to corner? If not possible is it possible to do this in another way in opengl-es? I have some layered procedurally generated graphics at load time that I would like to combine into single textures in order to save on performance at draw time. 回答1: Yes, absolutely. As long as the texture has a color-renderable

iOS OpenGL ES - Render screen to FBO on application resign for redraw later

北慕城南 提交于 2019-12-12 02:26:25
问题 I want to render my screen to a texture so that I can just "paste" the texture onto the screen when I come back into the application again. Currently in my app I am drawing a waveform with kEAGLDrawablePropertyRetainedBacking set to TRUE. It works, but the screen is cleared after I resign from my app and come back again. Is this normal behaviour with kEAGLDrawablePropertyRetainedBacking TRUE? I cannot afford the fps to redraw everything again when i come back to my application. I've already

Android playing sound in game

ぐ巨炮叔叔 提交于 2019-12-12 02:02:08
问题 I'm making game in OpenGL 2.0 and I want to play multiple sounds in same time. I have tried: SoundPool-but my soundtracks are very large and i can't load them. MediaPlayer-this work ok but than FPS are very low. 回答1: What you want to do is create a Service to run MediaPlayer and play the music. The Service will run in parallel to your Android process and will not effect it's performance. Service documentation: http://developer.android.com/guide/components/services.html SoundPool is best used

Issue with masking using Open GL 1.0 stencil buffer in iOs

ε祈祈猫儿з 提交于 2019-12-12 01:52:42
问题 I have been struggling to find a solution for a simple masking using Stencil Buffer in OPEN GL 1.0 on the iOs. I draw the background and then I draw on top of it using glPushMatrix a frame which is drawn using drawFrame. My frame is made of a VideoFrameTexture which I try to mask using maskTexture using the stencil buffer. My objective is to draw only part of the videoFrameTexture (which is defined by the white area of my mask and which corresponds to a circle shape) onto the background. I

glDrawElements display issue

最后都变了- 提交于 2019-12-12 01:38:48
问题 I want to draw object (cube) with texture in openGL ES 2, but got strange (as for me) result. Obj that i want to draw - extracted from FBX file and has data like (also i can extract Normals but i don't use them so just skip): ----Indices----24 0 1 2 3 4 7 6 5 0 4 5 1 1 5 6 2 2 6 7 3 4 0 3 7 ----Coordinates(Vertises)----72 1 1 -1 1 -1 -1 -1 -1 -1 -1 1 -1 1 0.999999 1 -1 1 1 -1 -1 1 0.999999 -1 1 1 1 -1 1 0.999999 1 0.999999 -1 1 1 -1 -1 1 -1 -1 0.999999 -1 1 -1 -1 1 -1 -1 -1 -1 -1 -1 -1 -1 1

Load a two texture for a single image at a regular interval of time - GLkit openglES

懵懂的女人 提交于 2019-12-12 01:29:30
问题 I used the below code to load the texture on a object. - (void)ldText:(UIImage *)Image { glGenTextures(1, &texture); glBindTexture(GL_TEXTURE_2D, texture); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); CGImageRef cgImage = Image.CGImage; float Width = CGImageGetWidth(cgImage); float Height = CGImageGetHeight(cgImage); CFDataRef data = CGDataProviderCopyData(CGImageGetDataProvider(cgImage)); glTexImage2D(GL

How do I import iGLU library to xcode?

时光怂恿深爱的人放手 提交于 2019-12-12 01:27:05
问题 If anyone doesn't know, iGLU http://code.google.com/p/iphone-glu/ is a GLU library for iphone. I can't seem to import the library to my project, it says to to run the following command but i get errors: make ARCH=armv6 PLATFORM=iphoneOS Has anyone get iGLU working? 回答1: You need editing the file iGLU/configs/darwin-iphone and modify it so that it reflects your Xcode environment. In my case I had to change the lines: GCC_VERSION = xxx IPHONEOS_DEPLOYMENT_TARGET = xxx to GCC_VERSION = 4.2

How to assemble animation from an array of images with the highest FPS possible on iOS?

孤者浪人 提交于 2019-12-12 01:09:37
问题 I apologize in advance if this question sounds dumb. I have an array of images produced by another project, and I want to show them on the screen in sequence as fast as possible to assemble them to animation. How should I do this to achieve a frame rate at least higher than 30FPS? I'm new to iOS development and I'm not sure where to start with. Should I look into Core Animation or OpenGL or Quartz2D or something else? Can someone please point me a direction? Thanks a lot! Really appreciate

How to set blend function on opengl for two overlapping objects

佐手、 提交于 2019-12-12 01:08:39
问题 Hi I needed to draw a round corner rectangle. I followed the procedure of the above image. I first drew the green rectangle. Then I drew the two black rectangles.And then I drew circles on the edges to make the corner round. Now what I get after doing this is in the image below. As it can be seen that the corner circles have less transparency on the portions where they overlap with the rectangles. But more transparency when not overlapped with the rectangles. The rectangles have alpha set to

OpenGL ES 3.0 matrix array only using first matrix

喜欢而已 提交于 2019-12-12 00:43:51
问题 I am doing GPU skinning in my vertex shader which works fine on PC, and which I'm porting to Android. My vertex shader is below, and the problem is that the creation of the matTransform matrix seems to only use the first matrix in boneMatrices: #version 300 es precision highp float; precision highp int; //Uniform count: projectionMatrix(16) + modelViewMatrix(16) + MVPMatrix(16) + textureMatrix(16) + normalMatrix(9) + lightMVPMatrices(16*5) + nShadowLights(1) + boneMatrices(16*boneMax) = 73 +