Almar
Moderator
Netherlands
192 Posts |
Posted - May 10 2004 : 2:06:42 PM
|
Hmm, I still have one annyoing issue that is bothering me a lot. It's in the resolutions changes for YALG. since I'm using Transformed, prelit vertices, I can't simply change the projection matrix to make everything resized. Unfortunatly.
So, I have to recalculate all vertex sizes, and locations. I have simply used the following method for that.
Max resolution, is 1024 is "1". so, 800x600 = 800 / 1024 = 0.78125
Which is calculated after every resolution change. No problems there. I think this is the right method.
In my function that makes a rectangle triangle list (6 verts), I simply use:
sngWidth = ((sngWidth - 0.1) * constTileSize) sngHeight = ((sngHeight - 0.1) * constTileSize)
sngX = (sngX * constTileSize) sngY = (sngY * constTileSize)
the 0.1 is there for demonstration.. I think my problem is related to some rounding stuff, I'm not exactly sure. Well, coming to the problem:
See the black border around the items? Well, at 800x600 it looks like this:
And it's so annoying! At 640x480 the same happens. I have tried Fix/Int/Cint/+0.1/, etc. I know this has been a problem before with the mouse cursor...
anyone have any interesting ideas? :) |
|
VBBR
Moderator
Brazil
617 Posts |
Posted - May 10 2004 : 2:35:13 PM
|
Wow how many annoying issues have you come into since you started this game? Sorry I don't know what the problem is. But a guess... How do you calculate the button border thickness?
|
Whatever. Who knows... |
|
|
Almar
Moderator
Netherlands
192 Posts |
Posted - May 10 2004 : 2:38:38 PM
|
quote: Originally posted by VBBR
Wow how many annoying issues have you come into since you started this game? Sorry I don't know what the problem is. But a guess... How do you calculate the button border thickness?
just a bitmap :) |
|
|
EACam
Warrior
154 Posts |
Posted - May 10 2004 : 3:23:03 PM
|
it looks like a problem with the texture coordinates...
What was that 0.1 for again? I don't get why you'd need it...
If i were you, i'd simply calculate the scale factor (for both height and width) between the display mode you made the game for and the display mode you're using and then multiply all the tiles/graphics by that...if that's not what you're doing already
Edit: Oh, yes it looks like you're doing the scale factor, but are you doing it for BOTH the height and width? You have to. And you should just multiply ALL values by the scale factor (which, obviously, would be 1 if the display mode was at the default). E.g. VertexCoordinate(X * ScaleFactorX, Y * ScaleFactorY) |
Edited by - EACam on May 10 2004 3:27:59 PM |
|
|
Almar
Moderator
Netherlands
192 Posts |
Posted - May 10 2004 : 3:37:36 PM
|
I'm doing that.. and the texture coords don't change.. The 0.1 is just for rounding purposes.. it was a test ;) |
|
|
VBBR
Moderator
Brazil
617 Posts |
Posted - May 10 2004 : 4:56:11 PM
|
Hey if the image is a bitmap then... the borders can disappear. look at this...
****** *------* *------* ******
if you squash this bitmap above to say, half its size look at what will come out probably...
**** *----
oops, that's without my border! Try making the border thicker
You should have know this lesson, try never to squash bitmaps that have a pixelated border... make the border separately. |
Whatever. Who knows... |
Edited by - VBBR on May 10 2004 5:03:28 PM |
|
|
EACam
Warrior
154 Posts |
Posted - May 10 2004 : 5:05:53 PM
|
Oh DUH!!! I was thinking too complicated...i guess that's a programmer's main problem...bugs are often way simpler than we think.
|
|
|
VBBR
Moderator
Brazil
617 Posts |
Posted - May 10 2004 : 5:46:26 PM
|
of course... |
Whatever. Who knows... |
|
|
Eric Coleman
Gladiator
USA
811 Posts |
Posted - May 10 2004 : 7:41:33 PM
|
Are you using texture filtering? If you are, I guess too much of the border is getting cut off for the border to be blended. One option to consider is to design the game for a smaller resolution, and then stretch the graphics to a larger size. The border won't disappear, it will just be a bit blurry.
Or you can do what VBBR suggests, create the border seperately.
A third option would be to use different graphics for different resolutions, but that's an option if you distribute your game over the internet. |
|
|
Sr. Guapo
Swordmaster
USA
272 Posts |
Posted - May 10 2004 : 10:32:32 PM
|
I would use Eric's first idea. You are starting with a big texture, then shirinking it... It may look worse, but it won't be missing pieces if you do it the other way around. |
|
|
ballistik
Moderator
72 Posts |
Posted - May 10 2004 : 11:55:11 PM
|
Ah yes, it took a problem like this for me to learn never to shrink my graphics, only to stretch them, but not too much otherwise that starts to look bad too. |
_____________________ ..::||::.. |
|
|
Almar
Moderator
Netherlands
192 Posts |
Posted - May 11 2004 : 12:10:34 PM
|
quote: Originally posted by VBBR
Hey if the image is a bitmap then... the borders can disappear. look at this...
****** *------* *------* ******
if you squash this bitmap above to say, half its size look at what will come out probably...
**** *----
oops, that's without my border! Try making the border thicker
You should have know this lesson, try never to squash bitmaps that have a pixelated border... make the border separately.
If you resize a photo, it won't cut something off either.. does it? :). I'm not cutting stuff off.. the TU/TV's stay the same, but the rectangle size is decreased.. it should just work. |
|
|
Almar
Moderator
Netherlands
192 Posts |
Posted - May 11 2004 : 12:11:59 PM
|
quote: Originally posted by Eric Coleman
Are you using texture filtering? If you are, I guess too much of the border is getting cut off for the border to be blended. One option to consider is to design the game for a smaller resolution, and then stretch the graphics to a larger size. The border won't disappear, it will just be a bit blurry.
Or you can do what VBBR suggests, create the border seperately.
A third option would be to use different graphics for different resolutions, but that's an option if you distribute your game over the internet.
This is just an example. It happens to the mouse cursor, or to many other objects... It's some rounding thing, since I can reproduce it with a Cint() in "normal" 1024... it should just be possible to resize the verts. I just don't get it :) |
|
|
Sr. Guapo
Swordmaster
USA
272 Posts |
Posted - May 11 2004 : 3:45:19 PM
|
When you shrink an image, basically, you are deleting lines of pixels (it actually averages 2 together). Anyway, some of the lines will be altered, and it just so happens that your border is being averaged out. In the screen shot, the border is still there, it has just been averaged with the next line(s), so it appears lighter/thinner. |
|
|
Almar
Moderator
Netherlands
192 Posts |
Posted - May 12 2004 : 12:39:38 PM
|
Hmm, I still think there should be an easier solution.
btw, I was just checking out a new vb fibre test thing I made (making a quick trianglelist rectangle), and I got like 20% speed improvement over the method most people make them. I was totally amazed by the amount of ASM code needed to call just one function.. |
|
|
Almar
Moderator
Netherlands
192 Posts |
Posted - May 12 2004 : 2:05:10 PM
|
Hmm, guess not. I thought about changing the destrect of present() but it doesn't work either. Guess I'll give up... |
|
|