7. Présentation Moteur 3D Temps réel Open Source 2001 - 2009 Multi-platforme: Linux, OS X, Windows, BSD Recherche, Visualisation, Jeux, Etudiants, Réalité augmentée, etc. C++, OO, Motifs Conceptions Accéléré par le matériel Leader : Steve Streeting Torus Knot software
8. Librairie Ogre est un composant Ne doit pas être le centre de l'application Doit s'insérer dans une application Fait par des développeurs pour les développeurs
9. Spécialisé et indépendan Moteur 3D accéléré seulement Tout est fait pour l'intégration d'Ogre et non l'inverse Longévité & stabilité Modélisation en premier, Code facile à maintenir, Commentaire, Documentation, Branche Stable et Développement Éviter la « prédestination » Pas de spécificité / type de rendu Composant réutilisable et extensible Les Règles d'Or
10. Moteur 3D != Moteur de JEU Renderer Animation, Particules Shading/Lighting Détection de Collisions Scripts Son/Vidéo Réseau Physique Intelligence Artificielle Éditeur (Niveaux, Terrain, shaders, modèles)
36. Système de traitement « post rendu » Scripts (comme matériaux) Peuvent être chainés Place importante dans les rendus modernes. Compositors
37. compositor TV { technique { // Temporary textures texture rt0 target_width target_height PF_A8R8G8B8 target rt0 { // Render from previous compositor // (or original scene) input previous } target_output { // Start with clear output input none // add some noise, distort it, // then render to scene aligned quad pass render_quad { // Renders a fullscreen quad with a material material Ogre/Compositor/OldTV input 0 rt0 } } } } Highlights: Compositors
38. material Ogre/Compositor/OldTV { technique { pass { depth_check off vertex_program_ref Ogre/Compositor/StdQuad_Tex2a_vp { } fragment_program_ref Ogre/Compositor/OldTV_FP { param_named_auto time_0_X time_0_x 120 param_named_auto sin_time_0_X sintime_0_x 120 param_named distortionFreq float 2.7 param_named distortionScale float 2.5 param_named distortionRoll float 0.93 param_named interference float 0.5 param_named frameLimit float 0.40 param_named frameShape float 0.26 param_named frameSharpness float 6.0 } texture_unit 0 { tex_coord_set 0 tex_address_mode clamp filtering linear linear linear } texture_unit 1 { texture Random3D.dds 3d tex_coord_set 1 tex_address_mode wrap filtering linear linear linear } texture_unit 2 { texture NoiseVolume.dds 3d tex_coord_set 2 tex_address_mode wrap filtering linear linear linear } } } }
42. The Future Pagination RT shader system Compositor NextGen Shared shader parameters CMake Symbian, iPhone & iPod touch support ....
43. Livres Pro OGRE3D Programming Greg Junker 2006 (Apress) C++ How to Program, 6 th Edition Dietel & Dietel 2007 (Prentice Hall) Introduction to Game Programming with C++ Alan Thorn 2007 (Wordware) Game Engine Architecture Jason Gregory 2009 (A K Peters)
SceneManager Basics Everything that appears on the screen is managed by the SceneManager (fancy that). When you place objects in the scene, the SceneManager is the class which keeps track of their locations. When you create Cameras to view the scene (which we will cover in a later tutorial) the SceneManager keeps track of them. When you create planes, billboards, lights...and so on, the SceneManager keeps track of them. There are multiple types of SceneManagers. There are SceneManagers that render terrain, there is a SceneManager for rendering BSP maps, and so on. You can see the various types of SceneManagers listed here. We will cover more about other SceneManagers as we progress through the tutorials. Entity Basics An Entity is one of the types of object that you can render on a scene. You can think of an Entity as being anything that's represented by a 3D mesh. A robot would be an entity, a fish would be an entity, the terrain your characters walk on would be a very large entity. Things such as Lights, Billboards, Particles, Cameras, etc would not be entities. One thing to note about Ogre is that it separates renderable objects from their location and orientation. This means that you cannot directly place an Entity in a scene. Instead you must attach the Entity to a SceneNode object, and this SceneNode contains the information about location and orientation. SceneNode Basics As already mentioned, SceneNodes keep track of location and orientation for all of the objects attached to it. When you create an Entity, it is not rendered in the scene until you attach it to a SceneNode. In addition a SceneNode is not an object that is displayed on the screen. Only when you create a SceneNode and attach an Entity (or other object) to it is something actually displayed on the screen. SceneNodes can have any number of objects attached to them. Let's say you have a character walking around on the screen and you want to have him generate a light around him. The way you do this would be to first create a SceneNode, then create an Entity for the character and attach it to the SceneNode. Then you would create a Light object and attach it to the SceneNode. SceneNodes may also be attached to other SceneNodes which allows you to create entire hierarchies of nodes. We will cover more advanced uses of SceneNode attachment in a later tutorial. One major concept to note about SceneNodes is that a SceneNode's position is always relative to its parent SceneNode, and each SceneManager contains a root node to which all other SceneNodes are attached.