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

Matthias Neuenhofer matthias at neuenhofer.de
Mon Apr 27 14:02:31 CEST 2009


>>>
>> 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.
ah now i got it
send draw Trip and you get Triangles, draw Soap for Strip
it just use the initial letter

but then LINE_STRIP, LINES, QUAD_STRIP and TRIANGLE_FAN are not  
available
maybe not necessary in this context

>
> 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.
the geometry_shader can´t use quads, they will cut into triangles and  
the object has to be drawn with them
when you use square as geom with only 4 vertices the plane can´t be  
filled, drawn as triangle will output an triangle half quad and drawn  
as strip connect v0 v1 v2  and v1 v2 v3 looks like this
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Bild 1.png
Type: image/png
Size: 176080 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/gem-dev/attachments/20090427/55282154/attachment.png>
-------------- next part --------------



mesh_square will provide a simple filled square in strip mode drawn

Matthias
>
>
> Cyrille
>
>
>



More information about the GEM-dev mailing list