Part of the Khronos Group

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 2 of 2

Thread: Discarding vertices possible using element array buffer?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Junior Member Newbie
    Join Date
    Jun 2013

    Discarding vertices possible using element array buffer?

    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 :

    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);

    Click image for larger version. 

Name:	snapshot1.jpg 
Views:	170 
Size:	20.5 KB 
ID:	1202
    Last edited by samvdj; 12-18-2013 at 06:15 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts