Qt 5.7 | Qt 3D | Qt 3D: Deferred Renderer C++ Example | geometry_gl2.vert Example File

Qt 5.7.1 Reference Documentation

# geometry_gl2.vert Example File

deferred-renderer-cpp/geometry_gl2.vert

      #version 110

      attribute vec4 vertexPosition;
      attribute vec3 vertexNormal;

      varying vec4 color0;
      varying vec3 position0;
      varying vec3 normal0;

      uniform mat4 mvp;
      uniform mat4 modelView;
      uniform mat3 modelViewNormal;
      uniform vec4 meshColor;

      void main()
      {
          color0 = meshColor;
          position0 = vec3(modelView * vertexPosition);
          normal0 = normalize(modelViewNormal * vertexNormal);
          gl_Position = mvp * vertexPosition;
      }