- Instancing: static (pack geometries into the same vertex buffer), dynamic (similar to static, but transformed per frame), Shader (use vertex constants and GPU transforms the data), Hardware (supported by GPU).
- Reduce draw calls: Since the process of transferring data to the GPU includes overhead, the concept of instancing is to pack more data into the same buffer to improve the performance.
- Data Dependencies: How to write the code in special ways for the CPU to trade memory for computational speed.
- Threading: Avoid deadlocks and other abnormalities.
- Memory allocation: Avoid "new" memory at all cost.
- Benchmark, bottleneck, and performance tuning.
- SIMD: Single Instruction Multiple Data.
Sunday, November 16, 2008
Code Optimization Techniques
Several common techniques that I've learned in my Optimization class:
Saturday, November 1, 2008
OpenGL Rendering
This is my project written with C++ and OpenGL. The goal of this project is to create a real-time 3D playground scene. 3D models are exported into source code and loaded into vertex buffer. The river is an animated mesh which is able to reflect the bridge above, and pointsprite was used to render the grass on the playground.
Highlights:
Highlights:
- OpenGL API
- Vertex animation
- Reflection with Stencil Buffer
- Pointsprite Grass
Saturday, October 11, 2008
Game - Super Star
The player will recruite the stars by playing the puzzle mini-games, where correct answers to the pop-culture trivia will impress them and allow the player to manage them. In addition, to make the stars more popular, the player will train them through singing and dancing mini-games which improve their popularity stats.
As the pop stars gain popularity, the player can then book small concerts for them. The ultimate goal of the player is to have the stars perform at the biggiest event in town - concert at the stadium.
Highlights:
- DirectX
- Sprite Animation
- Music and Rhythm mini-games.
- Puzzle mini-games.
- Collision and physics.
Thursday, October 2, 2008
Game - Mystic Kingdom
Sprite animation system is used to deliver the graphics for this game. The animation is scripted by XML files. Each level is defined by a XML file which control the appearance and monster spawning, and the monster A.I. is controlled by behavioral scripting to give them more organic look.
Highlights:
- DirectX API.
- Sprite Animation.
- Script-driven level and monster AI.
- Physics simulation.
- Collision detection.
Monday, September 22, 2008
Game Tool - Singing Editor (Rock Band/Guitar Hero)
Because the GUI is running in a thread, and I want to synchronize the state of the WMP control plug-in with the GUI, so I used a C# delegate to poll the WMP control and update the GUI.
- C# and .Net Framework.
- Windows Media Player control plug-in.
- Multi-threading delegates.
Friday, September 19, 2008
Game Tool - Dance Editor (DDR/Dance Dance Revolution)
This is another tool which goes along with my "SuperStar" project. The Dance Editor reco-lrds mouse clicks and generates "foot steps" as the dance moves. These moves are stored in XML which is loaded by the game to display the DDR-like gameplay.
One of the challenge for this tool is to be able to "pick" different oriented "foot steps" in different angles, and I use half-space test to check if the mouse click is within the collision rectangle or not.
Highlights:
- 2D Picking with half-space test.
- C# and .NET Framework.
- Windows Media Player control plug-in.
Subscribe to:
Posts (Atom)