opengl-es-2.0

Android OpenGL2.0 showing black textures

一曲冷凌霜 提交于 2019-11-27 21:36:22
I am trying to draw textures onto quads in OpenGL2.0. So far I got the quads to show up and everything, but the textures are not there - the quads are all black. My main suspicion is that i'm not mapping the textures correctly - my textures are not powers of 2, nor are they square - their width is in the field mWidth and their height in mRowHeight. The quads are drawn in a vertical list, which is done with a translate matrix. I'll be very grateful if anyone can go over this cause I'm desperate! Here's related code: Initializing the buffers: void initBuffers() { float r = (float) mRowHeight /

iOS and multiple OpenGL views

烂漫一生 提交于 2019-11-27 21:27:09
问题 I'm currently developping an iPad app which is using OpenGL to draw some very simple (no more than 1000 or 2000 vertices) rotating models in multiple OpenGL views. There are currently 6 view in a grid, each one running its own display link to update the drawing. Due to the simplicity of the models, it's by far the simplest method to do it, I don't have the time to code a full OpenGL interface. Currently, it's doing well performance-wise, but there are some annoying glitches. The first 3

CVOpenGLESTextureCacheCreateTextureFromImage returns error 6683

纵然是瞬间 提交于 2019-11-27 21:24:12
问题 I am currently attempting to draw an image in openGL using YUV420 format (bi-planar). I receive raw data, and am attempting to parse it into a CVPixelBuffer, and then pass said buffer using CVOpenGLESTextureCacheCreateTextureFromImage. While I receive no errors when parsing into the CVPixelBuffer, I receive an error (-6683) when trying to pass into CVOpenGLESTextureCacheCreateTextureFromImage. I'm trying my best to follow apple's GLCameraRipple sample code - except again, I'm using raw image

Framebuffer FBO render to texture is very slow, using OpenGL ES 2.0 on Android, why?

空扰寡人 提交于 2019-11-27 20:36:40
问题 I am programming an Android 2d game using opengl es 2.0. After I draw my sprites to the backbuffer I draw lights to a FBO and try to blend it to the back buffer again. When I draw the FBO to the framebuffer, even trasparent without any color, the framerates drops from 60 to 30 on a Samsung Galaxy w (it has an adreno 205 as gpu). I searched everywhere and tried everything, even if I draw a single sprite on the scene and blend a trasparent FBO texture to the screen the framerate drops. I tried

How to draw basic circle in OpenGL ES 2.0 Android

与世无争的帅哥 提交于 2019-11-27 19:51:59
I'm new in OpenGL ES 2, and I have read many topics about how to draw a circle in OpenGL ES 2 on Android. Based on Drawing Shapes and this code found on gamedev.net , I can draw triangles and quares, but I still don't know how to draw a circle. I now have three ways to draw a circle: Generate vertices in a circle and use glDrawArray( GL_LINES, ... ). Depending on how many vertices you generate this will yield a nice and crisp result. Use a pregenerated texture of a circle (with alpha transparency) and map it on a quad. This will result in very smooth graphics and allow for a ´thick´ circle,

LibGDX 0.9.9 - Apply cubemap in environment

元气小坏坏 提交于 2019-11-27 18:58:55
问题 I am using LibGDX 0.9.9. I am trying to render cubemap and fog. So my code snippet below: public void show() { modelBatch = new ModelBatch(); environment = new Environment(); environment.set(new ColorAttribute(ColorAttribute.AmbientLight, 1.0f, 0.4f, 0.4f, 1f)); environment.set(new ColorAttribute(ColorAttribute.Fog, 0.9f, 1f, 0f, 1f)); environment.add(new DirectionalLight().set(0.8f, 0.8f, 0.8f, -1f, -0.8f, -0.2f)); cubemap = new Cubemap(Gdx.files.internal("cubemap/pos-x.png"), Gdx.files

iPhone: Display a semi-transparent video on top of a UIView?

人走茶凉 提交于 2019-11-27 18:55:57
问题 is it possible to have semi-transparent video (created with blue-screen) playing on top of a UIView ? I was wondering that in case that's not doable with the MPMoviePlayerViewController it might be by using OpenGL ES and a video texture ? Thank you in advance, F. 回答1: It is possible using the ffmpeg library. Here is the link, where you can download a very good example link Then you just have to set the alpha property to the UIImageView. But i'm not sure about performance, try :) 来源: https:/

OpenGL ES 2.0 to Video on iPad/iPhone

偶尔善良 提交于 2019-11-27 18:53:15
I am at my wits end here despite the good information here on StackOverflow... I am trying to write an OpenGL renderbuffer to a video on the iPad 2 (using iOS 4.3). This is more exactly what I am attempting: A) set up an AVAssetWriterInputPixelBufferAdaptor create an AVAssetWriter that points to a video file set up an AVAssetWriterInput with appropriate settings set up an AVAssetWriterInputPixelBufferAdaptor to add data to the video file B) write data to a video file using that AVAssetWriterInputPixelBufferAdaptor render OpenGL code to the screen get the OpenGL buffer via glReadPixels create a

Drawing a border on a 2d polygon with a fragment shader

倖福魔咒の 提交于 2019-11-27 18:12:02
I have some simple polygons (fewer than 20 vertices) rendering flat on a simple xy plane, using GL_TRIANGLES and a flat color, a 2d simulation. I would like to add a border of variable thickness and a different color to these polygons. I have something implemented using the same vertices and glLineWidth/GL_LINE_LOOP, which works, but is another rendering pass and repeats all the vertex transforms. I think I should be able to do this in the fragment shader using gl_FragCoord and the vertex data and/or texture coordinates, but I'm not sure, and my naive attempts have been obviously incorrect. I

How do I blend two textures with different co-ordinates in OpenGL ES 2.0 on iPhone?

社会主义新天地 提交于 2019-11-27 18:05:21
问题 I can blend two textures with different blending modes in the fragment shader when both the textures covers the same rectangles. But now my problem is, one texture is a plain rectangle with no rotation and the other texture is another rectangle with a rotation/scale and translation. How do I merge these textures in the way I want? (In the picture) I know how to do this... But not sure how to do this... For blending textures in one rectangle (the first image), I used the following code..