Anti-aliasing in openGL
Im completely new to open gl, but ive seen some really nicely rendered shapes, and am wondering how you go about getting them to look smoother.
Im currently rendering planes using gridshape in order to make a cube. Then im using handle to rotate all of the planes and sketch to draw the 3D object. I was wondering if there is a way to anti-alias the planes in order to get rid of the jaggedy edges, or wether there is any way of smoothing or shading the shapes so that they look ‘nicer’.
Thanks in advance
you could try to send a fsaa 1 message to your [jit.window]
if your grafic card support this mode, it shoud work.
here the info from the [jit.window] help
Full scene anti-aliasing (FSAA) when rendering 3d graphics, can be turned on/off with the fsaa
Thanks for the quick reply,
Unfortunately I dont think this is possible as I am using jit.gl.sketch to render the plane to a named floating window and not a jit.window.
named floating windows are made with jit.window. are you thinking of in patcher windows which are jit.pwindow? if so you can still send the pwindow fsaa 1
either way fsaa should work if your graphics card supports it.
Ahh, Ive got it now. Thanks
Looks a lot smoother, is there any more processing that can be done , say to round the edges slightly or something as there still seems to be a lighter outline when rotated slightly
Thanks for the help.
can you post a patch that demonstrates what your talking about, Im not sure if I follow
|alexanderthomas wrote on Sat, 04 April 2009 13:49|
|Looks a lot smoother, is there any more processing that can be done , say to round the edges slightly or something as there still seems to be a lighter outline when rotated slightly|
The jit.gl.gridshape object (and some others) also take the antialias 1 message. It helps most in wireframe or points modes (poly_mode 1 1 or poly_mode 2 2). In points mode it turns square points into round ones, which I was quite pleased to discover as they look much nicer. However when the points get large (point_size) things do slow down considerably compared to the square ones, since it’s doing a lot of extra calculations to render them.
Not sure how the fsaa and antialias messages interact/overlap/interfere with each other…?
oh cool, the round points thing I did not know, thats great!
Thanks for all of the help. The antialias 1 message doesn’t seem to do anything when i send it to gridshape. I think the problem lies with the lighting/shading as I think the edges of the faces behind are slightly visible but are not being affected by the lighting.
Here is a simple example. Its not quite so obvious in this one as I have a live camera feed behind the real patch, but hopefully you’ll get what I mean.
----------begin_max5_patcher---------- 1476.3oc4Z1saihCEG+5zmBqn8xLQ9af8ptuD6MqFMxI3jvTBjEbTamQy69B 1NoYZBfoAHjsZFAECD96e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y35TlYjJFaP3aT8rsVx4OIK5AcbMGaz90xHq8qe8k7GQtUluwQq2n JUtLQrnX99f8tu7NTQAS8X8p8ceAY2VSn0YQg4aD6r9CM+odhH3wiK19kiUk 4weKRt.aikbyN6E7nXuJcqPEsD.6PqxB49she0rnWZtXvLM+olh8wHd0afdi euANM.3L+YiG9SBr7u9WHAheGv+BHamCbx.P.73nxaC.zQz..2sI.d2GC.tw exHh+D2l.3eeve6bfGOOW9S4OdDwenk+n54evcC+aF+nwC9wdF7iqOaPL7ih e8OmNMg28IFp0TY6+9XRd59rkG5O1uaOvahJTlWDtnnD2mbM50mN4p1DEFJ0 WvA8sMJbWZThxJBvWunER2pI1HTSdiPM4OB0TvfpIc0VbPU3AVUANoJxvpp2 Qgwgp39tHpxZNBHtKJVQvILy2tXwNF063QWobKeedNJWr6xk5yNUtH9beBgf HcjlCbVynVnY5oHl5ymi3bNi2MZVWL9FEc46znMZl.sb170uyvZNSo1ltRM6 ScUxsvzfvfmJ4BCk2vbGHYmobKl7QBnmHYJx63QWsQgSdvfsbMHJSaUfg7xc VfqO5ZoKqOjKAarHLeMxkhGd1Q9dUdDFZeWXG6lW6vB1ygtIdXCzzIMoKO4P tBb4GY3IyjpPUX+AVUHWXEdnYkSQ1gG3Xnd2yqJUMvwahcxu36Fm6cUQbJVI xPqJ2r1CtAdFvMpJuafpfiMUAcZYULbXWvge2JpAOm8wXkDbDU9iRT4OFQ0n zqv.qJGQEeThJ9XDUrQIpFXU4fl3CqOA5HLEh9OLghC90C+mogalT -----------end_max5_patcher-----------
you could try capturing your scene to a texture, and applying a blur to the texture. check out Max5/examples/jitter-examples/render/slab/jit.gl.slab.gauss6x-example.maxpat for a good blur slab to use.
search for "capture to texture" or "render to texture" or "scene process" for more information.
alexanderthomas wrote on Sat, 04 April 2009 16:25Thanks for all of the help. The antialias 1 message doesn’t seem to do anything when i send it to gridshape. I think the problem lies with the lighting/shading as I think the edges of the faces behind are slightly visible but are not being affected by the lighting.
Try this modified patch. The antialias seems only noticeable when in wireframe or points mode, though the fsaa seems to help when in solid mode. Also the line_width and point_size commands differ slightly if antialias is on or off…if it’s on, then fractional changes affect things, but if it’s off, it seems to increment only by integer amounts.
I think you can modify it to draw the gridshapes directly, without using jit.gl.sketch, which may be slowing things down? Not sure but it runs sluggishly here compared to other similar patches I’ve had. If you don’t use the sketch, you can attach the handle to jit.gl.render directly, though there’s a setting you need to change—"inherit_transform"—so it doesn’t go "all wacky". It takes a little fiddling.
----------begin_max5_patcher---------- 1825.3oc2assbiZCF95ryz2AFO8xrdzAPH0qReI5Mc1IC1HaytXvEvSR1c56 d0Av1I1fkAgQMYyZBhSe56+7uv+529xCyVj+Jubl2e382dO7vuDi7fZL4HOz LvCy1F85xznR0INa+Vd19YOVenr8aSxR4UpiAaFMohus91NqLOMId1idydT9 wKIE7UEQa4GFYWdRl7x+1I2x78UM2SbyvqxypxjWnDD+YQRT5APT81tlYwwa i9dHOTMPDOF4yS8+iml.axaX9hu+UHZ1oOrxjeptTHZNnY7cQUK2jjs94B9x J88EiHhi6ACfpM.fbCR7o22TWz+9aeQtUr4Qi43s7xxn07iSP9qpmllrdVhL ueGdYg.5x7H7h73ewKhixhl0Jo0BSAtLSA5joBBC0bCVtgFLmBD+fEjV3fXq Uo4h45UTIeOafLPq5LtP7bhTpPKhxV2Bw.6iJTPHUo6DpzjBrgFTU950o7ah SfcZ4bwoKaVGyJBxWNQH3loy3YVjljwe9kj3pMSpYAsOVE9zO8VEg8wnvm9+ TiBRmFEgH8rBXMqBAfWvKFeAcc7y1Ey3CWq.AIaEJehi.tlnWLWZNWTWpCf. MwQsl5PF+EAruPP1ne3sKO8sm2lGy8.dfKys3awixU31KSnsjOBbd.K.RC6J oj.eMAo1.gzCdUFKWvQYUhYXRToc7.2K9JnO9YHg0AnTFlR0Kl3Gpf0niCSs pLJZBII+dQRHczIswm1RjNJFehnIwRpy6Do4M4nd3LTuxgCoCiCUbiNl0XYp sZeZZ4xBNOaZKB.A6S9NDlx2My+H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MQvi4xtSHTiPmr4qd3aAcXPv7.0 KaZfLqFTyNVA0xEQ0TTitETKiwb.0HFbNEiw991D5LygN7lfN7DBGQfygDBI fXQnqVKiqic4RAcaPmpHccYgPTnhzwD8HVA4TeiA9Mot.QAmfbgtijyCQ1D4 lS42j4IjvNA4LTyNVRQwrTn.2bDCDVop.oJdul9U6YG1NXjvMSCTHU2bPPyW 4oS1iPZeu5Ut53z0NxITnISWzzjKoYfS0l1oHrt7EK8TStVfGhNQvCZD6glJ 1yrb1P3IBdXyf2DkRIxL2qeTG3dAOrYYmgmJ3YnoAaBcrftN7BmP3AbV3ALK BNBLMwzHeBP2jUmuS2FBSIOpaSdTml7bamJSD7Lk7HtM4QbZxKvsIuIBdl.N xz3Rw2kq+woSRwnZet41SdegF596HwoyryoybxoyLwoi76zQVc4HWFE0eZfl Q0W6OIPynNxNM1oTW18K0kc+RcY2uTW18K0kc+Rc5BGLqErfIpnKW1Whgnax ZRma2EL2tMStcebbZGJFks4vWMQ4.hM+GYx9D4. -----------end_max5_patcher-----------
Im using four cubes in the main patch, so I think thats why I ended up using sketch. Is this still the cheapest way? Im definitely looking for ways to optimize it too. For now I think fsaa has done the job.
Thanks for all the help
Forums > Jitter