Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: Geometry shader + transform feedback + triangles

Hybrid View

  1. #1
    Junior Member Newbie
    Join Date
    Mar 2011
    Posts
    12

    Geometry shader + transform feedback + triangles

    I have managed to make the example from http://cvit.iiit.ac.in/
    work on my Mac (OSX 10.6, Snow Leopard).

    I've got a very simple example that just renders 2 points, which works, i.e., I do get the points from the geometry shader in the transform feedback buffer (TFB).
    However, basically the same example that renders 2 triangles instead of the points does not work.

    You can find the two sample source codes here:
    http://zach.in.tu-clausthal.de/tmp/main_points.cpp
    http://zach.in.tu-clausthal.de/tmp/main_triangles.cpp
    They are both self-contained.

    As you can see in the source code, I render two points, have the geometry shader just pass the data through, and capture the geometry shader's output in the TFB. Then, I render the contents of the TFB again.
    This works fine.

    However, the same procedure, but with triangles instead of points, does not work.

    Can you spot anything I did wrong?

    Thanks a lot in advance for any kind of insights, pointers, or suggestions!

    Best regards,
    Gabriel.

    PS:
    Yes, it has to be GLSL 1.20

  2. #2
    Advanced Member Frequent Contributor
    Join Date
    Feb 2006
    Location
    Sweden
    Posts
    748

    Re: Geometry shader + transform feedback + triangles

    well first of all GL_GEOMETRY_OUTPUT_TYPE_EXT for the geometry shader has to be GL_TRIANGLE_STRIP in this case, The other valid types are GL_POINTS and GL_LINESTRIP
    besides from that i cant really see any problem with it directly but i wrote a few tutorial about it, take a look and see if it helps
    Geometry shaders part 1
    Geometry shaders part 2
    Geometry shaders part 3

  3. #3
    Junior Member Newbie
    Join Date
    Mar 2011
    Posts
    12

    Re: Geometry shader + transform feedback + triangles

    Thanks, that was one of the bugs in my code.
    There were some more, but now it works.

    So, for the record, here is my sample code: http://zach.in.tu-clausthal.de/softw...eedback_buffer

    G.

Posting Permissions

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