2D Toolkit Forum
2D Toolkit => Support => Topic started by: CoderBear on April 02, 2013, 09:13:11 pm
-
When running the game on a device via the editor/Unity Remote combo the whole picture all elements render properly (see 2DTK001 and 002 attached). However... when you push it to the device and run it directly from there I get the following issue.
The background images and foreground images are no longer displaying. The only things displaying are as show in the third picture?
Why is this happening? There should be no difference between running this via unity remote and on the device. Especially if the project is set to android.
-
What is the camera far clip plane set to? What is the position of the camera? Is there any chance that the background is really close to the far clip plane?
-
The camera far clip is 1000 and position is <0,0,-150>.
The backgrounds
sky Z = 0
ray Z= -5
tree z = -10
and that still doesn't explain why the ground is not rendering which is on the same z-Plane as the player and the falling objects. Nor the treetop which is just behind the HUD elements and in front of the falling objects.
I would say it might be an issue with the atlases but then none of them should work.
It looks like for some reason BackgroundSpriteCollectionData there were 2 Collection files for some reason
BackgroundSpriteCollectionData <- had no data
BackgroundSpriteCollectionData 1 <- had data
so I deleted the one with no data and renamed the other one (by removing the " 1"). However... it sadly had no effect on the situation.
-
What device are you running on?
How big is the sprite collection size for the one that doesn't work?
Does your device support textures of that size?
You can test this by dragging the atlas texture onto a plane, and see if it draws on the device. If not, it means its too big for that device.
-
A Nexus 7.
You have hit upon something not considered. I went back and reduced that sprite atlas to 2048 and suddenly the images are appearing without issue.
-
Max texture size on a nexus7 = 2048x2048. Anything larger than that will display black when running on device.
Its a shame Unity doesn't give you any errors when it fails to upload a texture, but as far as I'm aware, thats the way it is.
If it works in a new project it could be because the the atlas is being downscaled for some reason? Maybe mipmaps are on?