Request for Max2D: Antialiasing

BlitzMax Forums/BlitzMax Module Tweaks/Request for Max2D: Antialiasing

taumel(Posted 2005) [#1]
Hi,

it would be nice if there would be the possibility to define and activate antialiasing. This would be wonderful if you're doing a vector-like-game with lines, rects,...


Greetings,

taumel


ImaginaryHuman(Posted 2005) [#2]
I think it should also be possible to draw scaled and rotated vector representations of fonts, with antialiasing. They could easily be composed from polygons.


TartanTangerine (was Indiepath)(Posted 2005) [#3]
Max already has these, it's just a simple task of working out how to turn them on :D


Grisu(Posted 2005) [#4]
If you have found out how... let me know... :)


ImaginaryHuman(Posted 2005) [#5]
I dont know that it does. I assumed the freetype library rendered the glyphs to a bitmap/pixmap and then blitz uploaded the pixmaps as textures - not the same thing.


TartanTangerine (was Indiepath)(Posted 2005) [#6]
I was talking about Antialiasing which is the subject of this post.


TartanTangerine (was Indiepath)(Posted 2005) [#7]
OpenGL

Lines :-
GlEnable GL_LINE_SMOOTH
GlEnable GL_BLEND
glBlendFunc GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA
glHint GL_LINE_SMOOTH_HINT, GL_NICEST

Polys :-
GlEnable GL_POLYGON_SMOOTH
GlEnable GL_BLEND
glBlendFunc GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA
glHint GL_LINE_SMOOTH_HINT, GL_NICEST

DIRECTX:-
Lines:-
primarydevice.device.SetRenderState D3DRS_ANTIALIASEDLINEENABLE,True

Polys:-
Const D3DRS_ANTIALIAS = 2
primarydevice.device.SetRenderState D3DRS_MULTISAMPLEANTIALIAS,True
primarydevice.device.SetRenderState D3DRS_ANTIALIAS,True



taumel(Posted 2005) [#8]
Hi Tim,

yes but wouldn't it be nice just to have a basic command for it?

Hmm with your settings (glBlendFunc) you will get some problems drawing ovals and rects...but thanks for the DirectX-Settings! :O)


Greetings,

taumel


TartanTangerine (was Indiepath)(Posted 2005) [#9]
Hmmn the polys stuff don't work properly. Try changing the D3DRS_ANTIALIAS setting to 1 or 2.
Const D3DANTIALIAS_SORTDEPENDENT = 1
Const D3DANTIALIAS_SORTINDEPENDENT = 2



taumel(Posted 2005) [#10]
Hi Tim,

i just tried your directX example and it doesn't work...still jaggies...


Greetings,

taumel


TartanTangerine (was Indiepath)(Posted 2005) [#11]
Works great for me :)


Hotcakes(Posted 2005) [#12]
Probably a similar problem to Blitz3D antialiasing. Works for some, not for others.


Dreamora(Posted 2005) [#13]
Yepp is the same: DX7 does not support todays card antialias just the old antialias that is not supported anymore.
Due to that: You can't with DX7 and thus shouldn't use it in OpenGL as well if you allow the user to choose their driver.


taumel(Posted 2005) [#14]
I wonder, if after the 3D module will be there, there will be a updated Max2D which is built on openGL2 and DirectX9 when there is time...


Greetings,

taumel


ozak(Posted 2005) [#15]
If you use 2D, why not use the alpha channel and add a smooth edge to your sprites?


tonyg(Posted 2005) [#16]
... because it's for lines, rects, ovals and polys.


ozak(Posted 2005) [#17]
So? Texture them with an alpha texture (I sincerely hope that's possible :)


tonyg(Posted 2005) [#18]
You could use access OGL and DX drivers but couldn't do it with 'native' commands. Indiepath did a drawtexturedpoly code which will work for polys and rects but ovals and lines????


TartanTangerine (was Indiepath)(Posted 2005) [#19]
Ovals and lines are Polys :D


tonyg(Posted 2005) [#20]
Does your code texture them? I've never thought to try.