I would like to ask if Android always uses the EGL library for rendering 2D Graphics? Or it is using other libraries? I have noticed in the DisplayHardware.cpp and FramebufferNativeWindow.cpp that egl functions are always called when posting buffer etc.
Check out this vid Learn about Android Graphics !
At 6:30 the graphics architecture is exdplained. I recommend watching the whole thing tough. Lots of useful information.
Related
I'm planning to run an app based on (GNOME) libclutter on Android 9 (Pie). I'm quite new to these graphics related stuff, been wondering on these things, so seeking for guidance/direction whatever data that could help me to understand this thing better.
As per the documentation of Android Graphics, Android is using OpenGL ES & Vulkane at low level to render objects. And as per GNOME Clutter documentation, it could be only compiled with mentioned back-end only! (Please check embedded link to for platforms details.)
I don't see OpenGL ES or Vulkane support, So am I missing something on understanding part or it can't be done?!
[Clutter maintainer, here]
Yes, Clutter supports OpenGL ES—it uses Cogl, a library that abstracts GL and GLES concepts.
No, Clutter does not support Vulkan at the moment.
No, Clutter and Cogl do not support Android; there was an experimental port but it has been abandoned in 2012.
Additionally, Clutter is in deep maintenance mode: no new development releases, no new features, and only minimal/security/crasher bug fixes are allowed.
I would not recommend using Clutter in a newly written project.
OKay...after spending few more hours, I was able to figure out an answer! (Yayy..!!!)
As per Clutter Project website: (somehow I had missed this info previously! :p)
Clutter uses OpenGL for rendering (and optionally OpenGL ES for use on mobile and embedded platforms), but wraps an easy to use, efficient, flexible API around GL's complexity.
So, as per my requirement, I should be able to integrate and cross-compile Clutter lib source and compile it.
PS: I will try to integrate & build the libclutter on android 9. Will update this answer latter with additional set of information.
==========================================================================
Update:
As pointed out by #ebassi in another answer, I have dropped the idea of integration and looking forward to directly using Android Graphics stack for the implementation.
Thanks #ebassi...!
I would like to use OpenGL graphic on Android games and read some basic tutorial articles. I think it is very difficult, lenghty and long-time taking to prepare OpenGL code by hand. What is the practical way to prepare OpenGL code in real. Are there any editors to generate OpenGL objects code or any software it can help in generating of OpenGL code ? How do the companies prepare OpenGL projects ?
Quick response: Do some research with google for "android 3d engines" and pick the one that meets your needs.
From an opensource perspective, use any open graphics library out there (#andengine #libgdx #shadingzen...) as the main framework so that you don't need to write much of the complex OpenGL code. For creating 3D meshes you can use #Blender which supports many export formats and you can even write your own in python. There are some tons of examples on how to use Wavefront (.obj) objects in OpenGL (e.g. https://github.com/TraxNet/ShadingZen/blob/master/library/src/main/java/org/traxnet/shadingzen/core/shapes/OBJMesh.java).
There is not a OpenGL-code-generating-tool as you may think. OpenGL is an API which allows you to manage GPU driver states which is not enough to display objects, you also need to either write your own 3d engine (even if its very simple) or use any of the already made ones out there.
And again, do some research and find the workflow and the engine that meets your needs.
OpenGL is freakingly difficult to learn, for a newbie to Graphics programming. If you are comfortable with Java, then I would recommend you look into LibGDX. The way Libgdx or in fact any other gaming engine works is, they hide the difficulty of OpenGl programming by writing wrappers around OpenGL programs. So if you are comfortable with higher level language such as Java then working in Libgdx is much easier. Then you are good to go about your game.
The reason I have recommended Libgdx is clearly simple,
A) From outside i find they have a very active forum and lot of test code, demos.
B) Also the particle editors from Libgdx is something exceptional from a free Open Source point of view.
C) The ability to verify the output in the desktop is something exceptional, it saves hell lot of time.
It looks like AND engine or cocos2d the other free open source engines are no more as active as earlier. Probably they are having good time in Zynga ville :)
I would like to create an android game but one thing I do not understand is what I should use to create the graphics for it,
It is going to be a 2d game with movable images but would I use OpenGL ES or something else?
You should use OpenGl ES to get the best performance. Alternatively you could use Canvas drawing which is the default way of drawing in Android...
But the easiest way of creating an Android game probably by using Unity 3D...
Not Java development thoe :)
Try it via libgdx
it is easy to use.
Thanks
LibGDX is a fast library that is essentially a wrapper around OpenGL, saving you a lot of time. Unfortunately the documentation around it is severely lacking, so there is quite a steep learning curve, but once you are used to the library development is very fast.
It also gives you the option to run your code as a java application instead of the android emulator, which saves a lot of time.
There are a few good tutorials on the wiki to help you get started, but you will ultimately have to rely on the Java Docs and the test code to see how to use the library properly.
There are other options such as AndEngine, which is easier to learn but has less flexbility and runs slower, so ultimately you are better off with LibGDX.
when I was working with XNA model format was obvious .X or .FBX, they had bones so I was able to do animation and collision detection, they probably had everything I needed. But now I started to work with Android and OpenGL ES and I can't seem to find anything about preferred model formats, I keep seeing .OBJ but they don't support bones, I also read something about collada and md5 formats but heard there are some problems with loading them? Also suggestions with min3d but I don't like the idea using third party stuff.
Could someone please explain a bit the situation with models and OpenGL ES, why there are no preferred obvious choices(at least from my point of view), and what format or solution should I go with?
Also this is my first question, please write suggestions if I didn't explain myself right or made any other question errors.
OpenGL ES is much much more low level than XNA, it does not provide anything related to 3d models 'management', and thus, has no preferred model/file format or bone management.
Basically, if you don't like the idea of using 'third party stuff', then you'll have to pick whatever 3d model format you see fit, and do it all on your own.
OpenGL ES is basically a specification, nothing more, the 'SDK' provided by Khronos contains only 1 library. Generally, development resources are provided by the various hardware vendors, in the form of code samples.
I want to know OpenGL Version that VTK 5.6.1 implement because I want to create android application that use vtk.I will use VTK visualize DICOM image and present them on screen.
I know Android OS implement OpenGL ES but I don't know VTK 5.6.1 OpenGL version.if VTK OpenGL's version is 4.1 that support OpenGL ES,it mean I can use vtk 5.6.1 to create android application,right.
Thanking you for assistance in advance.
This is highly related to your other question about using VTK on Android. As I said in response to that question, VTK does not currently support Android (or other embedded systems). The base OpenGL version used by much of VTK is 1.1, but quite a few of the classes test for various OpenGL extensions and use them optionally. Porting VTK to OpenGL ES (1.x or 2.0) is non-trivial, but some initial work has begun. See this post for a little more background.
I have been doing some work on the iOS and Android platforms, largely concerned with using OpenGL ES 2.0 from C++ on both platforms (NDK on Android). The results were promising, but it will take time to port a significant portion of VTK. OpenGL ES 2.0 and Open GL 2.1 are quite similar in their API, but they are not identical.
I'm not entirely sure what your purpose/context is regarding using VTK on android, but if you are talking about reading in VTK files and rendering the objects on android, I can give you an explanation (and perhaps some code) on how to do that. I'm currently programming an app that takes in a legacy-VTK ASCII file and renders the image using opengl. Like Marcus said, its non-trivial, and a little bit rough, but I used basic indexOf and tokenizer/split methods to search through the vtk file for the vertices, indices, normals, and text. coords and put them into buffers. I see this is an old thread, so I'm not going to explain any further/give out code unless someone wants it.