Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. The default vertexShader property of ShaderEffectItem
QtWS25 Last Chance

The default vertexShader property of ShaderEffectItem

Scheduled Pinned Locked Moved QML and Qt Quick
2 Posts 2 Posters 2.1k 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.
  • G Offline
    G Offline
    Goran
    wrote on last edited by
    #1

    There "ShaderEffectItem":http://doc.qt.nokia.com/4.8/qml-shadereffectitem.html object which which allows to alter the output of given item with OpenGL shaders. This element have some properties, such as fragmentShader, vertexShader and etc

    The default vertex shader is following:
    @ uniform highp mat4 qt_ModelViewProjectionMatrix;
    attribute highp vec4 qt_Vertex;
    attribute highp vec2 qt_MultiTexCoord0;
    varying highp vec2 qt_TexCoord0;
    void main(void)
    {
    qt_TexCoord0 = qt_MultiTexCoord0;
    gl_Position = qt_ModelViewProjectionMatrix * qt_Vertex;
    }@

    The default fragment shader is following:
    @varying highp vec2 qt_TexCoord0;
    uniform sampler2D source;
    void main(void)
    {
    gl_FragColor = texture2D(source, qt_TexCoord0.st);
    }@

    When I don't set a vertex shader property of ShaderEffectItem, for instance, QML use the default property? which i have written above ?

    P.S. Sorry for may bad English

    Any fool can write code that a computer can understand. Good programmers write code that humans can understand.

    1 Reply Last reply
    0
    • T Offline
      T Offline
      task_struct
      wrote on last edited by
      #2

      Yes. These shaders are defaults. If you don't specify one of them(or both), QML automaticaly will use default ones.

      "Most good programmers do programming not because they expect to get paid or get adulation by the public, but because it is fun to program."

      • Linu...
      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