Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. OpenGL ES and large textures
Forum Updated to NodeBB v4.3 + New Features

OpenGL ES and large textures

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 1 Posters 356 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.
  • bunjee207B Offline
    bunjee207B Offline
    bunjee207
    wrote on last edited by
    #1

    Greetings Qt enthusiasts,

    I'm on Windows 10 with Qt 5.11.1.

    I'm building this video browser with Qt + libVLC and recently switched to the OpenGL ES backend:

    QCoreApplication::setAttribute(Qt::AA_UseOpenGLES);
    

    Coming from the Desktop OpenGL backend I immediately noticed how faster it was at resizing windows, and it felt like the proper way to go.

    Unfortunately when playing a 1440p video the CPU usage increases and the rendering gets slower, like way slower than classic OpenGL. Is there a flag or some configuration to alter OpenGL ES behavior with larger textures that update frequently.

    PS: my player is based on vertex and fragment shaders for rendering (https://github.com/omega-gg/Sky/blob/master/src/SkMedia/src/media/WBackendVlc.cpp#L371).

    1 Reply Last reply
    0
    • bunjee207B Offline
      bunjee207B Offline
      bunjee207
      wrote on last edited by
      #2

      For the record here are the shaders I'm currently using:

      /* virtual */ const char * WBackendVlcShader::vertexShader() const
      {
          return "#version 100\n"
      
                 "attribute highp vec4 vertex;"
                 "attribute highp vec2 fragment;"
      
                 "uniform highp mat4 position;"
      
                 "varying highp vec2 vector;"
      
                 "void main()"
                 "{"
                     "gl_Position = position * vertex;"
      
                     "vector = fragment;"
                 "}";
      }
      
      /* virtual */ const char * WBackendVlcShader::fragmentShader() const
      {
          return "#version 100\n"
      
                 "uniform sampler2D y;"
                 "uniform sampler2D u;"
                 "uniform sampler2D v;"
      
                 "uniform mediump mat4 matrix;"
      
                 "varying highp vec2 vector;"
      
                 "uniform lowp float opacity;"
      
                 "void main()"
                 "{"
                     "highp vec4 color = vec4(texture2D(y, vector.st).r,"
                                             "texture2D(u, vector.st).r,"
                                             "texture2D(v, vector.st).r, 1.0);"
      
                     "gl_FragColor = matrix * color * opacity;"
                 "}";
      }
      
      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