incorrect aliased rendering

i’ve been having some weird issues with perfect aliased rendering recently.

yesterday i had to render a 1280x720 texture at 1278x718 or i was getting weird artifacts.

i dug into it a little more and posted this issue

just now i thought it might have something to do with different video cards, so i did a test on my ati and on an older nvidia. i used the code below:

void ofApp::setup() {  
	fbo.allocate(512, 256);  
void ofApp::update() {  
void ofApp::drawGrid() {  
	ofTranslate(mouseX, 0);  
	if(ofGetMousePressed()) {  
		ofTranslate(.5, .5);  
	for(int i = 0; i < 256; i += 2) {  
		ofLine(i, 0, i, 256);  
		ofLine(0, i, 256, i);  
void ofApp::draw() {  
	ofClear(0, 255);  
	ofClear(0, 255);  
	fbo.draw(0, 256);  

and got the results attached.

my only conclusion is that nvidia treats the pixel grid as being starting on 0,0, and ati treats it as being aligned to .5,.5 (the pixel center).

i just found this post which describes a solution for this case:

1 ofSetupScreenOrtho(512, 512, OF_ORIENTATION_DEFAULT, true); at the top of draw()
2 ofSetupScreenOrtho(512, 256, OF_ORIENTATION_DEFAULT, false); just after fbo.begin()

then it’s exactly the same on ati as the original on nvidia.

but i don’t understand why it would make such a huge difference in the no-click ati case above. something seems very wrong to me.