|
Post by Smurftra on May 1, 2005 1:27:28 GMT
Lets say i set my screen at 800x600 and want to draw a 800x600 image as a background. Do i have to split it up in tiny 256x256 images and create enough image objects to draw it all, or is there some functionnality in sprite candy to handle such images.
thanks,
smurftra
|
|
tonyg
Junior Member
Posts: 73
|
Post by tonyg on May 1, 2005 18:14:15 GMT
Not sure why it would be causing a problem. This works...
Graphics3D 800,600 SetBuffer BackBuffer() Include "../sprite candy.bb" cam% = CreateCamera() hud1% = HUD_Create(cam) resource1% = HUD_LoadImageResource ("big.png",4) imagelayer% = HUD_CreateLayer(hud1,resource1) Image1% = HUD_CreateImage (ImageLayer, 0,0,0,0,800,600) HUD_SetObjectOrigin image1,-1,-1 While Not KeyHit(1) Cls HUD_Update() : RenderWorld : Flip Wend
|
|
|
Post by Smurftra on May 1, 2005 18:37:11 GMT
ya but i know 3d cards handle graphics in powers of 2
so i wonder if sprite candy creates one 1024x1024 texture for this (which most 3dcards cant accept). I know i have a good card so i was wondering if it worked for me because of that and if it will fail on cards that do not support more than 256x256 textures.
|
|
tonyg
Junior Member
Posts: 73
|
Post by tonyg on May 1, 2005 19:29:51 GMT
I *believe* B3D will scale non-power 2 textures if it finds the card can't handle them but it can look 'odd'. and is a bit wasteful. Some cards have conditional NP2 support but even newer cards (GF6800) has 'unconditional' NP2 support. This requires a different check by the application and, from 6800 users having problems, B3D might not be doing this additional check. Search for 'np2' here... developer.nvidia.com/object/devnews019.html***HOWEVER*** I checked the SpriteCandy code and it seems to do the same scaling in HUD_LoadImageResource where it checks the texture width/height and creates a new power of 2 texture if necessary. I guess this mean SpriteCandy creates the new texture regardless of card support (?) Simplest thing is to use ImagePacker to create a 1024*1024 and place the background in the top-left. (if SpriteCandy and/or B3D are going to resize it then you might as well get the scaling right P.S. I checked bb.com and a few 6800 users were complaining so I added something to the bug reports asking whether B3D does the additional check.
|
|
|
Post by Smurftra on May 1, 2005 20:06:39 GMT
"Simplest thing is to use ImagePacker to create a 1024*1024 and place the background in the top-left."
thats exactly what i don't want to do. The cards dont handle 1024x1024 textures, i dont want any textures bigger than 256x256 to support most cards.
i read somewhere that you have to take into account that 80% of the consumer base have 2 years or older hardware, and 50% have 4-5 years old hardware.
|
|
tonyg
Junior Member
Posts: 73
|
Post by tonyg on May 1, 2005 20:30:23 GMT
OK, I understand. Unofficial answer... I can't find anything in the SpriteCandy code which limits/reduces texture size and I don't think B3D does either. You'll have to split the image into 256*256 chunks as you suggest. Obviously, it will mean 4 surfaces rather than 1 but, for a single image, this shouldn't be a problem until you get into the 100's of surfaces.
|
|