Monday, 1 September 2014

AO and Performance

Hit the ground running with more Ambient Occlusion work (as though I never left) with further progress so that light mapping can now be triggered from inside the Test Game and the calculations retained across multiple test game sessions.  I am still keeping the integrated prototype close for quick lightmapping tests, but it's great to finally be in the main engine.


As you can see, here is a typical scene comprising of four large walls and some interior structures. I then press F1 in Test Game, wait a little while, and the static entities are replaced with my new static light map objects.


What you see is a combination of ambient occlusion and a single directional light mapping using a pre-bake of the static entities.  The surfaces still don't have normals and specular, but you can see the basic light vs dark are covered and the depth really comes through.

The light mapper also makes other assumptions, such as deleting LOD1 and LOD2 meshes from the process to reduce light map texture usage overall, betting on the fact the reduced shader requirement will allow the higher geometry rendering to remain.

In other small tests, I also wanted to double check the engine was capable of reaching 700 fps (as requested by Simon) on my crappy gfx card, and sure enough I was able to hit this target:


You might notice I have switched off a few things, but then who wants to run a game at 700 fps :)  Given this theoretical performance availability, the trick now is to ensure the re-introduced elements so not drain their 'fair share' of system resources so we can achieve high frame rates moving forward.  Terrain is a huge drain at present, and with the additional requirement to apply the AO shadows to it, there might be a solution of solving both issues with some kind of run-time replacement for the current dynamic and versatile terrain system (a sort of pre-bake for terrain).

My next trench of work involves being able to save and load the extra light map object data, transfer those files when making standalone and the ultimate test, pre-baking a large level such as The Escape demo.  I think this will lead me naturally onto memory reduction and tasks in that area, so I want to make sure all the other light mapping basics are covered before I get to that point.

Not bad for Monday, let's hope the rest of the week is as productive!  For those interested, I will be making my transatlantic journey to San Francisco next week for the annual Intel Developer Forum 2014.  If you would like to meet up and share a beer or two, I will be tweeting my locations each day and generally enjoying a brief break before the final charge up to Christmas.

8 comments:

  1. Great progress Lee,the cloth over the alter looks great in the second pick.

    ReplyDelete
  2. Excellent work! Still think the AO is slightly too dark though :)

    ReplyDelete
  3. These scenes are looking a lot better Lee. Keep it up :)

    ReplyDelete
  4. Looks very nice,but one thing that occurs to me about this:

    "The light mapper also makes other assumptions, such as deleting LOD1 and LOD2 meshes from the process to reduce light map texture usage overall, betting on the fact the reduced shader requirement will allow the higher geometry rendering to remain."

    Is that could this mean distant objects don't cast shadows? For example if you had a large hill or distant skyscraper being rendered in LOD1 or LOD2, would it not cast a shadow?

    Maybe a property like "always cast shadow" should be added?

    ReplyDelete
    Replies
    1. Ah, or would it just create shadows based on the LOD3 mesh? In which case that problem would obviously go away.

      Delete
  5. You should really let us know next time you are around for a beer in the UK. (mainly Macclesfield or Preston) I think I owe you a Guinness!

    ReplyDelete
    Replies
    1. Lee lives in Wales. Is that not part of the UK?

      Delete
    2. Yeah, my question probably wasn't worded correctly. It is part of the UK, however, Lee hasn't ever mentioned that he will tweet his location for people to meet up for a beer.

      I would love to arrange a meeting for a load of the UK based forum users to meet up for a beer, just to have a chat with like minded people and talk face to face rather than being an anonymous name on a forum board!

      I can imagine that most of the people on the forums suffer the same fate as myself; whereas, none of my friends are in to game design or have any interest in it. So, when it comes to talking about it, I am pretty much just stuck to the forums.

      Delete