Android :: Getting OpenGL-ES Stencil Buffer Working

Jun 29, 2010

With the stencil buffer in opengl-es for Android, I'm simply trying to mask out drawing part of the screen. I think I have it set up right, but it is not masking out the non-stenciled parts. Below is an extraction of code for what I'm doing.

CODE:......

I have confirmed this draws to the correct location by allowing colour to show. Trust that this draws the mask to the correct location.

CODE:.......

Draw everything. Only items inside the masked area should be drawn. But everything is drawn with this code...

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

Anyone spot anything wrong with this? What it does basically is draw a box for say, half the screen (this works if I had colour enabled) which is setting the stencil buffer to 1 for that area. And at the end I draw to the whole screen. I want it to draw to the top half only, but it draws everything.

Android :: Getting OpenGL-ES Stencil Buffer Working


Android :: OpenGL Depth Buffer - Cant Get To Work

Apr 29, 2010

I'm currently learning OpenGL ES programming on Android (2.1). I started with the obligatory rotating cube. It's rotating fine but I can't get the depth buffer to work. The polygons are always displayed in the order the GL commands render them. I do this during initialization of GL:

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

On surface-change I do this:

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

When I enable backface culling then everything looks correct. But backface culling is only a speed-optimization so it should also work with only the depth buffer or not? So what is missing here?

View 2 Replies View Related

Android : Opengl Direct/NonDirect Buffer

Aug 4, 2010

Been getting a headache with some 2d Opengl coordinates and putting them in a direct buffer.

I have a basic square defined as such

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

This runs, no segfault or anything, and when I iterate through the buffer the size and values seem exactly the same (8 elements, ordered just as the array). What happens though is that my draw() function draws nothing, it works one way, but doesn't work the other way. I use Direct Buffers in a lot of my other geometry. I have to get direct buffers working or I know that my software might not be reliable.

CODE:.........

My Drawing function is as follows.

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

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 ES - Color Picking - Front/Back Buffer

Sep 2, 2010

I have a 3D game and I am using color-picking to know which object was selected.

When the user touches the screen, I draw each object with a different color. Then I read the color where the user touched the screen to know which object was selected. After that I draw each object with their respective textures/colors. (everything done during one onDrawFrame pass)

The problem is that sometimes the colored objects appear on the screen (~5% of the times the user touches the screen) and it is even worse on slower hardwares.

This is my pseudo code:

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

View 9 Replies View Related

Android :: OpenGL GlScissor Not Working On HTC Phones

Nov 10, 2010

I am optimizing a game for performance. A large part of the screen remains the same from frame to frame and it takes a while to render, so I intend to use glScissor() to limit new drawing to only certain parts of the screen. I do not do a gl.glClear(GL10.GL_COLOR_BUFFER_BIT); so the bits that were drawn previously should remain.

This provides a large speed increase and works very well on the Droid and on the emulator. However, it is not working on the G1 or Droid Eris, both made by HTC. The areas outside the scissor region are still being drawn over in a strange way. It's as if what's being drawn inside the scissor region is being wrapped outside the region. There is a large rectangle in the middle of the screen that has the correct contents. This is the defined scissor region. Immediately below the scissor region is a row, maybe 150-200 pixels high that looks like an exact copy of the bottom of the scissor region. Again, this only is happening on the HTC phones.

I believe that unless I specifically clear the color bits, they should remain from frame to frame. Is this correct? Is this an HTC OpenGL library bug?

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

Samsung I7500 :: OpenGL Working On Galaxy - II5

Nov 6, 2009

On android-hilfe.de I just found: OpenGl ES Auf dem I7500!! Ja es geht wirklich - Android-Hilfe.de

I tested it and it works - i can run opengl games fluently on my samsung galaxy now.

For those of you who can't read German: you can get opengl hardware acceleration working on the samsung galaxy on II5 and probably any other version by copying the libhgl.so from a htc G1 device.

Unfortunately the only way to legally do this is probably by owning a HTC device, but there are some HTC system/recovery images available for download, from the HTC website. Be sure to download the OTA image as it contains the files directly and you can just copy the libhgl.so file directly.

Root your phone, remount the /system filesystem as read/write, then copy the HTC libhgl.so to /system/lib/libhgl.so . Reboot phone.

Now you'll have openGL hardware acceleration!

View 49 Replies View Related

Android :: OpenGL Speed Issue - Code Contribution To Other OpenGL

Feb 25, 2009

Single Threaded OpenGL game ! (check bottom, you can download and use the helper class) Lighting disabled ! Depth Buffer disabled ! Culling enabled ! Textures disabled !

Just 176 integers (x,y values only) making 88 vertexes along with 132 index numbers making "44 triangles only"

Framerates I get is

with GL_BLENDING disabled - 145 fps approx only! enabled - 110 fps approx only!

I have the screenshot of exact code in the draw function here.. just 2 damn lines ! I have hidden only the comments.. click here to see it http://prasna991.googlepages.com/drawframe.png

variable details in the 2 lines of code =========================== ipts = 176 elements (only x and y for each vertex) totallinetriangles * 3 = 176 lineindexes = 132 elements - type "short"

Here is the screenshot of output drawing and how it will look like http://prasna991.googlepages.com/screen.png

OpenGL single threaded Initialization Helper ================================ Here is my OpenGL helper class.. makes the OpenGL initialization for newbies a cakewalk http://prasna991.googlepages.com/OpenGLHelperclass.txt

I tested by rendering on the touch event only.. frame rate drops only when u touch and drag and here I have just tested by tapping and releasing gently on the emulator and on the device

Is this the device limitations ? So graphics is actually a lot lot lot slower than on iPhone ?

View 8 Replies View Related

Android :: NDK OpenGL - Mixing Java And Native - C - Calls To OpenGL API

Jul 24, 2010

I would like to be able to use the OpenGL API from both Java and C (via NDK).

In Java, there is a GL object passed, which has all GL methods on it.

In C, you just talk to the native library.

In a single onDrawFrame callback (for which Java is passed a GL), can I use methods on the GL object, and also call NDK methods which access the openGL library?

In other words, is the GL object just a wrapper for the same instance of the native library?

View 3 Replies View Related

Android :: Anyone Have An Android Logo Stencil?

May 5, 2010

Anyone have an android logo stencil that I could use to spray paint the logo on the back of one of my cases? The case that I got pretty much sucks color wise, so I'm planning on spraying it flat black and then a silver android logo.

View 1 Replies View Related

Android :: Data Buffer Pass By Jni

Aug 4, 2009

Have some tryed to pas databuffer on android by jni?

View 6 Replies View Related

Android :: System Log Buffer Size

Feb 11, 2009

I have the following problem: I'd like to see the system log of two days ago and I cannot. I see only 3 last hours. How can I configure the system log size, location, severity?

View 6 Replies View Related

Android :: Alpha Buffer Support On G1

Mar 21, 2009

Is it possible to generate an EGL Config with an alpha buffer on the G1? When I request a non-zero number of bits for the alpha buffer I can get a R5G5B5A1 or R8G8B8A8 visual, but neither of them renders correctly to the screen. I assume that's because the G1 only supports R5G6B5 visuals. It does surprise me that I can even get those visuals though. It's fairly obvious looking at the 32bpp visual artifacts that the frame buffer is indeed laid out with 32bpp, but display hardware is treating it as 16bpp, resulting in the left and right halves of my scene rendering in alternate scan lines, with distorted colors. So does anyone know if there is any way to get an alpha buffer on the G1? I've tried using FBO's but they don't seem to be implemented either. Or I'm using them incorrectly. If I call glGenFrameBuffersOES on a GL11ExtensionPack reference I get an UnsupportedOperationException. I am getting my GL11ExtensionPack reference by casting the return value from my EGLContext.getGL() call.

View 2 Replies View Related

Android :: Alpha Buffer Support

May 24, 2009

Since Google groups doesn't let you add posts to threads more than 60 days old, and I want to leave a solution to the problem I encountered a while back, I'm posting this message with the same title in hopes that anyone running into the problem I had will find this message as well. I was having trouble getting my G1 to render an RGBA_8888 OpenGL context to the screen. Everything was twice the size it should be because the 8888 pixels were being interpreted as two 565 pixels. The colors were obviously wrong as well. I had missed a critical function call. You must configure the Surface that is being used by EGL using the SurfaceHolder method setFormat. The pixel format needs to be TRANSLUCENT, or more specifically you can use RGBA_8888.

View 2 Replies View Related

Android :: How To Empty The Logcat Buffer

Jul 23, 2010

How can I empty the logcat buffer in Android? I use adb logcat from command line and pipe the output to a file, since the DDMS has a very limited buffer. At the moment, when I restart my app (after fixing bugs etc) the logcat buffer has data from the previous launch as well. Even uninstalling the app does not clear the buffer. The only way I've found so far to clear the buffer, is reboot. This is effective, but would like to know if there's an easier way.

View 1 Replies View Related

Android : Why Does Internet Radio Always Buffer

Oct 5, 2010

I like to listen to internet radio stations due to the variety of music i can listen to and also due to the lack of full Flash support yet for 2.1

my 3G & HSDPA signal is excellent almost anywhere....at home, at work and on the road and out and about. i'm with T-mobile (UK) for the past 5 years and i'm very happy with their service. and the signal.

but sometimes the internet radio still buffers sometimes even with an almost excellent signal. why is this? any explanation?

View 6 Replies View Related

Android :: How To Capture Audio Data From Mic Into A Buffer?

Sep 24, 2009

I am working on a packet switched network. I want to capture the audio data from mic into a buffer at a desired sample rate.How can I capture the audio data from mic into a buffer instead of a file? Also how can I control the audio capture rate as per the desired sample rate?

View 2 Replies View Related

Android :: Better (Video Buffer) YouTube Application?

Oct 19, 2010

I've pretty much fed up with the stock Youtube app on my Moto Droid, and was wondering if there are any alternate apps or fixes out there. Between it flipping a nut if I try to seek further into the video and the fact that it won't allow me to buffer the video at all is what tweaks me the most. Whats the point of trying to watch anything over 3G if I'm only gunna get 3 seconds of video followed by 3 seconds of buffering through the whole thing?

View 1 Replies View Related

Android :: Any Way To Change LogCat Buffer Size?

Jan 30, 2010

Is there a way to change how big the logcat buffer is? or how much is buffered back? Especially when using DDMS.

View 3 Replies View Related

Android :: Buffer Size For Audio Track

Jun 17, 2009

This may be impossible but is there any way that I can get a smaller buffer size for AudioTrack than what is provided by getMinBufferSize method?

This is how I am instantiating AudioTrack right now: SR = 44100; bufSize = AudioTrack.getMinBufferSize(SR, AudioFormat.CHANNEL_CONFIGURATION_MONO, AudioFormat.ENCODING_PCM_16BIT); audioTrack = new AudioTrack(AudioManager.STREAM_MUSIC, SR, AudioFormat.CHANNEL_CONFIGURATION_MONO, AudioFormat.ENCODING_PCM_16BIT, bufSize, AudioTrack.MODE_STREAM);

With sample rate of 44100, getMinBufferSize always returns 4800. If I try to make the buffer size smaller than 4800 then I get the following error message: E/AudioTrack( 318): Invalid buffer size: minFrameCount 1200, frameCount 600 E/AudioTrack-JNI( 318): Error initializing AudioTrack E/AudioTrack-Java( 318): [ android.media.AudioTrack ] Error code -20 when initializing AudioTrack. D/AndroidRuntime( 318): Shutting down VM W/dalvikvm( 318): threadid=3: thread exiting with uncaught exception (group=0x4000fe70) E/AndroidRuntime( 318): Uncaught handler: thread main exiting due to uncaught exception I/CheckinService( 59): From server: Intent { action=android.server.checkin.FOTA_CANCEL } E/AndroidRuntime( 318): java.lang.RuntimeException: Unable to start activity Does anyone has any ideas how to over come this problem?

View 2 Replies View Related

Android :: Using Cache Or SDcard As Temporary Buffer

Nov 19, 2010

I'm currently trying to create a buffer for my application which needs to be big!I mean at least 1MB but most likely to be 4MB.Now definitely bad idea to actually allocate this much on a byte array in memory.So the options are put all the data in a file. So question is where do I place this temp file?

Option 1: Store to sdcard. Might be slow and not such a good idea for continuous read/writes?

Option 2: Store to in the apps cache.I read somewhere this is fast for read/ writes. But also read before issues cleaning up the cache after use? I guess I should as if I be able to create a file in cache and discard it when I don't need it? Any tips/look outs from using this methods would be greatly appreciated!

View 7 Replies View Related

Android :: Display APIs - Buffer On Screen?

Nov 3, 2009

How can we display a buffer on screen?

Currently I create a bitmap using Bitmap's CreateBitmap() and render it on screen using canvas' drawBitmap().

Is there any other way of doing this in Java layer?

View 8 Replies View Related

Android :: Read The Current Frame Buffer?

Nov 16, 2010

Is there a method to read the frame buffer of the current screen? I searched some data about the frame buffer. Some one used the glReadPixels method, but the information was not enough. Does anyone know how to read the current frame buffer in detail?

View 4 Replies View Related

Android :: How To Read The Current Frame Buffer

Nov 16, 2010

Is there a method to read the frame buffer of the current screen? I searched some data about the frame buffer. Some one used the glReadPixels method, but the information was not enough. Does anyone know how to read the current frame buffer in detail?

View 1 Replies View Related

Android :: Glbuffersubdata With An Offset Into Buffer Without Causing Garbage

Aug 1, 2010

I'm trying to update part of a VBO with a call to glBufferSubData(). When I update from the start (0) of my existing shadow buffer, there is no problem, as the buffer starts reading from 0. The following will read 0 to y from the buffer and place it at 0 to y in the VBO: gl.glBufferSubData(GL11.GL_ARRAY_BUFFER, 0, y, mPositionBuffer);

However, if I want to update a portion of the VBO (not from 0) I run into a problem; The following doesn't work, since it will write the values from the start of the buffer (0 to y) into position x to x+y of the VBO:........................

View 1 Replies View Related

Android :: Passing Array Buffer Between Activity In Same Application

Apr 7, 2009

I am developing an image applications.

One activity decoding image file (jpg, bmp, and so on) to byte buffer RGB 565 or 888 type.

Then want to pass image buffer to another activity for change image data.

I have 3 activity the main decoding activity[A] and selecting effect activity[B] and apply effect activity[C] for change image data.

If i use intent then activity[A] should make intent[1] and putExtra to that intent. and then [B] call getIntent and getByteArrayExtra for get byte buffer.

If user select effect then [B] make new intent[2] and putExtra to intent[2]. and startActivityForResult with intent[2] and activity[C].

Then activity[C] call getIntent to get intent[2] and getByteArrayExtra for get byte buffer again.

There takes much times to make new byte buffer and copy from parent's activity's byte buffer 2 times. [A]->[B] and [B]->[C]

That process drops application performance.

Questions

1. Can i pass intent[1] to activity[C] without make new intent[2] and putExtra byte buffer? by modify intent[1]. (if it works just 1 buffer copy will perform)

2. Can i use application global memory for share byte buffer? if i use hash map how can each activity access same hash map? (if it works don't need to copy buffer)

View 2 Replies View Related

Android :: How To Continuously Record In Memory Using A Circular Buffer

Dec 24, 2009

I'm trying to use the Media Recorder to have my application continuously record audio in memory (to a circular buffer of a known size). Indeed, I'd like to be able to play back the past 10 seconds of recorded based on a certain event in my program. Much of the Media API is designed to linearly record audio to a file. Has anyone an idea on how I could best do this with or without the default API?

View 2 Replies View Related

Android :: Camera Preview Application - Buffer Allocation?

Nov 21, 2009

I have some questions regarding the code below for camera preview application.

1. How does surfaceCreated() and CreateSurface() relate? Is this surface created via createSurface() from SurfaceFlinger client to SurfaceFlinger server? If so, there must be 2 buffers (frame buffers from display driver if there is how acceleration or if it is the emulator, it will be from ashmem) associated with this surface: surface BB (for composition) and surface FB (for display).

2. How does the rendering buffer (frame buffer BB and frame buffer FB) get allocated in the camera preview application? Are they allocated by the application?

3. How does this surface relate to the preview buffers? Are the preview buffers allocated by the Camera Service during startPreview?

private class CameraSurfaceView extends SurfaceView implements SurfaceHolder.Callback {
private SurfaceHolder mHolder; private Camera camera = null;
public CameraSurfaceView(Context context) { super(context);
mHolder = getHolder(); mHolder.addCallback(this);
mHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
} public void surfaceCreated(SurfaceHolder holder) {
camera = Camera.open(); try {
camera.setPreviewDisplay(mHolder);
} catch (Exception e) { Log.e("Camera", "Failed to set camera preview display", e);
} } }

View 2 Replies View Related

Android :: Buffered Input Stream Buffer Size

Jul 5, 2010

I use BufferedInputStream in my code: socket = new Socket(ip, Integer.parseInt(port)); socket.setReceiveBufferSize(64000); output = socket.getOutputStream(); input = new BufferedInputStream(socket.getInputStream(), 64000); I read incoming packets like this: if (input.available() != 0) { System.out.println("Get Packet: " + input.available() + " bytes"); byte[] b = new byte[input.available()]; input.read(b); incParser(b); }

View 2 Replies View Related







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