OGRE is a scene-oriented, flexible 3D engine written in C++ designed to make it easier and more intuitive for developers to produce games and demos utilising 3D hardware.

GitHub release Join the chat at https://gitter.im/OGRECave/ogre Patreon

Summary

OGRE (Object-Oriented Graphics Rendering Engine) is a scene-oriented, flexible 3D engine written in C++ designed to make it easier and more intuitive for developers to produce games and demos utilising 3D hardware. The class library abstracts all the details of using the underlying system libraries like Direct3D and OpenGL and provides an interface based on world objects and other intuitive classes.

Build Status
Linux, OSX, Android, iOS CI Build
MSVC Build status

Index Of Contents

  • What's New?
    A summary of the new and altered features in this release.
  • Building the core OGRE libraries
    If you're using the full source release, this will help you build it. If you're using a precompiled SDK then most of the work has already been done for you, and you should use the sample projects to see how to compile your own code against OGRE.
  • The OGRE Manual
    A high-level guide to the major parts of the engine and script reference.
  • API Reference
    The full OGRE API documentation, as generated from the (heavily!) commented source.
  • The OGRE Tutorials
    A gold mine of tutorials, tips and code snippets which will help you get up to speed with the engine.

Try it

Features

For an exhaustive list, see the features page and try our Sample Browser. For a quick overview see below

Integrated Bump Mapping Integrated shadows
HW & SW skeletal animation Multi-layer Terrain
Automatic Rendertarget pipelining (Compositors) Volume Rendering with CSG & Triplanar Texturing
Dear ImGui Particle Effects

Who is using it?

Open Source

Closed Source

Contributing

We welcome all contributions to OGRE, be that new plugins, bugfixes, extensions, tutorials, documentation, example applications, artwork or pretty much anything else! If you would like to contribute to the development of OGRE, please create a pull request.

Getting Support

Please use our community support forums if you need help or think you may have found a bug.

Licensing

Please see the full license documentation for details.

Comments
  • Ogre3d Compilation issues

    Ogre3d Compilation issues

    There is a bug encountered when compiling ogre3d 1.10 on visualstudio 2015(not sure if other visualstudio), my best guess is it's within the dendancies as they maybe directed for ogre 2.xx. I'd like to suggest we have a subrepo for dependancies with version tags, or the ogre team creates a tool for compiling ogre, something like an installer that uses cmake and visual studio. I think Noob's will love this. It would infact increase the userbase greatly. I.e, it should request a user for boost directory, then proceed to ask the user which version of ogre the user wants, and install the relevant and tested dependancies. Even a simple script will do. At the end of it all, the user should end up with an sdk dir containing ogre. This is the only problem with ogre. I'm an experienced c++ dev, and yet I can't get ogre to work.

  • NEON softwareVertexSkinning fails

    NEON softwareVertexSkinning fails

    System Information

    • Ogre Version: 1.12.1 (Master)
    • Operating System / Platform: IOS
    • RenderSystem: GLSLES2

    Detailled description

    The RTSS shader fail to compile when the object have a skeleton with a simple texture on IOS It result as a "broken" mesh split by all faces.

    Ogre.log

    Fri May 17 17:11:46 201 : Material scheme switch from ShaderGeneratorDefaultScheme to ShaderGeneratorDefaultScheme on material : Material_#25
    Material scheme switch from ShaderGeneratorDefaultScheme to ShaderGeneratorDefaultScheme on material : Material_#25
    
    Fri May 17 17:11:46 201 : Vertex Program:55cc4c55994686caee7ecb81e6ce6735_VS Fragment Program:4a08102476ab588eaadffaa8fb240f6d_FS
    GLSL link result : 
    WARNING: Could not find vertex shader attribute 'blendWeights' to match BindAttributeLocation request.
    WARNING: Could not find vertex shader attribute 'uv5' to match BindAttributeLocation request.
    WARNING: Could not find vertex shader attribute 'secondary_colour' to match BindAttributeLocation request.
    WARNING: Could not find vertex shader attribute 'uv1' to match BindAttributeLocation request.
    WARNING: Could not find vertex shader attribute 'uv4' to match BindAttributeLocation request.
    WARNING: Could not find vertex shader attribute 'blendIndices' to match BindAttributeLocation request.
    WARNING: Could not find vertex shader attribute 'uv6' to match BindAttributeLocation request.
    WARNING: Could not find vertex shader attribute 'uv2' to match BindAttributeLocation request.
    WARNING: Could not find vertex shader attribute 'colour' to match BindAttributeLocation request.
    WARNING: Could not find vertex shader attribute 'position' to match BindAttributeLocation request.
    WARNING: Could not find vertex shader attribute 'tangent' to match BindAttributeLocation request.
    WARNING: Could not find vertex shader attribute 'uv3' to match BindAttributeLocation request.
    WARNING: Could not find vertex shader attribute 'uv7' to match BindAttributeLocation request.
    WARNING: Could not find vertex shader attribute 'binormal' to match BindAttributeLocation request.
    Vertex Program:55cc4c55994686caee7ecb81e6ce6735_VS Fragment Program:4a08102476ab588eaadffaa8fb240f6d_FS
    GLSL link result : 
    WARNING: Could not find vertex shader attribute 'blendWeights' to match BindAttributeLocation request.
    WARNING: Could not find vertex shader attribute 'uv5' to match BindAttributeLocation request.
    WARNING: Could not find vertex shader attribute 'secondary_colour' to match BindAttributeLocation request.
    WARNING: Could not find vertex shader attribute 'uv1' to match BindAttributeLocation request.
    WARNING: Could not find vertex shader attribute 'uv4' to match BindAttributeLocation request.
    WARNING: Could not find vertex shader attribute 'blendIndices' to match BindAttributeLocation request.
    WARNING: Could not find vertex shader attribute 'uv6' to match BindAttributeLocation request.
    WARNING: Could not find vertex shader attribute 'uv2' to match BindAttributeLocation request.
    WARNING: Could not find vertex shader attribute 'colour' to match BindAttributeLocation request.
    WARNING: Could not find vertex shader attribute 'position' to match BindAttributeLocation request.
    WARNING: Could not find vertex shader attribute 'tangent' to match BindAttributeLocation request.
    WARNING: Could not find vertex shader attribute 'uv3' to match BindAttributeLocation request.
    WARNING: Could not find vertex shader attribute 'uv7' to match BindAttributeLocation request.
    WARNING: Could not find vertex shader attribute 'binormal' to match BindAttributeLocation request.
    

    -->

  • cf.load causing crashes when it get's to AdaptivePNTrianglesTessellation.material

    cf.load causing crashes when it get's to AdaptivePNTrianglesTessellation.material

    My resources_d.cfg is empy. when I comment out cf.load(resourcePath + "resources_d.cfg"); it works

    CODE

    #include <iostream>
    
    #include "Ogre.h"
    #include <OIS/OIS.h>
    
    #if OGRE_PLATFORM == OGRE_PLATFORM_APPLE || OGRE_PLATFORM == OGRE_PLATFORM_IPHONE
    #include <macUtils.h>
    #endif
    
    int main()
    {
    	std::string resourcePath;
    
    #if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
    	resourcePath = Ogre::macBundlePath() + "/Contents/Resources/";
    #else
    	resourcePath = "";
    #endif
    
    	Ogre::Root* root = new Ogre::Root(resourcePath + "plugins_d.cfg", resourcePath + "ogre_d.cfg", "Ogre.log");
    
    	if (!root->showConfigDialog())
    		return -1;
    
    	Ogre::ConfigFile cf;
    	cf.load(resourcePath + "resources_d.cfg");
    
    	// Go through all sections & settings in the file
    	Ogre::ConfigFile::SectionIterator seci = cf.getSectionIterator();
    
    	Ogre::String secName, typeName, archName;
    	while (seci.hasMoreElements())
    	{
    		secName = seci.peekNextKey();
    		Ogre::ConfigFile::SettingsMultiMap *settings = seci.getNext();
    		Ogre::ConfigFile::SettingsMultiMap::iterator i;
    		for (i = settings->begin(); i != settings->end(); ++i)
    		{
    			typeName = i->first;
    			archName = i->second;
    
    #if OGRE_PLATFORM == OGRE_PLATFORM_APPLE || OGRE_PLATFORM == OGRE_PLATFORM_IPHONE
    			if (!Ogre::StringUtil::startsWith(archName, "/", false)) // only adjust relative dirs
    				archName = Ogre::String(Ogre::macBundlePath() + "/" + archName);
    #endif
    
    			Ogre::ResourceGroupManager::getSingleton().addResourceLocation(archName, typeName, secName);
    		}
    	}
    
    	Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
    
    	Ogre::RenderWindow* window = root->initialise(true);
    	Ogre::SceneManager* smgr = root->createSceneManager(Ogre::ST_GENERIC);
    
    	//Input Stuff
    	size_t windowHnd = 0;
    	window->getCustomAttribute("WINDOW", &windowHnd);
    	OIS::InputManager* im = OIS::InputManager::createInputSystem(windowHnd);
    	OIS::Keyboard* keyboard = static_cast<OIS::Keyboard*>(im->createInputObject(OIS::OISKeyboard, true));
    
    	while (1)
    	{
    		Ogre::WindowEventUtilities::messagePump();
    
    		keyboard->capture();
    
    		if (keyboard->isKeyDown(OIS::KC_ESCAPE))
    			break;
    
    		if (root->renderOneFrame() == false)
    			break;
    	}
    
    	im->destroyInputObject(keyboard);
    	im->destroyInputSystem(im);
    	im = 0;
    
    	delete root;
    	return 0;
    }
    

    LOG

    Creating resource group General
    Creating resource group Internal
    Creating resource group Autodetect
    SceneManagerFactory for type 'DefaultSceneManager' registered.
    Registering ResourceManager for type Material
    Registering ResourceManager for type Mesh
    Registering ResourceManager for type Skeleton
    MovableObjectFactory for type 'ParticleSystem' registered.
    ArchiveFactory for archive type FileSystem registered.
    ArchiveFactory for archive type Zip registered.
    ArchiveFactory for archive type EmbeddedZip registered.
    DDS codec registering
    FreeImage version: 3.15.3
    This program uses FreeImage, a free, open source image library supporting all co
    mmon bitmap formats. See http://freeimage.sourceforge.net for details
    Supported formats: bmp,ico,jpg,jif,jpeg,jpe,jng,koa,iff,lbm,mng,pbm,pbm,pcd,pcx,
    pgm,pgm,png,ppm,ppm,ras,tga,targa,tif,tiff,wap,wbmp,wbm,psd,cut,xbm,xpm,gif,hdr,
    g3,sgi,exr,j2k,j2c,jp2,pfm,pct,pict,pic
    ETC codec registering
    Registering ResourceManager for type HighLevelGpuProgram
    Registering ResourceManager for type Compositor
    MovableObjectFactory for type 'Entity' registered.
    MovableObjectFactory for type 'Light' registered.
    MovableObjectFactory for type 'BillboardSet' registered.
    MovableObjectFactory for type 'ManualObject' registered.
    MovableObjectFactory for type 'BillboardChain' registered.
    MovableObjectFactory for type 'RibbonTrail' registered.
    Loading library .\RenderSystem_Direct3D9_d
    Installing plugin: D3D9 RenderSystem
    D3D9 : Direct3D9 Rendering Subsystem created.
    D3D9: Driver Detection Starts
    D3D9: Driver Detection Ends
    Plugin successfully installed
    Loading library .\RenderSystem_GL_d
    Installing plugin: GL RenderSystem
    OpenGL Rendering Subsystem created.
    Plugin successfully installed
    Loading library .\RenderSystem_GL3Plus_d
    Installing plugin: GL 3+ RenderSystem
    OpenGL 3+ Rendering Subsystem created.
    Plugin successfully installed
    Loading library .\Plugin_ParticleFX_d
    Installing plugin: ParticleFX
    Particle Emitter Type 'Point' registered
    Particle Emitter Type 'Box' registered
    Particle Emitter Type 'Ellipsoid' registered
    Particle Emitter Type 'Cylinder' registered
    Particle Emitter Type 'Ring' registered
    Particle Emitter Type 'HollowEllipsoid' registered
    Particle Affector Type 'LinearForce' registered
    Particle Affector Type 'ColourFader' registered
    Particle Affector Type 'ColourFader2' registered
    Particle Affector Type 'ColourImage' registered
    Particle Affector Type 'ColourInterpolator' registered
    Particle Affector Type 'Scaler' registered
    Particle Affector Type 'Rotator' registered
    Particle Affector Type 'DirectionRandomiser' registered
    Particle Affector Type 'DeflectorPlane' registered
    Plugin successfully installed
    Loading library .\Plugin_BSPSceneManager_d
    Installing plugin: BSP Scene Manager
    Plugin successfully installed
    Loading library .\Plugin_CgProgramManager_d
    Installing plugin: Cg Program Manager
    Plugin successfully installed
    Loading library .\Plugin_PCZSceneManager_d
    Installing plugin: Portal Connected Zone Scene Manager
    PCZone Factory Type 'ZoneType_Default' registered
    Plugin successfully installed
    Loading library .\Plugin_OctreeZone_d
    Installing plugin: Octree Zone Factory
    Plugin successfully installed
    Loading library .\Plugin_OctreeSceneManager_d
    Installing plugin: Octree Scene Manager
    Plugin successfully installed
    *-*-* OGRE Initialising
    *-*-* Version 1.10.7 (Xalafu)
    D3D9 : RenderSystem Option: Allow DirectX9Ex = No
    D3D9 : RenderSystem Option: Allow NVPerfHUD = No
    D3D9 : RenderSystem Option: Backbuffer Count = Auto
    D3D9 : RenderSystem Option: FSAA = 0
    D3D9 : RenderSystem Option: Fixed Pipeline Enabled = Yes
    D3D9 : RenderSystem Option: Floating-point mode = Fastest
    D3D9 : RenderSystem Option: Full Screen = Yes
    D3D9 : RenderSystem Option: Multi device memory hint = Use minimum system memory
    
    D3D9 : RenderSystem Option: Rendering Device = Monitor-1-Mobile Intel(R) 4 Serie
    s Express Chipset Family (Microsoft Corporation - WDDM 1.1)
    D3D9 : RenderSystem Option: Resource Creation Policy = Create on all devices
    D3D9 : RenderSystem Option: Use Multihead = Auto
    D3D9 : RenderSystem Option: VSync = No
    D3D9 : RenderSystem Option: VSync Interval = 1
    D3D9 : RenderSystem Option: Video Mode = 800 x 600 @ 32-bit colour
    D3D9 : RenderSystem Option: sRGB Gamma Conversion = No
    Creating resource group Essential
    Added resource location '../Media/thumbnails' of type 'FileSystem' to resource g
    roup 'Essential'
    Added resource location '../Media/packs/SdkTrays.zip' of type 'Zip' to resource
    group 'Essential'
    Added resource location '../Media/packs/profiler.zip' of type 'Zip' to resource
    group 'Essential'
    Added resource location '../Media' of type 'FileSystem' to resource group 'Gener
    al'
    Added resource location '../Media/fonts' of type 'FileSystem' to resource group
    'General'
    Added resource location '../Media/materials/programs' of type 'FileSystem' to re
    source group 'General'
    Added resource location '../Media/materials/scripts' of type 'FileSystem' to res
    ource group 'General'
    Added resource location '../Media/materials/textures' of type 'FileSystem' to re
    source group 'General'
    Added resource location '../Media/materials/textures/nvidia' of type 'FileSystem
    ' to resource group 'General'
    Added resource location '../Media/models' of type 'FileSystem' to resource group
     'General'
    Added resource location '../Media/particle' of type 'FileSystem' to resource gro
    up 'General'
    Added resource location '../Media/DeferredShadingMedia' of type 'FileSystem' to
    resource group 'General'
    Added resource location '../Media/DeferredShadingMedia/DeferredShading/post' of
    type 'FileSystem' to resource group 'General'
    Added resource location '../Media/PCZAppMedia' of type 'FileSystem' to resource
    group 'General'
    Added resource location '../Media/materials/scripts/SSAO' of type 'FileSystem' t
    o resource group 'General'
    Added resource location '../Media/materials/textures/SSAO' of type 'FileSystem'
    to resource group 'General'
    Added resource location '../Media/volumeTerrain' of type 'FileSystem' to resourc
    e group 'General'
    Added resource location '../Media/HLMS' of type 'FileSystem' to resource group '
    General'
    Added resource location '../Media/packs/cubemap.zip' of type 'Zip' to resource g
    roup 'General'
    Added resource location '../Media/packs/cubemapsJS.zip' of type 'Zip' to resourc
    e group 'General'
    Added resource location '../Media/packs/dragon.zip' of type 'Zip' to resource gr
    oup 'General'
    Added resource location '../Media/packs/fresneldemo.zip' of type 'Zip' to resour
    ce group 'General'
    Added resource location '../Media/packs/ogretestmap.zip' of type 'Zip' to resour
    ce group 'General'
    Added resource location '../Media/packs/ogredance.zip' of type 'Zip' to resource
     group 'General'
    Added resource location '../Media/packs/Sinbad.zip' of type 'Zip' to resource gr
    oup 'General'
    Added resource location '../Media/packs/skybox.zip' of type 'Zip' to resource gr
    oup 'General'
    Added resource location '../Media/volumeTerrain/volumeTerrainBig.zip' of type 'Z
    ip' to resource group 'General'
    Creating resource group Tests
    Added resource location '../Tests/Media' of type 'FileSystem' to resource group
    'Tests'
    Parsing scripts for resource group Autodetect
    Finished parsing scripts for resource group Autodetect
    Creating resources for group Autodetect
    All done
    Parsing scripts for resource group Essential
    Parsing script SdkTrays.material
    Parsing script OgreProfiler.material
    Finished parsing scripts for resource group Essential
    Creating resources for group Essential
    All done
    Parsing scripts for resource group General
    Parsing script DualQuaternion.program
    Parsing script Examples.program
    Parsing script Instancing.program
    Parsing script StdQuad_vp.program
    Parsing script deferred_post.program
    Parsing script ShadowCaster.program
    Parsing script GBuffer.program
    Parsing script AdaptivePNTrianglesTessellation.material
    Assertion failed: msSingleton, file E:\programming\ogre\ogre\OgreMain\src\OgreGp
    uProgramManager.cpp, line 44
    
  • Always include shadow casting lights in local list

    Always include shadow casting lights in local list

    Culling of shadow casting lights from SceneNode's local list cause mismatch with frame shadow texture list. This breaks a texture shadowing if there are at least two spotlights that casts shadows in the scene. Here is small fix for this.

  • Building fails on MacOS Mojave due to linker errors

    Building fails on MacOS Mojave due to linker errors

    System Information

    • Ogre Version: 1.11.2 stable (from source)
    • Operating System / Platform: macOS 10.14 (Mojave)
    • RenderSystem: OpenGL (looking at the linker error, at least)

    Detailled description

    I downloaded the latest source today, ran cmake -GXcode .. in a build subdirectory. Changing the architecture to x86_64, I built the project. Compiling apparently runs through, but I get linker errors afterwards.

    Below is the complete log of the linking errors.

    Ogre.log

    Ld build/lib/macosx/RelWithDebInfo/RenderSystem_GL.framework/Versions/1.11.2/RenderSystem_GL normal x86_64
        cd /Users/michael/Code/Game/ogre
        export MACOSX_DEPLOYMENT_TARGET=10.14
        /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch x86_64 -dynamiclib -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -L/Users/michael/Code/Game/ogre/build/lib/macosx/RelWithDebInfo -F/Users/michael/Code/Game/ogre/build/lib/macosx/RelWithDebInfo -filelist /Users/michael/Code/Game/ogre/build/RenderSystems/GL/OGRE.build/RelWithDebInfo/RenderSystem_GL.build/Objects-normal/x86_64/RenderSystem_GL.LinkFileList -install_name @executable_path/../Frameworks/RenderSystem_GL.framework/Versions/1.11.2/RenderSystem_GL -Xlinker -rpath -Xlinker /Users/michael/Code/Game/ogre/build/sdk/lib -mmacosx-version-min=10.14 -Xlinker -object_path_lto -Xlinker /Users/michael/Code/Game/ogre/build/RenderSystems/GL/OGRE.build/RelWithDebInfo/RenderSystem_GL.build/Objects-normal/x86_64/RenderSystem_GL_lto.o -stdlib=libc++ -framework Cocoa -framework Carbon -framework OpenGL -framework AGL /Users/michael/Code/Game/ogre/build/lib/macosx/RelWithDebInfo/libOgreGLSupport.a -framework OpenGL /Users/michael/Code/Game/ogre/build/lib/macosx/RelWithDebInfo/Ogre.framework/Versions/1.11.2/Ogre -current_version 1.11.2 -Xlinker -dependency_info -Xlinker /Users/michael/Code/Game/ogre/build/RenderSystems/GL/OGRE.build/RelWithDebInfo/RenderSystem_GL.build/Objects-normal/x86_64/RenderSystem_GL_dependency_info.dat -o /Users/michael/Code/Game/ogre/build/lib/macosx/RelWithDebInfo/RenderSystem_GL.framework/Versions/1.11.2/RenderSystem_GL
    Undefined symbols for architecture x86_64:
      "Ogre::GpuProgram::setSyntaxCode(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
    
      NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
    ld: symbol(s) not found for architecture x86_64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    Showing first 200 notices only
    Showing first 200 errors only
    
    ** BUILD FAILED **
    
    
    The following build commands failed:
    	Ld build/lib/macosx/RelWithDebInfo/RenderSystem_GL.framework/Versions/1.11.2/RenderSystem_GL normal x86_64
    (1 failure)
    
  • [OGRE-102] Bump Mapping sample has flickering shadows when you move the camera (OpenGL)

    [OGRE-102] Bump Mapping sample has flickering shadows when you move the camera (OpenGL)

    [reporter="thesheeep", created="Mon, 10 Dec 2012 09:33:59 +0100"]

    I only noticed this with the Bump Mapping sample, other shadow samples work correctly. Also, this only happens with OpenGL.

  • Android crash on library initialisation

    Android crash on library initialisation

    System Information

    • Ogre Version: 1.11
    • Operating System / Platform: Android
    • RenderSystem: GLSLES2

    Detailled description

    I use NDK r15c GCC 4.9 When the library containing Ogre is loaded, it crash on memory allocation. Debugger pass through: Light PerPixelLighting::msBlankLight; in OgreShaderExPerPixelLighting.cpp MovableObject::MovableObject() : MovableObject(BLANKSTRING) {} in OgreMovableObject.cpp template class AllocatedObject {}; and crash in basic_string.tcc

    template<typename _CharT, typename _Traits, typename _Alloc>
        basic_string<_CharT, _Traits, _Alloc>::
        basic_string(const basic_string& __str)
        : _M_dataplus(__str._M_rep()->_M_grab(_Alloc(__str.get_allocator()),
    					  __str.get_allocator()),
    		  __str.get_allocator())
        { }
    

    Maybe it's related to the OgreMemoryAllocatorConfig.h changes ? I have no idea where to look at ^^

    Log

    04-17 14:04:04.813 11326 11425 F libc    : Fatal signal 11 (SIGSEGV), code 1, fault addr 0xfffffffc in tid 11425 (Thread-3)
    
  • Fixes issue preventing use of latest emscripten versions

    Fixes issue preventing use of latest emscripten versions

    fixes #1697 fixes #1686 fixes #1289 These changes enable the use the latest versions of emscripten. Latest version of emscripten has several fixes including handling of fullscreen see changelog not to mention it now uses LLVM backend.emscripten-llvm-wasm which has several benefits.

  • GL3+ Texture upload is on slow path

    GL3+ Texture upload is on slow path

    System Information

    • Ogre Version: Ogre 1 master (Tested on 1.12.1)
    • Operating System / Platform: Windows 10, NVidia
    • RenderSystem: GL3Plus

    Detailled description

    GL3PlusRS glTexStorage texture upload codepath is in "driver slow path" at the moment. This could be a possible NVidia driver bug, since I found no limitation in GL spec which would explain this behaviour. Please note, that I only tested this on Nvidia HW since I dont own any AMD, or Intel GPU-s, on those this codepath could be fine.

    I made a simple test case, upload a 4k*4k texture and measure the upload time. With pure GL it took 17ms, with OGRE it took 54ms. (The OGRE Texture upload stack was on fast path, so no resizes npot or anything like that) So I investigated, VS Profiler said most of the work was done inside glTexSubImage2D(), but glTexSubImage2D() had the correct fast path GL parameters, which I also used in my test code. This proved that some texture creation parameters might cause slowdowns (driver slow path), since the texture upload in my code was fine with default texParams.

    It turned out that specifying glTexParameteri -s before creating the backing GPU pixel buffer can be problematic in some limited cases. So commenting out them one by one, I found out that GL_TEXTURE_WRAP_* parameters will cause driver slow path IF not on GL default vaule. But this happens only if you specify the parameters first and then create the texture storage.

    So this is fast : GlTexStorage2D(GL_TEXTURE_2D, 1, GL_RGBA8, image.getWidth(), image.getHeight()); gl->setTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); gl->setTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); gl->setTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE);

    This is not : gl->setTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); gl->setTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); gl->setTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE); GlTexStorage2D(GL_TEXTURE_2D, 1, GL_RGBA8, image.getWidth(), image.getHeight());

    Possible solutions :

    • In OgreGL3PlusTexture.cpp around line 130 set the texture parameter to the correct default one GL_REPEAT.

    mRenderSystem->_getStateCacheManager()->setTexParameteri(texTarget, GL_TEXTURE_WRAP_S, GL_REPEAT); mRenderSystem->_getStateCacheManager()->setTexParameteri(texTarget, GL_TEXTURE_WRAP_T, GL_REPEAT); mRenderSystem->_getStateCacheManager()->setTexParameteri(texTarget, GL_TEXTURE_WRAP_R, GL_REPEAT);

    I used this as a quick fix, this will set us on driver fast path.

    • A slightly bigger but maybe better fix would be to set the texture params after creating the texture store. Not sure if it is 100% correct by spec, but this would avoid driver bugs like this in the future. So :

    GlHandle texture; GlGenTextures(1, &texture); gl->bindGLTexture(GL_TEXTURE_2D, texture); GlTexStorage2D(GL_TEXTURE_2D, 1, GL_RGBA8, image.getWidth(), image.getHeight());

    //Specify TexParami-s here

    //Upload texture later

  • OgreTextAreaOverlayElement CPU hog

    OgreTextAreaOverlayElement CPU hog

    System Information

    • Ogre Version: 1.11.5
    • Operating System / Platform: Win10
    • RenderSystem: GL3Plus

    Detailed description

    Frequently updated TextAreaOverlayElement-s (like a simple fps counter) will generate unacceptable amount of CPU usage in the buffer locking methods (updatePositionGeometry, updateColours). This happens probably because of CPU-GPU synchronization, as TextAreaOverlayElement will use glMapBuffer, when using GL3Plus rendersystem.

    In this case (and on single thread probably never) should OGRE use glMapBuffer, glBufferData is much faster with buffer orphaning. Experimented with the code a bit, and could not find a fast path when glMapBuffer was used.

    My "final" solution to avoid using glMapBuffer was using a shadow buffer, at buffer creation. This put me on the glBufferData path (writeData()).

    So to "fix" the CPU hog change the buffer creation code to this (changes in bold) :

        HardwareVertexBufferSharedPtr vbuf = 
            HardwareBufferManager::getSingleton().
                createVertexBuffer(
                    decl->getVertexSize(POS_TEX_BINDING), 
                    allocatedVertexCount,
                    **HardwareBuffer::HBU_DYNAMIC_WRITE_ONLY_DISCARDABLE, true**);
        bind->setBinding(POS_TEX_BINDING, vbuf);
    
        // colours
        vbuf = HardwareBufferManager::getSingleton().
                createVertexBuffer(
                    decl->getVertexSize(COLOUR_BINDING), 
                    allocatedVertexCount,
                    **HardwareBuffer::HBU_DYNAMIC_WRITE_ONLY_DISCARDABLE, true**);
        bind->setBinding(COLOUR_BINDING, vbuf);
    

    An alternative solution without shadow buffer, would be to use a std::vector to assembe geomerty and color data at update, and use the writeData() method instead of lock()/unlock().

  • thread pool creation fails

    thread pool creation fails

    System Information

    • Ogre Version: 1.11 (git commit efdf71fbeb1eaa7a6604b9b545e1f3992efab1e4 )
    • Operating System / Platform: windows 7
    • RenderSystem: webgl (emscripten)

    Detailled description

    Building ogre for emscripten target is good, but encountering exception error in samplebrowser example is no go :+1: ogre3webbug

    I'm testing this with chromium nightly build on windows 7.

    Ogre.log

    
    Creating resource group General
    Creating resource group Internal
    Creating resource group Autodetect
    SceneManagerFactory for type 'DefaultSceneManager' registered.
    Registering ResourceManager for type Material
    Registering ResourceManager for type Mesh
    Registering ResourceManager for type Skeleton
    MovableObjectFactory for type 'ParticleSystem' registered.
    ArchiveFactory for archive type FileSystem registered.
    ArchiveFactory for archive type Zip registered.
    ArchiveFactory for archive type EmbeddedZip registered.
    DDS codec registering
    PVRTC codec registering
    ETC codec registering
    Registering ResourceManager for type HighLevelGpuProgram
    Registering ResourceManager for type Compositor
    MovableObjectFactory for type 'Entity' registered.
    MovableObjectFactory for type 'Light' registered.
    MovableObjectFactory for type 'BillboardSet' registered.
    MovableObjectFactory for type 'ManualObject' registered.
    MovableObjectFactory for type 'BillboardChain' registered.
    MovableObjectFactory for type 'RibbonTrail' registered.
    *-*-* OGRE Initialising
    *-*-* Version 1.11.0dev (Rhagorthua)
    Installing plugin: OpenGL ES 2.0 RenderSystem
    OpenGL ES 2.x Rendering Subsystem created.
    Plugin successfully installed
    Installing plugin: Octree Scene Manager
    Plugin successfully installed
    Installing plugin: ParticleFX
    Particle Emitter Type 'Point' registered
    Particle Emitter Type 'Box' registered
    Particle Emitter Type 'Ellipsoid' registered
    Particle Emitter Type 'Cylinder' registered
    Particle Emitter Type 'Ring' registered
    Particle Emitter Type 'HollowEllipsoid' registered
    Particle Affector Type 'LinearForce' registered
    Particle Affector Type 'ColourFader' registered
    Particle Affector Type 'ColourFader2' registered
    Particle Affector Type 'ColourImage' registered
    Particle Affector Type 'ColourInterpolator' registered
    Particle Affector Type 'Scaler' registered
    Particle Affector Type 'Rotator' registered
    Particle Affector Type 'DirectionRandomiser' registered
    Particle Affector Type 'DeflectorPlane' registered
    Plugin successfully installed
    Installing plugin: STB Image Codec
    stb_image - v2.19 - public domain JPEG/PNG reader
    Supported formats: jpeg,jpg,png,bmp,psd,tga,gif,pic,ppm,pgm,hdr
    Plugin successfully installed
    OverlayElementFactory for type Panel registered.
    OverlayElementFactory for type BorderPanel registered.
    OverlayElementFactory for type TextArea registered.
    Registering ResourceManager for type Font
    CPU Identifier & Features
    -------------------------
     *   CPU ID: Unknown
    -------------------------
    ******************************
    *** Starting EGL Subsystem ***
    ******************************
    EGL_VERSION = 1.4 Emscripten EGL
    EGL_EXTENSIONS = 
    Registering ResourceManager for type Texture
    GLES2RenderSystem::_createRenderWindow "OGRE Emscripten Sample", 800x600 windowed  miscParams: FSAA= currentGLContext=true gamma= vsync=Yes 
    GL_VERSION = 2.0.0.0
    GL_VENDOR = WebKit
    GL_RENDERER = WebKit WebGL
    GL_EXTENSIONS = GL_ANGLE_instanced_arrays GL_EXT_blend_minmax GL_EXT_color_buffer_half_float GL_EXT_frag_depth GL_EXT_shader_texture_lod GL_EXT_texture_filter_anisotropic GL_WEBKIT_EXT_texture_filter_anisotropic GL_EXT_sRGB GL_OES_element_index_uint GL_OES_standard_derivatives GL_OES_texture_float GL_OES_texture_float_linear GL_OES_texture_half_float GL_OES_texture_half_float_linear GL_OES_vertex_array_object WEBGL_color_buffer_float WEBGL_compressed_texture_s3tc GL_WEBKIT_WEBGL_compressed_texture_s3tc WEBGL_compressed_texture_s3tc_srgb WEBGL_debug_renderer_info WEBGL_debug_shaders WEBGL_depth_texture GL_WEBKIT_WEBGL_depth_texture WEBGL_draw_buffers WEBGL_lose_context GL_WEBKIT_WEBGL_lose_context 
    **************************************
    *** OpenGL ES 2.x Renderer Started ***
    **************************************
    Shading language version: OpenGL ES GLSL ES 1.00 (WebGL GLSL ES 1.0 (OpenGL ES GLSL ES 1.0 Chromium))
    Registering ResourceManager for type GpuProgram
    GL ES 2: Using FBOs for rendering to textures
    [GLES2] : detectFBOFormats is disabled on this platform (due performance reasons)
    [GLES2] : Valid FBO targets PF_A8B8G8R8 
    RenderSystem capabilities
    -------------------------
    RenderSystem Name: OpenGL ES 2.x Rendering Subsystem
    GPU Vendor: webkit
    Device Name: WebKit WebGL
    Driver Version: 2.0.0.0
     * Fixed function pipeline: no
     * Anisotropic texture filtering: yes
     * Cube mapping: yes
     * Hardware stencil buffer: yes
       - Stencil depth: 8
       - Two sided stencil support: yes
       - Wrap stencil values: yes
     * 32-bit index buffers: yes
     * Vertex programs: yes
     * Number of floating-point constants for vertex programs: 4096
     * Number of integer constants for vertex programs: 4096
     * Number of boolean constants for vertex programs: 4096
     * Fragment programs: yes
     * Number of floating-point constants for fragment programs: 1024
     * Number of integer constants for fragment programs: 1024
     * Number of boolean constants for fragment programs: 1024
     * Geometry programs: no
     * Number of floating-point constants for geometry programs: 0
     * Number of integer constants for geometry programs: 34644
     * Number of boolean constants for geometry programs: 6
     * Tessellation Hull programs: no
     * Number of floating-point constants for tessellation hull programs: 0
     * Number of integer constants for tessellation hull programs: 0
     * Number of boolean constants for tessellation hull programs: 0
     * Tessellation Domain programs: no
     * Number of floating-point constants for tessellation domain programs: 0
     * Number of integer constants for tessellation domain programs: 0
     * Number of boolean constants for tessellation domain programs: 0
     * Compute programs: no
     * Number of floating-point constants for compute programs: 0
     * Number of integer constants for compute programs: 0
     * Number of boolean constants for compute programs: 0
     * Supported Shader Profiles: glsles
     * Texture Compression: yes
       - DXT: yes
       - VTC: no
       - PVRTC: no
       - ATC: no
       - ETC1: no
       - ETC2: no
       - BC4/BC5: no
       - BC6H/BC7: no
       - ASTC: no
       - Mipmaps for compressed formats: no
     * Hardware Occlusion Query: no
     * User clip planes: no
     * VET_UBYTE4 vertex element type: yes
     * Infinite far plane projection: yes
     * Hardware render-to-texture: yes
     * Floating point textures: yes
     * Non-power-of-two textures: no
     * 1d textures: yes
     * Volume textures: no
     * Multiple Render Targets: 1
       - With different bit depths: no
     * Point Sprites: yes
     * Hardware Gamma: no
     * Extended point parameters: yes
     * Max Point Size: 0
     * Vertex texture fetch: no
     * Number of texture units: 16
     * Number of vertex attributes: 16
     * Stencil buffer depth: 8
     * Number of vertex blend matrices: 0
     * Render to Vertex Buffer : no
     * Hardware Atomic Counters: no 
     * PBuffer support: no
     * Vertex Array Objects: yes
     * Separate shader objects: no
     * GLSL SSO redeclare interface block: no
     * Debugging/ profiling events: no
     * Map buffer storage: no
    DefaultWorkQueue('Root') initialising on thread 106424.
    
    thrown exception here from chromium canary build 
    bad name in getProcAddress: glActiveShaderProgramEXT,glActiveShaderProgram 
    printErr  @ EmscriptenSample.html:1249
    

    -->

  • Refactor WorkQueue to be leightweight

    Refactor WorkQueue to be leightweight

    it should only dispatch tasks.

    Not all tasks need a response queue and the corresponding overhead. Tasks that need it, can register to the frameEnded event to process any new messages instead of handleResponse.

    Drop all non-STD threading implementations (deprecated since 1.11) while at it.

    References:

    • https://forums.ogre3d.org/viewtopic.php?t=96708
    • #1336
  • Pointer issue

    Pointer issue

    I kind of don’t know where I should address it but there are a few changes to this engine since 2007 my project is old and linked to an older version of Axiom. I wanted to get my client upgraded to DirectX11. I been looking for a change log to see how to address my internal errors making calls to obsolete functions. BUT that is one of the smaller issues. Okay, I have the current Git cpp version of Ogre which I build my C# exports and then I added some function to the library source and recompile it to a new library. I made headwind into the old multiverse files until I needed to access the buffer.

    The library Image.cs needs to create a buffer. I pass it as byte[] * but the Image Error CS1503 Argument 1: cannot convert from 'byte[]' to 'org.ogre.SWIGTYPE_p_unsigned_char'

    Ok so that is easy fix??

    SWIGTYPE_p_unsigned_char sucks;

    image.loadDynamicImage(sucks, (uint)pageSize, (uint)pageSize, PixelFormat.PF_A8);

    Error CS1503 Argument 1: cannot convert from 'byte[]' to 'org.ogre.SWIGTYPE_p_unsigned_char'

    Okay so of course suck = new SWIGTYPE_p_unsigned_char();

    Error CS0122 'SWIGTYPE_p_unsigned_char.SWIGTYPE_p_unsigned_char()' is inaccessible due to its protection level.

    If you get the Type of SWIGTYPE_p_unsignedchar_chr it does come back as byte[] and not a pointer to byte[]

    I kind of don’t know swig that much. I’m trying to decide if it’s in the Swig compile files or if it is addressable inside the cs source. Actually I am a little concerned on how much the conversion is going to hamstring Ogre output to the frame buffer. Almost tempted to rip that out and use the old library and make using statements to point to that section.

    Anyway, I thought it may be a issue addressable on your end.

  • Wayland Support

    Wayland Support

    When building OGRE with the flag -DOGRE_GLSUPPORT_USE_EGL=1 to attempt to get it to run natively on Wayland, the sample applications still call on functions that require GLX or expect an X11 display socket and attempt to connect to that instead.

    There was some discussion on your forums here (https://forums.ogre3d.org/viewtopic.php?t=96208) where others also attempted this, but from what I could see it never got resolved.

    The application I'm trying to build is RViz, which uses the OGRE engine, and my aim is to have it work natively with the Weston Wayland compositor. Windows' WSL uses Weston internally for graphical Linux applications, and there's footage here (https://devblogs.microsoft.com/commandline/the-initial-preview-of-gui-app-support-is-now-available-for-the-windows-subsystem-for-linux-2/) of RViz running on Weston in WSL. However, I'm not familiar with how WSL works internally and whether they in fact use XWayland for compatibility.

    Does there exist an option in OGRE to disable the X11/GLX components and have it use EGL/Wayland exclusively, or would that require significant refactoring to achieve?

  • Consolidate transform feedback on GL*

    Consolidate transform feedback on GL*

    Currently all RenderSystems differ in the output specification.

    GL3+ requires using specific names like oPos. GL uses gl_Position and GLES2 mixes these two. The GL3+ approach should be preferred as it allows custom types like vec2 oPos and is compatible with GL.

    However, the used naming scheme is bad. We should use something descriptive like xfb_position. The xfb prefix follows GL_ARB_enhanced_layouts.

    If, implemented document it here: https://ogrecave.github.io/ogre/api/latest/_high-level-_programs.html#Binding-vertex-attributes

An OpenGL 4.3 / C++ 11 rendering engine oriented towards animation
An OpenGL 4.3 / C++ 11 rendering engine oriented towards animation

aer-engine About An OpenGL 4.3 / C++ 11 rendering engine oriented towards animation. Features: Custom animation model format, SKMA, with a Blender exp

Jul 25, 2021
A Vulkan game engine with a focus on data oriented design
A Vulkan game engine with a focus on data oriented design

The Fling Engine aims to be a cross platform Vulkan game engine that will experiment with the following: Low-level engine systems such as render API a

Jun 8, 2022
A faster drop-in replacement for giflib. It uses more RAM, but you get more speed.

GIFLIB-Turbo What is it? A faster drop-in replacement for GIFLIB Why did you write it? Starting in the late 80's, I was fascinated with computer graph

Jun 9, 2022
DxWrapper is a .dll file designed to wrap DirectX files to fix compatibility issues in older games

DxWrapper Introduction DxWrapper is a .dll file designed to wrap DirectX files to fix compatibility issues in older games. This project is primarily t

Jun 21, 2022
This is a list of different open-source video games and commercial video games open-source remakes.

This is a list of different open-source video games and commercial video games open-source remakes.

Jun 20, 2022
The flexible game engine.
The flexible game engine.

The flexible game engine. Crown is a general purpose and data-driven game engine, written in orthodox C++ with a minimalistic and data-oriented design

Jun 17, 2022
CLUSEK-RT is a complex game engine written in C++ and the successor of the CLUSEK game engine
CLUSEK-RT is a complex game engine written in C++ and the successor of the CLUSEK game engine

CLUSEK-RT is a complex game engine written in C++ and the successor of the CLUSEK game engine. This engine has been designed with a cross-platform design in mind. Thanks to Vulkan API it delivers a next-gen experience with ray tracing to both Linux and Windows platforms

Jun 12, 2022
Ground Engine is an easy to use Game Engine for 3D Game Development written in C++
Ground Engine is an easy to use Game Engine for 3D Game Development written in C++

Ground Engine is an easy to use Game Engine Framework for 3D Game Development written in C++. It's currently under development and its creation will b

Jun 10, 2022
Hyperion Engine is a 3D game engine written in C++
Hyperion Engine is a 3D game engine written in C++

Hyperion Engine About Hyperion Engine is a 3D game engine written in C++. We aim to make Hyperion be easy to understand and use, while still enabling

Jun 18, 2022
Game engine behind Sea Dogs, Pirates of the Caribbean and Age of Pirates games.
Game engine behind Sea Dogs, Pirates of the Caribbean and Age of Pirates games.

Game engine behind Sea Dogs, Pirates of the Caribbean and Age of Pirates games.

Jun 17, 2022
Project DELTA - An open-source trainer built on the Void Engine for Toby Fox's games and their spin-offs.

Project DELTA v3 Project DELTA - An open-source, modular mod menu for Toby Fox's games and their spin-offs. Important note to Grossley: Yes, it is out

Apr 20, 2022
An Unreal Engine 4 silent aim method, not usable on all games. Tested on Fortnite, Rogue Company, Bloodhunt, and Splitgate.

UE4-Silent-Aim An Unreal Engine 4 silent aim method, not usable on all games. Only tested on Fortnite, Rogue Company, Bloodhunt, and Splitgate. Done t

May 31, 2022
This is netvars, interfaces and class ids dump from Valve's Source2 Engine games

About this This is netvars, interfaces and class ids dump from Valve's Source2 Engine games: Artifact Classic Artifact Foundry Dota 2 Dota Underlords

May 24, 2022
Open-source, cross-platform, C++ game engine for creating 2D/3D games.

GamePlay v3.0.0 GamePlay is an open-source, cross-platform, C++ game framework/engine for creating 2D/3D mobile and desktop games. Website Wiki API De

Jun 17, 2022
Bounce is a 3D physics engine for games.

Bounce Welcome! Bounce is a 3D physics engine for games. Features Common Efficient data structures with no use of STL Fast memory allocators Built-in

Jun 5, 2022
Speedrun plugin for Source engine games.

Features Automatic demo recording Accurate session timing Speedrun timer with complex custom rule system Tools for segmented and tool-assisted speedru

Jun 19, 2022
TrenchBroom is a modern cross-platform level editor for Quake-engine based games.
TrenchBroom is a modern cross-platform level editor for Quake-engine based games.

TrenchBroom is a modern cross-platform level editor for Quake-engine based games.

Jun 21, 2022
Engine being created for homeworks in UPC Master's Degree in Advanced Programming for AAA Video Games.
Engine being created for homeworks in UPC Master's Degree in Advanced Programming for AAA Video Games.

Strawhat Engine Strawhat Engine is a game engine under construction that has model loading and camera movement features along with an editor. Reposito

May 18, 2022
Box2D is a 2D physics engine for games

Build Status Box2D Box2D is a 2D physics engine for games. Contributing Please do not submit pull requests with new features or core library changes.

Jun 20, 2022