Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

PNG MB size limit ?

Discussion in '2D' started by PJRM, Apr 9, 2014.

  1. PJRM

    PJRM

    Joined:
    Mar 4, 2013
    Posts:
    303
    Hi.

    I'm working on the photoshop in a planet which is 20000x20000 px.

    Unity3D Engine has a limit for PNG File size of pixels or size of file ???
     
  2. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Graphics hardware has a limit on texture sizes, which can be as low as 2048x2048, so if you want to ensure maximum compatibility, don't go above that. Aside from that, there are various VRAM limitations in different hardware, which 20Kx20K could potentially exceed even with compression.

    --Eric
     
  3. PJRM

    PJRM

    Joined:
    Mar 4, 2013
    Posts:
    303
    Hi Eric.

    My file size in pixels are 20kx20k, but what will be in game screen is a default video 1024x768.
    Here is a picture to ilustrate what i mean:
    $Final Desire.jpg
    The green circle is my planet PNG file.
    I don't want to all 20kx20k of the image show up on screen.just a fraction of it.
    is that even possible!?
     
    Last edited: Apr 9, 2014
  4. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    As I said, no, it's not possible because of hardware limitations. Also Unity currently won't go above 4096x4096, even though more recent hardware can do 8192x8192. There's no reason it has to be all in one texture, but there are the VRAM considerations I also mentioned. But if your planet is literally a green circle like that, using a texture is pointless anyway; there are better techniques.

    --Eric
     
  5. AndrewGrayGames

    AndrewGrayGames

    Joined:
    Nov 19, 2009
    Posts:
    3,821
    Consider breaking your 20kx20k image into < roughly 9x9 2048x2048 PNGs. Since the 2D infrastructure is largely the same as the 3D infrastructure, you would just be assembling all of the tiles on a layer behind the player.

    The only trick would be scaling each quad that hosts a tile of your planet image.
     
  6. Beardbotnik

    Beardbotnik

    Joined:
    Jul 27, 2013
    Posts:
    49
    You could also just use a ring shaped poly strip, I was able to make a mockup pretty quick using a single 256x512 texture.

    Based on how much detail you need on the inside you could even just use vertex colored geometry to fill in the inside layers with flat colors.



    and this is what it looks like without the wireframe



    and as you can see, the one I did is pretty squished using that many polygons, you could either use less geometry or get it down as low as a single 256x256 texture.
     
    Last edited: Apr 9, 2014
  7. PJRM

    PJRM

    Joined:
    Mar 4, 2013
    Posts:
    303
    Thank you for advices.
    Oh yeah. when i saw Eric's message, i just thought in that.
    I'll start creating small pieces of "pizza" of my entire planet. (rotate and slice! hehehehe).
    I'll make many pieces, because the planet is huge comparing to the player and I like to work on details, so it must be.. One object with many child.

    Thank you!
     
  8. PJRM

    PJRM

    Joined:
    Mar 4, 2013
    Posts:
    303
    I like your idea, although there is no tile equal to another in my project. ;)
     
  9. Beardbotnik

    Beardbotnik

    Joined:
    Jul 27, 2013
    Posts:
    49
    Are you having your character just walk on the surface? if so you could still paint for planet as one long strip and have it wrap around the ring with flat colors filling in the middle and it would still cut down the size of your texture considerably, you could even take it further and unwrap small strips and stack them to get a square texture sheet comprised of strips of the outer crust of the planet.
     
  10. PJRM

    PJRM

    Joined:
    Mar 4, 2013
    Posts:
    303
    Yes... the planet will be only for walking.
    It could work, but some áreas would be fail, as i do strange cliffs, but thank your!
     
  11. Kurius

    Kurius

    Joined:
    Sep 29, 2013
    Posts:
    412
    Also keep in mind that while some mobile phones can handle up to 2048x2048, other phones can only handle up to 1024x1024.
     
  12. Invertex

    Invertex

    Joined:
    Nov 7, 2013
    Posts:
    1,558
  13. PJRM

    PJRM

    Joined:
    Mar 4, 2013
    Posts:
    303
    It will not be for mobile, but it is good to know! I'll make sure it'll be 1024x1024, so whether i receive alot of request for mobile... then it need no changes.

    Nice.
    I'll remake it on Shader-Forge. And them I send you if you want to.


    Thanks guys
     
  14. Invertex

    Invertex

    Joined:
    Nov 7, 2013
    Posts:
    1,558
    Why remake it in Shader-Forge and create more overhead on the shader? These shaders are a simple CGProgram made for Unity specifically, just put them in your project assets folder and you're good to go, they'll show up in your shader list for materials. No extra work needed.
     
  15. PJRM

    PJRM

    Joined:
    Mar 4, 2013
    Posts:
    303
    I don't like to just "it work? fine! i'm using it". I like to understand the code behind the script. thanks to 'acegikmo', I can remake the shaders, for a better way to understand it. I am not a shader programmer. I hardly understand it.

    If I understand a shader, I can edit it whether i need changes. Having to rely on other is annoying and frustrating (When it comes to third party components). Knowledge is a powerful tool. when more better.


    but thanks.
     
    Last edited: Apr 11, 2014