Urho3D Wiki
Advertisement

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 flags

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

  1. HelloWorld Demo
  2. HelloGUI Demo
  3. Sprites Demo
  4. StaticScene Demo
  5. AnimatingScene Demo
  6. SkeletalAnimation Demo
  7. Billboards Demo
  8. Decals Demo
  9. MultipleViewports Demo
  10. RenderToTexture Demo
  11. Physics Demo
  12. PhysicsStressTest Demo
  13. Ragdolls Demo
  14. SoundEffects Demo
  15. Navigation Demo
  16. Chat Demo
  17. SceneReplication Demo
  18. CharacterDemo Demo
  19. VehicleDemo Demo
  20. HugeObjectCount Demo
  21. AngelScriptIntegration Demo
  22. LuaIntegration Demo
  23. Water Demo
  24. Urho2DSprite Demo
  25. Urho2DParticle Demo
  26. ConsoleInput Demo
  27. Urho2DPhysics Demo
  28. Urho2DPhysicsRope Demo
  29. SoundSynthesis Demo
  30. LightAnimation Demo
  31. MaterialAnimation Demo
  32. Urho2DConstraints Demo
  33. Urho2DSpriterAnimation Demo
  34. DynamicGeometry Demo
  35. SignedDistanceFieldText Demo
  36. Urho2DTileMap Demo
  37. UIDrag Demo
  38. SceneAndUILoad Demo
Advertisement