| June 18, 2009 12:00 AM PDT | |
by Rajshree Chabukswar, Adam T. Lake, and Mary R. Lee, Intel® Software Solutions Group
Learn how to decouple rendering and physical simulation in a multi-threaded environment with a simple physical simulation demonstration. The sample code provided with this paper can either be used as an example or adapted directly into your game engine.
This paper demonstrates bouncing spheres within a cube with sphere-sphere and sphere-plane collision detection mechanisms implemented using Newtonian physics. Initially, spheres collide with each other and the walls of the enclosing cube. After collision is detected, collision response code is executed to calculate the new velocity. The user has an option to run either a multi-threaded or single threaded version. Threading is implemented to compute physics equations in a separate thread while rendering takes place in the main thread.
The goal is to showcase how to use separate threads to perform CPU intensive physics computations independent of the actual rendering process. It is beneficial to use multiple threads to perform different tasks since future processor architectures are moving towards multiple cores. Hence, the performance of an application can be increased by having multiple threads work individually to take advantage of available CPU cycles. The paper first discusses the basics of this implementation followed by the physics concepts used in our demo. Future work and reference section is also included.
For more complete information about compiler optimizations, see our Optimization Notice.
Comments (4) 
| January 12, 2012 2:52 AM PST
Eric Chang |
I want to download the source code for this article "Multi-threaded Rendering and Physics Simulation", but the source code link is wrong. Could you send me the source code directly through my emial? Or can you fix the wrong link? |
| January 12, 2012 12:04 PM PST
Aubrey W. (Intel)
|
The source code link has been corrected. Thank you for bringing this to our attention. == Aubrey W. Intel(R) Software Network Support |
| March 17, 2012 12:00 PM PDT
Dante |
What is the purpose of this design? First of all, the system runs in lockstep with just 1 other thread, so there is no benefit of having another thread. I would only see the benefit in having multiple threads (scaled based on the quantity of cores) to simulate physics, and then return to rendering. There is no point in having 1 extra thread jump in, pause the previous thread, do its' thing and resume the initial thread. Absolutely pointless, Intel - this article was written by an intern, I presume? At least could have made it useful from the start by using a thread pool, as it stands this is a pointless example of threading - no benefit! Otherwise, add something interesting - like another thread that does something which would alter sphere's velocity/position, like a "Wind" thread (parallel to physics and rendering sim with direct interference). This way you could demonstrate at least some decoupling or synchronization technique (avoiding using a mutex). |
Trackbacks (3)
- Todd Seiler » Concurrency & Parallelism
September 5, 2010 11:08 PM PDT - 关于游戏引擎多线程的一些整理和思考 | Music Sets Me Free
January 5, 2011 4:05 AM PST - Concurrency & Parallelism » Todd Seiler
January 6, 2011 2:43 PM PST
Leave a comment 
Adam Lake (Intel)
| ||
Rajshree Chabukswar (Intel)
| ||
| Mary Lee (Intel) |



eric5588@ms3.hinet.net
35