top of page

AN OBJ Model Viewer
This project helped me understand the data structures used for storing 3D models in the OBJ format. I also learned how to write a Phong shader and an emissive blurry shader in HLSL. Furthermore, this project tested my Duality Engine’s capability of loading 3D models for game development.

ModelViewer_Demo

Lighting Debug constant
The constant buffer I pass into the Phong shader contains not only lighting information but also the camera’s position, falloff settings for the normal map, and a series of debug settings to visually debug lighting effects.

Sample TExtures
The shader samples the texel information stored in each texture. My Phong shader reads the material's diffuse texture, normal map, and a texture that combines specular, glossiness, and emissive information using separate RGB channels.

Net System
My network system uses TCP to establish a connection between the server and the client. The helper functions IsClient() and IsServer() assist the Update() function in managing ClientState or ServerState, depending on whether the program is set to a specific NetSystemMode in the NetSystemConfig.
The sendBufferSize and receiveBufferSize determine the amount of data the NetSystem can send or receive in a single frame. Those data are stored in the sendQueue and recvQueue.
The function ReadCommandFromReceiveQueue() process incoming commands by executing them when it detects a predefined terminator.
Meanwhile, PackSendQueueWithCommands() and PrepareSendBuffer() handle outgoing data by packaging game commands into the buffer for the other player to execute.

Game Commands
These commands simplify how player input is executed in the game and make it possible to synchronize the player and server by simply sending these commands over the network.


Subscribing And Sending
By utilizing the event system and network system, we can subscribe to all game commands and transmit the subscribed command strings through the NetSystem.
![]() | ![]() | ![]() | ![]() |
---|---|---|---|
![]() | ![]() | ![]() | ![]() |
bottom of page