Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: How to draw correctly supporting much graphic cards

  1. #1

    How to draw correctly supporting much graphic cards

    Hi there,

    I am new to PowerDraw and I like the way it makes it possible to draw 2D things using 3D hardware. Very nice idea and very good implementation!

    Now my question:

    I am trying to convert a little part of a 2D game I was developing quite a time ago, and I discovered the following problem:
    I need to use 800x600 resolution and my background-graphic is a still Image of this size. I load this image in an Imagelist and draw it by using RenderEffect-Routine of PowerDraw. Seems to work fine and fast using hardware... I tried out this little experiment on a computer with ATI Radeon 9000 mobility, works fine with more than 800 FPS in fullscreen.
    On another PC with GeForce4 Ti 4200 it works fine also with nearly 1000 FPS in fullscreen mode.
    Now the problem: I tested it on a PC with a shared memory Geforce 2MX/400 and every picture which has no size like 16*16,32*32,64*64,128*128 or 256*256 is shown just as a white square!
    So how do I paint images which has size like 800*600 on older graphic cards, which support 3D but no textures of different sizes like mentioned above?
    Lets stay at my little example. I want to paint a backgroun of size 800*600. How do I do this whithout getting problems on older graphic cards? Do I have to tile the background in 256*256-blocks? If it is so, then how would I e.g. rotate an image bigger than 256*256?
    Maybe the question is stupid and you have a quick answer, but any hint would help me very much.
    Thanks in advance.
    Dirk
    <a href="http://www.greatgamesexperiment.com/game/Valgard/?utm_source=gge&amp;utm_medium=badge_game"><img border="0" alt="GGE" title="GGE" src="http://static.greatgamesexperiment.com/badge/game/valgard/gge400x56.png"></a>

  2. #2

    How to draw correctly supporting much graphic cards

    While newer graphics cards support non power of two textures there is a speed hit, so you should avoid them anyway. For say an image of 800x600 you could expand its dimensions to next power of two (which in this case would be 1024x1024) keeping the expanded area empty. A thing to note is that big textures with dimensions above 512 are slower on older cards and if you have a lot of them they?¢_Tll suck up video ram quite fast, so you might want to scale those 800x600 images to 512x512 and stretch them when drawing (it wont be too ugly as it?¢_Tll be bilinear filtered in hardware). I think PowerDraw has a general drawing function named TextureMap or something which allows you to specify texture and vertex coordinates so you can do rotations or any other transformations yourself. And on a side note about moving to hardware acceleration, remember that texture changes are expensive, so for best performance don?¢_Tt put every small image in a separate texture, but try to group some images in one texture and before drawing sort sprites by texture for best performance.

  3. #3

    How to draw correctly supporting much graphic cards

    If anyone can say anything about this please quote your thoughts.
    I need a quite quick reply on this because this "experiment" is just a trial on converting a really big project to PowerDraw. And if it works like I wish then I will be proud to make a statement at the beginning of the game`that it is powered by PowerDraw. I just don't want to mess around with all the 3D stuff to make a 2D game. But I have a good idea for a game and am programming Delphi for about 10 years. But my knowledge ends in programming 3D hardware. So I would be glad if I could use components like PowerDraw to fulfill my thoughts in real calculated pictures.
    And till the actual moment I thought all would be working fine with PowerDraw, but then I found the issue with the GeForce 2MX/400.

    Ok, I am just writing this because I saw about 9 "seeings" of my post and no answer.... and I need a "quick" answer, because I have time now to spend on my project..... in a few weeks it could have changed to "no time"...

    thanks to everyone replying....

    Dirk
    <a href="http://www.greatgamesexperiment.com/game/Valgard/?utm_source=gge&amp;utm_medium=badge_game"><img border="0" alt="GGE" title="GGE" src="http://static.greatgamesexperiment.com/badge/game/valgard/gge400x56.png"></a>

  4. #4

    How to draw correctly supporting much graphic cards

    Hi Paulius,

    seems like you wrote your post when I did my second
    Sorry for my imapcience

    Ok, now to your post....

    I understand the talking about texturesize etc. I also understand that I have to use textures smaller than 512*512... But I miss the answer to my question... How do I draw e.g. backgrounds sized 800*600 the best way...

    Sure, I can tile all my images, I then can load every single part of it into different TAGFImages (in this case by 256*256 it would be 4*3 = 12 parts!!!) and then draw them on the screen. I am sure this will also work on the graphic card I mentioned before, because I tried to draw a "tile" on this card and then it worked...
    But in fact I am programmer and no designer ( I have a friend who does graphics, and he does his job very satisfying), so I don't want to mess with more pictures than I have to. And then the next question is, maybe I want to rotate the background, containing 4*3 images of 256*256 (to fill the screen of 800*600), how do I do this I have no experience in programming 3D so'it would be nice if you don't answer like "take the complement of vertex a and multiply it with face two, then add the matrice etc. :-) just joking, answer as you like, if I don't understand I will quote.....

    Dirk
    <a href="http://www.greatgamesexperiment.com/game/Valgard/?utm_source=gge&amp;utm_medium=badge_game"><img border="0" alt="GGE" title="GGE" src="http://static.greatgamesexperiment.com/badge/game/valgard/gge400x56.png"></a>

  5. #5

    How to draw correctly supporting much graphic cards

    You don?¢_~t need to think 3D for this, thinking 2D is enough, but you?¢_Tll still need to think . I took a look at PowerDraw help files, TextureMap looks like this:
    function TextureMap(Image: TAGFImage; PCoords: TPoint4; Color: TColor4; TexCoord: TTexCoord;
    Effect: Integer): Integer
    PCoords represents four corresponding points of the image on the screen, playing around with these will give you all you want. You want your texture stretched to the whole screen ?¢_" specify PCoords as your screen boundary size, you want rotation just rotate these four points in 2D. And there?¢_Ts no real sense to split images in small textures cause texture changes(change to using another texture when drawing, yes PowerDraw hides this from you) will be worse than the benefit from using small textures.
    How do I draw e.g. backgrounds sized 800*600 the best way
    you could expand its dimensions to next power of two
    or
    scale those 800x600 images to 512x512 and stretch them when drawing

  6. #6

    How to draw correctly supporting much graphic cards

    Hi Paulius,

    I have just tested the 1024*1024 sized texture on the GeForce2MX/400 system and it works.
    Thank you very much for your help.
    I only need 1 texture for background at a time (sized 1024*1024) so I don't think that there will be memory-problems, even on smaller graphic cards. All other grahics are even smaller than 256*256.
    Greetings and once more thanks,

    Dirk
    <a href="http://www.greatgamesexperiment.com/game/Valgard/?utm_source=gge&amp;utm_medium=badge_game"><img border="0" alt="GGE" title="GGE" src="http://static.greatgamesexperiment.com/badge/game/valgard/gge400x56.png"></a>

  7. #7

    How to draw correctly supporting much graphic cards

    It's very recommended to use 256x256 texture size as a maximum, just to make sure it works on any video card. Simply open your 800x600 image in some editor and resize it to 256x256. Back in PowerDraw, draw it in 800x600 size. Using 1024x1024 texture just to draw background image isn't a very good idea (you waste a lot of memory and make your application compatible only with newest video cards).

    Cheers,
    Lifepower

    P.S. Check http://www.mor.itesm.mx/~al375780/asphyre_beta.zip (full release coming... soon )

  8. #8

    How to draw correctly supporting much graphic cards

    I thought that only practically extinct 3dfx boards up to Voodoo3 had maximum texture size of 256x256, no?

  9. #9

    How to draw correctly supporting much graphic cards

    Well, my old Intel-powered video card on laptop has the same limitation, and few others have 512x512 as a maximum size. You can pretty much assume that most of video cards can handle bigger sizes, but since PowerDraw is made mainly to run on any hardware (thanks to Software Renderer), it's a good practice to not to overpass 256x256 texture size.

  10. #10

    How to draw correctly supporting much graphic cards

    Hello Lifepower,

    nice to hear something from the "master" himself
    If I understand your post right I would shrink my image to 256*256 and then stretch it back to 800*600. But this would mean I loose much quality of the background. It is necessary for my purposes to have the image on screen pixel by pixel as I draw it, because there are much interactionpoints for the user and it would look awful if I stretch it from 256*256.
    Is there any other way to make my background appear like I draw it in 800*600 size? This is an essential question, because I really would like to use PowerDraw or Asphyre but I need this stupid background to be drawn properly...

    Thanks for your time...
    <a href="http://www.greatgamesexperiment.com/game/Valgard/?utm_source=gge&amp;utm_medium=badge_game"><img border="0" alt="GGE" title="GGE" src="http://static.greatgamesexperiment.com/badge/game/valgard/gge400x56.png"></a>

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •