I am making a game in SpriteKit and I am using a texture atlas for all of my textures. I am using the setting
Scale Factors: Single Vector
Xcode is giving me a warning for this TextureAtlas :
Template rendering is not supported in texture atlases.
I am unsure what this means
In your assets folder, one of your textures is marked Render As:Template Image. Texture atlases do not support this render mode, so you need to change it back to Default
Related
Using Xcode 8, I have a texture atlas with a bunch of images in it in my project. In the scene editor, I can select a sprite and in the Texture field for thats sprite I can click and get a list of all textures (images) in the project, INCLUDING those in the texture atlas. I select a texture from the texture atlas. When running the app I don't get the texture on the sprite. I get a big red X.
I know I can programmatically get a texture from the atlas and assign it to the sprite. I want to know why the Xcode (IB) assignment to the sprite works inside of Xcode (IB) but not in the running app. I should be able to assign textures from texture atlases inside of Xcode to a sprite.
If I assign a texture from a normal graphics image not in the atlas it works.
Can you select the Assets.xcassets file and see in the File Inspector (far right, first icon, looks like a paper page) if your target is checked in the Target Membership list? This is usually an excellent reason not to get any images from the asset catalog.
For my SpriteKit game I am using a single pdf vector graphics for my SKSpriteNodes rather than many png sprites for all device resolutions for every entity in the game. the benefits of not having to worry too much about the graphics of the game have dramatically helped but my question is simple, would using vector graphics be a bad idea performance wise?
Wait, you are NOT using a PDF as texture for the SKSpriteNode
Instead you are probably using a PDF into the Xcode Asset Catalog right?
In this case, first of all this is a really good idea and it does NOT impact the performance of your game.
Infact when you load a PDF image into the Xcode Assets (and you set the Scale Factors to Single Vector), you are not using the PDF into your app or game.
As soon as you compile the app, Xcode automatically generates the PNG versions for the several resolutions.
E.g. if you game does support any device running iOS 9 then Xcode
automatically generates the 1x, 2x and 3x PNG (bitmap) images from your
original PDF (vector).
Another great benefit of this approach: if in the future Apple does release a device with a 4x pixel density, Xcode will likely be updated to support that and you'll just need to recompile your app to automatically generates the 4x images.
Answer
So the answer to your question is: NO. The PDF image will not impact your game performance simply because the game is not using the PDF, it's using the PNG instead (even if you can't see it).
When I add my game images to an atlas, the game's bundle size explodes fourfold.
Even with the RGB565_COMPRESSED setting I see a drastic increase in bundle file size. When I just add the image files to the Xcode project without generating an atlas, the bundle file size is a lot smaller.
My images in the atlas folder are 128x128 tiles only.
I suspect that Xcode is generating a lot of mipmap atlasses that I don't need for my game because there are no zoom levels. How can I suppress that or reduce atlas file size further?
I use Core Video texture cache for my OpenGL textures. I have an issue with rendering such textures in case of minification. Parameter GL_TEXTURE_MIN_FILTER has no effect: interpolation for minification is always the same as GL_TEXTURE_MAG_FILTER. The interesting fact is that everything works ok when I create pixel buffer object with CVPixelBufferCreateWithBytes function. The problem appears when I use CVPixelBufferCreate.
Environment:
iOS 7
OpenGL ES 2.0
iPad mini, iPad 3, iPad 4.
I've developed simple application which demonstrates this issue: https://github.com/Gubarev/iOS-CVTextureCache. The Demo application can render checkerboard (size of cell is 1x1) texture in three modes:
Regular OpenGL texture (ok).
Core Video texture, pixel buffer created with CVPixelBufferCreate (problem).
Core Video texture, pixel buffer created with CVPixelBufferCreateWithBytes (ok).
Texture is rendered two times with slight minification (achieved by using OpenGL viewport smaller than texture):
Left image rendered with minification filter GL_NEAREST, magnification filter GL_NEAREST.
Right image rendered with minification filter GL_LINEAR, magnification filter GL_NEAREST.
Image below demonstrates proper minificiation in case of regular OpenGL texture. It's clearly visible that setting for minificiation filter takes effect. Same results could be obtained when "CVPixelBufferCreateWithBytes" approach is used. The problem appear in case of "CVPixelBufferCreate" approach: both images minificated with setting for magnification filer (GL_NEAREST in particular).
Can Texture Packer's pvr.ccz files be used in a non cocos2d app? I'd like to use them with core animation. Is this possible?
Out of the box? No.
You can write your own .pvr.ccz texture loader respectively adapt the .pvr.ccz texture loading code from cocos2d. The key part really is just the compression format (ccz) which uses the zlib compression provided by the iOS/Mac SDK. After inflating the compressed file, you end up with a regular PVR texture that you can use in Core Animation.