Does webgl depend on the OpenGL in the OS? - macos

Mac OS does not support OpenGL anymore after MacOS 10.14 Mojave. Will the change influence the compatibility of Webgl?

Does webgl depend on the OpenGL in the OS?
Not necessarily. For instance on Windows Firefox and Chrome use ANGLE (defaulting to its Direct3D backend) to provide hardware-accelerated WebGL.

Per this post from the Apple Developer Forums:
"Apple's announcement that it is deprecating OpenGL doesn't have any impact for WebGL development using Safari. The underlying technologies might change in the future, but WebGL won't change."

Related

Why is there no GLES option in GPU Frame Capture in xcode edit scheme

I was trying to capture a gpu frame of an MAC openGL program (https://github.com/JohnTargaryen/LearnOpenGL/blob/master/src/1.getting_started/2.1.hello_triangle/hello_triangle.cpp) using xcode. The camera icon used to capture frame didn't show up when i ran the program, so I did as the link below suggested, meaning to change GPU Frame Capture to GLES. However, there is no GLES option for me to choose.
no GLES option in GPU Frame Capture in xcode edit scheme
https://developer.apple.com/documentation/metal/frame_capture_debugging_tools/enabling_frame_capture?language=objc
What's the possible cause and how I can solve it? Thx in advance!
Apple has deprecated OpenGL ES in iOS 12, the XCode GPU tools now only support the Metal API.
Also, OpenGL-ES is not available on MacOS, only OpenGL, which is also deprecated.
See the warning mention for example in https://developer.apple.com/library/archive/documentation/3DDrawing/Conceptual/OpenGLES_ProgrammingGuide/Introduction/Introduction.html
Important OpenGL ES was deprecated in iOS 12. To create high-performance code on GPUs, use the Metal framework instead. See Metal.
For OpenGL, a similar warning mention is visible :
OpenGL was deprecated in macOS 10.14. To create high-performance code on GPUs, use the Metal framework instead. See Metal.

Debugging OpenGL ES 2.0 game that runs in Windows through PowerVR emulation

I have small cross platform engine that runs my OpenGL ES 2.0 games on Android and on Windows. To run it on Windows I am using PowerVR emulator (just libraries linked to the project). It all works well.
Now I would like to debug it and inspect in any OpenGL debugger. I tried Intel GPA, AMD CodeXL, gDebugger, glslDevil. But non of them were able to do it. In case of Intel GPA it did not find the running game. In other cases it started the game but failed to pause it or do anything later.
I do not know whether it is because it is OpenGL ES instead of OpenGL. But the PowerVR emulation must work like translating OpenGL ES to OpenGL, I think?
My questions are:
Is there any (utility) way how to debug OpenGL ES 2.0 programs on Windows?
Or is there any better emulation library than PowerVR that will force the app look like OpenGL for other tools (instead of OpenGL ES)?
I am doing all this as none of debuggers work for me on Android device. I am developing with Samsung Galaxy Tab (which is Tegra GPU), but Nvida's PerfHUD ES does not currently support it (and I also do not meet Android 4.0 or higher having only 3.1)
Is there any way how to debug OpenGL ES on Android device that has Android version 3.1 and it is Samsung Galaxy Tab device?
Thanx
You're correct - PVRVFrame translates OpenGL ES calls into host OpenGL calls. This is why the likes of gDEBugger will capture the OpenGL API calls made by the emulator rather than the calls you actually submitted.
The PowerVR SDK includes an OpenGL ES/EGL API recording tool called PVRTrace that has all of the functionality you're looking for.
The PVRTrace recording libraries can be used to record applications using PVRVFrame on Windows and Linux. The SDK also includes recording libraries for Android and Linux devices.
PVRTraceGUI (analysis tool for Windows, OSX & Linux) can be used to review and inspect the data you've recorded. It also has an Image Analysis widget that allows you to step through the draw calls in your recording & some other handy features, such as a Pixel Analysis pie chart that highlights the most costly fragment shaders in your render so you know where to focus shader optimisation.
There's also a PVRTrace standalone playback tool that allows you to replay your recordings on any of the supported OS's (inc. Windows & Android).
You can find an overview of the tool on the Imagination website here & can download PVRTrace through the PowerVR SDK installer, available here
I routinely debug OpenGL ES on Windows using the PowerVR VFrame translator, which converts OpenGL ES calls to OpenGL, as you said. I think it's the best solution. VFrame has some step and tracing features, but mostly I am using the debugging features of MSVC++.
If you are using GLSurfaceView on android, it has an OpenGL ES tracing feature too. I also recommend using an X86 AVD rather than ARM or trusting the drivers on any one device. This article explains in detail:
http://software.intel.com/en-us/articles/porting-opengl-games-to-android-on-intel-atom-processors-part-1

How to do OpenGL 3 programming on OS X with a GeForce 9400

I have a MacBook Pro with a GeForce 9400 graphics card. Wikipedia said this card supports OpenGL 3.
But the header and library shipped with OS X 10.6 seems to be OpenGL 2 only (I checked the files in /usr/X11/include/).
I need to do some OpenGL 3 programming. Can I do it with my current hardware and OS? What do I need to get and install?
Sadly, I don't think you can yet, as detailed here.
I believe Lion will upgrade OpenGL to 3.2 for OS X though (which is still short of the more useful 3.3 unfortunately).
NB: I do not own a Mac, this is purely from trying to learn modern OpenGL on the windows side and digging around to understand how portable it would be.
Edit: this thread on the official OpenGL forums has more detail. Although (see comments below this answer) it may not be completely clear why vendors cannot provide OpenGL 3+ compliant drivers, it seems pretty clear that there is no way to use fully OpenGL 3.3 compliant code and shaders in OS X. Some workarounds are provided in that thread however, as well as in my first link.
The best place to check OpenGL support on the various OSX and Mac combinations is:
http://developer.apple.com/graphicsimaging/opengl/capabilities/
See the "Core" subpage for 10.7+
OpenGL 3.2 with GLSL 1.5 on 10.7.2 isn't too bad.
Your current hardware can support OpenGL 3, but not the OS. Mac OS X 10.7 (Lion) should support OpenGL 3, which is a solution only if you can wait many months.
Your only option right now is to switch to a different OS such as Windows or Linux. You'll have to boot from this other operating system, because the virtual machine systems present a virtual video card to the guest operating systems, and none have OpenGL 3 compatible virtual video cards.
(Disclaimer: This information is based on taking Windows OpenGL and replacing wgl with glX. But I did verify that the corresponding extensions exist in GLX land)
You won't find OpenGL 3 support in any header files. Rather you need the GLX_ARB_create_context extension.
The other answers are probably correct about missing support in OSX, but even when support comes, you'll have to use glXGetProcAddress and load the extension. (Can't video card manufacturers add support for these extensions through their driver? Why does it require "OS support"?)
Windows OpenGL developer here. On Windows 7 only OpenGL 1.4 is officially supported, but everyone gets around this limitation by querying which functions are available at run-time.
On OSX I expect you can do the same thing. The easiest way to do this is with The OpenGL Extension Wrangler Library: http://www.opengl.org/sdk/libs/GLEW/

WebGL on older Mac OS X versions (say 10.4)

Not really a programming related question but...
I'd like very much to experiment with WebGL on my spare time. My current 'spare time' machine is a MacBook running Mac OS X Tiger (10.4.xx) and I'm unable to find a new browser supporting this OS. Firefox dropped support, Chrome too, and Safari idem.
I read somewhere that this is due to a Quicktime bug that Apple won't fix.
Does anyone have more information on this issue ?
Does anyone have a clue or track to find a running implementation of WebGL on Mac OS X 10.4 ?
Cheers,
I know a fellow who is maintaining a Firefox 4 port to OS X 10.4.
Check out http://www.floodgap.com/software/tenfourfox/
Edit: Unfortunately I've just found out that this doesn't quite fulfil your main reason for wanting Firefox 4.
From the dev's site:
OpenGL support is presently disabled
in 10.4Fx. This is Apple's fault, as
Mozilla requires non-power-of-two
texture sizes, which require OpenGL 2.
Unfortunately, PPC Tiger does not
support OpenGL 2 at all, and only a
subset of cards support it in PPC
Leopard (the really irritating part is
that Intel Tiger does have OpenGL 2,
and OpenGL 2 came out in 2004!). It
may be enabled in the future for those
handful of configurations on Leopard,
but this won't benefit the majority of
users. Note that many graphics
features will work just fine; they
just won't be hardware-accelerated.
If you can get a build of Firefox which has WebGL to run, but don't have a GPU that supports OpenGL ES 2.0, you might want to try setting the "webgl.osmesalib" about:config option. Even simple programs will probably run at a flip-book frame rate however.

Update OpenGL libraries on windows

I'm using a 3rd party DLL which uses OpenGL. Right now that 3rd party does not work correctly as the display does not refresh correctly. I came to suspect that the OpenGL library isn't correctly installed or may be outdated.
Is there a way to update the OpenGL library on windows? Is there like an official site which will hold the correct opengl.dll file or something like that?
I believe the OpenGL libraries are just part of the drivers that ship with your graphics card. Upgrading your graphics drivers should upgrade your OpenGL stuff to the latest your card supports.
OpenGL should be up to date on Windows.
However, if you are getting display/refresh problems, and they're only occuring on windows, this is most likely an issue with your graphics driver.
Try updating to your latest OpenGL graphics driver. This fixes many OpenGL issues on Windows.
opengl.dll is part of your display card driver. Windows comes with a default opengl.dll that offers very little acceleration. Re installing the graphics card driver or upgrading to the latest version should take care of your problem.
OpenGL is implemented in the graphics driver. If you want to use the latest OpenGL version as a developer you download and use GLEW (http://glew.sourceforge.net/) as a normal library. This will give you access to cross platform OpenGL 4.1 or whatever version your card supports.

Resources