December 10, 2010

AquilaRapax AquilaRapax
Lab Rat
8 posts

QGLWidget does strange drawings

 

Hi everyone,

i’d like to use OpenGL in a project. So, to get a starting point, i tried the 2DPainting example, playing a litte around. One of the first things i did, was switching antialiasing on and off, getting a strange effect. As you can see on the no-antialized picture, the circle-corners are some kind of, well, false-drawn.

no antialiasing

When i turn on antialiasing, the circles don’t have those weird corners, but aren’t as round and smooth as in native mode.

antialized

So now, i’m not sure, if i still should use opengl. Sure, i could (and probably would) turn on antialiasing, but i wonder, why the quality is worse compared to the native mode… Or did anyone have a suggestion if i forgot something. I had the idea, that maybe double-buffering could solve the problem!?

AquilaRapax

10 replies

December 10, 2010

Bradley Bradley
Lab Rat
314 posts

Sounds like a graphics driver issue. Do you have the most recent graphics driver for your system installed?

 Signature 

Nokia Certified Qt Specialist.

December 10, 2010

AquilaRapax AquilaRapax
Lab Rat
8 posts

Yes i do… Updated just a week ago to the newest driver available.

But good remark, i didn’t tell my system configuration. I’m working on Win7 Prof., with an Geforce 8800GTS. Maybe it could be a problem with nvidia-cards, because i tested the program on my notebook, with Win7, equipped with a nvidia 9650M GT, and had the same problem. But i think, other people would have reported the same issue.

December 10, 2010

Bradley Bradley
Lab Rat
314 posts

I don’t have a system with a similar config. Perhaps someone else here has a similar system and can take a closer look at it for you. However, like you said, I think it would have been seen and reported by now. For the record, can you also report your Qt version?

 Signature 

Nokia Certified Qt Specialist.

December 10, 2010

AquilaRapax AquilaRapax
Lab Rat
8 posts

Sure. I’m using Qt v. 4.7.1 for Windows (VS 2008). It would be nice, if someone could do this. :)
Thanks in advance…

December 11, 2010

Deleted Member # 4a2 Deleted Member # 4a2
Ant Farmer
1481 posts

you can run benchmark and check how your driver/gpu card is doing with this free s/w here [ozone3d.net]

December 11, 2010

AquilaRapax AquilaRapax
Lab Rat
8 posts

Hi chetankjain,

i did the benchmark, but everything seemed to be normal. the score was nearly the score of equal graphic cards. The only thing that differed from, was my gpu-temperature, which was a bit high (~90-100°C, while the others had a temperature around 70°C).

December 12, 2010

AquilaRapax AquilaRapax
Lab Rat
8 posts

I tested it on several pcs (unfortunately all equipped with nvidia cards, so i could not compare results on ati) – all produced the same output. I reported it to the Qt bug tracker.
For those who are interested: http://bugreports.qt.nokia.com/browse/QTBUG-16043

December 12, 2010

Deleted Member # 4a2 Deleted Member # 4a2
Ant Farmer
1481 posts

yes I tried on 2 different systems, and can reproduce the issue… seems like a bug

December 13, 2010

przemo_li przemo_li
Lab Rat
7 posts

bug or not bad programming technique

BTW how antialiasing is done in this example?

December 13, 2010

AquilaRapax AquilaRapax
Lab Rat
8 posts

hm, i don’t think that this occures because of bad programming. I just used the 2D painting example that comes with Qt. I just added a few buttons to enable/disable antialiasing dynamically. Antialiasing is done by calling the QPainter::setRenderHint method with the arguments QPinter::Antialiasing and QPainter::HighQualityAntialiasing.

 
  ‹‹ QSharedPointer Usage      How C++ lambdas affect Qt? ››

You must log in to post a reply. Not a member yet? Register here!