Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-91162

PyQt3d does not support WebGL rendering

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • P2: Important
    • None
    • 5.15.0 RC2
    • QPA: WebGL
    • None

    Description

      Platform info:

      pip freeze | grep PyQt
      PyQt3D==5.15.2
      PyQt5==5.15.2
      PyQt5-sip==12.8.1
       
       
      Ubuntu 20.04
       
      I recently just tried to run the following demo code from https://github.com/zchen24/examples-Qt/blob/master/qt3d/qt3d-simple-example.py:

      With the following command

       
       

      export QSG_INFO=1
      export QT_QPA_EGLFS_DEBUG=1
      export QT_LOGGING_RULES=qt.qpa.*=true
      QT_QPA_PLATFORM=webgl:port=8998 python ./test.py
      

      Unfortunately, I tried to access 8998 with chrome and firefox, and never managed to see something different from a loading icone.

      Here are the logs on server side:
       {{qt.qpa.webgl: WebGL QPA Plugin created qt.qpa.input.methods.serialize: QIBusEngineDesc::fromDBusArgument() "(sa

      {sv}

      ssssssssussssssss)" qt.qpa.input.methods: socketWatcher.addPath "/home/user/.config/ibus/bus/57acbc52de7a41f6bcba53d2d3273731-unix-1" qt.qpa.webgl.httpserver: Listening in port 8998 qt.qpa.webgl: New offscreen surface 0x7ffd22b01a70 qt.qpa.webgl: 0x7ffd22b01a60 qt.qpa.webgl.context: Creating context 1 qt.qpa.webgl.context: 0x5565618246a0 qt.qpa.webgl: 0x7ff8080053b0 qt.qpa.webgl.context: Creating context 2 qt.qpa.webgl: 0x7ff808005730 qt.qpa.webgl.context: Creating context 3 qt.qpa.webgl: Creating platform window for: 0x556561810910 qt.qpa.webgl: New offscreen surface 0x556561879f70 qt.qpa.webgl.window: Destroying -1 qt.qpa.webgl.httpserver: ::1 requested: / qt.qpa.webgl.httpserver: ::1 requested: /webqt.js qt.qpa.webgl.websocketserver: Sending connect to QWebSocket(0x7ff80c00a490) QMap(("debug", QVariant(bool, false))("loadingScreen", QVariant(QByteArray, ""))("mouseTracking", QVariant(QByteArray, ""))("supportedFunctions", QVariant(QStringList, ("activeTexture", "attachShader", "bindAttribLocation", "bindBuffer", "bindFramebuffer", "bindRenderbuffer", "bindTexture", "blendColor", "blendEquation", "blendEquationSeparate", "blendFunc", "blendFuncSeparate", "bufferData", "bufferSubData", "checkFramebufferStatus", "clear", "clearColor", "clearDepthf", "clearStencil", "colorMask", "compileShader", "compressedTexImage2D", "compressedTexSubImage2D", "copyTexImage2D", "copyTexSubImage2D", "createProgram", "createShader", "cullFace", "deleteBuffers", "deleteFramebuffers", "deleteProgram", "deleteRenderbuffers", "deleteShader", "deleteTextures", "depthFunc", "depthMask", "depthRangef", "detachShader", "disableVertexAttribArray", "drawArrays", "drawElements", "enableVertexAttribArray", "finish", "flush", "framebufferRenderbuffer", "framebufferTexture2D", "frontFace", "genBuffers", "genFramebuffers", "genRenderbuffers", "genTextures", "generateMipmap", "getActiveAttrib", "getActiveUniform", "getAttachedShaders", "getAttribLocation", "getString", "getIntegerv", "getBooleanv", "enable", "disable", "getBufferParameteriv", "getError", "getParameter", "getFramebufferAttachmentParameteriv", "getProgramInfoLog", "getProgramiv", "getRenderbufferParameteriv", "getShaderInfoLog", "getShaderPrecisionFormat", "getShaderSource", "getShaderiv", "getTexParameterfv", "getTexParameteriv", "getUniformLocation", "getUniformfv", "getUniformiv", "getVertexAttribPointerv", "getVertexAttribfv", "getVertexAttribiv", "hint", "isBuffer", "isEnabled", "isFramebuffer", "isProgram", "isRenderbuffer", "isShader", "isTexture", "lineWidth", "linkProgram", "pixelStorei", "polygonOffset", "readPixels", "releaseShaderCompiler", "renderbufferStorage", "sampleCoverage", "scissor", "shaderBinary", "shaderSource", "stencilFunc", "stencilFuncSeparate", "stencilMask", "stencilMaskSeparate", "stencilOp", "stencilOpSeparate", "texImage2D", "texParameterf", "texParameterfv", "texParameteri", "texParameteriv", "texSubImage2D", "uniform1f", "uniform1fv", "uniform1i", "uniform1iv", "uniform2f", "uniform2fv", "uniform2i", "uniform2iv", "uniform3f", "uniform3fv", "uniform3i", "uniform3iv", "uniform4f", "uniform4fv", "uniform4i", "uniform4iv", "uniformMatrix2fv", "uniformMatrix3fv", "uniformMatrix4fv", "useProgram", "validateProgram", "vertexAttrib1f", "vertexAttrib1fv", "vertexAttrib2f", "vertexAttrib2fv", "vertexAttrib3f", "vertexAttrib3fv", "vertexAttrib4f", "vertexAttrib4fv", "vertexAttribPointer", "viewport", "blitFramebufferEXT", "renderbufferStorageMultisampleEXT", "getTexLevelParameteriv", "makeCurrent", "swapBuffers")))("sysinfo", QVariant(QVariantMap, QMap(("buildAbi", QVariant(QString, "x86_64-little_endian-lp64"))("buildCpuArchitecture", QVariant(QString, "x86_64"))("currentCpuArchitecture", QVariant(QString, "x86_64"))("kernelType", QVariant(QString, "linux"))("machineHostName", QVariant(QString, "supercomputer"))("prettyProductName", QVariant(QString, "Ubuntu
      20.04.2 LTS"))("productType", QVariant(QString, "ubuntu"))("productVersion", QVariant(QString, "20.04")))))) qt.qpa.webgl: 0x7ff80c00a490, Size: 1848x912. Physical Size:490.755838x242.191193 qt.qpa.webgl.httpserver: ::1 requested: /favicon.png qt.qpa.webgl: Connecting first client in the queue (0x7ff80c00a490) qt.qpa.webgl: Creating platform window for: 0x556561810910 qt.qpa.webgl.window: Window 1 created qt.qpa.webgl: Created platform window 0x5565618b7890 for: 0x556561810910 qt.qpa.webgl.websocketserver: Sending create_canvas to QWebSocket(0x7ff80c00a490) QMap(("height", QVariant(int, 912))("title", QVariant(QString, "test.py"))("width", QVariant(int, 1848))("winId", QVariant(qulonglong, 1))("x", QVariant(int, 0))("y", QVariant(int, 0))) qt.qpa.webgl.context: 0x5565618b7890 qt.qpa.webgl.websocketserver: Sending gl_command makeCurrent to 0x7ff80c00a490 with 4 parameters qt.qpa.webgl.websocketserver: Sending gl_command glGetIntegerv to 0x7ff80c00a490 with 1 parameters qt.qpa.webgl: gl_response message received QJsonObject(

      {"id":1,"type":"gl_response","value":32}

      ) qt.qpa.webgl.websocketserver: Sending gl_command glGetIntegerv to 0x7ff80c00a490 with 1 parameters qt.qpa.webgl: gl_response message received QJsonObject(

      {"id":2,"type":"gl_response","value":null}

      )}}
      On client side, some js logs:

      VM20 webqt.js:919 Calling: gl.getIntegerv [36664] 0: 36664 length: 1 proto: Array(0) VM20 webqt.js:921 WebGL: INVALID_ENUM: getParameter: invalid parameter name

      WebGL warning: getParameter: pname: Invalid enum value <enum 0x8f38>

      It looks like the above warning is linked to the value sent not being correct with respect to this set of definitions (example for opengl): https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glGet.xhtml

      or as part of webgl: https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Constants#standard_webgl_1_constants https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Constants#additional_constants_defined_webgl_2 https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Constants#constants_defined_in_webgl_extensions

      However I don't see 8F38 (=36664) anywhere there, I suppose there is an issue there.

      A first getIntegerv succeed, as the pname used is "gl.MAX_TEXTURE_IMAGE_UNITS (34930)" but the property 36664 does not correspond to a valid pname, so I guess there is a protocol version mismatch somewhere

      But I am not sure if this is the biggest issue

      In the end, I only see a green loading sign that cycles forever, and not the actual 3d webgl rendering I was expecting. Any idea ?

      Edit: I tried to check what was happening on the client side. Basically, javascript is stuck on the following function from webqt.js

      window.onload = function ()

      Edit2: I checked and validated support for webgl2 for my webbrowser on https://get.webgl.org/webgl2/
      with the following environment:

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            jefernan Jesus Fernandez
            mctob Tobbey McNamara
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes