Wednesday, 3 November 2010

RQ Workshop

This is a workshop we had to do in last week's lecture. I thought it would be a good idea to put my answers up on the blog so I have a good record of them.

Are you Focused?

  • What is the name of this module, how many credits?
          AG1081A Honours Project Planning and Reporting, 30 credits.
  • Your technical supervisor, how many times have you met?
         I have talked with Matt Bett twice about my project and hopefully will do so again soon, as there are still aspects of my project that I need to figure out.
  • What other module is associated with the honours project, how many credits?
         Honours Project Execution, 30 credits
  • How frequently do you update your blog?
         I try to update the blog at least once a week.
  • Have you included both your worksheets in your blog, with/out annotations/feedback?
        I have done all the worksheets so far (1-3) and posted them on the blog, but so far I have only had one comment on the first worksheet and not the others though I did send my links out.
  • Have you included in your blog the resources you have found and read/reading through your literature resources?
         Yes, I have put up links to all the online resources I have found so far and references for the books I have found also. I haven't read through a lot of them yet but I'm working on it.

Common Sense?

  • Have you subscribed to any game related forum and posted your RQ, research ideas and got feedback?
        No, I haven't. I've never been much of a forum goer and I do feel a little nervous about asking for help in one.
  • What back up procedures have you implemented?
         I keep copies of all the research papers, demos and links that I find on both my USB stick and on my laptop. Anything I have to write down, I use my notebook for and then transfer to the blog. Though, the notes on my blog are more complete than those in my notebook since I think better at a keyboard.
I would keep backups on my university account, but I've been having problems saving stuff to it as it claims that ther's no room. Once I get that sorted I will keep backups on there too.
  • How long do you spend for your Honours Project activities?
         It's hard to say exactly, but possibly about 2-3 hours a week. I probably should spend more time on it I know.

Do you know what you are doing?

  • "What" is your RQ?
           What are the solutions to rendering dynamic ambient occlusion in realtime 3D applications (i.e. games) and how can they be improved/expanded upon to better approximate global illumination?
  • "Why" is it important?
         Realism is a big issue in computer games today and within the realm of graphics, global illumination is a pretty current topic. Global illumination simulates the ambient light that bounces around a scene, reflecting off diffuse surfaces and adds more realism than just having lights and shadows would. However, global illumination techniques such as ray tracing, radiosity and photon mapping are computationaly expensive and while they produce good results graphically, they are not cost effective enough to really be viable in real time apps, i.e. games. Ambient occlusion on the other hand can be implemented in real time apps in a cost effective manner. AO simulates the soft shadows produced where light cannot reach. i.e. in creases and corners, or when two objects are very close together. It provides more depth to a scene, particluarly those with dim lighting. Ambient occlusion can be expanded to simulate indirect lighting as well and could be a viable alternative to global illumination.
  • "How" will you answer it?
         I will create an application that simulates a game environment, i.e. it will have lights, shadows, moving and static objects, and a movable camera. I will then implement a few of the methods for dynamic ambient occlusion and look at how they could be improved upon/expanded. I'm not sure if I should implement a globa illumination method as well so I could compare them, or how many methods I should actually end up implementing. I will have to think a bit more about this aspect of the project.
  • "So What" will be: 1. Your measure for success, 2. What will be the significance of what you have done?
        1.  I think the success will be measured in both, how cost effective the methods are and how well they simulate a global illumination effect.

Friday, 29 October 2010

Research Resource Links

Since I narrowed down my topic and research question, I've been trawling the web and the library for research material. I found quite a lot of resources that could be useful so in order to keep a good, organised record of them I will list them here on the blog.

Books:

Pharr, M and Green, S. 2004. Chapter 17: Ambient Occlusion. Fernando, R. GPU Gems: Programming Techniques, Tips and Tricks for Real Time Graphics. Addison Wesley. 2004. pp 272-292. [online]. Available online at: http://http.developer.nvidia.com/GPUGems/gpugems_ch17.html [Accessed 18/10/10]

Bunnell, M. 2005. Chapter 14: Dynamic Ambient Occlusion and Indirect Lighting. Fernando, R. GPU Gems 2: Programming Techniques for High Performance Graphics and General Purpose Computation. Addison Wesley. 2005. pp 223-233.  [online]. Available online at: http://http.developer.nvidia.com/GPUGems2/gpugems2_chapter14.html [Accessed 18/10/10]

Hoberock, J and Jia, Y. 2007. Chapter 12: High Quality Ambient Occlusion. Nguyen, H. GPU Gems 3. Addison Wesley. 2007/08. pp 257-274. [online]. Available online at: http://http.developer.nvidia.com/GPUGems3/gpugems3_ch12.html [Accessed 29/10/10]

Filion, D. 2010. Chapter 1.2: Principles and Practice of Screen Space Ambient Occlusion. Lake, A. Games Programming Gems 8. Course Technology PTR. 2010. pp 12-31. [online]. Available online at http://my.safaribooksonline.com/9781584507024. [Accessed 18/10/10] 

Akenine-Moller, T and Haines, E. 2002. Real-Time Rendering. 2nd ed. USA. A K Peters, Ltd. 

In the latest book in the Shaderx series; ShaderX7 there are three or four articles on dynamic ambient occlusion which I feel would be very useful - especially because they are very recent. (ShaderX7 was published this year.) However I haven't been able to locate a copy, either in the library or in ebook form (and at £23 I can't really afford to buy a copy.) I'm going to ask the library if they can do an inter library loan, so hopefully I'll be able to get my hands on a copy at some point. 

Online:





Academic Papers: 


Forum Discussions: 


Video Examples:

Wednesday, 20 October 2010

Worksheet 3 - Draft Proposal

Introduction
The aim of the project is to investigate different methods for calculating and rendering dynamic ambient occlusion. Ambient occlusion is used to generate soft shadows that appear in crevices and corners where the light cannot reach as well as shadows that occur when two objects are in close proximity. These shadows aren't cast by any particular light source but are a product of global illumination. During my preliminary search for reseach material I came across a number of different implementations and variations which I intend to look into in order to determine the solution which provides the best balance of graphical quality and performance. Since the application will be real time, cost effectiveness is a big issue - the ambient occlusion will be working in conjuction with lighting, shadows, dynamic objects and user interaction, so it's impact on the framerate cannot be too high. I would like to look at expanding the most viable ambient occlusion methods so that they provide a better approximation of global illumination/ indirect lighting. Again, the focus must be on keeping costs down but at the same time providing an adequete amount of realism.

Motivation
Simulating realism in computer games is a big issue in the games industry today. As games get more and more realistic, the consumers' graphical expctations are getting higher and higher. When it comes to graphical realism, lighting and shadows are one of the most important factors. But it's not enough to just render shadows cast by light sources - there is ambient lighting to consider as well. Global illumination techniques such as ray tracing and radiosity simulate the effects of light bouncing off surfaces and add more depth and realism to a scene. However, this is very computationally expensive and isn't really suitable for real time applications such as games. Ambient occlusion is far more cost effective and simpler. The results produced by ambient occlusion alone are not enough to simulate GI but it could be expanded to better emulate its results while still keeping costs down.

I've been interested in lighting effects and shaders since third year (a lot of my projects focused on the lighting aspects) and ambient occlusion seemed like an interesting topic to investigate. It's also pretty current. According to an article on ambient occlusion in Games Programming Gems 8 (published this year) indirect lighting/global illumination is still an active area of research so I felt it would be a good topic to look at in that respect as well.

Research Question

What are the solutions to rendering dynamic ambient occlusion in realtime 3D applications (i.e. games) and how can they be improved/expanded upon to better approximate global illumination?

Addressing the Question
In addressing the question, I plan to first research static ambient occlusion, in order to better understand the technique, and hopefully implement a simple demo using static AO in a very simple scene. This will help my understanding of the topic in a practical sense as I find learning by doing is a useful tool. I will also research global illumination techniques and how they calculate indirect lighting. From there I will look into the various methods that are available for implementing dynamic AO and try to implement those that seem the most viable performance wise in a real time app. Once I have these methods working in a game like environment I will identify any graphical or performance issues that they may have and experiment to try and solve them.

In expanding the solutions to better emulate global illumination, there are a number of articles I have found which discuss using AO to render indirect lighting. I will try and implement the solutions they discuss and maybe even expand them through experimentation and research into similar techniques.

(I was also wondering whether I should try and implement a proper global illumination method as a comparision but I'm not sure.)

Resource Requirements
I don't anticipate needing any equipment or software that is not already available to me in the game lab. I will be using Visual Studio 2005 or 2008, and working with the DirectX SDK - probably using DirectX 9.

References and Bibliography
Pharr, M and Green, S. 2004. Chapter 17: Ambient Occlusion. Fernando, R. GPU Gems: Programming Techniques, Tips and Tricks for Real Time Graphics. Addison Wesley. 2004. pp 272-292.

Bunnell, M. 2005. Chapter 14: Dynamic Ambient Occlusion and Indirect Lighting. Fernando, R. GPU Gems 2: Programming Techniques for High Performance Graphics and General Purpose Computation. Addison Wesley. 2005. pp 223-233.

Landis, Hayden. 2002. "Production-Ready Global Illumination." Course 16 notes, SIGGRAPH 2002. [online] Available online at http://spherevfx.com/downloads/ProductionReadyGI.pdf [Accessed 19/10/10]

Filion, D. 2010. Chapter 1.2: Principles and Practice of Screen Space Ambient Occlusion. Lake, A. Games Programming Gems 8. Course Technology PTR. 2010. pp 12-31. [online]. Available online at http://my.safaribooksonline.com/9781584507024. [Accessed 18/10/10]  

Friday, 15 October 2010

Worksheet 2 - Redone

As I stated in my previous post, I have decided to change my research question as my initial one was too wide. My topic is still within the realm of shadows and lighting but is far more specific now.
(I'm very insecure so I did have some worries that I'd gone from too wide to too narrow but I've been assured that ambient occlusion has enough scope and complexity.)

  1. Formulate a research question for your project. 
 What are the solutions to rendering dynamic ambient occlusion in realtime 3D applications (i.e. games) and how can they be improved upon*?

*(in terms of quality, cost effectiveness and better approximating global illumination/indirect lighting)
 
  1. Try and answer the following questions in trying to decide the RQ.
a. What is the focus of your project?
      The focus will be mainly on the cost effectiveness of the different methods investigated - particularly when  used in a scene with lighting, shadows, moving objects and player intereaction - as ambient occlusion can hit the frame rate hard. Of course, graphical quality is also an issue and the realism of the proximity shadows, i.e. softness, lack of artifacts etc, will be the secondary focus.

I would also like to look at how the methods could be expanded so as to better emulate global illumination and indirect lighting. 

b. What info do you need to find out about?
      I will need to first look into static ambient occlusion - the theory behind it, its application and why the implementations for static AO are not viable for dynamic AO.

From there I would progress to looking at the available methods for dynamic ambient occlusion - looking at how they solve the problems presented by static methods, how cost effective they are and what graphical glitches they may present. I've already done a bit of preliminary research and there's a number of different methods/ variations of methods. Of course, no method is perfect so I will also look into ways that they could possibly be improved.

As background reading, I also think it would be interesting to look into methods that produce ambient occlusion automatically such as ray tracing and photon mapping, and other global illumination methods.


     c.What experimental work do you need to perform?
      I will need to develop a framework and application within which the various methods will be implemented. The demo will display a real-time 3d scene with moving and static objects, a player controlled camera and simple lighting and shadows (shadow mapping). The various AO methods will then be implemented within this app, and the user will be able to switch between methods and also turn lighting on and off. Performance can be measured both with and without ambient occlusion, quite easily by logging the framerates. Graphical quality will have to be measured with the naked eye.

Wednesday, 13 October 2010

Change of Research Question

Today I met with Matt Bett to talk about my research question - specifically the scope - and he confirmed what I had already suspected. My research question is too broad. Matt highighted some more specific areas that I might like to focus on, such as soft shadowing and ambient occlusion. I was especially interested in the topic of ambient occlusion in real time.

In short, ambient occlusion is used to generate the soft shadows that appear in creases or corners where light cannot reach so easily. It is seperate from the shadows actually cast by light sources, so the type and position of any light sources in the scene are not needed in the calculations. Adding ambient occlusion to a scene gives objects a more realistic, 3 dimensional appearance than just cast shadows and lighting on their own would.

An example of dynamic ambient occlusion -> http://www.youtube.com/watch?v=eefsv8tQmAg

Matt told me that this was a pretty current topic in graphics rendering right now, which makes me think that it would be a good topic for my project. There's also a good amount of research material available from what I can see. 

I plan to redo Worksheet #2 before the weekend and formulate a new research question based around dynamic ambient occlusion for real time applications.

Friday, 8 October 2010

Worksheet 2 - Research Question


Worksheet #2 -  Formulating the research question

  1. Formulate a research question for your project. Details on the research question can be found in presentation 1 in the module folder.
  1. When developing a research question you must produce a question that can be answered by performing literature research, practical experimentation and critical analysis. The question should also focus the activities of your project.
  1. Try and answer the following questions in trying decide on the RQ
    1. What is the focus of your project?
    2. What information do you need to find out about?
    3. What Experimental work do you need to perform?
  1. Can your Research Question be refined in the light of answers to 2 and 3
  2. How will the information that you obtain in 2 allow you to answer the research question?



  1. Formulate a research question for your project.
Investigate the various methods for calculating and rendering shadows in a real-time 3D scene in order to determine the best balance of realism and performance that can be achieved.

Rephrasing that into an actual question:  Which method for calculating and rendering shadows will produce the best balance between realism and performance in a real time 3D scene?

  1. Try and answer the following questions in trying to decide the RQ.
a. What is the focus of your project?
The focus will be on both the realism* of the shadows and the performance/frame rate of the application and finding a good balance between the two. The project will look at the different methods and combinations of methods needed to achieve this.  

*by realism I mean good quality, accurate looking shadows, without pixilation or artefacts. 

b. What info do you need to find out about?
There are a number of methods that need to be investigated:

Shadow Mapping – A popular technique for shadow rendering, shadow mapping involves rendering the scene from the light's point of view and extracting the depth buffor information which is then stored as a 2D texture (the shadow map). The scene is then rendered a second time, from the camera's viewpoint. As each object in the scene is rendered, it's position is compared to the the shadow map. If a pixel is further away from the the light source than the value in the shadow map, then that pixel is shadowed. This method can create very nice, soft shadows and is considered to be an efficient real time algorithm.

(I've looked at/implemented shadow mapping before, during the 3rd year group project so I think I have quite a good grasp of how it works.)

Shadow Volumes – The other popular technique for shadows, this method creates sharp, per pixel accurate shadows. The technique involves projecting a line from the light source through each vertex of the shadow casting object to some far point. These lines will form a 3D volume that will encapsulate all the shadows cast by the object. The shadow volume is then rendered to the stencil buffer only. For each front facing face, the stencil buffer value is increased and vice versa for the back facing faces. Once this has been done for each face, any pixel with a value not equal to 0 is in shadow. 

(I'll need to do some really in depth research on shadow volumes, as I've never looked at them before.) 

I've been browsing the internet for information about these techniques and I've already found quite a few variations on each method which could merit further investigation. 
 
There are also methods for rendering planar shadows which I may look at for the sake of completeness. 


c. What experimental work do you need to perform?
I will need to develop a framework and application within which the various methods will be implemented. The demo will display a real-time 3d scene with moving and static objects which will both cast shadows and be cast upon. Of course there are variations of each method to be looked at and some experimenting as to how they could be combined. The application will measure the frame rate of the scene for each method – this will measure performance, but the realism will have to be measured with the naked eye.

Wednesday, 6 October 2010

Platform Choice

I've given some thought this week to what platform I'm going to utilise for my project's application and I've decided to go with DirectX rather than XNA or OpenGL. To help me decide, I made a small note of the pros and cons that concerned me for each platform.

OpenGL: I'm familiar with the API, having used it in both second and third year and it's a good platform for graphics applications. However, I intend to use shaders in my application and the shader support in OpenGL is not great. There is no error checking in glsl shaders, it's more a case of going through the shader line by line until you find the line that caused the problem. In general, I am far more comfortable with HLSL than GLSL and I think that using GLSL would only cause more stress.

XNA: XNA has great shader support and error checking, and C# is close enough to C++ to be easily learnt. However, I'm not too comfortable with all aspects of the API, mainly because my previous experience with it was as part of a group, so most of the framework I were using was constructed by other people - (my main focus there was the shaders).

DirectX: Good shader support (not as good as XNA when it comes to error checking but not bad) and I'm quite familar with the API. I will be able to reference some aspects of the framework from my third year directx coursework. I think that really, DirectX is the middle ground, between OpenGL and XNA.

(Hopefully I won't change my mind about this.)