Hello Guest

Author Topic: Wierd Undrawn sprite issue (Unity remote vs From Device)  (Read 4777 times)

CoderBear

  • Newbie
  • *
  • Posts: 13
    • View Profile
Wierd Undrawn sprite issue (Unity remote vs From Device)
« 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.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Wierd Undrawn sprite issue (Unity remote vs From Device)
« Reply #1 on: April 03, 2013, 01:08:09 pm »
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?

CoderBear

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: Wierd Undrawn sprite issue (Unity remote vs From Device)
« Reply #2 on: April 03, 2013, 06:38:50 pm »
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.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Wierd Undrawn sprite issue (Unity remote vs From Device)
« Reply #3 on: April 03, 2013, 10:47:03 pm »
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.

CoderBear

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: Wierd Undrawn sprite issue (Unity remote vs From Device)
« Reply #4 on: April 04, 2013, 07:56:29 pm »
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.
« Last Edit: April 04, 2013, 08:47:01 pm by CoderBear »

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Wierd Undrawn sprite issue (Unity remote vs From Device)
« Reply #5 on: April 04, 2013, 08:28:45 pm »
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?