Android :: Opengl Es Texture Created From Bitmap All White?

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);

....................

Android :: opengl es texture created from bitmap all white?


Android :: How To Texture White Square In Phone?

Aug 7, 2010

Alright, so I've got this OpenGL tutorial I'm basing from, my current code is equivalent to Part II of it, which is here:
http://blog.jayway.com/2009/12/04/opengl-es-tutorial-for-android-%E2%80%93-part-ii-building-a-polygon/
The code for that can be downloaded near the bottom of the page. It leaves you with a white square, and I want to apply a texture to it, which this tutorial series doesn't cover. I can't figure out how to texture my white square, in Android.

View 1 Replies View Related

Android :: Basic OpenGL ES Texture

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

Android :: OpenGL Texture Corrupted?

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

Android :: OpenGL Texture Scaling

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

Android :: Transparent Texture In OpenGL ES

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

Android :: OpenGL - ES Texture Bleeding

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

Android :: OpenGL Texture And GlDrawTexfOES

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

Android :: Render String To Texture And OpenGL ES

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

Android :: Create 1024x1024 Texture In OpenGL

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

Android :: OpenGL - Threading Texture Loading

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

Android :: OpenGL Texture Wrapping Flickers?

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

Android :: Easiest Way To Draw Texture With OpenGL ES?

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

Android :: OpenGL ES Texture Mapping Very Slow?

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

Android :: Move Particular Texture Around Screen Using Opengl Es?

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

Android : Use An Index Buffer With A Texture In OpenGL ES?

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

Android OpenGL Live Wallpaper Texture

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

Android :: Texture Appears White In Real Device But Not In Emulator

Jul 23, 2009

Texture appears white in the real device but not in the emulator, Ive already tried to find the solution in other POSTS but none of the solutions worked. The problem that I have is that the loaded texture not displayed in the real device (G1, firmware 1.5). If I turn of the texture and put a color in the geometry, it works fine. Details: the file that Im loading has width and height power of 2. And I tried with .bmp and .png files, for both I had the same problem. My code: METHOD used to load texture: private int loadTexture (GL10 gl, Bitmap bmp) int[] tmp_tex= new int[1]; gl.glGenTextures(1, tmp_tex, 0.

View 10 Replies View Related

Android :: Broken OpenGL Texture Output After Resuming App

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

Android :: Opengl Texture Working On Emulator But Not On HTC HERO

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

Android :: OpenGL ES - Texture Map All Faces Of An 8 Vertex Cube?

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

Android :: OpenGL Texture - Enabled Live Wallpaper

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

Android :: OpenGL - Set Monochrome Texture To Colored Shape?

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

Android :: OpenGL ES Texture Atlas - T Axis Inverted?

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

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 View Related

Android :: Basic OpenGL ES Texture / Way To Render Simple Textured Quad?

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

Android :: Saving Created Bitmap To Directory On Sd Card

Nov 24, 2010

I created a bitmap and now i want to save that bitmap to a directory somewhere. Can anyone show me how this is done.

CODE:.....................

WANT TO SAVE _bitmapScaled to a folder on my SD card

View 2 Replies View Related

Android :: White Screen In OpenGL Application

Oct 23, 2009

I've just dusted off an application I did for Android half a year ago. I upgraded to the latest SDK and Eclipse ADT. After some struggeling I get the application to run again. When I debug it I can see that all the right code are executed the right way. The application shows a OpenGL surface and animates stuff on it. It used to work perfectly (I even have it running on my HTC Magic device), but in the new emulator the screen is just white?

View 11 Replies View Related

Android :: Draw A Bitmap - Using OpenGL

Aug 30, 2010

I have a byte array of RGB values, just like the contents(without header) of a *.bmp file. What I want to do is, draw the corresponding bitmap on Android, using OpenGL.

It seems that OpenGL ES doesn't have a single API that will do, it true?

If true, how can I do this?

Actually, I can draw it in JAVA code, but it's too slow and costs too much CPU time. So I want to try drawing it with OpenGL. Is there any other advises? Or maybe OpenGL can't be the right answer?

View 2 Replies View Related

Android : Rotate Bitmap In Opengl?

Oct 10, 2010

I am trying to rotate a bitmap in OpenGL. I have searched around and come up with this. code...

Drawing the bitmaps indicated with the "ids" works fine but no rotation happens. I am no expert at openGL. Is is possible I need to set some sort of mode prior to the rotation?

View 8 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved