Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Maximum image size on old machines [Solved]  (Read 3042 times)

0 Members and 1 Guest are viewing this topic.

Tukimitzu

  • Full Member
  • ***
  • Posts: 117
  • Anti-Hero Member
    • View Profile
Maximum image size on old machines [Solved]
« on: March 18, 2016, 08:39:33 pm »
- I create a 1280x720 something.png image
- I change the extension to .bg
- I use sf::Texture::loadFromFile("something.bg")
- It says it can't load because maximum internal size is 1024x1024, and the image is 2048x1024

1) Why does it say the image is 2048x1024 when it is in fact 1280x720?
2) How outdated is this hardware for not being able to load a 1280x720 image?
3) Noob question: is this related to GPU or RAM?

Thanks!
« Last Edit: March 20, 2016, 10:37:06 pm by Tukimitzu »

FRex

  • Hero Member
  • *****
  • Posts: 1848
  • Back to C++ gamedev with SFML in May 2023
    • View Profile
    • Email
Re: Maximum image size on old machines
« Reply #1 on: March 18, 2016, 09:21:37 pm »
1) Your GPU doesn't support NPOT (non power of two) texture sizes so both width and height go up to the next closest power of two
2) It sounds quite bad... I have integrated Intel laptop GPU with just GL 2.1 that is very slow and even it has NPOT and larger maximum sizes support
3) 100% GPU issue

You can browse https://github.com/SFML/SFML/blob/master/src/SFML/Graphics/Texture.cpp to learn more.
Back to C++ gamedev with SFML in May 2023

Tukimitzu

  • Full Member
  • ***
  • Posts: 117
  • Anti-Hero Member
    • View Profile
Re: Maximum image size on old machines
« Reply #2 on: March 18, 2016, 10:30:00 pm »
1) Your GPU doesn't support NPOT (non power of two) texture sizes so both width and height go up to the next closest power of two
2) It sounds quite bad... I have integrated Intel laptop GPU with just GL 2.1 that is very slow and even it has NPOT and larger maximum sizes support
3) 100% GPU issue

Very interesting! Never heard about NPOT.
This is a friend's PC by the way.
So, as far as I can tell, there are 2 problems here:
- Unavailable NPOT sizes support.
- Image is too big (even if it had NPOT size support).

1280x720 is the largest image size I'll ever load in my game, these are the backgrounds. Should I bother to reconsider the size of my backgrounds to avoid the size issue and/or the NPOT issue?

I mean, I have to draw a line where a hardware is too old to run the game. Even if I resize it to 1024x1024, there will always be an older machine that cannot run it.

Thoughts?

FRex

  • Hero Member
  • *****
  • Posts: 1848
  • Back to C++ gamedev with SFML in May 2023
    • View Profile
    • Email
Re: Maximum image size on old machines
« Reply #3 on: March 18, 2016, 10:52:24 pm »
Such a machine is just beyond me, what GPU is that? My laptop was a medium class one in general (not really meant for gaming) when bought 5 years ago and it has NPOT and GL 2.1: https://www.opengl.org/wiki/NPOT_Texture

You could:
1) Split texture up programmatically or use something that does so (Thor BigTexture and BigSprite classes) but it's a bit slower and takes more graphical RAM, especially with no NPOT which makes you waste large chunks of space
2) Scale the texture to lower size when loading it, but that will make it look worse (although that's kinda cool that the game looks worse under minimal hardware requirements :P ) and requires some coding change to not assume that texture pixels correspond to drawn pixels 1:1
3) Just don't care since it's really old hardware
Back to C++ gamedev with SFML in May 2023

bitano

  • Jr. Member
  • **
  • Posts: 89
    • View Profile
Re: Maximum image size on old machines
« Reply #4 on: March 18, 2016, 10:59:00 pm »
...4. Buy your friend a new graphics card if his/her b-day is soon!

Tukimitzu

  • Full Member
  • ***
  • Posts: 117
  • Anti-Hero Member
    • View Profile
Re: Maximum image size on old machines
« Reply #5 on: March 18, 2016, 11:18:46 pm »
Such a machine is just beyond me, what GPU is that?

I don't know, it is an integrated card of some sort, when we met 5 years ago he had this PC already, it is a PC for family use, so I'm guessing it is more than 8 years old.

3) Just don't care since it's really old hardware

That's what I wanted to hear  ;D

4. Buy your friend a new graphics card if his/her b-day is soon!

Is 3 months soon? I hope not.  ;D

 

anything