|
|
Panel bmaps - non-power-of-2 compatibility?
#65250
03/01/06 02:49
03/01/06 02:49
|
Joined: Feb 2003
Posts: 6,818 Minot, North Dakota, USA
ulillillia
OP
Senior Expert
|
OP
Senior Expert
Joined: Feb 2003
Posts: 6,818
Minot, North Dakota, USA
|
For my 2D game, it's easier to program it when I can use nonpower-of-2 textures. Otherwise, I have to break it up and have multiple panels for the same graphic and more scripting to move these additional panels, which, in turn, gets sort of confusing to work with. Two questions:
1. What compatibility issues (especially with 6-year-old computers) are there with using a panel bmap that isn't a power of 2? In 6.31, at least, it is supposedly broken into fragments as needed. 2. If it is possible, can I use multiple bmaps for a single panel and be able to position them accordingly to make the original and also move the panel as a whole in the script (and not by referencing multiple panels)?
Note: This applies to the 6.31.4 engine, not 6.40.2. The panel.size_x thing in 6.4x is bad for my 2D game (care for another 1500 lines on top of the 23,000 already adding yet more confusion? Don't think so.) so it's not worth using the 6.4x engine for my 2D game.
"You level up the fastest and easiest if you do things at your own level and no higher or lower" - useful tip
My 2D game - release on Jun 13th; My tutorials
|
|
|
Re: Panel bmaps - non-power-of-2 compatibility?
[Re: ulillillia]
#65251
03/01/06 15:22
03/01/06 15:22
|
Joined: Feb 2003
Posts: 6,818 Minot, North Dakota, USA
ulillillia
OP
Senior Expert
|
OP
Senior Expert
Joined: Feb 2003
Posts: 6,818
Minot, North Dakota, USA
|
Another question: What effect does using a 512x24 bmap have on one panel versus one at 512x16 and another at 512x8 in two separate panels, moving both together.
The sizes I mainly use are whatever I get from adding two power of 2 values together such as 8, 10, 12, 16, 20, 24, 32, 40, 48, 64, etc. and not something like 39 or 27.
"You level up the fastest and easiest if you do things at your own level and no higher or lower" - useful tip
My 2D game - release on Jun 13th; My tutorials
|
|
|
Re: Panel bmaps - non-power-of-2 compatibility?
[Re: ShoreVietam]
#65254
03/03/06 16:54
03/03/06 16:54
|
Joined: Feb 2003
Posts: 6,818 Minot, North Dakota, USA
ulillillia
OP
Senior Expert
|
OP
Senior Expert
Joined: Feb 2003
Posts: 6,818
Minot, North Dakota, USA
|
I'm using near-power-of-2's rather than oddballs. That is, 512x24, 512x40, 512x6, etc.. From what I know (low certainty), the engine will break up the 512x24 into 512x16 and 512x8. It'd break up the 512x40 into 512x32 and 512x8. If my 2D game was run on a system with a video card that doesn't support nonpower-of-2 textures, I'm just asking what performance issues there may be, mainly slowdowns.
"You level up the fastest and easiest if you do things at your own level and no higher or lower" - useful tip
My 2D game - release on Jun 13th; My tutorials
|
|
|
Re: Panel bmaps - non-power-of-2 compatibility?
[Re: ulillillia]
#65255
03/11/06 06:35
03/11/06 06:35
|
Anonymous
Unregistered
|
Anonymous
Unregistered
|
As far as I know, when you create a panel, A6 constructs 2 polygons with the vertices that have been indexed like in the ASCII: Code:
0----1 | /| | / | | / | |/ | 2----3
Thus, A6 creates an index buffer in the following order: Code:
byte[] index = new byte { 0, 1, 2, 1, 2, 3 };
Thus, you have four vertices instead of 6. So, A6 constructs those vertices to make two polygons when a game developer creates a panel. Note that my code is in C# and I don't know how to explain this in C++ for native (unmanaged) DirectX, but all I can explain is A6 performs vertex/polygon creation for panels.)
|
|
|
Re: Panel bmaps - non-power-of-2 compatibility?
[Re: ulillillia]
#65256
03/11/06 08:58
03/11/06 08:58
|
Joined: Jul 2001
Posts: 6,904
HeelX
Senior Expert
|
Senior Expert
Joined: Jul 2001
Posts: 6,904
|
Quote:
From what I know (low certainty), the engine will break up the 512x24 into 512x16 and 512x8. It'd break up the 512x40 into 512x32 and 512x8. If my 2D game was run on a system with a video card that doesn't support nonpower-of-2 textures, I'm just asking what performance issues there may be, mainly slowdowns.
No. I was wrong the same way some weeks ago, because I thought this, too. All 3D cards require power of 2 texture sizes (32, 64, 128, 256...), but none needs a quadratic skin size. So, sizes like 64x128 or 128x256 are also possible. Never use a non-power-of-2 texture size for models or levels. If your texture has a different size, the engine has to inflate it to a power of 2, otherwise it would not be rendered. This results in a bad texture quality, slow rendering and waste of texture memory. Also, only power of 2 textures can be tiled properly. Old 3D cards work best with 256x256 texture sizes. Sizes above 256x256 render remarkably slower.
|
|
|
Re: Panel bmaps - non-power-of-2 compatibility?
[Re: HeelX]
#65257
03/11/06 09:48
03/11/06 09:48
|
Joined: Feb 2003
Posts: 6,818 Minot, North Dakota, USA
ulillillia
OP
Senior Expert
|
OP
Senior Expert
Joined: Feb 2003
Posts: 6,818
Minot, North Dakota, USA
|
This thread relates to panel bmaps, not textures for models or blocks. According to the manual, of what I read a long time ago (like about a year ago), it stated that the engine automatically splits big textures accordingly. However, if there was a way to put multiple bmap images on a single panel, I'd do it that way instead.
"You level up the fastest and easiest if you do things at your own level and no higher or lower" - useful tip
My 2D game - release on Jun 13th; My tutorials
|
|
|
Re: Panel bmaps - non-power-of-2 compatibility?
[Re: ulillillia]
#65258
03/11/06 10:56
03/11/06 10:56
|
Joined: Jul 2001
Posts: 6,904
HeelX
Senior Expert
|
Senior Expert
Joined: Jul 2001
Posts: 6,904
|
Uli, why should the engine use two different image-lists to save bmap*'s used for panels and textures?! look here: I was dealing with a filter bug tied to an overwritten panel bmap and JCL cursed me that I didnt read the manual  --> http://www.coniserver.net/ubbthreads/sho...true#Post623211According to this thread you see that the rules for texture bitmaps and panel bitmaps on the graphics card memory are the same. ciao Christian
Last edited by HeelX; 03/11/06 10:56.
|
|
|
Re: Panel bmaps - non-power-of-2 compatibility?
[Re: HeelX]
#65259
03/11/06 11:18
03/11/06 11:18
|
Joined: Feb 2003
Posts: 6,818 Minot, North Dakota, USA
ulillillia
OP
Senior Expert
|
OP
Senior Expert
Joined: Feb 2003
Posts: 6,818
Minot, North Dakota, USA
|
Seems like reinstalling 6.31 didn't return the 6.31 manual.... This question applies to version 6.31.4. I returned to it so I can work on my 2D game, which is nothing but panels. In 6.31 manual, I recall reading of something in that the engine automatically splits large bmaps. For the fun of it, I even used a 10240x64 bmap (that's right, 10,240 pixels, 5 times the limit of my video card) as a test and it worked without any problems. There were no errors of an invalid texture size or that the texture is too big for the video card. You're probably thinking of 6.4 where this is the case. Because of the size_x thing, of which would add another unneeded 1500 lines of code to the already high 22,000-something, I'm using 6.31. I didn't try the huge bmap test in 6.4 though, yet anyway. It's either I use things like 512x24 or 512x20, as some examples (the addition of two powers of two), or I define multiple panels splitting the bmaps into power-of-2 values using 1 bmap each, or I can somehow add multiple bmaps to a panel, of which there doesn't seem to be a way to do so.  There's nothing more than panels in this scene, with the occasional text object. The clouds at the top is a 512x36 image, which is 512x32 + 512x4. The second-closest mountains are 2048x96, and the 96 is 64+32, of which the 2048 is split into 4 512's making those mountains 8 textures and 12 panels....
"You level up the fastest and easiest if you do things at your own level and no higher or lower" - useful tip
My 2D game - release on Jun 13th; My tutorials
|
|
|
|