Android :: Project For Preview Image On Opengl Texture?
Dec 10, 2009
I'm trying to get the preview images of the android Camera onto a opengl texture. I have been successful so far, it works most of the times. Though sometimes I will just get a black screen when starting/ resuming the application. I have been debugging for days, not finding any clue. When debugging I noticed that both the camera callback and the onDrawFrame are called in such situations. the bytearray of the camera does contain data.
View 10 Replies
Jun 29, 2010
I'm having great difficulty getting basic textures to work in an OpenGL ES app on my Droid (2.1-update1). I trying to render a simple textured quad - four vertices, two faces, with normals and texture coords. When rendered, the texture is garbled and full of static, similar to TV noise. The basic colors from the texture map are there, but obviously the texture isn't being read or applied correctly. My texture load sequence is simple : int[] textures = new int[1]; gl.glGenTextures(1, textures, 0); Bitmap bmp = BitmapFactory.decodeResource(cx.getResources(), R.drawable.img); gl.glBindTexture(GL10.GL_TEXTURE_2D, textures[0]); GLUtils.texImage2D(GL10.GL_TEXTURE_2D, 0, bmp, 0);...
View 2 Replies
View Related
Aug 11, 2009
I took the source from API demos (TriangleRenderer.java) Here's the code on how textures are loaded in onSurfaceCreated():.....................
View 3 Replies
View Related
Feb 18, 2010
I have a texture with 8 equally sized stripes that I am using as a wall with OpenGL. On my Nexus One it scales it properly However, in emulators and on a G1 (and probably on other hardware), it does not scale properly, as the stripes remain the same width, while the height scales as it should. Is there an option that I need to set that is set to default on my nexus one but not on other platforms?
View 3 Replies
View Related
Mar 2, 2010
I'm trying to set the transparency of a texture on a quad in opengl, playing with the blend functions didn't help neither did anything on google.
View 2 Replies
View Related
Oct 18, 2010
I am writing a small app that at the moment generates a random map of textures. I am drawing this map as a 10 x 15 group of "quads" which are infact all triangle strips. I use the "map" to grab an int which I then take as the location of the texture for this square in the textureAtlas. so for example 0 is the bottom left "tile". The atlas is 128 x 128 and split into 32 pixel tiles.
However I seem to be getting some odd artifacts where the texture from the one tile is creeping in to the next tile. I wondered if it was the image itself but as far as I can tell the pixels are exactly where they should be. I then looked at the texture coords I was specifying but they all look exact (0.0, 0.25, 0.5, 0.75, 1.0 - splitting it into the 4 rows and columns I would expect). The odd thing is if I run it on the emulator I do not get any artifacts.
Is there a setting I am missing which would cause bleeding of 1 pixel? It seemed to only be vertical too - this could be related to on the phone I am "stretching" the image in that direction as the phone's screen is larger than normal in that direction..............
View 1 Replies
View Related
Nov 10, 2010
The following is piece of code in which I'm trying to draw 3 pieces of my background using glDrawTexfOES. The 3 pieces should look like green grass.
public void onDrawFrame(GL10 gl) {
gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);
gl.glLoadIdentity();
gl.glFrontFace(GL10.GL_CW);
gl.glEnableClientState(GL10.GL_TEXTURE_COORD_ARRAY);
gl.glEnable(GL10.GL_TEXTURE_2D);
gl.glBindTexture(GL10.GL_TEXTURE_2D, grass);
gl.glColor4x(0x10000, 0x00000, 0x10000, 0x10000);
((GL11Ext) gl).glDrawTexfOES(0.0f, 0.0f, -8.0f, 32, 32);
((GL11Ext) gl).glDrawTexfOES(32.0f, 0.0f, -8.0f, 32, 32);
((GL11Ext) gl).glDrawTexfOES(64.0f, 0.0f, -8.0f, 32, 32);
}
why my textures won't display correctly would be most appreciated! On a related note, for building a simple 2D tiled game is glDrawTexfOES the most efficient method for generating the tiled background?
View 1 Replies
View Related
Apr 8, 2010
I've googled around everywhere, but cannot find much for rendering strings to textures and then displaying that texture on a quad on the screen. Can someone provide a run-down on the process or provide good resources that describe how? Is rendering strings to textures even the best method for displaying text in an Android OpenGL ES app?
Okay, so LabelMaker interferes with alpha blending, the texture (created from a PNG with a transparent background) now has a solid black background, rather than a transparent background. If I comment out all the LabelMaker-related code, it works fine.
UPDATE:
Nevermind. I took a look at the code to find that LabelMaker was disabling blending after drawing the labels.
View 1 Replies
View Related
Dec 27, 2009
I'm trying to create a 1024x1024 texture in OpenGL. I'm trying to do this with Bitmap bmp = Bitmap.createBitmap(1024, 1024, Bitmap.Config.ARGB_8888); GLUtils.texImage2D(GL10.GL_TEXTURE_2D, 0, bmp, 0); But I can't actually create a 1024x1024 Bitmap - I get an out of memory exception.
I want to generate the texture, then use texSubImage2D to copy on various smaller bitmaps, but it seems that I need to somehow define that the texture is 1024x1024 before I can do that. Is there a function that lets me define the size/argb settings without just copying in a blank bitmap?
View 6 Replies
View Related
Aug 27, 2009
I'm converting an app I've written from Canvas to OpenGL, and not having too hard of a time yet. However, I've run into one snag that I can't seem to get around. My old app was threading image loads, because there are a ton of them, however, it looks like the OpenGL implementation protects itself to a single thread. I have a basic loadBitmap() function as follows:...............
View 4 Replies
View Related
Jul 6, 2010
I'm drawing 5 rectangles with OpenGL. They are texture mapped, and use the following parameters/binding:
..................
When I start the activity, the shapes all flash as if the textures were supposed to wrap (ie, i see more than one texture per shape), then the screen quickly corrects itself. Is there some manual buffering I'm supposed to do while the textures get mapped and unwrapped?
View 2 Replies
View Related
Feb 6, 2010
the draw_texture function is the fastest and VBO is 2nd faster. But I don't understand how to use it(the draw_texture method or the VBO way).
View 2 Replies
View Related
May 5, 2010
I have an Android application that displays VGA (640x480) frames using OpenGL ES. The application reads each frame from a movie file and updates the texture accordingly. My problem is that, it is taking almost 30 ms. to draw each frame using OpenGL. Similar test using the Canvas/drawBitmap was around 6 ms on the same device. I'm following the same OpenGL calls that VLC Media Player is using, so I'm assuming that those are optimized for this purpose.
View 1 Replies
View Related
Feb 9, 2010
I am very new to OpenGL ES. I am implementing some demo app to load multiple textures on the screen. For demo purpose I have loaded 2 textures in 2 different locations on the screen using glTranslatef() and glBindTextures() twice. Now I am able to see 2 different images on the screen. Now I want to move one particular texture across the screen using mouse.
View 2 Replies
View Related
Sep 21, 2009
I'm using OpenGL ES to display some objects exported from Blender. Blender provides a list of vertices, a list of the face indices and a list of the 2d texture co-ordinates. Within Blender, and I believe generally in OpenGL, the texture co-ordinates map to each vertex described in the index array.
I suppose I have two questions:
I'm given to understand(see the "Applying Textures" section) that in OpenGL ES the texture co-ordinates map to the vertex buffer only, not the index buffer. Is this the case or is there a way of binding the texture co-ords to the index buffer instead?
If the above is true, is there anything to be gained from using an index buffer at all? After all to properly map the textures one will need to write out the vertex buffer with all the redundancy that would have been saved with the index buffer. Is there still a performance increase to be gained or are index buffers redundant for textured data?
View 1 Replies
View Related
Jul 9, 2012
I'm having a problem with textures in my live wallpaper. I think its something I'm doing or not doing in blender when I bake my UV images... I get the app running just fine. But the textures are scrambled up on my model in the live wallpaper app... Here's a tester live wallpaper I built to show the problem I'm having... Three UV sphere the top one is post to be blue, the middle green, and the bottom is red inside blender. But after baking, this is what they turn out like in my live wallpaper... Here's a link to snap shots to the live wallpaper with the three sphere's..URL....
View 9 Replies
View Related
Jul 28, 2009
I've run into a very strange problem regarding OpenGL texture outputs, which only occurs when the app is resumed (particularly when leaving after pressing Home, and going back into the app).I'm not sure how or why, but it appears to be that it's reading bitrate of the pixels incorrect, or something else entirely. Furthermore, this issue only occurs on the device itself (testing on my G1/Dream), not on the emulator.Code as well as example screenshots in the zip file show exactly what I'm talking about. And to completely replicate the issue I've included the 2D sprite object framework I've developed for OpenGL so the situation is exactly the same as what I've run across when developing my game, so if it's somehow an issue in my framework you may be able to spot it.
View 6 Replies
View Related
Jul 14, 2010
In my application, I have a NDK native code that uses OpenGL 1.0 to apply a texture to a rectangle in order to draw an image on the screen. It is working fine on the emulator, but when I test it on the HTC HERO android device, it only draws a white rectangle without texture. Anybody else had the same problem? Did anybody find a solution?
Here is how I initialize openGL in native code:
CODE:............
And here is how I draw the frame in native code:
CODE:..................
View 3 Replies
View Related
May 18, 2010
Working through some OpenGL-ES tutorials, using the Android emulator. I've gotten up to texture mapping and am having some trouble mapping to a cube. Is it possible to map a texture to all faces of a cube that has 8 vertices and 12 triangles for the 6 faces as described below?
// Use half as we are going for a 0,0,0 centre.
width /= 2;
height /= 2;
depth /= 2;
float vertices[] = { -width, -height, depth, // 0
width, -height, depth, // 1
width, height, depth, // 2......................
View 1 Replies
View Related
Aug 8, 2010
I'm developing an openGL-enabled live wallpaper and it seems to work fine on the Nexus but I've had someone tell me that on their Milestone (basically a GSM Droid), all the textures are white. I only have a Nexus to test with. I've done lots of Googling on the issue and the big thing that seems to come up most is having power of two sized textures - which I have. I also put them in the /res/drawable-nodpi folder and set my manifest to all screen sizes/densities. At one point, I thought maybe it was the way I was implementing mipmaps so I turned them off. No dice. I'm sure it's something simple that I'm overlooking but my brain is completely fried at this point.
My texture loader:................
View 11 Replies
View Related
Feb 18, 2009
All the textures I create from my resource files are fine, but when I create a texture in the following way... <code> mOverlay = Bitmap.createBitmap((int)mWidth, (int)mHeight, Bitmap.Config.ARGB_4444); mOverlay.eraseColor(0); mOverlayCanvas = new Canvas(mOverlay);
...
Canvas c = mOverlayCanvas; c.drawColor(Color.argb(0, 0, 0, 0)); Paint p = new Paint(); p.setColor(Color.RED); c.drawCircle(160, 240, 10, p);
....................
View 4 Replies
View Related
May 15, 2010
I'm developing on Android with OpenGL ES, I draw some cubes and I change their colors with glColor4f. Now, what I want is to give a more realistic effect on the cubes, so I create a monochromatic 8bit depth, 64x64 pixel size PNG file. I loaded on a texture, and here is my problem, which is the way to combine the color and the texture to get a colorized and textured cubes onto the screen?
I'm not an expert on OpenGL, I tried this:
On create:...................................
View 1 Replies
View Related
May 21, 2010
I'm mapping a texture from my texture atlas to a square on a cube. For some reason, the t axis is inverted with 0 being at the top and 1 being at the bottom. Any ideas why this is happening? Also, I have to specify the texture coordinates in clockwise order rather than counter-clockwise. I am using counter-clockwise windings. The vertices, indices and texture coordinates I'm using are below.
float vertices[] = {
// Front face
-width, -height, depth, // 0
width, -height, depth, // 1
width, height, depth, // 2
-width, height, depth, // 3...............
View 1 Replies
View Related
Jun 29, 2010
I'm having great difficulty getting basic textures to work in an OpenGL ES app on my Droid (2.1-update1). I trying to render a simple textured quad - four vertices, two faces, with normals and texture coords. When rendered, the texture is garbled and full of static, similar to TV noise. Here's a pic showing the original texture map image, and then a screencap from my droid of the rendered textured quad. The basic colors are there, but obviously the texture isn't being read or applied correctly.
View 1 Replies
View Related
Jul 19, 2009
I have openGL layered on top of camera view by using the 'workaround' specified at-http://groups.google.com/group/android-beginners/browse_thread/thread... and it works great.
However, has been mentioned before that surfaceviews were not designed to be layered ontop of each other- [url]
As you can notice in the code snippet thats mentioned in the first thread, to get openGL working on top of camera we are first setting the contentView to be the openGL view and then adding the camera (on top of it) instead of the other way around as one would expect it. I am assuming there's something strange going on in here as it has also been mentioned that Z-order is not supported on surface views- [url]
Now my question is will all devices have this behavior? Can I use this behavior in my app to get openGL layered on top of camera preview? Please answer this query, its so cool to have openGL over the camera preview! It opens up for some amazing stuff!
View 2 Replies
View Related
Mar 12, 2010
i started a small project over at google code that provides you with bindings for OpenGL ES 2.0 in Java. I started just a couple of hours ago so it's not finished yet. The project includes the original GLSurfaceView plus all the helper classes from the latest Eclair build as well as a modified version of GLJNIView from the NDK samples which is now a fully functional GLSurfaceView subclass called GLSurfaceView20.
OpenGL ES 1.x and 2.0 are exclusive so you have to first check wheter GL ES 2.0 is supported. You can check this via the following method:
private boolean checkGL20Support( Context context ) { EGL10 egl = (EGL10) EGLContext.getEGL(); EGLDisplay display = egl.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY);
int[] version = new int[2]; egl.eglInitialize(display, version);...................
View 6 Replies
View Related
Jan 30, 2009
Does someone know how I can overlay an image over the camera preview?
View 6 Replies
View Related
Nov 8, 2010
Today I tried the sample code to get the camera preview working
(http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/graphics/CameraPreview.html)
But the image looks distorted when I start the application on my Galaxy S.
View 5 Replies
View Related
Jun 11, 2009
This is the code that I have for camera preview and image capture.I am trying to do camera preview and as I press the space button I am trying to take picture and save it in the picture gallery of the Android development phone. The code compiles fine,but as I press the space button,it captures the image and throws an exception and closes the application...
CODE:...................
View 7 Replies
View Related
Jun 23, 2009
I would like to save a preview frame as a jpeg image.
I have tried to write the following code...
but it's not possible to open a saved file as a jpeg image. Does anyone know how to save preview frames as jpeg images?
View 3 Replies
View Related