drawing differences between windows and linux

hi

i am getting different shapes when drawing same ofRect with no fill under windows and linux. I though this might be the graphics card under linux but it is the same both in my desktop and laptop.

Basically the rect left and top lines are not drawn. I just do

  
  
void:testApp:draw()  
{  
ofSetColor(255,0,0);  
ofNoFill();  
ofRect(100, 100, 100, 100);  
}  

is there anything i can do to fix this?

thanks

enrike

hey enrike

it’s working ok for me. it’s super weird you’re not getting a complete square, are you sure you don’t have anything else that is over the square or something like that? there’s no difference at all in the implementation of rect for the 3 platforms

no. i just took the emptyExample and added the code for drawing a rect with no fill and i get only the right and bottom sides. the same happens in the laptop running ubuntu as well.

i attach an screenshot where you can see the code and the result. also the bottom right pixel is missing.

maybe there some kind of antialias going on? it does not look like it but maybe ubuntu doing something weird.

I just tried to reproduce this as well and couldn’t. Could you please provide more details (what type of graphics card you have, which driver version, which Ubuntu version etc).
I tried with anti-aliasing and with Compiz and still got a square…

Section “Device”
Identifier “ATI Technologies, Inc. Radeon RV100 QY [Radeon 7000/VE]”
Driver “radeon”
BusID “PCI:1:0:0”
EndSection

kernel
2.6.28-15-generic #49-Ubuntu SMP Tue Aug 18 18:40:08 UTC 2009 i686 GNU/Linux

latest Ubuntu 9.04 desktop i386

same system in the laptop, but there the graphics card is a ATI radeon mobility M6 LY

hi enrike

can you try calling glFlush(); after drawing the rectangle. have found this:

http://ati.cchtml.com/show-bug.cgi?id=1220

that seems to be related. otherwise i have no idea why it’s not working.

like this?

  
void testApp::draw(){  
    ofSetColor(255,0,0);  
    ofRect(100, 100, 100, 100);  
    glFlush();  
}  

same result…

mmh, yes.

do you have anything like a settings panel for the graphics card? there’s this:

http://ati.amd.com/products/catalystcon-…-index.html

perhaps tweaking some settings will fix the problem

none of my cards are not supported by that ATI driver and control panel. maybe is the radeon driver used for this cards?

i am going to try to do some tests with Python +OpenGL to see if i get same error. i have been working with Python + OpenGL for years with both machines and i did not get this error. But maybe OF does some OpenGL command different than what I have been using in the past.

perhaps is related with that… note that rectangles, as everything else. is drawn using vertex arrays since 006, so when testing in python try using that instead of glBegin glEnd.

ok. i will check the OF source code to try to match it as close as possible

can you also try:

  
ofSetColor(0,0,0);  
glBegin(GL_LINE_LOOP);  
glVertex2f(50,50);  
glVertex2f(150,50);  
glVertex2f(150,150);  
glVertex2f(50,150);  
glEnd();  

we’ve replaced the glBegin() type commands with non-immediate mode (for opengles support) and I’m curious if your opengl card or system is unhappy w/ that.

take care!
zach

hi zach, same problem with your opengl code.

now my next question: do you know if they output resolution is native to your monitor, ie: are you looking at an image that’s in any way stretched or compressed?

I would guess that it might be a pixel interpolation issue.

second question, if you animate the rectangle, do you see any changes to how it draws, or is always missing the same lines:

  
  
void:testApp:draw()  
{  
ofSetColor(255,0,0);  
ofNoFill();  
ofRect(mouseX, 100, 100, 100);  
}  
  

  • zach

yeah i already thought about that. I tried to set the line width ofSetLineWidth() to values bigger than one in case it was somehow rounding it to less than one but it does not make any difference.

The resolutions are fine in both machines, they are the native ones.

I tried your code and applied it to the x loc and also the width and something funny happens, the error is the same but when the right side of the rect goes
out of the window, then i get the left and top sides drawn. I attach a screenshot

this is the content of my xorg.conf of my desktop file in case anyone sees something there

Section “Files”
FontPath “/usr/share/X11/fonts/misc”
FontPath “/usr/share/X11/fonts/cyrillic”
FontPath “/usr/share/X11/fonts/100dpi/:unscaled”
FontPath “/usr/share/X11/fonts/75dpi/:unscaled”
FontPath “/usr/share/X11/fonts/Type1”
FontPath “/usr/share/X11/fonts/100dpi”
FontPath “/usr/share/X11/fonts/75dpi”
FontPath “/usr/share/fonts/X11/misc”
FontPath “/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType”
# path to defoma fonts
EndSection

Section “Monitor”
Identifier “SyncMaster”
Option “DPMS”
EndSection

Section “Screen”
Identifier “Default Screen”
Device “ATI Technologies, Inc. Radeon RV100 QY [Radeon 7000/VE]”
Monitor “SyncMaster”
DefaultDepth 24
SubSection “Display”
Depth 1
Modes “1280x1024” “1152x864” “1024x768” “832x624” “800x600” “720x400” “640x480”
EndSubSection
SubSection “Display”
Depth 4
Modes “1280x1024” “1152x864” “1024x768” “832x624” “800x600” “720x400” “640x480”
EndSubSection
SubSection “Display”
Depth 8
Modes “1280x1024” “1152x864” “1024x768” “832x624” “800x600” “720x400” “640x480”
EndSubSection
SubSection “Display”
Depth 15
Modes “1280x1024” “1152x864” “1024x768” “832x624” “800x600” “720x400” “640x480”
EndSubSection
SubSection “Display”
Depth 16
Modes “1280x1024” “1152x864” “1024x768” “832x624” “800x600” “720x400” “640x480”
EndSubSection
SubSection “Display”
Depth 24
Modes “1280x1024” “1152x864” “1024x768” “832x624” “800x600” “720x400” “640x480”
EndSubSection
EndSection

Section “Module”
Load “i2c”
Load “bitmap”
Load “ddc”
Load “dri”
Load “extmod”
Load “freetype”
Load “glx”
Load “int10”
Load “type1”
Load “vbe”
EndSection

Section “DRI”
Mode 0666
EndSection

Section “InputDevice”
Identifier “Generic Keyboard”
Driver “kbd”
Option “CoreKeyboard”
Option “XkbRules” “xorg”
Option “XkbModel” “pc105”
Option “XkbLayout” “es”
Option “XkbOptions” “lv3:ralt_switch”
EndSection

Section “InputDevice”
Identifier “Configured Mouse”
Driver “mouse”
Option “CorePointer”
Option “Device” “/dev/input/mice”
Option “Protocol” “ExplorerPS/2”
Option “ZAxisMapping” “4 5”
Option “Emulate3Buttons” “true”
EndSection

Section “Extensions”
Option “Composite” “Disable”
EndSection

Section “ServerLayout”
Identifier “Default Layout”
Screen “Default Screen”
InputDevice “Generic Keyboard”
InputDevice “Configured Mouse”
EndSection

Section “Device”
Identifier “ATI Technologies, Inc. Radeon RV100 QY [Radeon 7000/VE]”
Driver “radeon”
BusID “PCI:1:0:0”
EndSection

Section “ServerFlags”
Option “DontZap” “False”
EndSection

i just tried with python + opengl and i get the same error. this must be something to do with the Ubuntu 9.04 configuration of the graphics or something like that. I have both machines for three years with different versions of Debian and Ubuntu. I worked quite a lot with python and OpenGL , i never had something similar.

yes, that’s like the weirdest bug :slight_smile: don’t know, it seems some kind of bug with the driver or something like that. perhaps try to download a newer version directly from the ati web page.

no the ATI glrx driver does not work with this card (Radeon 7000). this card uses the free driver which is not very good at 3D. maybe there is a bug in there but it was not before.

just to make sure i was not doing something stupid i run Ubuntu from a liveCD, downloaded OF, run the ubuntu scripts to install codeblocks and dependencies. Then I tried to draw a rect with no fill and i got the same problem. So it is defenitely not my machine or something i am doing wrong with the Ubuntu configuration. Most likely to be the graphics card driver. This is really anoying, i hope it will be solved soon. maybe i can try to compile myself the latest version?.

yes perhaps it’s solved in the last version. also try filling a bug report in the ubuntu launchpad:

https://launchpad.net/ubuntu

or even in the driver developer page