Included File draw limit

Discussion in 'Programming' started by CloseRange, Jun 12, 2019.

  1. CloseRange

    CloseRange Member

    Joined:
    Jul 2, 2016
    Posts:
    752
    I've been playing around with some pretty big images through included files, the biggest file I have so far is 16836 x 69
    The image looks perfectly fine for the most part pixel perfect no blur or anything except at the very end of the image.
    Past the 2^14 mark on the width the image is essentially gone and instead draws a long streak of the last pixel as if it was smeared along the image.
    I used the simple solution of just not drawing past 2^14 but I was mostly curious about what was so special about 2^14 and how come every other source I found told me not to draw past 2048 pixels. It seems to run fine with a big image like this.
     
  2. rIKmAN

    rIKmAN Member

    Joined:
    Sep 6, 2016
    Posts:
    4,421
    Because that image won't fit on a single texture page GM will resize it by half over and over until it does, the default texture page size in GM is 2048x2048 but you can change this yourself in the options upto a max of 8192x8192, although this may cause problems on some hardware (especially mobile). This operation is usually logged in the console when you compile.

    Not sure if this is causing your exact issue, but it usually results in lower image quality due the resizing, and I'd advise chopping up that image into smaller ones that fit within your chosen texture page size and then stitching them back together by drawing them individually at runtime.
     
  3. TsukaYuriko

    TsukaYuriko Q&A Spawn Camper Forum Staff Moderator

    Joined:
    Apr 21, 2016
    Posts:
    1,576
    Note that this is not limited to sprites that were dynamically created from an included file - the same hardware restrictions apply to static sprites, and with images that big, you're bound to run into issues at least on lower-end devices, if not high-end devices.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice