Results 1 to 5 of 5

Thread: 'True' Quadrilateral Interpolation on AMD?

  1. #1
    Member Contributor
    Join Date
    Jan 2011
    Posts
    78

    'True' Quadrilateral Interpolation on AMD?

    On following the recommendations of this thread, I tried to achieve 'true quadrilateral interpolation' via a geometry shader as was suggested in slide 21 of an NVIDIA presentation.

    I modified the ogl-330-primitive-smooth-shading sample in Groovounet's OpenGL Sample Pack as follows:
    1)Changed the colors to match NVIDIA's presentation
    2)Added the directive 'layout (lines_adjacency) in' to the geometry shader.
    3) Create a static ELEMENT_ARRAY_BUFFER buffer whose contents held the following indices: { 0,1,3,2 };
    4)Bound the named ELEMENT_ARRAY_BUFFER to the Right side rendering, and updated the draw call to the following:
    Code :
    glDrawElementsInstancedBaseVertex(GL_LINES_ADJACENCY, 4, GL_UNSIGNED_SHORT, NULL, 1, 0);
    However, the result of the rendering is the 'backslash' split that is referred to in NVIDIA's presentation. If I don't use geometry shader, the result is the 'slash' split. Is this a limitation of ATI/AMD hardware (no true QUAD support?) or am I doing something incorrectly. The code is running on an ATI Radeon HD 5000 series.

  2. #2
    Senior Member OpenGL Lord
    Join Date
    Mar 2015
    Posts
    6,674

    Re: 'True' Quadrilateral Interpolation on AMD?

    I tried to achieve 'true quadrilateral interpolation' via a geometry shader as was suggested in slide 21 of an NVIDIA presentation.
    Where in those slides does it say that use of only a geometry shader will result in bilinear interpolation?

    The lines_adjacency stuff is just to be able to send four vertices (aka: a quad) to the geometry shader without using GL_QUADS (which is removed in core). The geometry shader still has to write two triangles, which is exactly what you would get with GL_QUADS. Interpolation is still being done by the triangle.

    To get proper bilinear interpolation, you need to use a fragment shader.

  3. #3
    Member Contributor
    Join Date
    Jan 2011
    Posts
    78

    Re: 'True' Quadrilateral Interpolation on AMD?

    Quote Originally Posted by Alfonse Reinheart
    To get proper bilinear interpolation, you need to use a fragment shader.
    Is it possible to do bilinear interpolation without some form of texture lookup?

  4. #4
    Senior Member OpenGL Lord
    Join Date
    Mar 2015
    Posts
    6,674

    Re: 'True' Quadrilateral Interpolation on AMD?

    Is it possible to do bilinear interpolation without some form of texture lookup?
    I didn't say anything about a texture lookup. It's a matter of passing the right data to the fragment shader and having it do the interpolation manually.

    Basically, you pass a gl_PointCoord-like value that represents where on the surface the fragment is. This value will interpolate reasonably over a quad's surface.

    Unfortunately, you also need to pass all four of the coordinates you want to interpolate to each vertex (with a "flat" interpolation qualifier), so that the fragment shader can use the gl_PointCoord-like value to do the interpolation manually. So you will use up a lot of inputs/outputs.

  5. #5
    Member Contributor
    Join Date
    Jan 2011
    Posts
    78

    Re: 'True' Quadrilateral Interpolation on AMD?

    Thanks for the info. Definitely sounds like something that isn't worth the trouble.

Similar Threads

  1. Texture Mapping from a skewed quadrilateral to a Rectangle
    By atg2012 in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 09-14-2012, 10:04 AM
  2. Intersecting Line Against Quadrilateral
    By bcthund in forum OpenGL: General
    Replies: 2
    Last Post: 10-31-2010, 06:02 PM
  3. Exception in a very simple Quadrilateral program !
    By Aditi in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 02-02-2009, 11:42 AM
  4. Display Quadrilateral
    By subhash_r in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 04-28-2005, 09:59 PM
  5. Display Quadrilateral
    By subhash_r in forum OpenGL: Advanced Coding
    Replies: 0
    Last Post: 04-28-2005, 09:59 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean