Xcode SpriteKit Designer Clear Background Red X - ios

I'm not sure what the issue is, but I'm trying to design a level in Apple's Sprite Kit editor, and I'm running into a problem with SKSpriteNodes that have a transparent background. Sometimes the background doesn't appear as clear. Instead, SpriteKit seems to load a Red X as a background image.
Naturally, I can't have this. Also, it's a problem because I really should be doing all of the level design in the editor instead of manually adding sprites in my Scene code.
Has anyone come across this problem? Could it be a bug in SpriteKit Designer? (There are a number of issues I've had with it since starting to use the tool).
Here is a photo of what it looks like:

I found a kinda hacky way to solve it. Basically, as uchuugaka said, the Red X appears when Sprite Kit fails to load a texture. If you want a clear background, you have to load a clear png file as the background of the sprite. There is no "No Texture" option currently available in the Sprite Kit designer.
Take these steps.
1.) Open any .png file with some transparency in it.
2.) Copy an arbitrary rectangular section of pixels.
3.) Create a new file with said arbitrary pixels.
4.) Save this file as your "clear.png" and import it into your project.
5.) Click on the sprite node with the Big Red X so you can see its setting. Take a screenshot of its position, size, etc. using preview. These settings will get erased when you swap the texture over to clear.png
6.) Swap the texture to clear.png
7.) Re-enter the sprite settings from your screenshot.
8.) Because SpriteKit Editor is currently horribly terribly flawed (see post above), you will need to reset your sprite's physics properites. Set the physics body to none. Then set it to bounding box or circle or alpha mask or whatever you had earlier.
9.) I hope you remembered your collision mask, category mask, and other physics body properties because they just got reset to the default. Re-enter what you had earlier or you will get a very unexpected result.

Related

SCNParticleSystem partially hidden or occluded in wrong manner

I have an issue with particle systems, which can be, in rare cases, kind of occluded in a wrong manner. The particle system you see on the print-screens is a sphere (with invisible material, material transparency = 0.0), that emits particles from its surface. Like 250 particles per second - no magic - and the particle systems works in 99% as it should.
You see also a floor (which is a SCNPlane) that has a very large diameter, of like 100m x 100m. The occlusion happens when the camera is flying by and the angle of the view changes a little bit, because the camera moves smoothly. Depending on the camera angle, it can happen - as you see on the second image - the particle system is occluded partially in a wrong manner, like it would stay behind the horizon - but it does not - it hoovers 2m above the floor and has a radius of 1m.
Did anyone ran into a similar issue? Is there something that could be done, to make this render correctly in all cases (from all viewing angles).
Sometimes the particle system disappears even completely. i.Ex when the camera looks from (20m) above directly on the particle system.
(The scene uses physically based rendering using SceneKit - the background is a simple skybox)
You asked if anyone ran into a similar issue?
I can answer yes!
Depending on the point of view (camera position), and the object on which the SCNParticleSystem is attached, I'm getting weird occlusions of the emitted particles.
I have no SCNPlane, but I have a large SCNSphere around the scene showing a 360 video. If I remove the sphere, the bug doesn't occur anymore.
It might be a regression with iOS 14.x and macOS 11.2, as the same application running under iOS 13.6.1 doesn't show the problem !
If somebody needs. I had similar problem and was trying to set different settings of the particle system for a while.
One of solutions was increased "Rendering order" of the node, that contains the particles, but particles disappear if you change camera orientation.
By chance, I discovered that bug happens when I add specific node to the scene. One difference I found, this node had a material with Transparency mode "Dual layer". I tried this one to make transparent texture.
I changed mode to "Default" and it helped.
Xcode screen

ARKit - Adding texture to object in Scene Editor

This would be working perfectly if it weren't for one aspect of what is going on. When I add the texture to the object (drag and drop it onto the object from the menu in the bottom right) it adds it exactly where I want, but it also adds it around the object large (too large for the object) and all blurred, and I want it to just stay white:
Before:
After:
I want it to stay in the middle where it is, and have the surrounding area be the original color of the shirt.
UPDATE
I created a static physics body, and that allowed me to get to the materials of the Plane object. But I can't remove the coloring around the image.
UPDATE
Also, I exported the texture from Blender with Save Image As from Blender UV/Image Editor, I'm not sure if that is the correct way to export a texture to be used correctly in xcode.
UPDATE
I used the .obj file instead and got this far, but when it renders in the app there is no image, only they gray tshirt.
To export a .dae including textures from Blender, make sure to select UV Textures and the Copy checkbox unter Texture Options, in the Export options, during export. Then, in xcode, your texture will be available as a material under the Materials tab, and you just have to drag the image that you were using with the texture, onto the material (make sure you have the correct material selected) in the Scene Editor in Xcode.

Unity ARKit automatically positions terrain on startup

I just started learning ARKit with Unity. I've downloaded SDK from Asset store, imported it, opened demo scene and added a terrain. I've added it under HitCubeParent as a child:
http://shrani.si/f/40/UP/1q7QqoFl/1/capture.jpg
I've added a Unity AR Hit Test Example Script on a terrain and linked HitCubeParent to it:
http://shrani.si/f/6/133/3w5sasQA/1/capture1.jpg
When I build a game on iPhone, ARKit is working, but one thing that bothers me is that terrain is positioned automatically when scene starts (even though i don't tap on the screen). It causes bad positioning like terrain floating in the air or similar issues. I would like to modify the kit so when the scene starts, only generated blue plane is visible. User should then adjust the position of a plane to a table or similar flat surface and tap on the screen to position the terrain on that plane.
Like this:
https://www.youtube.com/watch?v=OCzuNnejwy4
Any good tutorials on this ? I've searched a lot but couldn't find anything usefull.
Disable the Terrain and enable it after the first successful ARHitTestResult. See line 68 in UnityARHitTestExample.cs:
if (HitTestWithResultType (point, resultType))
{
return;
}
This is actually confusing since this HitTest method actually positions the m_HitTransform and is not merely a test.
In this if block you could enable your terrain, after you disabled it in the Awake method.

Alpha Channel Makes Sprite Semi-Transparent

I have a few .png images that I've worked on and brought into SpriteKit and they originally had a "white background" that I've erased. The white background erased fine but the rest of the image is also made "slightly transparent" so that you can see other sprites that are behind it. Im not sure the reasoning for this but I only want the "white background" to be removed while leaving the rest of the picture 100% visible.
The steps I took to get the images are
I drew them in "Microsoft Paint"
Then I put them on a flash drive and bring them to my Mac
I open them in "Preview" and manually erase any area I don't want to be visible.
Then Drag them into SpriteKit
The result is that the area that I erased is now gone, but the rest of the image is somewhat see-through as well, and it should not be.
Any help is Appreciated!
In SpriteKit I've set the SKNode alpha to 1, but this doesn't seem to help at all.
Here Is A Picture Of The Problem - you can see the nodes behind the fish.

CCSprite has weird white pixels around the border

I'm facing a weird problem in cocos2d for my iPhone game. I have created a PNG file as below
In cocos2d, I use CCSpriteSheet to get each ball all of the with PNG file. It works well until then.
However, the weird thing is that on the iPhone's screen, the ball has weird white pixels around the border, as shown in the below screenshot
I have done so many researches on the web. But every suggestion like using TexturePacker or reset the glBlendFunc didn't work :(
Do you have any idea?
Update: I try to used normal CCSprite with separate PNG file of only one ball, the problem is still! I guess that I have to configure the cocos2d sourcecode some how to get it worked.
I have figured out the issue. Not because of the graphic itself. It's because of the box2d create an outline for the b2Fixture on the back of the CCSprite. Here I posted a question for that specific question!
http://www.cocos2d-iphone.org/forum/topic/25368?replies=1#post-132008

Resources