1 Part 1: Optimising a Rasterizer (40 marks)
This section carries a total of 40 marks.
The goal of this part of assignment is to enhance your understanding of games rendering pipelines by optimising a given rasterizer via any optimisation you see fit and culminating with using multithreading in C++. You will measure performance improvements and test your solutions on provided scenes and a custom one of your own creation.
You will be provided with a base rasterizer implemented in C++. This code already includes the following:
· Geometrical transformations (translation, scaling, rotation, perspective transformation etc.).
· Basic rasterization logic to render triangles (including interpolation of normals, depth etc.)
· Basic lighting model
Your first task is to thoroughly understand the base code. We will refer to this version as the base rasterizer.
Optimisation
Your first task is to optimise the base code as you see fit. For each optimisation you include, explain why and how you completed that task. Provide the results of your optimisations when compared to the base rasterizer for the 3 scenes (see below). When providing comparisons you can group your optimisations together, for example, you could optimise all the matrix and vector calculations and group them into one group entitled transformation optimisations. When doing the comparisons make sure that you are using a release version of the code and keep the same settings. Please report on the settings and present these as a screenshot in the report.
Multithreading
Your second task is to add multithreading to your code via the use of C++ std::thread library. Your task is to try and achieve the best speedup for the given number of threads on your Warwick-issued machine (up to 11 threads; although you can show results for 22 threads with the use of hyperthreading). The behaviour of the multithreaded version must correspond that that of the base rasterizer. You are permitted to present more than one way of dividing the tasks for parallelism and provide results for all your solutions. Provide a detailed description of your solution and how your tasks are broken down and how the solution avoids any race conditions. Provide comparisons with base rasterizer for the three scenes. You should provide overall results which include the optimisations from a) also. Results can be presented in multiple ways but a speedup graph is required for each scene.
Scene Testing
Two pre-designed scenes will be provided and the code will be available for these:
· Scene 1: Provided.
· Scene 2: Provided.
· Scene 3: Develop your own scene which showcases different parallel issues and optimisations. Basic primitives are sufficient for this scene. Explain your choice of scene in the report.
Evaluate your implementation's performance on these scenes and compare it with the base rasterizer.
2 Report (25 marks)
The report carries a total of 25 marks. It should be broken down cleanly split into two parts, one for Part 1 and one for Part 2.
For Part 1, include:
Section 1: an overall introduction about what has been achieved in the overall.
Section 2: a detailed description of each optimisation in sub sections with performance results. Show code for the optimisation and where in the code it was changed.
Section 3: a detailed description of the parallel strategy(ies) employed and performance results. Use sub-sections for the different strategies.
Section 4: Conclusion based on outcomes and future work given more time.
版权所有:编程辅导网 2021 All Rights Reserved 联系方式:QQ:99515681 微信:codinghelp 电子信箱:99515681@qq.com
免责声明:本站部分内容从网络整理而来,只供参考!如有版权问题可联系本站删除。