It seems to me that an image with 513x768 or 1024x768 draws fine but not 1025x768.
Tried love.graphics.newImage with ImageData as well as reading from a file.
I use v0.8.0 so should not be power of 2 syndrome. Is it just me having this problem?
Any hardcoded limit on image size?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Any hardcoded limit on image size?
It's more than hardcoded, it is hardwired into your graphics card. With 0.8 the PO2 syndrome is not magically gone, it is just cleverly worked around by reserving memory for a PO2 image behind your back, if this is necessary (i.e. when your graphic card cannot handle non PO2 images). So the 1025x768px image will reserve 2048x1024px to prevent any issues.
Now, making the assumption that one pixel takes up 4 Byte (32 bit), this will allocate 2048 * 1024 * 4 Byte = 8 MB of graphics memory just for the image (without PO2 correction this would still take up 1025 * 768 * 4 Byte = ~3MB). Some graphic cards (especially older ones) don't have that amount of memory. Thus, they cannot load or show the image.
Now, making the assumption that one pixel takes up 4 Byte (32 bit), this will allocate 2048 * 1024 * 4 Byte = 8 MB of graphics memory just for the image (without PO2 correction this would still take up 1025 * 768 * 4 Byte = ~3MB). Some graphic cards (especially older ones) don't have that amount of memory. Thus, they cannot load or show the image.
Re: Any hardcoded limit on image size?
Thanks!
I am not quite sure, but it does not look like a memory limit, however.
Here is a short code to demonstrate the problem:
On my system, second and forth image show up as white while the rest are in pink.
I am not quite sure, but it does not look like a memory limit, however.
Here is a short code to demonstrate the problem:
Code: Select all
local j,k={},{}
function love.load()
table.insert(j,love.image.newImageData(2,1024))
table.insert(j,love.image.newImageData(2,1025))
table.insert(j,love.image.newImageData(1024,2))
table.insert(j,love.image.newImageData(1025,2))
table.insert(j,love.image.newImageData(1024,1024))
for z=1,#j do
for y=0,j[z]:getHeight()-1 do
for x=0,j[z]:getWidth()-1 do
j[z]:setPixel(x,y,222,44,111,255)
end
end
k[z]=love.graphics.newImage(j[z])
end
end
function love.draw()
for z=1,#k do
love.graphics.draw(k[z],z*80+20,z*80+20)
end
end
Re: Any hardcoded limit on image size?
It looks like your graphics card/driver can't load textures with a width or height equal or higher than 2048. What graphics card and driver do you have? Can you try to update the driver?
Shallow indentations.
Re: Any hardcoded limit on image size?
I remember having this issue when I made a screensaver for my mother using LOVE. You don't really think about the differences in older versus newer tech until it bites you. I made a large static image for a background and her laptop's puny Intel chip completely choked. Turns out it can't handle large sizes well at all! I really had to butcher the nice screensaver I made to get it to work at all on her machine.
- Jasoco
- Inner party member
- Posts: 3726
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
- Contact:
Re: Any hardcoded limit on image size?
For safety reasons I like to keep my images to 1024x1024 at most just in case. But you could play it safe at 512x512. If you need images bigger, you'd just use pieces and draw them tiled, but at least you'd be safe from cards that can't do really big images.
We;ve done a few polls before to see who can support what. My MacBook Air's integrated HD3000 card can support a large amount of large images, but a better full dedicated card might be more limited. It seems to depend on what the card maker decided to support at the time. It's silly I know. But there's nothing you can do except prepare and use smaller images.
We;ve done a few polls before to see who can support what. My MacBook Air's integrated HD3000 card can support a large amount of large images, but a better full dedicated card might be more limited. It seems to depend on what the card maker decided to support at the time. It's silly I know. But there's nothing you can do except prepare and use smaller images.
Re: Any hardcoded limit on image size?
Thanks everyone for replying!
Yeah, I am using GMA950.
The problem is I cannot break up the image of a spritebatch or there will be issues with drawing sequence ...
I guess I will have to give up!
Wonder how other software handle this issue ...
Yeah, I am using GMA950.
The problem is I cannot break up the image of a spritebatch or there will be issues with drawing sequence ...
I guess I will have to give up!
Wonder how other software handle this issue ...
- Jasoco
- Inner party member
- Posts: 3726
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
- Contact:
Re: Any hardcoded limit on image size?
They handle it by breaking up the images. Just break up the image. You'll have to do it anyway. Instead of having one large image in the spritebatch you might have 4 or so. But at least it would be compatible with more graphics cards.IQuit wrote:Thanks everyone for replying!
Yeah, I am using GMA950.
The problem is I cannot break up the image of a spritebatch or there will be issues with drawing sequence ...
I guess I will have to give up!
Wonder how other software handle this issue ...
Who is online
Users browsing this forum: Ahrefs [Bot], Google [Bot] and 2 guests