Advertisement

OpenGL ES on desktops

Started by August 06, 2014 01:14 AM
9 comments, last by SeanMiddleditch 10 years, 5 months ago

Is there a way to use opengl es 2 on desktops natively? I have tried searching google and found alot to do with the android emulator but not much about gles2 on windows I found mesagles that maybe a solution for linux. I would think theres got to be something how do browsers use webgl?

Chrome uses Angle, which emulates GLES2 via D3D.

Advertisement

Thanks ill look into that at first glance i just see that it translates to directx is there something else they use for linux and mac osx?

Nevermind I see they use it for mac and linux just portions of it I guess

Is there a way to do it in reverse so something already existing using opengl can run in a browser or mobile with opengles? Is there a higher language that could be used across everything? Do developers usually make multiple shaders for multiple targets?

http://www.g-truc.net/post-0457.html

Thanks looks like a good post ill read up

Advertisement

Is there a way to do it in reverse so something already existing using opengl can run in a browser or mobile with opengles? Is there a higher language that could be used across everything?

That's what game engines do - they make up their own higher level API and then implement it repeatedly for every back-end.
e.g. Not the best example, but the Horde3D graphics engine is originally built on GL, but then ported to GLES and D3D.

Do developers usually make multiple shaders for multiple targets?

The technique that I've seen most often is that you write your shaders in HLSL/Cg (pretty much the same language), with some #defines to cover up the differences between different HLSL-based back-ends. Then you use something like hlsl2glsl to support OpenGL.

We run the same render path for desktop and mobile GL. I have a "proxy" header, which defines functions like gl::Clear, gl::VertexAttribPointer, etc instead. The proxy changes a few function names as needed, and a few things are switched on either compile or runtime flags. (Not many things.) I don't try to fully emulate correct GL ES behavior on desktop; I just want my ES code to run. This proxy does that and works across Windows, Linux, Mac, and iOS.

As for shaders, I found that trying to share them across desktop and mobile was a catastrophe. I now use hlsl2glsl (linked above) with some custom patches for full Mac and ES support. I should remember to assemble those changes into a pull request some day.

SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.
You might want to try out Emscripten. It compiles fairly typical C/C++ OpenGL code to Javascript / WebGL (WebGL is a subset of OpenGL ES).

You might also like to have a look at PVRVFrame which is part of the Imagination Technologies PowerVR SDK (http://www.imgtec.com/tools/powervr-tools/). We had a talk from these guys at work and these tools certainly looked useful.
http://tinyurl.com/shewonyay - Thanks so much for those who voted on my GF's Competition Cosplay Entry for Cosplayzine. She won! I owe you all beers :)

Mutiny - Open-source C++ Unity re-implementation.
Defile of Eden 2 - FreeBSD and OpenBSD binaries of our latest game.

ARM do a devkit which includes a library which will do ES->desktop translation for GL.

Browse around at http://malideveloper.arm.com/develop-for-mali/features/opengl-es-emulator-v1-4-released/

This topic is closed to new replies.

Advertisement