Smoothing edges with alpha mask
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.
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.
Video Game Artist and Video Game Tester - Bub & Bob 3, Call of Juarez.
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.
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.
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.
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.
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| Create Aquaria-like terrain- texturing edges | AndyKorth | 3 | 5,417 |
Jul 31, 2011 08:13 PM Last Post: FlamingHairball |
|
| Edge detection with sobel operator/mask | g00se | 5 | 9,372 |
May 20, 2011 12:23 AM Last Post: g00se |
|
| [SOLVED]OpenGL edges of textures | mk12 | 2 | 3,679 |
Sep 2, 2010 08:07 PM Last Post: mk12 |
|
| Replacing edges with degenerate quads (for shadow volumes) | Coyote | 9 | 6,460 |
Jan 15, 2010 07:08 PM Last Post: Coyote |
|
| Pasting an image with alpha mask on a texture | Najdorf | 10 | 5,067 |
Jun 24, 2008 03:23 PM Last Post: Najdorf |
|

