Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Why isn't OpenGL ES 2.0 / WebGL sufficient for most games and game engines?

Discussion in 'General Discussion' started by mmorpg-fps-rts-zombie, Feb 13, 2015.

  1. mmorpg-fps-rts-zombie

    mmorpg-fps-rts-zombie

    Joined:
    Jan 25, 2015
    Posts:
    22
    I've seen a number of impressive WebGL demos and games running on different browsers and operating systems as well as even mobile browsers (My 3rd generation iPad can run a number of older WebGL demos at 30+ fps).

    Since WebGL is based on OpenGL ES 2 which is a subset of OpenGL 2 (OpenGL 2.x and OpenGL ES 2 both date back to the mid-2000's) why do many game engines still offer multiple rendering systems (DX9, DX10, DX11, OGL 2.x, OGL 3.x)?
     
  2. kburkhart84

    kburkhart84

    Joined:
    Apr 28, 2012
    Posts:
    910
    Well, as far as most game engines offering different APIs, it is simply that some work better than others in different situations and needs. For example, on current hardware on windows, if you want tesselation shaders, your choice will be DX3d11, as there is no other current choice. I think the latest OGL can do it, but I'm not sure if it simply isn't ready yet or not supported by hardware yet. On the other hand, Nothing but windows(and XBOX and windows phone) support anything DX3d, so you have to use OpenGL or a software renderer there. Also, some hardware, though it supports a higher version, may well be faster with lower versions. Or simply the hardware that isn't the video card isn't advanced enough to utilize features of newer API versions even if the video card can.

    So yes, it is mostly due to wanting to support both older hardware as a fallback, and have features of newer hardware, all in the same game engine.
     
  3. mmorpg-fps-rts-zombie

    mmorpg-fps-rts-zombie

    Joined:
    Jan 25, 2015
    Posts:
    22
    But how much can the average game engine or game developer actually benefit from incorporating the features found in newer versions of DirectX and OpenGL?

    I can only imagine a very small percentage of game developers actually needing features like 64-bit floating point, hardware tessellation, instanced arrays, or compute shaders. Not for the vast majority of games being made these days (i.e. infinite runners, clickers, pixel art games, zombie apocalypse shooters).

    Also, Microsoft officially supports ANGLE (OpenGL ES 2.0 emulation layer for DirectX) which makes a separate DirectX game-engine renderer redundant.

    https://github.com/MSOpenTech/angle
     
  4. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,516
    Games are often about performance. Using the most efficient API for your target system often plays a role in that. Sure, you could technically get the same pixels drawn regardless of which API you use, but how much longer will some tasks take on some systems?
     
  5. kburkhart84

    kburkhart84

    Joined:
    Apr 28, 2012
    Posts:
    910
    Well, as an example, Unity has a target market that includes not only that average developer that doesn't need the new effects, but the crowd(yes, I said crowd, as in sizable group) that wants those new features for their games. Many devs, when given the chance, will indeed use those features, even if they don't actually need them, in order to make the games better if the game player has a system that can handle it. That is in fact the beauty of game engines like Unity(and Irrlicht, as it would do the fall backs too, though it isn't really modern or relevant anymore), that they can do the new features on newer hardware and pretty seamlessly fall back to not using them, downgrading materials, etc... on older systems as needed, and even allow you to emulate those systems' capabilities even on newer hardware. That last feature isn't perfect as it doesn't truly emulate the speed of those older systems, but at the least the rendering models, materials, shader levels, etc..., can be emulated by Unity.
     
  6. mmorpg-fps-rts-zombie

    mmorpg-fps-rts-zombie

    Joined:
    Jan 25, 2015
    Posts:
    22
    But many games don't benefit, at least meaningfully, from the performance gains provided by more efficient API's. For example, the average iOS or Android game written in C++ can be ported to Windows Phone using Angle without any major performance drawback, something advantageous with Windows Phone's small market share.

    Given the likelihood of bugs and lack of support for cutting edge graphics cards used by much fewer people, are these cutting edge features long-term beneficial?
     
  7. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,516
    You keep using the term "average" as if it means the same thing as "all".
     
    Deon-Cadme and greggtwep16 like this.
  8. mmorpg-fps-rts-zombie

    mmorpg-fps-rts-zombie

    Joined:
    Jan 25, 2015
    Posts:
    22
    I never said or implied "all". Even if that were the case, you could've presented anecdotal evidence in which one or a few games, even some flappy bird or 3d ping pong clone, actually did suffer when ported to platforms using seemingly less efficient APIs, and that would've been more beneficial to your position.
     
  9. Deon-Cadme

    Deon-Cadme

    Joined:
    Sep 10, 2013
    Posts:
    288
    You can view the benefits from many different angles... some API's make it easier for developers to build certain systems, that saves the company time and money which later on makes it easier for them to brake-even.

    Some API's give you access to exclusive functions, often hardware stuff... this might make your product a lot more interesting if a majority of your target group is sitting on the mentioned hardware.

    Some languages, API's and platforms are faster or a combination of these might be better optimized and work better together. The amount of speed that you need depends on the project... a person that wants to make a multiplayer tic-tac-toe could make it run on ancient mobile devices etc... but there are lots of technologies that developer want to use but they can't because we don't have the power to run them in real time and new technologies will arrive by the time that we can those that we wished for in the past.
    Also, this an intentional situation created on certain platforms... Microsoft want you to use DirectX and make you optimize the game for it because that makes the Windows platform the most attractive place for customers to enjoy the product.

    Wut? Sorry but what? o_O

    Cutting edge technology will be tomorrows dust in the mirror. Intel is just trying to brake into the graphics market if that is what you are thinking on but a serious gamer would still get a computer with proper AMD or INVIDIA card... Why do you think we get new consoles every once in a while? You have to know your audience and product to know how far you should target tech. Also, using a cutting edge feature might be a wonderful marketing argument.
     
    high-octane likes this.
  10. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    20,148
    Cutting edge graphics used by much fewer people? What are you talking about? NVIDIA has stated they've seen an increase in earnings of 31%. More than they were even expecting.

    It isn't surprising given the recent influx of 4K/5K monitors and needing hardware capable of driving them at acceptable speeds. Only the cutting edge cards can do it fast enough at the moment.

    http://www.wsj.com/articles/nvidia-profit-rises-31-1423691605
     
    Last edited: Feb 13, 2015
  11. mmorpg-fps-rts-zombie

    mmorpg-fps-rts-zombie

    Joined:
    Jan 25, 2015
    Posts:
    22
    Well, I heard the newest NVIDIA Tegra's (X1) will support OpenGL 4.5 and DirectX 12.

    Given the near ubiquity of OpenGL ES 2.0/WebGL capable hardware, I think this is total waste of API and graphics capability for a platform dominated (largely, not completely) by 3d ping pong and flappy bird clones, not to mention the "retro" zombie shooters that look like they were made in 1993.
     
  12. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    20,148
    Are mobile devices used solely for those purposes though? Shouldn't newer hardware consume less power due to having to spend less time rendering and at a lower clock rate? Don't forget too that mobile devices are not as low resolution as they used to be. That 7-inch screen can often be higher resolution than some big TVs.
     
    HemiMG and Deon-Cadme like this.
  13. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,516
    I didn't say you did. Your main reasoning for taking the approach you're asking about is that you don't think "most" games would suffer for it. That's quite possibly true. My point is solely that "most" isn't "all", and it's not a good idea to write things off just because "most" won't need them.

    Also, whether people need them or not doesn't necessarily correlate with whether they want them and/or whether or not they'll impact engine choice.

    What does "major" mean? It implies that there is a performance drawback. Also, what about those using Metal?
     
  14. Aras

    Aras

    Unity Technologies

    Joined:
    Nov 7, 2005
    Posts:
    4,770
    Are they using "vanilla ES2.0" or "ES2.0 with some useful extensions"?

    For example, vanilla ES2.0/WebGL does not have floating point textures (hard to make HDR rendering). Does not have EXT_texture_lod (hard to do image based lighting). Does not have derivative instructions in shaders (useful for a ton of things). All these and more are available on many OSes/GPUs as GLES2.0/WebGL extensions though, but then it becomes kinda halfway between ES2.0 and ES3.0 at least.

    In any case, generally yes - a fast GPU with some basic functionality is better than a slow GPU with fancy functionality. It is possible to make really, really, really nice graphics effects with comparatively "basic" functionality, as long as you have a fast GPU :)

    See above on extensions - many of the useful extensions are way more recent than mid-2000s.

    Multiple reasons. Some platforms don't have GLES/OpenGL (consoles, WinPhone, WindowsStoreApps). Some could have it, but typically drivers are, well, "not very good" (Windows).

    And then later iterations of each API (e.g. GLES2.0 -> 3.0, GL 2.x -> 3.x -> 4.x) bring in actually useful functionality. Though some of that is available as extensions to the old APIs too (see above).
     
  15. mmorpg-fps-rts-zombie

    mmorpg-fps-rts-zombie

    Joined:
    Jan 25, 2015
    Posts:
    22
    This is the best explanation, by far, thank you.