Smoothing edges with alpha mask

Moderator
Posts: 1,140
Joined: 2005.07
Post: #16
What resolution is it running at? If it's running at a low resolution, there's no way to keep it from being low quality no matter what: the problem is the low resolution. If you're running the game at a high resolution, then the problem will likely be the graphic is too low resolution, resulting in it being scaled to much. It is also possible that the problem is both the fact that both the screen resolution and the graphics are too low of a resolution, and both are scaled too much. A little more input about the size of the actual texture and the resolution of the game would help, and a little playing around of settings may also reveal some results.
Quote this message in a reply
Max
Member
Posts: 84
Joined: 2003.03
Post: #17
akb825 Wrote:What resolution is it running at? If it's running at a low resolution, there's no way to keep it from being low quality no matter what: the problem is the low resolution. If you're running the game at a high resolution, then the problem will likely be the graphic is too low resolution, resulting in it being scaled to much. It is also possible that the problem is both the fact that both the screen resolution and the graphics are too low of a resolution, and both are scaled too much. A little more input about the size of the actual texture and the resolution of the game would help, and a little playing around of settings may also reveal some results.
The game runs at 640x480. The graphics were created for that resolution. The resolution of my display is 1280x960.

Since my display is twice the size of the game, I was expecting sharp graphics. But instead, they're all blurred. Logically, this shouldn't happen. If you use Photoshop or any image editing application, and zoom 2x, the picture isn't blurred.

I think we'll stick with GL_NEAREST. The graphics aren't blurred when enlarged.

Freelance video game artist and video game compliance tester at Enzyme Testing Labs.
Quote this message in a reply
Moderator
Posts: 1,140
Joined: 2005.07
Post: #18
On LCD displays with different resolutions, it will look blurred regardless, since the pixels don't match up exactly. The best solution would be to have a variable resolution for fullscreen, and possibly have higher quality textures. What size do you have them as?

BTW, linear filtering will blur with large scale-ups, and the resolution your game is running at doesn't help. If the resolution of the image isn't much smaller than the size of the quad you're mapping it to, then the linear filtering is pretty much the best way to go. If it is much larger, you just have a choice between blocky and blurred.
Quote this message in a reply
Member
Posts: 22
Joined: 2005.02
Post: #19
Got it! The solution is:

Quartz blends the image when you call CGDrawImage onto the freshly created CGContext. I haven't found a way to prevent it from doing this. The calls

CGContextSetShouldAntialias (cg_context, false);
CGContextSetInterpolationQuality(cg_context, kCGInterpolationNone);


don't work.

My own solution is to save the pictures as raw images and put them directly to OpenGL bypassing Quartz completely. Maybe there's a more elegant way, maybe I can still try to use the built-in png decoder, but this method works at the moment.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Preventing texture from creating transparent gaps on edges ardowz 3 848 Jan 21, 2014 11:28 AM
Last Post: SethWillits
  Create Aquaria-like terrain- texturing edges AndyKorth 3 5,997 Jul 31, 2011 08:13 PM
Last Post: FlamingHairball
  Edge detection with sobel operator/mask g00se 5 10,349 May 20, 2011 12:23 AM
Last Post: g00se
  [SOLVED]OpenGL edges of textures mk12 2 4,155 Sep 2, 2010 08:07 PM
Last Post: mk12
  Replacing edges with degenerate quads (for shadow volumes) Coyote 9 7,254 Jan 15, 2010 07:08 PM
Last Post: Coyote