Results 1 to 3 of 3

Thread: generating meshes from opengl glDraw* calls

  1. #1
    Member Contributor
    Join Date
    Jul 2018

    generating meshes from opengl glDraw* calls


    is there a way to store the generated mesh from a glDraw* call?

    I have seen a mesh full of vertices and vertex information stuffed in VBOs and then rendered out with the glDrawArrays() call.

    But can I store the drawn result from the glDrawArrays as a new mesh? The thing i am expecting to get after the glDrawArrays() call are interpolated vertices. so in a sense i have a denser mesh than the one i started out with - i.e. in the beginning, I just had the vertices that were used by glDrawArrays to create the 3d object.

  2. #2
    glDrawArrays doesn't generate a mesh. The mesh information is in the VBO. Interpolation takes place on the GPU, between the vertex and fragment shader. I suppose you can take the position information at the fragment shader level and output the value to some render buffer (RGBA32F), but that is not mesh information.
    Perhaps what you want is gluProject to transform your vertices to window space? Or eye space? Or clip space?

  3. #3
    Senior Member Regular Contributor Rosario Leonardi's Avatar
    Join Date
    Aug 2008
    If your vertex shader is doing some vertex animation (bending, skinning or waving) or you have a geometry shader that add vertex or you are using a tessellation shader you can read the vertex with transform feedback.

    If you are not doing anything of the above.. then.. well you can read the data with transform feedback, but you will read the same data you have send, and that's embarrassing.
    ~ ~ I tell you, realtime 3D is made of blood, sweat and screams! ~ ~

Similar Threads

  1. Replies: 3
    Last Post: 07-01-2015, 01:52 PM
  2. glBitmap or glDraw/ReadPixels
    By vbovio in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 09-28-2006, 09:04 AM
  3. Generating Meshes
    By ianr44 in forum OpenGL: General
    Replies: 3
    Last Post: 01-26-2004, 06:18 PM
  4. glDraw/ReadPixels
    By JoeMac in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 11-29-2001, 04:28 AM
  5. gldraw
    By guest in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 08-07-2001, 04:48 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