opengl-es

Render off-screen SCNScene into UIImage

廉价感情. 提交于 2020-01-01 10:12:29
问题 How can I render render an off-screen SCNScene into a UIImage ? I know that SCNView provides a -snapshot method, but unfortunately that doesn't work for off-screen views. A similar question have been asked before where one of the answers suggest reading the bitmap data from OpenGL using glReadPixels , but that approach doesn't work for me with an off-screen scene. I tried rendering into the context of an GLKView using SCNRenderer without success. 回答1: Swift 4 with SCNRenderer: You can use

How to detect OpenGL capabilities without creating a GLSurfaceView (Android)

拈花ヽ惹草 提交于 2020-01-01 07:21:08
问题 I am trying to access the OpenGL capability of the phone before deciding whether to use OpenGL or Canvas for graphics puposes. However, all the functions that I can read documentation on requires you to already have a valid OpenGL context (namely, create a GLSurfaceView and assign it a rendered. Then check the OpenGL parameters in the onSurfaceCreated). So, is there a way to check the extensions, renderer name and max texture size capability of the phone BEFORE having to create any OpenGL

How to detect OpenGL capabilities without creating a GLSurfaceView (Android)

半城伤御伤魂 提交于 2020-01-01 07:20:53
问题 I am trying to access the OpenGL capability of the phone before deciding whether to use OpenGL or Canvas for graphics puposes. However, all the functions that I can read documentation on requires you to already have a valid OpenGL context (namely, create a GLSurfaceView and assign it a rendered. Then check the OpenGL parameters in the onSurfaceCreated). So, is there a way to check the extensions, renderer name and max texture size capability of the phone BEFORE having to create any OpenGL

android open gl really slower than canvas?

China☆狼群 提交于 2020-01-01 06:52:05
问题 im testing the android SpriteMethodTest and on default settings canvas is getting 58fps while open gl is between 50-55fps, and the gap just gets larger with more sprites. I was under the impression that opengl is faster than canvas so is this wrong? or is their something wrong with my phone (htc desire)? http://code.google.com/p/apps-for-android/source/browse/trunk/SpriteMethodTest/ 回答1: It should be noted that SpriteMethodTest is not using OpenGL at maximum efficiency. Each sprite is being

OpenGL-ES, iPhone and intermittent error: GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_OES (0x8CD6)

倖福魔咒の 提交于 2020-01-01 06:36:30
问题 I have an app that uses OpenGL-ES and an EAGLContext within a UIView - very much like Apple's GLPaint sample code app. It might be significant that I see this bug on my iPhone 4 but not on my iPad. Mostly, this works very well. However, I am getting GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_OES from glCheckFramebufferStatusOES() within the createFrameBuffer method. The reason is that the backingWidth and backingHeight are both 0. I am trying to understand the relation between )self.layer and its

Android only game in OpenGL: performance in C++ (NDK) vs Java (Dalvik) [closed]

和自甴很熟 提交于 2020-01-01 04:42:08
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 6 years ago . I know that similar questions have been asked before, but... We want to develop (at least hope) an indie game but still a game with high quality graphics with hundreds if not thousends of moving objects on the screen so we expect very high number of polygons and requirements for

Android Opengl-es loading a non-power of 2 texture

懵懂的女人 提交于 2020-01-01 04:38:06
问题 I have an app that I've been repeatedly playing with in android, it uses opengl-es. Currently I load textures from a bitmap like so: //Load up and flip the texture - then dispose the temp Bitmap temp = BitmapFactory.decodeResource(Deflecticon.getContext().getResources(), resourceID); Bitmap bmp = Bitmap.createBitmap(temp, 0, 0, temp.getWidth(), temp.getHeight(), flip, true); temp.recycle(); //Bind the texture in memory gl.glBindTexture(GL10.GL_TEXTURE_2D, id); //Set the parameters of the

OPENGL ES not working : no Current context

丶灬走出姿态 提交于 2020-01-01 04:20:25
问题 I tried the program as shown in book OpenGL ES2 for Android, but it's not working!! I have tested in Odroid E, samsung s3, samsung y, samsung star!! the gl version suported returns 2, but i get 11-22 15:09:45.804: E/oGl-es v(9047): 2.0:131072 11-22 15:09:45.804: E/libEGL(9047): call to OpenGL ES API with no current context (logged once per thread) 11-22 15:09:45.804: E/unable to(9047): createShader 11-22 15:09:45.804: E/libEGL(9047): call to OpenGL ES API with no current context (logged once

GLKit & adding tints to textures

依然范特西╮ 提交于 2020-01-01 03:31:18
问题 I am having issue with tinting a PNG image with GLKit. I have a white PNG image that I load into the application and then use it to create a texture: UIImage *image = [ UIImage imageNamed:@"brushImage" ]; NSError *error = nil; texture_m = [[ GLKTextureLoader textureWithCGImage:image.CGImage options:nil error:&error] retain ]; if (error) { NSLog(@"Error loading texture from image: %@",error); } the texture is created with no errors. however when I want to render the texture with blend

how to draw custom shapes using a simple texture in libgdx?

霸气de小男生 提交于 2020-01-01 03:15:06
问题 I want to draw custom static shapes in my game just like the angry birds done: but the problem is that the texture is in square shape. how we can tell to the "SpriteBatch" to draw shapes with some vertices? does anybody has some ideas? 回答1: According to the docs: A SpriteBatch is used to draw 2D rectangles that reference a texture (region) So essentially, this method does not allow you to specify any other geometry than a rectangle. However, there is a draw method that allows you to specify