how does bmax handle large images?

BlitzMax Forums/BlitzMax Programming/how does bmax handle large images?

Robert Cummings(Posted 2005) [#1]
Hi there

Because bmax is 3d hardware based, will a 512x512 image look blurry on a voodoo card? or does max auto split images?

What about a 1024x1024 image which isn't supported on ati rage and other laptop 3d cards? is this also split into 256x256 images and rendered seperately?

Please tell me.


Rambo_Bill(Posted 2005) [#2]
Good Question. I remember running into these things when coding for DirectX. Surface size limitations are based on card capabilities.. My guess is Blitzmax doesn't split surfaces, the directX code looks bare in my opinion.


Robert Cummings(Posted 2005) [#3]
Would be nice if it did.


DocFritz(Posted 2005) [#4]
Very nice. What happens, if you draw an image larger than the Card-Limit?


LarsG(Posted 2005) [#5]
displaying images larger that the screen reolution will work on some cards (most new-ish cards), but it may as well just fail.. (either bog out, or just don't display it)..


Robert Cummings(Posted 2005) [#6]
The point I'm making here is that textures larger than 1024 often fail anyway regardless of res, as some cards do not have the hardware capability.

So I think we are all best off splitting our larger images into smaller 256x256 tiles etc.

Just would be nice if this was done internally within Max2D.


Hotcakes(Posted 2005) [#7]
If bmax does split images automagically (would be a step down from blitz3d if this weren't the case) how does this impact on drawing to images? Or, grabbing them as a pixmap and drawing on that and putting it back... does it work on just the split or the whole image?


Dreamora(Posted 2005) [#8]
It does not split anything. if a size is not supported it will be brought to a size supported or not be loaded.
For broad support, having a 512x512 and/or 1024x1024 version is a must have


DocFritz(Posted 2005) [#9]
....great. -.-

The Point is, that I need bigger Images, which are rotated, scaled, and so on. If I had to split them myself, it would be a LOT of work and I would be very glad, if there was some interal split-handling-sys or something.


Dreamora(Posted 2005) [#10]
If you need bigger images you should perhaps check out things like tiled stuff etc ... can't think of any kind of image that needs to be larger than 1024x1024 especially in 2D only ... for backgrounds or maps tiled / sliced stuff is worlds faster and allows far more interesting combinations (it especially allows combination not only 1 static thing)


Robert Cummings(Posted 2005) [#11]
If bmax does split images automagically (would be a step down from blitz3d if this weren't the case) how does this impact on drawing to images? Or, grabbing them as a pixmap and drawing on that and putting it back... does it work on just the split or the whole image?

No! nothing slow like that...

Just like other world-class libraries do... lets look at popcap framework, which was used to create the games seen on www.popcap.com . The library is free to use btw if you're into C++.

Basically when the image is "drawn" and it is 700 pixels wide and 256 pixels high, it will draw 3 quads with different u.v offsets.

That simple.

1 256x256
1 256x256
1 188x256

3 quads are drawn side by side, with different uv maps. Blazingly fast and very simple, with support for images of any kind of size.

Basically, whenever it "runs past" 256 it makes another quad with the uv map offset.


Robert Cummings(Posted 2005) [#12]
Like doc says, it would be lovely to have this built in as splitting them and rotating+scaling them is very difficult beyond a size. It would be nice...


DocFritz(Posted 2005) [#13]
@Dreamora
It's very difficult to Tile a dynamic, moving and acting GameObject, you know? ^^


tesuji(Posted 2005) [#14]
Don't know whether anyone will find a use for it but I've just added a entry into the code archives that handles the splitting, rotation and scaling for you :-)

clicky

Enjoy.


nawi(Posted 2005) [#15]
Nice tesuji! If its that easy why is it not integrated in Blitzmax :O


Dreamora(Posted 2005) [#16]
DocFritz: Why? Making an own object types, load it as anim image or part images and only use the own object which is used to set a "tiled image handle" for correct rotation etc.
not much of work I've to say ...
Just a question of want to or not want to ...


Vorderman(Posted 2005) [#17]
So how would you do a background for a game such as Worms (I believe originally written in Amiga Blitz)?

You need a large backdrop image (a good few screens wide / tall) that can be stored, written to and altered at a pixel level in realtime.

With Blitz2D/3D you just load a single massive bitmap and that blockdraw it onto the screen. BMax seems to fall over completely loading anything above 2048 wide (on my system anyway).


Snarty(Posted 2005) [#18]
If a Pixmap is more like a DIB (Device Independant Bitmap), then you load it with that. Split the screen in to card friendly chunks and handle it that way. Or hope everyones drivers are up-to-date and block copy the pixmap direct to the screen.

I'm sure it's workable :)


LarsG(Posted 2005) [#19]
Vorderman: the Amiga had a feature which let you create a screen larger than your resolution, and manipulate it realtime.. (and display it by screen offsets)


Robert Cummings(Posted 2005) [#20]
Great work tesuji!

I hope BRL incorporate this into bmax as standard. Reason I am hitting walls all the time is because I'm making an entire and ambitious game that will be sold.

Vorderman, I would still use textures however they would be locked and modified when a change needs to be made. This is still preferable as you're allowed to still scale and rotate.

The performance hit is almost nothing as it only takes place when you modify the texture - ie take a big bite out of it.


Hotcakes(Posted 2005) [#21]
Hopefully tesuji, you've just saved my life for my future project =]

Vorderman: the Amiga had a feature which let you create a screen larger than your resolution, and manipulate it realtime.. (and display it by screen offsets)

The fact that the PC doesn't have that doesn't seem to have stopped games like Worms World Tour appearing on PC...

The performance hit is almost nothing as it only takes place when you modify the texture - ie take a big bite out of it.

Which is fine for a turn based game, but what about drawing images randomly onto them in realtime? It can't be a happy system, surely.


Robert Cummings(Posted 2005) [#22]
It's fine for worms, which was being discussed. I don't see worms making holes every frame :)


Dreamora(Posted 2005) [#23]
If you want to draw in realtime, create an extended Image type that uses PBuffers ...


Hotcakes(Posted 2005) [#24]
I don't see worms making holes every frame :)

That's why I specified turn based game.

If you want to draw in realtime, create an extended Image type that uses PBuffers ...

What if you're an idiot and don't know anything and want someone else to do it for you? =]


Robert Cummings(Posted 2005) [#25]
Less noise please dreamora and hotcakes. Lets keep chit chat in general.


Hotcakes(Posted 2005) [#26]
Well then since the topic died with that I'm reraising the question : How to go about using PBuffers? Has no one attempted it yet?


MrCredo(Posted 2005) [#27]
my 5 years old gfx-card supported 2048x2048 - and this card was "BAD"


Steve Elliott(Posted 2005) [#28]
I've asked this before and didn't get an official answer - just guesses from the guys here - and what about several images stored in a 512 X 512 (LoadAnimImage) texture?


Dubious Drewski(Posted 2005) [#29]
So how does this work if I have 256x128 - sized textures?
With the way video cards work in chunks, can I use a 256x256 texture at no extra performance cost?