I'm using the Texture2D class from the CrashLanding sample code. I'm getting strange artifacts around my images in both the simulator and the phone. The artifacts are little gray borders around the textures. The borders are inconsistent and do not surround the entire texture. I'm using pngs.
Iphone – How to get rid of artifacts in the OpenGL ES iPhone app
iphoneopengl-es
Related Solutions
It's certainly possible to develop on a Windows machine, in fact, my first application was exclusively developed on the old Dell Precision I had at the time :)
There are three routes;
- Install OSx86 (aka iATKOS / Kalyway) on a second partition/disk and dual boot.
- Run Mac OS X Server under VMWare (Mac OS X 10.7 (Lion) onwards, read the update below).
- Use Delphi XE4 and the macincloud service. This is a commercial toolset, but the component and lib support is growing.
The first route requires modifying (or using a pre-modified) image of Leopard that can be installed on a regular PC. This is not as hard as you would think, although your success/effort ratio will depend upon how closely the hardware in your PC matches that in Mac hardware - e.g. if you're running a Core 2 Duo on an Intel Motherboard, with an NVidia graphics card you are laughing. If you're running an AMD machine or something without SSE3 it gets a little more involved.
If you purchase (or already own) a version of Leopard then this is a gray area since the Leopard EULA states you may only run it on an "Apple Labeled" machine. As many point out if you stick an Apple sticker on your PC you're probably covered.
The second option is more costly. The EULA for the workstation version of Leopard prevents it from being run under emulation and as a result, there's no support in VMWare for this. Leopard server, however, CAN be run under emulation and can be used for desktop purposes. Leopard server and VMWare are expensive, however.
If you're interested in option 1) I would suggest starting at Insanelymac and reading the OSx86 sections.
I do think you should consider whether the time you will invest is going to be worth the money you will save though. It was for me because I enjoy tinkering with this type of stuff and I started during the early iPhone betas, months before their App Store became available.
Alternatively, you could pick up a low-spec Mac Mini from eBay. You don't need much horsepower to run the SDK and you can always sell it on later if you decide to stop development or buy a better Mac.
Update: You cannot create a Mac OS X Client virtual machine for OS X 10.6 and earlier. Apple does not allow these Client OSes to be virtualized. With Mac OS X 10.7 (Lion) onwards, Apple has changed its licensing agreement in regards to virtualization. Source: VMWare KnowledgeBase
Do you have a thing like that little black bar in your textures?
I've encountered similar problems when I have done something wrong. Here's a small check-list:
- Have you have mipmapped your texture or not, and check what parameters does it have.
- glTexParameters. (WRAP_S, WRAP_T, MAG_FILTER, MIN_FILTER...)
- texture's dimensions. (If there's non-power-of-two -textures allowed, it may cause graphic glitches, depending about how you load your textures)
- Are you are drawing that flashing bar on top of your rectangles?
- Whether there's something that's causing the black bar, in your texture.
- Alignment of the animation frames.
- Blending and alpha-blending.
If something in the list is vague for you, it's good exercise to read about them.
I also do a good guess: I believe you aren't wrapping your textures in any direction, and that the animation frames are a bit misaligned, so that your application has a bit wrong texture coordinates/height in the quad you are drawing.
I hope my advices make sense. I have only experience with the usual opengl, not the OpenGL ES that's graphics pipelines have been pruned to make it more compact, cleaner and more elegant.
Best Answer
Hey MrDatabase - It sounds like the problem is that your texture images have premultiplied alpha. I've had this problem on the iPhone too - the PNG compression that it performs when you build your app automatically premultiplies all the alpha values. If you're using
glBlend(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)
, you're basically applying the alpha twice - try usingglBlend(GL_ONE, GL_ONE_MINUS_SRC_ALPHA)
instead. There's lots of stuff in the Apple forums about this :-)