Hardware-accelerated OpenVG implementation on Desktop based on OpenGL ES [closed] - windows

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
I'm currently trying to get OpenVG up and running on my desktop. The problem comes here: I am / will be developing an application for a Windows CE device (with .NET compact framework), which has hardware-accelerated OpenGL ES 2.0 and OpenVG 1.0.1 (based on TI OMAP35x, if you're interested). The application will definitely use OpenVG for drawing, and likely OpenGL for some effects if OpenVG doesn't offer them (i.e. blur).
Now I'd like to develop on my desktop without the emulator (see this question). So I thought I just import OpenVG with P/Invoke, which was quite easy, since the OpenVG people made their constants into real enums, and though a procedural C API, it translated very well into an object-oriented form (with a Graphics class for drawing and Path, Paint, Stroke and Image objects). I also managed to get going with differently named DLLs and entry points. Oh, and I imported EGL 1.3, also quite easy to translate to an object-oriented API.
Until this point, it sounded quite good. I thought I'd just use the OpenVG reference implementation from Khronos, but it is slow. Really slow. You know, like clearing the surface taking literally a second! So I thought, fine, OpenVG is a standard, I'll just take one of the other implementations. Most of them are based on OpenGL, which is what I want. Or isn't it?
No, it's not. Creating an OpenGL ES 2.0 surface with EGL 1.3 (supplied with the PowerVR Windows Emulation SDK for OpenGL ES 2.0) is not compatible with any OpenVG implementation I tried. Some of them require traditional OpenGL (AmanithVG GLE), the EGL version supplied by PowerVR doesn't support OpenVG. Most implementations don't even have EGL and use some bizarre functions to initialize the context - all of them assuming that an OpenGL context has already been created. OpenGL, not OpenGL ES. Sigh.
The only one I could get to work was AmanithVG SRE, which is very fast for a software implementation and does not rely on OpenGL or EGL. It works, but it is still far too slow for real time animations.
I can't believe that these things feel so wrong. I'm really tempted to just use WindowsMobile.DirectX.Direct3D, for which PowerVR supplies an emulation layer for Desktop Windows, in the hope that the final Board Support Package will supply Direct3D as an OpenGL ES wrapper, like it seems to be on many devices.
So, the question, finally:
Is there any OpenVG implementation for Windows Desktop systems that works with OpenGL ES 2.0? Bonus points if it works smoothly with PowerVR's OpenGL ES 2.0 emulation and the supplied EGL 1.3.
Or should I just try to use a traditional OpenGL 2.0 implementation on the Desktop? But they're typically not supplying EGL as well. I don't want to have two initialization layers (EGL and WGL). Or should I?
Note: this is not a .NET question, because the problem is the very same without .NET.

I found a closed source OpenGL ES emulator for OpenGLES 2.0 and other versions from this site while searching for a solution to another problem I had:
http://www.malideveloper.com/developer-resources/tools/opengl-es-20-emulator.php
Its closed source but it appears you can use it for your development purposes.
Other then that, you could write your own abstraction layer that can switch between OpenGL and OpenGL ES -- I couldn't find one available from my searches. If you find one, let me know because that is what I am trying to do.

Related

OpenGL software rendering alternatives

I need to software render OpenGL in Windows and have already found about Mesa3D, which doesn't provide DLLs and I'm having some pain to build... Are there alternatives available?
That depends on what OpenGL version you wish to accelerate. Depending on your needs, there are some alternatives available. I've listed those I'm aware of below:
OpenGL 1.0 & 1.1
Windows (since Windows NT 3.5) actually includes an OpenGL software implementation to begin with. If you haven't installed any other software rasterizer, this ought to be your default implementation. The Microsoft software rasterizer supports either OpenGL 1.0 or 1.1, depending on your platform, but will not accelerate anything newer than that. If your desired OpenGL version is covered by 1.0 or 1.1 (however unlikely), the solution should be sufficient. I'm unsure as to what extent the default Windows OpenGL software implementation covers the OpenGL ES 1.x frameworks through its OpenGL 1.0 or 1.1 support.
OpenGL 1.4
Furthermore, in Windows Vista, Microsoft included an emulation layer which may translate OpenGL into Direct3D; thus supporting up-to OpenGL 1.4. Additionally, this should mean that Windows Vista (and up?) runtimes may accelerate most parts of OpenGL SC. I've never used this emulator myself, and was quite surprised to hear about it, but it may be of interest to someone having to run one of these old frameworks in a Windows environment.
Note that the standard Windows OpenGL software rasterizer (OpenGL 1.0 or 1.1) is also included in Windows Vista and above.
OpenGL ES 2.0
Additionally, there's the ANGLE project which accelerates WebGL and OpenGL ES 2.0 by translating OpenGL ES 2.0 invocations to DirectX 9 and 11. Their development notes also mention that an OpenGL ES 3.0 solution is in the works. Never having used ANGLE, I cannot offer a verdict.
OpenGL 3.1
In addition to those mentioned above, Mesa 3D (which supports up to OpenGL 3.1) feature three software implementations:
swrast
softpipe
llvmpipe
Since I know very little of swrast (the original Mesa project software rasterizer) and softpipe (a reference driver) I'll refrain from going into these. The third implementation, llvmpipe, and probably the one that may interest you the most, is a high-speed software implementation that uses multithreading and JIT compilation to speed up simulation with native- and SIMD instructions.
I have used Swiftshader from Transgaming for a production project before and I must say, it was brilliant. A tad costly, but brilliant.
As far as I've searched, the only other option is using WebGL software renderer, that as of today only Chrome supports. Direct3D has the reference driver (which is really unstable) and Swiftshader, which is good and expensive.
After some more headaches I managed to build Mesa3D for Windows, but only an old version which had still some support for it. At least, it has an awesome performance.

Are GDI, GDI+ and OpenGL really obsolete/deprecated? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
If you open the page "Graphics and Gaming (Windows)" on microsoft.com
the last category is described as
Legacy Graphics: Technologies that are obsolete and should not be used in new
applications.
This category includes (among others) the following APIs:
GDI
GDI+
OpenGL
What's your opinion? If i want to roll out a new software today it must support Windows XP (still about 50% of all installed systems). Direct2D requires Windows 7/Vista. What else should be used?
I suspect that Microsoft's definition of "legacy" has little to do with what any sensible developer should do, and is instead based on some Grand Rewrite of the Windows API.
Starting at around Windows Vista, Microsoft has been redesigning many of their API's. We now have MMDevAPI as the One True Sound API, WIC is the One True Image File API, etc. From what I've seen/heard, these new API's are much better than the old ones, and the "legacy" systems all work based on the new ones. In Windows Vista and later, DirectSound is entirely based on MMDevAPI, and components that need to read image files do it via WIC.
Windows 8 will have an ARM version, which it appears will support only a subset of the current Windows API. We won't know for sure until Windows on ARM is released, but, based on the libraries included for the ARM platform in Visual Studio 11 (ref: http://www.winehq.org/pipermail/wine-devel/2012-March/094559.html), it's looking like GDI+ and OpenGL will not be available. GDI is available for linking, but that doesn't necessarily mean it's intact.
This new API's from Vista and later roughly correspond to the libraries in the VS11 ARM target. I'm guessing that anything on that list is there because it's either the latest and greatest way to do what it does, or it's too technically important to discard (for now). Thus, "legacy" is anything that's not the latest and greatest way to do at least one thing.
I'm not sure what is the One True Graphics API. Already we have Direct2D, Direct3D, DirectComposition (which, by the way, is not available until Windows 8), DirectWrite, and DXGI. DXGI seems the closest, but I don't have a deep enough understanding of the graphics API's to say. I suspect gdi32 is technically very difficult to get rid of. How are non-legacy applications meant to find out when part of a window has been revealed and therefore must be painted, without using WM_PAINT, which involves an HDC, and how could a library do that on an application's behalf without replacing its window procedure? How are we meant to make semi-transparent windows without using UpdateLayeredWindow, which takes an HDC? How much does user32 depend on gdi32, and can they really be separated?
From a technical standpoint, Windows can easily get rid of GDI+ and OpenGL, but I'm not convinced that getting rid of OpenGL will work out, even on a new platform that doesn't promise any backward compatibility. It seems too valuable to developers. GDI+ isn't so important, but it's very easy for a third party to provide a replacement.
I would say use any of the API's you listed, and the worst that's likely to happen is that you have to rewrite your UI if you want to port your app to metro or Windows on ARM. GDI is a fine choice if your needs are simple and you'll be coding directly for the Windows API. There aren't many situations where I'd recommend GDI+ over OpenGL as a drawing API. GDI+ is slow, limited, and only available on Windows. The GDI+ API is simpler because it's 2D, so maybe it's worthwhile if you need to do something very simple but with anti-aliasing.
OpenGL isn't deprecated, Microsoft's implementation of it is. Microsoft's implementation is stuck at version 1.1, which is old. The current version of the standard is past version 4. If you want to use OpenGL, it is fully supported by NVidia, ATI, and Intel graphics cards on the Windows desktop, but not in Metro Windows Modern UI apps, is an industry standard, and also works on Mac and Linux. If you need a software fallback implementation, Mesa has got you covered, and it even works on DOS. (Since Mesa can render into memory buffers, there's no reason it won't work in Modern UI apps, but you probably don't want to do this because it can be slow.) One thing of note is that WGL, the API for accessing OpenGL functionality on the Windows desktop, depends on GDI (which is deprecated) so you probably want to use something like FreeGLUT or SDL instead if you want to future-proof your application, which also nets you platform independence.
OpenGL ES is a variant of OpenGL which works on Android and Apple iOS. It is also accessible in JavaScript via WebGL, which Internet Explorer 11 will support (and pretty much every other browser already does.) ANGLE provides a hardware-accelerated implementation of GLES for Windows which piggybacks off of DirectX (version 9 or 11) and thus should work in Modern UI apps as well. Once again, Mesa's got the software implementation covered.
TL;DR: OpenGL is not only not deprecated, it is cross-platform, standard, and has tremendous momentum in the industry. GDI and GDI+, well, not so much.
If you want to support Windows XP, then you're supporting a "legacy" operating system, and as such, using a "legacy" graphics framework is the logical choice.
Even if that weren't true, let's just say that I disagree with the advice given by the linked MSDN article. The "legacy" status here has more to do with which technology the Windows team thinks is cool this week. The status designation of "obsolete" just means that the group responsible is no longer accepting or fulfilling bug reports (except for critical security issues). Not too big of a deal—these technologies have been around long enough that they're fairly feature-complete and stable.
GDI isn't going anywhere, so if you need something rock-solid that is guaranteed to be supported anywhere and everywhere, that's what I would go with.
If you need a bit more 2D capabilities than GDI offers (e.g., alpha channel transparency), then you could consider using GDI+. It's nearly an order of magnitude slower than GDI, but that's not too big of an issue on modern machines with more power than you could ever want. This, too, is going to be supported for a very long time to come.
That said, if I were writing a new app today, I probably wouldn't bother with OpenGL. There's very little that it offers in benefits over Direct2D and DirectWrite, which are both what Microsoft is pushing as the replacements for GDI/GDI+. There might be some benefit to using OpenGL if you absolutely must target Windows XP because as far as I can tell, Direct2D/DirectWrite are only supported on Vista and later, but that's because (as I mentioned originally), Windows XP falls squarely into the "legacy" or "obsolete" camp itself. Alternatively, if you already know OpenGL well and don't have time or the desire to learn Direct2D/DirectWrite, then it might make sense to continue using it in a new application.
Don't let the verbiage of the MSDN article scare you. Choose whatever technology makes the most sense for your specific use case given all of the available information. By the time any of these technologies go away completely, you'll have to re-write the app completely for a dozen other reasons.
Edit: Hmm, it looks like DirectWrite has also been declared (by some people at least) "obsolete" as well, having been replaced by Direct2D. That's funny, it hasn't even been around long enough for me to bother learning it. I guess that only goes to support my earlier argument that "obsolete" simply designates that a particular technology is not what is currently considered to be in vogue by the Microsoft devs.
I'm personally waiting until all the bugs get worked out of this stuff (and we decide on a semi-permanent standard) before I make the switch for any of my applications. Everything I've seen written in DirectDraw or Direct2D has had serious rendering bugs and is a performance nightmare, even on reasonably competent machines. Sure, they only show up sometimes, under the right conditions, but that's too much for me. And I swear, the blurry text shows up all the time. Not being able to read what's on screen is a deal-killer for me and my users. GDI doesn't have this problem, and it's not going anywhere.
Are GDI, GDI+ and OpenGL really obsolete/deprecated?
This is not true for OpenGL. OpenGL 4 allows you to use geometry shaders on winxp. Which isn't possible with DirectX (DirectX 10 and up isn't supported on WInXP). It is also one of the only cross-platform 3D APIs out there.
From a business point of view MS is interested in promoting DirectX since it is their technology that lock Developer into windows platform (they're also interested in making DirectX more attractive for developer, but that's another story). So it makes sense that they aren't keen on promoting OpenGL.
What else should be used?
I'd advise to stop using platform-specific tecnologies when possible. Grab cross-platform framework and use it for your application. There's Qt, GTK, wxWidgets and other toolkits for GUI apps, and SDL(and alternatives) for games. This way when platform developer decide to make ridiculous decision (like not supporting DX10 on WinXP) you dislike, you'll be able to move elsewhere with minimum development cost. Qt is also ridiculously powerful and at the moment I have no reason to use something else for GUI development. Still, situation can change in the future.
In short, while developing for certain platform you should keep in mind that platform developer might have their goals that are not compatible with your wishes. Discovering that your source has become locked into single platform isn't very pleasant experience. Your own goals should be the first priority, and if os developer tries to make you use certain technology you don't like, then you shouldn't support that technology.
Because OpenGL is a standard, it should be considered equally deprecated as C or C++ so it is a matter of time before the entire Windows API -- which today has become a compile once run on every x86 machine API thanks to Wine -- is considered deprecated in favour of .NET and C#.
I use GDI for simple graphics and OpenGL, when I need accelerated 3d.
Another aspect is that Microsoft's build-in implementation of OpenGL is definitely to be considered as deprecated since it is just version 1.1 or something, but that has been for a long time.
Yeah, about OpenGL, it actually outperforms DirectX in many ways both resource and display wise. It will never be promoted by Microsoft because it can't own OpenGL, not to mention most people don't do their research and Microsoft can claim it is old. Truth is opengl is opensource standard and evolves at a much faster rate than closed does because it is more than 1 room of developers paid to work on it. Also Microsoft has contracts with many companies to release using only Microsoft's software, this causes more business for Microsoft and less to use the more advanced OpenGL standard. It is a interesting lock up if you will, Microsoft creates these contracts so that many programs are written in DirectX to keep business for Microsoft, and no company will refuse it because Microsoft has about 80%+ home user market.

Using OpenGL ES on the Mac

Is it possible and not too complicated to use OpenGL ES for OS X development. I have been writing Mac applications for three years now and I am ready to start learning about OpenGL, but I want use OpenGL ES because there is a lot of information about using it with Xcode and Objective-C and from some of the code samples I found it seems easier to learn than the full OpenGL.
Thanks!
OpenGL-ES 1.1 is a true subset of OpenGL-2, ES-2 is a subset of OpenGL-3, the main difference is, how the context is created and managed. However context creation and management happen outside of OpenGL actually. So as long as you stick to OpenGL-ES, minus extensions specific to ES (i.e. OES extensions) you can do with an ordinary OpenGL context of the right version.
There are OpenGL-ES compatibility profiles, but those just disable functionality, don't add new one.

OpenGL ES 2.0 debugging [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
So, I have an OpenGL ES 2.0 app. It compiles and runs in the iPhone/iPad simulators, on a real iPhone/iPad, and under Windows using Imgtec's emulator libraries (i.e. PVRVframe).
In said app, I have one particular draw call that results in no pixels written to the target, even though all the state I can query looks sensible (viewport, depth test/stencil test/cull/blend off, framebuffer complete etc), and AFAICT I am submitting sensible vertex data.
What I'm after at this point is a Pix / GPAD - like tool that will let me step through the scene and review state I cannot directly query from OpenGL at the point of the draw call in question (e.g. actual vertex/index buffer content).
Neither PVRTrace nor the OSX instruments appear to capture enough state for debugging this kind of problem. In particular, they do not capture vertex/index buffer or texture data (OSX instruments doesn't capture shader source either).
gDEBugger, previously the answer to this sort of question on Stack Overflow, is now at version 5.8 - it's gone free, which is nice, but no longer supports OpenGL ES 2 (under Windows, no ES2-renderable config is available through EGL; under OSX, there is no way to attach the debugger to an app running either in the simulator or on the real device) - which is not as nice.
Am I missing something obvious? What are my options? How do others debug their scenes?
There are several OpenGL ES 1.1/2.0 debugging tools from GPU vendors. Almost these tools require real device, but Imagination Technologies provides an emulation libraries and a tracing tool which you used. Did you use PVRTrace with PVRVFrame?
PowerVR (Imagination Technologies)
PVRVFrame is an emulation libraries for OpenGL ES 1.1/2.0 on OpenGL. And GL calls can be traced by PVRTrace with GUI.
PVRTrace can also connect with Linux ARMv7 devices.
Adreno (Qualcomm)
Adreno Profiler can trace GL calls with Adreno devices, such as Android with Snapdragon. Nexus One and many devices.
It can render GL calls that are executed on the target device.
WEBINAR: OPTIMIZE YOUR APP WITH ADRENO PROFILER
Tegra (NVIDIA)
PerfHUD ES has Frame Debugger as Adreno profiler. It require Tegra Development Kit.
Mali (ARM)
Mali GPU Performance Analysis Tool. It require Mali device. AFAIK, there are no Mali devices in the consumer market at the moment.
(I believe that gDEBugger 5.7 is the best tool for debugging OpenGL ES 1.1/2.0. But it is no longer available...)
It's possible in Xcode since version 4.2, c.f.
https://developer.apple.com/library/ios/documentation/DeveloperTools/Conceptual/WhatsNewXcode/Articles/xcode_4_2.html#//apple_ref/doc/uid/00200-SW5
I have found that gDebugger 5.7 for Windows IS still available here:
http://files.gremedy.com/downloads/gDEBugger-5_7.msi
I modified this URL from the one found at the top of this download page:
view-source:http://www.gremedy.com/downloading.php?platform=windows32
It may be possible to access the same version for other platforms via the same trick.
An old license file is available here:
http://www.geeks3d.com/20101207/3d-programming-gdebugger-advanced-opengl-debugger-now-free/
But it expired on Jan 31st, 2011.

What percentage of Windows boxes have OpenGL support [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I've been thinking about starting a new graphics project and I want to use Java. Java has wrappers for all of the relevant GL functionality but I wonder how many people, including casual users, actually have decent GL drivers installed. By decent, I mean somewhat stable and fairly new (GL 1.5 support would probably do although the GLSL support that comes with 2.0 would be great). I could DirectX, even with Java, but I pretty much hate it and this project is supposed to be 'fun'. Also, I like the at least near-cross-platformedness of GL. So, anyone know of any non-imaginary stats on what percentage of Windows users have the drivers to run a GL app?
The Steam Hardware Survey is probably the best and most detailed source for info about what gamers have. Accurate statistics for the general population will be harder to come by. Instead, you should look at this in terms of how recent you want the graphics hardware. For example, any ATI chip from the R300 series (Radeon 9550+) onward supports OpenGL 2.0. On the NVidia side, any GeForce 6000+ series chip will support OpenGL 2.0, and their predecessors, the FX series, almost supported OpenGL 2.0. The R300 series and the FX series were both introduced in 2002, so if you know what portion of your target market is using a PC from 2003 or later, you'll have a fairly good idea of how widespread OpenGL 2.0 support is among users with discrete graphics.
If you want to support integrated graphics (which are the largest segment of the market, but aren't particularly common with those who are serious about graphics of any kind) your users will need at least a GMA X3000 for hardware acceleration of OpenGL 2.0 features, which means their system has to be from 2006 or later.
If you're interested in support on other operating systems, any Intel Mac will support OpenGL 2.0 with software fallbacks, and hardware acceleration whenever the chip would support it under Windows. On Linux, any system with Mesa 7 or later (June 2007 or later) will support OpenGL 2.0 software rendering. Hardware acceleration is less reliable, but there are decent open-source drivers for ATI chips from R300 and newer.
Every modern day video card supports OpenGL ... Shouldnt you be questioning how many Windows boxes have the Java runtime?
As I recall, Windows XP comes with 1.1 support out of the box. Vista upgrades this to 1.5. So you can at least count on those as an absolute minimum.
Apart from that, the GPU drivers from pretty much any vendor gives you at least 2.0 support.
But if I were you, I'd reconsider DirectX. I don't know what you hate about it, but it does have some advantages. The tool support is vastly better (ie, there are tools available. And PIX is nothing short of amazing), the API is up to date, and well designed, rather than accumulated over 20 years of a committee working at cross purposes, and if this is limited to Windows anyway, cross-platform doesn't really matter. (On the other hand, of course, if you do need cross-platform capabilities, it doesn't really matter what else DirectX can offer, it won't deliver that one killer feature)
Nearly everybody has SOME form of OpenGL support. Experience has shown that the actual drivers involved can be quite poor when dealing with ATI and especially Intel hardware, but it will at least work, aforementioned bugs notwithstanding. If nothing else, Windows can fall back to its built in 1.1 (XP and earlier) or 1.4 (Vista and higher) implementation. It won't work well, but it will work.
Windows XP comes with OpenGL 1.1 (quite slow though). Windows Vista also comes with OpenGL 1.1 (but for some special applications it has OpenGL 1.4 emulator on top of D3D).
When you install a graphics driver on Windows, it installs a more OpenGL version. OpenGL 1.5 is roughly "DX9 shader model 2.0" capable hardware. How many machines have that kind of hardware depends on your target market. In traditional/hardcore games space, almost all will (see Steam Hardware Survey).
In more casual/small games space, quite a lot of machines have much older hardware (see Unity Hardware Stats - almost 30% in 2009 Q1 are older than "DX9 shader model 2.0"). Also, a lot of machines in that space do not have custom drivers; they use whatever display drivers are shipped in Windows (which do not provide anything more than GL 1.1). Again, see Unity Hardware Stats - the most popular driver versions are the ones that come with Windows.
Stability wise, I'd strongly suggest using D3D9 on Windows instead of OpenGL. Driver quality is much better for D3D9 (less crashes inside drivers, less incorrect rendering, better performance, ...).
I'd say that all Windows users have some support for OpenGL. The latest versions usually are reserved for Vista users, gamers, and developers.

Resources