Thread: the effects of textures on my frame rate

  1. #31
    Pursuing knowledge confuted's Avatar
    Join Date
    Jun 2002
    Posts
    1,916
    Check your video card settings.
    Away.

  2. #32
    l'Anziano DavidP's Avatar
    Join Date
    Aug 2001
    Location
    Plano, Texas, United States
    Posts
    2,743
    PROBLEM SOLVED:

    My frame rate is now: 60 fps (with textures)

    That was the weirdest freakin thing in the world....

    Seriously...

    When I built this computer I installed the AGP drivers that came with the motherboard, but not my video card drivers.

    After playing a few games I thought I didn't need to. All my games got GREAT frame rates. (Warcraft 3 included).

    But for some reason MY project WASNT getting great frame rates. So I decided to install my vid card drivers today and boom my frame rates skyrocket....

    Isnt that just so freakin gay....
    My Website

    "Circular logic is good because it is."

  3. #33
    Carnivore ('-'v) Hunter2's Avatar
    Join Date
    May 2002
    Posts
    2,879
    >>Isnt that just so freakin gay....
    No, it's common sense

    Sorry, I just had to say that
    Just Google It. √

    (\ /)
    ( . .)
    c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.

  4. #34
    Isnt that just so freakin gay....
    The OS thinks you are gay for not giving it the driver it needs to fully tap your graphics card capabilities.

    Sorry, I just had to say that

  5. #35
    Visionary Philosopher Sayeh's Avatar
    Join Date
    Aug 2002
    Posts
    212
    Okay, first of all, let's get back to basics (ie, what is performance really about)-- I won't $$$$$, but this is what I've been trying to tell you all for years about understanding how your machine works.

    I'm gonna address a few items, by no means all, but these alone will create dramatic improvements in performance in this code:

    1) Work with 8-bit textures, not 24. This is by far the biggest time saver. In a game, the eye cannot distinguish 24-bit color sufficiently to make it useful. At best, don't go more than 16-bit. The fact that you are moving 3 bytes per pixel per frame, is INCREDIBLE the amount of work that is creating.

    2) Don't waste time clearing buffers-- just put new data in them. It's faster. Remember the golden rule: Touch each pixel only once per frame.

    3) Do not do a lot of testing (if's, fors, etc.) in your frame drawing-- tests are expensive in terms of time.

    4) do not use local variables in your frame drawing code-- use globals, and registers where you can. Everytime you enter a function that gets and returns parameters, the system has to spend precious time setting up a stack frame. Don't waste that time.

    5) Don't use functions where you don' t have to-- recode the item as a macro-- this eliminates stack-time altogether.

    6) Don't use ints, and bytes for holding numbers, use the largest native word-size you can. This way, the processor doesn't have to waste time masking memory to work with just a few bits. In a 32-bit processor, you would use an unsigned long. I don't care if you're just counting to 8, use an unsigned long. It's not about the value the number will hold, it's how the processor handles it.

    7) Put everything in memory so you aren't hitting the disk.

    8) precalculate all your data so it's just sitting there, waiting to be displayed. Don't waste time manipulating data, if you can trade RAM for speed. Use the RAM instead of manipulation (ie. Store more data, even if redundant, if it's faster to access, rather than so, rotating a bitmap 90 degrees or whatever).

    -----

    Remember:

    1) DON'T work with more data than you have to
    2) DON'T do more work than you have to per pixel
    3) DON'T do more work than you have to per frame

    To get performance you trade one of two things (all are resources to you): You trade RAM for speed, or you trade code for speed.

    For example:

    The two fastest methods to swap the bits in a byte, end for end, come down to trading one resource or another for speed. In this case, You can use a table (uses RAM), or you can eliminate your loop and use more lines of nearly identical code-- one line for each bit being swapped)-- (uses code size).

    enjoy.
    It is not the spoon that bends, it is you who bends around the spoon.

  6. #36
    Carnivore ('-'v) Hunter2's Avatar
    Join Date
    May 2002
    Posts
    2,879
    >>recode the item as a macro
    Just thought I would point out, inline functions are supposed to be just about the same speed
    Just Google It. √

    (\ /)
    ( . .)
    c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.

  7. #37
    Has a Masters in B.S.
    Join Date
    Aug 2001
    Posts
    2,263
    ah, but there's no guarantee of inlining, macro's always work.
    ADVISORY: This users posts are rated CP-MA, for Mature Audiences only.

  8. #38
    Carnivore ('-'v) Hunter2's Avatar
    Join Date
    May 2002
    Posts
    2,879
    Ah right, my bad. Although if you're using MSVC you can use __forceinline
    Just Google It. √

    (\ /)
    ( . .)
    c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Getting Frame Rate in DirectX
    By Rune Hunter in forum Game Programming
    Replies: 4
    Last Post: 11-02-2005, 02:57 PM
  2. Animation not working....
    By aquinn in forum C Programming
    Replies: 7
    Last Post: 02-19-2005, 05:37 AM
  3. bottleneck in frame rate occurring
    By DavidP in forum Game Programming
    Replies: 10
    Last Post: 09-19-2003, 03:48 PM
  4. Frame Rate
    By Tommaso in forum Game Programming
    Replies: 6
    Last Post: 04-04-2003, 06:40 PM
  5. Whats a good frame rate?
    By compjinx in forum Game Programming
    Replies: 16
    Last Post: 04-07-2002, 05:31 PM