polygon smoothing with jit.gl.sketch

Nov 3, 2007 at 10:34pm

polygon smoothing with jit.gl.sketch

has anybody figured out how to enable polygon smoothing?

i’m trying to implement the following code (from the red book, http://
http://www.glprogramming.com/red/chapter06.html#name2).

glCullFace (GL_BACK);
glEnable (GL_CULL_FACE);
glBlendFunc (GL_SRC_ALPHA_SATURATE, GL_ONE);
glClearColor (0.0, 0.0, 0.0, 0.0);

glClear (GL_COLOR_BUFFER_BIT);
glEnable (GL_BLEND);
glEnable (GL_POLYGON_SMOOTH);
glDisable (GL_DEPTH_TEST);

here’s the message i’m sending to jit.gl.sketch (i’m using ortho
projection)

reset, glmatrixmode projection, glloadidentity,
glortho 0. 640. 480. 0. -5. 5., glmatrixmode modelview, glloadidentity,
glcullface 2, glenable cull_face, glblendfunc 10
1, glclearcolor 0. 0. 0. 0., glclear, glenable blend, glenable
polygon_smooth, gldisable depth_test, glcolor 1. 1. 1. 1.,
dim 200 200, glpushmatrix, glbegin quads, gltexcoord 0. 1., glvertex 91
135, gltexcoord 1. 1., glvertex 339 154,
gltexcoord 1. 0., glvertex 335 380, gltexcoord 0. 0., glvertex 75 367,
glend, glpopmatrix,

am i using the wrong clear function? the red book recommentds
color_buffer_bit, but it’s not clear how to access it.

thanks,

jeremy

#34444
Nov 4, 2007 at 12:00am

polygon smoothing doesn’t work on OSX in general. If you want
antialiasing on geometry you have to use fsaa.

wes

On 11/3/07, Jeremy Rotsztain wrote:
>
> has anybody figured out how to enable polygon smoothing?
>
> i’m trying to implement the following code (from the red book, http://
> http://www.glprogramming.com/red/chapter06.html#name2).
>
> glCullFace (GL_BACK);
> glEnable (GL_CULL_FACE);
> glBlendFunc (GL_SRC_ALPHA_SATURATE, GL_ONE);
> glClearColor (0.0, 0.0, 0.0, 0.0);
>
> glClear (GL_COLOR_BUFFER_BIT);
> glEnable (GL_BLEND);
> glEnable (GL_POLYGON_SMOOTH);
> glDisable (GL_DEPTH_TEST);
>
>
>
> here’s the message i’m sending to jit.gl.sketch (i’m using ortho
> projection)
>
> reset, glmatrixmode projection, glloadidentity,
> glortho 0. 640. 480. 0. -5. 5., glmatrixmode modelview, glloadidentity,
> glcullface 2, glenable cull_face, glblendfunc 10
> 1, glclearcolor 0. 0. 0. 0., glclear, glenable blend, glenable
> polygon_smooth, gldisable depth_test, glcolor 1. 1. 1. 1.,
> dim 200 200, glpushmatrix, glbegin quads, gltexcoord 0. 1., glvertex 91
> 135, gltexcoord 1. 1., glvertex 339 154,
> gltexcoord 1. 0., glvertex 335 380, gltexcoord 0. 0., glvertex 75 367,
> glend, glpopmatrix,
>
> am i using the wrong clear function? the red book recommentds
> color_buffer_bit, but it’s not clear how to access it.
>
> thanks,
>
> jeremy
>

#116259
Nov 4, 2007 at 3:16am

thanks wes, how would this be supported in jitter? with shaders?

jeremy

On Nov 3, 2007, at 8:00 PM, Wesley Smith wrote:

> polygon smoothing doesn’t work on OSX in general. If you want
> antialiasing on geometry you have to use fsaa.
>
> wes
>
> On 11/3/07, Jeremy Rotsztain wrote:
>>
>> has anybody figured out how to enable polygon smoothing?
>>
>> i’m trying to implement the following code (from the red book,
>> http://
>> http://www.glprogramming.com/red/chapter06.html#name2).
>>
>> glCullFace (GL_BACK);
>> glEnable (GL_CULL_FACE);
>> glBlendFunc (GL_SRC_ALPHA_SATURATE, GL_ONE);
>> glClearColor (0.0, 0.0, 0.0, 0.0);
>>
>> glClear (GL_COLOR_BUFFER_BIT);
>> glEnable (GL_BLEND);
>> glEnable (GL_POLYGON_SMOOTH);
>> glDisable (GL_DEPTH_TEST);
>>
>>
>>
>> here’s the message i’m sending to jit.gl.sketch (i’m using ortho
>> projection)
>>
>> reset, glmatrixmode projection, glloadidentity,
>> glortho 0. 640. 480. 0. -5. 5., glmatrixmode modelview,
>> glloadidentity,
>> glcullface 2, glenable cull_face, glblendfunc 10
>> 1, glclearcolor 0. 0. 0. 0., glclear, glenable blend, glenable
>> polygon_smooth, gldisable depth_test, glcolor 1. 1. 1. 1.,
>> dim 200 200, glpushmatrix, glbegin quads, gltexcoord 0. 1.,
>> glvertex 91
>> 135, gltexcoord 1. 1., glvertex 339 154,
>> gltexcoord 1. 0., glvertex 335 380, gltexcoord 0. 0., glvertex 75
>> 367,
>> glend, glpopmatrix,
>>
>> am i using the wrong clear function? the red book recommentds
>> color_buffer_bit, but it’s not clear how to access it.
>>
>> thanks,
>>
>> jeremy
>>
>

#116260
Nov 4, 2007 at 3:37am

What are you trying to do? Polygon smoothing has polygon ordering
issues and is thus not a good solution for drawing antialiased
polygons. Have you tried fsaa?
wes

On 11/3/07, Jeremy Rotsztain wrote:
>
> thanks wes, how would this be supported in jitter? with shaders?
>
> jeremy
>
> On Nov 3, 2007, at 8:00 PM, Wesley Smith wrote:
>
> > polygon smoothing doesn’t work on OSX in general. If you want
> > antialiasing on geometry you have to use fsaa.
> >
> > wes
> >
> > On 11/3/07, Jeremy Rotsztain
wrote:
> >>
> >> has anybody figured out how to enable polygon smoothing?
> >>
> >> i’m trying to implement the following code (from the red book,
> >> http://
> >> http://www.glprogramming.com/red/chapter06.html#name2).
> >>
> >> glCullFace (GL_BACK);
> >> glEnable (GL_CULL_FACE);
> >> glBlendFunc (GL_SRC_ALPHA_SATURATE, GL_ONE);
> >> glClearColor (0.0, 0.0, 0.0, 0.0);
> >>
> >> glClear (GL_COLOR_BUFFER_BIT);
> >> glEnable (GL_BLEND);
> >> glEnable (GL_POLYGON_SMOOTH);
> >> glDisable (GL_DEPTH_TEST);
> >>
> >>
> >>
> >> here’s the message i’m sending to jit.gl.sketch (i’m using ortho
> >> projection)
> >>
> >> reset, glmatrixmode projection, glloadidentity,
> >> glortho 0. 640. 480. 0. -5. 5., glmatrixmode modelview,
> >> glloadidentity,
> >> glcullface 2, glenable cull_face, glblendfunc 10
> >> 1, glclearcolor 0. 0. 0. 0., glclear, glenable blend, glenable
> >> polygon_smooth, gldisable depth_test, glcolor 1. 1. 1. 1.,
> >> dim 200 200, glpushmatrix, glbegin quads, gltexcoord 0. 1.,
> >> glvertex 91
> >> 135, gltexcoord 1. 1., glvertex 339 154,
> >> gltexcoord 1. 0., glvertex 335 380, gltexcoord 0. 0., glvertex 75
> >> 367,
> >> glend, glpopmatrix,
> >>
> >> am i using the wrong clear function? the red book recommentds
> >> color_buffer_bit, but it’s not clear how to access it.
> >>
> >> thanks,
> >>
> >> jeremy
> >>
> >
>
>

#116261
Nov 4, 2007 at 3:59am

i’m just rendering a texture on a skewed plane.
ah, it just occurred to me that fsaa is supported by jit.window. thanks!
i wish i’d realized this 5 hours ago!

jeremy

On Nov 3, 2007, at 11:37 PM, Wesley Smith wrote:

> What are you trying to do? Polygon smoothing has polygon ordering
> issues and is thus not a good solution for drawing antialiased
> polygons. Have you tried fsaa?
> wes
>
> On 11/3/07, Jeremy Rotsztain wrote:
>>
>> thanks wes, how would this be supported in jitter? with shaders?
>>
>> jeremy
>>
>> On Nov 3, 2007, at 8:00 PM, Wesley Smith wrote:
>>
>>> polygon smoothing doesn’t work on OSX in general. If you want
>>> antialiasing on geometry you have to use fsaa.
>>>
>>> wes
>>>
>>> On 11/3/07, Jeremy Rotsztain
wrote:
>>>>
>>>> has anybody figured out how to enable polygon smoothing?
>>>>
>>>> i’m trying to implement the following code (from the red book,
>>>> http://
>>>> http://www.glprogramming.com/red/chapter06.html#name2).
>>>>
>>>> glCullFace (GL_BACK);
>>>> glEnable (GL_CULL_FACE);
>>>> glBlendFunc (GL_SRC_ALPHA_SATURATE, GL_ONE);
>>>> glClearColor (0.0, 0.0, 0.0, 0.0);
>>>>
>>>> glClear (GL_COLOR_BUFFER_BIT);
>>>> glEnable (GL_BLEND);
>>>> glEnable (GL_POLYGON_SMOOTH);
>>>> glDisable (GL_DEPTH_TEST);
>>>>
>>>>
>>>>
>>>> here’s the message i’m sending to jit.gl.sketch (i’m using ortho
>>>> projection)
>>>>
>>>> reset, glmatrixmode projection, glloadidentity,
>>>> glortho 0. 640. 480. 0. -5. 5., glmatrixmode modelview,
>>>> glloadidentity,
>>>> glcullface 2, glenable cull_face, glblendfunc 10
>>>> 1, glclearcolor 0. 0. 0. 0., glclear, glenable blend, glenable
>>>> polygon_smooth, gldisable depth_test, glcolor 1. 1. 1. 1.,
>>>> dim 200 200, glpushmatrix, glbegin quads, gltexcoord 0. 1.,
>>>> glvertex 91
>>>> 135, gltexcoord 1. 1., glvertex 339 154,
>>>> gltexcoord 1. 0., glvertex 335 380, gltexcoord 0. 0., glvertex 75
>>>> 367,
>>>> glend, glpopmatrix,
>>>>
>>>> am i using the wrong clear function? the red book recommentds
>>>> color_buffer_bit, but it’s not clear how to access it.
>>>>
>>>> thanks,
>>>>
>>>> jeremy
>>>>
>>>
>>
>>
>

#116262
Nov 4, 2007 at 4:25am

BTW,
If FSAA doesn’t pan out for whatever reason, you can do it yourself by
rendering to a texture and applying a smoothing convolution shader as
a slab before texture a fullscreen videoplane with the result.

wes

On 11/3/07, Jeremy Rotsztain wrote:
>
> i’m just rendering a texture on a skewed plane.
> ah, it just occurred to me that fsaa is supported by jit.window. thanks!
> i wish i’d realized this 5 hours ago!
>
> jeremy
>
> On Nov 3, 2007, at 11:37 PM, Wesley Smith wrote:
>
> > What are you trying to do? Polygon smoothing has polygon ordering
> > issues and is thus not a good solution for drawing antialiased
> > polygons. Have you tried fsaa?
> > wes
> >
> > On 11/3/07, Jeremy Rotsztain
wrote:
> >>
> >> thanks wes, how would this be supported in jitter? with shaders?
> >>
> >> jeremy
> >>
> >> On Nov 3, 2007, at 8:00 PM, Wesley Smith wrote:
> >>
> >>> polygon smoothing doesn’t work on OSX in general. If you want
> >>> antialiasing on geometry you have to use fsaa.
> >>>
> >>> wes
> >>>
> >>> On 11/3/07, Jeremy Rotsztain
wrote:
> >>>>
> >>>> has anybody figured out how to enable polygon smoothing?
> >>>>
> >>>> i’m trying to implement the following code (from the red book,
> >>>> http://
> >>>> http://www.glprogramming.com/red/chapter06.html#name2).
> >>>>
> >>>> glCullFace (GL_BACK);
> >>>> glEnable (GL_CULL_FACE);
> >>>> glBlendFunc (GL_SRC_ALPHA_SATURATE, GL_ONE);
> >>>> glClearColor (0.0, 0.0, 0.0, 0.0);
> >>>>
> >>>> glClear (GL_COLOR_BUFFER_BIT);
> >>>> glEnable (GL_BLEND);
> >>>> glEnable (GL_POLYGON_SMOOTH);
> >>>> glDisable (GL_DEPTH_TEST);
> >>>>
> >>>>
> >>>>
> >>>> here’s the message i’m sending to jit.gl.sketch (i’m using ortho
> >>>> projection)
> >>>>
> >>>> reset, glmatrixmode projection, glloadidentity,
> >>>> glortho 0. 640. 480. 0. -5. 5., glmatrixmode modelview,
> >>>> glloadidentity,
> >>>> glcullface 2, glenable cull_face, glblendfunc 10
> >>>> 1, glclearcolor 0. 0. 0. 0., glclear, glenable blend, glenable
> >>>> polygon_smooth, gldisable depth_test, glcolor 1. 1. 1. 1.,
> >>>> dim 200 200, glpushmatrix, glbegin quads, gltexcoord 0. 1.,
> >>>> glvertex 91
> >>>> 135, gltexcoord 1. 1., glvertex 339 154,
> >>>> gltexcoord 1. 0., glvertex 335 380, gltexcoord 0. 0., glvertex 75
> >>>> 367,
> >>>> glend, glpopmatrix,
> >>>>
> >>>> am i using the wrong clear function? the red book recommentds
> >>>> color_buffer_bit, but it’s not clear how to access it.
> >>>>
> >>>> thanks,
> >>>>
> >>>> jeremy
> >>>>
> >>>
> >>
> >>
> >
>
>

#116263

You must be logged in to reply to this topic.