draw2DRectangleOutline

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Seraph
Posts: 68
Joined: Wed Oct 21, 2009 5:58 pm

draw2DRectangleOutline

Post by Seraph »

i have placed this function in the main loop:

driver->draw2DRectangleOutline(rect< s32 >(263,650,415,658),SColor(255, 255, 255, 255));

I don't understand why, during the execution, it changes thickness from 1 to 2 pixels :?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Maybe it's a problem with anti-aliasing settings. Some versions of Irrlicht, together with certain video drivers, tend to render thicker lines instead of anti-aliased lines. You might want to check out a mor recent version of Irrlicht from SVN where these issues should be fixed.
Seraph
Posts: 68
Joined: Wed Oct 21, 2009 5:58 pm

Post by Seraph »

my version is the 1.6, the last. the video driver is the opengl. It is sufficient to change the video driver? What type of video driver is the best in this case?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Since d3d does not do line smoothing without multi-sampling you won't see this in any driver besides OpenGL. Since the 2d material is not configurable in versions prior to 1.7 you need to recompile the engine or wait for 1.6.1. Simply set the anti-aliasing settings in the 2d render mode method to disabled.
Seraph
Posts: 68
Joined: Wed Oct 21, 2009 5:58 pm

Post by Seraph »

Simply set the anti-aliasing settings in the 2d render mode method to disabled.
I'm sorry but i can't find the correct parameter, what is the function?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

mat.AntiAliasing=video::EAAM_OFF;
It's in COpenGLDriver.cpp, line 2513 for latest 1.6 SVN branch
Seraph
Posts: 68
Joined: Wed Oct 21, 2009 5:58 pm

Post by Seraph »


SMaterial mat;
driver->setMaterial(mat);
mat.Thickness=10;
mat.setTexture(0, 0);
mat.Lighting = false;
mat.AntiAliasing=video::EAAM_OFF;
driver->draw2DRectangleOutline(rect< s32 >(263,673,314,681),SColor(255, 255, 255, 255));
:? the problem is the same. I have set the thickness to 10 but the line is tiny. Why this code are not applied to the displayed RectangleOutline?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Eh, no, that won't work. You have to change it in COpenGLDriver.cpp All other settings are simply overwritten by the driver setup code. Changing this from the app is only possible in 1.7 or later.
Seraph
Posts: 68
Joined: Wed Oct 21, 2009 5:58 pm

Post by Seraph »

but EAAM_OFF don't mean that it is disabled? i must change this row with what? mat.AntiAliasing=video::DISABLED?

thanks for the help :D
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

You have to change and recompile the engine, not your app. This cannot be altered from outside the engine in 1.6 or earlier.
Post Reply