5 Replies Latest reply on Oct 18, 2013 12:26 PM by nic

    Basic GLSL problems - garbled sprite textures on HD Graphics

    Jeff

      I'm having some problems with point sprite textures on the Intel HD Graphics card that comes with the Dell 790.  The textures produce random garbage each frame.  If I remove the Fragment shader, the texture appears fine, but upside down and the gl_PointSize and fading (fog) doesn't work.  While trying to work with the removed frag shader, I've tried changing the PointParameter to use GL_POINT_SPRITE_COORD_ORIGIN, GL_LOWER_LEFT but it has no effect on the upside down texture. I've tried multiple drivers, to include the latest.  I can't figure out what Intel has implemented here... what works on every other system is not working - HELP

       

      Vertex Shader

      #version 110

      uniform float pointSize;

      uniform float pointScale;

      uniform float gui;

      uniform float fogval;

      varying vec4 vFragColor;

       

      void main(void) {

          gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;

          vec4 modv = vec4( gl_ModelViewMatrix * gl_Vertex );

          vFragColor = gl_Color;

          float fogscale = 1.5;

          if(fogval == 8000.0) {

              fogscale = 2.0;

          }

          if(gui == 0.0) {

              gl_PointSize = pointScale * pointSize/ -modv.z;

              float fog = fogval/ -modv.z;

              if (fog < fogscale) {

                  vFragColor = smoothstep(0.0, fogscale, fog) * vFragColor;

              }

          } else {

              gl_PointSize = pointSize;

          }

          gl_FrontColor = vFragColor;

      }

       

      Fragment Shader

      #version 110

      uniform sampler2D tex;

      varying vec4 vFragColor;

       

      void main() {

          gl_FragColor = texture2D(tex,gl_TexCoord[0].st) * vFragColor;

      }

        • 1. Re: Basic GLSL problems - garbled sprite textures on HD Graphics
          Jeff

          Bump - Please Please help! I'm ripping my hair out!

          • 2. Re: Basic GLSL problems - garbled sprite textures on HD Graphics
            Diego_Intel

            Hello,

             

            Let me forward this information and let me check what would be the appropriate channel of support for this concern and get back to you.

            • 3. Re: Basic GLSL problems - garbled sprite textures on HD Graphics
              Jeff

              Thanks - Here is what I ended up doing, not a fix, but a work around specifically for Intel HD Graphics cards.

               

              If the card reports "HD Graphics Family" then I exclude the fragment shader.  If it reports "HD Graphics" minus "Family" then I include the fragment shader, but have to modify the vertex shader as follows.

              #version 110

              uniform float pointSize;

              uniform float pointScale;

              uniform float gui;

              uniform float fogval;

              varying vec4 vFragColor;

               

              void main(void) {

                  gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;

                  vec4 modv = vec4( gl_ModelViewMatrix * gl_Vertex );

                  vFragColor = gl_Color;

                  float fogscale = 1.5;

                  if(fogval == 8000.0) {

                      fogscale = 2.0;

                  }

                  if(gui == 0.0) {

                      gl_PointSize = pointScale * pointSize/ -modv.z;

                      float fog = fogval/ -modv.z;

                      if (fog < fogscale) {

                          vFragColor = smoothstep(0.0, fogscale, fog) * vFragColor;

                      }

                  } else {

                      gl_PointSize = pointSize;

                  }

                  gl_FrontColor = vFragColor;

                  gl_TexCoord[0] = gl_MultiTexCoord0;   

              }

              I'm not sure what the differences from the Intel HD Graphics Family vs the Intel HD Graphics driver sets are.  I seem to get the Family ones from Dell, and the non-family ones from Intel.  However, they're both Intel installers.  The card is a HD Graphics 2000 that comes in the Optiplex 790.

               

              I think one problem I had was that while I defined pointScale as a float, I might have been sending it an "int" in the app, which was causing an issue when I tried to adjust the pointSize.  The image being flipped up side down was due to me flipping it using GL_POINT_SPRITE_COORD_ORIGIN, but I only flip it if it reports as upside down.  This was part of the issue I was having - I would load a simple black and white image (2 pixels vertically).  If I could see the image (pixels the correct color) the shader was good, if they were in the right order, coord origin was good, but the Intel drivers, unlike every other system I've tested, reported the same thing regardless.  It always said the shader was good (it could see the image), when it couldn't (at least when viewed visually -  which is why I had to manually make exceptions) and it reported upside down, when in fact it was rightside up, but if you flip it, it still reports as upside down.  It seemed to always report the pixel was white, regardless.

              • 4. Re: Basic GLSL problems - garbled sprite textures on HD Graphics
                Diego_Intel

                Jeff,

                 

                I wanted to let you know that our OpenGL team was able to replicate this, so hopefully a fix will be available in a new driver update, however an estimated time for this is not yet provided.

                 

                Thank you for bringing up this information.

                • 5. Re: Basic GLSL problems - garbled sprite textures on HD Graphics
                  nic

                  Hi Jeff,

                   

                  This issue should be resolved in one of our latest drivers, and any drivers afterwards.  Please test with this driver and let me know if the issue persists.  https://communities.intel.com/docs/DOC-21232

                   

                  Thanks,

                  -Nic