Hi. I am trying to make a racing game. A crucial part is the track. Many games I know use a large bitmap (MRO, Turbo Sliders). These games are neither advanced, nor recent and they run on really old PCs. The bitmaps we're talking about here go to 10,000 pixels in width.
As you might know, LOVE can load an image or create a canvas that is no larger than the maximum texture size of your graphics card. So the reality is, you should not be happy that your GeForce handles 4096x4096, because some laptop may handle only 512x512 and your game won't run on it. These games DO work on old hardware.
So my question is, do you know a way to open large images using LOVE, slice them up into tiles, be able to perform group transformations on it? It seems strange that these games can load, draw, move VERY large images and LOVE can't.
I think, many years ago, I tried some DirectX based game library (DelphiX ?) and I could load large images too. So is this support for large images only available for DirectX? If you're using OpenGL, you're out of luck?
Support for LARGE images?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- kikito
- Inner party member
- Posts: 3153
- Joined: Sat Oct 03, 2009 5:22 pm
- Location: Madrid, Spain
- Contact:
Re: Support for LARGE images?
AFAIK ImageData is not linked to the graphics card or OpenGL in any way (unlike Image) so it shouldn't have those problems.
Try loading the big image inside a ImageData, then create several smaller (512x512) ImageDatas and use ImageData:paste to draw the big one onto the smaller ones. Then you should be able to create one Image for each one of the smaller ImageDatas.
Try loading the big image inside a ImageData, then create several smaller (512x512) ImageDatas and use ImageData:paste to draw the big one onto the smaller ones. Then you should be able to create one Image for each one of the smaller ImageDatas.
When I write def I mean function.
Re: Support for LARGE images?
No, it's universal. Chances are the devs behind DelphiX made the decision to hide a lot of complexity by automatically splitting large images up into smaller textures. You'll need to do the same. First, you should establish a maximum texture size that you wish to support. This will determine your least common denominator hardware (I wouldn't use anything above 2048x2048). When it comes time to draw, you'll need to run a nested for loop for however many rows and columns of slices are on the screen, then draw the correct slices.
Watch out for texture memory limitations. If there's a lot of redundancy in your graphics you might even want to split them into smaller tiles to save on memory.
Watch out for texture memory limitations. If there's a lot of redundancy in your graphics you might even want to split them into smaller tiles to save on memory.
Re: Support for LARGE images?
OK thanks for response guys. So what if I wanted to edit this 10,000px imagedata? I open big image, split it into square pieces, then what? I want to draw some lines on it with love.graphics.line or put some smaller textures on it. As far as I know, you can't draw on an image.
Canvas, on the other hand, is not recommended to be used at all. How many people can have a problem with canvas, really? 1%, 10%?
Canvas, on the other hand, is not recommended to be used at all. How many people can have a problem with canvas, really? 1%, 10%?
- slime
- Solid Snayke
- Posts: 3163
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: Support for LARGE images?
Definitely use canvases, just be aware that your game will either have minimum system requirements (not particularly high ones though), or you'll have to make them optional.Przemator wrote:Canvas, on the other hand, is not recommended to be used at all. How many people can have a problem with canvas, really? 1%, 10%?
~93% (rough estimate) of systems support canvases. The ones that don't probably either have very outdated graphics drivers, or hardware from over 10 years ago.
Re: Support for LARGE images?
Looking at the list, the biggest setback may be the Intel GMA 950 and Intel GMA X3100, which are still used on some modern laptops and Intel Atom (netbooks).
Re: Support for LARGE images?
My dad's PC has a GMA X3100 but it supports (small) canvases
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
Re: Support for LARGE images?
What...?Przemator wrote:As far as I know, you can't draw on an image.?
You're sure that you can't just...
Code: Select all
love.graphics.draw(ImageName, bunchO'Arguments)
love.graphics.line(x1, y1, x2, y2)
Is there something huge I'm missing?
Admittedly, I've only done this with smallish images, but that shouldn't make a difference.
(If you've done this and can't see the line, try setting the color and line size to something ridiculous.)
Re: Support for LARGE images?
Indeed there is , we're talking about editing the image. But it doesn't matter now, there is canvas for that.Knaimhe wrote:As long as the line is drawn after the image, it should appear on top of it.
Is there something huge I'm missing?
Who is online
Users browsing this forum: Bing [Bot] and 7 guests