[android-developers] Re: A big OpenGL speed issue + my code contribution to other OpenGL beginners
If you render the Open GL graphics in the main thread (where user- input is received and handled), how are you going to program animated graphics when the user does not interact with the screen/keyboard at all? by issuing a log of handler.post(Runnable) commands ? Also, your sample code is simple and it's therefore rendered pretty fast. If you start adding many more vertices, adding textures, lighting models, etc, the rendering will slow down. In short, i strongly suggest seperating the user-input(=main) thread and the Open GL drawing code into a seperate thread. It'll keep your app performance predictable and, in the end, better maintainable. On Feb 25, 11:33 pm, quakeboy prasna...@gmail.com wrote: Yes I forgot to mention that, I took pains to change code to follow the same model as in OpenGL samples and found no improvement too ! My guess is that Its either OpenGL commands memory bandwidth is very less... as I use DrawElements only and only person I have heard to get tremendous fps was using VBOs. But I cannot use VBO due to the nature of the game elements and the changing vertices. Or I am doing something wrong with OpenGL initialization code and pixel format etc ?? On Feb 26, 2:15 am, Jon Colverson jjc1...@gmail.com wrote: On Feb 25, 11:39 am, quakeboy prasna...@gmail.com wrote: More info:- 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 As I said before, this is a very unusual way of doing things. Have you tried drawing continuously in a separate thread as in the API demos? -- Jon- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: A big OpenGL speed issue + my code contribution to other OpenGL beginners
I have mentioned that I had tried shifting the whole OpenGL code to a new thread and still don't see any performance difference. May be I can try once again, but I strongly doubt any improvement is gonna be there. Does any one know about the fill rate limitations ?? But As you can see I don't even cover up the full screen, so think its not valid to think in that direction. I will reply back after implementing the threading concept again as I don't have any other choices. On Feb 26, 10:18 pm, Streets Of Boston flyingdutc...@gmail.com wrote: If you render the Open GL graphics in the main thread (where user- input is received and handled), how are you going to program animated graphics when the user does not interact with the screen/keyboard at all? by issuing a log of handler.post(Runnable) commands ? Also, your sample code is simple and it's therefore rendered pretty fast. You call that frame rate fast for that kinda of simple drawing ?? I get horrible frame rates when I enable background which I draw using Drawtex extensions and the other textures. And also except background all my other textures have transparency. If you start adding many more vertices, adding textures, lighting models, etc, the rendering will slow down. In short, i strongly suggest seperating the user-input(=main) thread and the Open GL drawing code into a seperate thread. It'll keep your app performance predictable and, in the end, better maintainable. On Feb 25, 11:33 pm, quakeboy prasna...@gmail.com wrote: Yes I forgot to mention that, I took pains to change code to follow the same model as in OpenGL samples and found no improvement too ! My guess is that Its either OpenGL commands memory bandwidth is very less... as I use DrawElements only and only person I have heard to get tremendous fps was using VBOs. But I cannot use VBO due to the nature of the game elements and the changing vertices. Or I am doing something wrong with OpenGL initialization code and pixel format etc ?? On Feb 26, 2:15 am, Jon Colverson jjc1...@gmail.com wrote: On Feb 25, 11:39 am, quakeboy prasna...@gmail.com wrote: More info:- 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 As I said before, this is a very unusual way of doing things. Have you tried drawing continuously in a separate thread as in the API demos? -- Jon- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: A big OpenGL speed issue + my code contribution to other OpenGL beginners
Very cool! Thanks very much! After I get my current three projects out there I really want to dig into this. On Feb 25, 4:39 am, quakeboy prasna...@gmail.com wrote: 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 ithttp://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 likehttp://prasna991.googlepages.com/screen.png OpenGL single threaded Initialization Helper Here is my OpenGL helper class.. makes the OpenGL initialization for newbies a cakewalkhttp://prasna991.googlepages.com/OpenGLHelperclass.txt More info:- 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 ?? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: A big OpenGL speed issue + my code contribution to other OpenGL beginners
On Feb 25, 11:39 am, quakeboy prasna...@gmail.com wrote: More info:- 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 As I said before, this is a very unusual way of doing things. Have you tried drawing continuously in a separate thread as in the API demos? -- Jon --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: A big OpenGL speed issue + my code contribution to other OpenGL beginners
do any one can refer me Android consultants? On Wed, Feb 25, 2009 at 9:22 AM, Sundog sunns...@gmail.com wrote: Very cool! Thanks very much! After I get my current three projects out there I really want to dig into this. On Feb 25, 4:39 am, quakeboy prasna...@gmail.com wrote: 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 ithttp:// 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 likehttp:// prasna991.googlepages.com/screen.png OpenGL single threaded Initialization Helper Here is my OpenGL helper class.. makes the OpenGL initialization for newbies a cakewalkhttp://prasna991.googlepages.com/OpenGLHelperclass.txt More info:- 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 ?? -- Mohan Rao Erp-Specialist --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: A big OpenGL speed issue + my code contribution to other OpenGL beginners
Yes I forgot to mention that, I took pains to change code to follow the same model as in OpenGL samples and found no improvement too ! My guess is that Its either OpenGL commands memory bandwidth is very less... as I use DrawElements only and only person I have heard to get tremendous fps was using VBOs. But I cannot use VBO due to the nature of the game elements and the changing vertices. Or I am doing something wrong with OpenGL initialization code and pixel format etc ?? On Feb 26, 2:15 am, Jon Colverson jjc1...@gmail.com wrote: On Feb 25, 11:39 am, quakeboy prasna...@gmail.com wrote: More info:- 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 As I said before, this is a very unusual way of doing things. Have you tried drawing continuously in a separate thread as in the API demos? -- Jon --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: A big OpenGL speed issue + my code contribution to other OpenGL beginners
And moreover did you look at my drawFrame code... I have just two lines of code between the code to do the fps calculation !!! We have a good OpenGL development team here in our workplace who work on iPhones already. Even they were all puzzled as there is nothing complex here. and one thing one can think about is that its a hardware limitation. On Feb 26, 2:15 am, Jon Colverson jjc1...@gmail.com wrote: On Feb 25, 11:39 am, quakeboy prasna...@gmail.com wrote: More info:- 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 As I said before, this is a very unusual way of doing things. Have you tried drawing continuously in a separate thread as in the API demos? -- Jon --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---