Graphics Update, v1.1

Discussion in 'Planetary Annihilation General Discussion' started by varrak, February 20, 2014.

  1. lokiCML

    lokiCML Post Master General

    Messages:
    1,973
    Likes Received:
    953
    Great post love to see that kind of stuff.:D Playing a game on a scale 3 planet in my frame rate was at 6 - 10 fps. Strategic icons were showing. Which I haven't seen since Alpha. I have a ATI XFX Radeon 5770 and i7 K875 with 16 gigs of RAM. recently updated catalysts to 13.12. I have attached log, perflogs, and dxiag hopefully they can help you.

    Thank you,

    lokiCML

    Attached Files:

    Last edited: February 20, 2014
  2. iron420

    iron420 Well-Known Member

    Messages:
    807
    Likes Received:
    321
    This makes me happy too!
  3. chronosoul

    chronosoul Well-Known Member

    Messages:
    941
    Likes Received:
    618
    Meshes and Quads? What are those if you don't mind explaining.
    varrak likes this.
  4. varrak

    varrak Official PA

    Messages:
    169
    Likes Received:
    1,237
    This is what I get for living and breathing 3D graphics programming...sometimes I forget not everybody out there knows these things. My apoligies :)

    If you want to do some reading, there's quite a good introductory article on polygonal meshes here: http://en.wikipedia.org/wiki/Polygon_mesh

    At a high level, a mesh is a bunch of points in 3D space that make a shape, in 3D; they are used to form the edges of triangles. The fundamental primitive of all 3D graphics is the triangle, so a polygonal mesh in the sense we use it in PA is really just a bunch of triangles all joined together.

    In 3D modelling terms, a quad is just a square. If you were to model something in Maya or 3DS Max, you would do it in quads. The model that gets exported for use in a game would split those into triangles (because that's what 3D hardware works with). (I might be overgeneralizing a bit here...)

    To make things more confusing, I'm talking about a different kind of quad. In the sense I'm using it, a quad is a just a square. We use them to render particles; so all those particle effects you see (the fab spray, the projectiles, even explosions etc) are made up of a bunch of squares. You don't see them as squares because they have textures, and transparency, so you only see the shape the artist intended you to see. Another term for these guys is "billboards"; in other words, a simple square that has a picture on it, like a billboard. For most particles, the billboards are always turned to point towards the camera, so you only ever see them face-on. This gives the illusion of them having presence in the scene.

    As a side note, all the trees (and other surface features) you see in game are rendered as quads when you go beyond a certain distance. This is a technique called "impostors". We project the tree (or whatever) onto 3 quads that are all orthogonal (at right-angles) to each other. When the camera is far enough away, we don't have to draw the full tree. We can just draw the "impostor" and you can't tell the difference.

    [The upshot here is, computer graphics is really just a bunch of clever tricks to make things look real, when they're often really something very simple].

    So... anyway. The old system used to take all the particles in the world, and build a great big mesh out of quads (or billboards) from them. It would do a bunch of math to make these guys face the camera. This was expensive.

    The new system just draws a single quad, over and over and over again (thousands of times), using a big pool of data describing where and how to draw it. The GPU does all the math to figure out which way it faces, which takes a lot of the load off the CPU (which has been our bottleneck, usually, to this point).

    This probably doesn't clear things up all that much.

    If you are really, really curious, here's a wikipedia article on particle systems that gives an overview. http://en.wikipedia.org/wiki/Particle_system
  5. chronosoul

    chronosoul Well-Known Member

    Messages:
    941
    Likes Received:
    618
    So are Homework problems 3, 4, and 5 going to be on the engine design test as well as particle systems? haha. I feel Like a professor has just assigned further reading.

    I'm probably going to read this in the morning when my brain is at full power. Thanks for taking the time to explain the art form to us simple forum plebs.
  6. liltbrockie

    liltbrockie Active Member

    Messages:
    314
    Likes Received:
    160
    Thank you varrak I love these kind of posts and appreciate all your hard work. Cheers.
  7. bmb

    bmb Well-Known Member

    Messages:
    1,497
    Likes Received:
    219
    liltbrockie likes this.
  8. bgolus

    bgolus Uber Alumni

    Messages:
    1,481
    Likes Received:
    2,299
    That shipped with Just Cause 2 (on which the author, Emil Persson, worked). It's an exceptionally intelligent solution to reducing fillrate in games that have many very large overlapping particles.

    We have a lot of very small particles so there isn't a huge savings doing this, not to mention it requires a unique mesh for every texture (or more in the case of flipbooks) greatly increasing the complexity of the system. They're trying to optimize for a different use case.
    carcinoma likes this.
  9. BulletMagnet

    BulletMagnet Post Master General

    Messages:
    3,263
    Likes Received:
    591
    So very much this.
  10. zweistein000

    zweistein000 Post Master General

    Messages:
    1,362
    Likes Received:
    727
    Here's a question, I'm not sire it it's connected with graphics or what you said:

    What determines how much memory will a planet take? 2 or 3 Builds ago I was able to play around with 8-9 planet systems (I simulated planets from Mercury to Mars, their moons + the planetoid Ceres) and while I had to wait in the lobby for around 5 minutes and it took me another 1-2 minutes to actually see the planets once we launched I was able to play on those systems and the funny thing is performance wise the lag wasn't much different than on smaller systems. Since 2 or 3 patches ago though I am unable to lad up systems bigger then 4-5 planets and even those planets can't be too big. Till the last patch I was even unable to play on Lava planets, but that has been fixed now. So here's another question: Will I ever be able to return to 9 planet systems or was that simple because game wasn't complete yet?
  11. v4skunk84

    v4skunk84 Active Member

    Messages:
    196
    Likes Received:
    64
    AMD is busy making the very impressive Mantle api to smash directx (which it does easily). If you run Amd 7000 series or newer get the 14.1 beta and try the Steam Starswarm Mantle demo...80 percent improvement over dx11....
  12. lokiCML

    lokiCML Post Master General

    Messages:
    1,973
    Likes Received:
    953
    Which is exclusive to AMD graphics cards.;)
  13. cptconundrum

    cptconundrum Post Master General

    Messages:
    4,186
    Likes Received:
    4,900
    Right. The only way I really see Mantle taking off is if it gets wrapped up into an abstraction layer that can choose the best option based on the situation, graphics card, etc.
  14. v4skunk84

    v4skunk84 Active Member

    Messages:
    196
    Likes Received:
    64
    Mantle is open source. Nvidia can use it if they wanted.
    There are also over 10 games coming out this year that support Mantle.
  15. lokiCML

    lokiCML Post Master General

    Messages:
    1,973
    Likes Received:
    953
    Please back up this statement.
  16. v4skunk84

    v4skunk84 Active Member

    Messages:
    196
    Likes Received:
    64
    Back what up? I know what I say is fact and can be found with a quick Google search.
  17. cptconundrum

    cptconundrum Post Master General

    Messages:
    4,186
    Likes Received:
    4,900
    It's not open source. It is an "open" API, in that any developer can write a program that uses it. The code itself is closed course and it still only works on a small number of GPUs. I'm sure Mantle is great, but it's not going to change the world. All they did was write a graphics library that is highly optimized for the GPUs that they make. Hopefully existing graphics libraries get updated to use mantle, but I don't really see anyone but AAA developers putting the time into supporting it on their own.

    If OpenGL were updated to automatically use Mantle for supported GPUs on the other hand...

    *Edit*
    It actually looks like the API isn't even public yet.
  18. SXX

    SXX Post Master General

    Messages:
    6,896
    Likes Received:
    1,812
    There will be OpenGL extension which should implement something like Mantle:
    https://twitter.com/grahamsellers/status/383175222469206016

    And actually 14.1 beta drivers already contain undocumented extension called GL_AMD_gcn_shader, possible there will be update on it in future.
    cptconundrum likes this.
  19. lokiCML

    lokiCML Post Master General

    Messages:
    1,973
    Likes Received:
    953
    I'm willing to believe you as long as you provide proof.;)
    Quitch, cwarner7264 and varrak like this.
  20. doud

    doud Well-Known Member

    Messages:
    922
    Likes Received:
    568
    Yes we love these detailed posts. 10ms down to 3ms => OMG !!! Yes we should definitly see the difference.
    Such order of magnitude in performance optimization is just amazing.
    Tons of Kuddos !!!!! :)
    LavaSnake likes this.

Share This Page