Post

 Resources 

Console

Home | Profile | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 VBGamer
 VBGamer
 One last DirectX issue - resolutions + TL vertices
 New Topic  Reply to Topic
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 2

Almar
Moderator

Netherlands
192 Posts

Posted - May 10 2004 :  2:06:42 PM  Show Profile  Visit Almar's Homepage  Send Almar an ICQ Message  Reply with Quote
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  Show Profile  Reply with Quote
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...
Go to Top of Page

Almar
Moderator

Netherlands
192 Posts

Posted - May 10 2004 :  2:38:38 PM  Show Profile  Visit Almar's Homepage  Send Almar an ICQ Message  Reply with Quote
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 :)
Go to Top of Page

EACam
Warrior

154 Posts

Posted - May 10 2004 :  3:23:03 PM  Show Profile  Reply with Quote
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
Go to Top of Page

Almar
Moderator

Netherlands
192 Posts

Posted - May 10 2004 :  3:37:36 PM  Show Profile  Visit Almar's Homepage  Send Almar an ICQ Message  Reply with Quote
I'm doing that.. and the texture coords don't change.. The 0.1 is just for rounding purposes.. it was a test ;)
Go to Top of Page

VBBR
Moderator

Brazil
617 Posts

Posted - May 10 2004 :  4:56:11 PM  Show Profile  Reply with Quote
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
Go to Top of Page

EACam
Warrior

154 Posts

Posted - May 10 2004 :  5:05:53 PM  Show Profile  Reply with Quote
Oh DUH!!! I was thinking too complicated...i guess that's a programmer's main problem...bugs are often way simpler than we think.

Go to Top of Page

VBBR
Moderator

Brazil
617 Posts

Posted - May 10 2004 :  5:46:26 PM  Show Profile  Reply with Quote
of course...

Whatever. Who knows...
Go to Top of Page

Eric Coleman
Gladiator

USA
811 Posts

Posted - May 10 2004 :  7:41:33 PM  Show Profile  Visit Eric Coleman's Homepage  Reply with Quote
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.
Go to Top of Page

Sr. Guapo
Swordmaster

USA
272 Posts

Posted - May 10 2004 :  10:32:32 PM  Show Profile  Reply with Quote
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.
Go to Top of Page

ballistik
Moderator

72 Posts

Posted - May 10 2004 :  11:55:11 PM  Show Profile  Reply with Quote
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.

_____________________
..::||::..
Go to Top of Page

Almar
Moderator

Netherlands
192 Posts

Posted - May 11 2004 :  12:10:34 PM  Show Profile  Visit Almar's Homepage  Send Almar an ICQ Message  Reply with Quote
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.
Go to Top of Page

Almar
Moderator

Netherlands
192 Posts

Posted - May 11 2004 :  12:11:59 PM  Show Profile  Visit Almar's Homepage  Send Almar an ICQ Message  Reply with Quote
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 :)
Go to Top of Page

Sr. Guapo
Swordmaster

USA
272 Posts

Posted - May 11 2004 :  3:45:19 PM  Show Profile  Reply with Quote
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.
Go to Top of Page

Almar
Moderator

Netherlands
192 Posts

Posted - May 12 2004 :  12:39:38 PM  Show Profile  Visit Almar's Homepage  Send Almar an ICQ Message  Reply with Quote
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..
Go to Top of Page

Almar
Moderator

Netherlands
192 Posts

Posted - May 12 2004 :  2:05:10 PM  Show Profile  Visit Almar's Homepage  Send Almar an ICQ Message  Reply with Quote
Hmm, guess not. I thought about changing the destrect of present() but it doesn't work either. Guess I'll give up...
Go to Top of Page
Page: of 2 Previous Topic Topic Next Topic  
Next Page
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
VBGamer © Go To Top Of Page
This page was generated in 0.2 seconds. Snitz Forums 2000

Copyright © 2002 - 2004 Eric Coleman, Peter Kuchnio , et. al.