GUI & anti-aliasing

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
pc0de
Posts: 300
Joined: Wed Dec 05, 2007 4:41 pm

GUI & anti-aliasing

Post by pc0de »

I'd like to disable anti-aliasing during the rendering of GUI Elements.

When anti-aliasing is turned on at the device level it appears that it can't be controlled after the device is created.

Also, attempting to control it at the material level doesn't appear to work. COpenGLDriver::setRenderStates2DMode mod:

Code: Select all

--- source/Irrlicht/COpenGLDriver.cpp   (revision 2261)
+++ source/Irrlicht/COpenGLDriver.cpp   (working copy)
@@ -2238,6 +2238,7 @@
                        mat.ZBuffer=ECFN_NEVER;
                        mat.Lighting=false;
                        mat.TextureLayer[0].BilinearFilter=false;
+            mat.AntiAliasing = 0;
                        setBasicRenderStates(mat, mat, true);
                        LastMaterial = mat;
                        glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
Is this even possible?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Yes, that should work. I've just recently discussed about adding a "2D material override" to set things like filtering and which could also be used to change anti-aliasing and stuff.
pc0de
Posts: 300
Joined: Wed Dec 05, 2007 4:41 pm

Post by pc0de »

That didn't work (setting mat.AntiAliasing = 0; in setRenderStates2DMode). I tried testing it before researching what it would take to add a "2D material override".

Both images have the test patch "mat.AntiAliasing=0" compiled in. The top image has SIrrlichtCreationParameters.AntiAlias set to 0, the bottom is set to 8:
Image
Same for the left/right captures here:
Image
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Hmm, I'll check and also try to find some way to configure the anti-aliasing. Moving to bugs forum to track it, maybe you want to add a feature request to our official tracker: https://sourceforge.net/tracker2/?atid= ... unc=browse
pc0de
Posts: 300
Joined: Wed Dec 05, 2007 4:41 pm

Post by pc0de »

Added to the tracker: 2686141. Thanks.
robmar
Posts: 1125
Joined: Sun Aug 14, 2011 11:30 pm

Re: GUI & anti-aliasing

Post by robmar »

Did anyone find a method to disable GUI anti-aliasing?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: GUI & anti-aliasing

Post by hybrid »

Well, somehow this thread moved to the wrong forum. So now moving it on to bug forum. But the tracker is closed, so maybe it works now as expected. This would mean that you simply set antiAlias to zero in the 2doverride material
robmar
Posts: 1125
Joined: Sun Aug 14, 2011 11:30 pm

Re: GUI & anti-aliasing

Post by robmar »

Just tried this, but it didn´t disable GUI anit-alias:-

m_video_driver->enableMaterial2D();
video::SMaterial& material2D = m_video_driver->getMaterial2D();
material2D.AntiAliasing = 0;
REDDemon
Developer
Posts: 1044
Joined: Tue Aug 31, 2010 8:06 pm
Location: Genova (Italy)

Re: GUI & anti-aliasing

Post by REDDemon »

as workaround simply disable antialiasing. render GUI at full resolution, and render the scene to a texture with desired resolution. Then scale that texture to fit the screen and use a screen quad. You will have nice gui at full resolution, and performance of rendering the scene to a smaller resolution.

(are you working too to a gui plugin based ? XD your windows looks very nice :) )
Junior Irrlicht Developer.
Real value in social networks is not about "increasing" number of followers, but about getting in touch with Amazing people.
- by Me
robmar
Posts: 1125
Joined: Sun Aug 14, 2011 11:30 pm

Re: GUI & anti-aliasing

Post by robmar »

ouch! my cpu will melt! thanks for the idea though!
REDDemon
Developer
Posts: 1044
Joined: Tue Aug 31, 2010 8:06 pm
Location: Genova (Italy)

Re: GUI & anti-aliasing

Post by REDDemon »

well usually antialiasing like your case is done on CPU, while using render to texture should force that do happens on videocard (should, maybe certain drivers already do AA on video card)
Junior Irrlicht Developer.
Real value in social networks is not about "increasing" number of followers, but about getting in touch with Amazing people.
- by Me
robmar
Posts: 1125
Joined: Sun Aug 14, 2011 11:30 pm

Re: GUI & anti-aliasing

Post by robmar »

Its a sure thing, all recent video cards do AA on the gpu otherwise it would just all slow down to a stop!!
Post Reply