SetVirtualResolution causes graphical glitches?

Archives Forums/BlitzMax Bug Reports/SetVirtualResolution causes graphical glitches?

zcbeaton(Posted 2012) [#1]
I wasn't sure if this belonged in here as a bug report or in the BlitzMax Programming board, but I'm going to put it here. I'm developing a 2D game right now that runs at a low resolution, but I was using SetVirtualResolution to run it at 2x size. I don't use viewports, or anything like that, I just set up the graphics environment like so:

Graphics 640,360
SetVirtualResolution 320,180

The problem is that it doesn't seem to be strictly adhering to these numbers. For example, if I have a bright pink image at the co-ordinates 12,12 and the size 20x20, I can see it fine; but if I overlap that with a blue image of the exact same size and co-ordinates, I still see a faint one-pixel sliver of pink peeking out from the edge. This obviously shouldn't happen, and doesn't happen when I actually run the game at the virtual resolution (e.g. if I do Graphics 320,180 instead).

Obviously, there's an issue here, but I can't identify where. Is this a problem with Max2D itself, or a DirectX issue, or what? I've only tested it out in Windows so far, so I can't tell you if it behaves any differently in Mac OS X or Linux. Also, all the images in the game have their flags set to 0 because I want them to be scaled without interpolation; interpolation tends to make pixel art look terrible.

If anyone has any ideas, I'd appreciate hearing them. Thanks!


therevills(Posted 2012) [#2]
How are you loading your images? Have you tried removing the FILTEREDIMAGE flag when loading your images?

Also have you tried "Defringing" your images?

http://www.blitzbasic.com/Community/posts.php?topic=83445

Last edited 2012


zcbeaton(Posted 2012) [#3]
I haven't yet tried defringing, which I will make sure to try today, but like I said in my original post, all the images in the game have their flags set to 0, so there's definitely no filtering going on. All images are loaded like this:

LoadImage("rsc/imagefile.png",0)