title: LWJGL Objects not shown on ATI graphics card
body: <p>I've written an LWJGL application that uses .obj files, reads them and displays them (using displaylists).</p>
  
  <p>On my nvidia graphics card, everything runs fine. But on an amd graphics card i can't see the objects.</p>
  
  <p>How i give data to the shaders:</p>
  
  <pre><code>glUseProgram(shaderEngine.obj);
  glUniform1i(glGetUniformLocation(shaderEngine.obj, "inOrangeJuice"), inOrangeJuice ? 1 : 0);
  shaderEngine.loadMatrix(glGetUniformLocation(shaderEngine.standard, "projectionMatrix"), camera.projectionMatrix);
  shaderEngine.loadMatrix(glGetUniformLocation(shaderEngine.obj, "viewMatrix"), camera.viewMatrix);
  </code></pre>
  
  <p>ModelMatrix is loaded:</p>
  
  <pre><code>shaderEngine.createModelMatrix(new Vector3f(x, y, z), new Vector3f(rx, ry, rz), new Vector3f(1, 1, 1));
  shaderEngine.loadModelMatrix(shaderEngine.obj);
  </code></pre>
  
  <p>Fragment Shader:</p>
  
  <pre><code>#version 130
  
  uniform sampler2D tex;
  uniform vec2 texCoord[4];
  
  float textureSize;
  float texelSize;
  
  uniform int inOrangeJuice;
  
  
  bool pointInTriangle(vec3 P, vec3 A, vec3 B, vec3 C)
  {
      vec3 u = B - A;
      vec3 v = C - A;
      vec3 w = P - A;
  
      vec3 vCrossW = cross(v, w);
      vec3 vCrossU = cross(v, u);
  
      if(dot(vCrossW, vCrossU) &lt; 0)
      {
          return false;
      }
  
  
      vec3 uCrossW = cross(u, w);
      vec3 uCrossV = cross(u, v);
  
      if(dot(uCrossW, uCrossV) &lt; 0)
      {
          return false;
      }
  
      float denom = length(uCrossV);
      float r = length(vCrossW);
      float t  = length(uCrossW);
  
      return (r + t &lt;= 1);
  }
  
  
  vec4 texture2DBilinear(sampler2D textureSampler, vec2 uv)
  {
      vec4 tl = texture2D(textureSampler, uv);
      vec4 tr = texture2D(textureSampler, uv + vec2(texelSize, 0));
      vec4 bl = texture2D(textureSampler, uv + vec2(0, texelSize));
      vec4 br = texture2D(textureSampler, uv + vec2(texelSize , texelSize));
      vec2 f = fract( uv.xy * textureSize );
      vec4 tA = mix( tl, tr, f.x );
      vec4 tB = mix( bl, br, f.x );
      return mix( tA, tB, f.y );
  }
  
  
  void main()
  {
      ivec2 textureSize2d = textureSize(tex,0);
      textureSize = float(textureSize2d.x);
      texelSize = 1.0 / textureSize;
  
      //texture coordinate:
      vec2 texCoord = (gl_TexCoord[0].st);
  
      bool inOJ = false;
  
      if(inOrangeJuice == 1)
      {
          float depth = gl_FragCoord.z / gl_FragCoord.w;//works only with perspective projection
          depth = depth / 6;
  
          if(depth &gt; 1)
          {
              depth = 1;
          }
          inOJ = true;
          gl_FragColor = texture2DBilinear(tex, texCoord) * gl_Color * (1.0 - depth) + vec4(1.0, 0.5, 0.0, 1.0) * depth;
      }
      if(inOJ == false)
      {
          gl_FragColor = texture2DBilinear(tex, texCoord) * gl_Color;
      }
  
      //Nothing is shown, inOrangeJuice should be 0
      //gl_FragColor = vec4(inOrangeJuice,0,0,1);
  
      //Always works:
      //gl_FragColor = texture2D(tex, texCoord) * gl_Color;
  }
  </code></pre>