Boson HUANG
Link to download:
https://drive.google.com/uc?export=download&id=1NZgysmpUd_1_LQkl3VeoO43GiuxzC0yZ




This assignment let us move our geometry and effect data to my game. Then submit those data from application thread and let graphic render in render thread. We create some interface to handle those data initialization and data passing.
Show the code from your MyGame project that submits the background color

Player can set the m_backColor by another member function.
Show the code from your MyGame project that submits an object/effect pair to be drawn


I submit the data in SubmitDataToBeRendered, I passed in a vector of the pair. And I can modify the vector in any other place of myGame.cpp. For example, user can modify the m_TempList so that they can draw object A using effect B. In my case, I remove one of the pairs when I am pressing space.
Explain to us why we have to submit things to be drawn the way that we do. (In other words, why do we have to cache all of the data for a single frame rather than just rendering things immediately?)
There is possibility that the previous frame hasn’t been rendered completely, and the application require the next frame render request. In this case, if it doesn’t wait until render finishes, the context can be destroyed since the render thread may bind a new effect or something else.
Size of my geometry and effect and the way to make it smaller
Size | Geometry | Effect |
X64 | 56 | 40 |
X86 | 32 | 28 |
I change my string to string* so the size become smaller in Effect.
In geometry, I store the vertex count, and index count as int which takes a lot of size. I don’t think I can exclude them. And I store the pointer of vertex data(s3dobject) and index data(uint16_t). I don’t’ I can exclude them too. The other stuffs in my geometry are platform dependent like vertex format handle. In my effect, it is similar. I have three shader handles, which cannot be exclude from my effect class because those data are required when it is initialized and bound and rendered.
Size of sDataRequiredToRenderAFrame
Size | sDataRequiredToRenderAFrame | Actual data size |
X64 | 192 | 192*2 = 384 |
X86 | 176 | 176*2 = 352 |