Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QtWebEngine
  4. WebGL not working
Qt 6.11 is out! See what's new in the release blog

WebGL not working

Scheduled Pinned Locked Moved Solved QtWebEngine
4 Posts 1 Posters 5.4k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Stesteste
    wrote on last edited by
    #1

    Hi,

    I am trying to use WebGL on a page in a QWebEngineView.

    When navigating in that widget to http://webglreport.com/ I am presented with the message "This browser supports WebGL 2, but it is disabled or unavailable.".

    When I try Three.js, I get these errors:
    Uncaught TypeError: Cannot read property 'getShaderPrecisionFormat' of null
    THREE.WebGLRenderer: Error creating WebGL context.

    Other than this error, the web engine works well, e.g. I can visit YouTube and watch videos, etc. I tried to explicitly enable WebGL in the web engine settings, but that didn't change anything (and the docs say, that it's enabled by default anyway).

    What do I miss? It's not easy to debug this.

    Thanks a lot,
    Stephan

    1 Reply Last reply
    0
    • S Offline
      S Offline
      Stesteste
      wrote on last edited by
      #2

      I forgot to mention that the application I am working on uses desktop OpenGL.

      What seems to fail is that when a canvas element is asked for the webgl context, it returns null instead of [object WebGLRenderingContext] (which I get in the Chrome browser showing the same page).

      var canvas = $('#canv');
      var gl = canvas[0].getContext('webgl', { stencil: true });
      alert(gl); // null in QWebEngineView, [object WebGLRenderingContext] in Chrome browser
      
      1 Reply Last reply
      0
      • S Offline
        S Offline
        Stesteste
        wrote on last edited by
        #3

        The recent blog post http://blog.qt.io/blog/2017/07/07/qt-webgl-streaming-merged/ contains this:
        "Since WebGL was modelled using OpenGLES2 as reference, first thing you will need is to have an OpenGLES2 version of Qt built."

        As I stated in my previous post here, my application is using Desktop OpenGL. Does this mean I cannot use WebGL?

        1 Reply Last reply
        0
        • S Offline
          S Offline
          Stesteste
          wrote on last edited by
          #4

          I got help from Qt support and it's working now! I had to specify --ignore-gpu-blacklist on the commandline with my application linked against a Qt with normal desktop OpenGL. All is well! :D

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved