The sample applications start from the very simple (a "Hello World" program) and progress to demonstrate more complex engine features. The code is heavily commented and should be easy to follow for learning. The applications display on-screen instructions when run.
The AngelScript and Lua versions reside in the Bin/Data/Scripts and Bin/Data/LuaScripts directories. Batch files to run each of them are not provided due to their large amount: instead run the player application with the script file name as the parameter, for example Urho3DPlayer Scripts/01_HelloWorld.as
The C++ versions need to be explicitly enabled in the build with the CMake option -DURHO3D_SAMPLES=1. When enabled, the executables will be produced into the Bin directory and can be run from there. Their source code is in the Source/Samples directory.
The samples provide the following common key controls:
ESC Exit F1 Toggle console F2 Toggle debug HUD 1 Cycle texture quality 2 Cycle material quality 3 Toggle specular lighting 4 Toggle shadow rendering 5 Cycle shadow resolution 6 Cycle shadow filtering quality 7 Toggle occlusion culling 8 Toggle dynamic instancing 9 Take a screenshot and save to the Data directory
Building C++ Demos[]
When compiling Urho3D from source, set the compiler flag "URHO3D_SAMPLES=1" in cmake.
Mac and Linux[]
./cmake_generic.sh -D URHO3D_SAMPLES=1
Windows[]
CMake-GUI Screenshot: URHO3D_SAMPLES is quite at the bottom. See Build Urho3D on Windows (MinGW) for a detailed build tutorial.
Demo Walkthroughs[]
Here is the template for the demos to ensure consistency: Demo Walkthrough Template
- HelloWorld Demo
- HelloGUI Demo
- Sprites Demo
- StaticScene Demo
- AnimatingScene Demo
- SkeletalAnimation Demo
- Billboards Demo
- Decals Demo
- MultipleViewports Demo
- RenderToTexture Demo
- Physics Demo
- PhysicsStressTest Demo
- Ragdolls Demo
- SoundEffects Demo
- Navigation Demo
- Chat Demo
- SceneReplication Demo
- CharacterDemo Demo
- VehicleDemo Demo
- HugeObjectCount Demo
- AngelScriptIntegration Demo
- LuaIntegration Demo
- Water Demo
- Urho2DSprite Demo
- Urho2DParticle Demo
- ConsoleInput Demo
- Urho2DPhysics Demo
- Urho2DPhysicsRope Demo
- SoundSynthesis Demo
- LightAnimation Demo
- MaterialAnimation Demo
- Urho2DConstraints Demo
- Urho2DSpriterAnimation Demo
- DynamicGeometry Demo
- SignedDistanceFieldText Demo
- Urho2DTileMap Demo
- UIDrag Demo
- SceneAndUILoad Demo