Sprite Candy Texture Limitation...

Blitz3D Forums/Blitz3D Programming/Sprite Candy Texture Limitation...

NeilH(Posted 2009) [#1]
Hi All,

I'm just getting to grips with Sprite Candy, which I have to say is totally awesome, but have come across something that I can't figure out.

I'm converting a game I have written with a vertical scrolling map in the background to work with Sprite Candy. With normal Blitz functions I loaded the image (one big thin image rather than tiles) and copied the required section of the map to the screen, incrementing the map y position each frame. Nice and simple and works like a charm. The Map is 640x10592!

The problem I get with Sprite Candy is that is gets part way through the map and then just starts repeating the image. Does any body know if there is a limitation to the size of a texture that can be loaded into Sprite Candy? Is it possible to get this type of thing working?

If this can't be done, is there a way to use conventional 2d functions in conjunction with Sprite Candy? I'm converting my game graphic by graphic and everything his hidden until I move it to a sprite candy function.

Any help appreciated!

Thanks
NeilH.


Yasha(Posted 2009) [#2]
I don't have SpriteCandy, but if it works the way I suspect it does (textured quads, yes?) then you're loading that image into a texture, and textures do have a maximum size that can be created on some cards. It's also not reliably the same from card to card. You'll probably find the largest texture available is 4096x4096 though, so you might have to split the image into sections no larger than that. If you want the product to be backwards-compatible, you might even consider keeping it below 2048x2048.


Ross C(Posted 2009) [#3]
There is def a limit for a texture, and you probably have went way past it. Blitz3D will always upscale your texture to the higher power of 2 size, if it's not already a power of two size.

So, in effect, your texture is 1024 x 16384. An absolutely HUGE texture. I'd def think about capping it to about 2048, or splitting it up to different chunks.

Also, that texture will consume 67.1 MB. That's a hell of alot of memory :)


Stevie G(Posted 2009) [#4]
Personally I would stick to 1024 x 1024 as a maximum - this is the maximum limit on alot of older cards.


MadJack(Posted 2009) [#5]
'1024 x 1024 as a maximum' - agree.

It's a bit tricky in SC as you'll need to set up a new layer for each separate section of the image. You'll then need to create an image object within each layer that contains the section.

Then you'll need to move those segments together to give a continuous scrolling image with no apparent joins.

I wonder if it wouldn't be easier to just create joined, textured mesh in a modelling package and load it in and scroll that up and down in the background as required. You could also use DDS images to reduce vid mem.


NeilH(Posted 2009) [#6]
Thanks for the responses all, however I have now figured this out.

I have set the autoclear of the camera off, which means that I can still use my standard 2D image and paste it onto the screen before rendering the 3D stuff.

Doing it this way also means I can keep my image files down to a managable size (1mb).

Thanks
NeilH.