Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Sprite quality due to size

Discussion in '2D' started by drHogan, Jan 13, 2014.

  1. drHogan

    drHogan

    Joined:
    Sep 26, 2012
    Posts:
    201
    Hi guys,

    i just moved to the 2d unity to port the tower game i was developing using the 3d engine in a "2d" way.

    $Screen Shot 2014-01-13 at 22.32.57.png

    Even if i could just continue with the old way, i've seen that moving to the 2d would mean speeding up a lot the development and optimizing the performances.

    But, i immediately met some barriers (maybe only due to my ignorance of the 2d editor) that are almost causing me to step back.

    For example, the first was that it doesn't seem to be possible to change the default axis for the 2d scene. I was using the unity terrain mixed with some textures to have some nice looking terrain for my maps, and it was also involved in the automatic generation of the grid for the map. Is it so that now a traditional terrain can't be used as background for a 2d game? Do you happen to know if this will change in the future?

    Another problem i met is with sprites. Before i was animating my stripes with a script and it was ok, but still kinda slow as approach. Now i tried the new sprite component, it's cool, but i have a problem with the quality. As you see in the picture below, depending on the scale and on the camera size (in my tower game is possible to zoom in and out on the map), the quality of the sprites gets really bad (it looks like some sort of antialiasing problem, but playing with the graphical settings didn't change a thing).

    $Screen Shot 2014-01-13 at 21.39.03.png
    In the picture you can see two sprites with the original image of different sizes and you see the problem in quality. The left one is the higher quality one, but when reduced in size becomes awful. Then if i zoom closer with the camera, that once becomes better, while the other one gets ugly (it's quite low quality). But still from a certain distance the right one is better that the left one. Does anybody know a solution to that?

    So far that's it, the result of my 2-3 hours spent this evening fighting for the first time with the new 2d editor. I think it can become super cool, but any suggestion if it's still limited or it's me that i'm limited in understanding it would be welcome!

    Best,
    H
     
  2. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    The 2D physics engine uses the x/y axes so I doubt this will change. You could maybe use two cameras, though, one for the background that uses the terrain, and one for the sprites (clear flags set to depth only so the background camera shows behind).

    Change the texture type from Sprite to Advanced and turn mipmaps on, and possibly trilinear filtering.

    --Eric
     
  3. drHogan

    drHogan

    Joined:
    Sep 26, 2012
    Posts:
    201
    Hi Eric,

    thanks for the answers.

    It's also not possible to rotate the traditional 3d terrain so to position it along some other axis right?

    For the sprite thing thanks, i didn't know that. Is it still possible to use it like a "normal" sprite then, if imported as advanced?

    Best,
    H
     
  4. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Correct.

    The Sprite texture type is just a preset, like all the others. What makes a sprite texture a sprite is setting Sprite Mode to something other than None.

    --Eric
     
  5. drHogan

    drHogan

    Joined:
    Sep 26, 2012
    Posts:
    201
    Thanks again than, i'll keep on inspecting the 2d toolkit and see what else is new, and if everything else still copes with my engine (i think that somehow i can find a workaround for the terrain problem, but the sprite thing really felt weird).

    Best,
    H