Trees in games

Discussion in 'General Game Discussion and Questions' started by lord-sam, Jan 13, 2010.

  1. reo7

    reo7 Member

    Nov 7, 2009
    22
    0
    0
    Best pun ever.
     
  2. Will090

    Will090 Well-Known Member

    Enviro-Bear has nice trees
     
  3. c0re

    c0re Well-Known Member

    Apr 15, 2009
    444
    0
    0
    Trees are a performance problem for an iPhone specific reason :)

    Please allow me to explain :

    In order to render a cheap semi-3D tree, with leaves, you have to use, let's assume, 2 - 3 vertical quads. Each one will be textured with a unique image, having a trunk and a pack of leaves.

    There comes the problem : If you want your quads not to hide the ones that are behind them, and take into account the transparent pixels of your texture instead, you have to use Alpha Testing.
    Alpha Testing recalculates if a portion of a solid polygon has to be more or less transparent, and then to display what's behind it.
    This calculation has already been done in an earlier pass, when the graphical pipeline saved the raw untextured polygon positions & displays.

    So not only this hungry calculation is done twice here, but the iPhone's graphical chip has an internal rendering optimization that put Alpha Testing out of the loop.

    In short, Alpha Testing is clearly unadvised by Apple.

    So, as one tree rarely comes alone, you will have to multiply these hard hits to your FPS by the number of trees onscreen.

    Which is why gamedevs often prefer (ugly) single quaded trees.

    Ugly trees or 15 fps ? Make a choice ;)
     
  4. MidianGTX

    MidianGTX Well-Known Member

    Jun 16, 2009
    3,738
    10
    38
    I knew you were going to point it out ;)
     
  5. Ddyracer123

    Ddyracer123 Well-Known Member

    Aug 4, 2009
    1,236
    1
    0
    doesn't GTA 4 have really crap like trees? I'v'e watched alot of gameplay vids and wasn't impressed with how ugly they are.


    This is how it should look:

     

Share This Page