top of page

Game Engine Engineering Assignment - 2

  • Writer: Vikram Venkatesh
    Vikram Venkatesh
  • Sep 17, 2020
  • 2 min read

Updated: Sep 25, 2023

The goal of this assignment was to create a roadmap to a completely platform independent Graphics class. We introduce two interfaces, namely Mesh and Effect, to the library and by using their help, get rid of most of the platform dependent code in Graphics.cpp. By creating a separate mesh class I was able to provide methods like AddTriangle(), to customize the shape of the mesh.


Using this method, we can now add any amount of triangles to create compound geometries. Now our triangle has evolved into a quad, by putting two of them together.

Now that we are able to draw quads(kind of), the other part of this assignment was to get familiar with some graphics debugging tools. The first one was Visual Studio’s own graphics debugger. Visual Studio’s graphics analyzer can capture frames and contains ton of information, from per-pixel data to info on every stage of the graphics pipeline.

OpenGL captures seem to be not possible through Visual studios’ analyzer, so we use use another tool: RenderDoc. RenderDoc is a standalone third-party free-to-use graphics debugger. It also has a very user friendly interface and provides you with a ton of info on frame captures.

And the Graphics.(platform).cpp have the platform independent mesh and effect interface as:

So now we have a platform independent interface for Meshes and Effects. Given the remainder of code in Graphics.gl.cpp and Graphics.d3d.cpp, majority of the difference stems from the fact that DirectX requires views to render. If we are able to encapsulate the view and the clearing in maybe some other class or in the context class itself, we should be able to make the Graphics class completely platform independent, meaning we can shift all code to a single Graphics.cpp file and remove the d3d and gl files completely. Aaand.. that finishes my review of Assignment 2.


Oh almost forgot this masterpiece for the optional challenge of drawing a house.






Comments


bottom of page