Hi all,
I'm trying to use the discard; command in my fragment shader to eliminate vertices with a specific color. When displaying using 2D textures, borderline effects can be eliminated by setting the third parameter in glTexParameterf to GL_NEAREST:
Code :glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER,GL_NEAREST); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,GL_NEAREST);
However, when I display my object in 3D using an element array buffer, I want to achieve the same functionality... Any idea how to do this equivalently?
Code :__glewBindBuffer(GL_ELEMENT_ARRAY_BUFFER, indexBuffer); //glTexParameterf(GL_ELEMENT_ARRAY_BUFFER, GL_TEXTURE_MAG_FILTER,GL_NEAREST); // <- Looking for appropriate function glPolygonMode(GL_FRONT_AND_BACK, wireFrame ? GL_LINE : GL_FILL); glDrawElements(GL_TRIANGLE_STRIP, 2*(width-1)*(height-1), GL_UNSIGNED_INT, 0); glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); __glewBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
![]()