Hello! I'm new to the Godot community and I hope this is the right place to ask questions like this and get feedback.

We're interested in using Godot's render engine as a library :)

Some background: we develop and maintain open source robotics simulators (gazebo, ignition) that currently use Ogre3d as the underlying render engine. However, there is growing interest in using an alternative rendering engine. We understand that Godot is a full game engine (and not a rendering engine / library) but after evaluating various open source rendering / game engines out there, we decided that we may devote some effort to investigate and come up with a minimal prototype of using Godot's renderer as a standalone C++ library that allows us to do things from initializing the rendering engine, to creating scenes, objects, lights, and importing assets.

I've found some related posts that suggest it's currently not supported out of the box: https://godotengine.org/qa/53477/using-the-rendering-engine-alone https://www.reddit.com/r/godot/comments/ch9aud/using_godot_as_a_c_library/

I think GDNative APIs may not be able to do what we want to achieve (launching the rendering engine, etc all without using the editor)? We also understand that Godot is probably not intended to be use this way and there are frequent changes in internal APIs. So we would like to get some feedback on our plan before we dive deep into this.

The first step in our plan is to either tweak the SCons scripts or create separate build scripts to build and package all source files and shaders used by Godot' renderer as a shared library with APIs that allows us to do things mentioned above all without using the editor.

  • Is this a crazy idea? i.e. we really should not be doing this
  • Are you aware of any similar efforts?
  • Assuming everything goes well, are build changes like this welcome upstream in Godot?

Thanks for reading this long post. Feedback and suggestions appreciated!

    You can use godot engine as a C/C++ only engine without the editor just fine afaik, though I haven't done so myself. However afaik, no you can't - as is - use the godot renderer as a library. You could however fork godot and integrate your own tech into it and remove any 'bloat' you don't need making your own effective engine out of it.

    Would it be worth the effort? I don't know. You'll have to figure that out yourself. But I do expect the technical dept to be pretty high.

    Whats wrong with OGRE though? And have you considered URHO3D?

    Is this a crazy idea? i.e. we really should not be doing this

    Not a crazy idea per say, but it might be difficult. Godot wasn't really designed to be used as a standalone rendering library, so there may be difficulties in getting it working as one. As @Megalomaniak said, you can use it without the editor and as a platform, however it does not really expose a rendering API or anything.

    Are you aware of any similar efforts?

    The question of using Godot as a library comes up every so often, but I don't know if there is already any movement towards modifying Godot so it can act as a library. I would suggest searching something like "Godot as a rendering library" in a search engine, if you have not already, and see if that brings up any results of similar efforts.

    Assuming everything goes well, are build changes like this welcome upstream in Godot?

    While I cannot say for sure, and I am by no means a core Godot developer, I think it would be unlikely that such changes would be merged into Godot. That's not to say it is impossible or unwelcome, I just think it may not be merged because of the additional complexity it could bring and because Godot is intended to be used as a game engine, not a rendering library, I'm not sure the cost of the complexity would be deemed to be worth it. That said, that is just what I think would happen, not necessarily what would. If you want to know more definitively, I would ask on the devel channel on the IRC.


    Also, some interesting, low-level rendering APIs, if you want to go down that route:

    Both are mainly just for making graphics programming easier and cross platform, but they might be interesting to look at. I've been meaning to try a project with either, but I haven't had the time and motivation to get one going just yet.

    @Megalomaniak

    However afaik, no you can't - as is - use the godot renderer as a library That's what we suspected after looking at GDNative and also reading this article about Godot's renderer design.

    Whats wrong with OGRE though? And have you considered URHO3D? We're happy when we moved from OGRE 1.9 to OGRE 2.1 that comes with better performance and modern rendering techniques. However, the development activity has slowed down in recent years (which is unfortunately the case for many of the open source rendering engines out there that we have looked at). Having said that, we will continue to support OGRE in our tool but also let users choose an alternative rendering engine once we have that ready. We are attracted to Godot for its active community and development of new features. We also evaluated URHO3D but decided to try Godot for the same reason.

    @TwistedTwigleg

    I would suggest searching something like "Godot as a rendering library" in a search engine Yeah I found a couple of related posts (e.g. the ones in my original post) but the answers have not been promising. I was hoping to see if things have changed or if there are any insights as to whether or not this is something being considered in Godot's roadmap. But from the sound of things, it's still the same as before.

    I think it would be unlikely that such changes would be merged into Godot. One concern for us is the long term maintenance effort. If we find that the changes required to build Godot as a library is too invasive and these changes are not likely going to make it upstream, we may have to reevaluate our plan. It all depends on what we find in the next few weeks I guess.

    Also, some interesting, low-level rendering APIs, Thanks! I'll take a look at these two projects.

    2 years later

    iche033 How is it going? I just came a cross this post as im interested in using the godot renderer standalone too...

    The Godot servers are a library. Just link to it. The Godot editor is an application that uses that library.

    There's the godot-cpp package that includes all the headers from the directory tree into a single godot.hpp. I think there is also a godot-headers package, without the code. For if you do gdextensions with the library that came with the version of Godot you're using.

    Just be careful not to mix up versions.

    I've looked at the code for the headers and the godot-cpp, but it looks like it's for adding things to the engine, not the other way around.

    Though the whole source code is open, so there should be a way to not use the editor, but it may be some work to customize it to only use the renderer.

    It's here though, if you want to take a look: https://github.com/godotengine/godot-cpp

    This is what SEGA did on Sonic Colors Ultimate, they had their own engine and swapped out the renderer for Godot. But I'm not sure where to start on that.

    The main(sic) difference between a thing for the engine and a stand-alone program is a missing main function. And maybe some documentation, how to initialize everything and such.

    But it is probably easier and quicker to write one's own framework than to wrap the mind around someone else's work :-) At least on that level.

    Well yes, in terms of loading the engine yeah. But there seems to be things that would need (or would be easier) to do in the editor, like importing assets, setting up materials (and saving them in the right format), etc.

    My opinion when working with Godot, too. Just tried to answer the q :-)

    To be honest, the Godot renderer is not even that great or modern (Godot 4.0 will be, but it's far from finished). The main reason Godot is any good is the editor and work flow.

    If you just need a graphics API abstraction, you might want to try bgfx: https://github.com/bkaradzic/bgfx