Tutorial06_Multithreading overview?
-
- Halfling
- Posts: 78
- Joined: Sun Jun 04, 2017 12:33 am
Tutorial06_Multithreading overview?
Using Tutorial06_Multithreading, can someone give an overview of what's going on with the GraphicsSystem and the LogicSystem, why they both call createScene01 and createScene02. Maybe talk a bit on renderThread() and logicThread(), their purpose? Or point to something that will help me understand this setup? I understood Ogre 1.x, but in 2.1, just not getting this.
- dark_sylinc
- OGRE Team Member
- Posts: 5296
- Joined: Sat Jul 21, 2007 4:55 pm
- Location: Buenos Aires, Argentina
- x 1278
- Contact:
Re: Tutorial06_Multithreading overview?
First, check Tutorial01-04 help descriptions.
Then check Tutorial05's help description (press F1 inside the demo).
Then Tutorial06's help desc.
If that is not enough, this old blog post, although it was written way before 2.1; the concepts are the same.
Then check Tutorial05's help description (press F1 inside the demo).
Then Tutorial06's help desc.
If that is not enough, this old blog post, although it was written way before 2.1; the concepts are the same.
-
- Halfling
- Posts: 78
- Joined: Sun Jun 04, 2017 12:33 am
Re: Tutorial06_Multithreading overview?
Thanks, this is helpful, and I think I understand the multithreading for performance reasons.
I understand that createScene is divided into two stages and each state runs in parrallel. Maybe it's more of a "How do I use logic and graphics". What type of stuff goes in logic and what do I put in graphics?
I understand that createScene is divided into two stages and each state runs in parrallel. Maybe it's more of a "How do I use logic and graphics". What type of stuff goes in logic and what do I put in graphics?
- dark_sylinc
- OGRE Team Member
- Posts: 5296
- Joined: Sat Jul 21, 2007 4:55 pm
- Location: Buenos Aires, Argentina
- x 1278
- Contact:
Re: Tutorial06_Multithreading overview?
Anything that has an impact in logic or physics goes into logic system.
Anything that is visually rendered, goes into graphics.
An object can be in both logic and graphics (in fact most will be).
For example the main character in a 3rd person view game has logic (its controls, health, damage calculation, its physics simulation in the world) and has graphics (it has a model, possibly a skeleton).
A tree has physics (collision) and has graphics (it gets rendered, possibly with branch / wind animation)
An enemy has logic (health, damage, physics, AI) and has graphics (it gets rendered, possibly has a skeleton)
A few decoration rocks (debris) with no impact on physics or gameplay only needs graphics.
Likewise particle effects may need some sort of control from logic (when to trigger, where to trigger, when to stop), but it doesn't simulate each particle individually. That is left for the graphics.
An area (in physics terms often is referred to as a "phantom") that triggers a cutscene or a win/lose condition, lives in logic (detect when player enters that area, trigger the consequences of entering that area), but has no graphics (it's invisible, never gets rendered).
Just think of logic as the things we feel, touch, can think about and affect us; while graphics is only the things we see, even if they're all just illusions.