Useful Tools for Making Video Games Part I An overview of Ogre.
-
Upload
adelia-hodge -
Category
Documents
-
view
220 -
download
3
Transcript of Useful Tools for Making Video Games Part I An overview of Ogre.
![Page 1: Useful Tools for Making Video Games Part I An overview of Ogre.](https://reader031.fdocuments.us/reader031/viewer/2022032200/56649f515503460f94c74165/html5/thumbnails/1.jpg)
Useful Tools for Making Video Games
Part IAn overview of Ogre
![Page 2: Useful Tools for Making Video Games Part I An overview of Ogre.](https://reader031.fdocuments.us/reader031/viewer/2022032200/56649f515503460f94c74165/html5/thumbnails/2.jpg)
Sample Games
Thunder Wheels Kong Masterplan Pacific Storm Trampoline
![Page 3: Useful Tools for Making Video Games Part I An overview of Ogre.](https://reader031.fdocuments.us/reader031/viewer/2022032200/56649f515503460f94c74165/html5/thumbnails/3.jpg)
Features
Graphics API independent 3D implementation Platform independence Material & Shader support
Well known texture formats: png, jpeg, tga, bmp, dds, dxt Mesh support: Milkshape3D, 3D Studio Max, Maya,
Blender Scene features
BSP, Octree plugins, hierarchical scene graph Special effects
Particle systems, skyboxes, billboarding, HUD, cube mapping, bump mapping, post-processing effects
Easy integration with physics libraries ODE, Tokamak, Newton, OPCODE
Open source!
![Page 4: Useful Tools for Making Video Games Part I An overview of Ogre.](https://reader031.fdocuments.us/reader031/viewer/2022032200/56649f515503460f94c74165/html5/thumbnails/4.jpg)
Core Objects
![Page 5: Useful Tools for Making Video Games Part I An overview of Ogre.](https://reader031.fdocuments.us/reader031/viewer/2022032200/56649f515503460f94c74165/html5/thumbnails/5.jpg)
Startup Sequence
ExampleApplication Go() Setup() Configure() setupResources() chooseSceneManager() createCamera() createViewport() createResourceListener() loadResources() createScene() frameStarted/Ended() createFrameListener() destroyScene()
![Page 6: Useful Tools for Making Video Games Part I An overview of Ogre.](https://reader031.fdocuments.us/reader031/viewer/2022032200/56649f515503460f94c74165/html5/thumbnails/6.jpg)
Basic Scene
Entity, SceneNode Camera, lights, shadows BSP map Integrated ODE physics BSP map Frame listeners
![Page 7: Useful Tools for Making Video Games Part I An overview of Ogre.](https://reader031.fdocuments.us/reader031/viewer/2022032200/56649f515503460f94c74165/html5/thumbnails/7.jpg)
Terrain, sky, fog
![Page 8: Useful Tools for Making Video Games Part I An overview of Ogre.](https://reader031.fdocuments.us/reader031/viewer/2022032200/56649f515503460f94c74165/html5/thumbnails/8.jpg)
CEGUI Window, panel, scrollbar,
listbox, button, static text Media/gui/ogregui.layoutCEGUI::Window* sheet = CEGUI::WindowManager::getSingleton().load
WindowLayout( (CEGUI::utf8*)"ogregui.layout");
mGUISystem->setGUISheet(sheet);
![Page 9: Useful Tools for Making Video Games Part I An overview of Ogre.](https://reader031.fdocuments.us/reader031/viewer/2022032200/56649f515503460f94c74165/html5/thumbnails/9.jpg)
Animation
Node animation (camera, light sources) Skeletal Animation
AnimationState *mAnimationState; mAnimationState = ent-
>getAnimationState("Idle");mAnimationState->setLoop(true);mAnimationState->setEnabled(true); mAnimationState-
>addTime(evt.timeSinceLastFrame); mNode->rotate(quat);
![Page 10: Useful Tools for Making Video Games Part I An overview of Ogre.](https://reader031.fdocuments.us/reader031/viewer/2022032200/56649f515503460f94c74165/html5/thumbnails/10.jpg)
Animation
Crowd (instancing vs single entity)InstancedGeometry* batch = new InstancedGeometry(mCamera-
>getSceneManager(), "robots" );batch->addEntity(ent, Vector3::ZERO);batch->build();
Facial animationVertexPoseKeyFrame* manualKeyFrame;manualKeyFrame->addPoseReference();manualKeyFrame->updatePoseReference ( ushort
poseIndex, Real influence)
![Page 11: Useful Tools for Making Video Games Part I An overview of Ogre.](https://reader031.fdocuments.us/reader031/viewer/2022032200/56649f515503460f94c74165/html5/thumbnails/11.jpg)
Picking
![Page 12: Useful Tools for Making Video Games Part I An overview of Ogre.](https://reader031.fdocuments.us/reader031/viewer/2022032200/56649f515503460f94c74165/html5/thumbnails/12.jpg)
Picking
CEGUI::Point mousePos = CEGUI::MouseCursor::getSingleton().getPosition(); Ray mouseRay = mCamera->getCameraToViewportRay(mousePos.d_x/float(arg.state.width), mousePos.d_y/float(arg.state.height)); mRaySceneQuery->setRay(mouseRay); mRaySceneQuery->setSortByDistance(false); RaySceneQueryResult &result = mRaySceneQuery->execute(); RaySceneQueryResult::iterator mouseRayItr; Vector3 nodePos; for (mouseRayItr = result.begin(); mouseRayItr != result.end();
mouseRayItr++) { if (mouseRayItr->worldFragment) { nodePos = mouseRayItr->worldFragment->singleIntersection; break; } // if }
![Page 13: Useful Tools for Making Video Games Part I An overview of Ogre.](https://reader031.fdocuments.us/reader031/viewer/2022032200/56649f515503460f94c74165/html5/thumbnails/13.jpg)
Particle EffectsmSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(
mSceneMgr->createParticleSystem("sil", "Examples/sil"));
Examples/sil{ material Examples/Flare2 particle_width 75 particle_height 100 cull_each false quota 1000 billboard_type oriented_self // Area emitter emitter Point { angle 30 emission_rate 75 time_to_live 2 direction 0 1 0 velocity_min 250 velocity_max 300 colour_range_start 0 0 0 colour_range_end 1 1 1 }
// Gravity affector LinearForce { force_vector 0 -100 0 force_application add }
// Fader affector ColourFader { red -0.5 green -0.5 blue -0.5 }}
![Page 14: Useful Tools for Making Video Games Part I An overview of Ogre.](https://reader031.fdocuments.us/reader031/viewer/2022032200/56649f515503460f94c74165/html5/thumbnails/14.jpg)
Particle Effects
Particle system attributesquota material particle_width particle_height cull_each billboard_type billboard_origin billboard_rotation_type common_direction common_up_vector renderer sorted local_space point_rendering accurate_facing iteration_interval
nonvisible_update_timeout
Emitter attributes(point, box, clyinder, ellipsoid, hollow ellipsoid, ring)angle colour colour_range_start colour_range_end direction emission_rate position velocity velocity_min velocity_max time_to_live time_to_live_min time_to_live_max duration duration_min duration_max repeat_delay repeat_delay_min repeat_delay_max
Affectors (LinearForce, ColorFader)Linear Force Affector ColourFader Affector ColourFader2 Affector Scaler Affector Rotator Affector ColourInterpolator Affector ColourImage Affector DeflectorPlane Affector DirectionRandomiser Affector
![Page 15: Useful Tools for Making Video Games Part I An overview of Ogre.](https://reader031.fdocuments.us/reader031/viewer/2022032200/56649f515503460f94c74165/html5/thumbnails/15.jpg)
Fire and Smoke
affector Rotator { rotation_range_start 0 rotation_range_end 360 rotation_speed_range_start -60 rotation_speed_range_end
200 }
![Page 16: Useful Tools for Making Video Games Part I An overview of Ogre.](https://reader031.fdocuments.us/reader031/viewer/2022032200/56649f515503460f94c74165/html5/thumbnails/16.jpg)
Cel Shading
vertex_program Ogre/CelShadingVP cg{
source Example_CelShading.cgentry_point main_vp…
default_params{… }
}
material Examples/CelShading{…
vertex_program_ref Ogre/CelShadingVP {}fragment_program_ref Ogre/CelShadingFP {}
}
![Page 17: Useful Tools for Making Video Games Part I An overview of Ogre.](https://reader031.fdocuments.us/reader031/viewer/2022032200/56649f515503460f94c74165/html5/thumbnails/17.jpg)
Cube Mapping
With Perlin noise to distort vertices
void morningcubemap_fp (float3 uv : TEXCOORD0,out float4 colour : COLOR,uniform samplerCUBE tex : register(s0) )
{colour = texCUBE(tex, uv);// blow out the light a bitcolour *= 1.7;
}
![Page 18: Useful Tools for Making Video Games Part I An overview of Ogre.](https://reader031.fdocuments.us/reader031/viewer/2022032200/56649f515503460f94c74165/html5/thumbnails/18.jpg)
Bump Mapping
+ =
![Page 19: Useful Tools for Making Video Games Part I An overview of Ogre.](https://reader031.fdocuments.us/reader031/viewer/2022032200/56649f515503460f94c74165/html5/thumbnails/19.jpg)
Reflections & Refractions// Noisetexture_unit{
// Perlin noise volumetexture waves2.dds// min / mag filtering, no mipfiltering linear linear none
}// Reflectiontexture_unit{ // Will be filled in at runtime
texture Reflectiontex_address_mode clamp// needed by ps.1.4tex_coord_set 1
}// Refractiontexture_unit{
// Will be filled in at runtimetexture Refractiontex_address_mode clamp// needed by ps.1.4tex_coord_set 2
}
![Page 20: Useful Tools for Making Video Games Part I An overview of Ogre.](https://reader031.fdocuments.us/reader031/viewer/2022032200/56649f515503460f94c74165/html5/thumbnails/20.jpg)
Reflections & Refractions
![Page 21: Useful Tools for Making Video Games Part I An overview of Ogre.](https://reader031.fdocuments.us/reader031/viewer/2022032200/56649f515503460f94c74165/html5/thumbnails/21.jpg)
Grass
Each grass section is 3 planes at 60 degrees to each otherNormals point straight up to simulate correct lighting
![Page 22: Useful Tools for Making Video Games Part I An overview of Ogre.](https://reader031.fdocuments.us/reader031/viewer/2022032200/56649f515503460f94c74165/html5/thumbnails/22.jpg)
Post-Processing Effects
![Page 23: Useful Tools for Making Video Games Part I An overview of Ogre.](https://reader031.fdocuments.us/reader031/viewer/2022032200/56649f515503460f94c74165/html5/thumbnails/23.jpg)
Supporting tools (add-ons)
Blender, Autodesk 3DS, Milkshape3D, Softimage XSI importers/exporters
Particle editors, mesh viewers GUI editors Physics bindings Scene exporters and lots moreAdd-on site
![Page 24: Useful Tools for Making Video Games Part I An overview of Ogre.](https://reader031.fdocuments.us/reader031/viewer/2022032200/56649f515503460f94c74165/html5/thumbnails/24.jpg)
References
http://www.ogre3d.org/