[GEM-dev] [ pd-gem-Feature Requests-2612731 ] glsl_geometry

cyrille henry cyrille.henry at la-kitchen.fr
Sun Apr 26 18:58:16 CEST 2009



Matthias Neuenhofer a écrit :
> 

>> did you recompile Gem after my yesterday commit?
> yes but with change
> void glsl_program:: outtypeMess(GLuint outtype) {
>   m_geoOutType=outtype;
>   if(m_program && glProgramParameteriEXT) {
>     
> glProgramParameteriEXT(m_program,GL_GEOMETRY_OUTPUT_TYPE_EXT,m_geoOutType);
>   }
> was before GL_GEOMETRY_INPUT_TYPE_EXT

yep, your right, there is another typo here.
i corrected it.
it is strange it was working with this typo.
now that i corrected it, nothing changed...



>>
> use the patch with dub - easier to understand the draw types
> when you use TRIANGLE_STRIP instead of Strip there is no difference between
> TRIANGLES draw. Where is Strip defined couldn´t find it - saw it someday
> have a look at the patch
> matthias
> 

yep, thanks,
the drawing mode you send to the primitive is not the openGL drawing mode.
you can have a look at src/base/GemShape.cpp :

void GemShape :: typeMess(t_symbol *type)
{
  char c=toupper(*type->s_name);
  switch (c){
  case 'D': // default
    m_drawType = GL_DEFAULT_GEM;
    break;
  case 'L': // line
    m_drawType = GL_LINE_LOOP;
    break;
  case 'F': // fill
    m_drawType = GL_POLYGON;
    break;
  case 'Q': // quads
    m_drawType = GL_QUADS;
    break;
  case 'P': // point
    m_drawType = GL_POINTS;
    break;
  case 'T': // triangles
    m_drawType = GL_TRIANGLES;
    break;
  case 'S': // strip
    m_drawType = GL_TRIANGLE_STRIP;
    break;  
    
  default:
    error ("unknown draw style");
    return;
  }
  setModified();
}

so sending [draw foo( to the square will draw the square with GL_POLYGON...
sending draw QUAD_STRIP will draw the square with GL_QUADS.
sending draw Line / line_loop / LINE_STRIP will use gl_line_loop
draw TRIANGLE_STRIP will use gl_triangle, you have to send draw strip in order to have triangle strip.
etc.
so the drawing mode and there comments in my initial patch was right.
changing them result in unexpected behaviour.


But your patch clearly point that the drawing time of a primitive is important.
If i understand correctly, i would say that the driver automatically quad primitive into primitive that use triangle, since there is less geometry_intype than drawing mode.

Cyrille







More information about the GEM-dev mailing list